<?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:edit.html.twig */
class __TwigTemplate_2e058964240918df89474603f55bf1f19c33bf4334e4efefbcb5a77518f3b2e3 extends \Twig\Template
{
    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        $this->displayBlock('content', $context, $blocks);
        // line 8
        echo "
<script type=\"text/javascript\" nonce=\"";
        // line 9
        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 10
        echo twig_jsonencode_filter($this->getAttribute($this->getAttribute($this->getAttribute(($context["app"] ?? null), "session", []), "flashbag", []), "all", []));
        echo "');
</script>

<script nonce=\"";
        // line 13
        echo twig_escape_filter($this->env, $this->env->getExtension('Akeneo\Platform\Bundle\UIBundle\Twig\ContentSecurityPolicyExtension')->getScriptNonce(), "html", null, true);
        echo "\">
    require(
        [
            'pim/common/breadcrumbs',
            'pim/fetcher-registry',
            'pim/form-builder',
            'pim/page-title'
        ],
        function(
            Breadcrumbs,
            FetcherRegistry,
            FormBuilder,
            PageTitle
        ) {
            \$(function() {
                var breadcrumbs = new Breadcrumbs({
                    config: {
                        tab: 'pim-menu-settings',
                        item: 'pim-menu-settings-product-category'
                    }
                });
                breadcrumbs.configure().then(function () {
                    breadcrumbs.render();
                    \$('*[data-drop-zone=\"breadcrumbs\"]').append(breadcrumbs.\$el);
                });

                PageTitle.set({ 'category.label': '";
        // line 39
        echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "label", []), "html", null, true);
        echo "' });

                // On the initial page load the routing is completed before we set the PageTitle params so we need to trigger it manually (see PIM-8655).
                ";
        // line 42
        if (twig_test_empty($this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "code", []))) {
            // line 43
            echo "                PageTitle.render('pim_enrich_categorytree_create', { 'category.label': '";
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "label", []), "html", null, true);
            echo "' });
                ";
        } else {
            // line 45
            echo "                PageTitle.render('pim_enrich_categorytree_edit', { 'category.label': '";
            echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute($this->getAttribute(($context["form"] ?? null), "vars", []), "value", []), "label", []), "html", null, true);
            echo "' });
                ";
        }
        // line 47
        echo "
                FetcherRegistry.initialize().done(function () {
                    FormBuilder.build('pim-menu-user-navigation').then(function (form) {
                        \$('.user-menu').append(form.el);
                        form.render();
                    }.bind(this));
                });
            });
        }
    );
</script>
";
    }

    // line 1
    public function block_content($context, array $blocks = [])
    {
        // line 2
        echo "    <div id=\"category-form\" style=\"flex-grow:1\" class=\"AknDefault-mainContent\">
        ";
        // line 3
        $this->loadTemplate("AkeneoPimEnrichmentBundle:CategoryTree:form.html.twig", "AkeneoPimEnrichmentBundle:CategoryTree:edit.html.twig", 3)->display(twig_array_merge($context, ["form" => ($context["form"] ?? null)]));
        // line 4
        echo "    </div>

    ";
        // line 6
        $this->loadTemplate("AkeneoPimEnrichmentBundle:CategoryTree:_scripts.html.twig", "AkeneoPimEnrichmentBundle:CategoryTree:edit.html.twig", 6)->display($context);
    }

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

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  122 => 6,  118 => 4,  116 => 3,  113 => 2,  110 => 1,  95 => 47,  89 => 45,  83 => 43,  81 => 42,  75 => 39,  46 => 13,  40 => 10,  36 => 9,  33 => 8,  31 => 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:edit.html.twig", "/var/www/html/vendor/akeneo/pim-community-dev/src/Akeneo/Pim/Enrichment/Bundle/Resources/views/CategoryTree/edit.html.twig");
    }
}
