The Decorator Pattern is a structural design pattern that allows you to add new functionalities to an existing object…