<!-- Start of Rocket.Chat Livechat Script -->
<script defer="defer" async="async" type="text/javascript">
(function(w, d, s, u) {
    w.RocketChat = function(c) { w.RocketChat._.push(c) }; w.RocketChat._ = []; w.RocketChat.url = u;
    var h = d.getElementsByTagName(s)[0], j = d.createElement(s);
    j.async = true; j.src = '{{ rocketchat_url }}/livechat/rocketchat-livechat.min.js';
    h.parentNode.insertBefore(j, h);
})(window, document, 'script', '{{ rocketchat_url }}/livechat');
{% if user.is_authenticated %}
RocketChat(function() {
    var store = localStorage.getItem('store')
    if (!store || !JSON.parse(store).user) {
        this.registerGuest({
            name: '{{ user.get_full_name }}',
            email: '{{ user.email }}',
        });
    }
});
{% endif %}
</script>
<!-- End of Rocket.Chat Livechat Script -->
