<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\SandboxExtension;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Source;
use Twig\Template;

/* themes/mahipro/templates/layout/page.html.twig */
class __TwigTemplate_6a081b96ef9b5bf857319078462bc9a5 extends Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
        $this->sandbox = $this->env->getExtension('\Twig\Extension\SandboxExtension');
        $this->checkSecurity();
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 34
        echo "


";
        // line 37
        $this->loadTemplate("@mahipro/parts/header.html.twig", "themes/mahipro/templates/layout/page.html.twig", 37)->display($context);
        // line 39
        echo "
";
        // line 40
        $context["urlpage"] = $this->extensions['Drupal\Core\Template\TwigExtension']->getPath("<current>");
        // line 41
        echo "<div id=\"main-wrapper\" class=\"main-wrapper\">
    <!--<div class=\"container\">-->
        <!--<div class=\"main-container\">-->
        
        
              <main id=\"main\" class=\"page-content\">
                    <div class=\"container\">
                        ";
        // line 48
        $this->loadTemplate("@mahipro/parts/content_top.html.twig", "themes/mahipro/templates/layout/page.html.twig", 48)->display($context);
        // line 49
        echo "                    </div>
                <a id=\"main-content\" tabindex=\"-1\"></a>";
        // line 51
        echo "                ";
        if ((($context["is_front"] ?? null) && twig_get_attribute($this->env, $this->source, ($context["page"] ?? null), "content_home", [], "any", false, false, true, 51))) {
            // line 52
            echo "                  ";
            // line 53
            echo "                ";
        }
        // line 54
        echo "                
                ";
        // line 56
        echo "                ";
        if (($context["is_front"] ?? null)) {
            // line 57
            echo "                  ";
            // line 58
            echo "                  
                  ";
            // line 60
            echo "                  
                  ";
            // line 62
            echo "                  ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_gallery.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 62)->display($context);
            // line 63
            echo "                  
                  ";
            // line 64
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_Seguros_de_Salud_con_Obamacare.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 64)->display($context);
            // line 65
            echo "                  
                  ";
            // line 66
            if ((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 66) == "en")) {
                // line 67
                echo "                    ";
                $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_preguntas_frecuentes_EN.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 67)->display($context);
                // line 68
                echo "                  ";
            } else {
                // line 69
                echo "                    ";
                $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_preguntas_frecuentes.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 69)->display($context);
                // line 70
                echo "                  ";
            }
            // line 71
            echo "                  
                  ";
            // line 72
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_necesitas_un_seguro.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 72)->display($context);
            // line 73
            echo "                  
                  ";
            // line 74
            if ((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 74) == "en")) {
                // line 75
                echo "                    ";
                $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_elige_el_mejor_producto_para_ti_EN.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 75)->display($context);
                // line 76
                echo "                  ";
            } else {
                // line 77
                echo "                    ";
                $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_elige_el_mejor_producto_para_ti.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 77)->display($context);
                // line 78
                echo "                  ";
            }
            // line 79
            echo "                  ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_circle.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 79)->display($context);
            // line 80
            echo "                  ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_dejame_un_mensaje.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 80)->display($context);
            // line 81
            echo "                  
                ";
        } else {
            // line 83
            echo "                  
                ";
        }
        // line 85
        echo "                
                ";
        // line 86
        if ((twig_get_attribute($this->env, $this->source, ($context["node"] ?? null), "id", [], "any", false, false, true, 86) == 2)) {
            echo " ";
            // line 87
            echo "                    ";
            // line 88
            echo "                ";
        }
        // line 89
        echo "
                ";
        // line 90
        if (((($context["urlpage"] ?? null) == "/contacto") || (($context["urlpage"] ?? null) == "/en/contact"))) {
            echo " 
                    ";
            // line 91
            echo " ";
            // line 92
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/page_contact.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 92)->display($context);
            // line 93
            echo "                ";
        }
        // line 94
        echo "                
                ";
        // line 95
        if (((($context["urlpage"] ?? null) == "/productos/seguro-dental") || (($context["urlpage"] ?? null) == "/en/products/dental-insurance"))) {
            echo " 
                    ";
            // line 96
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/productos/seguro-dental.twig"), "themes/mahipro/templates/layout/page.html.twig", 96)->display($context);
            // line 97
            echo "                ";
        }
        // line 98
        echo "                
                ";
        // line 99
        if (((($context["urlpage"] ?? null) == "/productos/seguro-de-discapacidad") || (($context["urlpage"] ?? null) == "/en/products/disability-insurance"))) {
            // line 100
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/productos/seguro-de-discapacidad.twig"), "themes/mahipro/templates/layout/page.html.twig", 100)->display($context);
            // line 101
            echo "                ";
        }
        // line 102
        echo "                
                ";
        // line 103
        if (((($context["urlpage"] ?? null) == "/productos/seguro-de-accidente") || (($context["urlpage"] ?? null) == "/en/products/accident-insurance"))) {
            // line 104
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/productos/seguro-de-accidente.twig"), "themes/mahipro/templates/layout/page.html.twig", 104)->display($context);
            // line 105
            echo "                ";
        }
        // line 106
        echo "                
                ";
        // line 107
        if (((($context["urlpage"] ?? null) == "/productos/seguro-de-salud") || (($context["urlpage"] ?? null) == "/en/products/health-insurance"))) {
            // line 108
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/productos/seguro-de-salud.twig"), "themes/mahipro/templates/layout/page.html.twig", 108)->display($context);
            // line 109
            echo "                ";
        }
        // line 110
        echo "                
                ";
        // line 111
        if (((($context["urlpage"] ?? null) == "/productos/seguro-de-vida") || (($context["urlpage"] ?? null) == "/en/products/life-insurance"))) {
            // line 112
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/productos/seguro-de-vida.twig"), "themes/mahipro/templates/layout/page.html.twig", 112)->display($context);
            // line 113
            echo "                ";
        }
        // line 114
        echo "                
                ";
        // line 115
        if (((($context["urlpage"] ?? null) == "/terminos-de-uso") || (($context["urlpage"] ?? null) == "/en/terms-of-use"))) {
            // line 116
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/footer/terminos-de-uso.twig"), "themes/mahipro/templates/layout/page.html.twig", 116)->display($context);
            // line 117
            echo "                ";
        }
        // line 118
        echo "                
                ";
        // line 119
        if (((($context["urlpage"] ?? null) == "/politica-de-privacidad") || (($context["urlpage"] ?? null) == "/en/privacy-policy"))) {
            // line 120
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/footer/politica-de-privacidad.twig"), "themes/mahipro/templates/layout/page.html.twig", 120)->display($context);
            // line 121
            echo "                ";
        }
        // line 122
        echo "                
                ";
        // line 123
        if (((($context["urlpage"] ?? null) == "/asistencia-de-idiomas-aviso-de-no-discriminacion") || (($context["urlpage"] ?? null) == "/en/language-assistance-non-discrimination-notice"))) {
            // line 124
            echo "                    ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/footer/asistencia-de-idiomas.twig"), "themes/mahipro/templates/layout/page.html.twig", 124)->display($context);
            // line 125
            echo "                ";
        }
        // line 126
        echo "                
                ";
        // line 128
        echo "                
                ";
        // line 130
        echo "                <DIV STYLE=\"DISPLAY:NONE\">";
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, ($context["page"] ?? null), "content", [], "any", false, false, true, 130), 130, $this->source), "html", null, true);
        echo "</DIV>
                ";
        // line 131
        if (($context["is_front"] ?? null)) {
            // line 132
            echo "                    ";
            // line 133
            echo "                ";
        } else {
            // line 134
            echo "                    ";
            if (((($context["urlpage"] ?? null) == "/sobre-mi") || (($context["urlpage"] ?? null) == "/en/about-me"))) {
                // line 135
                echo "                        ";
                $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_dinamic.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 135)->display($context);
                // line 136
                echo "                    ";
            } else {
                // line 137
                echo "                        <div class=\"container\">
                            ";
                // line 138
                echo $this->extensions['Drupal\Core\Template\TwigExtension']->escapeFilter($this->env, $this->sandbox->ensureToStringAllowed(twig_get_attribute($this->env, $this->source, ($context["page"] ?? null), "content", [], "any", false, false, true, 138), 138, $this->source), "html", null, true);
                echo "
                        </div>
                    ";
            }
            // line 141
            echo "                    
                ";
        }
        // line 143
        echo "                ";
        $this->loadTemplate("@mahipro/parts/content_bottom.html.twig", "themes/mahipro/templates/layout/page.html.twig", 143)->display($context);
        // line 144
        echo "              </main>
              ";
        // line 145
        $this->loadTemplate("@mahipro/parts/sidebar-left.html.twig", "themes/mahipro/templates/layout/page.html.twig", 145)->display($context);
        // line 146
        echo "              ";
        $this->loadTemplate("@mahipro/parts/sidebar-right.html.twig", "themes/mahipro/templates/layout/page.html.twig", 146)->display($context);
        // line 147
        echo "      
        <!--</div>--> ";
        // line 149
        echo "    <!--</div>--> ";
        // line 150
        echo "  
