<?php

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

/* PimNotificationBundle:Notification:list.json.twig */
class __TwigTemplate_1da3bba48368d169182bc4307153791f0a3bf4e30413c3524136835c76efe639 extends \Twig\Template
{
    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        $context["notifications"] = [];
        // line 2
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["userNotifications"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["item"]) {
            // line 3
            echo "    ";
            if (($this->getAttribute($this->getAttribute($this->getAttribute($context["item"], "notification", [], "any", false, true), "context", [], "any", false, true), "gridParameters", [], "any", true, true) &&  !(null === $this->getAttribute($this->getAttribute($context["item"], "notification", []), "route", [])))) {
                // line 4
                echo "        ";
                $context["generatedUrl"] = (($this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath($this->getAttribute($this->getAttribute($context["item"], "notification", []), "route", [])) . "|g/") . $this->getAttribute($this->getAttribute($this->getAttribute($context["item"], "notification", []), "context", []), "gridParameters", []));
                // line 5
                echo "    ";
            } elseif ( !(null === $this->getAttribute($this->getAttribute($context["item"], "notification", []), "route", []))) {
                // line 6
                echo "        ";
                $context["generatedUrl"] = $this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath($this->getAttribute($this->getAttribute($context["item"], "notification", []), "route", []), $this->getAttribute($this->getAttribute($context["item"], "notification", []), "routeParams", []));
                // line 7
                echo "    ";
            } else {
                // line 8
                echo "        ";
                $context["generatedUrl"] = null;
                // line 9
                echo "    ";
            }
            // line 10
            echo "
    ";
            // line 11
            $context["sanitizedMessageParams"] = [];
            // line 12
            echo "    ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute($context["item"], "notification", []), "messageParams", []));
            foreach ($context['_seq'] as $context["labelKey"] => $context["value"]) {
                // line 13
                echo "        ";
                $context["sanitizedMessageParams"] = twig_array_merge(($context["sanitizedMessageParams"] ?? null), [("" . $context["labelKey"]) => twig_escape_filter($this->env, $context["value"])]);
                // line 14
                echo "    ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['labelKey'], $context['value'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 15
            echo "
    ";
            // line 16
            $context["notifications"] = twig_array_merge(($context["notifications"] ?? null), [0 => ["id" => $this->getAttribute(            // line 17
$context["item"], "id", []), "type" => $this->getAttribute($this->getAttribute(            // line 18
$context["item"], "notification", []), "type", []), "message" => $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans($this->getAttribute($this->getAttribute(            // line 19
$context["item"], "notification", []), "message", []), ($context["sanitizedMessageParams"] ?? null)), "viewed" => $this->getAttribute(            // line 20
$context["item"], "viewed", []), "url" =>             // line 21
($context["generatedUrl"] ?? null), "createdAt" => twig_date_format_filter($this->env, $this->getAttribute($this->getAttribute(            // line 22
$context["item"], "notification", []), "created", []), "Y-m-d H:i:s", ($context["userTimezone"] ?? null)), "actionType" => (($this->getAttribute($this->getAttribute($this->getAttribute(            // line 23
$context["item"], "notification", []), "context", []), "actionType", [])) ? ($this->getAttribute($this->getAttribute($this->getAttribute($context["item"], "notification", []), "context", []), "actionType", [])) : (null)), "buttonLabel" => (($this->getAttribute($this->getAttribute($this->getAttribute(            // line 24
$context["item"], "notification", [], "any", false, true), "context", [], "any", false, true), "buttonLabel", [], "any", true, true)) ? ($this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans($this->getAttribute($this->getAttribute($this->getAttribute($context["item"], "notification", []), "context", []), "buttonLabel", []))) : ($this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("pim_notification.report"))), "showReportButton" => (($this->getAttribute($this->getAttribute($this->getAttribute(            // line 25
$context["item"], "notification", [], "any", false, true), "context", [], "any", false, true), "showReportButton", [], "any", true, true)) ? ($this->getAttribute($this->getAttribute($this->getAttribute($context["item"], "notification", []), "context", []), "showReportButton", [])) : (true)), "comment" => (($this->getAttribute($this->getAttribute(            // line 26
$context["item"], "notification", []), "comment", [])) ? ($this->getAttribute($this->getAttribute($context["item"], "notification", []), "comment", [])) : (null))]]);
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['item'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 29
        $context["data"] = ["notifications" => ($context["notifications"] ?? null), "unreadCount" => $this->env->getExtension('Akeneo\Platform\Bundle\NotificationBundle\Twig\NotificationExtension')->countNotifications()];
        // line 30
        echo twig_jsonencode_filter(($context["data"] ?? null));
        echo "
";
    }

    public function getTemplateName()
    {
        return "PimNotificationBundle:Notification:list.json.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  97 => 30,  95 => 29,  89 => 26,  88 => 25,  87 => 24,  86 => 23,  85 => 22,  84 => 21,  83 => 20,  82 => 19,  81 => 18,  80 => 17,  79 => 16,  76 => 15,  70 => 14,  67 => 13,  62 => 12,  60 => 11,  57 => 10,  54 => 9,  51 => 8,  48 => 7,  45 => 6,  42 => 5,  39 => 4,  36 => 3,  32 => 2,  30 => 1,);
    }

    /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */
    public function getSource()
    {
        @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED);

        return $this->getSourceContext()->getCode();
    }

    public function getSourceContext()
    {
        return new Source("", "PimNotificationBundle:Notification:list.json.twig", "/var/www/html/vendor/akeneo/pim-community-dev/src/Akeneo/Platform/Bundle/NotificationBundle/Resources/views/Notification/list.json.twig");
    }
}
