/*! © 2026 Yahoo, Inc. UDS v0.0.0-development */
const require_runtime = require('../../../_virtual/_rolldown/runtime.cjs');
const require_variantConfigGuards = require('./variantConfigGuards.cjs');
let lodash_es = require("lodash-es");

//#region ../automated-config/dist/utils/getConfigVariantProperties.js
/*! © 2026 Yahoo, Inc. UDS Default Config v0.0.0-development */
/**
* Gets the properties of a variant config grouped by layer.
*
* @param variant - The variant config to get the properties from
* @returns A Record of layer names to their properties, or null if no properties are found
*/
function getConfigVariantProperties(variant) {
	if (!variant || !require_variantConfigGuards.isVariantConfigWithProperties(variant)) return null;
	const result = (0, lodash_es.mapValues)(variant.layers, (layer) => layer.properties);
	for (const layerKey in result) {
		const layerProperties = result[layerKey];
		if (!layerProperties || Object.keys(layerProperties).length === 0) delete result[layerKey];
	}
	if (Object.keys(result).length === 0) return null;
	return result;
}

//#endregion
exports.getConfigVariantProperties = getConfigVariantProperties;