</div>";
        // line 152
        if (($context["sliding_sidebar"] ?? null)) {
            // line 153
            echo "  ";
            $this->loadTemplate("@mahipro/parts/sidebar-sliding.html.twig", "themes/mahipro/templates/layout/page.html.twig", 153)->display($context);
        }
        // line 155
        echo "
";
        // line 156
        if (($context["is_front"] ?? null)) {
            // line 157
            echo "
";
        } else {
            // line 159
            echo "        ";
            $this->loadTemplate((($context["directory"] ?? null) . "/templates/parts/home_necesitas_un_seguro.html.twig"), "themes/mahipro/templates/layout/page.html.twig", 159)->display($context);
        }
        // line 161
        $this->loadTemplate("@mahipro/parts/home_atencion.html.twig", "themes/mahipro/templates/layout/page.html.twig", 161)->display($context);
        // line 162
        echo "<!-- Code -->
";
        // line 163
        $context["c"] = 0;
        // line 164
        $context["site_phoneOne"] = "";
        // line 165
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(twig_split_filter($this->env, ($context["site_phone"] ?? null), " - "));
        foreach ($context['_seq'] as $context["_key"] => $context["imgItem"]) {
            // line 166
            echo "    ";
            $context["c"] = (($context["c"] ?? null) + 1);
            // line 167
            echo "     
    ";
            // line 168
            if ((($context["c"] ?? null) == 1)) {
                // line 169
                echo "            ";
                $context["site_phoneOne"] = $context["imgItem"];
                // line 170
                echo "    ";
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['imgItem'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 172
        echo "





";
        // line 178
        if ((($context["urlDoimanHost"] ?? null) == "enteratecondanielvelasquez.com")) {
            // line 179
            echo "    <script id=\"et-iframe\" data-version=\"0.5\" data-widgetId=\"5f7dcd41c0265908844fbca8\" src=\"https://client.consolto.com/iframeApp/iframeApp.js\"  ></script>
 ";
        } else {
            // line 181
            echo "    <div>
        <a href=\"https://api.whatsapp.com/send?phone=1";
            // line 182
            echo $this->extensions['Drupal\Core\Template\TwigExtension']->escapeFilter($this->env, twig_replace_filter(twig_replace_filter(twig_replace_filter(twig_replace_filter($this->sandbox->ensureToStringAllowed(($context["site_phoneOne"] ?? null), 182, $this->source), ["-" => ""]), [" " => ""]), ["(" => ""]), [")" => ""]), "html", null, true);
            echo "\" class=\"myFloat myBounce\" target=\"_blank\">
            <i class=\"fa fa-whatsapp my-float\"></i>
        </a>
    </div>
 ";
        }
        // line 187
        echo "                                     
                                     
<!-- Whatsapp Button End -->
";
        // line 190
        $this->loadTemplate("@mahipro/parts/footer.html.twig", "themes/mahipro/templates/layout/page.html.twig", 190)->display($context);
        // line 191
        echo "<!-- Userway -->


<script data-account=\"UQmPmX5ero\" src=\"https://cdn.userway.org/widget.js\"></script>







<!-- start by rsc -->
<script src=\"/assets/assets/js/jquery-3.4.1.min.js\"></script>
<script src=\"/assets/assets/vendors/bootstrap/js/popper.min.js\"></script>
<script src=\"/assets/assets/vendors/bootstrap/js/bootstrap.min.js\"></script>
<script src=\"/assets/assets/vendors/slick/slick.min.js\"></script>
<script src=\"/assets/assets/js/parallaxie.js\"></script>
<script src=\"/assets/assets/vendors/circle-progressbar/jquery.waypoints.min.js\"></script>
<script src=\"/assets/assets/vendors/circle-progressbar/jquery.counterup.min.js\"></script>
<script src=\"/assets/assets/vendors/circle-progressbar/circle-progress.js\"></script>
<script src=\"/assets/assets/vendors/slick/slick.min.js\"></script>

<script src=\"/assets/assets/vendors/wow/wow.min.js\"></script>

<script src=\"/assets/assets/vendors/magnify-popup/jquery.magnific-popup.min.js\"></script>
<!-- contact js -->
<script src=\"/assets/assets/js/jquery.form.js\"></script>
<script src=\"/assets/assets/js/jquery.validate.min.js\"></script>
<script src=\"/assets/assets/js/main.js\"></script>

<script src=\"/assets/js/jquery.countdown.min.js\"></script>
<script src=\"/assets/js/jquery.meanmenu.min.js\"></script>
<script src=\"/assets/js/jquery.nivo.slider.js\"></script>
<script src=\"/assets/js/jquery.nivo.slider2.js\"></script>

<script src=\"/assets/js/bootstrap.min.js\"></script>
<script src=\"/assets/js/plugins.js\"></script>
<!--
<script src=\"https://enterateconyasminpena.com/assets/js/main.js\"></script> 
-->
<script src=\"/assets/bootstrap/bootstrap.bundle.min.js\"></script>
<script src=\"/assets/bootstrap/offcanvas-navbar.js\"></script>

 <link rel=\"stylesheet\" href=\"https://code.jquery.com/ui/1.14.1/themes/base/jquery-ui.css\">
 <!--<link rel=\"stylesheet\" href=\"/resources/demos/style.css\">-->
<link rel=\"stylesheet\" href=\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.14.1/themes/smoothness/jquery-ui.css\">
<script src=\"https://ajax.googleapis.com/ajax/libs/jqueryui/1.14.1/jquery-ui.min.js\"></script>
<script>
var js = jQuery.noConflict();
js(document).ready(  
    function(){
        /*function reloadCaptcha(url=\"\"){
            js('#siimage').prop('src', url+'securimage_show.php?sid=' + Math.random());
        }*/
        
        js('#ajaxgif').addClass('hide');
        js('#ajaxgifTxt').addClass('hide');
         
        js(\"#submitcontact\").click(
            function() {
                 
\t\t\t\turlDo = js('#do').val();
\t\t\t\t//urlCaptcha = js('#txturlcaptcha').val();
                js('#ajaxgif').removeClass('hide');
                js('#ajaxgifTxt').removeClass('hide');
                 
                js.ajax({
                        url: urlDo,
                        type: 'POST',
                        data: js('#frmGeneric').serialize(),
                        dataType: 'json'
                }).done(function(data) {
                        
                        if (data.error === 0) {
                             
                            js('#frmGeneric').hide();
                            js(\"#errormessages\").hide();
                            js('#webform-ajax-response-success').show();
                            js('#frmGeneric')[0].reset();
                            //reloadCaptcha(urlCaptcha);
                            //setTimeout(\"js('#webform-ajax-response-success').fadeOut();\", 12000);
                        } else {
\t\t\t\t\t\t\t\t//alert(\"There was an error with your submission.\\n\\n\" + data.message);
\t\t\t\t\t\t\t\tjs('#ajaxgif').addClass('hide');
\t\t\t\t\t\t\t\tjs('#ajaxgifTxt').addClass('hide');
\t\t\t\t\t\t\t\tjs(\"#errormessages\").show();
\t\t\t\t\t\t\t\tjs(\"#myerrorlist\").html(data.message);
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t//captcha = js(\"#ct_captcha\");
\t\t\t\t\t\t\t\t/*\t\t################\tPAGE 01::CONTACT US\t################\t*/
\t\t\t\t\t\t\t\tvalidaForm(js('#txtfname'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js('#txtphone'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js(\"#txtemail\"), 1);
\t\t\t\t\t\t\t\t//validaForm(js('#txtcheckautoriza'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#txtsubject'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#message'), 0);
\t\t\t\t\t\t\t\t//validaForm(js(\"#ct_captcha\"), 0);
                        }
                });
                return false;
            }
        );
        /* ############################## START FORM CITA (FORM 2)############################*/
        /* ###################################################################################*/
        js('#ajaxgif2').addClass('hide');
        js('#ajaxgifTxt2').addClass('hide');
         
        js(\"#submitcontact2\").click(
            function() {
                 
\t\t\t\turlDo = js('#do2').val();
\t\t\t\t//urlCaptcha = js('#txturlcaptcha').val();
                js('#ajaxgif2').removeClass('hide');
                js('#ajaxgifTxt2').removeClass('hide');
                 
                js.ajax({
                        url: urlDo,
                        type: 'POST',
                        data: js('#frmGeneric2').serialize(),
                        dataType: 'json'
                }).done(function(data) {
                        
                        if (data.error === 0) {
                             
                            js('#frmGeneric2').hide();
                            js(\"#errormessages2\").hide();
                            js('#webform-ajax-response-success2').show();
                            js('#frmGeneric2')[0].reset();
                            //reloadCaptcha(urlCaptcha);
                            //setTimeout(\"js('#webform-ajax-response-success').fadeOut();\", 12000);
                        } else {
\t\t\t\t\t\t\t\t//alert(\"There was an error with your submission.\\n\\n\" + data.message);
\t\t\t\t\t\t\t\tjs('#ajaxgif2').addClass('hide');
\t\t\t\t\t\t\t\tjs('#ajaxgifTxt2').addClass('hide');
\t\t\t\t\t\t\t\tjs(\"#errormessages2\").show();
\t\t\t\t\t\t\t\tjs(\"#myerrorlist2\").html(data.message);
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t//captcha = js(\"#ct_captcha\");
\t\t\t\t\t\t\t\t/*\t\t################\tPAGE 01::CONTACT US\t################\t*/
\t\t\t\t\t\t\t\tvalidaForm(js('#txtfname2'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js('#txtphone2'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js(\"#txtemail2\"), 1);
\t\t\t\t\t\t\t\tvalidaForm(js('#txmeet2'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js('#datepicker2'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js('#txthour2'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#txtcheckautoriza2'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#txtsubject'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#message'), 0);
\t\t\t\t\t\t\t\t//validaForm(js(\"#ct_captcha\"), 0);
                        }
                });
                return false;
            }
        );
        
        /* ############################## END FORM CITA (FORM 2)############################*/
        /* ###################################################################################*/
        
        
        /* ############################## START FORM LLAMADA (FORM 3)############################*/
        /* ###################################################################################*/
        js('#ajaxgif3').addClass('hide');
        js('#ajaxgifTxt3').addClass('hide');
         
        js(\"#submitcontact3\").click(
            function() {
                 
\t\t\t\turlDo = js('#do3').val();
\t\t\t\t//urlCaptcha = js('#txturlcaptcha').val();
                js('#ajaxgif3').removeClass('hide');
                js('#ajaxgifTxt3').removeClass('hide');
                 
                js.ajax({
                        url: urlDo,
                        type: 'POST',
                        data: js('#frmGeneric3').serialize(),
                        dataType: 'json'
                }).done(function(data) {
                        
                        if (data.error === 0) {
                             
                            js('#frmGeneric3').hide();
                            js(\"#errormessages3\").hide();
                            js('#webform-ajax-response-success3').show();
                            js('#frmGeneric3')[0].reset();
                            //reloadCaptcha(urlCaptcha);
                            //setTimeout(\"js('#webform-ajax-response-success').fadeOut();\", 12000);
                        } else {
\t\t\t\t\t\t\t\t//alert(\"There was an error with your submission.\\n\\n\" + data.message);
\t\t\t\t\t\t\t\tjs('#ajaxgif3').addClass('hide');
\t\t\t\t\t\t\t\tjs('#ajaxgifTxt3').addClass('hide');
\t\t\t\t\t\t\t\tjs(\"#errormessages3\").show();
\t\t\t\t\t\t\t\tjs(\"#myerrorlist3\").html(data.message);
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t//captcha = js(\"#ct_captcha\");
\t\t\t\t\t\t\t\t/*\t\t################\tPAGE 01::CONTACT US\t################\t*/
\t\t\t\t\t\t\t\tvalidaForm(js('#txtfname3'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js('#txtphone3'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js(\"#txtemail3\"), 1);
\t\t\t\t\t\t\t\tvalidaForm(js('#datepicker3'), 0);
\t\t\t\t\t\t\t\tvalidaForm(js('#txthour3'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#txtcheckautoriza3'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#txtsubject'), 0);
\t\t\t\t\t\t\t\t//validaForm(js('#message'), 0);
\t\t\t\t\t\t\t\t//validaForm(js(\"#ct_captcha\"), 0);
                        }
                });
                return false;
            }
        );
        
        /* ############################## END FORM LLAMADA (FORM 3)############################*/
        /* ###################################################################################*/
        
    }/*    function()  */
);/*   js(document).ready   */    

function validaForm(field, isemail=0){
\tif (field.val() == ''){
\t\tfield.addClass(\"input_text_error\");
\t} else {
\t\tif (isemail == 0){
\t\t\tfield.removeClass(\"input_text_error\");
\t\t} else if (isemail == 1) {
\t\t\t//validacion_email = /^[a-zA-Z0-9_\\.\\-]+@[a-zA-Z0-9\\-]+\\.[a-zA-Z0-9\\-\\.]+js/;
\t\t\tvar pattern = new RegExp(/^((\"[\\w-\\s]+\")|([\\w-]+(?:\\.[\\w-]+)*)|(\"[\\w-\\s]+\")([\\w-]+(?:\\.[\\w-]+)*))(@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)\$)|(@\\[?((25[0-5]\\.|2[0-4][0-9]\\.|1[0-9]{2}\\.|[0-9]{1,2}\\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\\]?\$)/i);
\t\t\tif (!pattern.test(field.val())){
\t\t\t\tfield.addClass(\"input_text_error\");
\t\t\t} else {
\t\t\t\tfield.removeClass(\"input_text_error\");
\t\t\t}
\t\t}
\t\t
\t}
}
</script>

<!-- end by rsc -->
<script src=\"https://cdnjs.cloudflare.com/ajax/libs/jquery.inputmask/3.2.6/jquery.inputmask.bundle.min.js\"></script>
<script>
       console.log('Testing')
    jQuery(document).ready(function () {
        console.log('Ready')
        
        jQuery(\".currencyMask\").inputmask('Regex', {regex: \"^[0-9]{1,6}(\\\\.\\\\d{1,2})?\$\", rightAlign: true});

        let arr_merried = [];
        let arr_dependent_handler = [];
        let arr_dependent = [];
        
        const myLang = jQuery('#myLang').val();
        
        let cmp = jQuery('#accordion')

        jQuery('#merried_handler').click(function (e) { 
            e.preventDefault();
            console.log('merried_handler')
            if (arr_merried.length === 0) {
                cmp.append(`

                <div id=\"accordion_merried\" class=\"panel _banner_main_box_person\">
                    <div class=\"panel-heading\" role=\"tab\" id=\"headingTwo\">
                    <h6 class=\"panel-title\" style=\"text-align: center;\">
                        <a class=\"_banner_main_box_person--title\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseTwo\" aria-expanded=\"false\" aria-controls=\"collapseTwo\">
                        ";
        // line 455
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 455) == "en")) ? ("Spouse") : ("Esposo(a)")));
        echo "
                        </a>
                        <button id=\"row_merried\" class=\"_banner_main_close_button\">X</button>
                    </h6>
                    </div>
                    <div id=\"collapseTwo\" class=\"panel-collapse collapse show\" role=\"tabpanel\" aria-labelledby=\"headingTwo\">
                    <div class=\"panel-body\" style=\"padding: 0 10px\">

                        <div class=\"row\">

                            <div class=\"col-md-12\">
                                <p style=\"color: #fff;\">
                                    <span style=\"color: red;\">*</span>  
                                    ";
        // line 468
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 468) == "en")) ? ("Age") : ("Edad")));
        echo "
                                </p>
                            </div>

                            <div class=\"col-md-6\">
                                <div class=\"form-group\">
                                    <input class=\"form-control\" placeholder=\"\" id=\"input_age_merried\" type=\"text\">
                                </div>
                            </div>

                            <div class=\"col-md-6\">
                                <div class=\"form-group\">
                                    <div class=\"form-check\">
                                        <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"input_is_applying_merried\">
                                        <label style=\"color: #fff;\" class=\"form-check-label\" for=\"flexCheckDefault\">
                                            ";
        // line 483
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 483) == "en")) ? ("Needs Insurance") : ("Necesita Cobertura")));
        echo "
                                        </label>
                                    </div>
                                    <div class=\"form-check\">
                                        <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"is_uses_tobacco_merried\">
                                        <label style=\"color: #fff;\" class=\"form-check-label\" for=\"flexCheckDefault\">
                                            ";
        // line 489
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 489) == "en")) ? ("Tobacco user") : ("Fumador")));
        echo "
                                        </label>
                                    </div>
                                </div>
                            </div>

                        </div>

                        
                        

                    </div>
                    </div>
                </div>
                `)
                arr_merried.push(true)
            }
        });

        jQuery('body').on('click', '#row_merried', function () {
            if (arr_merried.length > 0) {
                jQuery('#accordion_merried').remove();
                arr_merried = []
            }
        });

        jQuery('#dependent_handler').click(function (e) { 
            e.preventDefault();
            console.log('dependent_handler')
            const countArr = arr_dependent.length
            console.log('countArr', countArr)
            if (countArr >= 0 && countArr <= 7) {
                const myCurrentValue = countArr + 1
                arr_dependent.push({
                    id: myCurrentValue,
                    age_input: {
                        name: `input_age_dependent_\${myCurrentValue}`,
                        value: '',
                    },
                    is_applying_input: {
                        name: `input_applying_dependent_\${myCurrentValue}`,
                        value: false,
                    },
                    uses_tobacco_input: {
                        name: `input_tobacco_dependent_\${myCurrentValue}`,
                        value: false,
                    },
                })
                
                 jQuery(\".collapse\").removeClass(\"show\");
                
                

                cmp.append(`
                <div id=\"accordion_dependent_\${myCurrentValue}\" class=\"panel _banner_main_box_person\">
                    <div class=\"panel-heading\" role=\"tab\" id=\"headingTwo\">
                    <h6 class=\"panel-title\" style=\"text-align: center;\">
                        <a class=\"_banner_main_box_person--title\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseDependent\${myCurrentValue}\" aria-expanded=\"false\" aria-controls=\"collapseDependent\${myCurrentValue}\">
                        ";
        // line 547
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 547) == "en")) ? ("Dependent") : ("Dependiente")));
        echo "
                        \${myCurrentValue}
                        </a>
                        <button data-id=\"\${myCurrentValue}\" id=\"row_dependent_\${myCurrentValue}\" class=\"_banner_main_close_button row_dependent\">X</button>
                    </h6>
                    </div>
                    <div id=\"collapseDependent\${myCurrentValue}\" class=\"panel-collapse collapse show\" role=\"tabpanel\" aria-labelledby=\"headingTwo\">
                    <div class=\"panel-body\" style=\"padding: 0 10px\">

                        <div class=\"row\">
                            
                            <div class=\"col-md-12\">
                                <p style=\"color: #fff;\">
                                <span style=\"color: red;\">*</span> 
                                ";
        // line 561
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 561) == "en")) ? ("Age") : ("Edad")));
        echo "
                                </p>
                            </div>

                            <div class=\"col-md-6\">
                                <div class=\"form-group\">
                                    <input class=\"form-control\" placeholder=\"\" id=\"input_age_dependent_\${myCurrentValue}\" type=\"text\">
                                </div>
                            </div>

                            <div class=\"col-md-6\">
                                <div class=\"form-group\">
                                    <div class=\"form-check\">
                                        <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"input_applying_dependent_\${myCurrentValue}\">
                                        <label style=\"color: #fff;\" class=\"form-check-label\" for=\"flexCheckDefault\">
                                            ";
        // line 576
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 576) == "en")) ? ("Needs Insurance") : ("Necesita Cobertura")));
        echo "
                                        </label>
                                    </div>
                                    <div class=\"form-check\">
                                        <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"input_tobacco_dependent_\${myCurrentValue}\">
                                        <label style=\"color: #fff;\" class=\"form-check-label\" for=\"flexCheckDefault\">
                                            ";
        // line 582
        echo $this->extensions['Drupal\Core\Template\TwigExtension']->renderVar((((twig_get_attribute($this->env, $this->source, ($context["language"] ?? null), "getId", [], "method", false, false, true, 582) == "en")) ? ("Tobacco user") : ("Fumador")));
        echo "
                                        </label>
                                    </div>
                                </div>
                            </div>

                        </div>

                    </div>
                    </div>
                </div>
                `)

                console.log('arr_dependent', arr_dependent)

            }
        });

        // *** Remove Dependent ***
        jQuery('body').on('click', '.row_dependent', function () {
            const id = jQuery(this).attr('data-id');
            arr_dependent.map(el => {
                el.age_input.value = jQuery(`#input_age_dependent_\${el.id}`).val();

                el.is_applying_input.value = false
                if (jQuery(`#input_applying_dependent_\${el.id}`).is(':checked')) {
                    el.is_applying_input.value = true
                }
                el.uses_tobacco_input.value = false
                if (jQuery(`#input_tobacco_dependent_\${el.id}`).is(':checked')) {
                    el.uses_tobacco_input.value = true
                }

                jQuery(`#accordion_dependent_\${el.id}`).remove();
            })

            arr_dependent.map(el => {  
                jQuery(`#accordion_dependent_\${el.id}`).remove();
            })

            console.log('arr_dependent info', arr_dependent)
            
            let copy_arr_dependent = arr_dependent;
            let result_arr_dependent = copy_arr_dependent.filter( el => {
                return el.id != id;
            });
            let countArray = 1
            arr_dependent = result_arr_dependent.map(el => {
                el.id = countArray
                countArray++
                return el
            })
            console.log('arr_dependent 2', arr_dependent)
            arr_dependent.map(el => {
                cmp.append(`
                <div id=\"accordion_dependent_\${el.id}\" class=\"panel _banner_main_box_person\">
                    <div class=\"panel-heading\" role=\"tab\" id=\"headingTwo\">
                    <h6 class=\"panel-title\" style=\"text-align: center;\">
                        <a class=\"_banner_main_box_person--title\" role=\"button\" data-toggle=\"collapse\" data-parent=\"#accordion\" href=\"#collapseDependent\${el.id}\" aria-expanded=\"false\" aria-controls=\"collapseDependent\${el.id}\">
                        \${myLang == 'es' ? 'Dependiente' : 'Dependent'} \${el.id}
                        </a>
                        <button data-id=\"\${el.id}\" id=\"row_dependent_\${el.id}\" class=\"_banner_main_close_button row_dependent\">X</button>
                    </h6>
                    </div>
                    <div id=\"collapseDependent\${el.id}\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"headingTwo\">
                    <div class=\"panel-body\" style=\"padding: 0 10px\">

                        <div class=\"row\">

                            <div class=\"col-md-12\">
                                <p style=\"color: #fff;\">
                                <span style=\"color: red;\">*</span> \${myLang == 'es' ? 'Edad' : 'Age'}
                                </p>
                            </div>

                            <div class=\"col-md-6\">
                            <div class=\"form-group\">
            
                                <input value=\"\${el.age_input.value}\" class=\"form-control\" placeholder=\"\" id=\"input_age_dependent_\${el.id}\" type=\"text\">
                            </div>
                            </div>

                            <div class=\"col-md-6\">
                            <div class=\"form-group\">
                                <div class=\"form-check\">
                                    <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"input_applying_dependent_\${el.id}\" \${el.is_applying_input.value && 'checked'}>
                                    <label style=\"color: #fff;\" class=\"form-check-label\" for=\"flexCheckDefault\">
                                        \${myLang == 'es' ? 'Necesita Cobertura' : 'Needs Insurance'}
                                    </label>
                                </div>
                                <div class=\"form-check\">
                                    <input class=\"form-check-input\" type=\"checkbox\" value=\"\" id=\"input_tobacco_dependent_\${el.id}\" \${el.uses_tobacco_input.value && 'checked'}>
                                    <label style=\"color: #fff;\" class=\"form-check-label\" for=\"flexCheckDefault\">
                                        \${myLang == 'es' ? 'Fumador' : 'Tobacco user'}
                                    </label>
                                </div>
                            </div>
                            </div>

                        </div>

                    </div>
                    </div>
                </div>
                `)
            })
        });
        // start year
        let coverage_year = '2024'
        
        jQuery('#input_year').change(function() {
            coverage_year = \$(this).val();
        });
        // end year
        jQuery('#plan_handler').click(async function (e) { 
            e.preventDefault();
            console.log('planHandler')

            // *** Get Data Form ***
            let age = jQuery('#input_age').val();
            let is_applying = false;
            let uses_tobacco = false;
            let income = jQuery('#input_income').val();
            //let coverage_year = 2024;
            let zip_code = jQuery('#input_zip_code').val();

            // *** Merried
            let age_applying_merried = jQuery('#input_age_merried').val();
            let is_applying_applying_merried = false;
            let uses_tobacco_applying_merried = false;

            // *** Validate Data
            if (
                age.length === 0 ||
                income.length === 0 ||
                coverage_year.length === 0 ||
                zip_code.length === 0
            ) {
                console.log('age', age)
                console.log('is_applying', is_applying)
                console.log('uses_tobacco', uses_tobacco)
                console.log('income', income)
                console.log('coverage_year', coverage_year)
                console.log('zip_code', zip_code)
                alert('Los Campos con * son requeridos.')
                return
            }

            // *** Validate Is Applying
            let has_applying = false

            if (jQuery(\"#input_is_applying_merried\").is(':checked')) {
                        is_applying_applying_merried = true
            }

            if (arr_merried.length > 0) {
                if (age_applying_merried.length === 0) {
                    alert('Los Campos con * son requeridos.')
                } else {
                    // *** Get Checked
                    if (jQuery(\"#input_is_applying_merried\").is(':checked')) {
                        is_applying_applying_merried = true
                        has_applying = true
                    }
                    if (jQuery(\"#is_uses_tobacco_merried\").is(':checked')) {
                        uses_tobacco_applying_merried = true
                    }
                }
            }

            // *** Get Checked
            if (jQuery(\"#input_is_applying\").is(':checked')) {
                is_applying = true
                has_applying = true
            }
            if (jQuery(\"#is_uses_tobacco\").is(':checked')) {
                uses_tobacco = true
            }

            arr_dependent.map(el => {  
                if (el.is_applying_input.value === true) {
                    has_applying = true
                }
            })
            if (has_applying === false) {
                alert('Necesita una cobertura.')
                return
            }

            

            // *** Check Data
            console.log('age', age)
            console.log('is_applying', is_applying)
            console.log('uses_tobacco', uses_tobacco)
            console.log('income', income)
            console.log('coverage_year', coverage_year)
            console.log('zip_code', zip_code)

            // *** Base URL 
            const myUrl = new URL(\"https://aca.enterate.com/site/enterate/find-plan\");
            // *** Create Params

            // *** people
            let people = [];
            // *** When You ***
            people.push({
                \"age\": age,
                \"uses_tobacco\": uses_tobacco,
                \"has_mec\": !is_applying,
                \"is_pregnant\":false,
                \"is_parent\":false,
                \"gender\":\"Male\",
                \"aptc_eligible\":true,
                \"isPrincipal\":true
            })

            if (arr_merried.length > 0) {
                people[0].hasMarriedCouple = true;
            }

            // *** When Married ***
            if (arr_merried.length > 0) {
                people.push({
                    \"age\": age_applying_merried,
                    \"uses_tobacco\": uses_tobacco_applying_merried,
                    \"has_mec\":!is_applying_applying_merried,
                    \"is_pregnant\":false,
                    \"is_parent\":false,
                    \"aptc_eligible\":true, 
                    \"isSpouse\":true
                })
            }

            // *** When Dependent ***
            let hasAgeDependent = true
            arr_dependent.map(el => {
                el.age_input.value = jQuery(`#input_age_dependent_\${el.id}`).val();

                el.is_applying_input.value = false
                if (jQuery(`#input_applying_dependent_\${el.id}`).is(':checked')) {
                    el.is_applying_input.value = true
                }
                el.uses_tobacco_input.value = false
                if (jQuery(`#input_tobacco_dependent_\${el.id}`).is(':checked')) {
                    el.uses_tobacco_input.value = true
                }
                console.log('el.age_input.value', el.age_input.value)
                if (el.age_input.value == '') {
                    hasAgeDependent = false
                }

            })

            if (arr_dependent.length > 0 && hasAgeDependent === false) {
                alert('Los Campos con * son requeridos.')
                return
            }
            
            arr_dependent.map(el => {
                people.push({
                    \"age\": el.age_input.value,
                    \"uses_tobacco\": el.uses_tobacco_input.value,
                    \"has_mec\":!el.is_applying_input.value,
                    \"is_pregnant\":false,
                    \"is_parent\":false,
                    \"aptc_eligible\":true, 
                    \"isSpouse\":false,
                    \"isDependent\": true
                })
            })

            console.log('people', people);
            myUrl.searchParams.append(\"people\", `\${JSON.stringify(people)}`);
            // *** income
            myUrl.searchParams.append(\"income\", income);
            // *** fips
            await jQuery.ajax({
                type: \"GET\",
                url: `https://services.enterate.com:8181/healthcare-public-ws/api/public/marketplace_auxiliary/getFips/\${zip_code}`,
                dataType: \"json\",
                success: function (response) {
                    console.log(response)
                    if (Array.isArray(response?.counties)) {
                        console.log('isArray')
                        console.log(JSON.stringify(response?.counties[0]))
                        myUrl.searchParams.append(\"fips\", JSON.stringify(response?.counties[0]));
                    } else {
                        alert('ZipCode Inválido')
                        zip_code = null
                    }
                }
            });
            // *** csr
            myUrl.searchParams.append(\"csr\", \"0\");
            // *** coverage_year
            myUrl.searchParams.append(\"coverage_year\", coverage_year);//myUrl.searchParams.append(\"coverage_year\", \"2024\");
            // *** isAfterSubmit
            myUrl.searchParams.append(\"isAfterSubmit\", \"false\");
            // *** householdPeopleCount
            myUrl.searchParams.append(\"householdPeopleCount \", \"-1\");

            console.log('Build URL')

            if (zip_code !== null) {
                console.log('Build URL SUCCESSES')
                console.log(myUrl.href)
                window.open(myUrl.href, '_blank');
            } else {
                console.log('Build URL ERROR')
            }

        });
    });
</script>
";
        // line 911
        echo "<script>
  jQuery( function() {
    jQuery( \"#datepicker\" ).datepicker({
      changeMonth: true,
      changeYear: true
    });
    jQuery( \"#datepicker2\" ).datepicker({
      changeMonth: true,
      changeYear: true
    });
    jQuery( \"#datepicker3\" ).datepicker({
      changeMonth: true,
      changeYear: true
    });
  } );
  </script>";
    }

    public function getTemplateName()
    {
        return "themes/mahipro/templates/layout/page.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  1136 => 911,  818 => 582,  809 => 576,  791 => 561,  774 => 547,  713 => 489,  704 => 483,  686 => 468,  670 => 455,  404 => 191,  402 => 190,  397 => 187,  389 => 182,  386 => 181,  382 => 179,  380 => 178,  372 => 172,  365 => 170,  362 => 169,  360 => 168,  357 => 167,  354 => 166,  350 => 165,  348 => 164,  346 => 163,  343 => 162,  341 => 161,  337 => 159,  333 => 157,  331 => 156,  328 => 155,  324 => 153,  322 => 152,  319 => 150,  317 => 149,  314 => 147,  311 => 146,  309 => 145,  306 => 144,  303 => 143,  299 => 141,  293 => 138,  290 => 137,  287 => 136,  284 => 135,  281 => 134,  278 => 133,  276 => 132,  274 => 131,  269 => 130,  266 => 128,  263 => 126,  260 => 125,  257 => 124,  255 => 123,  252 => 122,  249 => 121,  246 => 120,  244 => 119,  241 => 118,  238 => 117,  235 => 116,  233 => 115,  230 => 114,  227 => 113,  224 => 112,  222 => 111,  219 => 110,  216 => 109,  213 => 108,  211 => 107,  208 => 106,  205 => 105,  202 => 104,  200 => 103,  197 => 102,  194 => 101,  191 => 100,  189 => 99,  186 => 98,  183 => 97,  181 => 96,  177 => 95,  174 => 94,  171 => 93,  168 => 92,  166 => 91,  162 => 90,  159 => 89,  156 => 88,  154 => 87,  151 => 86,  148 => 85,  144 => 83,  140 => 81,  137 => 80,  134 => 79,  131 => 78,  128 => 77,  125 => 76,  122 => 75,  120 => 74,  117 => 73,  115 => 72,  112 => 71,  109 => 70,  106 => 69,  103 => 68,  100 => 67,  98 => 66,  95 => 65,  93 => 64,  90 => 63,  87 => 62,  84 => 60,  81 => 58,  79 => 57,  76 => 56,  73 => 54,  70 => 53,  68 => 52,  65 => 51,  62 => 49,  60 => 48,  51 => 41,  49 => 40,  46 => 39,  44 => 37,  39 => 34,);
    }

    public function getSourceContext()
    {
        return new Source("", "themes/mahipro/templates/layout/page.html.twig", "/home/anapatriciaserna/public_html/themes/mahipro/templates/layout/page.html.twig");
    }
    
    public function checkSecurity()
    {
        static $tags = array("include" => 37, "set" => 40, "if" => 51, "for" => 165);
        static $filters = array("escape" => 130, "split" => 165, "replace" => 182);
        static $functions = array("path" => 40);

        try {
            $this->sandbox->checkSecurity(
                ['include', 'set', 'if', 'for'],
                ['escape', 'split', 'replace'],
                ['path']
            );
        } catch (SecurityError $e) {
            $e->setSourceContext($this->source);

            if ($e instanceof SecurityNotAllowedTagError && isset($tags[$e->getTagName()])) {
                $e->setTemplateLine($tags[$e->getTagName()]);
            } elseif ($e instanceof SecurityNotAllowedFilterError && isset($filters[$e->getFilterName()])) {
                $e->setTemplateLine($filters[$e->getFilterName()]);
            } elseif ($e instanceof SecurityNotAllowedFunctionError && isset($functions[$e->getFunctionName()])) {
                $e->setTemplateLine($functions[$e->getFunctionName()]);
            }

            throw $e;
        }

    }
}
