local U=require(script.Parent.Maid)local A=require(script.Parent.Signal)local o=require(script.Parent.Promise)local K=require(script.Parent.Thread)local B=require(script.Parent.TableUtil)local x=game:GetService("\067\111\108\108\101\099\116\105\111\110\083\101\114\118\105\099\101")local S=game:GetService("\082\117\110\083\101\114\118\105\099\101")local Q=game:GetService("\080\108\097\121\101\114\115")local s=S:IsServer()local G=60 local Y="\067\111\109\112\111\110\101\110\116\083\101\114\118\101\114\073\100"
--[[

	Component.Auto(folder)
		-> Create components automatically from descendant modules of this folder
		-> Each module must have a '.Tag' string property
		-> Each module optionally can have '.RenderPriority' number property

	component = Component.FromTag(tag)
		-> Retrieves an existing component from the tag name

	component = Component.new(tag, class [, renderPriority])
		-> Creates a new component from the tag name, class module, and optional render priority

	component:GetAll()
	component:GetFromInstance(instance)
	component:GetFromID(id)
	component:Filter(filterFunc)
	component:WaitFor(instanceOrName)
	component:Destroy()

	component.Added(obj)
	component.Removed(obj)

	-----------------------------------------------------------------------

	A component class must look something like this:

		-- DEFINE
		local MyComponent = {}
		MyComponent.__index = MyComponent

		-- CONSTRUCTOR
		function MyComponent.new(instance)
			local self = setmetatable({}, MyComponent)
			return self
		end

		-- FIELDS AFTER CONSTRUCTOR COMPLETES
		MyComponent.Instance: Instance

		-- OPTIONAL LIFECYCLE HOOKS
		function MyComponent:Init() end                     -> Called right after constructor
		function MyComponent:Deinit() end                   -> Called right before deconstructor
		function MyComponent:HeartbeatUpdate(dt) ... end    -> Updates every heartbeat
		function MyComponent:SteppedUpdate(dt) ... end      -> Updates every physics step
		function MyComponent:RenderUpdate(dt) ... end       -> Updates every render step

		-- DESTRUCTOR
		function MyComponent:Destroy()
		end


	A component is then registered like so:
		
		local Component = require(Knit.Util.Component)
		local MyComponent = require(somewhere.MyComponent)
		local tag = "MyComponent"

		local myComponent = Component.new(tag, MyComponent)


	Components can be listened and queried:

		myComponent.Added:Connect(function(instanceOfComponent)
			-- New MyComponent constructed
		end)

		myComponent.Removed:Connect(function(instanceOfComponent)
			-- New MyComponent deconstructed
		end)

--]]

local Maid = require(script.Parent.Maid)
local Signal = require(script.Parent.Signal)
local Promise = require(script.Parent.Promise)
local Thread = require(script.Parent.Thread)
local TableUtil = require(script.Parent.TableUtil)
local CollectionService = game:GetService("CollectionService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")

local IS_SERVER = RunService:IsServer()
local DEFAULT_WAIT_FOR_TIMEOUT = 60
local ATTRIBUTE_ID_NAME = "ComponentServerId"
