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

/* AkeneoPimEnrichmentBundle:CategoryTree:form.html.twig */
class __TwigTemplate_5d73fb633809ba304fd5d04b7831a368a59b84529cc4f02dc81b59cbf0c1d7fc 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
        ob_start(function () { return ''; });
        // line 2
        $context["elements"] = $this->loadTemplate("PimUIBundle:Default:page_elements.html.twig", "AkeneoPimEnrichmentBundle:CategoryTree:form.html.twig", 2)->unwrap();
        // line 3
        echo "
";
        // line 4
        $context["parentId"] = (($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "parent", [])) ? ($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "parent", []), "id", [])) : (null));
        // line 5
        echo "
";
        // line 6
        $context["entityName"] = ((($context["parentId"] ?? null)) ? ("category") : ("tree"));
        // line 7
        echo "
";
        // line 8
        if ($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id", [])) {
            // line 9
            echo "    ";
            $context["title"] = (($this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans((($context["entityName"] ?? null) . ".edit")) . " - ") . $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "label", []));
        } else {
            // line 11
            echo "    ";
            $context["title"] = $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans((($context["entityName"] ?? null) . ".create"));
        }
        echo trim(preg_replace('/>\s+</', '><', ob_get_clean()));
        // line 14
        echo "

";
        // line 16
        echo         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_start', ["action" => (($this->getAttribute($this->getAttribute($this->getAttribute(        // line 17
($context["form"] ?? null), "vars", []), "value", []), "id", [])) ? ($this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath((        // line 18
($context["route"] ?? null) . "_categorytree_edit"), ["id" => $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id", [])])) : ($this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath((        // line 19
($context["route"] ?? null) . "_categorytree_create"), ["parent" => ($context["parentId"] ?? null)]))), "attr" => ["data-updated-title" => $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("confirmation.leave"), "data-updated-message" => $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("confirmation.discard changes", ["%entity%" => $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans((        // line 22
($context["entityName"] ?? null) . ".title"))])]]);
        // line 24
        echo "

    ";
        // line 26
        ob_start(function () { return ''; });
        // line 27
        echo "        ";
        if (($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id", []) && $this->env->getExtension('Oro\Bundle\SecurityBundle\Twig\OroSecurityExtension')->checkResourceIsGranted((($context["acl"] ?? null) . "_category_remove")))) {
            // line 28
            echo "            <div class=\"AknSecondaryActions AknDropdown AknButtonList-item secondary-actions\">
              <div class=\"AknSecondaryActions-button dropdown-button\" data-toggle=\"dropdown\"></div>
              <div class=\"AknDropdown-menu AknDropdown-menu--right\">
                  <div class=\"AknDropdown-menuTitle\">";
            // line 31
            echo twig_escape_filter($this->env, $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("other_actions"), "html", null, true);
            echo "</div>
                      ";
            // line 32
            if ($this->env->getExtension('Akeneo\Pim\Enrichment\Bundle\Twig\CategoryExtension')->exceedsProductsLimitForRemoval($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), true, ($context["related_entity"] ?? null))) {
                // line 33
                echo "                          ";
                echo $context["elements"]->getlink("pim_common.delete", null, ["icon" => "trash", "title" => "pim_common.delete", "class" => "AknDropdown-menuLink delete", "attr" => ["data-title" => $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("confirmation.delete"), "data-dialog" => "alert", "data-message" => $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("info.category.products limit exceeded", ["%limit%" => _twig_default_filter($this->env->getExtension('Akeneo\Pim\Enrichment\Bundle\Twig\CategoryExtension')->getProductsLimitForRemoval(), "0")])]]);
                // line 46
                echo "
                      ";
            } else {
                // line 48
                echo "                          ";
                echo $context["elements"]->getdeleteLink($this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath((                // line 49
($context["route"] ?? null) . "_categorytree_remove"), ["id" => $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id", [])]), (                // line 50
($context["acl"] ?? null) . "_category_remove"), (($this->getAttribute($this->getAttribute($this->getAttribute(                // line 51
($context["form"] ?? null), "vars", []), "value", []), "parent", [])) ? ($this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath((($context["route"] ?? null) . "_categorytree_edit"), ["id" => $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "parent", []), "id", [])])) : ($this->env->getExtension('Symfony\Bridge\Twig\Extension\RoutingExtension')->getPath((($context["route"] ?? null) . "_categorytree_create")))), (((($this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("confirmation.remove.category", ["%name%" => $this->getAttribute($this->getAttribute($this->getAttribute(                // line 52
($context["form"] ?? null), "vars", []), "value", []), "label", [])]) . " ") . $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("info.category.remove children")) . " ") . $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans("info.category.keep products")), $this->env->getExtension('Symfony\Bridge\Twig\Extension\TranslationExtension')->trans((($this->getAttribute($this->getAttribute($this->getAttribute(                // line 55
($context["form"] ?? null), "vars", []), "value", []), "parent", [])) ? ("flash.category.removed") : ("flash.tree.removed"))), "", "AknDropdown-menuLink delete", "", "tree.remove.error_linked");
                // line 60
                echo "
                      ";
            }
            // line 62
            echo "                  </div>
            </div>
        ";
        }
        // line 65
        echo "        ";
        echo $context["elements"]->getsubmitBtn("", "ok", "AknButtonList-item");
        echo "
    ";
        $context["buttons"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 67
        echo "
    ";
        // line 68
        echo $context["elements"]->getpage_header(["title" =>         // line 70
($context["title"] ?? null), "buttons" =>         // line 71
($context["buttons"] ?? null), "state" =>         // line 72
$context["elements"]->getupdated($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "id", []))]);
        // line 74
        echo "

    ";
        // line 77
        echo "    <div id=\"category-tree-container\" style=\"display:flex; height:100%\">
        <div class=\"ui-resizable-container\">
          <div id=\"tree\" ";
        // line 79
        if ($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id", [])) {
            echo " data-node-id=\"";
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "id", []), "html", null, true);
            echo "\"";
        } elseif ($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "parent", [])) {
            echo " data-node-id=\"";
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "parent", []), "id", []), "html", null, true);
            echo "\"";
        }
        if ($this->env->getExtension('Oro\Bundle\SecurityBundle\Twig\OroSecurityExtension')->checkResourceIsGranted((($context["acl"] ?? null) . "_category_edit"))) {
            echo " data-editable=\"true\"";
        }
        if ($this->env->getExtension('Oro\Bundle\SecurityBundle\Twig\OroSecurityExtension')->checkResourceIsGranted((($context["acl"] ?? null) . "_category_create"))) {
            echo " data-creatable=\"true\"";
        }
        echo "></div>
        </div>
        <div class=\"AknTabContainer\" style=\"flex-grow:1; padding: 0 0 0 20px;\">
            ";
        // line 82
        echo $context["elements"]->getform_navbar($this->env->getExtension('Akeneo\Platform\Bundle\UIBundle\Twig\ViewElementExtension')->getViewElementAliases($context, ($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "id", []) . ".form_tab")));
        echo "
            <div class=\"AknTabContainer-content tab-content\">
                ";
        // line 84
        echo $context["elements"]->getform_errors(($context["form"] ?? null));
        echo "
                ";
        // line 85
        echo $this->env->getExtension('Akeneo\Platform\Bundle\UIBundle\Twig\ViewElementExtension')->renderViewElements($context, ($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "id", []) . ".form_tab"));
        echo "
            </div>
        </div>
    </div>

