{% extends aa_content_templates.base_layout %}

{% block header %}
  {% include '_layout/_header.html.twig' %}
{% endblock %}

{% block stylesheets_head %}
  {{ parent() }}
  <link rel="stylesheet" href="{{ asset('/build/app.min.css')|gda_cache_suffix_add }}">

  <script>
    function getCookie(name) {
      const cookieString = decodeURIComponent(document.cookie);
      const cookies = cookieString.split(';');
      for (let i = 0; i < cookies.length; i++) {
        const cookie = cookies[i].trim();
        if (cookie.startsWith(name + '=')) {
          return cookie.substring(name.length + 1);
        }
      }
      return null;
    }

    function isAllowedToLoadJs() {
      return parseInt(getCookie('aa_is_bot')) !== 1;
    }
  </script>
{% endblock %}

 {% block javascripts_body %}
   {{ parent() }}
   <script type="text/javascript" src="{{ asset('/build/app.min.js')|gda_cache_suffix_add }}"></script>
 {% endblock %}

{% block body_attr %}
  class="{% block body_classes %}{% endblock %}"
  data-analytics-id="{% block body_analytics_id %}{% endblock %}"
  data-analytics-config="{% block body_analytics_config %}{% endblock %}"
{% endblock %}

{% block body %}
  <div class="body">
    {{ parent() }}
  </div>
{% endblock %}

{% block footer %}
  {% include '_layout/_footer.html.twig' %}
{% endblock %}