<?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/display_data.html.twig */
class __TwigTemplate_b1bbe0e7c170cc7889595a34f747f7ae 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 "
";
        // line 33
        $context["is_ajax"] = (CoreExtension::getAttribute($this->env, $this->source, ($context["data"] ?? null), "searchform_id", [], "array", true, true, false, 33) &&  !(null === (($_v0 = ($context["data"] ?? null)) && is_array($_v0) || $_v0 instanceof ArrayAccess ? ($_v0["searchform_id"] ?? null) : null)));
        // line 34
        $context["fluid_search"] = ((array_key_exists("fluid_search", $context)) ? (Twig\Extension\CoreExtension::default(($context["fluid_search"] ?? null), true)) : (true));
        // line 35
        if ((($tmp =  !($context["is_ajax"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 36
            yield "   <div class=\"ajax-container search-display-data\">
";
        }
        // line 38
        yield "
";
        // line 40
        $context["normalized_itemtype"] = Twig\Extension\CoreExtension::replace(($context["itemtype"] ?? null), ["\\" => ""]);
        // line 41
        yield "
<form id=\"massform";
        // line 42
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["normalized_itemtype"] ?? null), "html", null, true);
        yield "\" method=\"get\" action=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\RoutingExtension']->path("front/massiveaction.php"), "html", null, true);
        yield "\"
      data-search-itemtype=\"";
        // line 43
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape((($_v1 = ($context["data"] ?? null)) && is_array($_v1) || $_v1 instanceof ArrayAccess ? ($_v1["itemtype"] ?? null) : null), "html", null, true);
        yield "\" data-start=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["start"] ?? null), "html", null, true);
        yield "\" data-count=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["count"] ?? null), "html", null, true);
        yield "\" data-limit=\"";
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["limit"] ?? null), "html", null, true);
        yield "\" data-submit-once>
   <div class=\"card card-sm mt-0 search-card\">
      <div class=\"card-header d-flex justify-content-between search-header pe-0\">
         ";
        // line 46
        if (((($_v2 = ($context["data"] ?? null)) && is_array($_v2) || $_v2 instanceof ArrayAccess ? ($_v2["display_type"] ?? null) : null) == Twig\Extension\CoreExtension::constant("Search::GLOBAL_SEARCH"))) {
            // line 47
            yield "            <h2>";
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['Glpi\Application\View\Extension\ItemtypeExtension']->getItemtypeName(($context["itemtype"] ?? null)), "html", null, true);
            yield "</h2>

            ";
            // line 49
            if ((($context["count"] ?? null) > (($context["start"] ?? null) + Twig\Extension\CoreExtension::constant("Search::GLOBAL_DISPLAY_COUNT")))) {
                // line 50
                yield "               <a href=\"";
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["href"] ?? null), "html", null, true);
                yield "\">
                  <i class=\"far fa-eye\"></i>
                  ";
                // line 52
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("View all"), "html", null, true);
                yield "
               </a>
            ";
            }
            // line 55
            yield "         ";
        } else {
            // line 56
            yield "            ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/search/controls.html.twig");
            yield "
         ";
        }
        // line 58
        yield "      </div>

      ";
        // line 60
        if (((($_v3 = (($_v4 = ($context["data"] ?? null)) && is_array($_v4) || $_v4 instanceof ArrayAccess ? ($_v4["search"] ?? null) : null)) && is_array($_v3) || $_v3 instanceof ArrayAccess ? ($_v3["as_map"] ?? null) : null) == 0)) {
            // line 61
            yield "         ";
            yield Twig\Extension\CoreExtension::include($this->env, $context, "components/search/table.html.twig");
            yield "
      ";
        }
        // line 63
        yield "      ";
        if ((($context["count"] ?? null) > 0)) {
            // line 64
            yield "         ";
            if ((((($_v5 = ($context["data"] ?? null)) && is_array($_v5) || $_v5 instanceof ArrayAccess ? ($_v5["display_type"] ?? null) : null) != Twig\Extension\CoreExtension::constant("Search::GLOBAL_SEARCH")) && ((($_v6 = (($_v7 = ($context["data"] ?? null)) && is_array($_v7) || $_v7 instanceof ArrayAccess ? ($_v7["search"] ?? null) : null)) && is_array($_v6) || $_v6 instanceof ArrayAccess ? ($_v6["as_map"] ?? null) : null) == 0))) {
                // line 65
                yield "            <div class=\"card-footer search-footer\">
               ";
                // line 66
                yield Twig\Extension\CoreExtension::include($this->env, $context, "components/pager.html.twig");
                yield "
            </div>
         ";
            }
            // line 69
            yield "      ";
        } elseif (((($_v8 = (($_v9 = ($context["data"] ?? null)) && is_array($_v9) || $_v9 instanceof ArrayAccess ? ($_v9["search"] ?? null) : null)) && is_array($_v8) || $_v8 instanceof ArrayAccess ? ($_v8["as_map"] ?? null) : null) == 1)) {
            // line 70
            yield "         <div class=\"alert alert-info mb-0 rounded-0 border-top-0 border-bottom-0 border-right-0\" role=\"alert\">
            ";
            // line 71
            yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(__("No item found"), "html", null, true);
            yield "
         </div>
      ";
        }
        // line 74
        yield "   </div>
</form>

";
        // line 77
        if ((($tmp =  !($context["is_ajax"] ?? null)) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
            // line 78
            yield "   </div>

   ";
            // line 80
            if (((($_v10 = (($_v11 = ($context["data"] ?? null)) && is_array($_v11) || $_v11 instanceof ArrayAccess ? ($_v11["search"] ?? null) : null)) && is_array($_v10) || $_v10 instanceof ArrayAccess ? ($_v10["as_map"] ?? null) : null) == 0)) {
                // line 81
                yield "      <script>
          if (typeof initFluidSearch !== \"function\") {
             window.initFluidSearch = () => {
                 new GLPI.Search.ResultsView(\"massform";
                // line 84
                yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape(($context["normalized_itemtype"] ?? null), "html", null, true);
                yield "\", GLPI.Search.Table);
             };
          }
          if (document.readyState === \x27complete\x27) {
              initFluidSearch();
          } else {
              \$(document).on(\x27ready\x27, initFluidSearch);
          }
      </script>
   ";
            }
        }
        yield from [];
    }

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

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  169 => 84,  164 => 81,  162 => 80,  158 => 78,  156 => 77,  151 => 74,  145 => 71,  142 => 70,  139 => 69,  133 => 66,  130 => 65,  127 => 64,  124 => 63,  118 => 61,  116 => 60,  112 => 58,  106 => 56,  103 => 55,  97 => 52,  91 => 50,  89 => 49,  83 => 47,  81 => 46,  69 => 43,  63 => 42,  60 => 41,  58 => 40,  55 => 38,  51 => 36,  49 => 35,  47 => 34,  45 => 33,  42 => 32,);
    }

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