1. Open webChat.js

2. Goto function: notifyNewParticipant

3. Find and replace code bellow: 
        if (webChat.checkAgentVisibility(id, role)) {
        ...
        } else if (roles !== undefined) {
            ...
        }
    with this one:
        if (roles === undefined) {
            for (var i = 0; i < agents.length; i++) {
                roles = [];
                roles.push(agents[i].type);
                webChat.joinedAgents[agents[i].id] = roles;
            }
        } else {
            roles.push(role);
            webChat.joinedAgents[id] = roles;
        }
    
        // Notify UI about Agent/Supervisor join if it's configured in ChatUI configuration panel
        if (webChat.checkAgentVisibility(id, role)) {
            webChat.writeResponse(chatConfig.agentJoinedMessage, chatConfig.writeResponseClassSystem);
        }

4. In any place add a new function as bellow:
    notifyConsecutiveAgentLeave: function (id, currentRole) {
        var roles = webChat.joinedAgents[id];
        var role = roles[0];
        while (role !== undefined && role !== currentRole) {
            if (webChat.checkAgentVisibility(id, role)) {
                webChat.writeResponse(chatConfig.agentLeftMessage, chatConfig.writeResponseClassSystem);
            }
            roles.shift();
            role = roles[0];
        }
    },

5. Go to function: notifyParticipantLeave
    5.1. Replace condition:  if (Object.keys(body.participants).length === 0)
       with this one:      if (agents.length === 0)

    5.2. Replace block:
            else {
                webChat.writeResponse(chatConfig.agentLeftMessage, chatConfig.writeResponseClassSystem);
            }
        with this one:
            else if (webChat.joinedAgents[id] !== undefined) {
                webChat.notifyConsecutiveAgentLeave(id);
                delete webChat.joinedAgents[id];
            }

    5.3. Remove all the code block under condition:
            if (savedAgentRoles.includes('supervisor_observe') || savedAgentRoles.includes('supervisor_coach'))
         And put only this line:
            webChat.notifyConsecutiveAgentLeave(id, 'supervisor_barge')

    5.4. Update condition:
            else if (agents.length === 1 && (savedAgentRoles.includes('passive_participant')
                        || savedRolesOtherParticipant.includes('supervisor_barge')))
         with this one:
            else if (agents.length === 1 && (savedAgentRoles.includes('passive_participant')
                        || (savedRolesOtherParticipant !== undefined && savedRolesOtherParticipant.includes('supervisor_barge'))))

    5.5. Replace condition:
            if (savedAgentRoles.length === 0)
        with this one:
            if (savedAgentRoles !== undefined && savedAgentRoles.length === 0)

6. Save file and close