function getInitialCurrentVariant(sReference, aCtrlVariantManagementChanges, aVariants) {
		var oComponentData = FlexState.getComponentData(sReference);
		var aVariantReferencesFromUrl = ObjectPath.get(
			["technicalParameters", VariantsApplyUtil.VARIANT_TECHNICAL_PARAMETER],
			oComponentData
		) || [];

		// Only visible variants can be current
		var aVariantKeys = aVariants.filter((oVariant) => {
			return oVariant.visible;
		})
		.map((oVariant) => {
			return oVariant.key;
		});

		// Check if variant is set via url parameter
		// Legacy URLs can have multiple variant technical parameter instances (length > 1)
		if (aVariantReferencesFromUrl.length === 1) {
			aVariantReferencesFromUrl = aVariantReferencesFromUrl[0].split(",");
		}

		var sDesiredSelectedVariantId = aVariantKeys.find((sVariantKey) => {
			return aVariantReferencesFromUrl.includes(sVariantKey);
		});
		if (sDesiredSelectedVariantId) {
			return sDesiredSelectedVariantId;
		}

		// Determine latest current variant selection based on setDefault changes
		// Not used for setting the actual default variant because the initialCurrentVariant
		// check is only executed once and influenced by technical parameters
		// Default is set via applyVariantManagementChange instead
		return aCtrlVariantManagementChanges
		.slice()
		.reverse()
		.map((oVariantManagementChange) => {
			return oVariantManagementChange.getContent().defaultVariant;
		})
		.find((sDesiredDefaultVariantKey) => {
			return aVariantKeys.includes(sDesiredDefaultVariantKey);
		});
	}
Handler class to manipulate control variant changes in a variants map. See also {@link sap.ui.fl.variants.VariantManagement}.

@namespace sap.ui.fl.apply._internal.flexState.controlVariants.VariantManagementState
@since 1.74
@version ${version}
@private
@ui5-restricted