var/cache/dev/twig/cd/cd471a7f32a87d53dbdc8aca2792d7c7.php line 190

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\SandboxExtension;
  6. use Twig\Markup;
  7. use Twig\Sandbox\SecurityError;
  8. use Twig\Sandbox\SecurityNotAllowedTagError;
  9. use Twig\Sandbox\SecurityNotAllowedFilterError;
  10. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  11. use Twig\Source;
  12. use Twig\Template;
  13. /* layouts/base.html.twig */
  14. class __TwigTemplate_57f15f3e4103dd8b92c2fa0c817c4713 extends \Twig\Template
  15. {
  16.     private $source;
  17.     private $macros = [];
  18.     public function __construct(Environment $env)
  19.     {
  20.         parent::__construct($env);
  21.         $this->source $this->getSourceContext();
  22.         $this->parent false;
  23.         $this->blocks = [
  24.             'head' => [$this'block_head'],
  25.             'body_class' => [$this'block_body_class'],
  26.             'body' => [$this'block_body'],
  27.             'header' => [$this'block_header'],
  28.             'breadcrumb' => [$this'block_breadcrumb'],
  29.             'content' => [$this'block_content'],
  30.             'footer' => [$this'block_footer'],
  31.             'pub_standard' => [$this'block_pub_standard'],
  32.             'pubs' => [$this'block_pubs'],
  33.             'cookies' => [$this'block_cookies'],
  34.             'modalFlashes' => [$this'block_modalFlashes'],
  35.             'scripts' => [$this'block_scripts'],
  36.             'javascripts' => [$this'block_javascripts'],
  37.         ];
  38.     }
  39.     protected function doDisplay(array $context, array $blocks = [])
  40.     {
  41.         $macros $this->macros;
  42.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  43.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""layouts/base.html.twig"));
  44.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  45.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""layouts/base.html.twig"));
  46.         // line 1
  47.         echo "<!DOCTYPE html>
  48. <html lang=\"";
  49.         // line 2
  50.         if (array_key_exists("languagecode"$context)) {
  51.             echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->source, ($context["languagecode"] ?? null), "locale", [], "any"truetruefalse2)) ? (_twig_default_filter(twig_get_attribute($this->env$this->source, ($context["languagecode"] ?? null), "locale", [], "any"falsefalsefalse2), ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse2), "getLocale", [], "method"truetruefalse2)) ? (_twig_default_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse2), "getLocale", [], "method"falsefalsefalse2))) : ("")))) : (((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse2), "getLocale", [], "method"truetruefalse2)) ? (_twig_default_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse2), "getLocale", [], "method"falsefalsefalse2))) : ("")))), "html"nulltrue);
  52.         } else {
  53.             echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse2), "getLocale", [], "method"truetruefalse2)) ? (_twig_default_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse2), "getLocale", [], "method"falsefalsefalse2))) : ("")), "html"nulltrue);
  54.         }
  55.         echo "\">
  56. <head>
  57.     ";
  58.         // line 4
  59.         $this->displayBlock('head'$context$blocks);
  60.         // line 7
  61.         echo "</head>
  62. <body";
  63.         // line 8
  64.         $this->displayBlock('body_class'$context$blocks);
  65.         echo ">
  66. ";
  67.         // line 9
  68.         echo _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("scripts_body"twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse9), "getLocale", [], "method"falsefalsefalse9)));
  69.         echo "
  70. ";
  71.         // line 10
  72.         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); })()))) : (""));
  73.         echo "
  74. ";
  75.         // line 11
  76.         if ($this->extensions['App\Twig\AppExtension']->isAuthenticatedInStudio()) {
  77.             // line 12
  78.             echo "    ";
  79.             $this->loadTemplate("admin\\adminbar.html.twig""layouts/base.html.twig"12)->display($context);
  80.         }
  81.         // line 14
  82.         echo "
  83. ";
  84.         // line 15
  85.         $this->displayBlock('body'$context$blocks);
  86.         // line 64
  87.         echo "
  88. ";
  89.         // line 65
  90.         $this->displayBlock('cookies'$context$blocks);
  91.         // line 77
  92.         echo "
  93. ";
  94.         // line 78
  95.         $this->displayBlock('modalFlashes'$context$blocks);
  96.         // line 103
  97.         echo "
  98. ";
  99.         // line 104
  100.         $this->displayBlock('scripts'$context$blocks);
  101.         // line 134
  102.         echo "
  103. <script type=\"text/javascript\">
  104.     ";
  105.         // line 137
  106.         $this->displayBlock('javascripts'$context$blocks);
  107.         // line 442
  108.         echo "</script>
  109. ";
  110.         // line 443
  111.         echo _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("scripts_footer"twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse443), "getLocale", [], "method"falsefalsefalse443)));
  112.         echo "
  113. ";
  114.         // line 444
  115.         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); })()))) : (""));
  116.         echo "
  117. </body>
  118. </html>
  119. ";
  120.         
  121.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  122.         
  123.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  124.     }
  125.     // line 4
  126.     public function block_head($context, array $blocks = [])
  127.     {
  128.         $macros $this->macros;
  129.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  130.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""head"));
  131.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  132.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""head"));
  133.         // line 5
  134.         $this->loadTemplate("partials\\head.html.twig""layouts/base.html.twig"5)->display($context);
  135.         
  136.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  137.         
  138.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  139.     }
  140.     // line 8
  141.     public function block_body_class($context, array $blocks = [])
  142.     {
  143.         $macros $this->macros;
  144.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  145.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body_class"));
  146.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  147.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body_class"));
  148.         
  149.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  150.         
  151.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  152.     }
  153.     // line 15
  154.     public function block_body($context, array $blocks = [])
  155.     {
  156.         $macros $this->macros;
  157.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  158.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  159.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  160.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""body"));
  161.         // line 16
  162.         echo "    <div class=\"wrap\">
  163.         ";
  164.         // line 17
  165.         $this->displayBlock('header'$context$blocks);
  166.         // line 20
  167.         echo "
  168.         ";
  169.         // line 21
  170.         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); })()))) : (""))) {
  171.             // line 22
  172.             echo "            <div class=\"mt-3 mx-4 alert alert-danger\">
  173.                 ";
  174.             // line 23
  175.             echo twig_escape_filter($this->env$this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("is_preview", [], "pages"), "html"nulltrue);
  176.             echo "
  177.             </div>
  178.         ";
  179.         }
  180.         // line 26
  181.         echo "
  182.         ";
  183.         // line 27
  184.         $this->displayBlock('breadcrumb'$context$blocks);
  185.         // line 30
  186.         echo "
  187.         <main>
  188.             ";
  189.         // line 32
  190.         $this->displayBlock('content'$context$blocks);
  191.         // line 35
  192.         echo "        </main>
  193.         ";
  194.         // line 37
  195.         $this->displayBlock('footer'$context$blocks);
  196.         // line 62
  197.         echo "    </div>
  198. ";
  199.         
  200.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  201.         
  202.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  203.     }
  204.     // line 17
  205.     public function block_header($context, array $blocks = [])
  206.     {
  207.         $macros $this->macros;
  208.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  209.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""header"));
  210.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  211.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""header"));
  212.         // line 18
  213.         echo "            ";
  214.         $this->loadTemplate((("partials\\variants\\" $this->extensions['App\Twig\AppExtension']->getConfig("header_style""")) . ".html.twig"), "layouts/base.html.twig"18)->display($context);
  215.         // line 19
  216.         echo "        ";
  217.         
  218.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  219.         
  220.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  221.     }
  222.     // line 27
  223.     public function block_breadcrumb($context, array $blocks = [])
  224.     {
  225.         $macros $this->macros;
  226.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  227.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""breadcrumb"));
  228.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  229.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""breadcrumb"));
  230.         // line 28
  231.         echo "            ";
  232.         $this->loadTemplate("partials\\breadcrumb.html.twig""layouts/base.html.twig"28)->display($context);
  233.         // line 29
  234.         echo "        ";
  235.         
  236.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  237.         
  238.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  239.     }
  240.     // line 32
  241.     public function block_content($context, array $blocks = [])
  242.     {
  243.         $macros $this->macros;
  244.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  245.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  246.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  247.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  248.         // line 33
  249.         echo "                ";
  250.         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); })()))) : (""));
  251.         echo "
  252.             ";
  253.         
  254.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  255.         
  256.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  257.     }
  258.     // line 37
  259.     public function block_footer($context, array $blocks = [])
  260.     {
  261.         $macros $this->macros;
  262.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  263.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""footer"));
  264.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  265.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""footer"));
  266.         // line 38
  267.         echo "            ";
  268.         $this->displayBlock('pub_standard'$context$blocks);
  269.         // line 45
  270.         echo "            ";
  271.         $this->displayBlock('pubs'$context$blocks);
  272.         // line 56
  273.         echo "
  274.             ";
  275.         // line 57
  276.         $this->loadTemplate((("partials\\variants\\" $this->extensions['App\Twig\AppExtension']->getConfig("footer_style""")) . ".html.twig"), "layouts/base.html.twig"57)->display($context);
  277.         // line 58
  278.         echo "            ";
  279.         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); })())))) {
  280.             // line 59
  281.             echo "                ";
  282.             $this->loadTemplate("partials\\elements\\mobile-bar.twig""layouts/base.html.twig"59)->display($context);
  283.             // line 60
  284.             echo "            ";
  285.         }
  286.         // line 61
  287.         echo "        ";
  288.         
  289.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  290.         
  291.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  292.     }
  293.     // line 38
  294.     public function block_pub_standard($context, array $blocks = [])
  295.     {
  296.         $macros $this->macros;
  297.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  298.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""pub_standard"));
  299.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  300.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""pub_standard"));
  301.         // line 39
  302.         echo "                ";
  303.         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))) {
  304.             // line 40
  305.             echo "                    ";
  306.             if ($this->extensions['App\Twig\AdsExtension']->isAdZoneActive("standard")) {
  307.                 // line 41
  308.                 echo "                        ";
  309.                 $this->loadTemplate("partials/ads-banners/standard.html.twig""layouts/base.html.twig"41)->display($context);
  310.                 // line 42
  311.                 echo "                    ";
  312.             }
  313.             // line 43
  314.             echo "                ";
  315.         }
  316.         // line 44
  317.         echo "            ";
  318.         
  319.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  320.         
  321.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  322.     }
  323.     // line 45
  324.     public function block_pubs($context, array $blocks = [])
  325.     {
  326.         $macros $this->macros;
  327.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  328.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""pubs"));
  329.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  330.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""pubs"));
  331.         // line 46
  332.         echo "                ";
  333.         if ($this->extensions['App\Twig\AdsExtension']->isAdZoneActive("layer")) {
  334.             // line 47
  335.             echo "                    ";
  336.             $this->loadTemplate("partials/ads-banners/layer.html.twig""layouts/base.html.twig"47)->display($context);
  337.             // line 48
  338.             echo "                ";
  339.         }
  340.         // line 49
  341.         echo "                ";
  342.         if ($this->extensions['App\Twig\AdsExtension']->isAdZoneActive("xtrad")) {
  343.             // line 50
  344.             echo "                    ";
  345.             $this->loadTemplate("partials/ads-banners/xtrad.html.twig""layouts/base.html.twig"50)->display($context);
  346.             // line 51
  347.             echo "                ";
  348.         }
  349.         // line 52
  350.         echo "                ";
  351.         if (($this->extensions['App\Twig\AppExtension']->isMobile() && $this->extensions['App\Twig\AdsExtension']->isAdZoneActive("splash"))) {
  352.             // line 53
  353.             echo "                    ";
  354.             $this->loadTemplate("partials/ads-banners/splash.html.twig""layouts/base.html.twig"53)->display($context);
  355.             // line 54
  356.             echo "                ";
  357.         }
  358.         // line 55
  359.         echo "            ";
  360.         
  361.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  362.         
  363.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  364.     }
  365.     // line 65
  366.     public function block_cookies($context, array $blocks = [])
  367.     {
  368.         $macros $this->macros;
  369.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  370.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""cookies"));
  371.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  372.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""cookies"));
  373.         // line 66
  374.         echo "    ";
  375.         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
  376. (isset($context["studio"]) || array_key_exists("studio"$context) ? $context["studio"] : (function () { throw new RuntimeError('Variable "studio" does not exist.'68$this->source); })()), "getCookie", [], "method"falsefalsefalse68))) || ( !$this->extensions['App\Twig\AppExtension']->getVariables("COOKIE_DATABASE_ENABLED") && (twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source,         // line 70
  377. (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'70$this->source); })()), "request", [], "any"falsefalsefalse70), "cookies", [], "any"falsefalsefalse70), "get", [=> $this->extensions['App\Twig\AppExtension']->getVariables("COOKIE_STD_NAME"), => ""], "method"falsefalsefalse70) == ""))))) {
  378.             // line 72
  379.             echo "        ";
  380.             $context["cookiepage"] = $this->extensions['App\Twig\AppExtension']->getPageInfo(twig_get_attribute($this->env$this->sourcetwig_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"falsefalsefalse72), "locale", [], "any"falsefalsefalse72), $this->extensions['App\Twig\AppExtension']->getConfig("cookies_pages"""));
  381.             // line 73
  382.             echo "        <div id=\"cookies-modal\" data-url=\"";
  383.             echo twig_escape_filter($this->env, ((twig_get_attribute($this->env$this->source, ($context["cookiepage"] ?? null), "url", [], "any"truetruefalse73)) ? (_twig_default_filter(twig_get_attribute($this->env$this->source, ($context["cookiepage"] ?? null), "url", [], "any"falsefalsefalse73))) : ("")), "html"nulltrue);
  384.             echo "\"
  385.              data-accept=\"";
  386.             // line 74
  387.             echo $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("std_cookies_accept");
  388.             echo "\"></div>
  389.     ";
  390.         }
  391.         
  392.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  393.         
  394.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  395.     }
  396.     // line 78
  397.     public function block_modalFlashes($context, array $blocks = [])
  398.     {
  399.         $macros $this->macros;
  400.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  401.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""modalFlashes"));
  402.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  403.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""modalFlashes"));
  404.         // line 79
  405.         echo "    ";
  406.         $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", [=> "success"], "method"falsefalsefalse79);
  407.         // line 80
  408.         echo "    ";
  409.         $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", [=> "error"], "method"falsefalsefalse80);
  410.         // line 81
  411.         echo "
  412.     <div class=\"modal fade\" id=\"modalMessages\" tabindex=\"-1\">
  413.         <div class=\"modal-dialog modal-dialog modal-dialog-centered\" role=\"document\">
  414.             <div class=\"modal-content\">
  415.                 <div class=\"modal-body\">
  416.                     <button type=\"button\" class=\"close-modal ml-auto\" data-dismiss=\"modal\" aria-label=\"Close\">
  417.                         <span aria-hidden=\"true\">×</span>
  418.                     </button>
  419.                     <div class=\"js-modal-messages-content\">
  420.                         ";
  421.         // line 90
  422.         $context['_parent'] = $context;
  423.         $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); })()));
  424.         foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  425.             // line 91
  426.             echo "                            ";
  427.             echo html_entity_decode($context["message"]);
  428.             echo "
  429.                         ";
  430.         }
  431.         $_parent $context['_parent'];
  432.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  433.         $context array_intersect_key($context$_parent) + $_parent;
  434.         // line 93
  435.         echo "                        ";
  436.         $context['_parent'] = $context;
  437.         $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); })()));
  438.         foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  439.             // line 94
  440.             echo "                            ";
  441.             echo html_entity_decode($context["message"]);
  442.             echo "
  443.                         ";
  444.         }
  445.         $_parent $context['_parent'];
  446.         unset($context['_seq'], $context['_iterated'], $context['_key'], $context['message'], $context['_parent'], $context['loop']);
  447.         $context array_intersect_key($context$_parent) + $_parent;
  448.         // line 96
  449.         echo "                    </div>
  450.                 </div>
  451.             </div>
  452.         </div>
  453.     </div>
  454. ";
  455.         
  456.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  457.         
  458.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  459.     }
  460.     // line 104
  461.     public function block_scripts($context, array $blocks = [])
  462.     {
  463.         $macros $this->macros;
  464.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  465.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""scripts"));
  466.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  467.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""scripts"));
  468.         // line 105
  469.         echo "    ";
  470.         // line 108
  471.         echo "    ";
  472.         $context["adsProvider"] = _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("ads_provider"""), "none");
  473.         // line 109
  474.         echo "    ";
  475.         $context["adsScripts"] = _twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("ads_scripts"""), "");
  476.         // line 110
  477.         echo "
  478.     ";
  479.         // line 112
  480.         if (((isset($context["adsProvider"]) || array_key_exists("adsProvider"$context) ? $context["adsProvider"] : (function () { throw new RuntimeError('Variable "adsProvider" does not exist.'112$this->source); })()) == "studio")) {
  481.             echo 
  482.         <script src=\"/build/assets/js/ads-banners.js\"></script>
  483.     ";
  484.         } elseif (((        // line 114
  485. 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"))) {
  486.             // line 115
  487.             echo "        ";
  488.             echo (isset($context["adsScripts"]) || array_key_exists("adsScripts"$context) ? $context["adsScripts"] : (function () { throw new RuntimeError('Variable "adsScripts" does not exist.'115$this->source); })());
  489.             echo "
  490.     ";
  491.         }
  492.         // line 116
  493.         echo 
  494.     ";
  495.         // line 118
  496.         $this->loadTemplate("partials\\scripts.html.twig""layouts/base.html.twig"118)->display($context);
  497.         // line 119
  498.         echo "    ";
  499.         $context["webpackEntries"] = ((twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse119), "attributes", [], "any"falsetruefalse119), "get", [=> "webpackEntries"], "method"truetruefalse119)) ? (_twig_default_filter(twig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->sourcetwig_get_attribute($this->env$this->source, ($context["app"] ?? null), "request", [], "any"falsetruefalse119), "attributes", [], "any"falsetruefalse119), "get", [=> "webpackEntries"], "method"falsefalsefalse119), [])) : ([]));
  500.         // line 120
  501.         echo "    ";
  502.         if (_twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("notificationsbar_page"""))) {
  503.             // line 121
  504.             echo "        ";
  505.             $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); })()), [=> "B31_notificationsbar"]);
  506.             // line 122
  507.             echo "    ";
  508.         }
  509.         // line 123
  510.         echo "    ";
  511.         $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); })()), [=> "slick-carousel"]);
  512.         // line 124
  513.         echo "    ";
  514.         if (_twig_default_filter($this->extensions['App\Twig\AppExtension']->getConfig("newsletterblock_page"""))) {
  515.             // line 125
  516.             echo "        ";
  517.             $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); })()), [=> ("validation_messages_" . (isset($context["locale"]) || array_key_exists("locale"$context) ? $context["locale"] : (function () { throw new RuntimeError('Variable "locale" does not exist.'125$this->source); })()))]);
  518.             // line 126
  519.             echo "        ";
  520.             $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); })()), [=> "B32_newsletter"]);
  521.             // line 127
  522.             echo "    ";
  523.         }
  524.         // line 128
  525.         echo "    ";
  526.         if (array_key_exists("webpackEntries"$context)) {
  527.             // line 129
  528.             echo "        ";
  529.             $context['_parent'] = $context;
  530.             $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); })()));
  531.             foreach ($context['_seq'] as $context["_key"] => $context["entry"]) {
  532.                 // line 130
  533.                 echo "            ";
  534.                 echo $this->extensions['Symfony\WebpackEncoreBundle\Twig\EntryFilesTwigExtension']->renderWebpackScriptTags($context["entry"]);
  535.                 echo "
  536.         ";
  537.             }
  538.             $_parent $context['_parent'];
  539.             unset($context['_seq'], $context['_iterated'], $context['_key'], $context['entry'], $context['_parent'], $context['loop']);
  540.             $context array_intersect_key($context$_parent) + $_parent;
  541.             // line 132
  542.             echo "    ";
  543.         }
  544.         
  545.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  546.         
  547.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  548.     }
  549.     // line 137
  550.     public function block_javascripts($context, array $blocks = [])
  551.     {
  552.         $macros $this->macros;
  553.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  554.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  555.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  556.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  557.         // line 138
  558.         echo "    ";
  559.         echo (isset($context["blockscontentjs"]) || array_key_exists("blockscontentjs"$context) ? $context["blockscontentjs"] : (function () { throw new RuntimeError('Variable "blockscontentjs" does not exist.'138$this->source); })());
  560.         echo "
  561.     ";
  562.         // line 141
  563.         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))) {
  564.             // line 142
  565.             echo "    document.addEventListener(\"DOMContentLoaded\", function () {
  566.         function getCookie(name) {
  567.             const value = `; \${document.cookie}`;
  568.             const parts = value.split(`; \${name}=`);
  569.             if (parts.length === 2) return parts.pop().split(';').shift();
  570.         }
  571.         // Calculate distance between two coordinates in km (Haversine formula)
  572.         function haversineDistance(lat1, lon1, lat2, lon2) {
  573.             const R = 6371; // Earth's radius in km
  574.             const dLat = (lat2 - lat1) * Math.PI / 180;
  575.             const dLon = (lon2 - lon1) * Math.PI / 180;
  576.             const a = Math.sin(dLat/2) * Math.sin(dLat/2) +
  577.                       Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
  578.                       Math.sin(dLon/2) * Math.sin(dLon/2);
  579.             const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
  580.             return R * c;
  581.         }
  582.         const LOCATION_VERIFY_INTERVAL = 10 * 60 * 1000;
  583.         let locationVerifyTimer = null;
  584.         function verifyLocationWithBackend() {
  585.             if (!(\"geolocation\" in navigator)) return;
  586.             
  587.             const lastLat = localStorage.getItem('lastLocationLat');
  588.             const lastLon = localStorage.getItem('lastLocationLon');
  589.             if (!lastLat || !lastLon) return;
  590.             
  591.             navigator.geolocation.getCurrentPosition(
  592.                 function(position) {
  593.                     const latitude = position.coords.latitude;
  594.                     const longitude = position.coords.longitude;
  595.                     
  596.                     ";
  597.             // line 177
  598.             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))) {
  599.                 // line 178
  600.                 echo "                    fetch(`/geo-location/verify?lon=\${longitude}&lat=\${latitude}`)
  601.                         .then(res => res.json())
  602.                         .then(data => {
  603.                             if (data.needs_update) {
  604.                                 fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=500`)
  605.                                     .then(res => res.json())
  606.                                     .then(updateData => {
  607.                                         if (!updateData.error) {
  608.                                             localStorage.setItem('lastLocationLat', latitude.toString());
  609.                                             localStorage.setItem('lastLocationLon', longitude.toString());
  610.                                             localStorage.setItem('lastLocationVerify', Date.now().toString());
  611.                                             location.reload();
  612.                                         }
  613.                                     })
  614.                                     .catch(err => console.error('[Location Verify] Update error:', err));
  615.                             } else {
  616.                                 localStorage.setItem('lastLocationVerify', Date.now().toString());
  617.                             }
  618.                         })
  619.                         .catch(() => {});
  620.                     ";
  621.             }
  622.             // line 199
  623.             echo "                },
  624.                 function() {},
  625.                 { enableHighAccuracy: false, timeout: 15000, maximumAge: 60000 }
  626.             );
  627.         }
  628.         function startLocationVerification() {
  629.             if (locationVerifyTimer) clearInterval(locationVerifyTimer);
  630.             locationVerifyTimer = setInterval(verifyLocationWithBackend, LOCATION_VERIFY_INTERVAL);
  631.             
  632.             document.addEventListener('visibilitychange', function() {
  633.                 if (document.visibilityState === 'visible') {
  634.                     const lastVerify = parseInt(localStorage.getItem('lastLocationVerify') || '0');
  635.                     if (Date.now() - lastVerify > 5 * 60 * 1000) verifyLocationWithBackend();
  636.                 }
  637.             });
  638.         }
  639.         if (localStorage.getItem('lastLocationLat') && localStorage.getItem('lastLocationLon')) {
  640.             startLocationVerification();
  641.         }
  642.         function updateLocationSilently() {
  643.             if (!(\"geolocation\" in navigator)) return;
  644.             
  645.             navigator.geolocation.getCurrentPosition(
  646.                 function (position) {
  647.                     const longitude = position.coords.longitude;
  648.                     const latitude = position.coords.latitude;
  649.                     const distance = 500;
  650.                     const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
  651.                     const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
  652.                     
  653.                     if (!isNaN(lastLat) && !isNaN(lastLon)) {
  654.                         const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
  655.                         if (distanceMoved <= 1) return; // Haven't moved much, skip update
  656.                     }
  657.                     ";
  658.             // line 238
  659.             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))) {
  660.                 // line 239
  661.                 echo "                    fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
  662.                         .then(res => res.json())
  663.                         .then(data => {
  664.                             if (!data.error) {
  665.                                 localStorage.setItem('lastLocationLat', latitude.toString());
  666.                                 localStorage.setItem('lastLocationLon', longitude.toString());
  667.                                 localStorage.setItem('lastLocationVerify', Date.now().toString());
  668.                                 localStorage.removeItem('locationReloaded'); 
  669.                             }
  670.                         })
  671.                         .catch(() => {});
  672.                     ";
  673.             }
  674.             // line 251
  675.             echo "                },
  676.                 function () {},
  677.                 {enableHighAccuracy: true, timeout: 10000, maximumAge: 0}
  678.             );
  679.         }
  680.         // Removed duplicate visibilitychange listener - now handled by startLocationVerification()
  681.         let cookieConsentGiven = false;
  682.         let locationAsked = false;
  683.         
  684.         function askLocationOnce() {
  685.             if (locationAsked) return;
  686.             if (localStorage.getItem('locationReloaded')) return;
  687.             locationAsked = true;
  688.             cookieConsentGiven = true;
  689.             clearInterval(intervalId);
  690.             tryAskLocation();
  691.         }
  692.         
  693.         function checkForExistingConsent() {
  694.             // Check localStorage for AdOpt consent (most reliable method)
  695.             const adoptConsent = localStorage.getItem('adopt-consent');
  696.             if (adoptConsent) {
  697.                 askLocationOnce();
  698.                 return true;
  699.             }
  700.             
  701.             // Check if banner is not present (consent already given on previous visit)
  702.             const banner = document.getElementById('cookie-banner');
  703.             if (!banner) {
  704.                 // Wait a bit for banner to potentially load
  705.                 setTimeout(function() {
  706.                     const bannerCheck = document.getElementById('cookie-banner');
  707.                     if (!bannerCheck) {
  708.                         askLocationOnce();
  709.                     }
  710.                 }, 2000);
  711.             }
  712.             return false;
  713.         }
  714.         
  715.         function setupCookieBannerListeners() {
  716.             // Listen for AdOpt custom events
  717.             window.addEventListener('adopt:consent', function() {
  718.                 askLocationOnce();
  719.             });
  720.             
  721.             // Listen for localStorage changes (AdOpt stores consent there)
  722.             window.addEventListener('storage', function(e) {
  723.                 if (e.key === 'adopt-consent' && e.newValue) {
  724.                     askLocationOnce();
  725.                 }
  726.             });
  727.             
  728.             document.addEventListener('click', function(e) {
  729.                 const target = e.target;
  730.                 if (target.id === 'adopt-accept-all-button' || 
  731.                     target.id === 'adopt-reject-all-button' ||
  732.                     target.closest('#adopt-accept-all-button') ||
  733.                     target.closest('#adopt-reject-all-button')) {
  734.                     // Small delay to let AdOpt process
  735.                     setTimeout(askLocationOnce, 500);
  736.                 }
  737.             });
  738.             
  739.             const observeBody = new MutationObserver(function(mutations) {
  740.                 mutations.forEach(function(mutation) {
  741.                     mutation.removedNodes.forEach(function(node) {
  742.                         if (node.id === 'cookie-banner' || (node.querySelector && node.querySelector('#cookie-banner'))) {
  743.                             setTimeout(askLocationOnce, 300);
  744.                             observeBody.disconnect();
  745.                         }
  746.                     });
  747.                 });
  748.             });
  749.             observeBody.observe(document.body, { childList: true, subtree: true });
  750.         }
  751.         function tryAskLocation() {
  752.             // if (localStorage.getItem('locationReloaded')) {
  753.             //     return;
  754.             // }
  755.             
  756.             //";
  757.             // line 336
  758.             echo "            // if (analyticsCookie === 'accepted') {
  759.                 if (\"geolocation\" in navigator) {
  760.                     navigator.geolocation.getCurrentPosition(
  761.                         function (position) {
  762.                             const longitude = position.coords.longitude;
  763.                             const latitude = position.coords.latitude;
  764.                             const distance = 500;
  765.                             // Check if user has moved significantly since last location update
  766.                             const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
  767.                             const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
  768.                             const locationReloaded = localStorage.getItem('locationReloaded');
  769.                             
  770.                             let shouldUpdate = !locationReloaded;
  771.                             
  772.                             // If we have previous coordinates, check if user moved > 1km
  773.                             if (locationReloaded && !isNaN(lastLat) && !isNaN(lastLon)) {
  774.                                 const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
  775.                                 if (distanceMoved > 1) { // More than 1km
  776.                                     shouldUpdate = true;
  777.                                     localStorage.removeItem('locationReloaded');
  778.                                 }
  779.                             }
  780.                             ";
  781.             // line 360
  782.             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))) {
  783.                 // line 361
  784.                 echo "                            fetch(`https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=\${latitude}&longitude=\${longitude}&localityLanguage=pt-PT`)
  785.                                 .then(res => res.json())
  786.                                 .then(data => {
  787.                                     const country = data.countryName;
  788.                                     const principalSubdivision = data.principalSubdivision;
  789.                                     const city = data.city;
  790.                                     const locality = data.locality;
  791.                                     localStorage.setItem('locations', country || '');
  792.                                     localStorage.setItem('municipality', principalSubdivision || '');
  793.                                     localStorage.setItem('city', city || '');
  794.                                     localStorage.setItem('locality', locality || '');
  795.                                     fetch('/ip-geo-location/accept', {
  796.                                         method: 'POST',
  797.                                         headers: {'Content-Type': 'application/json'},
  798.                                         body: JSON.stringify({country, city})
  799.                                     });
  800.                                 });
  801.                             ";
  802.             }
  803.             // line 381
  804.             echo "
  805.                             ";
  806.             // line 382
  807.             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))) {
  808.                 // line 383
  809.                 echo "                            fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
  810.                                 .then(res => res.json())
  811.                                 .then(data => {
  812.                                     if (!data.error) {
  813.                                         // Store current coordinates for future comparison
  814.                                         localStorage.setItem('lastLocationLat', latitude.toString());
  815.                                         localStorage.setItem('lastLocationLon', longitude.toString());
  816.                                         localStorage.setItem('lastLocationVerify', Date.now().toString());
  817.                                         
  818.                                         // Start periodic location verification
  819.                                         startLocationVerification();
  820.                                         
  821.                                         if (shouldUpdate) {
  822.                                             localStorage.setItem('locationReloaded', 'true');
  823.                                             location.reload();
  824.                                         }
  825.                                     } else {
  826.                                         console.error('Erro:', data.error);
  827.                                     }
  828.                                 })
  829.                                 .catch(err => {
  830.                                     console.error('Erro na requisição:', err);
  831.                                 });
  832.                             ";
  833.             }
  834.             // line 407
  835.             echo "
  836.                         },
  837.                         function (error) {
  838.                             if (error.code === error.PERMISSION_DENIED) {
  839.                                 localStorage.removeItem('locationReloaded');
  840.                                 localStorage.removeItem('lastLocationLat');
  841.                                 localStorage.removeItem('lastLocationLon');
  842.                             }
  843.                             console.error(\"Error getting location:\", error.message);
  844.                         },
  845.                         {enableHighAccuracy: true, timeout: 120000, maximumAge: 0}
  846.                     );
  847.                 } else {
  848.                     console.log(\"Geolocation is not supported by this browser.\");
  849.                 }
  850.             // } else if (analyticsCookie !== undefined && analyticsCookie !== '' && analyticsCookie !== 'accepted') {
  851.             //     clearInterval(intervalId);
  852.             // }
  853.         }
  854.         // Setup listeners for cookie consent
  855.         setupCookieBannerListeners();
  856.         
  857.         const intervalId = setInterval(function() {
  858.             if (checkForExistingConsent()) {
  859.                 clearInterval(intervalId);
  860.             }
  861.         }, 1000);
  862.         
  863.         // Initial check
  864.         checkForExistingConsent();
  865.     });
  866.     ";
  867.         }
  868.         // line 440
  869.         echo "
  870.     ";
  871.         
  872.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  873.         
  874.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  875.     }
  876.     public function getTemplateName()
  877.     {
  878.         return "layouts/base.html.twig";
  879.     }
  880.     public function isTraitable()
  881.     {
  882.         return false;
  883.     }
  884.     public function getDebugInfo()
  885.     {
  886.         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,);
  887.     }
  888.     public function getSourceContext()
  889.     {
  890.         return new Source("<!DOCTYPE html>
  891. <html lang=\"{% if languagecode is defined %}{{ languagecode.locale|default((app.request.getLocale()|default)) }}{% else %}{{ app.request.getLocale()|default }}{% endif %}\">
  892. <head>
  893.     {% block head -%}
  894.         {%- include 'partials\\\\head.html.twig' -%}
  895.     {%- endblock %}
  896. </head>
  897. <body{% block body_class %}{%- endblock %}>
  898. {{ get_config('scripts_body',app.request.getLocale())|default|raw }}
  899. {{ scriptsbody|default|raw }}
  900. {% if is_authenticated_in_studio() %}
  901.     {% include 'admin\\\\adminbar.html.twig' %}
  902. {% endif %}
  903. {% block body %}
  904.     <div class=\"wrap\">
  905.         {% block header %}
  906.             {% include 'partials\\\\variants\\\\' ~ get_config('header_style','') ~ '.html.twig' %}
  907.         {% endblock %}
  908.         {% if preview|default %}
  909.             <div class=\"mt-3 mx-4 alert alert-danger\">
  910.                 {{ 'is_preview'|trans({},'pages') }}
  911.             </div>
  912.         {% endif %}
  913.         {% block breadcrumb %}
  914.             {% include 'partials\\\\breadcrumb.html.twig' %}
  915.         {% endblock %}
  916.         <main>
  917.             {% block content %}
  918.                 {{ blockscontent|default|raw }}
  919.             {% endblock %}
  920.         </main>
  921.         {% block footer %}
  922.             {% block pub_standard %}
  923.                 {% if hide_pub is not defined or hide_pub == false %}
  924.                     {% if is_ad_zone_active('standard') %}
  925.                         {% include 'partials/ads-banners/standard.html.twig' %}
  926.                     {% endif %}
  927.                 {% endif %}
  928.             {% endblock %}
  929.             {% block pubs %}
  930.                 {% if is_ad_zone_active('layer') %}
  931.                     {% include 'partials/ads-banners/layer.html.twig' %}
  932.                 {% endif %}
  933.                 {% if is_ad_zone_active('xtrad') %}
  934.                     {% include 'partials/ads-banners/xtrad.html.twig' %}
  935.                 {% endif %}
  936.                 {% if is_mobile() and is_ad_zone_active('splash') %}
  937.                     {% include 'partials/ads-banners/splash.html.twig' %}
  938.                 {% endif %}
  939.             {% endblock %}
  940.             {% include 'partials\\\\variants\\\\' ~ get_config('footer_style','') ~ '.html.twig' %}
  941.             {% if get_config('mobilebottombar',locale)|default %}
  942.                 {% include 'partials\\\\elements\\\\mobile-bar.twig' %}
  943.             {% endif %}
  944.         {% endblock %}
  945.     </div>
  946. {% endblock %}
  947. {% block cookies %}
  948.     {% if get_config('cookies_pages', '')|default
  949.         and (
  950.         (get_env('COOKIE_DATABASE_ENABLED') and studio.getCookie() is null)
  951.         or
  952.         (not get_env('COOKIE_DATABASE_ENABLED') and app.request.cookies.get(get_env('COOKIE_STD_NAME'),'') == '')
  953.         ) %}
  954.         {% set cookiepage=get_page_info(app.request.locale,get_config('cookies_pages','')) %}
  955.         <div id=\"cookies-modal\" data-url=\"{{ cookiepage.url|default }}\"
  956.              data-accept=\"{{ path('std_cookies_accept') }}\"></div>
  957.     {% endif %}
  958. {% endblock %}
  959. {% block modalFlashes %}
  960.     {% set flashessuccess=app.flashes('success') %}
  961.     {% set flasheserror=app.flashes('error') %}
  962.     <div class=\"modal fade\" id=\"modalMessages\" tabindex=\"-1\">
  963.         <div class=\"modal-dialog modal-dialog modal-dialog-centered\" role=\"document\">
  964.             <div class=\"modal-content\">
  965.                 <div class=\"modal-body\">
  966.                     <button type=\"button\" class=\"close-modal ml-auto\" data-dismiss=\"modal\" aria-label=\"Close\">
  967.                         <span aria-hidden=\"true\">×</span>
  968.                     </button>
  969.                     <div class=\"js-modal-messages-content\">
  970.                         {% for message in flashessuccess %}
  971.                             {{ message|html_entity_decode|raw }}
  972.                         {% endfor %}
  973.                         {% for message in flasheserror %}
  974.                             {{ message|html_entity_decode|raw }}
  975.                         {% endfor %}
  976.                     </div>
  977.                 </div>
  978.             </div>
  979.         </div>
  980.     </div>
  981. {% endblock %}
  982. {% block scripts %}
  983.     {# ============================
  984.        Publicidade – Provider Loader
  985.        ============================ #}
  986.     {% set adsProvider = get_config('ads_provider', '')|default('none') %}
  987.     {% set adsScripts = get_config('ads_scripts', '')|default('') %}
  988.     {% if adsProvider == 'studio' %} 
  989.         <script src=\"/build/assets/js/ads-banners.js\"></script>
  990.     {%elseif adsScripts is defined and adsScripts != '' and adsProvider!='none' %}
  991.         {{ adsScripts|raw }}
  992.     {% endif %} 
  993.     {% include 'partials\\\\scripts.html.twig' %}
  994.     {% set webpackEntries=app.request.attributes.get('webpackEntries')|default([]) %}
  995.     {% if get_config('notificationsbar_page', '')|default %}
  996.         {% set webpackEntries=webpackEntries|merge(['B31_notificationsbar']) %}
  997.     {% endif %}
  998.     {% set webpackEntries=webpackEntries|merge(['slick-carousel']) %}
  999.     {% if get_config('newsletterblock_page', '')|default %}
  1000.         {% set webpackEntries=webpackEntries|merge(['validation_messages_' ~ locale]) %}
  1001.         {% set webpackEntries=webpackEntries|merge(['B32_newsletter']) %}
  1002.     {% endif %}
  1003.     {% if webpackEntries is defined %}
  1004.         {% for entry in webpackEntries %}
  1005.             {{ encore_entry_script_tags(entry) }}
  1006.         {% endfor %}
  1007.     {% endif %}
  1008. {% endblock %}
  1009. <script type=\"text/javascript\">
  1010.     {% block javascripts %}
  1011.     {{ blockscontentjs|raw }}
  1012.     {% if scripts_tracking_precise is defined and scripts_tracking_precise is same as(true) %}
  1013.     document.addEventListener(\"DOMContentLoaded\", function () {
  1014.         function getCookie(name) {
  1015.             const value = `; \${document.cookie}`;
  1016.             const parts = value.split(`; \${name}=`);
  1017.             if (parts.length === 2) return parts.pop().split(';').shift();
  1018.         }
  1019.         // Calculate distance between two coordinates in km (Haversine formula)
  1020.         function haversineDistance(lat1, lon1, lat2, lon2) {
  1021.             const R = 6371; // Earth's radius in km
  1022.             const dLat = (lat2 - lat1) * Math.PI / 180;
  1023.             const dLon = (lon2 - lon1) * Math.PI / 180;
  1024.             const a = Math.sin(dLat/2) * Math.sin(dLat/2) +
  1025.                       Math.cos(lat1 * Math.PI / 180) * Math.cos(lat2 * Math.PI / 180) *
  1026.                       Math.sin(dLon/2) * Math.sin(dLon/2);
  1027.             const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));
  1028.             return R * c;
  1029.         }
  1030.         const LOCATION_VERIFY_INTERVAL = 10 * 60 * 1000;
  1031.         let locationVerifyTimer = null;
  1032.         function verifyLocationWithBackend() {
  1033.             if (!(\"geolocation\" in navigator)) return;
  1034.             
  1035.             const lastLat = localStorage.getItem('lastLocationLat');
  1036.             const lastLon = localStorage.getItem('lastLocationLon');
  1037.             if (!lastLat || !lastLon) return;
  1038.             
  1039.             navigator.geolocation.getCurrentPosition(
  1040.                 function(position) {
  1041.                     const latitude = position.coords.latitude;
  1042.                     const longitude = position.coords.longitude;
  1043.                     
  1044.                     {% if use_geo_map_tracking is defined and use_geo_map_tracking is same as(true) %}
  1045.                     fetch(`/geo-location/verify?lon=\${longitude}&lat=\${latitude}`)
  1046.                         .then(res => res.json())
  1047.                         .then(data => {
  1048.                             if (data.needs_update) {
  1049.                                 fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=500`)
  1050.                                     .then(res => res.json())
  1051.                                     .then(updateData => {
  1052.                                         if (!updateData.error) {
  1053.                                             localStorage.setItem('lastLocationLat', latitude.toString());
  1054.                                             localStorage.setItem('lastLocationLon', longitude.toString());
  1055.                                             localStorage.setItem('lastLocationVerify', Date.now().toString());
  1056.                                             location.reload();
  1057.                                         }
  1058.                                     })
  1059.                                     .catch(err => console.error('[Location Verify] Update error:', err));
  1060.                             } else {
  1061.                                 localStorage.setItem('lastLocationVerify', Date.now().toString());
  1062.                             }
  1063.                         })
  1064.                         .catch(() => {});
  1065.                     {% endif %}
  1066.                 },
  1067.                 function() {},
  1068.                 { enableHighAccuracy: false, timeout: 15000, maximumAge: 60000 }
  1069.             );
  1070.         }
  1071.         function startLocationVerification() {
  1072.             if (locationVerifyTimer) clearInterval(locationVerifyTimer);
  1073.             locationVerifyTimer = setInterval(verifyLocationWithBackend, LOCATION_VERIFY_INTERVAL);
  1074.             
  1075.             document.addEventListener('visibilitychange', function() {
  1076.                 if (document.visibilityState === 'visible') {
  1077.                     const lastVerify = parseInt(localStorage.getItem('lastLocationVerify') || '0');
  1078.                     if (Date.now() - lastVerify > 5 * 60 * 1000) verifyLocationWithBackend();
  1079.                 }
  1080.             });
  1081.         }
  1082.         if (localStorage.getItem('lastLocationLat') && localStorage.getItem('lastLocationLon')) {
  1083.             startLocationVerification();
  1084.         }
  1085.         function updateLocationSilently() {
  1086.             if (!(\"geolocation\" in navigator)) return;
  1087.             
  1088.             navigator.geolocation.getCurrentPosition(
  1089.                 function (position) {
  1090.                     const longitude = position.coords.longitude;
  1091.                     const latitude = position.coords.latitude;
  1092.                     const distance = 500;
  1093.                     const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
  1094.                     const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
  1095.                     
  1096.                     if (!isNaN(lastLat) && !isNaN(lastLon)) {
  1097.                         const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
  1098.                         if (distanceMoved <= 1) return; // Haven't moved much, skip update
  1099.                     }
  1100.                     {% if use_geo_map_tracking is defined and use_geo_map_tracking is same as(true) %}
  1101.                     fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
  1102.                         .then(res => res.json())
  1103.                         .then(data => {
  1104.                             if (!data.error) {
  1105.                                 localStorage.setItem('lastLocationLat', latitude.toString());
  1106.                                 localStorage.setItem('lastLocationLon', longitude.toString());
  1107.                                 localStorage.setItem('lastLocationVerify', Date.now().toString());
  1108.                                 localStorage.removeItem('locationReloaded'); 
  1109.                             }
  1110.                         })
  1111.                         .catch(() => {});
  1112.                     {% endif %}
  1113.                 },
  1114.                 function () {},
  1115.                 {enableHighAccuracy: true, timeout: 10000, maximumAge: 0}
  1116.             );
  1117.         }
  1118.         // Removed duplicate visibilitychange listener - now handled by startLocationVerification()
  1119.         let cookieConsentGiven = false;
  1120.         let locationAsked = false;
  1121.         
  1122.         function askLocationOnce() {
  1123.             if (locationAsked) return;
  1124.             if (localStorage.getItem('locationReloaded')) return;
  1125.             locationAsked = true;
  1126.             cookieConsentGiven = true;
  1127.             clearInterval(intervalId);
  1128.             tryAskLocation();
  1129.         }
  1130.         
  1131.         function checkForExistingConsent() {
  1132.             // Check localStorage for AdOpt consent (most reliable method)
  1133.             const adoptConsent = localStorage.getItem('adopt-consent');
  1134.             if (adoptConsent) {
  1135.                 askLocationOnce();
  1136.                 return true;
  1137.             }
  1138.             
  1139.             // Check if banner is not present (consent already given on previous visit)
  1140.             const banner = document.getElementById('cookie-banner');
  1141.             if (!banner) {
  1142.                 // Wait a bit for banner to potentially load
  1143.                 setTimeout(function() {
  1144.                     const bannerCheck = document.getElementById('cookie-banner');
  1145.                     if (!bannerCheck) {
  1146.                         askLocationOnce();
  1147.                     }
  1148.                 }, 2000);
  1149.             }
  1150.             return false;
  1151.         }
  1152.         
  1153.         function setupCookieBannerListeners() {
  1154.             // Listen for AdOpt custom events
  1155.             window.addEventListener('adopt:consent', function() {
  1156.                 askLocationOnce();
  1157.             });
  1158.             
  1159.             // Listen for localStorage changes (AdOpt stores consent there)
  1160.             window.addEventListener('storage', function(e) {
  1161.                 if (e.key === 'adopt-consent' && e.newValue) {
  1162.                     askLocationOnce();
  1163.                 }
  1164.             });
  1165.             
  1166.             document.addEventListener('click', function(e) {
  1167.                 const target = e.target;
  1168.                 if (target.id === 'adopt-accept-all-button' || 
  1169.                     target.id === 'adopt-reject-all-button' ||
  1170.                     target.closest('#adopt-accept-all-button') ||
  1171.                     target.closest('#adopt-reject-all-button')) {
  1172.                     // Small delay to let AdOpt process
  1173.                     setTimeout(askLocationOnce, 500);
  1174.                 }
  1175.             });
  1176.             
  1177.             const observeBody = new MutationObserver(function(mutations) {
  1178.                 mutations.forEach(function(mutation) {
  1179.                     mutation.removedNodes.forEach(function(node) {
  1180.                         if (node.id === 'cookie-banner' || (node.querySelector && node.querySelector('#cookie-banner'))) {
  1181.                             setTimeout(askLocationOnce, 300);
  1182.                             observeBody.disconnect();
  1183.                         }
  1184.                     });
  1185.                 });
  1186.             });
  1187.             observeBody.observe(document.body, { childList: true, subtree: true });
  1188.         }
  1189.         function tryAskLocation() {
  1190.             // if (localStorage.getItem('locationReloaded')) {
  1191.             //     return;
  1192.             // }
  1193.             
  1194.             //{#const analyticsCookie = getCookie('{{ get_env(\"COOKIE_STD_ANALYTICS_NAME\") }}');#}
  1195.             // if (analyticsCookie === 'accepted') {
  1196.                 if (\"geolocation\" in navigator) {
  1197.                     navigator.geolocation.getCurrentPosition(
  1198.                         function (position) {
  1199.                             const longitude = position.coords.longitude;
  1200.                             const latitude = position.coords.latitude;
  1201.                             const distance = 500;
  1202.                             // Check if user has moved significantly since last location update
  1203.                             const lastLat = parseFloat(localStorage.getItem('lastLocationLat'));
  1204.                             const lastLon = parseFloat(localStorage.getItem('lastLocationLon'));
  1205.                             const locationReloaded = localStorage.getItem('locationReloaded');
  1206.                             
  1207.                             let shouldUpdate = !locationReloaded;
  1208.                             
  1209.                             // If we have previous coordinates, check if user moved > 1km
  1210.                             if (locationReloaded && !isNaN(lastLat) && !isNaN(lastLon)) {
  1211.                                 const distanceMoved = haversineDistance(lastLat, lastLon, latitude, longitude);
  1212.                                 if (distanceMoved > 1) { // More than 1km
  1213.                                     shouldUpdate = true;
  1214.                                     localStorage.removeItem('locationReloaded');
  1215.                                 }
  1216.                             }
  1217.                             {% if use_api_tracking is defined and use_api_tracking is same as(true) %}
  1218.                             fetch(`https://api.bigdatacloud.net/data/reverse-geocode-client?latitude=\${latitude}&longitude=\${longitude}&localityLanguage=pt-PT`)
  1219.                                 .then(res => res.json())
  1220.                                 .then(data => {
  1221.                                     const country = data.countryName;
  1222.                                     const principalSubdivision = data.principalSubdivision;
  1223.                                     const city = data.city;
  1224.                                     const locality = data.locality;
  1225.                                     localStorage.setItem('locations', country || '');
  1226.                                     localStorage.setItem('municipality', principalSubdivision || '');
  1227.                                     localStorage.setItem('city', city || '');
  1228.                                     localStorage.setItem('locality', locality || '');
  1229.                                     fetch('/ip-geo-location/accept', {
  1230.                                         method: 'POST',
  1231.                                         headers: {'Content-Type': 'application/json'},
  1232.                                         body: JSON.stringify({country, city})
  1233.                                     });
  1234.                                 });
  1235.                             {% endif %}
  1236.                             {% if use_geo_map_tracking is defined and use_geo_map_tracking is same as(true) %}
  1237.                             fetch(`/geo-location/accept?lon=\${longitude}&lat=\${latitude}&distance=\${distance}`)
  1238.                                 .then(res => res.json())
  1239.                                 .then(data => {
  1240.                                     if (!data.error) {
  1241.                                         // Store current coordinates for future comparison
  1242.                                         localStorage.setItem('lastLocationLat', latitude.toString());
  1243.                                         localStorage.setItem('lastLocationLon', longitude.toString());
  1244.                                         localStorage.setItem('lastLocationVerify', Date.now().toString());
  1245.                                         
  1246.                                         // Start periodic location verification
  1247.                                         startLocationVerification();
  1248.                                         
  1249.                                         if (shouldUpdate) {
  1250.                                             localStorage.setItem('locationReloaded', 'true');
  1251.                                             location.reload();
  1252.                                         }
  1253.                                     } else {
  1254.                                         console.error('Erro:', data.error);
  1255.                                     }
  1256.                                 })
  1257.                                 .catch(err => {
  1258.                                     console.error('Erro na requisição:', err);
  1259.                                 });
  1260.                             {% endif %}
  1261.                         },
  1262.                         function (error) {
  1263.                             if (error.code === error.PERMISSION_DENIED) {
  1264.                                 localStorage.removeItem('locationReloaded');
  1265.                                 localStorage.removeItem('lastLocationLat');
  1266.                                 localStorage.removeItem('lastLocationLon');
  1267.                             }
  1268.                             console.error(\"Error getting location:\", error.message);
  1269.                         },
  1270.                         {enableHighAccuracy: true, timeout: 120000, maximumAge: 0}
  1271.                     );
  1272.                 } else {
  1273.                     console.log(\"Geolocation is not supported by this browser.\");
  1274.                 }
  1275.             // } else if (analyticsCookie !== undefined && analyticsCookie !== '' && analyticsCookie !== 'accepted') {
  1276.             //     clearInterval(intervalId);
  1277.             // }
  1278.         }
  1279.         // Setup listeners for cookie consent
  1280.         setupCookieBannerListeners();
  1281.         
  1282.         const intervalId = setInterval(function() {
  1283.             if (checkForExistingConsent()) {
  1284.                 clearInterval(intervalId);
  1285.             }
  1286.         }, 1000);
  1287.         
  1288.         // Initial check
  1289.         checkForExistingConsent();
  1290.     });
  1291.     {% endif %}
  1292.     {% endblock %}
  1293. </script>
  1294. {{ get_config('scripts_footer',app.request.getLocale())|default|raw }}
  1295. {{ scriptsfooter|default|raw }}
  1296. </body>
  1297. </html>
  1298. ""layouts/base.html.twig""/var/www/html/theme/templates/layouts/base.html.twig");
  1299.     }
  1300. }