function getControlChangesForVariantSwitch(mPropertyBag) {
		const aCurrentVariantChanges = VariantManagementState.getControlChangesForVariant(
			{
				...(_pick(mPropertyBag, ["vmReference", "variantsMap", "reference"])),
				vReference: mPropertyBag.currentVReference
			}
		);
		var aNewChanges = VariantManagementState.getControlChangesForVariant(
			{
				...(_pick(mPropertyBag, ["vmReference", "variantsMap", "reference"])),
				vReference: mPropertyBag.newVReference
			}
		);

		var aRevertChanges = [];
		if (aNewChanges.length > 0) {
			aRevertChanges = aCurrentVariantChanges.slice();
			aCurrentVariantChanges.some(function(oChange) {
				if (aNewChanges[0] && oChange.getId() === aNewChanges[0].getId()) {
					aNewChanges.shift();
					aRevertChanges.shift();
				} else {
					return true;
				}
			});
		} else {
			aRevertChanges = aCurrentVariantChanges;
		}

		var mSwitches = {
			changesToBeReverted: aRevertChanges.reverse(),
			changesToBeApplied: aNewChanges
		};

		return mSwitches;
	}
Returns the map with all changes to be reverted and applied when switching variants.

@param {object} mPropertyBag - Additional properties for variant switch
@param {string} mPropertyBag.vmReference - Variant management ID
@param {string} mPropertyBag.currentVReference - The ID of the currently used variant
@param {string} mPropertyBag.newVReference - ID of the newly selected variant

@typedef {object} sap.ui.fl.variants.SwitchChanges
@property {array} changesToBeReverted - Array of changes to be reverted
@property {array} changesToBeApplied - Array of changes to be applied

@returns {sap.ui.fl.variants.SwitchChanges} Map containing all changes to be reverted and all new changes
@private
@ui5-restricted