var/cache/dev/twig/ba/bacce819c845ded04f8abfb14ab70b41.php line 55

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\Markup;
  8. use Twig\Sandbox\SecurityError;
  9. use Twig\Sandbox\SecurityNotAllowedTagError;
  10. use Twig\Sandbox\SecurityNotAllowedFilterError;
  11. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  12. use Twig\Source;
  13. use Twig\Template;
  14. use Twig\TemplateWrapper;
  15. /* analytic/explore.html.twig */
  16. class __TwigTemplate_f05d055baa959720d7643e8266c8175b extends Template
  17. {
  18.     private Source $source;
  19.     /**
  20.      * @var array<string, Template>
  21.      */
  22.     private array $macros = [];
  23.     public function __construct(Environment $env)
  24.     {
  25.         parent::__construct($env);
  26.         $this->source $this->getSourceContext();
  27.         $this->blocks = [
  28.             'title' => [$this'block_title'],
  29.             'content' => [$this'block_content'],
  30.             'javascripts' => [$this'block_javascripts'],
  31.         ];
  32.     }
  33.     protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  34.     {
  35.         // line 1
  36.         return "Layouts/layout.html.twig";
  37.     }
  38.     protected function doDisplay(array $context, array $blocks = []): iterable
  39.     {
  40.         $macros $this->macros;
  41.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  42.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""analytic/explore.html.twig"));
  43.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  44.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template""analytic/explore.html.twig"));
  45.         $this->parent $this->loadTemplate("Layouts/layout.html.twig""analytic/explore.html.twig"1);
  46.         yield from $this->parent->unwrap()->yield($contextarray_merge($this->blocks$blocks));
  47.         
  48.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  49.         
  50.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  51.     }
  52.     // line 3
  53.     /**
  54.      * @return iterable<null|scalar|\Stringable>
  55.      */
  56.     public function block_title(array $context, array $blocks = []): iterable
  57.     {
  58.         $macros $this->macros;
  59.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  60.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  61.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  62.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""title"));
  63.         yield " Retabit Platform ";
  64.         
  65.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  66.         
  67.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  68.         yield from [];
  69.     }
  70.     // line 5
  71.     /**
  72.      * @return iterable<null|scalar|\Stringable>
  73.      */
  74.     public function block_content(array $context, array $blocks = []): iterable
  75.     {
  76.         $macros $this->macros;
  77.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  78.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  79.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  80.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""content"));
  81.         // line 6
  82.         yield "
  83.     ";
  84.         // line 7
  85.         $context['_parent'] = $context;
  86.         $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'7$this->source); })()), "flashes", ["notice"], "method"falsefalsefalse7));
  87.         foreach ($context['_seq'] as $context["_key"] => $context["message"]) {
  88.             // line 8
  89.             yield "        <div class=\"flash-notice\" id=\"flash_div\">
  90.             <div class=\"text-end\"><span class=\"material-symbols-outlined hover\" onclick=\"removeDiv('flash_div')\">close</span></div>
  91.             <div class=\"container\">
  92.                 <p>";
  93.             // line 11
  94.             yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans($context["message"]), "html"nulltrue);
  95.             yield "</p>
  96.             </div>
  97.         </div>
  98.     ";
  99.         }
  100.         $_parent $context['_parent'];
  101.         unset($context['_seq'], $context['_key'], $context['message'], $context['_parent']);
  102.         $context array_intersect_key($context$_parent) + $_parent;
  103.         // line 15
  104.         yield "
  105.     <div class=\"modal fade\" id=\"popUpIndicadores\" tabindex=\"-1\" >
  106.         <div class=\"modal-dialog modal-lg\">
  107.             <div class=\"modal-content\">
  108.                 <div class=\"modal-header\">
  109.                     <h1 class=\"modal-title fs-5\" id=\"exampleModalLabel\">";
  110.         // line 20
  111.         yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Selecciona los indicadores para descargar en un fichero Excel", [], "messages");
  112.         yield "</h1>
  113.                     <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
  114.                 </div>
  115.                 <div class=\"modal-body\">
  116.                     <div class=\"row\">
  117.                         <a id=\"selectAllBtn\" class=\"px-5 mb-2\" style=\"cursor: pointer; font-weight: 400; text-decoration:none;\">";
  118.         // line 25
  119.         yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Seleccionar Todos", [], "messages");
  120.         yield "</a>
  121.                         <div class=\"col-12 px-5\" id=\"project_actions_content\">
  122.                             
  123.                         </div>
  124.                         <div class=\"text-center\" id=\"popUpIndicadores_button\">
  125.                             <button class=\"btn btn-primary\" onclick=\"getExcel()\">";
  126.         // line 30
  127.         yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Descargar", [], "messages");
  128.         yield " selección</button>
  129.                         </div>
  130.                     </div>
  131.                 </div>
  132.             </div>
  133.         </div>
  134.     </div>
  135.     <div class=\"container-fluid project_explore_container\" id=\"container_in_content\">
  136.         <div class=\"row justify-content-center\">
  137.             <div id=\"infoview_content\" class=\"col-12\">
  138.                 ";
  139.         // line 44
  140.         yield "                ";
  141.         $context['_parent'] = $context;
  142.         $context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data"]) || array_key_exists("analytic_data"$context) ? $context["analytic_data"] : (function () { throw new RuntimeError('Variable "analytic_data" does not exist.'44$this->source); })()));
  143.         foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
  144.             // line 45
  145.             yield "                ";
  146.             if ((CoreExtension::getAttribute($this->env$this->source$context["item"], "slug", [], "any"falsefalsefalse45) == (isset($context["slug"]) || array_key_exists("slug"$context) ? $context["slug"] : (function () { throw new RuntimeError('Variable "slug" does not exist.'45$this->source); })()))) {
  147.                 // line 46
  148.                 yield "                    ";
  149.                 // line 47
  150.                 yield "                <div class=\"row justify-content-center\">
  151.                     <!-- Textai box -->
  152.                     <div class=\"col-12 p-3\" id=\"header_content_info_top\">
  153.                         
  154.                         <div class=\"d-flex justify-content-between align-items-center\">
  155.                             <h2 class=\"d-inline-block\" data-bs-toggle=\"collapse\" href=\"#textai_box\" role=\"button\" aria-expanded=\"false\" aria-controls=\"textai_box\" onclick=\"expandIcon('analytics_title_arrow')\" >
  156.                                 ";
  157.                 // line 53
  158.                 if ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'53$this->source); })()), "request", [], "any"falsefalsefalse53), "locale", [], "any"falsefalsefalse53) == "ca")) {
  159.                     // line 54
  160.                     yield "                                    ";
  161.                     yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["item"], "name_ca", [], "any"falsefalsefalse54), "html"nulltrue);
  162.                     yield "
  163.                                 ";
  164.                 } elseif ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source,                 // line 55
  165. (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'55$this->source); })()), "request", [], "any"falsefalsefalse55), "locale", [], "any"falsefalsefalse55) == "en")) {
  166.                     // line 56
  167.                     yield "                                    ";
  168.                     yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["item"], "name_en", [], "any"falsefalsefalse56), "html"nulltrue);
  169.                     yield "
  170.                                 ";
  171.                 } else {
  172.                     // line 58
  173.                     yield "                                    ";
  174.                     yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["item"], "name", [], "any"falsefalsefalse58), "html"nulltrue);
  175.                     yield "
  176.                                 ";
  177.                 }
  178.                 // line 60
  179.                 yield "                                 
  180.                                 <span class=\"material-symbols-outlined hover\" id=\"analytics_title_arrow\">expand_more</span>
  181.                             </h2>
  182.                             <div class=\"d-flex\">
  183.                                 <div class=\"d-flex align-items-center\">                                    
  184.                                     <button class=\"btn btn-primary btn-sm\" onclick=\"loadSelectorIndicators()\">";
  185.                 // line 65
  186.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Descargar datos", [], "messages");
  187.                 yield "</button>
  188.                                 </div>
  189.                                 
  190.                             </div>
  191.                         </div>
  192.                         <div class=\"collapse\" id=\"textai_box\" style=\"max-width: 940px;\">
  193.                             <p class=\"flex-fill mb-3\" style=\"font-size: 14px;\">";
  194.                 // line 72
  195.                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["item"], "textai", [], "any"falsefalsefalse72), "html"nulltrue);
  196.                 yield "</p>
  197.                         </div>
  198.                         
  199.                     </div>
  200.                     
  201.                     <div class=\"col-12 all_steps\" id=\"analytic_step\">
  202.                         <div class=\"row justify-content-center align-items-top\">
  203.                             <div id=\"infoview\" class=\"infoview_div col-12\">
  204.                                 <div class=\"row align-items-center justify-content-center\">
  205.                                     
  206.                                     <div class=\"col-12 collapse show\" id=\"filter_div\">
  207.                                         <div class=\"row align-items-center justify-content-center\">
  208.                                             
  209.                                         </div>
  210.                                     </div>
  211.                                 </div>
  212.                                 <div class=\"row viewfindergroup\" id=\"map_view\" >
  213.                                     <div class=\"col-12\">
  214.                                         
  215.                                         <div class=\"map__container\" style=\"position:relative;\">
  216.                                             <div id=\"map\" class=\"map\"></div>
  217.                                             <div class=\"legend\"></div>
  218.                                             <div id=\"popup\" class=\"popup d-none\">
  219.                                                 <a href=\"#\" id=\"popup-closer\" class=\"popup__closer\"></a>
  220.                                                 <div id=\"popup-content\" class=\"popup__content\"></div>
  221.                                             </div>
  222.                                             <button id=\"centerbutton\" class=\"btn btn-light btn-sm pb-0\" onclick=\"centerViewMap()\">
  223.                                             <span class=\"material-symbols-outlined\">fit_screen</span>
  224.                                             <span class=\"material-symbols-outlined d-none\">collapse_content</span></button>
  225.                                             <button id=\"expand\" class=\"btn btn-light btn-sm pb-0\" onclick=\"infoviewToggle()\">
  226.                                             <span class=\"material-symbols-outlined\">expand_content</span></button>
  227.                                         </div>
  228.                                     </div>
  229.                                 </div>
  230.                                 <div class=\"row viewfindergroup\" id=\"data_view\">
  231.                                     <div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
  232.                                         <div id=\"wrapper\"></div>
  233.                                     </div>
  234.                                 </div>
  235.                                 <div class=\"row viewfindergroup\" id=\"card_view\" >
  236.                                     <div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
  237.                                         <form class=\"row row-cols-lg-auto g-2 align-items-center mb-2 d-none\">
  238.                                             <div class=\"col-12\">
  239.                                                 <label class=\"visually-hidden\" for=\"via\">";
  240.                 // line 123
  241.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Tipo via", [], "messages");
  242.                 yield "</label>
  243.                                                 <select class=\"form-select\" id=\"via\">
  244.                                                     <option value=\"1\">";
  245.                 // line 125
  246.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Calle", [], "messages");
  247.                 yield "</option>
  248.                                                     <option value=\"2\">";
  249.                 // line 126
  250.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Avenida", [], "messages");
  251.                 yield "</option>
  252.                                                     <option value=\"3\">";
  253.                 // line 127
  254.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Rambla", [], "messages");
  255.                 yield "</option>
  256.                                                 </select>
  257.                                             </div>
  258.                                             <div class=\"col-12\">
  259.                                                 <label class=\"visually-hidden\" for=\"street_name\">";
  260.                 // line 132
  261.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Nombre calle", [], "messages");
  262.                 yield "</label>
  263.                                                 <div class=\"input-group\">
  264.                                                     <input type=\"text\" class=\"form-control\" id=\"street\" placeholder=\"Nombre de calle\">
  265.                                                 </div>
  266.                                             </div>
  267.                                             <div class=\"col-12\">
  268.                                                 <label class=\"visually-hidden\" for=\"flat\">";
  269.                 // line 139
  270.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Piso", [], "messages");
  271.                 yield "</label>
  272.                                                 <div class=\"input-group\">
  273.                                                     <input type=\"text\" class=\"form-control\" id=\"flat\" placeholder=\"Piso\">
  274.                                                 </div>
  275.                                             </div>
  276.                                             <div class=\"col-12\">
  277.                                                 <label class=\"visually-hidden\" for=\"floor\">";
  278.                 // line 146
  279.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Planta", [], "messages");
  280.                 yield "</label>
  281.                                                 <div class=\"input-group\">
  282.                                                     <input type=\"text\" class=\"form-control\" id=\"floor\" placeholder=\"Pta.\">
  283.                                                 </div>
  284.                                             </div>
  285.                                             <div class=\"col-12\">
  286.                                                 <button type=\"submit\" class=\"btn btn-primary pb-0\"><span class=\"material-symbols-outlined\">search</span></button>
  287.                                             </div>
  288.                                         </form>
  289.                                         <div class=\"row\" style=\" padding: 20px; margin-bottom: 40px;    box-sizing: border-box;\">
  290.                                             <div class=\"col-6 col-sm-3 overflow-hidden\" id=\"img_fachada\" style=\"background: #fbfbfb;  padding: 20px;\"></div>
  291.                                             
  292.                                             <div class=\"col-6 col-sm-3 overflow-hidden me-4\" id=\"img_catastro\" style=\"background: #fbfbfb;  padding: 20px;\"></div>
  293.                                             <div class=\"col-12 col-sm-5\" id=\"txt_build\"></div>
  294.                                             
  295.                                         </div>
  296.                                         
  297.                                         <div class=\"row g-3\" id=\"build_indicators\">
  298.                                         </div>
  299.                                     </div>
  300.                                 </div>
  301.                             </div>
  302.                             <div id=\"infoview2\" class=\"infoview2_div collapse collapse-horizontal show\">
  303.                                     
  304.                                 
  305.                                 <!-- Selected box -->
  306.                                 <div class=\"col-12 selected_box p-3 mb-3 sticky-top d-none\">
  307.                                     <h4>";
  308.                 // line 175
  309.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Indicador seleccionado", [], "messages");
  310.                 yield "</h4>
  311.                                     <div id=\"selected_box_content\" class=\"selected_box_item\" title=\"Header\" data-bs-toggle=\"popover_live_top\" data-bs-trigger=\"hover focus\" data-bs-title=\"Popover title\" data-bs-content=\"And here's some amazing content. It's very engaging. Right?\"></div>
  312.                                 </div>
  313.                                 <!-- Indicadores box -->
  314.                                 <div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
  315.                                     <div class=\"d-flex justify-content-between\">
  316.                                         <p class=\"fw-bold fs-5\">";
  317.                 // line 182
  318.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Indicadores relacionados", [], "messages");
  319.                 yield "</p>
  320.                                         
  321.                                     </div>
  322.                                     <div class=\"\" id=\"analytics_indicators\">
  323.                                         ";
  324.                 // line 186
  325.                 $context["break"] = false;
  326.                 // line 187
  327.                 yield "                                        ";
  328.                 $context["array_used"] = [];
  329.                 // line 188
  330.                 yield "                                        ";
  331.                 $context["category"] = "";
  332.                 // line 189
  333.                 yield "
  334.                                         ";
  335.                 // line 191
  336.                 yield "                                        ";
  337.                 // line 192
  338.                 yield "
  339.                                         ";
  340.                 // line 193
  341.                 $context['_parent'] = $context;
  342.                 $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env$this->source$context["item"], "relation", [], "any"falsefalsefalse193));
  343.                 $context['loop'] = [
  344.                   'parent' => $context['_parent'],
  345.                   'index0' => 0,
  346.                   'index'  => 1,
  347.                   'first'  => true,
  348.                 ];
  349.                 if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  350.                     $length count($context['_seq']);
  351.                     $context['loop']['revindex0'] = $length 1;
  352.                     $context['loop']['revindex'] = $length;
  353.                     $context['loop']['length'] = $length;
  354.                     $context['loop']['last'] = === $length;
  355.                 }
  356.                 foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
  357.                     // line 194
  358.                     yield "                                            ";
  359.                     if (((isset($context["break"]) || array_key_exists("break"$context) ? $context["break"] : (function () { throw new RuntimeError('Variable "break" does not exist.'194$this->source); })()) == false)) {
  360.                         // line 195
  361.                         yield "
  362.                                             ";
  363.                         // line 197
  364.                         yield "
  365.                                             ";
  366.                         // line 198
  367.                         if ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'198$this->source); })()), "request", [], "any"falsefalsefalse198), "locale", [], "any"falsefalsefalse198) == "ca")) {
  368.                             // line 199
  369.                             yield "                                                ";
  370.                             $context["title"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "name_ca", [], "any"falsefalsefalse199);
  371.                             // line 200
  372.                             yield "                                                ";
  373.                             $context["description"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "info_ca", [], "any"falsefalsefalse200);
  374.                             // line 201
  375.                             yield "                                            ";
  376.                         } elseif ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'201$this->source); })()), "request", [], "any"falsefalsefalse201), "locale", [], "any"falsefalsefalse201) == "en")) {
  377.                             // line 202
  378.                             yield "                                                ";
  379.                             $context["title"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "name_en", [], "any"falsefalsefalse202);
  380.                             // line 203
  381.                             yield "                                                ";
  382.                             $context["description"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "info_en", [], "any"falsefalsefalse203);
  383.                             // line 204
  384.                             yield "                                            ";
  385.                         } else {
  386.                             // line 205
  387.                             yield "                                                ";
  388.                             $context["title"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse205);
  389.                             // line 206
  390.                             yield "                                                ";
  391.                             $context["description"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "info", [], "any"falsefalsefalse206);
  392.                             // line 207
  393.                             yield "                                            ";
  394.                         }
  395.                         // line 208
  396.                         yield "
  397.                                             ";
  398.                         // line 209
  399.                         $context["array_used"] = Twig\Extension\CoreExtension::merge((isset($context["array_used"]) || array_key_exists("array_used"$context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.'209$this->source); })()), [CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse209)]);
  400.                         // line 210
  401.                         yield "                                            
  402.                                             <div id=\"statline_id_";
  403.                         // line 211
  404.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse211), "html"nulltrue);
  405.                         yield "\" onclick=\"updateMapFromDiv(";
  406.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse211), "html"nulltrue);
  407.                         yield ")\" class=\"grayscale analytics_statsline_item\" data-kpi=\"";
  408.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse211), "html"nulltrue);
  409.                         yield "\" data-slug=\"";
  410.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "slug", [], "any"falsefalsefalse211), "html"nulltrue);
  411.                         yield "\" data-bs-toggle=\"popover_live_";
  412.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse211), "html"nulltrue);
  413.                         yield "\" data-bs-trigger=\"hover focus\" data-bs-title=\"";
  414.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title"$context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.'211$this->source); })())), "html"nulltrue);
  415.                         yield "\" data-bs-content=\"";
  416.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["description"]) || array_key_exists("description"$context) ? $context["description"] : (function () { throw new RuntimeError('Variable "description" does not exist.'211$this->source); })()), "html"nulltrue);
  417.                         yield "\" data-p=\"";
  418.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "province", [], "any"falsefalsefalse211), "html"nulltrue);
  419.                         yield "\" data-m=\"";
  420.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "city", [], "any"falsefalsefalse211), "html"nulltrue);
  421.                         yield "\" data-r=\"";
  422.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "region", [], "any"falsefalsefalse211), "html"nulltrue);
  423.                         yield "\" data-max=\"";
  424.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "max_value", [], "any"falsefalsefalse211), "html"nulltrue);
  425.                         yield "\" data-min=\"";
  426.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "min_value", [], "any"falsefalsefalse211), "html"nulltrue);
  427.                         yield "\">
  428.                                             
  429.                                                 <p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">";
  430.                         // line 214
  431.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title"$context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.'214$this->source); })())), "html"nulltrue);
  432.                         yield "</p>
  433.                                                 <div class=\"statsline mb-3\" >
  434.                                                     ";
  435.                         // line 217
  436.                         $context["color"] = [];
  437.                         // line 218
  438.                         yield "                                                    ";
  439.                         $context['_parent'] = $context;
  440.                         $context['_seq'] = CoreExtension::ensureTraversable((isset($context["kpi_rank"]) || array_key_exists("kpi_rank"$context) ? $context["kpi_rank"] : (function () { throw new RuntimeError('Variable "kpi_rank" does not exist.'218$this->source); })()));
  441.                         foreach ($context['_seq'] as $context["_key"] => $context["rank"]) {
  442.                             // line 219
  443.                             yield "                                                        
  444.                                                         ";
  445.                             // line 220
  446.                             if ((CoreExtension::getAttribute($this->env$this->source$context["rank"], "kpi_id", [], "any"falsefalsefalse220) == CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse220))) {
  447.                                 // line 221
  448.                                 yield "                                                            ";
  449.                                 $context["color"] = Twig\Extension\CoreExtension::merge((isset($context["color"]) || array_key_exists("color"$context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.'221$this->source); })()), [CoreExtension::getAttribute($this->env$this->source$context["rank"], "bgcolor", [], "any"falsefalsefalse221)]);
  450.                                 // line 222
  451.                                 yield "                                                        ";
  452.                             }
  453.                             // line 223
  454.                             yield "
  455.                                                     ";
  456.                         }
  457.                         $_parent $context['_parent'];
  458.                         unset($context['_seq'], $context['_key'], $context['rank'], $context['_parent']);
  459.                         $context array_intersect_key($context$_parent) + $_parent;
  460.                         // line 225
  461.                         yield "                                                    ";
  462.                         $context["counter"] = Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["color"]) || array_key_exists("color"$context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.'225$this->source); })()));
  463.                         // line 226
  464.                         yield "                                                    ";
  465.                         $context["partsize"] = (100 / (isset($context["counter"]) || array_key_exists("counter"$context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.'226$this->source); })()));
  466.                         // line 227
  467.                         yield "                                                    ";
  468.                         $context["stylestring"] = "";
  469.                         // line 228
  470.                         yield "
  471.                                                     <div class=\"bk_line\">
  472.                                                     ";
  473.                         // line 231
  474.                         $context['_parent'] = $context;
  475.                         $context['_seq'] = CoreExtension::ensureTraversable((isset($context["color"]) || array_key_exists("color"$context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.'231$this->source); })()));
  476.                         $context['loop'] = [
  477.                           'parent' => $context['_parent'],
  478.                           'index0' => 0,
  479.                           'index'  => 1,
  480.                           'first'  => true,
  481.                         ];
  482.                         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  483.                             $length count($context['_seq']);
  484.                             $context['loop']['revindex0'] = $length 1;
  485.                             $context['loop']['revindex'] = $length;
  486.                             $context['loop']['length'] = $length;
  487.                             $context['loop']['last'] = === $length;
  488.                         }
  489.                         foreach ($context['_seq'] as $context["_key"] => $context["colorpart"]) {
  490.                             // line 232
  491.                             yield "                                                        ";
  492.                             if (CoreExtension::getAttribute($this->env$this->source$context["loop"], "last", [], "any"falsefalsefalse232)) {
  493.                                 // line 233
  494.                                 yield "                                                        ";
  495.                                 $context["dato"] = (99.9 - ((isset($context["partsize"]) || array_key_exists("partsize"$context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.'233$this->source); })()) * ((isset($context["counter"]) || array_key_exists("counter"$context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.'233$this->source); })()) - 1)));
  496.                                 // line 234
  497.                                 yield "                                                            <div class=\"analytic_color_bar\" style=\"width:";
  498.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["dato"]) || array_key_exists("dato"$context) ? $context["dato"] : (function () { throw new RuntimeError('Variable "dato" does not exist.'234$this->source); })()), "html"nulltrue);
  499.                                 yield "%; background-color: ";
  500.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html"nulltrue);
  501.                                 yield ";\"></div>
  502.                                                         ";
  503.                             } else {
  504.                                 // line 236
  505.                                 yield "                                                            <div class=\"analytic_color_bar\" style=\"width:";
  506.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["partsize"]) || array_key_exists("partsize"$context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.'236$this->source); })()), 2"."), "html"nulltrue);
  507.                                 yield "%; background-color: ";
  508.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html"nulltrue);
  509.                                 yield ";\"></div>        
  510.                                                         ";
  511.                             }
  512.                             // line 238
  513.                             yield "                                                        
  514.                                                     ";
  515.                             ++$context['loop']['index0'];
  516.                             ++$context['loop']['index'];
  517.                             $context['loop']['first'] = false;
  518.                             if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  519.                                 --$context['loop']['revindex0'];
  520.                                 --$context['loop']['revindex'];
  521.                                 $context['loop']['last'] = === $context['loop']['revindex0'];
  522.                             }
  523.                         }
  524.                         $_parent $context['_parent'];
  525.                         unset($context['_seq'], $context['_key'], $context['colorpart'], $context['_parent'], $context['loop']);
  526.                         $context array_intersect_key($context$_parent) + $_parent;
  527.                         // line 240
  528.                         yield "                                                    
  529.                                                     </div>
  530.                                                     
  531.                                                     <span class=\"statsline_item statsline_";
  532.                         // line 243
  533.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse243), "html"nulltrue);
  534.                         yield " item_tooltip\" style=\"left: ";
  535.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "theme_per", [], "any"falsefalsefalse243), "html"nulltrue);
  536.                         yield "%;margin-left: -6px;\" data-text=\"";
  537.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "theme", [], "any"falsefalsefalse243), "html"nulltrue);
  538.                         yield "\" data-kpi=\"";
  539.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse243), "html"nulltrue);
  540.                         yield "\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
  541.                                                     
  542.                                                 </div>
  543.                                                 <div class=\"statsline_range d-flex justify-content-between d-none\">
  544.                                                     <span>";
  545.                         // line 247
  546.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "min_value", [], "any"falsefalsefalse247), "html"nulltrue);
  547.                         yield "</span>
  548.                                                     <span>";
  549.                         // line 248
  550.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "max_value", [], "any"falsefalsefalse248), "html"nulltrue);
  551.                         yield "</span>
  552.                                                 </div>
  553.                                                 ";
  554.                         // line 251
  555.                         if ((CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse251) == 4)) {
  556.                             // line 252
  557.                             yield "                                                ";
  558.                             $context["break"] = true;
  559.                             // line 253
  560.                             yield "                                                ";
  561.                         }
  562.                         // line 254
  563.                         yield "                                           
  564.                                             
  565.                                             </div>
  566.                                             <script>
  567.                                             \$('[data-bs-toggle=\"popover_live_";
  568.                         // line 258
  569.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse258), "html"nulltrue);
  570.                         yield "\"]').mouseover(function(){
  571.                                                 \$('[data-bs-toggle=\"popover_live_";
  572.                         // line 259
  573.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse259), "html"nulltrue);
  574.                         yield "\"]').popover();
  575.                                             })
  576.                                         </script>
  577.                                          ";
  578.                     }
  579.                     // line 263
  580.                     yield "                                        ";
  581.                     ++$context['loop']['index0'];
  582.                     ++$context['loop']['index'];
  583.                     $context['loop']['first'] = false;
  584.                     if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  585.                         --$context['loop']['revindex0'];
  586.                         --$context['loop']['revindex'];
  587.                         $context['loop']['last'] = === $context['loop']['revindex0'];
  588.                     }
  589.                 }
  590.                 $_parent $context['_parent'];
  591.                 unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent'], $context['loop']);
  592.                 $context array_intersect_key($context$_parent) + $_parent;
  593.                 // line 264
  594.                 yield "                                        
  595.                                         </div>
  596.                                     </div>
  597.                                 <!-- Otros Indicadores box -->
  598.                                 <div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
  599.                                     <div class=\"d-flex justify-content-between\">
  600.                                         <p class=\"fw-bold fs-5\" data-bs-toggle=\"collapse\" data-bs-target=\"#analytics_indicators\" aria-expanded=\"true\" aria-controls=\"analytics_statsline\" onclick=\"expandIcon('analytics_indicators_arrow')\" role=\"button\">";
  601.                 // line 271
  602.                 yield $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("Otros indicadores", [], "messages");
  603.                 yield "</p>
  604.                                         
  605.                                     </div>
  606.                                     <div class=\"\" id=\"analytics_indicators_others\">
  607.                                         ";
  608.                 // line 275
  609.                 $context["category"] = "";
  610.                 // line 276
  611.                 yield "                                        
  612.                                         ";
  613.                 // line 278
  614.                 yield "                                        
  615.                                         ";
  616.                 // line 280
  617.                 $context['_parent'] = $context;
  618.                 $context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data_relation"]) || array_key_exists("analytic_data_relation"$context) ? $context["analytic_data_relation"] : (function () { throw new RuntimeError('Variable "analytic_data_relation" does not exist.'280$this->source); })()));
  619.                 $context['loop'] = [
  620.                   'parent' => $context['_parent'],
  621.                   'index0' => 0,
  622.                   'index'  => 1,
  623.                   'first'  => true,
  624.                 ];
  625.                 if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  626.                     $length count($context['_seq']);
  627.                     $context['loop']['revindex0'] = $length 1;
  628.                     $context['loop']['revindex'] = $length;
  629.                     $context['loop']['length'] = $length;
  630.                     $context['loop']['last'] = === $length;
  631.                 }
  632.                 foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
  633.                     // line 281
  634.                     yield "                                            ";
  635.                     // line 282
  636.                     yield "                                            ";
  637.                     if (!CoreExtension::inFilter(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse282), (isset($context["array_used"]) || array_key_exists("array_used"$context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.'282$this->source); })()))) {
  638.                         // line 283
  639.                         yield "
  640.                                             ";
  641.                         // line 284
  642.                         if (((isset($context["category"]) || array_key_exists("category"$context) ? $context["category"] : (function () { throw new RuntimeError('Variable "category" does not exist.'284$this->source); })()) != CoreExtension::getAttribute($this->env$this->source$context["rel"], "category", [], "any"falsefalsefalse284))) {
  643.                             // line 285
  644.                             yield "                                                <p class=\"mt-2 fw-bold\" style=\"font-size: 12px; font-weight: 700;\"> 
  645.                                                      
  646.                                                     ";
  647.                             // line 287
  648.                             if ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'287$this->source); })()), "request", [], "any"falsefalsefalse287), "locale", [], "any"falsefalsefalse287) == "ca")) {
  649.                                 // line 288
  650.                                 yield "                                                        ";
  651.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "category_ca", [], "any"falsefalsefalse288), "html"nulltrue);
  652.                                 yield 
  653.                                                     ";
  654.                             } elseif ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source,                             // line 289
  655. (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'289$this->source); })()), "request", [], "any"falsefalsefalse289), "locale", [], "any"falsefalsefalse289) == "en")) {
  656.                                 // line 290
  657.                                 yield "                                                        ";
  658.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "category_en", [], "any"falsefalsefalse290), "html"nulltrue);
  659.                                 yield 
  660.                                                     ";
  661.                             } else {
  662.                                 // line 292
  663.                                 yield "                                                        ";
  664.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "category", [], "any"falsefalsefalse292), "html"nulltrue);
  665.                                 yield 
  666.                                                     ";
  667.                             }
  668.                             // line 294
  669.                             yield "                                                </p>
  670.                                                 ";
  671.                             // line 295
  672.                             $context["category"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "category", [], "any"falsefalsefalse295);
  673.                             // line 296
  674.                             yield "                                            ";
  675.                         }
  676.                         // line 297
  677.                         yield "
  678.                                             ";
  679.                         // line 298
  680.                         if ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'298$this->source); })()), "request", [], "any"falsefalsefalse298), "locale", [], "any"falsefalsefalse298) == "ca")) {
  681.                             // line 299
  682.                             yield "                                                ";
  683.                             $context["title"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "name_ca", [], "any"falsefalsefalse299);
  684.                             // line 300
  685.                             yield "                                                ";
  686.                             $context["description"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "info_ca", [], "any"falsefalsefalse300);
  687.                             // line 301
  688.                             yield "                                            ";
  689.                         } elseif ((CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'301$this->source); })()), "request", [], "any"falsefalsefalse301), "locale", [], "any"falsefalsefalse301) == "en")) {
  690.                             // line 302
  691.                             yield "                                                ";
  692.                             $context["title"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "name_en", [], "any"falsefalsefalse302);
  693.                             // line 303
  694.                             yield "                                                ";
  695.                             $context["description"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "info_en", [], "any"falsefalsefalse303);
  696.                             // line 304
  697.                             yield "                                            ";
  698.                         } else {
  699.                             // line 305
  700.                             yield "                                                ";
  701.                             $context["title"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse305);
  702.                             // line 306
  703.                             yield "                                                ";
  704.                             $context["description"] = CoreExtension::getAttribute($this->env$this->source$context["rel"], "info", [], "any"falsefalsefalse306);
  705.                             // line 307
  706.                             yield "                                            ";
  707.                         }
  708.                         // line 308
  709.                         yield "                                            
  710.                                             <div id=\"statline_id_";
  711.                         // line 309
  712.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse309), "html"nulltrue);
  713.                         yield "\" onclick=\"updateMapFromDiv(";
  714.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse309), "html"nulltrue);
  715.                         yield ")\" class=\"grayscale analytics_statsline_item\" data-kpi=\"";
  716.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse309), "html"nulltrue);
  717.                         yield "\" data-slug=\"";
  718.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "slug", [], "any"falsefalsefalse309), "html"nulltrue);
  719.                         yield "\" data-bs-toggle=\"popover_live_";
  720.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse309), "html"nulltrue);
  721.                         yield "\" data-bs-trigger=\"hover focus\" data-bs-title=\"";
  722.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title"$context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.'309$this->source); })())), "html"nulltrue);
  723.                         yield "\" data-bs-content=\"";
  724.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["description"]) || array_key_exists("description"$context) ? $context["description"] : (function () { throw new RuntimeError('Variable "description" does not exist.'309$this->source); })()), "html"nulltrue);
  725.                         yield "\" data-p=\"";
  726.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "province", [], "any"falsefalsefalse309), "html"nulltrue);
  727.                         yield "\" data-m=\"";
  728.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "city", [], "any"falsefalsefalse309), "html"nulltrue);
  729.                         yield "\" data-r=\"";
  730.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "region", [], "any"falsefalsefalse309), "html"nulltrue);
  731.                         yield "\" data-max=\"";
  732.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "max_value", [], "any"falsefalsefalse309), "html"nulltrue);
  733.                         yield "\" data-min=\"";
  734.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "min_value", [], "any"falsefalsefalse309), "html"nulltrue);
  735.                         yield "\">
  736.                                             <script>
  737.                                             \$('[data-bs-toggle=\"popover_live_";
  738.                         // line 312
  739.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse312), "html"nulltrue);
  740.                         yield "\"]').mouseover(function(){
  741.                                                 \$('[data-bs-toggle=\"popover_live_";
  742.                         // line 313
  743.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse313), "html"nulltrue);
  744.                         yield "\"]').popover();
  745.                                             })
  746.                                             </script>
  747.                                             
  748.                                                 <p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">";
  749.                         // line 317
  750.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), (isset($context["title"]) || array_key_exists("title"$context) ? $context["title"] : (function () { throw new RuntimeError('Variable "title" does not exist.'317$this->source); })())), "html"nulltrue);
  751.                         yield "</p>
  752.                                                 <div class=\"statsline mb-3\" >
  753.                                                     ";
  754.                         // line 320
  755.                         $context["color"] = [];
  756.                         // line 321
  757.                         yield "                                                    ";
  758.                         $context['_parent'] = $context;
  759.                         $context['_seq'] = CoreExtension::ensureTraversable((isset($context["kpi_rank"]) || array_key_exists("kpi_rank"$context) ? $context["kpi_rank"] : (function () { throw new RuntimeError('Variable "kpi_rank" does not exist.'321$this->source); })()));
  760.                         foreach ($context['_seq'] as $context["_key"] => $context["rank"]) {
  761.                             // line 322
  762.                             yield "                                                        
  763.                                                         ";
  764.                             // line 323
  765.                             if ((CoreExtension::getAttribute($this->env$this->source$context["rank"], "kpi_id", [], "any"falsefalsefalse323) == CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse323))) {
  766.                                 // line 324
  767.                                 yield "                                                            ";
  768.                                 $context["color"] = Twig\Extension\CoreExtension::merge((isset($context["color"]) || array_key_exists("color"$context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.'324$this->source); })()), [CoreExtension::getAttribute($this->env$this->source$context["rank"], "bgcolor", [], "any"falsefalsefalse324)]);
  769.                                 // line 325
  770.                                 yield "                                                        ";
  771.                             }
  772.                             // line 326
  773.                             yield "
  774.                                                     ";
  775.                         }
  776.                         $_parent $context['_parent'];
  777.                         unset($context['_seq'], $context['_key'], $context['rank'], $context['_parent']);
  778.                         $context array_intersect_key($context$_parent) + $_parent;
  779.                         // line 328
  780.                         yield "                                                    ";
  781.                         $context["counter"] = Twig\Extension\CoreExtension::length($this->env->getCharset(), (isset($context["color"]) || array_key_exists("color"$context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.'328$this->source); })()));
  782.                         // line 329
  783.                         yield "                                                    ";
  784.                         $context["partsize"] = (100 / (isset($context["counter"]) || array_key_exists("counter"$context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.'329$this->source); })()));
  785.                         // line 330
  786.                         yield "                                                    ";
  787.                         $context["stylestring"] = "";
  788.                         // line 331
  789.                         yield "
  790.                                                     <div class=\"bk_line\">
  791.                                                     ";
  792.                         // line 334
  793.                         $context['_parent'] = $context;
  794.                         $context['_seq'] = CoreExtension::ensureTraversable((isset($context["color"]) || array_key_exists("color"$context) ? $context["color"] : (function () { throw new RuntimeError('Variable "color" does not exist.'334$this->source); })()));
  795.                         $context['loop'] = [
  796.                           'parent' => $context['_parent'],
  797.                           'index0' => 0,
  798.                           'index'  => 1,
  799.                           'first'  => true,
  800.                         ];
  801.                         if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
  802.                             $length count($context['_seq']);
  803.                             $context['loop']['revindex0'] = $length 1;
  804.                             $context['loop']['revindex'] = $length;
  805.                             $context['loop']['length'] = $length;
  806.                             $context['loop']['last'] = === $length;
  807.                         }
  808.                         foreach ($context['_seq'] as $context["_key"] => $context["colorpart"]) {
  809.                             // line 335
  810.                             yield "                                                        ";
  811.                             if (CoreExtension::getAttribute($this->env$this->source$context["loop"], "last", [], "any"falsefalsefalse335)) {
  812.                                 // line 336
  813.                                 yield "                                                        ";
  814.                                 $context["dato"] = (99.9 - ((isset($context["partsize"]) || array_key_exists("partsize"$context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.'336$this->source); })()) * ((isset($context["counter"]) || array_key_exists("counter"$context) ? $context["counter"] : (function () { throw new RuntimeError('Variable "counter" does not exist.'336$this->source); })()) - 1)));
  815.                                 // line 337
  816.                                 yield "                                                            <div class=\"analytic_color_bar\" style=\"width:";
  817.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["dato"]) || array_key_exists("dato"$context) ? $context["dato"] : (function () { throw new RuntimeError('Variable "dato" does not exist.'337$this->source); })()), "html"nulltrue);
  818.                                 yield "%; background-color: ";
  819.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html"nulltrue);
  820.                                 yield ";\"></div>
  821.                                                         ";
  822.                             } else {
  823.                                 // line 339
  824.                                 yield "                                                            <div class=\"analytic_color_bar\" style=\"width:";
  825.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["partsize"]) || array_key_exists("partsize"$context) ? $context["partsize"] : (function () { throw new RuntimeError('Variable "partsize" does not exist.'339$this->source); })()), 2"."), "html"nulltrue);
  826.                                 yield "%; background-color: ";
  827.                                 yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["colorpart"], "html"nulltrue);
  828.                                 yield ";\"></div>        
  829.                                                         ";
  830.                             }
  831.                             // line 341
  832.                             yield "                                                        
  833.                                                     ";
  834.                             ++$context['loop']['index0'];
  835.                             ++$context['loop']['index'];
  836.                             $context['loop']['first'] = false;
  837.                             if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  838.                                 --$context['loop']['revindex0'];
  839.                                 --$context['loop']['revindex'];
  840.                                 $context['loop']['last'] = === $context['loop']['revindex0'];
  841.                             }
  842.                         }
  843.                         $_parent $context['_parent'];
  844.                         unset($context['_seq'], $context['_key'], $context['colorpart'], $context['_parent'], $context['loop']);
  845.                         $context array_intersect_key($context$_parent) + $_parent;
  846.                         // line 343
  847.                         yield "                                                    
  848.                                                     </div>
  849.                                                     
  850.                                                     <span class=\"statsline_item statsline_";
  851.                         // line 346
  852.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["loop"], "index", [], "any"falsefalsefalse346), "html"nulltrue);
  853.                         yield " item_tooltip\" style=\"left: ";
  854.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "theme_per", [], "any"falsefalsefalse346), "html"nulltrue);
  855.                         yield "%; margin-left: -6px;\" data-text=\"";
  856.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "theme", [], "any"falsefalsefalse346), "html"nulltrue);
  857.                         yield "\" data-kpi=\"";
  858.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse346), "html"nulltrue);
  859.                         yield "\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
  860.                                                     
  861.                                                 </div>
  862.                                                 <div class=\"statsline_range d-flex justify-content-between d-none\">
  863.                                                     <span>";
  864.                         // line 350
  865.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "min_value", [], "any"falsefalsefalse350), "html"nulltrue);
  866.                         yield "</span>
  867.                                                     <span>";
  868.                         // line 351
  869.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "max_value", [], "any"falsefalsefalse351), "html"nulltrue);
  870.                         yield "</span>
  871.                                                 </div>
  872.                                             
  873.                                             </div>
  874.                                             
  875.                                             ";
  876.                     }
  877.                     // line 358
  878.                     yield "                                        ";
  879.                     ++$context['loop']['index0'];
  880.                     ++$context['loop']['index'];
  881.                     $context['loop']['first'] = false;
  882.                     if (isset($context['loop']['revindex0'], $context['loop']['revindex'])) {
  883.                         --$context['loop']['revindex0'];
  884.                         --$context['loop']['revindex'];
  885.                         $context['loop']['last'] = === $context['loop']['revindex0'];
  886.                     }
  887.                 }
  888.                 $_parent $context['_parent'];
  889.                 unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent'], $context['loop']);
  890.                 $context array_intersect_key($context$_parent) + $_parent;
  891.                 yield 
  892.                                         </div>
  893.                                     </div>
  894.                                     
  895.                                 </div>
  896.                                         ";
  897.                 // line 390
  898.                 yield "                                
  899.                                 
  900.                             </div>
  901.                         </div>
  902.                     </div>
  903.                 ";
  904.             }
  905.             // line 397
  906.             yield "                ";
  907.         }
  908.         $_parent $context['_parent'];
  909.         unset($context['_seq'], $context['_key'], $context['item'], $context['_parent']);
  910.         $context array_intersect_key($context$_parent) + $_parent;
  911.         // line 398
  912.         yield "
  913.                 </div>
  914.                 
  915.             </div>
  916.             
  917.             
  918.         </div>
  919.     </div>
  920. <style>
  921. td.gridjs-td{
  922.     //padding: 2px 24px !important;
  923. }
  924. </style>
  925. ";
  926.         
  927.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  928.         
  929.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  930.         yield from [];
  931.     }
  932.     // line 417
  933.     /**
  934.      * @return iterable<null|scalar|\Stringable>
  935.      */
  936.     public function block_javascripts(array $context, array $blocks = []): iterable
  937.     {
  938.         $macros $this->macros;
  939.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  940.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  941.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  942.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block""javascripts"));
  943.         // line 418
  944.         yield "<script src=\"";
  945.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/js/calls.js"), "html"nulltrue);
  946.         yield "\"></script>
  947. <script src=\"";
  948.         // line 420
  949.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("bundles/fosjsrouting/js/router.min.js"), "html"nulltrue);
  950.         yield "\"></script>
  951. <script src=\"";
  952.         // line 421
  953.         yield $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("fos_js_routing_js", ["callback" => "fos.Router.setData"]);
  954.         yield "\"></script>
  955. <script src=\"https://cdnjs.cloudflare.com/ajax/libs/gridjs/6.0.6/gridjs.production.min.js\" integrity=\"sha512-wpiJjuL800CTEBA0QFs+RFw0tFtpXnQGea1p9S16WcYNXC1F3U0l1L7FQrDC3ihkYRtOj4Td7lKR3mYKxrwMMA==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
  956. <link rel=\"stylesheet\" type=\"text/css\" href=\"https://unpkg.com/gridjs/dist/theme/mermaid.min.css\" />
  957. <script type=\"text/javascript\">
  958.     const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
  959.     const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
  960.     var Routes = Routing; // loaded from router.min.js
  961.     // because ES5 doesn't support require syntax,
  962.     // we use jquery getJSON function in order to set
  963.     // routing data to our Routing object
  964.     \$.getJSON(\"";
  965.         // line 436
  966.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/js/fos_js_routes.json"), "html"nulltrue);
  967.         yield "\", function (routes) {
  968.         Routes.setRoutingData(routes);
  969.     });
  970.     ";
  971.         // line 440
  972.         yield "</script>
  973. <script type=\"text/javascript\">
  974.     //let explore_baseUrl = '";
  975.         // line 443
  976.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["base_url"]) || array_key_exists("base_url"$context) ? $context["base_url"] : (function () { throw new RuntimeError('Variable "base_url" does not exist.'443$this->source); })()), "html"nulltrue);
  977.         yield "';
  978.     \$(document).ready(function(){
  979.         \$('.viewfindergroup').hide();
  980.         \$('#map_view').show();        
  981.         \$('.build_bar').css('width','100%');
  982.         \$('.people_bar').css('width','100%');
  983.         /*setTimeout(()=>{
  984.             \$('#info_div').collapse('hide');
  985.         },10000);*/
  986.         let arrayData = document.querySelectorAll('.analytics_statsline_item');
  987.         let arraySlugs = [];
  988.         for(let i=0; arrayData.length > i; i++){
  989.             arraySlugs.push(arrayData[i].getAttribute('data-slug'));
  990.         }
  991.         // console.log(arraySlugs);
  992.         buttonsToHeaderBar();
  993.         \$('#left_bar_button_map').addClass('active');
  994.     });
  995.     document.getElementById(\"selectAllBtn\").addEventListener(\"click\", function() {
  996.         let checkboxes = document.querySelectorAll(\".form-check-input\");
  997.         let allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked);
  998.         checkboxes.forEach(checkbox => {
  999.             checkbox.checked = !allChecked; // Alterna selección
  1000.         });
  1001.         this.textContent = allChecked ? \"Seleccionar Todos\" : \"Deseleccionar Todos\"; 
  1002.     });
  1003.     function buttonsToHeaderBar(){
  1004.         // <span class=\"material-symbols-outlined\">bar_chart_4_bars</span>
  1005.         document.getElementById('new_header_map').innerHTML = '<div id=\"left_bar_button_map\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'map\\')\"><span class=\"material-symbols-outlined\">map</span><br>";
  1006.         // line 481
  1007.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Mapa"), "html"nulltrue);
  1008.         yield "</div>';
  1009.         document.getElementById('new_header_table').innerHTML = '<div id=\"left_bar_button_data\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'data\\')\"><span class=\"material-symbols-outlined\">table</span><br>";
  1010.         // line 482
  1011.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Tabla"), "html"nulltrue);
  1012.         yield "</div>';
  1013.         document.getElementById('new_header_card').innerHTML = '<div id=\"left_bar_button_card\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'card\\')\"><span class=\"material-symbols-outlined\">grid_view</span><br>";
  1014.         // line 483
  1015.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Ficha"), "html"nulltrue);
  1016.         yield "</div>';
  1017.         
  1018.     }
  1019.     \$('.item_tooltip').on('mouseover',function (){
  1020.         
  1021.         let name = this.getAttribute('data-text');
  1022.         let kpi = this.getAttribute('data-kpi');
  1023.         // console.log(name,kpi);
  1024.         \$('.item_tooltip[data-kpi='+kpi+']').tooltip({title: name, delay: {show: 100, hide: 100}}); 
  1025.     })
  1026.     const { Grid, html } = gridjs;
  1027.     var rPlatform = map;
  1028.     var caller = call;
  1029.     let layers = ";
  1030.         // line 500
  1031.         yield (isset($context["layers"]) || array_key_exists("layers"$context) ? $context["layers"] : (function () { throw new RuntimeError('Variable "layers" does not exist.'500$this->source); })());
  1032.         yield ";
  1033.     let configLayers = ";
  1034.         // line 502
  1035.         yield (isset($context["configLayers"]) || array_key_exists("configLayers"$context) ? $context["configLayers"] : (function () { throw new RuntimeError('Variable "configLayers" does not exist.'502$this->source); })());
  1036.         yield ";
  1037.     let explore_baseUrl = '";
  1038.         // line 503
  1039.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["base_url"]) || array_key_exists("base_url"$context) ? $context["base_url"] : (function () { throw new RuntimeError('Variable "base_url" does not exist.'503$this->source); })()), "html"nulltrue);
  1040.         yield "';
  1041.     caller.vars.explore_baseUrl = '";
  1042.         // line 504
  1043.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["base_url"]) || array_key_exists("base_url"$context) ? $context["base_url"] : (function () { throw new RuntimeError('Variable "base_url" does not exist.'504$this->source); })()), "html"nulltrue);
  1044.         yield "';
  1045.     
  1046.     let explore_mun = '";
  1047.         // line 506
  1048.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["mun"]) || array_key_exists("mun"$context) ? $context["mun"] : (function () { throw new RuntimeError('Variable "mun" does not exist.'506$this->source); })()), "html"nulltrue);
  1049.         yield "';
  1050.     let explore_kpi = 3;
  1051.     let explore_slug = '';
  1052.     let explore_colors = ";
  1053.         // line 509
  1054.         yield (isset($context["kpi_colors"]) || array_key_exists("kpi_colors"$context) ? $context["kpi_colors"] : (function () { throw new RuntimeError('Variable "kpi_colors" does not exist.'509$this->source); })());
  1055.         yield ";
  1056.     let explore_insight = [];
  1057.     let explore_extrakpi = [];
  1058.     let explore_layer_data = [];
  1059.     let explore_url = window.location.href;
  1060.     let explore_filter_url = '';
  1061.     let filtered_data_array = ";
  1062.         // line 516
  1063.         yield (isset($context["filtered_data"]) || array_key_exists("filtered_data"$context) ? $context["filtered_data"] : (function () { throw new RuntimeError('Variable "filtered_data" does not exist.'516$this->source); })());
  1064.         yield ";
  1065.     let kpi_list = ";
  1066.         // line 518
  1067.         yield (isset($context["kpi_list"]) || array_key_exists("kpi_list"$context) ? $context["kpi_list"] : (function () { throw new RuntimeError('Variable "kpi_list" does not exist.'518$this->source); })());
  1068.         yield ";
  1069.     let kpi_list_complete = document.querySelectorAll('#kpi_list_data li');
  1070.     for(i=0; kpi_list_complete.length > i; i++){
  1071.         let name = kpi_list_complete[i].innerText;
  1072.         let kpi = kpi_list_complete[i].getAttribute('data-kpi');
  1073.         let slug = kpi_list_complete[i].getAttribute('data-slug');
  1074.         kpi_list.push({'name':name,'kpi':kpi,'slug':slug});
  1075.     }
  1076.     // use stats data and print graphic
  1077.     let useStat = ";
  1078.         // line 528
  1079.         yield (isset($context["useStatData"]) || array_key_exists("useStatData"$context) ? $context["useStatData"] : (function () { throw new RuntimeError('Variable "useStatData" does not exist.'528$this->source); })());
  1080.         yield ";
  1081.     let useStatData = analyticOrganizeData(useStat);
  1082.     var useStatTotalData = analyticOrganizeTotalData(useStat);
  1083.     ";
  1084.         // line 532
  1085.         yield "    
  1086.     // year stats data and print graphic
  1087.     let yearStat = ";
  1088.         // line 534
  1089.         yield (isset($context["yearStatData"]) || array_key_exists("yearStatData"$context) ? $context["yearStatData"] : (function () { throw new RuntimeError('Variable "yearStatData" does not exist.'534$this->source); })());
  1090.         yield ";
  1091.     let yearStatData = analyticOrganizeData(yearStat);
  1092.     var yearStatTotalData = analyticOrganizeTotalData(yearStat);
  1093.     ";
  1094.         // line 538
  1095.         yield "
  1096.     // area stats data and print graphic
  1097.     let areaStat = ";
  1098.         // line 540
  1099.         yield (isset($context["areaStatData"]) || array_key_exists("areaStatData"$context) ? $context["areaStatData"] : (function () { throw new RuntimeError('Variable "areaStatData" does not exist.'540$this->source); })());
  1100.         yield ";
  1101.     let areaStatData = analyticOrganizeData(areaStat);
  1102.     var areaStatTotalData = analyticOrganizeTotalData(areaStat);
  1103.     ";
  1104.         // line 544
  1105.         yield "
  1106.     // occupation stats data and print graphic
  1107.     let occupationStat = ";
  1108.         // line 546
  1109.         yield (isset($context["occupationStatData"]) || array_key_exists("occupationStatData"$context) ? $context["occupationStatData"] : (function () { throw new RuntimeError('Variable "occupationStatData" does not exist.'546$this->source); })());
  1110.         yield ";
  1111.     let occupationStatData = analyticOrganizeData(occupationStat);
  1112.     var occupationStatTotalData = analyticOrganizeTotalData(occupationStat);
  1113.     ";
  1114.         // line 550
  1115.         yield "
  1116.     let explore_mun_name = '";
  1117.         // line 552
  1118.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), CoreExtension::getAttribute($this->env$this->source, (isset($context["municipioname"]) || array_key_exists("municipioname"$context) ? $context["municipioname"] : (function () { throw new RuntimeError('Variable "municipioname" does not exist.'552$this->source); })()), "adminunitname", [], "any"falsefalsefalse552)), "html"nulltrue);
  1119.         yield "';
  1120.     let allgeodataUrl = explore_baseUrl + \"/get-allgeodata?mun=\" + explore_mun ;
  1121.     let munPolygon = '";
  1122.         // line 555
  1123.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source, (isset($context["municipioname"]) || array_key_exists("municipioname"$context) ? $context["municipioname"] : (function () { throw new RuntimeError('Variable "municipioname" does not exist.'555$this->source); })()), "geom", [], "any"falsefalsefalse555), "html"nulltrue);
  1124.         yield "';
  1125.     let initGeo = '";
  1126.         // line 556
  1127.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source, (isset($context["municipioname"]) || array_key_exists("municipioname"$context) ? $context["municipioname"] : (function () { throw new RuntimeError('Variable "municipioname" does not exist.'556$this->source); })()), "envelope", [], "any"falsefalsefalse556), "html"nulltrue);
  1128.         yield "';
  1129.     
  1130.     let queryString = window.location.search;
  1131.     let urlParams = new URLSearchParams(queryString);
  1132.     let filterStart = urlParams.get('fs');
  1133.     let filterEnd = urlParams.get('fe');
  1134.     window.appLocale = '";
  1135.         // line 562
  1136.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'562$this->source); })()), "request", [], "any"falsefalsefalse562), "locale", [], "any"falsefalsefalse562), "js"), "html"nulltrue);
  1137.         yield "';
  1138.     if(filterStart == null){
  1139.         filterStart = 0;
  1140.     }
  1141.     if(filterEnd == null){
  1142.         filterEnd = 0;
  1143.     }
  1144.     rPlatform.setInpireidList(filtered_data_array);
  1145.     rPlatform.setMun(explore_mun);
  1146.     rPlatform.setBaseUrl(explore_baseUrl);
  1147.     rPlatform.setLayers(layers);
  1148.     rPlatform.setColorsStyle(explore_colors);
  1149.     rPlatform.setLayerData(explore_layer_data);
  1150.    
  1151.     // ----------------------- Map ------------------------ //
  1152.     async function init() { // Cargar mapa de inicio
  1153.         let queryString = window.location.search;
  1154.         let urlParams = new URLSearchParams(queryString);
  1155.         // Crear indArr con el primer kpi del listado
  1156.         let alldivi = document.getElementsByClassName('grayscale');
  1157.         let kpi_init = alldivi[0].getAttribute('data-kpi');
  1158.         let slug_init = alldivi[0].getAttribute('data-slug');
  1159.         explore_kpi = kpi_init;
  1160.         explore_slug = slug_init;
  1161.         alldivi[0].classList.add('kpi_selected');
  1162.         alldivi[0].classList.add('disabled');
  1163.         // Colocar primer alldivi como seleccionado
  1164.         selectedIndicator(alldivi[0]);
  1165.         // Recibir parametros ind desde url
  1166.         let indArr = [parseInt(kpi_init)];
  1167.         let frArr = [filterStart, filterEnd];
  1168.         await rPlatform.setiActive(indArr);
  1169.         await rPlatform.initMapExplore(layers, explore_baseUrl, initGeo, explore_mun, frArr, indArr);
  1170.         await rPlatform.getSimpleStyleDistrict();
  1171.         await rPlatform.getSimpleStyleSection();
  1172.         rPlatform.updateMap();
  1173.     }
  1174.     init();
  1175.     
  1176.     
  1177.     // ----------------------- Table Map ------------------------ //
  1178.     function tableData(){        
  1179.         let wrapper = document.getElementById(\"wrapper\");
  1180.         wrapper.innerHTML = '';
  1181.         let tabla = null; // Variable global para almacenar la instancia de la tabla
  1182.         function renderizarTabla(data) {
  1183.             // Eliminar la tabla anterior si existe
  1184.             if (tabla !== null) {
  1185.                 tabla.destroy();
  1186.             }
  1187.             // Crear una nueva instancia de Grid.js con los nuevos datos y renderizarla
  1188.             tabla = new gridjs.Grid({
  1189.                 columns: [{
  1190.                     id: 'year',
  1191.                     name: \"";
  1192.         // line 634
  1193.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Año"), "html"nulltrue);
  1194.         yield "\"
  1195.                 },
  1196.                 {
  1197.                     id: 'currentuse',
  1198.                     name: \"";
  1199.         // line 638
  1200.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Uso"), "html"nulltrue);
  1201.         yield "\",
  1202.                     formatter: (cell, row) => {
  1203.                         if (cell == '1_residential' ){
  1204.                             return gridjs.html(`<span style=\"color: blue; cursor:pointer;\" onclick=\" viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Residential</span>`)  
  1205.                         }else if(cell == '2_agriculture'){
  1206.                             return gridjs.html(`<span style=\"color: green; cursor:pointer;\" onclick=\"viewFinder(\\'card\\');  viewCard(\\'\${row.cells[22].data}\\')\">Agriculture</span>`)
  1207.                         }else if(cell == '3_industrial'){
  1208.                             return gridjs.html(`<span style=\"color: gray; cursor:pointer;\" onclick=\"viewFinder(\\'card\\');  viewCard(\\'\${row.cells[22].data}\\')\">Industrial</span>`)
  1209.                         }else if(cell == '4_3_publicServices'){
  1210.                             return gridjs.html(`<span style=\"color: orange; cursor:pointer;\" onclick=\"viewFinder(\\'card\\');  viewCard(\\'\${row.cells[22].data}\\')\">Public services</span>`)
  1211.                         }else{
  1212.                             return gridjs.html(`<span style=\"color: black\">\${cell}</span>`)
  1213.                         }
  1214.                     }
  1215.                 },
  1216.                 {
  1217.                     id: 'grossfloorarea',
  1218.                     name: \"";
  1219.         // line 655
  1220.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Grossfloorarea"), "html"nulltrue);
  1221.         yield "\",
  1222.                     formatter: (cell) => html(`\${cell} m<sup>2</sup>`)
  1223.                 },
  1224.                 {
  1225.                     id: 'habitantes',
  1226.                     name: \"";
  1227.         // line 660
  1228.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Habitantes"), "html"nulltrue);
  1229.         yield "\",
  1230.                     formatter: (cell) => {
  1231.                         return gridjs.html(`<div class=\"mt-2\"><i class=\"fa-solid fa-users\"></i> \${cell}</div>`)
  1232.                     }
  1233.                 },
  1234.                 {
  1235.                     id: 'numberofdwellings',
  1236.                     name: \"";
  1237.         // line 667
  1238.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Viviendas"), "html"nulltrue);
  1239.         yield "\",
  1240.                     formatter: (cell) => html(`\${cell}`)
  1241.                 },
  1242.                 {
  1243.                     id: 'kpi_1_energy_renovated_residential_buildings',
  1244.                     name: \"";
  1245.         // line 672
  1246.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Energy renovated residential buildings"), "html"nulltrue);
  1247.         yield "\",
  1248.                     formatter: (cell) => html(`\${cell}`)
  1249.                 },
  1250.                 {
  1251.                     id: 'kpi_2_final_energy_consumption',
  1252.                     name: \"";
  1253.         // line 677
  1254.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Final energy consumption"), "html"nulltrue);
  1255.         yield "\",
  1256.                     formatter: (cell) => html(`\${cell}`)
  1257.                 },
  1258.                 {
  1259.                     id: 'kpi_3_renewable_energy_consumption',
  1260.                     name: \"";
  1261.         // line 682
  1262.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Renewable energy consumption"), "html"nulltrue);
  1263.         yield "\",
  1264.                     formatter: (cell) => html(`\${cell}`)
  1265.                 },
  1266.                 {
  1267.                     id: 'kpi_4_pv_potential_generation',
  1268.                     name: \"";
  1269.         // line 687
  1270.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Pv potential generation"), "html"nulltrue);
  1271.         yield "\",
  1272.                     formatter: (cell) => html(`\${cell}`)
  1273.                 },
  1274.                 {
  1275.                     id: 'kpi_7_heating_energy_consumption',
  1276.                     name: \"";
  1277.         // line 692
  1278.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Heating energy consumption"), "html"nulltrue);
  1279.         yield "\",
  1280.                     formatter: (cell) => html(`\${cell}`)
  1281.                 },
  1282.                 {
  1283.                     id: 'kpi_8_ghg_emissions',
  1284.                     name: \"";
  1285.         // line 697
  1286.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("GhG emissions"), "html"nulltrue);
  1287.         yield "\",
  1288.                     formatter: (cell) => html(`\${cell}`)
  1289.                 },
  1290.                 {
  1291.                     id: 'kpi_19_population_income_below_60_average',
  1292.                     name: \"";
  1293.         // line 702
  1294.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Population income below 60 average"), "html"nulltrue);
  1295.         yield "\",
  1296.                     formatter: (cell) => html(`\${cell}`)
  1297.                 },
  1298.                 {
  1299.                     id: 'kpi_20_median_household_income',
  1300.                     name: \"";
  1301.         // line 707
  1302.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Median household income"), "html"nulltrue);
  1303.         yield "\",
  1304.                     formatter: (cell) => html(`\${cell}`)
  1305.                 },
  1306.                 {
  1307.                     id: 'kpi_21_average_price_renting_compared_family_income',
  1308.                     name: \"";
  1309.         // line 712
  1310.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Average price renting compared family income"), "html"nulltrue);
  1311.         yield "\",
  1312.                     formatter: (cell) => html(`\${cell}`)
  1313.                 },
  1314.                 {
  1315.                     id: 'kpi_22_house_price',
  1316.                     name: \"";
  1317.         // line 717
  1318.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("House price"), "html"nulltrue);
  1319.         yield "\",
  1320.                     formatter: (cell) => html(`\${cell}`)
  1321.                 },
  1322.                 {
  1323.                     id: 'kpi_27_urban_equipment_at_15_min',
  1324.                     name: \"";
  1325.         // line 722
  1326.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Urban equipment at 15 min"), "html"nulltrue);
  1327.         yield "\",
  1328.                     formatter: (cell) => html(`\${cell}`)
  1329.                 },
  1330.                 {
  1331.                     id: 'kpi_28_accessibility_to_bike_lane',
  1332.                     name: \"";
  1333.         // line 727
  1334.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Accessibility to bike lane"), "html"nulltrue);
  1335.         yield "\",
  1336.                     formatter: (cell) => html(`\${cell}`)
  1337.                 },{
  1338.                     id: 'kpi_30_green_area_surfaces',
  1339.                     name: \"";
  1340.         // line 731
  1341.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Green area surfaces"), "html"nulltrue);
  1342.         yield "\",
  1343.                     formatter: (cell) => html(`\${cell}`)
  1344.                 },
  1345.                 {
  1346.                     id: 'kpi_31_vulnerability_heatwaves_temperature_rise',
  1347.                     name: \"";
  1348.         // line 736
  1349.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Vulnerability heatwaves temperature rise"), "html"nulltrue);
  1350.         yield "\",
  1351.                     formatter: (cell) => html(`\${cell}`)
  1352.                 },
  1353.                 {
  1354.                     id: 'kpi_36_charging_outlets',
  1355.                     name: \"";
  1356.         // line 741
  1357.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Charging outlets"), "html"nulltrue);
  1358.         yield "\",
  1359.                     formatter: (cell) => html(`\${cell}`)
  1360.                 },
  1361.                 {
  1362.                     id: 'kpi_6_1_energy_efficient_and_energy_recovering_homes',
  1363.                     name: \"";
  1364.         // line 746
  1365.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Energy efficient and energy recovering_homes"), "html"nulltrue);
  1366.         yield "\",
  1367.                     formatter: (cell) => html(`\${cell}`)
  1368.                 },
  1369.                 {
  1370.                     id: 'kpi_6_2_energy_efficient_and_energy_recovering_homes',
  1371.                     name: \"";
  1372.         // line 751
  1373.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Energy efficient and energy recovering homes"), "html"nulltrue);
  1374.         yield "\",
  1375.                     formatter: (cell) => html(`\${cell}`)
  1376.                 },
  1377.                 {
  1378.                     id: 'inspireid',
  1379.                     name: \"";
  1380.         // line 756
  1381.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("inspireid"), "html"nulltrue);
  1382.         yield "\",
  1383.                     formatter: (cell) => html(`\${cell}`)
  1384.                 }],
  1385.                 data: data,
  1386.                 pagination: {
  1387.                     limit: 50,
  1388.                     summary: true,
  1389.                 },
  1390.                 resizable: true,
  1391.                 search: false,
  1392.                 sort: true,
  1393.                 fixedHeader: true,
  1394.                 height: \$(\"#infoview\").height(),
  1395.             }).render(wrapper);
  1396.         }
  1397.         // Llamar a la función obtenerDatos() para obtener los datos inicialmente y renderizar la tabla
  1398.         caller.obtenerDatos(explore_kpi, explore_mun, explore_slug)
  1399.             .then((data) => {
  1400.                 console.log(data);
  1401.                 renderizarTabla(data);
  1402.             })
  1403.             .then(()=>{
  1404.                 setTimeout(()=>{
  1405.                     updateTable(explore_slug);
  1406.                 },2000)
  1407.                 
  1408.             });
  1409.     }
  1410.     //------------------------ Descargar Datos ------------------- //
  1411.     function loadSelectorIndicators()
  1412.     {
  1413.         \$(\"#project_actions_content\").html('');
  1414.         ";
  1415.         // line 790
  1416.         $context['_parent'] = $context;
  1417.         $context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data"]) || array_key_exists("analytic_data"$context) ? $context["analytic_data"] : (function () { throw new RuntimeError('Variable "analytic_data" does not exist.'790$this->source); })()));
  1418.         foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
  1419.             // line 791
  1420.             yield "            ";
  1421.             if ((CoreExtension::getAttribute($this->env$this->source$context["item"], "slug", [], "any"falsefalsefalse791) == (isset($context["slug"]) || array_key_exists("slug"$context) ? $context["slug"] : (function () { throw new RuntimeError('Variable "slug" does not exist.'791$this->source); })()))) {
  1422.                 // line 792
  1423.                 yield "                ";
  1424.                 $context["break"] = false;
  1425.                 // line 793
  1426.                 yield "                ";
  1427.                 $context["array_used"] = [];
  1428.                 // line 794
  1429.                 yield "
  1430.                 ";
  1431.                 // line 795
  1432.                 $context['_parent'] = $context;
  1433.                 $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env$this->source$context["item"], "relation", [], "any"falsefalsefalse795));
  1434.                 foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
  1435.                     // line 796
  1436.                     yield "                    ";
  1437.                     if (((isset($context["break"]) || array_key_exists("break"$context) ? $context["break"] : (function () { throw new RuntimeError('Variable "break" does not exist.'796$this->source); })()) == false)) {
  1438.                         // line 797
  1439.                         yield "                        ";
  1440.                         $context["array_used"] = Twig\Extension\CoreExtension::merge((isset($context["array_used"]) || array_key_exists("array_used"$context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.'797$this->source); })()), [CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse797)]);
  1441.                         // line 798
  1442.                         yield "                        var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='";
  1443.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "slug", [], "any"falsefalsefalse798), "html"nulltrue);
  1444.                         yield "' id='flexCheckDefault' data-name='";
  1445.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse798), "html"nulltrue);
  1446.                         yield "'> <label class='form-check-label' for='flexCheckDefault'> ";
  1447.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse798), "html"nulltrue);
  1448.                         yield " </label></div>\";
  1449.                         \$(\"#project_actions_content\").append(check);
  1450.                         
  1451.                         console.log('";
  1452.                         // line 801
  1453.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse801), "html"nulltrue);
  1454.                         yield "');
  1455.                     ";
  1456.                     }
  1457.                     // line 803
  1458.                     yield "                ";
  1459.                 }
  1460.                 $_parent $context['_parent'];
  1461.                 unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent']);
  1462.                 $context array_intersect_key($context$_parent) + $_parent;
  1463.                 // line 804
  1464.                 yield "
  1465.                 ";
  1466.                 // line 805
  1467.                 $context['_parent'] = $context;
  1468.                 $context['_seq'] = CoreExtension::ensureTraversable((isset($context["analytic_data_relation"]) || array_key_exists("analytic_data_relation"$context) ? $context["analytic_data_relation"] : (function () { throw new RuntimeError('Variable "analytic_data_relation" does not exist.'805$this->source); })()));
  1469.                 foreach ($context['_seq'] as $context["_key"] => $context["rel"]) {
  1470.                     // line 806
  1471.                     yield "                    ";
  1472.                     if (!CoreExtension::inFilter(CoreExtension::getAttribute($this->env$this->source$context["rel"], "kpi", [], "any"falsefalsefalse806), (isset($context["array_used"]) || array_key_exists("array_used"$context) ? $context["array_used"] : (function () { throw new RuntimeError('Variable "array_used" does not exist.'806$this->source); })()))) {
  1473.                         // line 807
  1474.                         yield "                        var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='";
  1475.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "slug", [], "any"falsefalsefalse807), "html"nulltrue);
  1476.                         yield "' id='flexCheckDefault' data-name='";
  1477.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse807), "html"nulltrue);
  1478.                         yield "'> <label class='form-check-label' for='flexCheckDefault'> ";
  1479.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse807), "html"nulltrue);
  1480.                         yield " </label></div>\";
  1481.                         \$(\"#project_actions_content\").append(check);
  1482.                         console.log('";
  1483.                         // line 809
  1484.                         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->source$context["rel"], "name", [], "any"falsefalsefalse809), "html"nulltrue);
  1485.                         yield "');
  1486.                     ";
  1487.                     }
  1488.                     // line 810
  1489.                     yield 
  1490.                 ";
  1491.                 }
  1492.                 $_parent $context['_parent'];
  1493.                 unset($context['_seq'], $context['_key'], $context['rel'], $context['_parent']);
  1494.                 $context array_intersect_key($context$_parent) + $_parent;
  1495.                 // line 811
  1496.                 yield 
  1497.             ";
  1498.             }
  1499.             // line 812
  1500.             yield 
  1501.         ";
  1502.         }
  1503.         $_parent $context['_parent'];
  1504.         unset($context['_seq'], $context['_key'], $context['item'], $context['_parent']);
  1505.         $context array_intersect_key($context$_parent) + $_parent;
  1506.         // line 813
  1507.         yield 
  1508.         \$(\"#popUpIndicadores\").modal('show');
  1509.     }
  1510.     function getExcel() {
  1511.         const selectedNames = {};
  1512.         const checkboxes = document.querySelectorAll('.form-check-input:checked');
  1513.         const selectedValues = Array.from(checkboxes).map(checkbox => checkbox.value);
  1514.         /*const selectedNames = Array.from(checkboxes).map(checkbox => ({
  1515.             [checkbox.value]: checkbox.dataset.name
  1516.         }));*/
  1517.         checkboxes.forEach((checkbox) => selectedNames[checkbox.value] = checkbox.dataset.name);
  1518.         console.log(selectedValues);
  1519.         console.log(selectedNames);        
  1520.         caller.getExcel(explore_kpi, explore_mun, explore_slug, selectedValues, selectedNames)
  1521.             .then((data) => {
  1522.                 console.log(data); 
  1523.                 var bURL = \"";
  1524.         // line 835
  1525.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env$this->sourceCoreExtension::getAttribute($this->env$this->source, (isset($context["app"]) || array_key_exists("app"$context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.'835$this->source); })()), "request", [], "any"falsefalsefalse835), "getBasePath", [], "method"falsefalsefalse835), "html"nulltrue);
  1526.         yield "\";
  1527.                 var href = bURL + \"/documents/\" + data;            
  1528.                 location = href;                             
  1529.             }).then(
  1530.                 //si hay que eliminar el archivo generado ---> here
  1531.             );
  1532.             
  1533.     }
  1534.     
  1535.     // --------------------- Card ------------------------------- //
  1536.     async function viewCard(id){
  1537.         \$(\"#infoview2\").hide();
  1538.         \$('.viewfindergroup').hide();
  1539.         \$('#card_view').show();
  1540.         let fachada = document.getElementById('img_fachada');
  1541.         let catastro = document.getElementById('img_catastro');
  1542.         let txt_build = document.getElementById('txt_build');
  1543.         let build_indicators = document.getElementById('build_indicators');
  1544.         let size = fachada.offsetWidth;
  1545.         fachada.style.height = size + 'px';
  1546.         catastro.style.height = size + 'px';
  1547.         var imagenAlternativa = explore_baseUrl + '/img/img_bk_building.jpg';
  1548.         let img_fachada = '<img class=\"img-fluid\" src=\"https://ovc.catastro.meh.es/OVCServWeb/OVCWcfLibres/OVCFotoFachada.svc/RecuperarFotoFachadaGet?ReferenciaCatastral=' + id + '\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
  1549.         let img_catastro = '<img class=\"img-fluid\" src=\"https://www1.sedecatastro.gob.es/Cartografia/GeneraGraficoParcela.aspx?del=8&mun=279&refcat=' + id + '&AnchoPixels=500&AltoPixels=500\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
  1550.         document.getElementById('img_fachada').innerHTML = img_fachada;
  1551.         document.getElementById('img_catastro').innerHTML = img_catastro;
  1552.         let buildData = await caller.getBuildData(id);
  1553.         // console.log(buildData);
  1554.         let UseValue = '';
  1555.         let valuesContent = '';
  1556.         if (buildData.use_numeric == 0) {
  1557.             UseValue = 'SFH';
  1558.         } else {
  1559.             UseValue = 'MFH';
  1560.         }
  1561.                 
  1562.         valuesContent += '<p style=\"font-size: 14px; \"><b>";
  1563.         // line 885
  1564.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Referencia catastral"), "html"nulltrue);
  1565.         yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.inspireid + '</span></p>';
  1566.         valuesContent += '<p style=\"font-size: 14px; \"><b>";
  1567.         // line 886
  1568.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Año de construcción"), "html"nulltrue);
  1569.         yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.year + '</span></p>';
  1570.         valuesContent += '<p style=\"font-size: 14px; \"><b>";
  1571.         // line 887
  1572.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Uso"), "html"nulltrue);
  1573.         yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + UseValue + '</span></p>';
  1574.         valuesContent += '<p style=\"font-size: 14px; \"><b>";
  1575.         // line 888
  1576.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Plantas"), "html"nulltrue);
  1577.         yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.num_floors + '</span></p>';
  1578.         valuesContent += '<p style=\"font-size: 14px; \"><b>";
  1579.         // line 889
  1580.         yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\TranslationExtension']->trans("Superficie"), "html"nulltrue);
  1581.         yield ":</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.grossfloorarea + '</span></p>';
  1582.         document.getElementById('txt_build').innerHTML = valuesContent;
  1583.         // console.log(kpi_list);      
  1584.         build_indicators.innerHTML = '';
  1585.         for(let i=0; kpi_list.length > i; i++){
  1586.             // console.log(kpi_list[i].slug);
  1587.             let buildDataFiltered = Object.keys(buildData).filter((key) => key === kpi_list[i].slug).map((key) => buildData[key]);
  1588.             //console.log(kpi_list[i]);
  1589.             if(kpi_list[i].name != 'Todos'){
  1590.                 var styleBox = \"\";
  1591.                 var grafica = \"\";
  1592.                 if (kpi_list[i].name == \"año de construcción\" || kpi_list[i].name == \"área\" || kpi_list[i].name == \"uso\") 
  1593.                     styleBox = \"bk_box--color\";
  1594.                 
  1595.                
  1596.                 if ( \$(\"#statline_id_\"+kpi_list[i].id) ){
  1597.                      
  1598.                     let contenido = \$(\"#statline_id_\"+kpi_list[i].id).html();  // Obtiene el HTML
  1599.                     let tempDiv = \$(\"<div>\").html(contenido);   // Lo convierte en un objeto jQuery
  1600.                     tempDiv.find(\"p\").hide();
  1601.                     tempDiv.find(\".statsline_range\").removeClass(\"d-none\");
  1602.                     tempDiv.find(\".statsline_range\").css({
  1603.                         \"position\": \"relative\",
  1604.                         \"font-size\": \"12px\",
  1605.                         \"color\": \"#7a7a7a\",
  1606.                         //\"top\": \"-10px\"
  1607.                     });
  1608.                     let maxValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"max\");
  1609.                     let minValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"min\");
  1610.                     let per = Math.ceil(((buildDataFiltered[0]) - minValue)/(maxValue - minValue) * 100);
  1611.                     
  1612.                     tempDiv.find(\".statsline_item\").css(\"left\", per+\"%\");                    
  1613.                     grafica = tempDiv.html();
  1614.                 }  else grafica = \"\";
  1615.                 let dataNumber = \"\";
  1616.                 if (buildDataFiltered[0] == null){
  1617.                     if (window.appLocale == 'ca')   dataNumber = \"No hi han dades\";
  1618.                     else if (window.appLocale == 'en')  dataNumber = \"No data\";
  1619.                     else dataNumber = \"No hay datos\"; 
  1620.                 }   
  1621.                 else if (kpi_list[i].name != \"año de construcción\"){
  1622.                     numero = Number.parseFloat(buildDataFiltered[0]);
  1623.                     dataNumber = numero.toLocaleString(\"es-ES\");
  1624.                 }else  dataNumber =  buildDataFiltered[0];                           
  1625.                 if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 0){
  1626.                     if (window.appLocale == 'ca')   dataNumber = \"Unifamiliar\";
  1627.                     else if (window.appLocale == 'en')  dataNumber = \"Unifamiliar\";
  1628.                     else dataNumber = \"Unifamiliar\";
  1629.                     
  1630.                 }         
  1631.                 else if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 1){
  1632.                     if (window.appLocale == 'ca')   dataNumber = \"Plurifamiliar\";
  1633.                     else if (window.appLocale == 'en')  dataNumber = \"Plurifamiliar\";
  1634.                     else dataNumber = \"Plurifamiliar\";
  1635.                 }     
  1636.                 if (window.appLocale == 'ca')
  1637.                 {
  1638.                     var kpiName = kpi_list[i].name_ca;
  1639.                     var KpiInfo = kpi_list[i].info_ca;
  1640.                 }else if (window.appLocale == 'en') {
  1641.                     var kpiName = kpi_list[i].name_en;
  1642.                     var KpiInfo = kpi_list[i].info_en;
  1643.                 }else{ 
  1644.                     var kpiName = kpi_list[i].name;
  1645.                     var KpiInfo = kpi_list[i].info; 
  1646.                 }
  1647.                 build_indicators.innerHTML += '<div class=\"col-6 col-sm-3 d-flex\"><div class=\"bk_box '+styleBox+' p-3 w-100 d-flex flex-column\"><div class=\"mb-2 d-flex justify-content-between align-items-baseline\" style=\"height: 58px;\"><p class=\"fw-bold mb-2\" style=\"font-size: 14px; line-height: 18px; max-width: 70%;\">'+ capitalizeFirstLetter(kpiName) +'</p><p style=\"font-weight:600; \"><span style=\"font-size:16px; color:#6E93F6;\"> '+ dataNumber +'</span></p></div><div class=\"d-flex justify-content-between mb-2\"><div style=\"width: 100%;\">'+grafica+'</div></div><p class=\" mb-2 boxed_limited\" onclick=\"activeClass(this)\" >'+ KpiInfo +'</p></div></div>';
  1648.                 
  1649.             }
  1650.             
  1651.         }
  1652.     }
  1653.     function formatearNumero(numero) {
  1654.         //return numero;
  1655.         
  1656.         if(typeof numero === 'number'){
  1657.             numero = numero.toString();
  1658.             numero = Number.parseFloat(numero);
  1659.             return numero.toLocaleString(\"es-ES\");
  1660.             // return numero.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");
  1661.         }else if(numero === null){
  1662.             return numero;
  1663.         }else{
  1664.             // console.log(numero);
  1665.             numero = Number.parseFloat(numero);
  1666.             return numero.toLocaleString(\"es-ES\");
  1667.             
  1668.         }
  1669.     }
  1670.     function hideCardOnData(){
  1671.         document.getElementById('info_window').innerHTML = '';
  1672.     }
  1673.     // --------------------- Fn OK ------------------------------- //
  1674.     function updateMapFromDiv(a){
  1675.         let indArr = [{'kpi': parseInt(a)}];
  1676.         let divi = document.getElementById('statline_id_' + a);
  1677.         let alldivi = document.getElementsByClassName('grayscale');
  1678.         for(let i=0; alldivi.length > i; i++){
  1679.             alldivi[i].classList.remove('kpi_selected');
  1680.             alldivi[i].classList.remove('disabled');
  1681.         }
  1682.         divi.classList.add('kpi_selected');
  1683.         divi.classList.add('disabled');
  1684.         explore_kpi = divi.getAttribute('data-kpi');
  1685.         explore_slug = divi.getAttribute('data-slug');
  1686.         
  1687.         rPlatform.setiSelected(indArr);
  1688.         rPlatform.setiActive();
  1689.         rPlatform.updateMap();
  1690.         // console.log(indArr);
  1691.         this.selectedIndicator(divi);
  1692.         this.updateTable(explore_slug);
  1693.         //this.selectedDiv();
  1694.     }
  1695.     function updateMapFromStat(a){
  1696.         let indArr = [{'kpi': parseInt(a)}];
  1697.         let slug = '';
  1698.         let name = '';
  1699.         if(a == 100){
  1700.             slug = 'statYearBox';
  1701.             name = 'Año de construcción';
  1702.         }else if(a == 101){
  1703.             slug = 'statAreaBox';
  1704.             name = 'Área';
  1705.         }else if(a == 104){
  1706.             slug = 'statOccupationBox';
  1707.             name = 'Porcentaje de ocupación';
  1708.         }else if(a == 105){
  1709.             slug = 'statUseBox';
  1710.             name = 'Uso del edificio';
  1711.         }
  1712.         let divi = document.getElementById(slug);
  1713.         
  1714.         var selectedBox = document.getElementById('selected_box_content');
  1715.         // selectedBox.innerHTML = divi.outerHTML;
  1716.         let html = '<h6>'+name+'</h6>';
  1717.         // selectedBox.insertAdjacentHTML(\"afterbegin\", html);
  1718.         rPlatform.setiSelected(indArr);
  1719.         rPlatform.setiActive();
  1720.         rPlatform.updateMap();
  1721.     }
  1722.     function updateTable(slug){
  1723.         let kpiArray = ['kpi_1_energy_renovated_residential_buildings', 'kpi_2_final_energy_consumption', 'kpi_3_renewable_energy_consumption', 'kpi_4_pv_potential_generation', 'kpi_7_heating_energy_consumption', 'kpi_8_ghg_emissions', 'kpi_19_population_income_below_60_average', 'kpi_20_median_household_income', 'kpi_21_average_price_renting_compared_family_income', 'kpi_22_house_price', 'kpi_27_urban_equipment_at_15_min', 'kpi_28_accessibility_to_bike_lane', 'kpi_30_green_area_surfaces', 'kpi_31_vulnerability_heatwaves_temperature_rise', 'kpi_36_charging_outlets', 'kpi_6_2_energy_efficient_and_energy_recovering_homes', 'kpi_6_1_energy_efficient_and_energy_recovering_homes', 'inspireid']
  1724.         // Seleccionar todas las columnas con slug
  1725.         for(let i=0; kpiArray.length > i;i++){
  1726.             let celda = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+kpiArray[i]+']');
  1727.             for(let j=0; celda.length > j;j++){
  1728.                 celda[j].classList.add('d-none');
  1729.             }
  1730.         }
  1731.         
  1732.         // Seleccionar las celdas de nuestro slug
  1733.         let celdaSlug = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+slug+']');
  1734.         for(let j=0; celdaSlug.length > j;j++){
  1735.             celdaSlug[j].classList.remove('d-none');
  1736.             celdaSlug[j].classList.add('selected');
  1737.         }
  1738.         
  1739.         // console.log('updateTable',slug);
  1740.     }
  1741.     function selectedIndicator(a){
  1742.         var dataDiv = '';
  1743.         var selectedBox = document.getElementById('selected_box_content');
  1744.         var linestat = a.getElementsByClassName('statsline');
  1745.         var titlestat = a.getElementsByClassName('title');
  1746.         
  1747.         var p = parseFloat(a.getAttribute('data-p')).toFixed(2);
  1748.         var m = parseFloat(a.getAttribute('data-m')).toFixed(2);
  1749.         var r = parseFloat(a.getAttribute('data-r')).toFixed(2);
  1750.         var max = parseFloat(a.getAttribute('data-max'));
  1751.         // Si hay datos completos pintamos los pins en el indicador seleccionado
  1752.         if (p !== null && m !== null && r !== null){
  1753.             var dato_p = detres(p,max);
  1754.             var dato_m = detres(m,max);
  1755.             var dato_r = detres(r,max);
  1756.             var pinDiv = '<span class=\"statsline_item_extra\" style=\"left: '+dato_p+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Provincia '+p+'\"></i><span class=\"pindata\">P</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_m+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Municipio '+m+'\"></i><span class=\"pindata\">M</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_r+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Región '+r+'\"></i><span class=\"pindata\">R</span></span> ';
  1757.             var elemento = linestat[0];
  1758.             // elemento.insertAdjacentHTML('beforeend', pinDiv);
  1759.             dataDiv = titlestat[0].outerHTML + elemento.outerHTML;
  1760.             // selectedBox.innerHTML = dataDiv;   
  1761.         }else{
  1762.             dataDiv = titlestat[0].outerHTML + linestat[0].outerHTML;
  1763.             // selectedBox.innerHTML = dataDiv;
  1764.         }
  1765.         
  1766.         let titleAttribute = a.getAttribute('data-bs-title');
  1767.         let descAttribute = a.getAttribute('data-bs-content');
  1768.         // selectedBox.setAttribute(\"data-bs-title\", titleAttribute);
  1769.         // selectedBox.setAttribute(\"data-bs-content\", descAttribute);
  1770.         \$('[data-bs-toggle=\"popover_live_top\"]').mouseover(function(){
  1771.             \$('[data-bs-toggle=\"popover_live_top\"]').popover();
  1772.         });
  1773.         const popoverTriggerList = document.querySelectorAll('[data-bs-toggle=\"popover_live_top\"]')
  1774.         const popovertipList = [...popoverTriggerList].map(item => new bootstrap.Popover(item));
  1775.         const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
  1776.         const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
  1777.     }
  1778.     function detres(value,max){
  1779.         let dato = (value*100)/max;
  1780.         return dato.toFixed(2);
  1781.     }
  1782.     
  1783.     function updateMap(){
  1784.         var selectElement = document.querySelector('#kpi_selector');
  1785.         var kpi_id = selectElement.value;
  1786.         let indArr = [{'kpi': parseInt(kpi_id)}];
  1787.         rPlatform.setiSelected(indArr);
  1788.         rPlatform.setiActive();
  1789.         rPlatform.updateMap();
  1790.         var iActive = rPlatform.getiActive();
  1791.         updateSelector(iActive)
  1792.     }
  1793.     // --------------------- Simple Fn OK ------------------------------- //
  1794.     function updateSelector(kpi){
  1795.         var selector = document.getElementById('kpi_selector');
  1796.         selector.value = kpi;
  1797.     }
  1798.     function loadUrlBack(){
  1799.         let url = explore_baseUrl + \"/\" + explore_mun ;
  1800.         window.location.href = url;
  1801.     }
  1802.     
  1803.     function gotoproject(){
  1804.         let url = '';
  1805.         url = explore_baseUrl + \"/\" + explore_mun + \"/plan\";
  1806.         window.location.href = url;
  1807.     }
  1808.     function capitalizeFirstLetter(string) {
  1809.         return string.charAt(0).toUpperCase() + string.slice(1);
  1810.     }
  1811.     function viewFinder(a){
  1812.         \$('.viewfindergroup').hide();
  1813.         \$('#'+ a +'_view').show();
  1814.         
  1815.         if(a == 'map' || a == 'data')
  1816.         {
  1817.             \$(\"#infoview2\").show();
  1818.         }else{
  1819.             \$(\"#infoview2\").hide();
  1820.         }
  1821.         if(a == 'data'){
  1822.             tableData();
  1823.         }
  1824.         console.log(a);
  1825.         [...document.querySelectorAll('.left_bar_button')].map(x => x.classList.remove('active'));       
  1826.         document.getElementById('left_bar_button_'+a).classList.add('active');
  1827.     }
  1828.     
  1829.     function centerViewMap(){
  1830.         var zoom = rPlatform.getZoom();
  1831.         rPlatform.setCenterView(initGeo);
  1832.     }
  1833.     function expandIcon(e){
  1834.         var elemento = document.getElementById(e);
  1835.         var textoExtraido = elemento.innerText;
  1836.         if (textoExtraido == 'expand_more'){
  1837.             elemento.innerText = 'expand_less';
  1838.         }else{
  1839.             elemento.innerText = 'expand_more';
  1840.         }
  1841.     }
  1842.     function infoviewToggle(){
  1843.         if(\$('#infoview2').hasClass('show')){
  1844.             \$('#infoview2').collapse('hide');
  1845.             \$('#infoview').addClass('w-100');
  1846.             \$('#expand .material-symbols-outlined').text('collapse_content');
  1847.         }else{
  1848.             \$('#infoview2').collapse('show');
  1849.             \$('#infoview').removeClass('w-100');
  1850.             \$('#expand .material-symbols-outlined').text('expand_content');
  1851.         }
  1852.     }
  1853.     function activeClass(elem){
  1854.         var elemento = \$(elem);
  1855.         elemento.toggleClass('active');
  1856.     }
  1857.     
  1858. </script>
  1859. <script>
  1860.     \$(document).ready(function(){
  1861.         document.getElementById('big_container').classList.add('full');
  1862.         
  1863.         var headerInTop = document.getElementById('header_in_top').offsetHeight;
  1864.         var containerInContent = document.getElementById('container_in_content').offsetHeight;
  1865.         var headerContentInfoTop = document.getElementById('header_content_info_top').offsetHeight;
  1866.         var bigContainer = document.getElementById('big_container').offsetHeight;
  1867.         var containerInContentTotal = bigContainer - headerInTop;
  1868.         var containerSteps = bigContainer - headerInTop - headerContentInfoTop;
  1869.         
  1870.         document.getElementById('container_in_content').style.height = containerInContentTotal + 'px';
  1871.         document.getElementById('infoview_content').style.height = containerInContentTotal + 'px';
  1872.         document.getElementById('analytic_step').style.height = containerInContentTotal + 'px';
  1873.         
  1874.         var divs = document.querySelectorAll('.infoview_div');
  1875.         for(let i=0; divs.length > i; i++){
  1876.             divs[i].style.height = containerSteps + 'px';
  1877.         }
  1878.         var divs2 = document.querySelectorAll('.infoview2_div');
  1879.         for(let i=0; divs2.length > i; i++){
  1880.             divs2[i].style.height = containerSteps + 'px';
  1881.         }
  1882.         var divsIn = document.querySelectorAll('.viewfindergroup');
  1883.         for(let i=0; divsIn.length > i; i++){
  1884.             divsIn[i].style.height = containerSteps + 'px';
  1885.         }
  1886.         let flashDiv = document.querySelector('.flash-notice');
  1887.         if(flashDiv){
  1888.             setTimeout(()=>{
  1889.                 flashDiv.remove();
  1890.             },10000);
  1891.         }
  1892.     });
  1893.     function removeDiv(id){
  1894.         let divi = document.getElementById(id);
  1895.         divi.remove();
  1896.     }
  1897. </script>
  1898. ";
  1899.         
  1900.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  1901.         
  1902.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  1903.         yield from [];
  1904.     }
  1905.     /**
  1906.      * @codeCoverageIgnore
  1907.      */
  1908.     public function getTemplateName(): string
  1909.     {
  1910.         return "analytic/explore.html.twig";
  1911.     }
  1912.     /**
  1913.      * @codeCoverageIgnore
  1914.      */
  1915.     public function isTraitable(): bool
  1916.     {
  1917.         return false;
  1918.     }
  1919.     /**
  1920.      * @codeCoverageIgnore
  1921.      */
  1922.     public function getDebugInfo(): array
  1923.     {
  1924.         return array (  1705 => 889,  1701 => 888,  1697 => 887,  1693 => 886,  1689 => 885,  1636 => 835,  1612 => 813,  1605 => 812,  1601 => 811,  1594 => 810,  1589 => 809,  1579 => 807,  1576 => 806,  1572 => 805,  1569 => 804,  1563 => 803,  1558 => 801,  1547 => 798,  1544 => 797,  1541 => 796,  1537 => 795,  1534 => 794,  1531 => 793,  1528 => 792,  1525 => 791,  1521 => 790,  1484 => 756,  1476 => 751,  1468 => 746,  1460 => 741,  1452 => 736,  1444 => 731,  1437 => 727,  1429 => 722,  1421 => 717,  1413 => 712,  1405 => 707,  1397 => 702,  1389 => 697,  1381 => 692,  1373 => 687,  1365 => 682,  1357 => 677,  1349 => 672,  1341 => 667,  1331 => 660,  1323 => 655,  1303 => 638,  1296 => 634,  1221 => 562,  1212 => 556,  1208 => 555,  1202 => 552,  1198 => 550,  1192 => 546,  1188 => 544,  1182 => 540,  1178 => 538,  1172 => 534,  1168 => 532,  1162 => 528,  1149 => 518,  1144 => 516,  1134 => 509,  1128 => 506,  1123 => 504,  1119 => 503,  1115 => 502,  1110 => 500,  1090 => 483,  1086 => 482,  1082 => 481,  1041 => 443,  1036 => 440,  1030 => 436,  1012 => 421,  1008 => 420,  1002 => 418,  989 => 417,  962 => 398,  956 => 397,  947 => 390,  925 => 358,  915 => 351,  911 => 350,  898 => 346,  893 => 343,  878 => 341,  870 => 339,  862 => 337,  859 => 336,  856 => 335,  839 => 334,  834 => 331,  831 => 330,  828 => 329,  825 => 328,  818 => 326,  815 => 325,  812 => 324,  810 => 323,  807 => 322,  802 => 321,  800 => 320,  794 => 317,  787 => 313,  783 => 312,  755 => 309,  752 => 308,  749 => 307,  746 => 306,  743 => 305,  740 => 304,  737 => 303,  734 => 302,  731 => 301,  728 => 300,  725 => 299,  723 => 298,  720 => 297,  717 => 296,  715 => 295,  712 => 294,  706 => 292,  700 => 290,  698 => 289,  693 => 288,  691 => 287,  687 => 285,  685 => 284,  682 => 283,  679 => 282,  677 => 281,  660 => 280,  656 => 278,  653 => 276,  651 => 275,  644 => 271,  635 => 264,  621 => 263,  614 => 259,  610 => 258,  604 => 254,  601 => 253,  598 => 252,  596 => 251,  590 => 248,  586 => 247,  573 => 243,  568 => 240,  553 => 238,  545 => 236,  537 => 234,  534 => 233,  531 => 232,  514 => 231,  509 => 228,  506 => 227,  503 => 226,  500 => 225,  493 => 223,  490 => 222,  487 => 221,  485 => 220,  482 => 219,  477 => 218,  475 => 217,  469 => 214,  441 => 211,  438 => 210,  436 => 209,  433 => 208,  430 => 207,  427 => 206,  424 => 205,  421 => 204,  418 => 203,  415 => 202,  412 => 201,  409 => 200,  406 => 199,  404 => 198,  401 => 197,  398 => 195,  395 => 194,  378 => 193,  375 => 192,  373 => 191,  370 => 189,  367 => 188,  364 => 187,  362 => 186,  355 => 182,  345 => 175,  313 => 146,  303 => 139,  293 => 132,  285 => 127,  281 => 126,  277 => 125,  272 => 123,  218 => 72,  208 => 65,  201 => 60,  195 => 58,  189 => 56,  187 => 55,  182 => 54,  180 => 53,  172 => 47,  170 => 46,  167 => 45,  162 => 44,  146 => 30,  138 => 25,  130 => 20,  123 => 15,  113 => 11,  108 => 8,  104 => 7,  101 => 6,  88 => 5,  65 => 3,  42 => 1,);
  1925.     }
  1926.     public function getSourceContext(): Source
  1927.     {
  1928.         return new Source("{% extends 'Layouts/layout.html.twig' %}
  1929. {% block title %} Retabit Platform {% endblock %}
  1930. {% block content %}
  1931.     {% for message in app.flashes('notice') %}
  1932.         <div class=\"flash-notice\" id=\"flash_div\">
  1933.             <div class=\"text-end\"><span class=\"material-symbols-outlined hover\" onclick=\"removeDiv('flash_div')\">close</span></div>
  1934.             <div class=\"container\">
  1935.                 <p>{{ message | raw | trans}}</p>
  1936.             </div>
  1937.         </div>
  1938.     {% endfor %}
  1939.     <div class=\"modal fade\" id=\"popUpIndicadores\" tabindex=\"-1\" >
  1940.         <div class=\"modal-dialog modal-lg\">
  1941.             <div class=\"modal-content\">
  1942.                 <div class=\"modal-header\">
  1943.                     <h1 class=\"modal-title fs-5\" id=\"exampleModalLabel\">{% trans %}Selecciona los indicadores para descargar en un fichero Excel{% endtrans %}</h1>
  1944.                     <button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>
  1945.                 </div>
  1946.                 <div class=\"modal-body\">
  1947.                     <div class=\"row\">
  1948.                         <a id=\"selectAllBtn\" class=\"px-5 mb-2\" style=\"cursor: pointer; font-weight: 400; text-decoration:none;\">{% trans %}Seleccionar Todos{% endtrans %}</a>
  1949.                         <div class=\"col-12 px-5\" id=\"project_actions_content\">
  1950.                             
  1951.                         </div>
  1952.                         <div class=\"text-center\" id=\"popUpIndicadores_button\">
  1953.                             <button class=\"btn btn-primary\" onclick=\"getExcel()\">{% trans %}Descargar{% endtrans %} selección</button>
  1954.                         </div>
  1955.                     </div>
  1956.                 </div>
  1957.             </div>
  1958.         </div>
  1959.     </div>
  1960.     <div class=\"container-fluid project_explore_container\" id=\"container_in_content\">
  1961.         <div class=\"row justify-content-center\">
  1962.             <div id=\"infoview_content\" class=\"col-12\">
  1963.                 {# {{dump(analytic_data)}} #}
  1964.                 {% for item in analytic_data %}
  1965.                 {% if item.slug == slug %}
  1966.                     {#% dump(item) %#}
  1967.                 <div class=\"row justify-content-center\">
  1968.                     <!-- Textai box -->
  1969.                     <div class=\"col-12 p-3\" id=\"header_content_info_top\">
  1970.                         
  1971.                         <div class=\"d-flex justify-content-between align-items-center\">
  1972.                             <h2 class=\"d-inline-block\" data-bs-toggle=\"collapse\" href=\"#textai_box\" role=\"button\" aria-expanded=\"false\" aria-controls=\"textai_box\" onclick=\"expandIcon('analytics_title_arrow')\" >
  1973.                                 {% if app.request.locale == \"ca\" %}
  1974.                                     {{item.name_ca}}
  1975.                                 {% elseif app.request.locale == \"en\" %}
  1976.                                     {{item.name_en}}
  1977.                                 {% else %}
  1978.                                     {{item.name}}
  1979.                                 {% endif %}
  1980.                                  
  1981.                                 <span class=\"material-symbols-outlined hover\" id=\"analytics_title_arrow\">expand_more</span>
  1982.                             </h2>
  1983.                             <div class=\"d-flex\">
  1984.                                 <div class=\"d-flex align-items-center\">                                    
  1985.                                     <button class=\"btn btn-primary btn-sm\" onclick=\"loadSelectorIndicators()\">{% trans %}Descargar datos{% endtrans %}</button>
  1986.                                 </div>
  1987.                                 
  1988.                             </div>
  1989.                         </div>
  1990.                         <div class=\"collapse\" id=\"textai_box\" style=\"max-width: 940px;\">
  1991.                             <p class=\"flex-fill mb-3\" style=\"font-size: 14px;\">{{item.textai}}</p>
  1992.                         </div>
  1993.                         
  1994.                     </div>
  1995.                     
  1996.                     <div class=\"col-12 all_steps\" id=\"analytic_step\">
  1997.                         <div class=\"row justify-content-center align-items-top\">
  1998.                             <div id=\"infoview\" class=\"infoview_div col-12\">
  1999.                                 <div class=\"row align-items-center justify-content-center\">
  2000.                                     
  2001.                                     <div class=\"col-12 collapse show\" id=\"filter_div\">
  2002.                                         <div class=\"row align-items-center justify-content-center\">
  2003.                                             
  2004.                                         </div>
  2005.                                     </div>
  2006.                                 </div>
  2007.                                 <div class=\"row viewfindergroup\" id=\"map_view\" >
  2008.                                     <div class=\"col-12\">
  2009.                                         
  2010.                                         <div class=\"map__container\" style=\"position:relative;\">
  2011.                                             <div id=\"map\" class=\"map\"></div>
  2012.                                             <div class=\"legend\"></div>
  2013.                                             <div id=\"popup\" class=\"popup d-none\">
  2014.                                                 <a href=\"#\" id=\"popup-closer\" class=\"popup__closer\"></a>
  2015.                                                 <div id=\"popup-content\" class=\"popup__content\"></div>
  2016.                                             </div>
  2017.                                             <button id=\"centerbutton\" class=\"btn btn-light btn-sm pb-0\" onclick=\"centerViewMap()\">
  2018.                                             <span class=\"material-symbols-outlined\">fit_screen</span>
  2019.                                             <span class=\"material-symbols-outlined d-none\">collapse_content</span></button>
  2020.                                             <button id=\"expand\" class=\"btn btn-light btn-sm pb-0\" onclick=\"infoviewToggle()\">
  2021.                                             <span class=\"material-symbols-outlined\">expand_content</span></button>
  2022.                                         </div>
  2023.                                     </div>
  2024.                                 </div>
  2025.                                 <div class=\"row viewfindergroup\" id=\"data_view\">
  2026.                                     <div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
  2027.                                         <div id=\"wrapper\"></div>
  2028.                                     </div>
  2029.                                 </div>
  2030.                                 <div class=\"row viewfindergroup\" id=\"card_view\" >
  2031.                                     <div class=\"col-12 pb-2\" style=\"overflow-y: scroll; height: 80vh;\">
  2032.                                         <form class=\"row row-cols-lg-auto g-2 align-items-center mb-2 d-none\">
  2033.                                             <div class=\"col-12\">
  2034.                                                 <label class=\"visually-hidden\" for=\"via\">{% trans %}Tipo via{% endtrans %}</label>
  2035.                                                 <select class=\"form-select\" id=\"via\">
  2036.                                                     <option value=\"1\">{% trans %}Calle{% endtrans %}</option>
  2037.                                                     <option value=\"2\">{% trans %}Avenida{% endtrans %}</option>
  2038.                                                     <option value=\"3\">{% trans %}Rambla{% endtrans %}</option>
  2039.                                                 </select>
  2040.                                             </div>
  2041.                                             <div class=\"col-12\">
  2042.                                                 <label class=\"visually-hidden\" for=\"street_name\">{% trans %}Nombre calle{% endtrans %}</label>
  2043.                                                 <div class=\"input-group\">
  2044.                                                     <input type=\"text\" class=\"form-control\" id=\"street\" placeholder=\"Nombre de calle\">
  2045.                                                 </div>
  2046.                                             </div>
  2047.                                             <div class=\"col-12\">
  2048.                                                 <label class=\"visually-hidden\" for=\"flat\">{% trans %}Piso{% endtrans %}</label>
  2049.                                                 <div class=\"input-group\">
  2050.                                                     <input type=\"text\" class=\"form-control\" id=\"flat\" placeholder=\"Piso\">
  2051.                                                 </div>
  2052.                                             </div>
  2053.                                             <div class=\"col-12\">
  2054.                                                 <label class=\"visually-hidden\" for=\"floor\">{% trans %}Planta{% endtrans %}</label>
  2055.                                                 <div class=\"input-group\">
  2056.                                                     <input type=\"text\" class=\"form-control\" id=\"floor\" placeholder=\"Pta.\">
  2057.                                                 </div>
  2058.                                             </div>
  2059.                                             <div class=\"col-12\">
  2060.                                                 <button type=\"submit\" class=\"btn btn-primary pb-0\"><span class=\"material-symbols-outlined\">search</span></button>
  2061.                                             </div>
  2062.                                         </form>
  2063.                                         <div class=\"row\" style=\" padding: 20px; margin-bottom: 40px;    box-sizing: border-box;\">
  2064.                                             <div class=\"col-6 col-sm-3 overflow-hidden\" id=\"img_fachada\" style=\"background: #fbfbfb;  padding: 20px;\"></div>
  2065.                                             
  2066.                                             <div class=\"col-6 col-sm-3 overflow-hidden me-4\" id=\"img_catastro\" style=\"background: #fbfbfb;  padding: 20px;\"></div>
  2067.                                             <div class=\"col-12 col-sm-5\" id=\"txt_build\"></div>
  2068.                                             
  2069.                                         </div>
  2070.                                         
  2071.                                         <div class=\"row g-3\" id=\"build_indicators\">
  2072.                                         </div>
  2073.                                     </div>
  2074.                                 </div>
  2075.                             </div>
  2076.                             <div id=\"infoview2\" class=\"infoview2_div collapse collapse-horizontal show\">
  2077.                                     
  2078.                                 
  2079.                                 <!-- Selected box -->
  2080.                                 <div class=\"col-12 selected_box p-3 mb-3 sticky-top d-none\">
  2081.                                     <h4>{% trans %}Indicador seleccionado{% endtrans %}</h4>
  2082.                                     <div id=\"selected_box_content\" class=\"selected_box_item\" title=\"Header\" data-bs-toggle=\"popover_live_top\" data-bs-trigger=\"hover focus\" data-bs-title=\"Popover title\" data-bs-content=\"And here's some amazing content. It's very engaging. Right?\"></div>
  2083.                                 </div>
  2084.                                 <!-- Indicadores box -->
  2085.                                 <div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
  2086.                                     <div class=\"d-flex justify-content-between\">
  2087.                                         <p class=\"fw-bold fs-5\">{% trans %}Indicadores relacionados{% endtrans %}</p>
  2088.                                         
  2089.                                     </div>
  2090.                                     <div class=\"\" id=\"analytics_indicators\">
  2091.                                         {% set break = false %}
  2092.                                         {% set array_used = [] %}
  2093.                                         {% set category = '' %}
  2094.                                         {#% dump(\"Item\") %#}
  2095.                                         {#% dump(item) %#}
  2096.                                         {% for rel in item.relation %}
  2097.                                             {% if break == false %}
  2098.                                             {#% dump(rel) %#}
  2099.                                             {% if app.request.locale == \"ca\" %}
  2100.                                                 {% set title = rel.name_ca %}
  2101.                                                 {% set description = rel.info_ca %}
  2102.                                             {% elseif app.request.locale == \"en\" %}
  2103.                                                 {% set title = rel.name_en %}
  2104.                                                 {% set description = rel.info_en %}
  2105.                                             {% else %}
  2106.                                                 {% set title = rel.name %}
  2107.                                                 {% set description = rel.info %}
  2108.                                             {% endif %}
  2109.                                             {% set array_used = array_used|merge([rel.kpi]) %}
  2110.                                             
  2111.                                             <div id=\"statline_id_{{rel.kpi}}\" onclick=\"updateMapFromDiv({{rel.kpi}})\" class=\"grayscale analytics_statsline_item\" data-kpi=\"{{rel.kpi}}\" data-slug=\"{{rel.slug}}\" data-bs-toggle=\"popover_live_{{loop.index}}\" data-bs-trigger=\"hover focus\" data-bs-title=\"{{title|capitalize}}\" data-bs-content=\"{{description}}\" data-p=\"{{ rel.province }}\" data-m=\"{{ rel.city }}\" data-r=\"{{ rel.region }}\" data-max=\"{{ rel.max_value }}\" data-min=\"{{ rel.min_value }}\">
  2112.                                             
  2113.                                                 <p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">{{title|capitalize}}</p>
  2114.                                                 <div class=\"statsline mb-3\" >
  2115.                                                     {% set color = [] %}
  2116.                                                     {% for rank in kpi_rank %}
  2117.                                                         
  2118.                                                         {% if rank.kpi_id == rel.kpi %}
  2119.                                                             {% set color = color|merge([rank.bgcolor]) %}
  2120.                                                         {% endif %}
  2121.                                                     {% endfor %}
  2122.                                                     {% set counter = color|length %}
  2123.                                                     {% set partsize = 100/counter %}
  2124.                                                     {% set stylestring = '' %}
  2125.                                                     <div class=\"bk_line\">
  2126.                                                     {% for colorpart in color %}
  2127.                                                         {% if loop.last %}
  2128.                                                         {% set dato = 99.9-(partsize*(counter - 1)) %}
  2129.                                                             <div class=\"analytic_color_bar\" style=\"width:{{dato}}%; background-color: {{colorpart}};\"></div>
  2130.                                                         {% else %}
  2131.                                                             <div class=\"analytic_color_bar\" style=\"width:{{partsize|number_format(2, '.')}}%; background-color: {{colorpart}};\"></div>        
  2132.                                                         {% endif %}
  2133.                                                         
  2134.                                                     {% endfor %}
  2135.                                                     
  2136.                                                     </div>
  2137.                                                     
  2138.                                                     <span class=\"statsline_item statsline_{{loop.index}} item_tooltip\" style=\"left: {{rel.theme_per}}%;margin-left: -6px;\" data-text=\"{{rel.theme}}\" data-kpi=\"{{rel.kpi}}\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
  2139.                                                     
  2140.                                                 </div>
  2141.                                                 <div class=\"statsline_range d-flex justify-content-between d-none\">
  2142.                                                     <span>{{rel.min_value}}</span>
  2143.                                                     <span>{{rel.max_value}}</span>
  2144.                                                 </div>
  2145.                                                 {% if loop.index == 4 %}
  2146.                                                 {% set break = true %}
  2147.                                                 {% endif %}
  2148.                                            
  2149.                                             
  2150.                                             </div>
  2151.                                             <script>
  2152.                                             \$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').mouseover(function(){
  2153.                                                 \$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').popover();
  2154.                                             })
  2155.                                         </script>
  2156.                                          {% endif %}
  2157.                                         {% endfor %}
  2158.                                         
  2159.                                         </div>
  2160.                                     </div>
  2161.                                 <!-- Otros Indicadores box -->
  2162.                                 <div class=\"col-12 analytic_box box_blue_soft p-3 graphic_box stats_box mb-3\">
  2163.                                     <div class=\"d-flex justify-content-between\">
  2164.                                         <p class=\"fw-bold fs-5\" data-bs-toggle=\"collapse\" data-bs-target=\"#analytics_indicators\" aria-expanded=\"true\" aria-controls=\"analytics_statsline\" onclick=\"expandIcon('analytics_indicators_arrow')\" role=\"button\">{% trans %}Otros indicadores{% endtrans %}</p>
  2165.                                         
  2166.                                     </div>
  2167.                                     <div class=\"\" id=\"analytics_indicators_others\">
  2168.                                         {% set category = '' %}
  2169.                                         
  2170.                                         {#% dump(\"Analytic\") %#}
  2171.                                         
  2172.                                         {% for rel in analytic_data_relation %}
  2173.                                             {#% dump(rel) %#}
  2174.                                             {% if rel.kpi not in array_used %}
  2175.                                             {% if category != rel.category %}
  2176.                                                 <p class=\"mt-2 fw-bold\" style=\"font-size: 12px; font-weight: 700;\"> 
  2177.                                                      
  2178.                                                     {% if app.request.locale == \"ca\" %}
  2179.                                                         {{rel.category_ca}} 
  2180.                                                     {% elseif app.request.locale == \"en\" %}
  2181.                                                         {{rel.category_en}} 
  2182.                                                     {% else %}
  2183.                                                         {{rel.category}} 
  2184.                                                     {% endif %}
  2185.                                                 </p>
  2186.                                                 {% set category = rel.category %}
  2187.                                             {% endif %}
  2188.                                             {% if app.request.locale == \"ca\" %}
  2189.                                                 {% set title = rel.name_ca %}
  2190.                                                 {% set description = rel.info_ca %}
  2191.                                             {% elseif app.request.locale == \"en\" %}
  2192.                                                 {% set title = rel.name_en %}
  2193.                                                 {% set description = rel.info_en %}
  2194.                                             {% else %}
  2195.                                                 {% set title = rel.name %}
  2196.                                                 {% set description = rel.info %}
  2197.                                             {% endif %}
  2198.                                             
  2199.                                             <div id=\"statline_id_{{rel.kpi}}\" onclick=\"updateMapFromDiv({{rel.kpi}})\" class=\"grayscale analytics_statsline_item\" data-kpi=\"{{rel.kpi}}\" data-slug=\"{{rel.slug}}\" data-bs-toggle=\"popover_live_{{loop.index}}\" data-bs-trigger=\"hover focus\" data-bs-title=\"{{title|capitalize}}\" data-bs-content=\"{{description}}\" data-p=\"{{ rel.province }}\" data-m=\"{{ rel.city }}\" data-r=\"{{ rel.region }}\" data-max=\"{{ rel.max_value }}\" data-min=\"{{ rel.min_value }}\">
  2200.                                             <script>
  2201.                                             \$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').mouseover(function(){
  2202.                                                 \$('[data-bs-toggle=\"popover_live_{{loop.index}}\"]').popover();
  2203.                                             })
  2204.                                             </script>
  2205.                                             
  2206.                                                 <p class=\"mb-1 title\" style=\"font-size: 14px; font-weight: 600;\">{{title|capitalize}}</p>
  2207.                                                 <div class=\"statsline mb-3\" >
  2208.                                                     {% set color = [] %}
  2209.                                                     {% for rank in kpi_rank %}
  2210.                                                         
  2211.                                                         {% if rank.kpi_id == rel.kpi %}
  2212.                                                             {% set color = color|merge([rank.bgcolor]) %}
  2213.                                                         {% endif %}
  2214.                                                     {% endfor %}
  2215.                                                     {% set counter = color|length %}
  2216.                                                     {% set partsize = 100/counter %}
  2217.                                                     {% set stylestring = '' %}
  2218.                                                     <div class=\"bk_line\">
  2219.                                                     {% for colorpart in color %}
  2220.                                                         {% if loop.last %}
  2221.                                                         {% set dato = 99.9-(partsize*(counter - 1)) %}
  2222.                                                             <div class=\"analytic_color_bar\" style=\"width:{{dato}}%; background-color: {{colorpart}};\"></div>
  2223.                                                         {% else %}
  2224.                                                             <div class=\"analytic_color_bar\" style=\"width:{{partsize|number_format(2, '.')}}%; background-color: {{colorpart}};\"></div>        
  2225.                                                         {% endif %}
  2226.                                                         
  2227.                                                     {% endfor %}
  2228.                                                     
  2229.                                                     </div>
  2230.                                                     
  2231.                                                     <span class=\"statsline_item statsline_{{loop.index}} item_tooltip\" style=\"left: {{rel.theme_per}}%; margin-left: -6px;\" data-text=\"{{rel.theme}}\" data-kpi=\"{{rel.kpi}}\" data-bs-custom-class=\"custom-tooltip\" data-bs-placement=\"top\"><i class=\"fa-solid triangle\"></i></span>
  2232.                                                     
  2233.                                                 </div>
  2234.                                                 <div class=\"statsline_range d-flex justify-content-between d-none\">
  2235.                                                     <span>{{rel.min_value}}</span>
  2236.                                                     <span>{{rel.max_value}}</span>
  2237.                                                 </div>
  2238.                                             
  2239.                                             </div>
  2240.                                             
  2241.                                             {% endif %}
  2242.                                         {% endfor %} 
  2243.                                         </div>
  2244.                                     </div>
  2245.                                     
  2246.                                 </div>
  2247.                                         {# <div class=\"\" id=\"analytics_barplot_container\">
  2248.                                             <div id=\"analytics_barplot\">
  2249.                                                 
  2250.                                                 <div class=\"hover_window\">
  2251.                                                     <h5>Uso del edificio</h5>
  2252.                                                     <div class=\"mb-3\" id=\"statUseBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(105)\"></div>
  2253.                                                 </div>
  2254.                                                 
  2255.                                                 <div class=\"hover_window\">
  2256.                                                     <h5>Año de construcción</h5>
  2257.                                                     <div class=\"mb-3\" id=\"statYearBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(100)\"></div>
  2258.                                                 </div>
  2259.                                                 
  2260.                                                 <div class=\"hover_window\">
  2261.                                                     <h5>Área</h5>
  2262.                                                     <div class=\"mb-3\" id=\"statAreaBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(101)\"></div>
  2263.                                                 </div>
  2264.                                                 
  2265.                                                 <div class=\"hover_window\">
  2266.                                                     <h5>Porcentaje de ocupación</h5>
  2267.                                                     <div class=\"mb-3\" id=\"statOccupationBox\" style=\"position: relative;\" onclick=\"updateMapFromStat(104)\"></div>
  2268.                                                 </div>
  2269.                                                 
  2270.                                             </div>
  2271.                                         </div> #}
  2272.                                 
  2273.                                 
  2274.                             </div>
  2275.                         </div>
  2276.                     </div>
  2277.                 {% endif %}
  2278.                 {% endfor %}
  2279.                 </div>
  2280.                 
  2281.             </div>
  2282.             
  2283.             
  2284.         </div>
  2285.     </div>
  2286. <style>
  2287. td.gridjs-td{
  2288.     //padding: 2px 24px !important;
  2289. }
  2290. </style>
  2291. {% endblock %}
  2292. {% block javascripts %}
  2293. <script src=\"{{ asset('build/js/calls.js') }}\"></script>
  2294. <script src=\"{{ asset('bundles/fosjsrouting/js/router.min.js') }}\"></script>
  2295. <script src=\"{{ path('fos_js_routing_js', { callback: 'fos.Router.setData' }) }}\"></script>
  2296. <script src=\"https://cdnjs.cloudflare.com/ajax/libs/gridjs/6.0.6/gridjs.production.min.js\" integrity=\"sha512-wpiJjuL800CTEBA0QFs+RFw0tFtpXnQGea1p9S16WcYNXC1F3U0l1L7FQrDC3ihkYRtOj4Td7lKR3mYKxrwMMA==\" crossorigin=\"anonymous\" referrerpolicy=\"no-referrer\"></script>
  2297. <link rel=\"stylesheet\" type=\"text/css\" href=\"https://unpkg.com/gridjs/dist/theme/mermaid.min.css\" />
  2298. <script type=\"text/javascript\">
  2299.     const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
  2300.     const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
  2301.     var Routes = Routing; // loaded from router.min.js
  2302.     // because ES5 doesn't support require syntax,
  2303.     // we use jquery getJSON function in order to set
  2304.     // routing data to our Routing object
  2305.     \$.getJSON(\"{{ asset('build/js/fos_js_routes.json') }}\", function (routes) {
  2306.         Routes.setRoutingData(routes);
  2307.     });
  2308.     {# console.log(Routes); #}
  2309. </script>
  2310. <script type=\"text/javascript\">
  2311.     //let explore_baseUrl = '{{ base_url }}';
  2312.     \$(document).ready(function(){
  2313.         \$('.viewfindergroup').hide();
  2314.         \$('#map_view').show();        
  2315.         \$('.build_bar').css('width','100%');
  2316.         \$('.people_bar').css('width','100%');
  2317.         /*setTimeout(()=>{
  2318.             \$('#info_div').collapse('hide');
  2319.         },10000);*/
  2320.         let arrayData = document.querySelectorAll('.analytics_statsline_item');
  2321.         let arraySlugs = [];
  2322.         for(let i=0; arrayData.length > i; i++){
  2323.             arraySlugs.push(arrayData[i].getAttribute('data-slug'));
  2324.         }
  2325.         // console.log(arraySlugs);
  2326.         buttonsToHeaderBar();
  2327.         \$('#left_bar_button_map').addClass('active');
  2328.     });
  2329.     document.getElementById(\"selectAllBtn\").addEventListener(\"click\", function() {
  2330.         let checkboxes = document.querySelectorAll(\".form-check-input\");
  2331.         let allChecked = Array.from(checkboxes).every(checkbox => checkbox.checked);
  2332.         checkboxes.forEach(checkbox => {
  2333.             checkbox.checked = !allChecked; // Alterna selección
  2334.         });
  2335.         this.textContent = allChecked ? \"Seleccionar Todos\" : \"Deseleccionar Todos\"; 
  2336.     });
  2337.     function buttonsToHeaderBar(){
  2338.         // <span class=\"material-symbols-outlined\">bar_chart_4_bars</span>
  2339.         document.getElementById('new_header_map').innerHTML = '<div id=\"left_bar_button_map\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'map\\')\"><span class=\"material-symbols-outlined\">map</span><br>{{\"Mapa\" |trans}}</div>';
  2340.         document.getElementById('new_header_table').innerHTML = '<div id=\"left_bar_button_data\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'data\\')\"><span class=\"material-symbols-outlined\">table</span><br>{{\"Tabla\" |trans}}</div>';
  2341.         document.getElementById('new_header_card').innerHTML = '<div id=\"left_bar_button_card\" class=\"left_bar_button text-center d-inline-block\" onclick=\"viewFinder(\\'card\\')\"><span class=\"material-symbols-outlined\">grid_view</span><br>{{\"Ficha\" |trans}}</div>';
  2342.         
  2343.     }
  2344.     \$('.item_tooltip').on('mouseover',function (){
  2345.         
  2346.         let name = this.getAttribute('data-text');
  2347.         let kpi = this.getAttribute('data-kpi');
  2348.         // console.log(name,kpi);
  2349.         \$('.item_tooltip[data-kpi='+kpi+']').tooltip({title: name, delay: {show: 100, hide: 100}}); 
  2350.     })
  2351.     const { Grid, html } = gridjs;
  2352.     var rPlatform = map;
  2353.     var caller = call;
  2354.     let layers = {{ layers |raw}};
  2355.     let configLayers = {{ configLayers|raw }};
  2356.     let explore_baseUrl = '{{ base_url }}';
  2357.     caller.vars.explore_baseUrl = '{{ base_url }}';
  2358.     
  2359.     let explore_mun = '{{ mun }}';
  2360.     let explore_kpi = 3;
  2361.     let explore_slug = '';
  2362.     let explore_colors = {{ kpi_colors|raw }};
  2363.     let explore_insight = [];
  2364.     let explore_extrakpi = [];
  2365.     let explore_layer_data = [];
  2366.     let explore_url = window.location.href;
  2367.     let explore_filter_url = '';
  2368.     let filtered_data_array = {{ filtered_data|raw }};
  2369.     let kpi_list = {{ kpi_list|raw }};
  2370.     let kpi_list_complete = document.querySelectorAll('#kpi_list_data li');
  2371.     for(i=0; kpi_list_complete.length > i; i++){
  2372.         let name = kpi_list_complete[i].innerText;
  2373.         let kpi = kpi_list_complete[i].getAttribute('data-kpi');
  2374.         let slug = kpi_list_complete[i].getAttribute('data-slug');
  2375.         kpi_list.push({'name':name,'kpi':kpi,'slug':slug});
  2376.     }
  2377.     // use stats data and print graphic
  2378.     let useStat = {{ useStatData|raw }};
  2379.     let useStatData = analyticOrganizeData(useStat);
  2380.     var useStatTotalData = analyticOrganizeTotalData(useStat);
  2381.     {# barplotDoubleDouble100('statUseBox',useStatData[0],useStatTotalData[1],useStatData[2], 'analytics_barplot_container',useStatTotalData[0]); #}
  2382.     
  2383.     // year stats data and print graphic
  2384.     let yearStat = {{ yearStatData|raw }};
  2385.     let yearStatData = analyticOrganizeData(yearStat);
  2386.     var yearStatTotalData = analyticOrganizeTotalData(yearStat);
  2387.     {# barplotDoubleDouble100('statYearBox',yearStatData[0],yearStatTotalData[1],yearStatData[2], 'analytics_barplot_container',yearStatTotalData[0]); #}
  2388.     // area stats data and print graphic
  2389.     let areaStat = {{ areaStatData|raw }};
  2390.     let areaStatData = analyticOrganizeData(areaStat);
  2391.     var areaStatTotalData = analyticOrganizeTotalData(areaStat);
  2392.     {# barplotDoubleDouble100('statAreaBox',areaStatData[0],areaStatTotalData[1],areaStatData[2], 'analytics_barplot_container',areaStatTotalData[0]); #}
  2393.     // occupation stats data and print graphic
  2394.     let occupationStat = {{ occupationStatData|raw }};
  2395.     let occupationStatData = analyticOrganizeData(occupationStat);
  2396.     var occupationStatTotalData = analyticOrganizeTotalData(occupationStat);
  2397.     {# barplotDoubleDouble100('statOccupationBox',occupationStatData[0],occupationStatTotalData[1],occupationStatData[2], 'analytics_barplot_container',occupationStatTotalData[0]); #}
  2398.     let explore_mun_name = '{{ municipioname.adminunitname|capitalize }}';
  2399.     let allgeodataUrl = explore_baseUrl + \"/get-allgeodata?mun=\" + explore_mun ;
  2400.     let munPolygon = '{{ municipioname.geom }}';
  2401.     let initGeo = '{{ municipioname.envelope }}';
  2402.     
  2403.     let queryString = window.location.search;
  2404.     let urlParams = new URLSearchParams(queryString);
  2405.     let filterStart = urlParams.get('fs');
  2406.     let filterEnd = urlParams.get('fe');
  2407.     window.appLocale = '{{ app.request.locale|e('js') }}';
  2408.     if(filterStart == null){
  2409.         filterStart = 0;
  2410.     }
  2411.     if(filterEnd == null){
  2412.         filterEnd = 0;
  2413.     }
  2414.     rPlatform.setInpireidList(filtered_data_array);
  2415.     rPlatform.setMun(explore_mun);
  2416.     rPlatform.setBaseUrl(explore_baseUrl);
  2417.     rPlatform.setLayers(layers);
  2418.     rPlatform.setColorsStyle(explore_colors);
  2419.     rPlatform.setLayerData(explore_layer_data);
  2420.    
  2421.     // ----------------------- Map ------------------------ //
  2422.     async function init() { // Cargar mapa de inicio
  2423.         let queryString = window.location.search;
  2424.         let urlParams = new URLSearchParams(queryString);
  2425.         // Crear indArr con el primer kpi del listado
  2426.         let alldivi = document.getElementsByClassName('grayscale');
  2427.         let kpi_init = alldivi[0].getAttribute('data-kpi');
  2428.         let slug_init = alldivi[0].getAttribute('data-slug');
  2429.         explore_kpi = kpi_init;
  2430.         explore_slug = slug_init;
  2431.         alldivi[0].classList.add('kpi_selected');
  2432.         alldivi[0].classList.add('disabled');
  2433.         // Colocar primer alldivi como seleccionado
  2434.         selectedIndicator(alldivi[0]);
  2435.         // Recibir parametros ind desde url
  2436.         let indArr = [parseInt(kpi_init)];
  2437.         let frArr = [filterStart, filterEnd];
  2438.         await rPlatform.setiActive(indArr);
  2439.         await rPlatform.initMapExplore(layers, explore_baseUrl, initGeo, explore_mun, frArr, indArr);
  2440.         await rPlatform.getSimpleStyleDistrict();
  2441.         await rPlatform.getSimpleStyleSection();
  2442.         rPlatform.updateMap();
  2443.     }
  2444.     init();
  2445.     
  2446.     
  2447.     // ----------------------- Table Map ------------------------ //
  2448.     function tableData(){        
  2449.         let wrapper = document.getElementById(\"wrapper\");
  2450.         wrapper.innerHTML = '';
  2451.         let tabla = null; // Variable global para almacenar la instancia de la tabla
  2452.         function renderizarTabla(data) {
  2453.             // Eliminar la tabla anterior si existe
  2454.             if (tabla !== null) {
  2455.                 tabla.destroy();
  2456.             }
  2457.             // Crear una nueva instancia de Grid.js con los nuevos datos y renderizarla
  2458.             tabla = new gridjs.Grid({
  2459.                 columns: [{
  2460.                     id: 'year',
  2461.                     name: \"{{'Año' |trans }}\"
  2462.                 },
  2463.                 {
  2464.                     id: 'currentuse',
  2465.                     name: \"{{'Uso' |trans }}\",
  2466.                     formatter: (cell, row) => {
  2467.                         if (cell == '1_residential' ){
  2468.                             return gridjs.html(`<span style=\"color: blue; cursor:pointer;\" onclick=\" viewFinder(\\'card\\'); viewCard(\\'\${row.cells[22].data}\\')\">Residential</span>`)  
  2469.                         }else if(cell == '2_agriculture'){
  2470.                             return gridjs.html(`<span style=\"color: green; cursor:pointer;\" onclick=\"viewFinder(\\'card\\');  viewCard(\\'\${row.cells[22].data}\\')\">Agriculture</span>`)
  2471.                         }else if(cell == '3_industrial'){
  2472.                             return gridjs.html(`<span style=\"color: gray; cursor:pointer;\" onclick=\"viewFinder(\\'card\\');  viewCard(\\'\${row.cells[22].data}\\')\">Industrial</span>`)
  2473.                         }else if(cell == '4_3_publicServices'){
  2474.                             return gridjs.html(`<span style=\"color: orange; cursor:pointer;\" onclick=\"viewFinder(\\'card\\');  viewCard(\\'\${row.cells[22].data}\\')\">Public services</span>`)
  2475.                         }else{
  2476.                             return gridjs.html(`<span style=\"color: black\">\${cell}</span>`)
  2477.                         }
  2478.                     }
  2479.                 },
  2480.                 {
  2481.                     id: 'grossfloorarea',
  2482.                     name: \"{{'Grossfloorarea' |trans }}\",
  2483.                     formatter: (cell) => html(`\${cell} m<sup>2</sup>`)
  2484.                 },
  2485.                 {
  2486.                     id: 'habitantes',
  2487.                     name: \"{{'Habitantes' |trans }}\",
  2488.                     formatter: (cell) => {
  2489.                         return gridjs.html(`<div class=\"mt-2\"><i class=\"fa-solid fa-users\"></i> \${cell}</div>`)
  2490.                     }
  2491.                 },
  2492.                 {
  2493.                     id: 'numberofdwellings',
  2494.                     name: \"{{'Viviendas' |trans }}\",
  2495.                     formatter: (cell) => html(`\${cell}`)
  2496.                 },
  2497.                 {
  2498.                     id: 'kpi_1_energy_renovated_residential_buildings',
  2499.                     name: \"{{'Energy renovated residential buildings' |trans }}\",
  2500.                     formatter: (cell) => html(`\${cell}`)
  2501.                 },
  2502.                 {
  2503.                     id: 'kpi_2_final_energy_consumption',
  2504.                     name: \"{{'Final energy consumption' |trans }}\",
  2505.                     formatter: (cell) => html(`\${cell}`)
  2506.                 },
  2507.                 {
  2508.                     id: 'kpi_3_renewable_energy_consumption',
  2509.                     name: \"{{'Renewable energy consumption' |trans }}\",
  2510.                     formatter: (cell) => html(`\${cell}`)
  2511.                 },
  2512.                 {
  2513.                     id: 'kpi_4_pv_potential_generation',
  2514.                     name: \"{{'Pv potential generation' |trans }}\",
  2515.                     formatter: (cell) => html(`\${cell}`)
  2516.                 },
  2517.                 {
  2518.                     id: 'kpi_7_heating_energy_consumption',
  2519.                     name: \"{{'Heating energy consumption' |trans }}\",
  2520.                     formatter: (cell) => html(`\${cell}`)
  2521.                 },
  2522.                 {
  2523.                     id: 'kpi_8_ghg_emissions',
  2524.                     name: \"{{'GhG emissions' |trans }}\",
  2525.                     formatter: (cell) => html(`\${cell}`)
  2526.                 },
  2527.                 {
  2528.                     id: 'kpi_19_population_income_below_60_average',
  2529.                     name: \"{{'Population income below 60 average' |trans }}\",
  2530.                     formatter: (cell) => html(`\${cell}`)
  2531.                 },
  2532.                 {
  2533.                     id: 'kpi_20_median_household_income',
  2534.                     name: \"{{'Median household income' |trans }}\",
  2535.                     formatter: (cell) => html(`\${cell}`)
  2536.                 },
  2537.                 {
  2538.                     id: 'kpi_21_average_price_renting_compared_family_income',
  2539.                     name: \"{{'Average price renting compared family income' |trans }}\",
  2540.                     formatter: (cell) => html(`\${cell}`)
  2541.                 },
  2542.                 {
  2543.                     id: 'kpi_22_house_price',
  2544.                     name: \"{{'House price' |trans }}\",
  2545.                     formatter: (cell) => html(`\${cell}`)
  2546.                 },
  2547.                 {
  2548.                     id: 'kpi_27_urban_equipment_at_15_min',
  2549.                     name: \"{{'Urban equipment at 15 min' |trans }}\",
  2550.                     formatter: (cell) => html(`\${cell}`)
  2551.                 },
  2552.                 {
  2553.                     id: 'kpi_28_accessibility_to_bike_lane',
  2554.                     name: \"{{'Accessibility to bike lane' |trans }}\",
  2555.                     formatter: (cell) => html(`\${cell}`)
  2556.                 },{
  2557.                     id: 'kpi_30_green_area_surfaces',
  2558.                     name: \"{{'Green area surfaces' |trans }}\",
  2559.                     formatter: (cell) => html(`\${cell}`)
  2560.                 },
  2561.                 {
  2562.                     id: 'kpi_31_vulnerability_heatwaves_temperature_rise',
  2563.                     name: \"{{'Vulnerability heatwaves temperature rise' |trans }}\",
  2564.                     formatter: (cell) => html(`\${cell}`)
  2565.                 },
  2566.                 {
  2567.                     id: 'kpi_36_charging_outlets',
  2568.                     name: \"{{'Charging outlets' |trans }}\",
  2569.                     formatter: (cell) => html(`\${cell}`)
  2570.                 },
  2571.                 {
  2572.                     id: 'kpi_6_1_energy_efficient_and_energy_recovering_homes',
  2573.                     name: \"{{'Energy efficient and energy recovering_homes' |trans }}\",
  2574.                     formatter: (cell) => html(`\${cell}`)
  2575.                 },
  2576.                 {
  2577.                     id: 'kpi_6_2_energy_efficient_and_energy_recovering_homes',
  2578.                     name: \"{{'Energy efficient and energy recovering homes' |trans }}\",
  2579.                     formatter: (cell) => html(`\${cell}`)
  2580.                 },
  2581.                 {
  2582.                     id: 'inspireid',
  2583.                     name: \"{{'inspireid' |trans }}\",
  2584.                     formatter: (cell) => html(`\${cell}`)
  2585.                 }],
  2586.                 data: data,
  2587.                 pagination: {
  2588.                     limit: 50,
  2589.                     summary: true,
  2590.                 },
  2591.                 resizable: true,
  2592.                 search: false,
  2593.                 sort: true,
  2594.                 fixedHeader: true,
  2595.                 height: \$(\"#infoview\").height(),
  2596.             }).render(wrapper);
  2597.         }
  2598.         // Llamar a la función obtenerDatos() para obtener los datos inicialmente y renderizar la tabla
  2599.         caller.obtenerDatos(explore_kpi, explore_mun, explore_slug)
  2600.             .then((data) => {
  2601.                 console.log(data);
  2602.                 renderizarTabla(data);
  2603.             })
  2604.             .then(()=>{
  2605.                 setTimeout(()=>{
  2606.                     updateTable(explore_slug);
  2607.                 },2000)
  2608.                 
  2609.             });
  2610.     }
  2611.     //------------------------ Descargar Datos ------------------- //
  2612.     function loadSelectorIndicators()
  2613.     {
  2614.         \$(\"#project_actions_content\").html('');
  2615.         {% for item in analytic_data %}
  2616.             {% if item.slug == slug %}
  2617.                 {% set break = false %}
  2618.                 {% set array_used = [] %}
  2619.                 {% for rel in item.relation %}
  2620.                     {% if break == false %}
  2621.                         {% set array_used = array_used|merge([rel.kpi]) %}
  2622.                         var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='{{rel.slug}}' id='flexCheckDefault' data-name='{{rel.name}}'> <label class='form-check-label' for='flexCheckDefault'> {{rel.name}} </label></div>\";
  2623.                         \$(\"#project_actions_content\").append(check);
  2624.                         
  2625.                         console.log('{{rel.name}}');
  2626.                     {% endif %}
  2627.                 {% endfor %}
  2628.                 {% for rel in analytic_data_relation %}
  2629.                     {% if rel.kpi not in array_used %}
  2630.                         var check = \"<div class='form-check'> <input class='form-check-input' type='checkbox' value='{{rel.slug}}' id='flexCheckDefault' data-name='{{rel.name}}'> <label class='form-check-label' for='flexCheckDefault'> {{rel.name}} </label></div>\";
  2631.                         \$(\"#project_actions_content\").append(check);
  2632.                         console.log('{{rel.name}}');
  2633.                     {% endif %} 
  2634.                 {% endfor %} 
  2635.             {% endif %} 
  2636.         {% endfor %} 
  2637.         \$(\"#popUpIndicadores\").modal('show');
  2638.     }
  2639.     function getExcel() {
  2640.         const selectedNames = {};
  2641.         const checkboxes = document.querySelectorAll('.form-check-input:checked');
  2642.         const selectedValues = Array.from(checkboxes).map(checkbox => checkbox.value);
  2643.         /*const selectedNames = Array.from(checkboxes).map(checkbox => ({
  2644.             [checkbox.value]: checkbox.dataset.name
  2645.         }));*/
  2646.         checkboxes.forEach((checkbox) => selectedNames[checkbox.value] = checkbox.dataset.name);
  2647.         console.log(selectedValues);
  2648.         console.log(selectedNames);        
  2649.         caller.getExcel(explore_kpi, explore_mun, explore_slug, selectedValues, selectedNames)
  2650.             .then((data) => {
  2651.                 console.log(data); 
  2652.                 var bURL = \"{{app.request.getBasePath() }}\";
  2653.                 var href = bURL + \"/documents/\" + data;            
  2654.                 location = href;                             
  2655.             }).then(
  2656.                 //si hay que eliminar el archivo generado ---> here
  2657.             );
  2658.             
  2659.     }
  2660.     
  2661.     // --------------------- Card ------------------------------- //
  2662.     async function viewCard(id){
  2663.         \$(\"#infoview2\").hide();
  2664.         \$('.viewfindergroup').hide();
  2665.         \$('#card_view').show();
  2666.         let fachada = document.getElementById('img_fachada');
  2667.         let catastro = document.getElementById('img_catastro');
  2668.         let txt_build = document.getElementById('txt_build');
  2669.         let build_indicators = document.getElementById('build_indicators');
  2670.         let size = fachada.offsetWidth;
  2671.         fachada.style.height = size + 'px';
  2672.         catastro.style.height = size + 'px';
  2673.         var imagenAlternativa = explore_baseUrl + '/img/img_bk_building.jpg';
  2674.         let img_fachada = '<img class=\"img-fluid\" src=\"https://ovc.catastro.meh.es/OVCServWeb/OVCWcfLibres/OVCFotoFachada.svc/RecuperarFotoFachadaGet?ReferenciaCatastral=' + id + '\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
  2675.         let img_catastro = '<img class=\"img-fluid\" src=\"https://www1.sedecatastro.gob.es/Cartografia/GeneraGraficoParcela.aspx?del=8&mun=279&refcat=' + id + '&AnchoPixels=500&AltoPixels=500\" width=\"auto\" height=\"'+size+'px\" onerror=\"this.onerror=null; this.src=\\''+ imagenAlternativa + '\\';\" />';
  2676.         document.getElementById('img_fachada').innerHTML = img_fachada;
  2677.         document.getElementById('img_catastro').innerHTML = img_catastro;
  2678.         let buildData = await caller.getBuildData(id);
  2679.         // console.log(buildData);
  2680.         let UseValue = '';
  2681.         let valuesContent = '';
  2682.         if (buildData.use_numeric == 0) {
  2683.             UseValue = 'SFH';
  2684.         } else {
  2685.             UseValue = 'MFH';
  2686.         }
  2687.                 
  2688.         valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Referencia catastral\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.inspireid + '</span></p>';
  2689.         valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Año de construcción\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.year + '</span></p>';
  2690.         valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Uso\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + UseValue + '</span></p>';
  2691.         valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Plantas\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.num_floors + '</span></p>';
  2692.         valuesContent += '<p style=\"font-size: 14px; \"><b>{{\"Superficie\" |trans}}:</b> <span style=\"color:#222222; padding-left: 15px;\">' + buildData.grossfloorarea + '</span></p>';
  2693.         document.getElementById('txt_build').innerHTML = valuesContent;
  2694.         // console.log(kpi_list);      
  2695.         build_indicators.innerHTML = '';
  2696.         for(let i=0; kpi_list.length > i; i++){
  2697.             // console.log(kpi_list[i].slug);
  2698.             let buildDataFiltered = Object.keys(buildData).filter((key) => key === kpi_list[i].slug).map((key) => buildData[key]);
  2699.             //console.log(kpi_list[i]);
  2700.             if(kpi_list[i].name != 'Todos'){
  2701.                 var styleBox = \"\";
  2702.                 var grafica = \"\";
  2703.                 if (kpi_list[i].name == \"año de construcción\" || kpi_list[i].name == \"área\" || kpi_list[i].name == \"uso\") 
  2704.                     styleBox = \"bk_box--color\";
  2705.                 
  2706.                
  2707.                 if ( \$(\"#statline_id_\"+kpi_list[i].id) ){
  2708.                      
  2709.                     let contenido = \$(\"#statline_id_\"+kpi_list[i].id).html();  // Obtiene el HTML
  2710.                     let tempDiv = \$(\"<div>\").html(contenido);   // Lo convierte en un objeto jQuery
  2711.                     tempDiv.find(\"p\").hide();
  2712.                     tempDiv.find(\".statsline_range\").removeClass(\"d-none\");
  2713.                     tempDiv.find(\".statsline_range\").css({
  2714.                         \"position\": \"relative\",
  2715.                         \"font-size\": \"12px\",
  2716.                         \"color\": \"#7a7a7a\",
  2717.                         //\"top\": \"-10px\"
  2718.                     });
  2719.                     let maxValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"max\");
  2720.                     let minValue = \$(\"#statline_id_\"+kpi_list[i].id).data(\"min\");
  2721.                     let per = Math.ceil(((buildDataFiltered[0]) - minValue)/(maxValue - minValue) * 100);
  2722.                     
  2723.                     tempDiv.find(\".statsline_item\").css(\"left\", per+\"%\");                    
  2724.                     grafica = tempDiv.html();
  2725.                 }  else grafica = \"\";
  2726.                 let dataNumber = \"\";
  2727.                 if (buildDataFiltered[0] == null){
  2728.                     if (window.appLocale == 'ca')   dataNumber = \"No hi han dades\";
  2729.                     else if (window.appLocale == 'en')  dataNumber = \"No data\";
  2730.                     else dataNumber = \"No hay datos\"; 
  2731.                 }   
  2732.                 else if (kpi_list[i].name != \"año de construcción\"){
  2733.                     numero = Number.parseFloat(buildDataFiltered[0]);
  2734.                     dataNumber = numero.toLocaleString(\"es-ES\");
  2735.                 }else  dataNumber =  buildDataFiltered[0];                           
  2736.                 if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 0){
  2737.                     if (window.appLocale == 'ca')   dataNumber = \"Unifamiliar\";
  2738.                     else if (window.appLocale == 'en')  dataNumber = \"Unifamiliar\";
  2739.                     else dataNumber = \"Unifamiliar\";
  2740.                     
  2741.                 }         
  2742.                 else if (kpi_list[i].name == \"uso\" && buildDataFiltered[0] == 1){
  2743.                     if (window.appLocale == 'ca')   dataNumber = \"Plurifamiliar\";
  2744.                     else if (window.appLocale == 'en')  dataNumber = \"Plurifamiliar\";
  2745.                     else dataNumber = \"Plurifamiliar\";
  2746.                 }     
  2747.                 if (window.appLocale == 'ca')
  2748.                 {
  2749.                     var kpiName = kpi_list[i].name_ca;
  2750.                     var KpiInfo = kpi_list[i].info_ca;
  2751.                 }else if (window.appLocale == 'en') {
  2752.                     var kpiName = kpi_list[i].name_en;
  2753.                     var KpiInfo = kpi_list[i].info_en;
  2754.                 }else{ 
  2755.                     var kpiName = kpi_list[i].name;
  2756.                     var KpiInfo = kpi_list[i].info; 
  2757.                 }
  2758.                 build_indicators.innerHTML += '<div class=\"col-6 col-sm-3 d-flex\"><div class=\"bk_box '+styleBox+' p-3 w-100 d-flex flex-column\"><div class=\"mb-2 d-flex justify-content-between align-items-baseline\" style=\"height: 58px;\"><p class=\"fw-bold mb-2\" style=\"font-size: 14px; line-height: 18px; max-width: 70%;\">'+ capitalizeFirstLetter(kpiName) +'</p><p style=\"font-weight:600; \"><span style=\"font-size:16px; color:#6E93F6;\"> '+ dataNumber +'</span></p></div><div class=\"d-flex justify-content-between mb-2\"><div style=\"width: 100%;\">'+grafica+'</div></div><p class=\" mb-2 boxed_limited\" onclick=\"activeClass(this)\" >'+ KpiInfo +'</p></div></div>';
  2759.                 
  2760.             }
  2761.             
  2762.         }
  2763.     }
  2764.     function formatearNumero(numero) {
  2765.         //return numero;
  2766.         
  2767.         if(typeof numero === 'number'){
  2768.             numero = numero.toString();
  2769.             numero = Number.parseFloat(numero);
  2770.             return numero.toLocaleString(\"es-ES\");
  2771.             // return numero.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");
  2772.         }else if(numero === null){
  2773.             return numero;
  2774.         }else{
  2775.             // console.log(numero);
  2776.             numero = Number.parseFloat(numero);
  2777.             return numero.toLocaleString(\"es-ES\");
  2778.             
  2779.         }
  2780.     }
  2781.     function hideCardOnData(){
  2782.         document.getElementById('info_window').innerHTML = '';
  2783.     }
  2784.     // --------------------- Fn OK ------------------------------- //
  2785.     function updateMapFromDiv(a){
  2786.         let indArr = [{'kpi': parseInt(a)}];
  2787.         let divi = document.getElementById('statline_id_' + a);
  2788.         let alldivi = document.getElementsByClassName('grayscale');
  2789.         for(let i=0; alldivi.length > i; i++){
  2790.             alldivi[i].classList.remove('kpi_selected');
  2791.             alldivi[i].classList.remove('disabled');
  2792.         }
  2793.         divi.classList.add('kpi_selected');
  2794.         divi.classList.add('disabled');
  2795.         explore_kpi = divi.getAttribute('data-kpi');
  2796.         explore_slug = divi.getAttribute('data-slug');
  2797.         
  2798.         rPlatform.setiSelected(indArr);
  2799.         rPlatform.setiActive();
  2800.         rPlatform.updateMap();
  2801.         // console.log(indArr);
  2802.         this.selectedIndicator(divi);
  2803.         this.updateTable(explore_slug);
  2804.         //this.selectedDiv();
  2805.     }
  2806.     function updateMapFromStat(a){
  2807.         let indArr = [{'kpi': parseInt(a)}];
  2808.         let slug = '';
  2809.         let name = '';
  2810.         if(a == 100){
  2811.             slug = 'statYearBox';
  2812.             name = 'Año de construcción';
  2813.         }else if(a == 101){
  2814.             slug = 'statAreaBox';
  2815.             name = 'Área';
  2816.         }else if(a == 104){
  2817.             slug = 'statOccupationBox';
  2818.             name = 'Porcentaje de ocupación';
  2819.         }else if(a == 105){
  2820.             slug = 'statUseBox';
  2821.             name = 'Uso del edificio';
  2822.         }
  2823.         let divi = document.getElementById(slug);
  2824.         
  2825.         var selectedBox = document.getElementById('selected_box_content');
  2826.         // selectedBox.innerHTML = divi.outerHTML;
  2827.         let html = '<h6>'+name+'</h6>';
  2828.         // selectedBox.insertAdjacentHTML(\"afterbegin\", html);
  2829.         rPlatform.setiSelected(indArr);
  2830.         rPlatform.setiActive();
  2831.         rPlatform.updateMap();
  2832.     }
  2833.     function updateTable(slug){
  2834.         let kpiArray = ['kpi_1_energy_renovated_residential_buildings', 'kpi_2_final_energy_consumption', 'kpi_3_renewable_energy_consumption', 'kpi_4_pv_potential_generation', 'kpi_7_heating_energy_consumption', 'kpi_8_ghg_emissions', 'kpi_19_population_income_below_60_average', 'kpi_20_median_household_income', 'kpi_21_average_price_renting_compared_family_income', 'kpi_22_house_price', 'kpi_27_urban_equipment_at_15_min', 'kpi_28_accessibility_to_bike_lane', 'kpi_30_green_area_surfaces', 'kpi_31_vulnerability_heatwaves_temperature_rise', 'kpi_36_charging_outlets', 'kpi_6_2_energy_efficient_and_energy_recovering_homes', 'kpi_6_1_energy_efficient_and_energy_recovering_homes', 'inspireid']
  2835.         // Seleccionar todas las columnas con slug
  2836.         for(let i=0; kpiArray.length > i;i++){
  2837.             let celda = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+kpiArray[i]+']');
  2838.             for(let j=0; celda.length > j;j++){
  2839.                 celda[j].classList.add('d-none');
  2840.             }
  2841.         }
  2842.         
  2843.         // Seleccionar las celdas de nuestro slug
  2844.         let celdaSlug = document.querySelectorAll('#wrapper .gridjs-table [data-column-id='+slug+']');
  2845.         for(let j=0; celdaSlug.length > j;j++){
  2846.             celdaSlug[j].classList.remove('d-none');
  2847.             celdaSlug[j].classList.add('selected');
  2848.         }
  2849.         
  2850.         // console.log('updateTable',slug);
  2851.     }
  2852.     function selectedIndicator(a){
  2853.         var dataDiv = '';
  2854.         var selectedBox = document.getElementById('selected_box_content');
  2855.         var linestat = a.getElementsByClassName('statsline');
  2856.         var titlestat = a.getElementsByClassName('title');
  2857.         
  2858.         var p = parseFloat(a.getAttribute('data-p')).toFixed(2);
  2859.         var m = parseFloat(a.getAttribute('data-m')).toFixed(2);
  2860.         var r = parseFloat(a.getAttribute('data-r')).toFixed(2);
  2861.         var max = parseFloat(a.getAttribute('data-max'));
  2862.         // Si hay datos completos pintamos los pins en el indicador seleccionado
  2863.         if (p !== null && m !== null && r !== null){
  2864.             var dato_p = detres(p,max);
  2865.             var dato_m = detres(m,max);
  2866.             var dato_r = detres(r,max);
  2867.             var pinDiv = '<span class=\"statsline_item_extra\" style=\"left: '+dato_p+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Provincia '+p+'\"></i><span class=\"pindata\">P</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_m+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Municipio '+m+'\"></i><span class=\"pindata\">M</span></span> <span class=\"statsline_item_extra\" style=\"left: '+dato_r+'%;\"><i class=\"fa-solid vert_bar\" data-bs-toggle=\"tooltip\" data-bs-placement=\"top\" data-bs-custom-class=\"custom-tooltip\" data-bs-title=\"Región '+r+'\"></i><span class=\"pindata\">R</span></span> ';
  2868.             var elemento = linestat[0];
  2869.             // elemento.insertAdjacentHTML('beforeend', pinDiv);
  2870.             dataDiv = titlestat[0].outerHTML + elemento.outerHTML;
  2871.             // selectedBox.innerHTML = dataDiv;   
  2872.         }else{
  2873.             dataDiv = titlestat[0].outerHTML + linestat[0].outerHTML;
  2874.             // selectedBox.innerHTML = dataDiv;
  2875.         }
  2876.         
  2877.         let titleAttribute = a.getAttribute('data-bs-title');
  2878.         let descAttribute = a.getAttribute('data-bs-content');
  2879.         // selectedBox.setAttribute(\"data-bs-title\", titleAttribute);
  2880.         // selectedBox.setAttribute(\"data-bs-content\", descAttribute);
  2881.         \$('[data-bs-toggle=\"popover_live_top\"]').mouseover(function(){
  2882.             \$('[data-bs-toggle=\"popover_live_top\"]').popover();
  2883.         });
  2884.         const popoverTriggerList = document.querySelectorAll('[data-bs-toggle=\"popover_live_top\"]')
  2885.         const popovertipList = [...popoverTriggerList].map(item => new bootstrap.Popover(item));
  2886.         const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle=\"tooltip\"]')
  2887.         const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl));
  2888.     }
  2889.     function detres(value,max){
  2890.         let dato = (value*100)/max;
  2891.         return dato.toFixed(2);
  2892.     }
  2893.     
  2894.     function updateMap(){
  2895.         var selectElement = document.querySelector('#kpi_selector');
  2896.         var kpi_id = selectElement.value;
  2897.         let indArr = [{'kpi': parseInt(kpi_id)}];
  2898.         rPlatform.setiSelected(indArr);
  2899.         rPlatform.setiActive();
  2900.         rPlatform.updateMap();
  2901.         var iActive = rPlatform.getiActive();
  2902.         updateSelector(iActive)
  2903.     }
  2904.     // --------------------- Simple Fn OK ------------------------------- //
  2905.     function updateSelector(kpi){
  2906.         var selector = document.getElementById('kpi_selector');
  2907.         selector.value = kpi;
  2908.     }
  2909.     function loadUrlBack(){
  2910.         let url = explore_baseUrl + \"/\" + explore_mun ;
  2911.         window.location.href = url;
  2912.     }
  2913.     
  2914.     function gotoproject(){
  2915.         let url = '';
  2916.         url = explore_baseUrl + \"/\" + explore_mun + \"/plan\";
  2917.         window.location.href = url;
  2918.     }
  2919.     function capitalizeFirstLetter(string) {
  2920.         return string.charAt(0).toUpperCase() + string.slice(1);
  2921.     }
  2922.     function viewFinder(a){
  2923.         \$('.viewfindergroup').hide();
  2924.         \$('#'+ a +'_view').show();
  2925.         
  2926.         if(a == 'map' || a == 'data')
  2927.         {
  2928.             \$(\"#infoview2\").show();
  2929.         }else{
  2930.             \$(\"#infoview2\").hide();
  2931.         }
  2932.         if(a == 'data'){
  2933.             tableData();
  2934.         }
  2935.         console.log(a);
  2936.         [...document.querySelectorAll('.left_bar_button')].map(x => x.classList.remove('active'));       
  2937.         document.getElementById('left_bar_button_'+a).classList.add('active');
  2938.     }
  2939.     
  2940.     function centerViewMap(){
  2941.         var zoom = rPlatform.getZoom();
  2942.         rPlatform.setCenterView(initGeo);
  2943.     }
  2944.     function expandIcon(e){
  2945.         var elemento = document.getElementById(e);
  2946.         var textoExtraido = elemento.innerText;
  2947.         if (textoExtraido == 'expand_more'){
  2948.             elemento.innerText = 'expand_less';
  2949.         }else{
  2950.             elemento.innerText = 'expand_more';
  2951.         }
  2952.     }
  2953.     function infoviewToggle(){
  2954.         if(\$('#infoview2').hasClass('show')){
  2955.             \$('#infoview2').collapse('hide');
  2956.             \$('#infoview').addClass('w-100');
  2957.             \$('#expand .material-symbols-outlined').text('collapse_content');
  2958.         }else{
  2959.             \$('#infoview2').collapse('show');
  2960.             \$('#infoview').removeClass('w-100');
  2961.             \$('#expand .material-symbols-outlined').text('expand_content');
  2962.         }
  2963.     }
  2964.     function activeClass(elem){
  2965.         var elemento = \$(elem);
  2966.         elemento.toggleClass('active');
  2967.     }
  2968.     
  2969. </script>
  2970. <script>
  2971.     \$(document).ready(function(){
  2972.         document.getElementById('big_container').classList.add('full');
  2973.         
  2974.         var headerInTop = document.getElementById('header_in_top').offsetHeight;
  2975.         var containerInContent = document.getElementById('container_in_content').offsetHeight;
  2976.         var headerContentInfoTop = document.getElementById('header_content_info_top').offsetHeight;
  2977.         var bigContainer = document.getElementById('big_container').offsetHeight;
  2978.         var containerInContentTotal = bigContainer - headerInTop;
  2979.         var containerSteps = bigContainer - headerInTop - headerContentInfoTop;
  2980.         
  2981.         document.getElementById('container_in_content').style.height = containerInContentTotal + 'px';
  2982.         document.getElementById('infoview_content').style.height = containerInContentTotal + 'px';
  2983.         document.getElementById('analytic_step').style.height = containerInContentTotal + 'px';
  2984.         
  2985.         var divs = document.querySelectorAll('.infoview_div');
  2986.         for(let i=0; divs.length > i; i++){
  2987.             divs[i].style.height = containerSteps + 'px';
  2988.         }
  2989.         var divs2 = document.querySelectorAll('.infoview2_div');
  2990.         for(let i=0; divs2.length > i; i++){
  2991.             divs2[i].style.height = containerSteps + 'px';
  2992.         }
  2993.         var divsIn = document.querySelectorAll('.viewfindergroup');
  2994.         for(let i=0; divsIn.length > i; i++){
  2995.             divsIn[i].style.height = containerSteps + 'px';
  2996.         }
  2997.         let flashDiv = document.querySelector('.flash-notice');
  2998.         if(flashDiv){
  2999.             setTimeout(()=>{
  3000.                 flashDiv.remove();
  3001.             },10000);
  3002.         }
  3003.     });
  3004.     function removeDiv(id){
  3005.         let divi = document.getElementById(id);
  3006.         divi.remove();
  3007.     }
  3008. </script>
  3009. {% endblock %}
  3010. ""analytic/explore.html.twig""/mnt/www/retabit_platform/templates/analytic/explore.html.twig");
  3011.     }
  3012. }