local o=require(script.Parent.Symbol)local a=o.named("\078\105\108")local x={}local function r(o,r)local f=x[o]if f then local o=f[r]if o==a then return true,nil end if o~=nil then return true,o end else f={}x[o]=f end local Y=Instance.new(o)local l,u=pcall(function()return Y[r]end)Y:Destroy()if l then if u==nil then f[r]=a else f[r]=u end end return l,u end return r


local Symbol = require(script.Parent.Symbol)

local Nil = Symbol.named("Nil")
local _cachedPropertyValues = {}

local function getDefaultInstanceProperty(className, propertyName)
	local classCache = _cachedPropertyValues[className]

	if classCache then
		local propValue = classCache[propertyName]

		-- We have to use a marker here, because Lua doesn't distinguish
		-- between 'nil' and 'not in a table'
		if propValue == Nil then
			return true, nil
		end

		if propValue ~= nil then
			return true, propValue
		end
	else
		classCache = {}
		_cachedPropertyValues[className] = classCache
	end

	local created = Instance.new(className)
	local ok, defaultValue = pcall(function()
		return created[propertyName]
	end)

	created:Destroy()

	if ok then
		if defaultValue == nil then
			classCache[propertyName] = Nil
		else
			classCache[propertyName] = defaultValue
		end
	end

	return ok, defaultValue
end

return getDefaultInstanceProperty