";
        // line 90
        echo         $this->env->getRuntime('Symfony\Component\Form\FormRenderer')->renderBlock(($context["form"] ?? null), 'form_end');
        echo "

<script type=\"text/javascript\" nonce=\"";
        // line 92
        echo twig_escape_filter($this->env, $this->env->getExtension('Akeneo\Platform\Bundle\UIBundle\Twig\ContentSecurityPolicyExtension')->getScriptNonce(), "html", null, true);
        echo "\">
    window.flashMessages = JSON.parse('";
        // line 93
        echo twig_jsonencode_filter($this->getAttribute($this->getAttribute($this->getAttribute(($context["app"] ?? null), "session", []), "flashbag", []), "all", []));
        echo "');

    require(['pim/menu/resizable'], function(Resizable) {
        \$(function() {
            Resizable.set({
                minWidth: 300,
                maxWidth: 500,
                container: '.ui-resizable-container',
                storageKey: 'category-tree-edit'
            })
        });
    });
</script>
";
    }

    public function getTemplateName()
    {
        return "AkeneoPimEnrichmentBundle:CategoryTree:form.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  180 => 93,  176 => 92,  171 => 90,  163 => 85,  159 => 84,  154 => 82,  134 => 79,  130 => 77,  126 => 74,  124 => 72,  123 => 71,  122 => 70,  121 => 68,  118 => 67,  112 => 65,  107 => 62,  103 => 60,  101 => 55,  100 => 52,  99 => 51,  98 => 50,  97 => 49,  95 => 48,  91 => 46,  88 => 33,  86 => 32,  82 => 31,  77 => 28,  74 => 27,  72 => 26,  68 => 24,  66 => 22,  65 => 19,  64 => 18,  63 => 17,  62 => 16,  58 => 14,  53 => 11,  49 => 9,  47 => 8,  44 => 7,  42 => 6,  39 => 5,  37 => 4,  34 => 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("", "AkeneoPimEnrichmentBundle:CategoryTree:form.html.twig", "/var/www/html/vendor/akeneo/pim-community-dev/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/CategoryTree/form.html.twig");
    }
}
