<?php

use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
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;

/* map/_list_cas.html.twig */
class __TwigTemplate_1dad2c4791691dbdfda77cec3c0e2281a23811eda0f18d71e484cfbb2730765f extends Template
{
    private $source;
    private $macros = [];

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

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

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->enter($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "map/_list_cas.html.twig"));

        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02 = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->enter($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "map/_list_cas.html.twig"));

        // line 1
        yield "<div id=\"sidebarMap\" class=\"card-content d-flex flex-column\" style=\"width: 100%; height: 100%;\">
    <style>
        #sidebarContent {
            flex-grow: 1;
            overflow-y: auto;
        }
        #sidebarMap .pagination .page-link {
            color: #34495e;
            background-color: transparent;
            border-color: #34495e;
        }
        #sidebarMap .pagination .page-item.active .page-link {
            background-color: #34495e;
            border-color: #34495e;
            color: white;
        }
        #sidebarMap .pagination .page-item.disabled .page-link {
            color: #bdc3c7;
            background-color: transparent;
            border-color: #34495e;
        }
        #sidebarMap .pagination .page-link:hover {
            background-color: #34495e;
            color: white;
        }
    </style>
    
    <div id=\"sidebarContent\">
        ";
        // line 29
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable((isset($context["cas"]) || array_key_exists("cas", $context) ? $context["cas"] : (function () { throw new RuntimeError('Variable "cas" does not exist.', 29, $this->source); })()));
        $context['loop'] = [
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        ];
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof \Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["_key"] => $context["equipement"]) {
            // line 30
            yield "            ";
            $context["label"] = CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "mapLabel", [], "any", false, false, false, 30);
            // line 31
            yield "            ";
            $context["client"] = CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "clientSouscripteur", [], "any", false, false, false, 31);
            // line 32
            yield "            ";
            $context["contrat"] = CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getLastContrat", [], "any", false, false, false, 32);
            // line 33
            yield "            <div id=\"cas-block-";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "id", [], "any", false, false, false, 33), "html", null, true);
            yield "\" class=\"d-flex flex-column mb-2 border cas-sidebar-block\" style=\"width: 100%; background-color: white; border-width: 1px !important; border-color: #d1dce5 !important; border-radius: 0; overflow: hidden;\">
                ";
            // line 35
            yield "                <div class=\"d-flex align-items-center text-white px-2 py-1\" style=\"font-weight: bold; font-size: 1.1em; background-color: #34495e;\">
                    <div class=\"flex-grow-1\">
                        ";
            // line 37
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["label"]) || array_key_exists("label", $context) ? $context["label"] : (function () { throw new RuntimeError('Variable "label" does not exist.', 37, $this->source); })()), "html", null, true);
            yield " - ";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["client"]) || array_key_exists("client", $context) ? $context["client"] : (function () { throw new RuntimeError('Variable "client" does not exist.', 37, $this->source); })()), "getIdentite", [], "any", false, false, false, 37), "html", null, true);
            yield "
                    </div>
                    ";
            // line 39
            if ((1 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getNbAbsences", [], "any", false, false, false, 39), 0))) {
                // line 40
                yield "                        <div class=\"bg-danger px-2 me-2\" style=\"border-radius: 6px; font-size: 0.9em;\">
                            ";
                // line 41
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getNbAbsences", [], "any", false, false, false, 41), "html", null, true);
                yield " absences
                        </div>
                    ";
            }
            // line 44
            yield "                    
                    ";
            // line 45
            if ((1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getEquipementGroupes", [], "any", false, false, false, 45)), 0))) {
                // line 46
                yield "                        <div class=\"d-flex align-items-center bg-white px-2 me-2\" style=\"border-radius: 6px; font-size: 0.9em; color: #1abc9c; border: 1px solid #1abc9c;\">
                            <i class=\"fa fa-users me-1\"></i>
                            ";
                // line 48
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getEquipementGroupes", [], "any", false, false, false, 48), "first", [], "any", false, false, false, 48), "getNumeroGroupe", [], "any", false, false, false, 48), "html", null, true);
                yield "
                        </div>
                    ";
            }
            // line 51
            yield "
                    <div style=\"font-size: 0.9em; font-weight: normal;\">
                        ";
            // line 53
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getDistance", [], "any", false, false, false, 53), 2, ",", " "), "html", null, true);
            yield "kms
                    </div>
                </div>

                ";
            // line 58
            yield "                <div class=\"d-flex p-2\">
                    ";
            // line 60
            yield "                    <div class=\"flex-grow-1 d-flex flex-column\" style=\"color: #333;\">
                        <div class=\"mb-1\">
                            <span style=\"font-weight: bold;\">N° Client</span>
                            <a href=\"";
            // line 63
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("show_client", ["id" => CoreExtension::getAttribute($this->env, $this->source, (isset($context["client"]) || array_key_exists("client", $context) ? $context["client"] : (function () { throw new RuntimeError('Variable "client" does not exist.', 63, $this->source); })()), "id", [], "any", false, false, false, 63), "id_equipement" => CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "id", [], "any", false, false, false, 63)]), "html", null, true);
            yield "\" target=\"_blank\" style=\"color: #1abc9c; font-weight: bold; margin-left: 10px; text-decoration: none;\">
                                ";
            // line 64
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["client"]) || array_key_exists("client", $context) ? $context["client"] : (function () { throw new RuntimeError('Variable "client" does not exist.', 64, $this->source); })()), "getFormattedNumeroClient", [], "any", false, false, false, 64), "html", null, true);
            yield "
                            </a>
                        </div>
                        
                        ";
            // line 68
            if (CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "adresse", [], "any", false, false, false, 68)) {
                // line 69
                yield "                            <div class=\"d-flex align-items-start mb-1\">
                                <i class=\"fa fa-home mt-1\" style=\"width: 20px; color: #2c3e50;\"></i>
                                <div style=\"color: #2c3e50;\">
                                    ";
                // line 72
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "adresse", [], "any", false, false, false, 72), "adresse", [], "any", false, false, false, 72), "html", null, true);
                yield " ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "adresse", [], "any", false, false, false, 72), "codePostal", [], "any", false, false, false, 72), "html", null, true);
                yield " ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "adresse", [], "any", false, false, false, 72), "ville", [], "any", false, false, false, 72), "html", null, true);
                yield "
                                </div>
                            </div>
                        ";
            }
            // line 76
            yield "
                        ";
            // line 77
            if ((1 === CoreExtension::compare(Twig\Extension\CoreExtension::length($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, (isset($context["client"]) || array_key_exists("client", $context) ? $context["client"] : (function () { throw new RuntimeError('Variable "client" does not exist.', 77, $this->source); })()), "clientTels", [], "any", false, false, false, 77)), 0))) {
                // line 78
                yield "                            <div class=\"d-flex align-items-center mb-2\">
                                <i class=\"fa fa-phone me-1\" style=\"width: 20px; color: #2c3e50; text-align: center;\"></i>
                                <div class=\"d-flex flex-column\" style=\"color: #2c3e50;\">
                                    ";
                // line 81
                $context['_parent'] = $context;
                $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, (isset($context["client"]) || array_key_exists("client", $context) ? $context["client"] : (function () { throw new RuntimeError('Variable "client" does not exist.', 81, $this->source); })()), "clientTels", [], "any", false, false, false, 81));
                foreach ($context['_seq'] as $context["_key"] => $context["tel"]) {
                    // line 82
                    yield "                                        <span>";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["tel"], "numTel", [], "any", false, false, false, 82), "html", null, true);
                    yield "</span>
                                    ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['tel'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 84
                yield "                                </div>
                            </div>
                        ";
            }
            // line 87
            yield "
                        ";
            // line 88
            $context["typeLibelle"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "equipementTypePuissance", [], "any", false, false, false, 88)) ? (CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "equipementTypePuissance", [], "any", false, false, false, 88), "equipementType", [], "any", false, false, false, 88), "type", [], "any", false, false, false, 88)) : (null));
            // line 89
            yield "                        ";
            if ((isset($context["typeLibelle"]) || array_key_exists("typeLibelle", $context) ? $context["typeLibelle"] : (function () { throw new RuntimeError('Variable "typeLibelle" does not exist.', 89, $this->source); })())) {
                // line 90
                yield "                            <div class=\"mb-0\">
                                Type équipement : 
                                <span style=\"font-weight: bold;\">";
                // line 92
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["typeLibelle"]) || array_key_exists("typeLibelle", $context) ? $context["typeLibelle"] : (function () { throw new RuntimeError('Variable "typeLibelle" does not exist.', 92, $this->source); })()), "html", null, true);
                yield "</span>
                            </div>
                        ";
            }
            // line 95
            yield "
                        ";
            // line 96
            if ((CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getSecteur", [], "any", false, false, false, 96) && CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getSecteur", [], "any", false, false, false, 96), "getAgentPrincipal", [], "any", false, false, false, 96))) {
                // line 97
                yield "                            <div class=\"mb-0\">
                                Agent : 
                                <span style=\"font-weight: bold;\">";
                // line 99
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getSecteur", [], "any", false, false, false, 99), "getAgentPrincipal", [], "any", false, false, false, 99), "getCodeNom", [], "any", false, false, false, 99), "html", null, true);
                yield "</span>
                            </div>
                        ";
            }
            // line 102
            yield "
                        ";
            // line 103
            if (CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getDateDerniereV1", [], "any", false, false, false, 103)) {
                // line 104
                yield "                            <div class=\"mb-0\">
                                Dernière V1 : 
                                <span style=\"font-weight: bold;\">";
                // line 106
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getDateDerniereV1", [], "any", false, false, false, 106), "d/m/Y"), "html", null, true);
                yield "</span>
                            </div>
                        ";
            }
            // line 109
            yield "
                        <div class=\"mb-0\">
                            Contrat ";
            // line 111
            ((((isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 111, $this->source); })()) && CoreExtension::getAttribute($this->env, $this->source, (isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 111, $this->source); })()), "contratType", [], "any", false, false, false, 111))) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 111, $this->source); })()), "contratType", [], "any", false, false, false, 111), "libelleCourt", [], "any", false, false, false, 111), "html", null, true)) : (yield ""));
            yield " : 
                            <span style=\"font-weight: bold;\">
                                ";
            // line 113
            if ((isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 113, $this->source); })())) {
                // line 114
                yield "                                    ";
                ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 114, $this->source); })()), "dateDebutContrat", [], "any", false, false, false, 114)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, (isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 114, $this->source); })()), "dateDebutContrat", [], "any", false, false, false, 114), "d/m/Y"), "html", null, true)) : (yield "?"));
                yield " &rarr; ";
                ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 114, $this->source); })()), "dateFinContrat", [], "any", false, false, false, 114)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, (isset($context["contrat"]) || array_key_exists("contrat", $context) ? $context["contrat"] : (function () { throw new RuntimeError('Variable "contrat" does not exist.', 114, $this->source); })()), "dateFinContrat", [], "any", false, false, false, 114), "d/m/Y"), "html", null, true)) : (yield "?"));
                yield "
                                ";
            } else {
                // line 116
                yield "                                    Pas de contrat
                                ";
            }
            // line 118
            yield "                            </span>
                        </div>
                    </div>

                    ";
            // line 123
            yield "                    <div class=\"d-flex flex-column align-items-end ms-2\">
                        <div class=\"d-flex flex-column gap-2 w-100\">
                            <button id=\"\" class=\"btn btn-md btn-block bg-outline-bleu\" style=\"width:123px;\" ";
            // line 125
            yield (((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getActif", [], "any", false, false, false, 125), false))) ? ("disabled") : (""));
            yield " type=\"button\"><i class=\"fa fa-calendar-alt me-2 \" ></i>Planifier</button>
";
            // line 129
            yield "
                            <a class=\"btn btn-md btn-block btn-outline-success\" 
                               data-disable-on-view=\"\" data-poppup-container=\"body\" data-popup-id=\"popup_pref_planification_";
            // line 131
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "id", [], "any", false, false, false, 131), "html", null, true);
            yield "\" 
                               data-dxpopup=\"\" data-popup-title=\"Préférences de planification\" data-popup-width=\"auto\" 
                               style=\"width:123px;\" type=\"button\">
                                <i class=\"fa fa-calendar-check-o me-2\"></i>Préférences
                            </a>
                            ";
            // line 136
            yield Twig\Extension\CoreExtension::include($this->env, $context, "clients/_popup_pref_planification.html.twig", ["equipement" => $context["equipement"], "consultation_only" => true]);
            yield "

                            <a href=\"#\" class=\"btn btn-md btn-block btn-outline-danger btn-log-call\" style=\"width:123px;\" data-client-id=\"";
            // line 138
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["client"]) || array_key_exists("client", $context) ? $context["client"] : (function () { throw new RuntimeError('Variable "client" does not exist.', 138, $this->source); })()), "id", [], "any", false, false, false, 138), "html", null, true);
            yield "\" data-equipement-id=\"";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "id", [], "any", false, false, false, 138), "html", null, true);
            yield "\">
                                <i class=\"fa fa-phone me-2\"></i>Appeler
                            </a>
                            ";
            // line 141
            $context["lastAppel"] = CoreExtension::getAttribute($this->env, $this->source, $context["equipement"], "getLastAppel", [], "any", false, false, false, 141);
            // line 142
            yield "                            ";
            if ((isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 142, $this->source); })())) {
                // line 143
                yield "                                <div class=\"text-end\" style=\"font-size: 0.75rem; color: #e74c3c; width: 123px;\">
                                    le ";
                // line 144
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 144, $this->source); })()), "dateHeureEnvoi", [], "any", false, false, false, 144), "d/m/Y"), "html", null, true);
                yield " à ";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, (isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 144, $this->source); })()), "dateHeureEnvoi", [], "any", false, false, false, 144), "H:i"), "html", null, true);
                yield " par ";
                ((CoreExtension::getAttribute($this->env, $this->source, (isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 144, $this->source); })()), "utilisateur", [], "any", false, false, false, 144)) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((((((CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 144, $this->source); })()), "utilisateur", [], "any", false, false, false, 144), "codeAgent", [], "any", false, false, false, 144) . " - ") . CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 144, $this->source); })()), "utilisateur", [], "any", false, false, false, 144), "initiales", [], "any", false, false, false, 144)) . " ") . Twig\Extension\CoreExtension::upper($this->env->getCharset(), Twig\Extension\CoreExtension::first($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 144, $this->source); })()), "utilisateur", [], "any", false, false, false, 144), "prenom", [], "any", false, false, false, 144)))) . ".") . CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["lastAppel"]) || array_key_exists("lastAppel", $context) ? $context["lastAppel"] : (function () { throw new RuntimeError('Variable "lastAppel" does not exist.', 144, $this->source); })()), "utilisateur", [], "any", false, false, false, 144), "nom", [], "any", false, false, false, 144)), "html", null, true)) : (yield "Inconnu"));
                yield "
                                </div>
                            ";
            }
            // line 147
            yield "                        </div>
                    </div>
                </div>
            </div>
        ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['equipement'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 152
        yield "        ";
        if (Twig\Extension\CoreExtension::testEmpty((isset($context["cas"]) || array_key_exists("cas", $context) ? $context["cas"] : (function () { throw new RuntimeError('Variable "cas" does not exist.', 152, $this->source); })()))) {
            // line 153
            yield "            <div class=\"p-4 text-center\" style=\"color: #34495e; font-size: 1.1em; background-color: white; border: 1px solid #d1dce5;\">
                Nous n’avons trouvé aucun contrat à servir correspondant. Essayez d’élargir votre recherche ou de modifier les critères.
            </div>
        ";
        }
        // line 157
        yield "    </div>

    ";
        // line 159
        if ((array_key_exists("totalPages", $context) && (1 === CoreExtension::compare((isset($context["totalPages"]) || array_key_exists("totalPages", $context) ? $context["totalPages"] : (function () { throw new RuntimeError('Variable "totalPages" does not exist.', 159, $this->source); })()), 1)))) {
            // line 160
            yield "        <nav aria-label=\"Page navigation\" class=\"border-top pt-2\" style=\"background-color: transparent;\">
            <ul class=\"pagination pagination-sm justify-content-center mb-0\">
                <li class=\"page-item ";
            // line 162
            if ((0 === CoreExtension::compare((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 162, $this->source); })()), 1))) {
                yield "disabled";
            }
            yield "\">
                    <a class=\"page-link page-link-cas\" href=\"#\" data-page=\"";
            // line 163
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 163, $this->source); })()) - 1), "html", null, true);
            yield "\" aria-label=\"Previous\">
                        <span aria-hidden=\"true\">&laquo;</span>
                    </a>
                </li>
                
                ";
            // line 169
            yield "                ";
            $context["nearbyPagesLimit"] = 2;
            // line 170
            yield "                
                ";
            // line 171
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(range(1, (isset($context["totalPages"]) || array_key_exists("totalPages", $context) ? $context["totalPages"] : (function () { throw new RuntimeError('Variable "totalPages" does not exist.', 171, $this->source); })())));
            foreach ($context['_seq'] as $context["_key"] => $context["i"]) {
                // line 172
                yield "                    ";
                if ((((0 === CoreExtension::compare($context["i"], 1)) || (0 === CoreExtension::compare($context["i"], (isset($context["totalPages"]) || array_key_exists("totalPages", $context) ? $context["totalPages"] : (function () { throw new RuntimeError('Variable "totalPages" does not exist.', 172, $this->source); })())))) || ((0 <= CoreExtension::compare($context["i"], ((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 172, $this->source); })()) - (isset($context["nearbyPagesLimit"]) || array_key_exists("nearbyPagesLimit", $context) ? $context["nearbyPagesLimit"] : (function () { throw new RuntimeError('Variable "nearbyPagesLimit" does not exist.', 172, $this->source); })())))) && (0 >= CoreExtension::compare($context["i"], ((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 172, $this->source); })()) + (isset($context["nearbyPagesLimit"]) || array_key_exists("nearbyPagesLimit", $context) ? $context["nearbyPagesLimit"] : (function () { throw new RuntimeError('Variable "nearbyPagesLimit" does not exist.', 172, $this->source); })()))))))) {
                    // line 173
                    yield "                        <li class=\"page-item ";
                    if ((0 === CoreExtension::compare($context["i"], (isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 173, $this->source); })())))) {
                        yield "active";
                    }
                    yield "\">
                            <a class=\"page-link page-link-cas\" href=\"#\" data-page=\"";
                    // line 174
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["i"], "html", null, true);
                    yield "\">";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($context["i"], "html", null, true);
                    yield "</a>
                        </li>
                    ";
                } elseif (((0 === CoreExtension::compare(                // line 176
$context["i"], (((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 176, $this->source); })()) - (isset($context["nearbyPagesLimit"]) || array_key_exists("nearbyPagesLimit", $context) ? $context["nearbyPagesLimit"] : (function () { throw new RuntimeError('Variable "nearbyPagesLimit" does not exist.', 176, $this->source); })())) - 1))) || (0 === CoreExtension::compare($context["i"], (((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 176, $this->source); })()) + (isset($context["nearbyPagesLimit"]) || array_key_exists("nearbyPagesLimit", $context) ? $context["nearbyPagesLimit"] : (function () { throw new RuntimeError('Variable "nearbyPagesLimit" does not exist.', 176, $this->source); })())) + 1))))) {
                    // line 177
                    yield "                        <li class=\"page-item disabled\"><span class=\"page-link\">...</span></li>
                    ";
                }
                // line 179
                yield "                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['i'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 180
            yield "
                <li class=\"page-item ";
            // line 181
            if ((0 === CoreExtension::compare((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 181, $this->source); })()), (isset($context["totalPages"]) || array_key_exists("totalPages", $context) ? $context["totalPages"] : (function () { throw new RuntimeError('Variable "totalPages" does not exist.', 181, $this->source); })())))) {
                yield "disabled";
            }
            yield "\">
                    <a class=\"page-link page-link-cas\" href=\"#\" data-page=\"";
            // line 182
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((isset($context["currentPage"]) || array_key_exists("currentPage", $context) ? $context["currentPage"] : (function () { throw new RuntimeError('Variable "currentPage" does not exist.', 182, $this->source); })()) + 1), "html", null, true);
            yield "\" aria-label=\"Next\">
                        <span aria-hidden=\"true\">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
    ";
        }
        // line 189
        yield "</div>
