<?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;
use Twig\TemplateWrapper;

/* components/search/controls.html.twig */
class __TwigTemplate_0061cafe2612d456300161fd16b3f4e7 extends Template
{
    private Source $source;
    /**
     * @var array<string, Template>
     */
    private array $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 = []): iterable
    {
        $macros = $this->macros;
        // line 32
        yield "
<div class=\"d-inline-flex search-controls\">
   ";
        // line 34
        if ((($context["showmassiveactions"] ?? null) && (($context["count"] ?? null) > 0))) {
            // line 35
            yield "      ";
            $this->extensions['Glpi\Application\View\Extension\PhpExtension']->call("Html::showMassiveActions", [($context["massiveactionparams"] ?? null)]);
            // line 36
            yield "   ";
        }
        // line 37
        yield "
   ";
        // line 38
        if ((($context["may_be_located"] ?? null) && ((($context["count"] ?? null) > 0) || ((($_v0 = (($_v1 = ($context["data"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["search"] ?? null) : null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["as_map"] ?? null) : null) == 1)))) {
            // line 39
            yield "      <label class=\"form-check form-switch btn btn-sm btn-ghost-info me-0 me-sm-1 px-1 mb-0 flex-column-reverse flex-sm-row\"
             data-bs-toggle=\"tooltip\" data-bs-placement=\"bottom\" title=\"";
            // line 40
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Show as map"), "html", null, true);
            yield "\">
         <input type=\"checkbox\" class=\"form-check-input ms-0 me-1 mt-0\" role=\"button\"
                name=\"as_map\" value=\"1\" autocomplete=\"off\"
                onclick=\"toogle(\x27as_map\x27,\x27\x27,\x27\x27,\x27\x27); document.forms[\x27searchform";
            // line 43
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::lower($this->env->getCharset(), ($context["itemtype"] ?? null)), "html", null, true);
            yield "\x27].submit();\"
                ";
            // line 44
            yield ((((($_v2 = (($_v3 = ($context["data"] ?? null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["search"] ?? null) : null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["as_map"] ?? null) : null) == 1)) ? ("checked") : (""));
            yield " />
         <span class=\"form-check-label mb-1 mb-sm-0\">
            <i class=\"ti fa-lg ti-map-2\"></i>
         </span >
      </label>
   ";
        }
        // line 50
        yield "
   ";
        // line 51
        if ((($tmp = ($context["may_be_browsed"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 52
            yield "      <label class=\"form-check form-switch btn btn-sm btn-ghost-info me-0 me-sm-1 px-1 mb-0 flex-column-reverse flex-sm-row\"
             data-bs-toggle=\"tooltip\" data-bs-placement=\"bottom\" title=\"";
            // line 53
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Toggle browse"), "html", null, true);
            yield "\">
         <input type=\"checkbox\" class=\"form-check-input ms-0 me-1 mt-0\" role=\"button\"
                name=\"browse\" value=\"1\" autocomplete=\"off\"
                onclick=\"toogle(\x27browse\x27,\x27\x27,\x27\x27,\x27\x27); document.forms[\x27searchform";
            // line 56
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::lower($this->env->getCharset(), ($context["itemtype"] ?? null)), "html", null, true);
            yield "\x27].submit();\"
                ";
            // line 57
            yield ((((($_v4 = (($_v5 = ($context["data"] ?? null)) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5["search"] ?? null) : null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["browse"] ?? null) : null) == 1)) ? ("checked") : (""));
            yield " />
         <span class=\"form-check-label mb-1 mb-sm-0\">
            <i class=\"ti fa-lg ti-subtask\"></i>
         </span>
      </label>
   ";
        }
        // line 63
        yield "
   ";
        // line 64
        if ((($tmp = ($context["may_be_deleted"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 65
            yield "      <label class=\"form-check form-switch btn btn-sm btn-ghost-danger me-0 me-sm-1 px-1 mb-0 flex-column-reverse flex-sm-row\"
             data-bs-toggle=\"tooltip\" data-bs-placement=\"bottom\" title=\"";
            // line 66
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Show the trashbin"), "html", null, true);
            yield "\">
         <input type=\"checkbox\" class=\"form-check-input ms-0 me-1 mt-0\" role=\"button\"
                name=\"is_deleted\" value=\"1\" autocomplete=\"off\"
                onclick=\"toogle(\x27is_deleted\x27,\x27\x27,\x27\x27,\x27\x27); document.forms[\x27searchform";
            // line 69
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(Twig\Extension\CoreExtension::lower($this->env->getCharset(), ($context["itemtype"] ?? null)), "html", null, true);
            yield "\x27].submit();\"
                ";
            // line 70
            yield ((((($_v6 = (($_v7 = ($context["data"] ?? null)) && is_array($_v7) || $_v7 instanceof ArrayAccess ? ($_v7["search"] ?? null) : null)) && is_array($_v6) || $_v6 instanceof ArrayAccess ? ($_v6["is_deleted"] ?? null) : null) == 1)) ? ("checked") : (""));
            yield " />
         <span class=\"form-check-label mb-1 mb-sm-0\">
            <i class=\"ti fa-lg ti-trash\"></i>
         </span>
      </label>
   ";
        }
        // line 76
        yield "
   <label class=\"form-check form-switch btn btn-sm btn-ghost-secondary me-0 me-sm-1 px-1 mb-0 flex-column-reverse flex-sm-row\"
          data-bs-toggle=\"tooltip\" data-bs-placement=\"bottom\" data-bs-trigger=\"hover\"
          title=\"";
        // line 79
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Toggle search filters"), "html", null, true);
        yield "\">
      <input type=\"checkbox\" class=\"form-check-input ms-0 me-1 mt-0 fold-search\" role=\"button\"
             ";
        // line 81
        yield (((($tmp = $this->extensions['Glpi\Application\View\Extension\SessionExtension']->session("glpifold_search")) && $tmp instanceof Markup ? (string) $tmp : $tmp)) ? ("") : ("checked"));
        yield " autocomplete=\"off\" />
      <span class=\"form-check-label mb-1 mb-sm-0\">
         <i class=\"ti fa-lg ti-search\"></i>
      </span>
   </label>

   <div class=\"d-inline-flex\" role=\"group\">

      ";
        // line 89
        if ((($context["can_config"] ?? null) && (($context["count"] ?? null) > 0))) {
            // line 90
            yield "      <button class=\"btn btn-sm btn-icon btn-ghost-secondary show_displaypreference_modal me-0 me-sm-1\"
             title=\"";
            // line 91
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Select default items to show"), "html", null, true);
            yield "\" data-bs-toggle=\"tooltip\" data-bs-placement=\"bottom\">
         <i class=\"ti fa-lg ti-tool\"></i>
      </button>
      ";
        }
        // line 95
        yield "
      ";
        // line 96
        if ((($context["count"] ?? null) > 0)) {
            // line 97
            yield "         <button class=\"dropdown-toggle btn btn-sm btn-icon btn-ghost-secondary\" type=\"button\" id=\"dropdown-export\"
               data-bs-toggle=\"dropdown\" aria-expanded=\"false\" >
            <span class=\"py-1 px-2 my-n1 mx-n2\"data-bs-toggle=\"tooltip\" data-bs-placement=\"bottom\" title=\"";
            // line 99
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(_x("button", "Export"), "html", null, true);
            yield "\">
               <i id=\"export_dropdown_icon\" class=\"ti fa-lg ti-file-download\"></i>
            </span>
         </button>
      ";
            // line 103
            $context["exporthref"] = (((($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path("/front/report.dynamic.php") . "?") . Twig\Extension\CoreExtension::urlencode(["item_type" =>             // line 104
($context["itemtype"] ?? null), "sort" =>             // line 105
($context["sort"] ?? null), "order" =>             // line 106
($context["order"] ?? null), "start" =>             // line 107
($context["start"] ?? null)])) . "&") .             // line 108
($context["posthref"] ?? null));
            // line 109
            yield "      <ul class=\"dropdown-menu\" aria-labelledby=\"dropdown-export\">
         <li><a class=\"dropdown-item\" href=\"";
            // line 110
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=") . Twig\Extension\CoreExtension::constant("Search::PDF_OUTPUT_LANDSCAPE")), "html", null, true);
            yield "\">
            <i class=\"far fa-lg fa-file-pdf\"></i>
            ";
            // line 112
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Current page in landscape PDF"), "html", null, true);
            yield "
         </a></li>
         <li><a class=\"dropdown-item\" href=\"";
            // line 114
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=") . Twig\Extension\CoreExtension::constant("Search::PDF_OUTPUT_PORTRAIT")), "html", null, true);
            yield "\">
            <i class=\"far fa-lg fa-file-pdf\"></i>
            ";
            // line 116
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Current page in portrait PDF"), "html", null, true);
            yield "
         </a></li>
         <li><a class=\"dropdown-item\" href=\"";
            // line 118
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=") . Twig\Extension\CoreExtension::constant("Search::SYLK_OUTPUT")), "html", null, true);
            yield "\">
            <i class=\"far fa-lg fa-file-excel\"></i>
            ";
            // line 120
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Current page in SLK"), "html", null, true);
            yield "
         </a></li>
         <li><a class=\"dropdown-item\" href=\"";
            // line 122
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=") . Twig\Extension\CoreExtension::constant("Search::CSV_OUTPUT")), "html", null, true);
            yield "\">
            <i class=\"fas fa-lg fa-file-csv\"></i>
            ";
            // line 124
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Current page in CSV"), "html", null, true);
            yield "
         </a></li>
         <li><a class=\"dropdown-item\" href=\"";
            // line 126
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=-") . Twig\Extension\CoreExtension::constant("Search::PDF_OUTPUT_LANDSCAPE")), "html", null, true);
            yield "\">
            <i class=\"far fa-lg fa-file-pdf\"></i>
            ";
            // line 128
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("All pages in landscape PDF"), "html", null, true);
            yield "
         </a></li>
         <li><a class=\"dropdown-item\" href=\"";
            // line 130
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=-") . Twig\Extension\CoreExtension::constant("Search::PDF_OUTPUT_PORTRAIT")), "html", null, true);
            yield "\">
            <i class=\"far fa-lg fa-file-pdf\"></i>
            ";
            // line 132
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("All pages in portrait PDF"), "html", null, true);
            yield "
         </a></li>
         <li><a class=\"dropdown-item\" href=\"";
            // line 134
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=-") . Twig\Extension\CoreExtension::constant("Search::SYLK_OUTPUT")), "html", null, true);
            yield "\">
            <i class=\"far fa-lg fa-file-excel\"></i>
            ";
            // line 136
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("All pages in SLK"), "html", null, true);
            yield "
         </a></li>
         <li><a class=\"dropdown-item\" href=\"";
            // line 138
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=-") . Twig\Extension\CoreExtension::constant("Search::CSV_OUTPUT")), "html", null, true);
            yield "\">
            <i class=\"fas fa-lg fa-file-csv\"></i>
            ";
            // line 140
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("All pages in CSV"), "html", null, true);
            yield "
         </a></li>
         ";
            // line 142
            if ((($context["itemtype"] ?? null) != "Stat")) {
                // line 143
                yield "         <li id=\"copy_names_to_clipboard\"><a class=\"dropdown-item\" href=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(((($context["exporthref"] ?? null) . "&display_type=-") . Twig\Extension\CoreExtension::constant("Search::NAMES_OUTPUT")), "html", null, true);
                yield "\">
            <i class=\"far fa-lg fa-copy\"></i>
            ";
                // line 145
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Copy names to clipboard"), "html", null, true);
                yield "
         </a></li>
         ";
            }
            // line 148
            yield "      </ul>
      ";
        }
        // line 150
        yield "   </div>
</div>

<script type=\"text/javascript\">
\$(document).ready(function() {
   \$(\x27.show_displaypreference_modal\x27).click(function(e) {
      e.preventDefault();

      var modal = \x27<div class=\"modal fade\" id=\"displayprefence_modal";
        // line 158
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\" role=\"dialog\">\x27;
      modal += \x27<div class=\"modal-dialog modal-lg\">\x27;
      modal += \x27<div class=\"modal-content\">\x27;
      modal += \x27<div class=\"modal-header\">\x27;
      modal += \x27<h4 class=\"modal-title\">";
        // line 162
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Select default items to show"), "html", null, true);
        yield "</h4>\x27;
      modal += \x27<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"";
        // line 163
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("Close modal"), "html", null, true);
        yield "\"></button>\x27;
      modal += \x27</div>\x27;
      modal += \x27<div class=\"modal-body\">\x27;
      modal += \x27<div class=\"ratio ratio-4x3\">\x27;
      modal += \x27<iframe src=\"";
        // line 167
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path(("front/displaypreference.form.php?itemtype=" . $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["itemtype"] ?? null), "url"))), "html", null, true);
        yield "\"></iframe>\x27
      modal += \x27</div>\x27;
      modal += \x27</div>\x27;
      modal += \x27</div>\x27;
      modal += \x27</div>\x27;

      // remove old modal
      \$(\x27#displayprefence_modal";
        // line 174
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).remove();

      // create new one
      \$(\x27body\x27).append(modal);
      \$(\x27#displayprefence_modal";
        // line 178
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27).modal(\x27show\x27);
   });

   \$(\"body\").on(\x27hide.bs.modal\x27, \x27#displayprefence_modal";
        // line 181
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["rand"] ?? null), "html", null, true);
        yield "\x27, function() {
      location.reload();
   });

   \$(\x27.fold-search\x27).change(function(event) {
      var show_search = \$(this).is(\":checked\");

      // hide tooltips (issue maybe ?)
      \$(\x27[data-toggle=\"tooltip\"]\x27).tooltip(\x27hide\x27);

      event.preventDefault();
      \$.ajax({
         url: \x27";
        // line 193
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path("/ajax/search.php"), "html", null, true);
        yield "\x27,
         type: \x27POST\x27,
         datatype: \x27json\x27,
         data: {
            \x27action\x27: \x27fold_search\x27,
            \x27show_search\x27: (show_search ? 1 : 0),
         },
         success: function() {
            toggle_fold_search(show_search);

            // scroll to top to display the change
            if (show_search) {
               \$(\"html, body, .search-container\").animate({ scrollTop: 0 });
            }
         }
      });
   });

   // Callbacks for copy success/failure
   function copy_success() {
      glpi_toast_info(__(\x27Results copied to clipboard\x27));
      \$(\x27#export_dropdown_icon\x27).removeClass(\x27fa-circle-notch\x27);
      \$(\x27#export_dropdown_icon\x27).removeClass(\x27fa-spin\x27);
      \$(\x27#export_dropdown_icon\x27).addClass(\x27fa-file-download\x27);
      \$(\x27#export_dropdown_icon\x27).parent().parent().addClass(\x27dropdown-toggle\x27);
   }
   function copy_error() {
      glpi_toast_error(__(\x27Unexpected error\x27));
      \$(\x27#export_dropdown_icon\x27).removeClass(\x27fa-circle-notch\x27);
      \$(\x27#export_dropdown_icon\x27).removeClass(\x27fa-spin\x27);
      \$(\x27#export_dropdown_icon\x27).addClass(\x27fa-file-download\x27);
      \$(\x27#export_dropdown_icon\x27).parent().parent().addClass(\x27dropdown-toggle\x27);
   }

   \$(\x27#copy_names_to_clipboard\x27).click(function(e) {
      // Get target link
      var link = \$(this).find(\x27a\x27).prop(\x27href\x27);

      // Show loading indicator
      \$(\x27#export_dropdown_icon\x27).removeClass(\x27fa-file-download\x27);
      \$(\x27#export_dropdown_icon\x27).addClass(\x27fa-circle-notch\x27);
      \$(\x27#export_dropdown_icon\x27).addClass(\x27fa-spin\x27);
      \$(\x27#export_dropdown_icon\x27).parent().parent().removeClass(\x27dropdown-toggle\x27);

      // Prevent link from working
      e.preventDefault();

      // Get data using ajax
      \$.get(link, function (data) {
         navigator.clipboard.writeText(data).then(copy_success, copy_error);
      }).fail(copy_error);
   });
});
</script>
";
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "components/search/controls.html.twig";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  358 => 193,  343 => 181,  337 => 178,  330 => 174,  320 => 167,  313 => 163,  309 => 162,  302 => 158,  292 => 150,  288 => 148,  282 => 145,  276 => 143,  274 => 142,  269 => 140,  264 => 138,  259 => 136,  254 => 134,  249 => 132,  244 => 130,  239 => 128,  234 => 126,  229 => 124,  224 => 122,  219 => 120,  214 => 118,  209 => 116,  204 => 114,  199 => 112,  194 => 110,  191 => 109,  189 => 108,  188 => 107,  187 => 106,  186 => 105,  185 => 104,  184 => 103,  177 => 99,  173 => 97,  171 => 96,  168 => 95,  161 => 91,  158 => 90,  156 => 89,  145 => 81,  140 => 79,  135 => 76,  126 => 70,  122 => 69,  116 => 66,  113 => 65,  111 => 64,  108 => 63,  99 => 57,  95 => 56,  89 => 53,  86 => 52,  84 => 51,  81 => 50,  72 => 44,  68 => 43,  62 => 40,  59 => 39,  57 => 38,  54 => 37,  51 => 36,  48 => 35,  46 => 34,  42 => 32,);
    }

    public function getSourceContext(): Source
    {
        return new Source("", "components/search/controls.html.twig", "C:\\xampp\\htdocs\\itsm\\templates\\components\\search\\controls.html.twig");
    }
}
