-- Compiled with roblox-ts v3.0.0 local TS = _G[script] local Reflect = TS.import(script, TS.getModule(script, "@flamework", "core").out).Reflect local _services = TS.import(script, TS.getModule(script, "@rbxts", "services")) local HttpService = _services.HttpService local RunService = _services.RunService local consolePrefix = `SharedComponets` local errorString = `--// [{consolePrefix}]: Caught an error in your code //--` local warnString = `--// [{consolePrefix}] //--` local IsServer = RunService:IsServer() local IsClient = RunService:IsClient() local function logError(message, displayTraceback) if displayTraceback == nil then displayTraceback = true end local _condition = message if _condition == nil then _condition = "" end return error(`\n {errorString} \n {_condition} \n \n {displayTraceback and debug.traceback()}`) end local function logWarning(message, displayTraceback) if displayTraceback == nil then displayTraceback = true end warn(`\n {warnString} \n {message} \n {displayTraceback and debug.traceback()}`) end local function logAssert(condition, message, displayTraceback) if displayTraceback == nil then displayTraceback = true end local _ = not (condition ~= 0 and condition == condition and condition ~= "" and condition) and logError(message, displayTraceback) end local function GenerateID() return `{HttpService:GenerateGUID(false)}-{tick()}` end local function GetConstructorIdentifier(constructor) local identifier = Reflect.getOwnMetadata(constructor, "identifier") if identifier == nil then logWarning(`Component {constructor} does not have an identifier. Check for the presence of the @Component decorator.`) return "MissingIdentifier" end return identifier end local function GetParentConstructor(ctor) local metatable = getmetatable(ctor) if metatable and type(metatable) == "table" then local parentConstructor = rawget(metatable, "__index") return parentConstructor end end local function GetSharedComponentCtor(constructor, parent) local currentClass = constructor local metatable = getmetatable(currentClass) local result = constructor while currentClass and rawget(metatable, "__index") ~= parent do local _value = Reflect.getOwnMetadata(currentClass, "sharedComponentsFlamework:shared") if _value ~= 0 and _value == _value and _value ~= "" and _value then return result end currentClass = rawget(metatable, "__index") metatable = getmetatable(currentClass) result = currentClass end return result end return { logError = logError, logWarning = logWarning, logAssert = logAssert, GenerateID = GenerateID, GetConstructorIdentifier = GetConstructorIdentifier, GetParentConstructor = GetParentConstructor, GetSharedComponentCtor = GetSharedComponentCtor, consolePrefix = consolePrefix, IsServer = IsServer, IsClient = IsClient, }