try {
            if (rid) {
                await Livechat.closeChat({ rid });
            }
        } catch (error) {