package carapace

import (
	
	
)

// Diff compares values of two actions.
// It overrides the style to hightlight changes.
//
//	red:   only present in original
//	dim:   present in both
//	green: only present in new
func (,  Action) Action {
	return ActionCallback(func( Context) Action {
		 := Batch(
			,
			,
		).Invoke()

		 := make(map[string]common.RawValue)
		for ,  := range [0].action.rawValues {
			.Style = style.Red
			[.Value] = 
		}

		for ,  := range [1].action.rawValues {
			if ,  := [.Value];  {
				.Style = style.Dim
				[.Value] = 
			} else {
				.Style = style.Green
				[.Value] = 
			}
		}

		 := .Merge()
		.action.rawValues = make(common.RawValues, 0)
		for ,  := range  {
			.action.rawValues = append(.action.rawValues, )
		}
		return .ToA()
	})
}