<div id="sfwdt{{ token }}" class="sf-toolbar" style="display: none"></div>
{% include 'WebProfilerBundle:Profiler:base_js.html.twig' %}
<script type="text/javascript">/*<![CDATA[*/
    (function () {
        Sfjs.load(
            'sfwdt{{ token }}',
            '{{ path("_wdt", { "token": token }) }}',
            function(xhr, el) {
                el.style.display = -1 !== xhr.responseText.indexOf('sf-toolbarreset') ? 'block' : 'none';
            },
            function(xhr) {
                if (xhr.status !== 0) {
                    confirm('An error occurred while loading the web debug toolbar (' + xhr.status + ': ' + xhr.statusText + ').\n\nDo you want to open the profiler?') && (window.location = '{{ path("_profiler", { "token": token }) }}');
                }
            }
        );
    })();
/*]]>*/</script>
