<?php

/* @nucleus/layout/container.html.twig */
class __TwigTemplate_373941ecfdc773847901c90a0bdac10c952f45239b5cd74f96d19c9c881733ba extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        $context["attr_id"] = (($this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "id", array())) ? ($this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "id", array())) : (("g-" . $this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "id", array()))));
        // line 2
        $context["boxed"] = $this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "boxed", array());
        // line 3
        if ( !(null === (isset($context["boxed"]) ? $context["boxed"] : null))) {
            // line 4
            echo "    ";
            $context["boxed"] = (((trim((isset($context["boxed"]) ? $context["boxed"] : null)) == "")) ? ($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute($this->getAttribute((isset($context["gantry"]) ? $context["gantry"] : null), "config", array()), "page", array()), "body", array()), "layout", array()), "sections", array())) : ((isset($context["boxed"]) ? $context["boxed"] : null)));
        }
        // line 6
        echo "
";
        // line 7
        ob_start();
        // line 8
        echo "    ";
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable((isset($context["segments"]) ? $context["segments"] : null));
        $context['loop'] = array(
          'parent' => $context['_parent'],
          'index0' => 0,
          'index'  => 1,
          'first'  => true,
        );
        if (is_array($context['_seq']) || (is_object($context['_seq']) && $context['_seq'] instanceof Countable)) {
            $length = count($context['_seq']);
            $context['loop']['revindex0'] = $length - 1;
            $context['loop']['revindex'] = $length;
            $context['loop']['length'] = $length;
            $context['loop']['last'] = 1 === $length;
        }
        foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
            // line 9
            echo "        ";
            $this->loadTemplate((("@nucleus/layout/" . $this->getAttribute($context["segment"], "type", array())) . ".html.twig"), "@nucleus/layout/container.html.twig", 9)->display(array_merge($context, array("segments" => $this->getAttribute($context["segment"], "children", array()))));
            // line 10
            echo "    ";
            ++$context['loop']['index0'];
            ++$context['loop']['index'];
            $context['loop']['first'] = false;
            if (isset($context['loop']['length'])) {
                --$context['loop']['revindex0'];
                --$context['loop']['revindex'];
                $context['loop']['last'] = 0 === $context['loop']['revindex0'];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        $context["html"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
        // line 12
        echo "
";
        // line 13
        if (($this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "sticky", array()) || trim((isset($context["html"]) ? $context["html"] : null)))) {
            // line 14
            echo "    ";
            $context["classes"] = (($this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "class", array())) ? ((" " . twig_escape_filter($this->env, $this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "class", array())))) : (""));
            // line 15
            echo "    ";
            $context["attr_extra"] = "";
            // line 16
            echo "
    ";
            // line 17
            if ($this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "extra", array())) {
                // line 18
                echo "        ";
                $context['_parent'] = $context;
                $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute((isset($context["segment"]) ? $context["segment"] : null), "attributes", array()), "extra", array()));
                foreach ($context['_seq'] as $context["_key"] => $context["attributes"]) {
                    // line 19
                    echo "            ";
                    $context['_parent'] = $context;
                    $context['_seq'] = twig_ensure_traversable($context["attributes"]);
                    foreach ($context['_seq'] as $context["key"] => $context["value"]) {
                        // line 20
                        echo "                ";
                        $context["attr_extra"] = ((((((isset($context["attr_extra"]) ? $context["attr_extra"] : null) . " ") . twig_escape_filter($this->env, $context["key"])) . "=\"") . twig_escape_filter($this->env, $context["value"], "html_attr")) . "\"");
                        // line 21
                        echo "            ";
                    }
                    $_parent = $context['_parent'];
                    unset($context['_seq'], $context['_iterated'], $context['key'], $context['value'], $context['_parent'], $context['loop']);
                    $context = array_intersect_key($context, $_parent) + $_parent;
                    // line 22
                    echo "        ";
                }
                $_parent = $context['_parent'];
                unset($context['_seq'], $context['_iterated'], $context['_key'], $context['attributes'], $context['_parent'], $context['loop']);
                $context = array_intersect_key($context, $_parent) + $_parent;
                // line 23
                echo "    ";
            }
            // line 24
            echo "
    ";
            // line 25
            if (( !(null === (isset($context["boxed"]) ? $context["boxed"] : null)) && (((isset($context["boxed"]) ? $context["boxed"] : null) == 0) || ((isset($context["boxed"]) ? $context["boxed"] : null) == 2)))) {
                // line 26
                echo "        ";
                ob_start();
                // line 27
                echo "        <div class=\"g-container";
                echo ((((isset($context["boxed"]) ? $context["boxed"] : null) == 2)) ? (" g-flushed") : (""));
                echo "\">";
                echo (isset($context["html"]) ? $context["html"] : null);
                echo "</div>
        ";
                $context["html"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
                // line 29
                echo "    ";
            }
            // line 30
            echo "
    ";
            // line 31
            ob_start();
            // line 32
            echo "    <section id=\"";
            echo twig_escape_filter($this->env, (isset($context["attr_id"]) ? $context["attr_id"] : null), "html", null, true);
            echo "\" class=\"g-wrapper";
            echo twig_escape_filter($this->env, (isset($context["classes"]) ? $context["classes"] : null), "html", null, true);
            echo "\"";
            echo (isset($context["attr_extra"]) ? $context["attr_extra"] : null);
            echo ">
        ";
            // line 33
            echo (isset($context["html"]) ? $context["html"] : null);
            echo "
    </section>
    ";
            $context["html"] = ('' === $tmp = ob_get_clean()) ? '' : new Twig_Markup($tmp, $this->env->getCharset());
            // line 36
            echo "
    ";
            // line 37
            if (((isset($context["boxed"]) ? $context["boxed"] : null) == 1)) {
                // line 38
                echo "        <div class=\"g-container\">";
                echo (isset($context["html"]) ? $context["html"] : null);
                echo "</div>
    ";
            } else {
                // line 40
                echo "        ";
                echo (isset($context["html"]) ? $context["html"] : null);
                echo "
    ";
            }
        }
    }

    public function getTemplateName()
    {
        return "@nucleus/layout/container.html.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  164 => 40,  158 => 38,  156 => 37,  153 => 36,  147 => 33,  138 => 32,  136 => 31,  133 => 30,  130 => 29,  122 => 27,  119 => 26,  117 => 25,  114 => 24,  111 => 23,  105 => 22,  99 => 21,  96 => 20,  91 => 19,  86 => 18,  84 => 17,  81 => 16,  78 => 15,  75 => 14,  73 => 13,  70 => 12,  55 => 10,  52 => 9,  34 => 8,  32 => 7,  29 => 6,  25 => 4,  23 => 3,  21 => 2,  19 => 1,);
    }
}
/* {% set attr_id = segment.attributes.id ?: 'g-' ~ segment.id %}*/
/* {% set boxed = segment.attributes.boxed %}*/
/* {% if boxed is not null %}*/
/*     {% set boxed = boxed|trim == '' ? gantry.config.page.body.layout.sections : boxed %}*/
/* {% endif %}*/
/* */
/* {% set html %}*/
/*     {% for segment in segments %}*/
/*         {% include '@nucleus/layout/' ~ segment.type ~ '.html.twig' with { 'segments': segment.children } %}*/
/*     {% endfor %}*/
/* {% endset %}*/
/* */
/* {% if segment.attributes.sticky or html|trim %}*/
/*     {% set classes = segment.attributes.class ? ' ' ~ segment.attributes.class|e %}*/
/*     {% set attr_extra = '' %}*/
/* */
/*     {% if segment.attributes.extra %}*/
/*         {% for attributes in segment.attributes.extra %}*/
/*             {% for key, value in attributes %}*/
/*                 {% set attr_extra = attr_extra ~ ' ' ~ key|e ~ '="' ~ value|e('html_attr') ~ '"' %}*/
/*             {% endfor %}*/
/*         {% endfor %}*/
/*     {% endif %}*/
/* */
/*     {% if boxed is not null and (boxed == 0 or boxed == 2) %}*/
/*         {% set html %}*/
/*         <div class="g-container{{ boxed == 2 ? ' g-flushed' }}">{{ html|raw }}</div>*/
/*         {% endset %}*/
/*     {% endif %}*/
/* */
/*     {% set html %}*/
/*     <section id="{{ attr_id }}" class="g-wrapper{{ classes }}"{{ attr_extra|raw }}>*/
/*         {{ html|raw }}*/
/*     </section>*/
/*     {% endset %}*/
/* */
/*     {% if boxed == 1 %}*/
/*         <div class="g-container">{{ html|raw }}</div>*/
/*     {% else %}*/
/*         {{ html|raw }}*/
/*     {% endif %}*/
/* {% endif %}*/
/* */
