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

/* _layouts/components/notifications */
class __TwigTemplate_b7797f71df12c92ec24dd236d3be664c 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 = [
        ];
        $this->sandbox = $this->extensions[SandboxExtension::class];
        $this->checkSecurity();
    }

    protected function doDisplay(array $context, array $blocks = []): iterable
    {
        $macros = $this->macros;
        craft\helpers\Template::beginProfile("template", "_layouts/components/notifications");
        // line 1
        yield "<div id=\"notifications\" role=\"status\">
  <h2 id=\"cp-notification-heading\" class=\"visually-hidden\">";
        // line 2
        yield $this->env->getRuntime('Twig\Runtime\EscaperRuntime')->escape($this->extensions['craft\web\twig\Extension']->translateFilter("Notifications", "app"), "html", null, true);
        yield "</h2>
</div>

";
        // line 5
        $context['_parent'] = $context;
        $context['_seq'] = CoreExtension::ensureTraversable(["notice", "success", "error"]);
        foreach ($context['_seq'] as $context["_key"] => $context["type"]) {
            // line 6
            yield "  ";
            $context["notification"] = craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, craft\helpers\Template::attribute($this->env, $this->source, (isset($context["craft"]) || array_key_exists("craft", $context) ? $context["craft"] : (function () { throw new RuntimeError('Variable "craft" does not exist.', 6, $this->source); })()), "app", [], "any", false, false, true, 6), "session", [], "any", false, false, true, 6), "getFlash", [("cp-notification-" . $this->sandbox->ensureToStringAllowed($context["type"], 6, $this->source))], "method", false, false, true, 6);
            // line 7
            yield "  ";
            if ((isset($context["notification"]) || array_key_exists("notification", $context) ? $context["notification"] : (function () { throw new RuntimeError('Variable "notification" does not exist.', 7, $this->source); })())) {
                // line 8
                yield "    ";
                ob_start();
                // line 9
                yield "      Craft.cp.displayNotification(";
                yield $this->extensions['craft\web\twig\Extension']->jsonEncodeFilter($this->sandbox->ensureToStringAllowed($context["type"], 9, $this->source));
                yield ", ";
                yield $this->extensions['craft\web\twig\Extension']->jsonEncodeFilter($this->sandbox->ensureToStringAllowed(craft\helpers\Template::attribute($this->env, $this->source, (isset($context["notification"]) || array_key_exists("notification", $context) ? $context["notification"] : (function () { throw new RuntimeError('Variable "notification" does not exist.', 9, $this->source); })()), 0, [], "array", false, false, true, 9), 9, $this->source));
                yield ", ";
                yield $this->extensions['craft\web\twig\Extension']->jsonEncodeFilter($this->sandbox->ensureToStringAllowed(craft\helpers\Template::attribute($this->env, $this->source, (isset($context["notification"]) || array_key_exists("notification", $context) ? $context["notification"] : (function () { throw new RuntimeError('Variable "notification" does not exist.', 9, $this->source); })()), 1, [], "array", false, false, true, 9), 9, $this->source));
                yield ");
    ";
                craft\helpers\Template::js(ob_get_clean(), ['position' => 3]);
                // line 11
                yield "  ";
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_key'], $context['type'], $context['_parent']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        craft\helpers\Template::endProfile("template", "_layouts/components/notifications");
        yield from [];
    }

    /**
     * @codeCoverageIgnore
     */
    public function getTemplateName(): string
    {
        return "_layouts/components/notifications";
    }

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

    /**
     * @codeCoverageIgnore
     */
    public function getDebugInfo(): array
    {
        return array (  77 => 11,  67 => 9,  64 => 8,  61 => 7,  58 => 6,  54 => 5,  48 => 2,  45 => 1,);
    }

    public function getSourceContext(): Source
    {
        return new Source("<div id=\"notifications\" role=\"status\">
  <h2 id=\"cp-notification-heading\" class=\"visually-hidden\">{{ 'Notifications'|t('app') }}</h2>
</div>

{% for type in ['notice', 'success', 'error'] %}
  {% set notification = craft.app.session.getFlash(\"cp-notification-#{type}\") %}
  {% if notification %}
    {% js %}
      Craft.cp.displayNotification({{ type|json_encode|raw }}, {{ notification[0]|json_encode|raw }}, {{ notification[1]|json_encode|raw }});
    {% endjs %}
  {% endif %}
{% endfor %}
", "_layouts/components/notifications", "/Users/nodata/nodata.local/_controlnocontrol/sites/hjhs.ca/www/craft/vendor/craftcms/cms/src/templates/_layouts/components/notifications.twig");
    }
    
    public function checkSecurity()
    {
        static $tags = ["for" => 5, "set" => 6, "if" => 7, "js" => 8];
        static $filters = ["escape" => 2, "t" => 2, "raw" => 9, "json_encode" => 9];
        static $functions = [];

        try {
            $this->sandbox->checkSecurity(
                ['for', 'set', 'if', 'js'],
                ['escape', 't', 'raw', 'json_encode'],
                [],
                $this->source
            );
        } catch (SecurityError $e) {
            $e->setSourceContext($this->source);

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

            throw $e;
        }

    }
}