";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName()
    {
        return "map/_list_cas.html.twig";
    }

    /**
     * @codeCoverageIgnore
     */
    public function isTraitable()
    {
        return false;
    }

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  455 => 189,  445 => 182,  439 => 181,  436 => 180,  430 => 179,  426 => 177,  424 => 176,  417 => 174,  410 => 173,  407 => 172,  403 => 171,  400 => 170,  397 => 169,  389 => 163,  383 => 162,  379 => 160,  377 => 159,  373 => 157,  367 => 153,  364 => 152,  346 => 147,  336 => 144,  333 => 143,  330 => 142,  328 => 141,  320 => 138,  315 => 136,  307 => 131,  303 => 129,  299 => 125,  295 => 123,  289 => 118,  285 => 116,  277 => 114,  275 => 113,  270 => 111,  266 => 109,  260 => 106,  256 => 104,  254 => 103,  251 => 102,  245 => 99,  241 => 97,  239 => 96,  236 => 95,  230 => 92,  226 => 90,  223 => 89,  221 => 88,  218 => 87,  213 => 84,  204 => 82,  200 => 81,  195 => 78,  193 => 77,  190 => 76,  179 => 72,  174 => 69,  172 => 68,  165 => 64,  161 => 63,  156 => 60,  153 => 58,  146 => 53,  142 => 51,  136 => 48,  132 => 46,  130 => 45,  127 => 44,  121 => 41,  118 => 40,  116 => 39,  109 => 37,  105 => 35,  100 => 33,  97 => 32,  94 => 31,  91 => 30,  74 => 29,  44 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("<div id=\"sidebarMap\" class=\"card-content d-flex flex-column\" style=\"width: 100%; height: 100%;\">
    <style>
        #sidebarContent {
            flex-grow: 1;
            overflow-y: auto;
        }
        #sidebarMap .pagination .page-link {
            color: #34495e;
            background-color: transparent;
            border-color: #34495e;
        }
        #sidebarMap .pagination .page-item.active .page-link {
            background-color: #34495e;
            border-color: #34495e;
            color: white;
        }
        #sidebarMap .pagination .page-item.disabled .page-link {
            color: #bdc3c7;
            background-color: transparent;
            border-color: #34495e;
        }
        #sidebarMap .pagination .page-link:hover {
            background-color: #34495e;
            color: white;
        }
    </style>
    
    <div id=\"sidebarContent\">
        {% for equipement in cas %}
            {% set label = equipement.mapLabel %}
            {% set client = equipement.clientSouscripteur %}
            {% set contrat = equipement.getLastContrat %}
            <div id=\"cas-block-{{ equipement.id }}\" class=\"d-flex flex-column mb-2 border cas-sidebar-block\" style=\"width: 100%; background-color: white; border-width: 1px !important; border-color: #d1dce5 !important; border-radius: 0; overflow: hidden;\">
                {# Header #}
                <div class=\"d-flex align-items-center text-white px-2 py-1\" style=\"font-weight: bold; font-size: 1.1em; background-color: #34495e;\">
                    <div class=\"flex-grow-1\">
                        {{ label }} - {{ client.getIdentite }}
                    </div>
                    {% if equipement.getNbAbsences > 0 %}
                        <div class=\"bg-danger px-2 me-2\" style=\"border-radius: 6px; font-size: 0.9em;\">
                            {{ equipement.getNbAbsences }} absences
                        </div>
                    {% endif %}
                    
                    {% if equipement.getEquipementGroupes|length > 0 %}
                        <div class=\"d-flex align-items-center bg-white px-2 me-2\" style=\"border-radius: 6px; font-size: 0.9em; color: #1abc9c; border: 1px solid #1abc9c;\">
                            <i class=\"fa fa-users me-1\"></i>
                            {{ equipement.getEquipementGroupes.first.getNumeroGroupe }}
                        </div>
                    {% endif %}

                    <div style=\"font-size: 0.9em; font-weight: normal;\">
                        {{ equipement.getDistance|number_format(2, ',', ' ') }}kms
                    </div>
                </div>

                {# Body #}
                <div class=\"d-flex p-2\">
                    {# Infos à gauche #}
                    <div class=\"flex-grow-1 d-flex flex-column\" style=\"color: #333;\">
                        <div class=\"mb-1\">
                            <span style=\"font-weight: bold;\">N° Client</span>
                            <a href=\"{{ path('show_client', {id: client.id, id_equipement: equipement.id}) }}\" target=\"_blank\" style=\"color: #1abc9c; font-weight: bold; margin-left: 10px; text-decoration: none;\">
                                {{ client.getFormattedNumeroClient }}
                            </a>
                        </div>
                        
                        {% if equipement.adresse %}
                            <div class=\"d-flex align-items-start mb-1\">
                                <i class=\"fa fa-home mt-1\" style=\"width: 20px; color: #2c3e50;\"></i>
                                <div style=\"color: #2c3e50;\">
                                    {{ equipement.adresse.adresse }} {{ equipement.adresse.codePostal }} {{ equipement.adresse.ville }}
                                </div>
                            </div>
                        {% endif %}

                        {% if client.clientTels|length > 0 %}
                            <div class=\"d-flex align-items-center mb-2\">
                                <i class=\"fa fa-phone me-1\" style=\"width: 20px; color: #2c3e50; text-align: center;\"></i>
                                <div class=\"d-flex flex-column\" style=\"color: #2c3e50;\">
                                    {% for tel in client.clientTels %}
                                        <span>{{ tel.numTel }}</span>
                                    {% endfor %}
                                </div>
                            </div>
                        {% endif %}

                        {% set typeLibelle = equipement.equipementTypePuissance ? equipement.equipementTypePuissance.equipementType.type : null %}
                        {% if typeLibelle %}
                            <div class=\"mb-0\">
                                Type équipement : 
                                <span style=\"font-weight: bold;\">{{ typeLibelle }}</span>
                            </div>
                        {% endif %}

                        {% if equipement.getSecteur and equipement.getSecteur.getAgentPrincipal %}
                            <div class=\"mb-0\">
                                Agent : 
                                <span style=\"font-weight: bold;\">{{ equipement.getSecteur.getAgentPrincipal.getCodeNom }}</span>
                            </div>
                        {% endif %}

                        {% if equipement.getDateDerniereV1 %}
                            <div class=\"mb-0\">
                                Dernière V1 : 
                                <span style=\"font-weight: bold;\">{{ equipement.getDateDerniereV1|date('d/m/Y') }}</span>
                            </div>
                        {% endif %}

                        <div class=\"mb-0\">
                            Contrat {{ contrat and contrat.contratType ? contrat.contratType.libelleCourt : '' }} : 
                            <span style=\"font-weight: bold;\">
                                {% if contrat %}
                                    {{ contrat.dateDebutContrat ? contrat.dateDebutContrat|date('d/m/Y') : '?' }} &rarr; {{ contrat.dateFinContrat ? contrat.dateFinContrat|date('d/m/Y') : '?' }}
                                {% else %}
                                    Pas de contrat
                                {% endif %}
                            </span>
                        </div>
                    </div>

                    {# Boutons à droite #}
                    <div class=\"d-flex flex-column align-items-end ms-2\">
                        <div class=\"d-flex flex-column gap-2 w-100\">
                            <button id=\"\" class=\"btn btn-md btn-block bg-outline-bleu\" style=\"width:123px;\" {{ (equipement.getActif == false) ? 'disabled' : '' }} type=\"button\"><i class=\"fa fa-calendar-alt me-2 \" ></i>Planifier</button>
{#                            <a href=\"#\" class=\"btn btn-md btn-block bg-outline-bleu\" style=\"width:123px;\">#}
{#                                <i class=\"fa fa-calendar-alt me-2 \" ></i>Planifier#}
{#                            </a>#}

                            <a class=\"btn btn-md btn-block btn-outline-success\" 
                               data-disable-on-view=\"\" data-poppup-container=\"body\" data-popup-id=\"popup_pref_planification_{{ equipement.id }}\" 
                               data-dxpopup=\"\" data-popup-title=\"Préférences de planification\" data-popup-width=\"auto\" 
                               style=\"width:123px;\" type=\"button\">
                                <i class=\"fa fa-calendar-check-o me-2\"></i>Préférences
                            </a>
                            {{ include('clients/_popup_pref_planification.html.twig', {'equipement': equipement, 'consultation_only': true}) }}

                            <a href=\"#\" class=\"btn btn-md btn-block btn-outline-danger btn-log-call\" style=\"width:123px;\" data-client-id=\"{{ client.id }}\" data-equipement-id=\"{{ equipement.id }}\">
                                <i class=\"fa fa-phone me-2\"></i>Appeler
                            </a>
                            {% set lastAppel = equipement.getLastAppel %}
                            {% if lastAppel %}
                                <div class=\"text-end\" style=\"font-size: 0.75rem; color: #e74c3c; width: 123px;\">
                                    le {{ lastAppel.dateHeureEnvoi|date('d/m/Y') }} à {{ lastAppel.dateHeureEnvoi|date('H:i') }} par {{ lastAppel.utilisateur ? lastAppel.utilisateur.codeAgent ~ ' - ' ~ lastAppel.utilisateur.initiales ~ ' ' ~ lastAppel.utilisateur.prenom|first|upper ~ '.' ~ lastAppel.utilisateur.nom : 'Inconnu' }}
                                </div>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        {% endfor %}
        {% if cas is empty %}
            <div class=\"p-4 text-center\" style=\"color: #34495e; font-size: 1.1em; background-color: white; border: 1px solid #d1dce5;\">
                Nous n’avons trouvé aucun contrat à servir correspondant. Essayez d’élargir votre recherche ou de modifier les critères.
            </div>
        {% endif %}
    </div>

    {% if totalPages is defined and totalPages > 1 %}
        <nav aria-label=\"Page navigation\" class=\"border-top pt-2\" style=\"background-color: transparent;\">
            <ul class=\"pagination pagination-sm justify-content-center mb-0\">
                <li class=\"page-item {% if currentPage == 1 %}disabled{% endif %}\">
                    <a class=\"page-link page-link-cas\" href=\"#\" data-page=\"{{ currentPage - 1 }}\" aria-label=\"Previous\">
                        <span aria-hidden=\"true\">&laquo;</span>
                    </a>
                </li>
                
                {# Logique de pagination rétractable #}
                {% set nearbyPagesLimit = 2 %}
                
                {% for i in 1..totalPages %}
                    {% if i == 1 or i == totalPages or (i >= currentPage - nearbyPagesLimit and i <= currentPage + nearbyPagesLimit) %}
                        <li class=\"page-item {% if i == currentPage %}active{% endif %}\">
                            <a class=\"page-link page-link-cas\" href=\"#\" data-page=\"{{ i }}\">{{ i }}</a>
                        </li>
                    {% elseif i == currentPage - nearbyPagesLimit - 1 or i == currentPage + nearbyPagesLimit + 1 %}
                        <li class=\"page-item disabled\"><span class=\"page-link\">...</span></li>
                    {% endif %}
                {% endfor %}

                <li class=\"page-item {% if currentPage == totalPages %}disabled{% endif %}\">
                    <a class=\"page-link page-link-cas\" href=\"#\" data-page=\"{{ currentPage + 1 }}\" aria-label=\"Next\">
                        <span aria-hidden=\"true\">&raquo;</span>
                    </a>
                </li>
            </ul>
        </nav>
    {% endif %}
</div>
", "map/_list_cas.html.twig", "/builds/dev/refonte_sav/templates/map/_list_cas.html.twig");
    }
}
