<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;
/* layouts/base.html.twig */
class __TwigTemplate_57f15f3e4103dd8b92c2fa0c817c4713 extends \Twig\Template
{
private $source;
private $macros = [];
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->parent = false;
$this->blocks = [
'head' => [$this, 'block_head'],
'body_class' => [$this, 'block_body_class'],
'body' => [$this, 'block_body'],
'header' => [$this, 'block_header'],
'breadcrumb' => [$this, 'block_breadcrumb'],
'content' => [$this, 'block_content'],
'footer' => [$this, 'block_footer'],
'pub_standard' => [$this, 'block_pub_standard'],
'pubs' => [$this, 'block_pubs'],
'cookies' => [$this, 'block_cookies'],
'modalFlashes' => [$this, 'block_modalFlashes'],
'scripts' => [$this, 'block_scripts'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doDisplay(array $context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "layouts/base.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "layouts/base.html.twig"));
// line 1
echo "<!DOCTYPE html>
<html lang=\"";
// line 2
if (array_key_exists("languagecode", $context)) {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["languagecode"] ?? null), "locale", [], "any", true, true, false, 2)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["languagecode"] ?? null), "locale", [], "any", false, false, false, 2), ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 2), "getLocale", [], "method", true, true, false, 2)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 2), "getLocale", [], "method", false, false, false, 2))) : ("")))) : (((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 2), "getLocale", [], "method", true, true, false, 2)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 2), "getLocale", [], "method", false, false, false, 2))) : ("")))), "html", null, true);
} else {
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 2), "getLocale", [], "method", true, true, false, 2)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 2), "getLocale", [], "method", false, false, false, 2))) : ("")), "html", null, true);
}
echo "\">
<head>
";
// line 4
$this->displayBlock('head', $context, $blocks);
// line 7
echo "</head>
<body";
// line 8
$this->displayBlock('body_class', $context, $blocks);
echo ">
";
// line 9
echo _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("scripts_body", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 9, $this->source); })()), "request", [], "any", false, false, false, 9), "getLocale", [], "method", false, false, false, 9)));
echo "
";
// line 10
echo ((array_key_exists("scriptsbody", $context)) ? (_twig_default_filter((isset($context["scriptsbody"]) || array_key_exists("scriptsbody", $context) ? $context["scriptsbody"] : (function () { throw new RuntimeError('Variable "scriptsbody" does not exist.', 10, $this->source); })()))) : (""));
echo "
";
// line 11
if ($this->extensions['App\Twig\AppExtension']->isAuthenticatedInStudio()) {
// line 12
echo " ";
$this->loadTemplate("admin\\adminbar.html.twig", "layouts/base.html.twig", 12)->display($context);
}
// line 14
echo "
";
// line 15
$this->displayBlock('body', $context, $blocks);
// line 64
echo "
";
// line 65
$this->displayBlock('cookies', $context, $blocks);
// line 77
echo "
";
// line 78
$this->displayBlock('modalFlashes', $context, $blocks);
// line 103
echo "
";
// line 104
$this->displayBlock('scripts', $context, $blocks);
// line 134
echo "
<script type=\"text/javascript\">
";
// line 137
$this->displayBlock('javascripts', $context, $blocks);
// line 442
echo "</script>
";
// line 443
echo _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("scripts_footer", twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 443, $this->source); })()), "request", [], "any", false, false, false, 443), "getLocale", [], "method", false, false, false, 443)));
echo "
";
// line 444
echo ((array_key_exists("scriptsfooter", $context)) ? (_twig_default_filter((isset($context["scriptsfooter"]) || array_key_exists("scriptsfooter", $context) ? $context["scriptsfooter"] : (function () { throw new RuntimeError('Variable "scriptsfooter" does not exist.', 444, $this->source); })()))) : (""));
echo "
</body>
</html>
";
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 4
public function block_head($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "head"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "head"));
// line 5
$this->loadTemplate("partials\\head.html.twig", "layouts/base.html.twig", 5)->display($context);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 8
public function block_body_class($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body_class"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body_class"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 15
public function block_body($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 16
echo " <div class=\"wrap\">
";
// line 17
$this->displayBlock('header', $context, $blocks);
// line 20
echo "
";
// line 21
if (((array_key_exists("preview", $context)) ? (_twig_default_filter((isset($context["preview"]) || array_key_exists("preview", $context) ? $context["preview"] : (function () { throw new RuntimeError('Variable "preview" does not exist.', 21, $this->source); })()))) : (""))) {
// line 22
echo " <div class=\"mt-3 mx-4 alert alert-danger\">
";
// line 23
echo twig_escape_filter($this->env, $this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("is_preview", [], "pages"), "html", null, true);
echo "
</div>
";
}
// line 26
echo "
";
// line 27
$this->displayBlock('breadcrumb', $context, $blocks);
// line 30
echo "
<main>
";
// line 32
$this->displayBlock('content', $context, $blocks);
// line 35
echo " </main>
";
// line 37
$this->displayBlock('footer', $context, $blocks);
// line 62
echo " </div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 17
public function block_header($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "header"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "header"));
// line 18
echo " ";
$this->loadTemplate((("partials\\variants\\" . $this->extensions['App\Twig\AppExtension']->getConfig("header_style", "")) . ".html.twig"), "layouts/base.html.twig", 18)->display($context);
// line 19
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 27
public function block_breadcrumb($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "breadcrumb"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "breadcrumb"));
// line 28
echo " ";
$this->loadTemplate("partials\\breadcrumb.html.twig", "layouts/base.html.twig", 28)->display($context);
// line 29
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 32
public function block_content($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "content"));
// line 33
echo " ";
echo ((array_key_exists("blockscontent", $context)) ? (_twig_default_filter((isset($context["blockscontent"]) || array_key_exists("blockscontent", $context) ? $context["blockscontent"] : (function () { throw new RuntimeError('Variable "blockscontent" does not exist.', 33, $this->source); })()))) : (""));
echo "
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 37
public function block_footer($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "footer"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "footer"));
// line 38
echo " ";
$this->displayBlock('pub_standard', $context, $blocks);
// line 45
echo " ";
$this->displayBlock('pubs', $context, $blocks);
// line 56
echo "
";
// line 57
$this->loadTemplate((("partials\\variants\\" . $this->extensions['App\Twig\AppExtension']->getConfig("footer_style", "")) . ".html.twig"), "layouts/base.html.twig", 57)->display($context);
// line 58
echo " ";
if (_twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("mobilebottombar", (isset($context["locale"]) || array_key_exists("locale", $context) ? $context["locale"] : (function () { throw new RuntimeError('Variable "locale" does not exist.', 58, $this->source); })())))) {
// line 59
echo " ";
$this->loadTemplate("partials\\elements\\mobile-bar.twig", "layouts/base.html.twig", 59)->display($context);
// line 60
echo " ";
}
// line 61
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 38
public function block_pub_standard($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "pub_standard"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "pub_standard"));
// line 39
echo " ";
if (( !array_key_exists("hide_pub", $context) || ((isset($context["hide_pub"]) || array_key_exists("hide_pub", $context) ? $context["hide_pub"] : (function () { throw new RuntimeError('Variable "hide_pub" does not exist.', 39, $this->source); })()) == false))) {
// line 40
echo " ";
if ($this->extensions['App\Twig\AdsExtension']->isAdZoneActive("standard")) {
// line 41
echo " ";
$this->loadTemplate("partials/ads-banners/standard.html.twig", "layouts/base.html.twig", 41)->display($context);
// line 42
echo " ";
}
// line 43
echo " ";
}
// line 44
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 45
public function block_pubs($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "pubs"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "pubs"));
// line 46
echo " ";
if ($this->extensions['App\Twig\AdsExtension']->isAdZoneActive("layer")) {
// line 47
echo " ";
$this->loadTemplate("partials/ads-banners/layer.html.twig", "layouts/base.html.twig", 47)->display($context);
// line 48
echo " ";
}
// line 49
echo " ";
if ($this->extensions['App\Twig\AdsExtension']->isAdZoneActive("xtrad")) {
// line 50
echo " ";
$this->loadTemplate("partials/ads-banners/xtrad.html.twig", "layouts/base.html.twig", 50)->display($context);
// line 51
echo " ";
}
// line 52
echo " ";
if (($this->extensions['App\Twig\AppExtension']->isMobile() && $this->extensions['App\Twig\AdsExtension']->isAdZoneActive("splash"))) {
// line 53
echo " ";
$this->loadTemplate("partials/ads-banners/splash.html.twig", "layouts/base.html.twig", 53)->display($context);
// line 54
echo " ";
}
// line 55
echo " ";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 65
public function block_cookies($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "cookies"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "cookies"));
// line 66
echo " ";
if ((_twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("cookies_pages", "")) && (($this->extensions['App\Twig\AppExtension']->getVariables("COOKIE_DATABASE_ENABLED") && (null === twig_get_attribute($this->env, $this->source, // line 68
(isset($context["studio"]) || array_key_exists("studio", $context) ? $context["studio"] : (function () { throw new RuntimeError('Variable "studio" does not exist.', 68, $this->source); })()), "getCookie", [], "method", false, false, false, 68))) || ( !$this->extensions['App\Twig\AppExtension']->getVariables("COOKIE_DATABASE_ENABLED") && (twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, // line 70
(isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 70, $this->source); })()), "request", [], "any", false, false, false, 70), "cookies", [], "any", false, false, false, 70), "get", [0 => $this->extensions['App\Twig\AppExtension']->getVariables("COOKIE_STD_NAME"), 1 => ""], "method", false, false, false, 70) == ""))))) {
// line 72
echo " ";
$context["cookiepage"] = $this->extensions['App\Twig\AppExtension']->getPageInfo(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 72, $this->source); })()), "request", [], "any", false, false, false, 72), "locale", [], "any", false, false, false, 72), $this->extensions['App\Twig\AppExtension']->getConfig("cookies_pages", ""));
// line 73
echo " <div id=\"cookies-modal\" data-url=\"";
echo twig_escape_filter($this->env, ((twig_get_attribute($this->env, $this->source, ($context["cookiepage"] ?? null), "url", [], "any", true, true, false, 73)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, ($context["cookiepage"] ?? null), "url", [], "any", false, false, false, 73))) : ("")), "html", null, true);
echo "\"
data-accept=\"";
// line 74
echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("std_cookies_accept");
echo "\"></div>
";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 78
public function block_modalFlashes($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "modalFlashes"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "modalFlashes"));
// line 79
echo " ";
$context["flashessuccess"] = twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 79, $this->source); })()), "flashes", [0 => "success"], "method", false, false, false, 79);
// line 80
echo " ";
$context["flasheserror"] = twig_get_attribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 80, $this->source); })()), "flashes", [0 => "error"], "method", false, false, false, 80);
// line 81
echo "
<div class=\"modal fade\" id=\"modalMessages\" tabindex=\"-1\">
<div class=\"modal-dialog modal-dialog modal-dialog-centered\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-body\">
<button type=\"button\" class=\"close-modal ml-auto\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">×</span>
</button>
<div class=\"js-modal-messages-content\">
";
// line 90
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["flashessuccess"]) || array_key_exists("flashessuccess", $context) ? $context["flashessuccess"] : (function () { throw new RuntimeError('Variable "flashessuccess" does not exist.', 90, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 91
echo " ";
echo html_entity_decode($context["message"]);
echo "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 93
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["flasheserror"]) || array_key_exists("flasheserror", $context) ? $context["flasheserror"] : (function () { throw new RuntimeError('Variable "flasheserror" does not exist.', 93, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
// line 94
echo " ";
echo html_entity_decode($context["message"]);
echo "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 96
echo " </div>
</div>
</div>
</div>
</div>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 104
public function block_scripts($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "scripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "scripts"));
// line 105
echo " ";
// line 108
echo " ";
$context["adsProvider"] = _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("ads_provider", ""), "none");
// line 109
echo " ";
$context["adsScripts"] = _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("ads_scripts", ""), "");
// line 110
echo "
";
// line 112
if (((isset($context["adsProvider"]) || array_key_exists("adsProvider", $context) ? $context["adsProvider"] : (function () { throw new RuntimeError('Variable "adsProvider" does not exist.', 112, $this->source); })()) == "studio")) {
echo "
<script src=\"/build/assets/js/ads-banners.js\"></script>
";
} elseif ((( // line 114
array_key_exists("adsScripts", $context) && ((isset($context["adsScripts"]) || array_key_exists("adsScripts", $context) ? $context["adsScripts"] : (function () { throw new RuntimeError('Variable "adsScripts" does not exist.', 114, $this->source); })()) != "")) && ((isset($context["adsProvider"]) || array_key_exists("adsProvider", $context) ? $context["adsProvider"] : (function () { throw new RuntimeError('Variable "adsProvider" does not exist.', 114, $this->source); })()) != "none"))) {
// line 115
echo " ";
echo (isset($context["adsScripts"]) || array_key_exists("adsScripts", $context) ? $context["adsScripts"] : (function () { throw new RuntimeError('Variable "adsScripts" does not exist.', 115, $this->source); })());
echo "
";
}
// line 116
echo "
";
// line 118
$this->loadTemplate("partials\\scripts.html.twig", "layouts/base.html.twig", 118)->display($context);
// line 119
echo " ";
$context["webpackEntries"] = ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 119), "attributes", [], "any", false, true, false, 119), "get", [0 => "webpackEntries"], "method", true, true, false, 119)) ? (_twig_default_filter(twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["app"] ?? null), "request", [], "any", false, true, false, 119), "attributes", [], "any", false, true, false, 119), "get", [0 => "webpackEntries"], "method", false, false, false, 119), [])) : ([]));
// line 120
echo " ";
if (_twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("notificationsbar_page", ""))) {
// line 121
echo " ";
$context["webpackEntries"] = twig_array_merge((isset($context["webpackEntries"]) || array_key_exists("webpackEntries", $context) ? $context["webpackEntries"] : (function () { throw new RuntimeError('Variable "webpackEntries" does not exist.', 121, $this->source); })()), [0 => "B31_notificationsbar"]);
// line 122
echo " ";
}
// line 123
echo " ";
$context["webpackEntries"] = twig_array_merge((isset($context["webpackEntries"]) || array_key_exists("webpackEntries", $context) ? $context["webpackEntries"] : (function () { throw new RuntimeError('Variable "webpackEntries" does not exist.', 123, $this->source); })()), [0 => "slick-carousel"]);
// line 124
echo " ";
if (_twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("newsletterblock_page", ""))) {
// line 125
echo " ";
$context["webpackEntries"] = twig_array_merge((isset($context["webpackEntries"]) || array_key_exists("webpackEntries", $context) ? $context["webpackEntries"] : (function () { throw new RuntimeError('Variable "webpackEntries" does not exist.', 125, $this->source); })()), [0 => ("validation_messages_" . (isset($context["locale"]) || array_key_exists("locale", $context) ? $context["locale"] : (function () { throw new RuntimeError('Variable "locale" does not exist.', 125, $this->source); })()))]);
// line 126
echo " ";
$context["webpackEntries"] = twig_array_merge((isset($context["webpackEntries"]) || array_key_exists("webpackEntries", $context) ? $context["webpackEntries"] : (function () { throw new RuntimeError('Variable "webpackEntries" does not exist.', 126, $this->source); })()), [0 => "B32_newsletter"]);
// line 127
echo " ";
}
// line 128
echo " ";
if (array_key_exists("webpackEntries", $context)) {
// line 129
echo " ";
$context['_parent'] = $context;
$context['_seq'] = twig_ensure_traversable((isset($context["webpackEntries"]) || array_key_exists("webpackEntries", $context) ? $context["webpackEntries"] : (function () { throw new RuntimeError('Variable "webpackEntries" does not exist.', 129, $this->source); })()));
foreach ($context['_seq'] as $context["_key"] => $context["entry"]) {
// line 130
echo " ";
echo $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackScriptTags($context["entry"]);
echo "
";
}
$_parent = $context['_parent'];
unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entry'], $context['_parent'], $context['loop']);
$context = array_intersect_key($context, $_parent) + $_parent;
// line 132
echo " ";
}
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
// line 137
public function block_javascripts($context, array $blocks = [])
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 138
echo " ";
echo (isset($context["blockscontentjs"]) || array_key_exists("blockscontentjs", $context) ? $context["blockscontentjs"] : (function () { throw new RuntimeError('Variable "blockscontentjs" does not exist.', 138, $this->source); })());
echo "
";
// line 141
if ((array_key_exists("scripts_tracking_precise", $context) && ((isset($context["scripts_tracking_precise"]) || array_key_exists("scripts_tracking_precise", $context) ? $context["scripts_tracking_precise"] : (function () { throw new RuntimeError('Variable "scripts_tracking_precise" does not exist.', 141, $this->source); })()) === true))) {
// line 142
echo " document.addEventListener(\"DOMContentLoaded\", function () {
function getCookie(name) {
const value = `; \${document.cookie}`;
const parts = value.split(`; \${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
// Calculate distance between two coordinates in km (Haversine formula)
function haversineDistance(lat1, lon1, lat2, lon2) {
const R = 6371; // Earth's radius in km
const dLat = (lat2 - lat1) * Math.PI / 180;
const dLon = (lon2 - lon1) * Math.PI / 180;
const a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon/2) * Math.sin(dLon/2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
return R * c;
}
const LOCATION_VERIFY_INTERVAL = 10 * 60 * 1000;
let locationVerifyTimer = null;
function verifyLocationWithBackend() {
if (!(\"geolocation\" in navigator)) return;
const lastLat = localStorage.getItem('lastLocationLat');
const lastLon = localStorage.getItem('lastLocationLon');
if (!lastLat || !lastLon) return;
navigator.geolocation.getCurrentPosition(
function(position) {
const latitude = position.coords.latitude;
const longitude = position.coords.longitude;
";
// line 177
if ((array_key_exists("use_geo_map_tracking", $context) && ((isset($context["use_geo_map_tracking"]) || array_key_exists("use_geo_map_tracking", $context) ? $context["use_geo_map_tracking"] : (function () { throw new RuntimeError('Variable "use_geo_map_tracking" does not exist.', 177, $this->source); })()) === true))) {
// line 178
echo " fetch(`/geo-location/verify?lon=\${longitude}&lat=\${latitude}`)
.then(res => res.json())
.then(data => {
if (data.needs_update) {
fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=500`)
.then(res => res.json())
.then(updateData => {
if (!updateData.error) {
localStorage.setItem('lastLocationLat', latitude.toString());
localStorage.setItem('lastLocationLon', longitude.toString());
localStorage.setItem('lastLocationVerify', Date.now().toString());
location.reload();
}
})
.catch(err => console.error('[Location Verify] Update error:', err));
} else {
localStorage.setItem('lastLocationVerify', Date.now().toString());
}
})
.catch(() => {});
";
}
// line 199
echo " },
function() {},
{ enableHighAccuracy: false, timeout: 15000, maximumAge: 60000 }
);
}
function startLocationVerification() {
if (locationVerifyTimer) clearInterval(locationVerifyTimer);
locationVerifyTimer = setInterval(verifyLocationWithBackend, LOCATION_VERIFY_INTERVAL);
document.addEventListener('visibilitychange', function() {
if (document.visibilityState === 'visible') {
const lastVerify = parseInt(localStorage.getItem('lastLocationVerify') || '0');
if (Date.now() - lastVerify > 5 * 60 * 1000) verifyLocationWithBackend();
}
});
}
if (localStorage.getItem('lastLocationLat') && localStorage.getItem('lastLocationLon')) {
startLocationVerification();
}
function updateLocationSilently() {
if (!(\"geolocation\" in navigator)) return;
navigator.geolocation.getCurrentPosition(
function (position) {
const longitude = position.coords.longitude;
const latitude = position.coords.latitude;
const distance = 500;
const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
if (!isNaN(lastLat) && !isNaN(lastLon)) {
const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
if (distanceMoved <= 1) return; // Haven't moved much, skip update
}
";
// line 238
if ((array_key_exists("use_geo_map_tracking", $context) && ((isset($context["use_geo_map_tracking"]) || array_key_exists("use_geo_map_tracking", $context) ? $context["use_geo_map_tracking"] : (function () { throw new RuntimeError('Variable "use_geo_map_tracking" does not exist.', 238, $this->source); })()) === true))) {
// line 239
echo " fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
.then(res => res.json())
.then(data => {
if (!data.error) {
localStorage.setItem('lastLocationLat', latitude.toString());
localStorage.setItem('lastLocationLon', longitude.toString());
localStorage.setItem('lastLocationVerify', Date.now().toString());
localStorage.removeItem('locationReloaded');
}
})
.catch(() => {});
";
}
// line 251
echo " },
function () {},
{enableHighAccuracy: true, timeout: 10000, maximumAge: 0}
);
}
// Removed duplicate visibilitychange listener - now handled by startLocationVerification()
let cookieConsentGiven = false;
let locationAsked = false;
function askLocationOnce() {
if (locationAsked) return;
if (localStorage.getItem('locationReloaded')) return;
locationAsked = true;
cookieConsentGiven = true;
clearInterval(intervalId);
tryAskLocation();
}
function checkForExistingConsent() {
// Check localStorage for AdOpt consent (most reliable method)
const adoptConsent = localStorage.getItem('adopt-consent');
if (adoptConsent) {
askLocationOnce();
return true;
}
// Check if banner is not present (consent already given on previous visit)
const banner = document.getElementById('cookie-banner');
if (!banner) {
// Wait a bit for banner to potentially load
setTimeout(function() {
const bannerCheck = document.getElementById('cookie-banner');
if (!bannerCheck) {
askLocationOnce();
}
}, 2000);
}
return false;
}
function setupCookieBannerListeners() {
// Listen for AdOpt custom events
window.addEventListener('adopt:consent', function() {
askLocationOnce();
});
// Listen for localStorage changes (AdOpt stores consent there)
window.addEventListener('storage', function(e) {
if (e.key === 'adopt-consent' && e.newValue) {
askLocationOnce();
}
});
document.addEventListener('click', function(e) {
const target = e.target;
if (target.id === 'adopt-accept-all-button' ||
target.id === 'adopt-reject-all-button' ||
target.closest('#adopt-accept-all-button') ||
target.closest('#adopt-reject-all-button')) {
// Small delay to let AdOpt process
setTimeout(askLocationOnce, 500);
}
});
const observeBody = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.removedNodes.forEach(function(node) {
if (node.id === 'cookie-banner' || (node.querySelector && node.querySelector('#cookie-banner'))) {
setTimeout(askLocationOnce, 300);
observeBody.disconnect();
}
});
});
});
observeBody.observe(document.body, { childList: true, subtree: true });
}
function tryAskLocation() {
// if (localStorage.getItem('locationReloaded')) {
// return;
// }
//";
// line 336
echo " // if (analyticsCookie === 'accepted') {
if (\"geolocation\" in navigator) {
navigator.geolocation.getCurrentPosition(
function (position) {
const longitude = position.coords.longitude;
const latitude = position.coords.latitude;
const distance = 500;
// Check if user has moved significantly since last location update
const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
const locationReloaded = localStorage.getItem('locationReloaded');
let shouldUpdate = !locationReloaded;
// If we have previous coordinates, check if user moved > 1km
if (locationReloaded && !isNaN(lastLat) && !isNaN(lastLon)) {
const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
if (distanceMoved > 1) { // More than 1km
shouldUpdate = true;
localStorage.removeItem('locationReloaded');
}
}
";
// line 360
if ((array_key_exists("use_api_tracking", $context) && ((isset($context["use_api_tracking"]) || array_key_exists("use_api_tracking", $context) ? $context["use_api_tracking"] : (function () { throw new RuntimeError('Variable "use_api_tracking" does not exist.', 360, $this->source); })()) === true))) {
// line 361
echo " fetch(`https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=\${latitude}&longitude=\${longitude}&localityLanguage=pt-PT`)
.then(res => res.json())
.then(data => {
const country = data.countryName;
const principalSubdivision = data.principalSubdivision;
const city = data.city;
const locality = data.locality;
localStorage.setItem('locations', country || '');
localStorage.setItem('municipality', principalSubdivision || '');
localStorage.setItem('city', city || '');
localStorage.setItem('locality', locality || '');
fetch('/ip-geo-location/accept', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({country, city})
});
});
";
}
// line 381
echo "
";
// line 382
if ((array_key_exists("use_geo_map_tracking", $context) && ((isset($context["use_geo_map_tracking"]) || array_key_exists("use_geo_map_tracking", $context) ? $context["use_geo_map_tracking"] : (function () { throw new RuntimeError('Variable "use_geo_map_tracking" does not exist.', 382, $this->source); })()) === true))) {
// line 383
echo " fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
.then(res => res.json())
.then(data => {
if (!data.error) {
// Store current coordinates for future comparison
localStorage.setItem('lastLocationLat', latitude.toString());
localStorage.setItem('lastLocationLon', longitude.toString());
localStorage.setItem('lastLocationVerify', Date.now().toString());
// Start periodic location verification
startLocationVerification();
if (shouldUpdate) {
localStorage.setItem('locationReloaded', 'true');
location.reload();
}
} else {
console.error('Erro:', data.error);
}
})
.catch(err => {
console.error('Erro na requisição:', err);
});
";
}
// line 407
echo "
},
function (error) {
if (error.code === error.PERMISSION_DENIED) {
localStorage.removeItem('locationReloaded');
localStorage.removeItem('lastLocationLat');
localStorage.removeItem('lastLocationLon');
}
console.error(\"Error getting location:\", error.message);
},
{enableHighAccuracy: true, timeout: 120000, maximumAge: 0}
);
} else {
console.log(\"Geolocation is not supported by this browser.\");
}
// } else if (analyticsCookie !== undefined && analyticsCookie !== '' && analyticsCookie !== 'accepted') {
// clearInterval(intervalId);
// }
}
// Setup listeners for cookie consent
setupCookieBannerListeners();
const intervalId = setInterval(function() {
if (checkForExistingConsent()) {
clearInterval(intervalId);
}
}, 1000);
// Initial check
checkForExistingConsent();
});
";
}
// line 440
echo "
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
}
public function getTemplateName()
{
return "layouts/base.html.twig";
}
public function isTraitable()
{
return false;
}
public function getDebugInfo()
{
return array ( 967 => 440, 932 => 407, 906 => 383, 904 => 382, 901 => 381, 879 => 361, 877 => 360, 851 => 336, 765 => 251, 751 => 239, 749 => 238, 708 => 199, 685 => 178, 683 => 177, 646 => 142, 644 => 141, 637 => 138, 627 => 137, 616 => 132, 607 => 130, 602 => 129, 599 => 128, 596 => 127, 593 => 126, 590 => 125, 587 => 124, 584 => 123, 581 => 122, 578 => 121, 575 => 120, 572 => 119, 570 => 118, 566 => 116, 560 => 115, 558 => 114, 553 => 112, 549 => 110, 546 => 109, 543 => 108, 541 => 105, 531 => 104, 515 => 96, 506 => 94, 501 => 93, 492 => 91, 488 => 90, 477 => 81, 474 => 80, 471 => 79, 461 => 78, 448 => 74, 443 => 73, 440 => 72, 438 => 70, 437 => 68, 435 => 66, 425 => 65, 415 => 55, 412 => 54, 409 => 53, 406 => 52, 403 => 51, 400 => 50, 397 => 49, 394 => 48, 391 => 47, 388 => 46, 378 => 45, 368 => 44, 365 => 43, 362 => 42, 359 => 41, 356 => 40, 353 => 39, 343 => 38, 333 => 61, 330 => 60, 327 => 59, 324 => 58, 322 => 57, 319 => 56, 316 => 45, 313 => 38, 303 => 37, 290 => 33, 280 => 32, 270 => 29, 267 => 28, 257 => 27, 247 => 19, 244 => 18, 234 => 17, 223 => 62, 221 => 37, 217 => 35, 215 => 32, 211 => 30, 209 => 27, 206 => 26, 200 => 23, 197 => 22, 195 => 21, 192 => 20, 190 => 17, 187 => 16, 177 => 15, 159 => 8, 149 => 5, 139 => 4, 125 => 444, 121 => 443, 118 => 442, 116 => 137, 111 => 134, 109 => 104, 106 => 103, 104 => 78, 101 => 77, 99 => 65, 96 => 64, 94 => 15, 91 => 14, 87 => 12, 85 => 11, 81 => 10, 77 => 9, 73 => 8, 70 => 7, 68 => 4, 59 => 2, 56 => 1,);
}
public function getSourceContext()
{
return new Source("<!DOCTYPE html>
<html lang=\"{% if languagecode is defined %}{{ languagecode.locale|default((app.request.getLocale()|default)) }}{% else %}{{ app.request.getLocale()|default }}{% endif %}\">
<head>
{% block head -%}
{%- include 'partials\\\\head.html.twig' -%}
{%- endblock %}
</head>
<body{% block body_class %}{%- endblock %}>
{{ get_config('scripts_body',app.request.getLocale())|default|raw }}
{{ scriptsbody|default|raw }}
{% if is_authenticated_in_studio() %}
{% include 'admin\\\\adminbar.html.twig' %}
{% endif %}
{% block body %}
<div class=\"wrap\">
{% block header %}
{% include 'partials\\\\variants\\\\' ~ get_config('header_style','') ~ '.html.twig' %}
{% endblock %}
{% if preview|default %}
<div class=\"mt-3 mx-4 alert alert-danger\">
{{ 'is_preview'|trans({},'pages') }}
</div>
{% endif %}
{% block breadcrumb %}
{% include 'partials\\\\breadcrumb.html.twig' %}
{% endblock %}
<main>
{% block content %}
{{ blockscontent|default|raw }}
{% endblock %}
</main>
{% block footer %}
{% block pub_standard %}
{% if hide_pub is not defined or hide_pub == false %}
{% if is_ad_zone_active('standard') %}
{% include 'partials/ads-banners/standard.html.twig' %}
{% endif %}
{% endif %}
{% endblock %}
{% block pubs %}
{% if is_ad_zone_active('layer') %}
{% include 'partials/ads-banners/layer.html.twig' %}
{% endif %}
{% if is_ad_zone_active('xtrad') %}
{% include 'partials/ads-banners/xtrad.html.twig' %}
{% endif %}
{% if is_mobile() and is_ad_zone_active('splash') %}
{% include 'partials/ads-banners/splash.html.twig' %}
{% endif %}
{% endblock %}
{% include 'partials\\\\variants\\\\' ~ get_config('footer_style','') ~ '.html.twig' %}
{% if get_config('mobilebottombar',locale)|default %}
{% include 'partials\\\\elements\\\\mobile-bar.twig' %}
{% endif %}
{% endblock %}
</div>
{% endblock %}
{% block cookies %}
{% if get_config('cookies_pages', '')|default
and (
(get_env('COOKIE_DATABASE_ENABLED') and studio.getCookie() is null)
or
(not get_env('COOKIE_DATABASE_ENABLED') and app.request.cookies.get(get_env('COOKIE_STD_NAME'),'') == '')
) %}
{% set cookiepage=get_page_info(app.request.locale,get_config('cookies_pages','')) %}
<div id=\"cookies-modal\" data-url=\"{{ cookiepage.url|default }}\"
data-accept=\"{{ path('std_cookies_accept') }}\"></div>
{% endif %}
{% endblock %}
{% block modalFlashes %}
{% set flashessuccess=app.flashes('success') %}
{% set flasheserror=app.flashes('error') %}
<div class=\"modal fade\" id=\"modalMessages\" tabindex=\"-1\">
<div class=\"modal-dialog modal-dialog modal-dialog-centered\" role=\"document\">
<div class=\"modal-content\">
<div class=\"modal-body\">
<button type=\"button\" class=\"close-modal ml-auto\" data-dismiss=\"modal\" aria-label=\"Close\">
<span aria-hidden=\"true\">×</span>
</button>
<div class=\"js-modal-messages-content\">
{% for message in flashessuccess %}
{{ message|html_entity_decode|raw }}
{% endfor %}
{% for message in flasheserror %}
{{ message|html_entity_decode|raw }}
{% endfor %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
{# ============================
Publicidade – Provider Loader
============================ #}
{% set adsProvider = get_config('ads_provider', '')|default('none') %}
{% set adsScripts = get_config('ads_scripts', '')|default('') %}
{% if adsProvider == 'studio' %}
<script src=\"/build/assets/js/ads-banners.js\"></script>
{%elseif adsScripts is defined and adsScripts != '' and adsProvider!='none' %}
{{ adsScripts|raw }}
{% endif %}
{% include 'partials\\\\scripts.html.twig' %}
{% set webpackEntries=app.request.attributes.get('webpackEntries')|default([]) %}
{% if get_config('notificationsbar_page', '')|default %}
{% set webpackEntries=webpackEntries|merge(['B31_notificationsbar']) %}
{% endif %}
{% set webpackEntries=webpackEntries|merge(['slick-carousel']) %}
{% if get_config('newsletterblock_page', '')|default %}
{% set webpackEntries=webpackEntries|merge(['validation_messages_' ~ locale]) %}
{% set webpackEntries=webpackEntries|merge(['B32_newsletter']) %}
{% endif %}
{% if webpackEntries is defined %}
{% for entry in webpackEntries %}
{{ encore_entry_script_tags(entry) }}
{% endfor %}
{% endif %}
{% endblock %}
<script type=\"text/javascript\">
{% block javascripts %}
{{ blockscontentjs|raw }}
{% if scripts_tracking_precise is defined and scripts_tracking_precise is same as(true) %}
document.addEventListener(\"DOMContentLoaded\", function () {
function getCookie(name) {
const value = `; \${document.cookie}`;
const parts = value.split(`; \${name}=`);
if (parts.length === 2) return parts.pop().split(';').shift();
}
// Calculate distance between two coordinates in km (Haversine formula)
function haversineDistance(lat1, lon1, lat2, lon2) {
const R = 6371; // Earth's radius in km
const dLat = (lat2 - lat1) * Math.PI / 180;
const dLon = (lon2 - lon1) * Math.PI / 180;
const a = Math.sin(dLat/2) * Math.sin(dLat/2) +
Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
Math.sin(dLon/2) * Math.sin(dLon/2);
const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
return R * c;
}
const LOCATION_VERIFY_INTERVAL = 10 * 60 * 1000;
let locationVerifyTimer = null;
function verifyLocationWithBackend() {
if (!(\"geolocation\" in navigator)) return;
const lastLat = localStorage.getItem('lastLocationLat');
const lastLon = localStorage.getItem('lastLocationLon');
if (!lastLat || !lastLon) return;
navigator.geolocation.getCurrentPosition(
function(position) {
const latitude = position.coords.latitude;
const longitude = position.coords.longitude;
{% if use_geo_map_tracking is defined and use_geo_map_tracking is same as(true) %}
fetch(`/geo-location/verify?lon=\${longitude}&lat=\${latitude}`)
.then(res => res.json())
.then(data => {
if (data.needs_update) {
fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=500`)
.then(res => res.json())
.then(updateData => {
if (!updateData.error) {
localStorage.setItem('lastLocationLat', latitude.toString());
localStorage.setItem('lastLocationLon', longitude.toString());
localStorage.setItem('lastLocationVerify', Date.now().toString());
location.reload();
}
})
.catch(err => console.error('[Location Verify] Update error:', err));
} else {
localStorage.setItem('lastLocationVerify', Date.now().toString());
}
})
.catch(() => {});
{% endif %}
},
function() {},
{ enableHighAccuracy: false, timeout: 15000, maximumAge: 60000 }
);
}
function startLocationVerification() {
if (locationVerifyTimer) clearInterval(locationVerifyTimer);
locationVerifyTimer = setInterval(verifyLocationWithBackend, LOCATION_VERIFY_INTERVAL);
document.addEventListener('visibilitychange', function() {
if (document.visibilityState === 'visible') {
const lastVerify = parseInt(localStorage.getItem('lastLocationVerify') || '0');
if (Date.now() - lastVerify > 5 * 60 * 1000) verifyLocationWithBackend();
}
});
}
if (localStorage.getItem('lastLocationLat') && localStorage.getItem('lastLocationLon')) {
startLocationVerification();
}
function updateLocationSilently() {
if (!(\"geolocation\" in navigator)) return;
navigator.geolocation.getCurrentPosition(
function (position) {
const longitude = position.coords.longitude;
const latitude = position.coords.latitude;
const distance = 500;
const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
if (!isNaN(lastLat) && !isNaN(lastLon)) {
const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
if (distanceMoved <= 1) return; // Haven't moved much, skip update
}
{% if use_geo_map_tracking is defined and use_geo_map_tracking is same as(true) %}
fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
.then(res => res.json())
.then(data => {
if (!data.error) {
localStorage.setItem('lastLocationLat', latitude.toString());
localStorage.setItem('lastLocationLon', longitude.toString());
localStorage.setItem('lastLocationVerify', Date.now().toString());
localStorage.removeItem('locationReloaded');
}
})
.catch(() => {});
{% endif %}
},
function () {},
{enableHighAccuracy: true, timeout: 10000, maximumAge: 0}
);
}
// Removed duplicate visibilitychange listener - now handled by startLocationVerification()
let cookieConsentGiven = false;
let locationAsked = false;
function askLocationOnce() {
if (locationAsked) return;
if (localStorage.getItem('locationReloaded')) return;
locationAsked = true;
cookieConsentGiven = true;
clearInterval(intervalId);
tryAskLocation();
}
function checkForExistingConsent() {
// Check localStorage for AdOpt consent (most reliable method)
const adoptConsent = localStorage.getItem('adopt-consent');
if (adoptConsent) {
askLocationOnce();
return true;
}
// Check if banner is not present (consent already given on previous visit)
const banner = document.getElementById('cookie-banner');
if (!banner) {
// Wait a bit for banner to potentially load
setTimeout(function() {
const bannerCheck = document.getElementById('cookie-banner');
if (!bannerCheck) {
askLocationOnce();
}
}, 2000);
}
return false;
}
function setupCookieBannerListeners() {
// Listen for AdOpt custom events
window.addEventListener('adopt:consent', function() {
askLocationOnce();
});
// Listen for localStorage changes (AdOpt stores consent there)
window.addEventListener('storage', function(e) {
if (e.key === 'adopt-consent' && e.newValue) {
askLocationOnce();
}
});
document.addEventListener('click', function(e) {
const target = e.target;
if (target.id === 'adopt-accept-all-button' ||
target.id === 'adopt-reject-all-button' ||
target.closest('#adopt-accept-all-button') ||
target.closest('#adopt-reject-all-button')) {
// Small delay to let AdOpt process
setTimeout(askLocationOnce, 500);
}
});
const observeBody = new MutationObserver(function(mutations) {
mutations.forEach(function(mutation) {
mutation.removedNodes.forEach(function(node) {
if (node.id === 'cookie-banner' || (node.querySelector && node.querySelector('#cookie-banner'))) {
setTimeout(askLocationOnce, 300);
observeBody.disconnect();
}
});
});
});
observeBody.observe(document.body, { childList: true, subtree: true });
}
function tryAskLocation() {
// if (localStorage.getItem('locationReloaded')) {
// return;
// }
//{#const analyticsCookie = getCookie('{{ get_env(\"COOKIE_STD_ANALYTICS_NAME\") }}');#}
// if (analyticsCookie === 'accepted') {
if (\"geolocation\" in navigator) {
navigator.geolocation.getCurrentPosition(
function (position) {
const longitude = position.coords.longitude;
const latitude = position.coords.latitude;
const distance = 500;
// Check if user has moved significantly since last location update
const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
const locationReloaded = localStorage.getItem('locationReloaded');
let shouldUpdate = !locationReloaded;
// If we have previous coordinates, check if user moved > 1km
if (locationReloaded && !isNaN(lastLat) && !isNaN(lastLon)) {
const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
if (distanceMoved > 1) { // More than 1km
shouldUpdate = true;
localStorage.removeItem('locationReloaded');
}
}
{% if use_api_tracking is defined and use_api_tracking is same as(true) %}
fetch(`https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=\${latitude}&longitude=\${longitude}&localityLanguage=pt-PT`)
.then(res => res.json())
.then(data => {
const country = data.countryName;
const principalSubdivision = data.principalSubdivision;
const city = data.city;
const locality = data.locality;
localStorage.setItem('locations', country || '');
localStorage.setItem('municipality', principalSubdivision || '');
localStorage.setItem('city', city || '');
localStorage.setItem('locality', locality || '');
fetch('/ip-geo-location/accept', {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({country, city})
});
});
{% endif %}
{% if use_geo_map_tracking is defined and use_geo_map_tracking is same as(true) %}
fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
.then(res => res.json())
.then(data => {
if (!data.error) {
// Store current coordinates for future comparison
localStorage.setItem('lastLocationLat', latitude.toString());
localStorage.setItem('lastLocationLon', longitude.toString());
localStorage.setItem('lastLocationVerify', Date.now().toString());
// Start periodic location verification
startLocationVerification();
if (shouldUpdate) {
localStorage.setItem('locationReloaded', 'true');
location.reload();
}
} else {
console.error('Erro:', data.error);
}
})
.catch(err => {
console.error('Erro na requisição:', err);
});
{% endif %}
},
function (error) {
if (error.code === error.PERMISSION_DENIED) {
localStorage.removeItem('locationReloaded');
localStorage.removeItem('lastLocationLat');
localStorage.removeItem('lastLocationLon');
}
console.error(\"Error getting location:\", error.message);
},
{enableHighAccuracy: true, timeout: 120000, maximumAge: 0}
);
} else {
console.log(\"Geolocation is not supported by this browser.\");
}
// } else if (analyticsCookie !== undefined && analyticsCookie !== '' && analyticsCookie !== 'accepted') {
// clearInterval(intervalId);
// }
}
// Setup listeners for cookie consent
setupCookieBannerListeners();
const intervalId = setInterval(function() {
if (checkForExistingConsent()) {
clearInterval(intervalId);
}
}, 1000);
// Initial check
checkForExistingConsent();
});
{% endif %}
{% endblock %}
</script>
{{ get_config('scripts_footer',app.request.getLocale())|default|raw }}
{{ scriptsfooter|default|raw }}
</body>
</html>
", "layouts/base.html.twig", "/var/www/html/theme/templates/layouts/base.html.twig");
}
}