-- Compiled with roblox-ts v3.0.0 local TS = _G[script] local mergeGuiProps = TS.import(script, script.Parent.Parent, "sx", "mergeGuiProps").mergeGuiProps local resolveSx = TS.import(script, script.Parent.Parent, "sx", "sx").resolveSx local function isCompoundMatch(candidate, resolvedSelection) local candidateRecord = candidate local resolvedRecord = resolvedSelection for rawVariantName, rawExpectedValue in pairs(candidateRecord) do if not (type(rawVariantName) == "string") or not (type(rawExpectedValue) == "string") then continue end local actualValue = resolvedRecord[rawVariantName] if actualValue ~= rawExpectedValue then return false end end return true end local function createRecipe(config) return function(selection, theme) local _condition = config.defaultVariants if _condition == nil then _condition = {} end local _object = table.clone(_condition) setmetatable(_object, nil) local _condition_1 = selection if _condition_1 == nil then _condition_1 = {} end for _k, _v in _condition_1 do _object[_k] = _v end local resolvedSelection = _object local merged = resolveSx(config.base, theme) local variants = config.variants if variants then local variantsRecord = variants local resolvedRecord = resolvedSelection for rawVariantName, rawVariantMap in pairs(variantsRecord) do if not (type(rawVariantName) == "string") or not (type(rawVariantMap) == "table") then continue end local selectedValue = resolvedRecord[rawVariantName] if selectedValue == nil then continue end local sx = rawVariantMap[selectedValue] merged = mergeGuiProps(merged, resolveSx(sx, theme)) end end for _, compound in config.compoundVariants or {} do if not isCompoundMatch(compound.variants, resolvedSelection) then continue end merged = mergeGuiProps(merged, resolveSx(compound.sx, theme)) end return merged end end return { createRecipe = createRecipe, }