<?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;

/* intervention/_liste_interventions_a_valider.html.twig */
class __TwigTemplate_5184a86a1a17b3ba8220914a645cf4673c3aba6829c72b3ba5649ca195f3f38d 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", "intervention/_liste_interventions_a_valider.html.twig"));

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

        // line 1
        yield "
<div class=\"mb-1 ps-1 position-relative\">
    <div class=\"input-group form-group pb-2 d-flex w-auto me-4\" style=\"visibility: hidden; position: absolute !important; opacity: 0 !important; pointer-events: none !important;\">
        <label class=\"white me-2 control-label align-self-center\">A partir du</label>
        <input type=\"date\" name=\"a_partir_du\" id=\"a_partir_du\" class=\"form-control bg-grey \" value=\"\" min=\"";
        // line 5
        (((isset($context["firstInterventionDate"]) || array_key_exists("firstInterventionDate", $context) ? $context["firstInterventionDate"] : (function () { throw new RuntimeError('Variable "firstInterventionDate" does not exist.', 5, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["firstInterventionDate"]) || array_key_exists("firstInterventionDate", $context) ? $context["firstInterventionDate"] : (function () { throw new RuntimeError('Variable "firstInterventionDate" does not exist.', 5, $this->source); })()), "html", null, true)) : (yield ""));
        yield "\"  form=\"validation-form-search\" data-default-date=\"";
        (((isset($context["firstDate"]) || array_key_exists("firstDate", $context) ? $context["firstDate"] : (function () { throw new RuntimeError('Variable "firstDate" does not exist.', 5, $this->source); })())) ? (yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((isset($context["firstDate"]) || array_key_exists("firstDate", $context) ? $context["firstDate"] : (function () { throw new RuntimeError('Variable "firstDate" does not exist.', 5, $this->source); })()), "html", null, true)) : (yield ""));
        yield "\">
    </div>
    <button class=\"btn bg-orange-inverse w-100 border-orange\" id=\"bouton_date_validation\"><i class=\"fa fa-calendar me-1\"></i>Dates antérieures</button>
</div>
<div class=\"accordion\" id=\"dateAccordion\">
    ";
        // line 10
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable((isset($context["interventions"]) || array_key_exists("interventions", $context) ? $context["interventions"] : (function () { throw new RuntimeError('Variable "interventions" does not exist.', 10, $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["date"] => $context["intervention_date"]) {
            // line 11
            yield "    <div class=\"accordion-item ps-1\">
        <h2 class=\"accordion-header\" id=\"heading";
            // line 12
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 12), "html", null, true);
            yield "\">
            <button class=\"accordion-button bg-primary color-white ps-2 ";
            // line 13
            yield ((((0 !== CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 13), 1)) &&  !CoreExtension::getAttribute($this->env, $this->source, $context["intervention_date"], "warning", [], "array", true, true, false, 13))) ? ("collapsed") : (""));
            yield "\" type=\"button\" data-target=\"#collapse";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 13), "html", null, true);
            yield "\" aria-expanded=\"";
            yield ((((0 !== CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 13), 1)) &&  !CoreExtension::getAttribute($this->env, $this->source, $context["intervention_date"], "warning", [], "array", true, true, false, 13))) ? ("false") : ("true"));
            yield "\" aria-controls=\"collapse";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 13), "html", null, true);
            yield "\">
                ";
            // line 14
            if (CoreExtension::getAttribute($this->env, $this->source, $context["intervention_date"], "warning", [], "array", true, true, false, 14)) {
                // line 15
                yield "                    <img src=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/picto-intervention-warning.png"), "html", null, true);
                yield "\" width=\"24\" height=\"24\" class=\"me-2\">
                ";
            } else {
                // line 17
                yield "                    <img src=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/picto-intervention-valide.png"), "html", null, true);
                yield "\" width=\"24\" height=\"24\" class=\"me-2\">
                ";
            }
            // line 19
            yield "                ";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::capitalize($this->env->getCharset(), $this->extensions['Twig\Extra\Intl\IntlExtension']->formatDateTime($this->env, $context["date"], "medium", "medium", "eeee dd/MM/YYYY", null, "gregorian", "fr")), "html", null, true);
            yield "
            </button>
        </h2>
        <div id=\"collapse";
            // line 22
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 22), "html", null, true);
            yield "\" class=\"accordion-collapse collapse ";
            yield ((((0 === CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 22), 1)) || CoreExtension::getAttribute($this->env, $this->source, $context["intervention_date"], "warning", [], "array", true, true, false, 22))) ? ("show") : (""));
            yield " bg-grey\" aria-labelledby=\"heading";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["loop"], "index", [], "any", false, false, false, 22), "html", null, true);
            yield "\">
            <div class=\"accordion-body pe-0 ps-0\">
                <ul class=\"list-group\">
                    ";
            // line 25
            $context['_parent'] = $context;
            $context['_seq'] = CoreExtension::ensureTraversable(CoreExtension::getAttribute($this->env, $this->source, $context["intervention_date"], "interventions", [], "array", false, false, false, 25));
            foreach ($context['_seq'] as $context["_key"] => $context["intervention"]) {
                // line 26
                yield "                    ";
                $context["equipement"] = CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "equipement", [], "any", false, false, false, 26);
                // line 27
                yield "                    ";
                $context["autre_intervention"] = !CoreExtension::inFilter(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "planning", [], "any", false, false, false, 27), "getTypePlanificationInit", [], "any", false, false, false, 27), "getCategoriePlanification", [], "any", false, false, false, 27), "libelle", [], "any", false, false, false, 27), ["Client", "Interne"]);
                // line 28
                yield "                    <li class=\"list-group-item pe-1 color-primary ";
                yield (((isset($context["autre_intervention"]) || array_key_exists("autre_intervention", $context) ? $context["autre_intervention"] : (function () { throw new RuntimeError('Variable "autre_intervention" does not exist.', 28, $this->source); })())) ? ("") : ("show_validation"));
                yield "\" data-href=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("get_intervention_validation", ["id" => CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "id", [], "any", false, false, false, 28), "type" => (isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 28, $this->source); })())]), "html", null, true);
                yield "\" style=\"margin-bottom: 0.1rem !important;\">
                        <div class=\"d-flex\">
                            <div class=\"d-flex flex-column align-items-center justify-content-center color-vert mt-2\">
                                <div class=\"fw-600\">";
                // line 31
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "planning", [], "any", false, false, false, 31), "getHeureDebut", [], "any", false, false, false, 31), "h:i"), "html", null, true);
                yield "</div>
                                <div class=\"fw-600\">";
                // line 32
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Twig\Extension\CoreExtension']->formatDate(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "planning", [], "any", false, false, false, 32), "getHeureFin", [], "any", false, false, false, 32), "h:i"), "html", null, true);
                yield "</div>
                            </div>
                            <div class=\"bg-primary mx-2\" style=\"width:1px;margin-top: 0.5rem;\"></div>
                            <div class=\"d-flex flex-column justify-content-center pt-2\">
                                ";
                // line 36
                if (((isset($context["equipement"]) || array_key_exists("equipement", $context) ? $context["equipement"] : (function () { throw new RuntimeError('Variable "equipement" does not exist.', 36, $this->source); })()) &&  !(isset($context["autre_intervention"]) || array_key_exists("autre_intervention", $context) ? $context["autre_intervention"] : (function () { throw new RuntimeError('Variable "autre_intervention" does not exist.', 36, $this->source); })()))) {
                    // line 37
                    yield "                                    <div class=\"\">N°intervention : ";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "id", [], "any", false, false, false, 37), "html", null, true);
                    yield "</div>
                                    <div class=\"\">Souscripteur: ";
                    // line 38
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["equipement"]) || array_key_exists("equipement", $context) ? $context["equipement"] : (function () { throw new RuntimeError('Variable "equipement" does not exist.', 38, $this->source); })()), "getClientSouscripteur", [], "any", false, false, false, 38), "html", null, true);
                    yield "</div>
                                    ";
                    // line 39
                    if (CoreExtension::getAttribute($this->env, $this->source, (isset($context["equipement"]) || array_key_exists("equipement", $context) ? $context["equipement"] : (function () { throw new RuntimeError('Variable "equipement" does not exist.', 39, $this->source); })()), "getClientUtilisateur", [], "any", false, false, false, 39)) {
                        // line 40
                        yield "                                        <div class=\"\">Utilisateur: ";
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["equipement"]) || array_key_exists("equipement", $context) ? $context["equipement"] : (function () { throw new RuntimeError('Variable "equipement" does not exist.', 40, $this->source); })()), "getClientUtilisateur", [], "any", false, false, false, 40), "html", null, true);
                        yield "</div>
                                    ";
                    }
                    // line 42
                    yield "                                ";
                }
                // line 43
                yield "                                <div class=\"\">
                                    ";
                // line 44
                $context["type_intervention_2"] = (((0 !== CoreExtension::compare(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "planning", [], "any", false, false, false, 44), "getTypePlanificationInit", [], "any", false, false, false, 44), CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "getTypePlanification", [], "any", false, false, false, 44)))) ? ((" -> " . CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "getTypePlanification", [], "any", false, false, false, 44), "code", [], "any", false, false, false, 44))) : (""));
                // line 45
                yield "                                    ";
                yield (((isset($context["autre_intervention"]) || array_key_exists("autre_intervention", $context) ? $context["autre_intervention"] : (function () { throw new RuntimeError('Variable "autre_intervention" does not exist.', 45, $this->source); })())) ? ("") : ("Type intervention: "));
                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["intervention"], "planning", [], "any", false, false, false, 45), "getTypePlanificationInit", [], "any", false, false, false, 45), "code", [], "any", false, false, false, 45) . (isset($context["type_intervention_2"]) || array_key_exists("type_intervention_2", $context) ? $context["type_intervention_2"] : (function () { throw new RuntimeError('Variable "type_intervention_2" does not exist.', 45, $this->source); })())), "html", null, true);
                yield "
                                </div>
                            </div>
                            <div class=\"flex-grow-1 d-flex ms-auto justify-content-end\" style=\"padding-top: 3px;\">
                                ";
                // line 49
                $context["type_validation_effective"] = ((CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "typeValidationTechnique", [], "any", false, false, false, 49)) ?: (CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "typePreValidationTechnique", [], "any", false, false, false, 49)));
                // line 50
                yield "                                ";
                if (((((0 === CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 50, $this->source); })()), "adm")) && CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "getDateValidationAdm", [], "any", false, false, false, 50)) || ((0 === CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 50, $this->source); })()), "technique")) && CoreExtension::getAttribute($this->env, $this->source, $context["intervention"], "getDateValidationTechnique", [], "any", false, false, false, 50))) || (isset($context["autre_intervention"]) || array_key_exists("autre_intervention", $context) ? $context["autre_intervention"] : (function () { throw new RuntimeError('Variable "autre_intervention" does not exist.', 50, $this->source); })()))) {
                    // line 51
                    yield "                                    <img src=\"";
                    yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/picto-intervention-valide.png"), "html", null, true);
                    yield "\" width=\"24\" height=\"24\">
                                ";
                } else {
                    // line 53
                    yield "                                    ";
                    if ((0 === CoreExtension::compare((isset($context["type"]) || array_key_exists("type", $context) ? $context["type"] : (function () { throw new RuntimeError('Variable "type" does not exist.', 53, $this->source); })()), "technique"))) {
                        // line 54
                        yield "                                        ";
                        if (((isset($context["type_validation_effective"]) || array_key_exists("type_validation_effective", $context) ? $context["type_validation_effective"] : (function () { throw new RuntimeError('Variable "type_validation_effective" does not exist.', 54, $this->source); })()) && CoreExtension::inFilter("Sensibilisation", (((CoreExtension::getAttribute($this->env, $this->source, ($context["type_validation_effective"] ?? null), "libelleTechnique", [], "any", true, true, false, 54) &&  !(null === CoreExtension::getAttribute($this->env, $this->source, ($context["type_validation_effective"] ?? null), "libelleTechnique", [], "any", false, false, false, 54)))) ? (CoreExtension::getAttribute($this->env, $this->source, ($context["type_validation_effective"] ?? null), "libelleTechnique", [], "any", false, false, false, 54)) : ((((CoreExtension::getAttribute($this->env, $this->source, ($context["type_validation_effective"] ?? null), "libelle", [], "any", true, true, false, 54) &&  !(null === CoreExtension::getAttribute($this->env, $this->source, ($context["type_validation_effective"] ?? null), "libelle", [], "any", false, false, false, 54)))) ? (CoreExtension::getAttribute($this->env, $this->source, ($context["type_validation_effective"] ?? null), "libelle", [], "any", false, false, false, 54)) : (""))))))) {
                            // line 55
                            yield "                                            <img src=\"";
                            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/picto-intervention-sensibilisation.png"), "html", null, true);
                            yield "\" width=\"24\" height=\"24\">
                                        ";
                        } else {
                            // line 57
                            yield "                                            <img src=\"";
                            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/picto-intervention-warning.png"), "html", null, true);
                            yield "\" width=\"24\" height=\"24\">
                                        ";
                        }
                        // line 59
                        yield "                                    ";
                    } else {
                        // line 60
                        yield "                                        <img src=\"";
                        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Symfony\Bridge\Twig\Extension\AssetExtension']->getAssetUrl("build/images/picto-intervention-warning.png"), "html", null, true);
                        yield "\" width=\"24\" height=\"24\">
                                    ";
                    }
                    // line 62
                    yield "                                ";
                }
                // line 63
                yield "                            </div>
                        </div>
                    </li>
                    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['intervention'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 67
            yield "                </ul>
            </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['date'], $context['intervention_date'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 72
        yield "</div>

<script>
\$(document).ready(function() {
    // Gestion du clic sur le bouton \"Dates antérieures\"
    \$('#bouton_date_validation').on('click', function(e) {
        e.preventDefault();
        const inputDateElement = document.getElementById('a_partir_du');
        
        // Récupérer la date par défaut depuis l'attribut data
        const defaultDate = inputDateElement.getAttribute('data-default-date');
        
        // Si on a une date par défaut, la définir temporairement pour l'ouverture du calendrier
        if (defaultDate) {
            inputDateElement.value = defaultDate;
        }
        
        // Ouvrir le calendrier
        inputDateElement.showPicker();
        
        // Remettre la valeur vide après l'ouverture (optionnel)
        // setTimeout(() => { inputDateElement.value = ''; }, 100);
    });
    \$('#a_partir_du').on('change',function(e) {
        if (\$('#a_partir_du').val() != '') {
            \$('#validation-form-search').submit();
        }
    });

    // Gestion personnalisée des accordéons
    \$('.accordion-button').on('click', function(e) {
        e.preventDefault();
        const target = \$(this).data('target');
        const collapse = \$(target);
        
        if (collapse.hasClass('show')) {
            // Fermer cet accordéon
            collapse.removeClass('show');
            \$(this).addClass('collapsed');
            \$(this).attr('aria-expanded', 'false');
        } else {
            // Ouvrir cet accordéon
            collapse.addClass('show');
            \$(this).removeClass('collapsed');
            \$(this).attr('aria-expanded', 'true');
        }
    });
});
</script>";
        
        $__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e->leave($__internal_085b0142806202599c7fe3b329164a92397d8978207a37e79d70b8c52599e33e_prof);

        
        $__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02->leave($__internal_319393461309892924ff6e74d6d6e64287df64b63545b994e100d4ab223aed02_prof);

        return; yield '';
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo()
    {
        return array (  259 => 72,  241 => 67,  232 => 63,  229 => 62,  223 => 60,  220 => 59,  214 => 57,  208 => 55,  205 => 54,  202 => 53,  196 => 51,  193 => 50,  191 => 49,  182 => 45,  180 => 44,  177 => 43,  174 => 42,  168 => 40,  166 => 39,  162 => 38,  157 => 37,  155 => 36,  148 => 32,  144 => 31,  135 => 28,  132 => 27,  129 => 26,  125 => 25,  115 => 22,  108 => 19,  102 => 17,  96 => 15,  94 => 14,  84 => 13,  80 => 12,  77 => 11,  60 => 10,  50 => 5,  44 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("
<div class=\"mb-1 ps-1 position-relative\">
    <div class=\"input-group form-group pb-2 d-flex w-auto me-4\" style=\"visibility: hidden; position: absolute !important; opacity: 0 !important; pointer-events: none !important;\">
        <label class=\"white me-2 control-label align-self-center\">A partir du</label>
        <input type=\"date\" name=\"a_partir_du\" id=\"a_partir_du\" class=\"form-control bg-grey \" value=\"\" min=\"{{ firstInterventionDate ? firstInterventionDate : '' }}\"  form=\"validation-form-search\" data-default-date=\"{{ firstDate ? firstDate : '' }}\">
    </div>
    <button class=\"btn bg-orange-inverse w-100 border-orange\" id=\"bouton_date_validation\"><i class=\"fa fa-calendar me-1\"></i>Dates antérieures</button>
</div>
<div class=\"accordion\" id=\"dateAccordion\">
    {%  for date, intervention_date in interventions %}
    <div class=\"accordion-item ps-1\">
        <h2 class=\"accordion-header\" id=\"heading{{ loop.index }}\">
            <button class=\"accordion-button bg-primary color-white ps-2 {{ (loop.index != 1 and not intervention_date['warning'] is defined) ? 'collapsed' : '' }}\" type=\"button\" data-target=\"#collapse{{ loop.index }}\" aria-expanded=\"{{ (loop.index != 1 and not intervention_date['warning'] is defined) ? 'false': 'true' }}\" aria-controls=\"collapse{{ loop.index }}\">
                {% if intervention_date['warning'] is defined %}
                    <img src=\"{{ asset('build/images/picto-intervention-warning.png') }}\" width=\"24\" height=\"24\" class=\"me-2\">
                {% else %}
                    <img src=\"{{ asset('build/images/picto-intervention-valide.png') }}\" width=\"24\" height=\"24\" class=\"me-2\">
                {% endif %}
                {{ date|format_datetime(locale='fr', pattern='eeee dd/MM/YYYY')|capitalize }}
            </button>
        </h2>
        <div id=\"collapse{{ loop.index }}\" class=\"accordion-collapse collapse {{ (loop.index == 1 or intervention_date['warning'] is defined) ? 'show' : '' }} bg-grey\" aria-labelledby=\"heading{{ loop.index }}\">
            <div class=\"accordion-body pe-0 ps-0\">
                <ul class=\"list-group\">
                    {% for intervention in intervention_date['interventions'] %}
                    {% set equipement = intervention.equipement %}
                    {% set autre_intervention = (intervention.planning.getTypePlanificationInit.getCategoriePlanification.libelle  not in ['Client', 'Interne'])  %}
                    <li class=\"list-group-item pe-1 color-primary {{ autre_intervention ?  '' : 'show_validation' }}\" data-href=\"{{ path('get_intervention_validation', {'id': intervention.id, 'type': type}) }}\" style=\"margin-bottom: 0.1rem !important;\">
                        <div class=\"d-flex\">
                            <div class=\"d-flex flex-column align-items-center justify-content-center color-vert mt-2\">
                                <div class=\"fw-600\">{{ intervention.planning.getHeureDebut|date('h:i') }}</div>
                                <div class=\"fw-600\">{{ intervention.planning.getHeureFin|date('h:i') }}</div>
                            </div>
                            <div class=\"bg-primary mx-2\" style=\"width:1px;margin-top: 0.5rem;\"></div>
                            <div class=\"d-flex flex-column justify-content-center pt-2\">
                                {% if equipement and  not autre_intervention %}
                                    <div class=\"\">N°intervention : {{ intervention.id }}</div>
                                    <div class=\"\">Souscripteur: {{ equipement.getClientSouscripteur }}</div>
                                    {% if equipement.getClientUtilisateur %}
                                        <div class=\"\">Utilisateur: {{ equipement.getClientUtilisateur }}</div>
                                    {% endif %}
                                {% endif %}
                                <div class=\"\">
                                    {% set type_intervention_2 = intervention.planning.getTypePlanificationInit != intervention.getTypePlanification ? ' -> ' ~ intervention.getTypePlanification.code  %}
                                    {{ autre_intervention ? '' : 'Type intervention: ' }}{{ intervention.planning.getTypePlanificationInit.code ~ type_intervention_2 }}
                                </div>
                            </div>
                            <div class=\"flex-grow-1 d-flex ms-auto justify-content-end\" style=\"padding-top: 3px;\">
                                {% set type_validation_effective = intervention.typeValidationTechnique ?: intervention.typePreValidationTechnique %}
                                {% if (type == 'adm' and intervention.getDateValidationAdm) or (type == 'technique' and intervention.getDateValidationTechnique) or autre_intervention %}
                                    <img src=\"{{ asset('build/images/picto-intervention-valide.png') }}\" width=\"24\" height=\"24\">
                                {% else %}
                                    {% if type == 'technique' %}
                                        {% if type_validation_effective and 'Sensibilisation' in (type_validation_effective.libelleTechnique ?? type_validation_effective.libelle ?? '') %}
                                            <img src=\"{{ asset('build/images/picto-intervention-sensibilisation.png') }}\" width=\"24\" height=\"24\">
                                        {% else %}
                                            <img src=\"{{ asset('build/images/picto-intervention-warning.png') }}\" width=\"24\" height=\"24\">
                                        {% endif %}
                                    {% else %}
                                        <img src=\"{{ asset('build/images/picto-intervention-warning.png') }}\" width=\"24\" height=\"24\">
                                    {% endif %}
                                {% endif %}
                            </div>
                        </div>
                    </li>
                    {% endfor %}
                </ul>
            </div>
        </div>
    </div>
    {% endfor %}
</div>

<script>
\$(document).ready(function() {
    // Gestion du clic sur le bouton \"Dates antérieures\"
    \$('#bouton_date_validation').on('click', function(e) {
        e.preventDefault();
        const inputDateElement = document.getElementById('a_partir_du');
        
        // Récupérer la date par défaut depuis l'attribut data
        const defaultDate = inputDateElement.getAttribute('data-default-date');
        
        // Si on a une date par défaut, la définir temporairement pour l'ouverture du calendrier
        if (defaultDate) {
            inputDateElement.value = defaultDate;
        }
        
        // Ouvrir le calendrier
        inputDateElement.showPicker();
        
        // Remettre la valeur vide après l'ouverture (optionnel)
        // setTimeout(() => { inputDateElement.value = ''; }, 100);
    });
    \$('#a_partir_du').on('change',function(e) {
        if (\$('#a_partir_du').val() != '') {
            \$('#validation-form-search').submit();
        }
    });

    // Gestion personnalisée des accordéons
    \$('.accordion-button').on('click', function(e) {
        e.preventDefault();
        const target = \$(this).data('target');
        const collapse = \$(target);
        
        if (collapse.hasClass('show')) {
            // Fermer cet accordéon
            collapse.removeClass('show');
            \$(this).addClass('collapsed');
            \$(this).attr('aria-expanded', 'false');
        } else {
            // Ouvrir cet accordéon
            collapse.addClass('show');
            \$(this).removeClass('collapsed');
            \$(this).attr('aria-expanded', 'true');
        }
    });
});
</script>", "intervention/_liste_interventions_a_valider.html.twig", "/builds/dev/refonte_sav/templates/intervention/_liste_interventions_a_valider.html.twig");
    }
}
