<?php

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

/* default/template/extension/module/d_quickcheckout.twig */
class __TwigTemplate_1ed26becadda6c8850ee4e3ee1de9d442dc6fb2be5dd8aeaa1917917e843509c extends \Twig\Template
{
    private $source;
    private $macros = [];

    public function __construct(Environment $env)
    {
        parent::__construct($env);

        $this->source = $this->getSourceContext();

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        $macros = $this->macros;
        // line 1
        echo "<?php
/**
 *  location: catalog/view
 */
?>

<div class=\"qc-spinner\"></div>
<d_quickcheckout id=\"d_quickcheckout\" class=\"qc ";
        // line 8
        if (($context["edit"] ?? null)) {
            echo " edit ";
        }
        echo "\"></d_quickcheckout>


";
        // line 11
        if (($context["edit"] ?? null)) {
            // line 12
            echo "    <style>
        body{
            margin-top: 60px;
        }
        body > #d_quickcheckout{
            display: block;
        }
    </style>
";
        } else {
            // line 21
            echo "    <style>
        ";
            // line 22
            if ((twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["state"] ?? null), "layout", [], "any", false, false, false, 22), "header_footer", [], "any", false, false, false, 22) != 1)) {
                // line 23
                echo "            body > *{
                display: none;
            }
            body > .qc-spinner{
                display: block;
            }
            body > #d_quickcheckout{
                padding: 40px;
                display: block;
            }
        ";
            }
            // line 34
            echo "    </style>
    <style>
    ";
            // line 36
            echo twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["state"] ?? null), "layout", [], "any", false, false, false, 36), "css", [], "any", false, false, false, 36);
            echo "
    </style>
    <script>
        var header_footer = ";
            // line 39
            echo twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["state"] ?? null), "layout", [], "any", false, false, false, 39), "header_footer", [], "any", false, false, false, 39);
            echo "
        if(header_footer != 1){
            \$('body').prepend(\$('.qc-spinner'));
            \$('body').prepend(\$('#d_quickcheckout'));

        }else{
            \$('.qc-spinner').after(\$('#d_quickcheckout'));
        }
    </script>
    <script>
    ";
            // line 49
            echo twig_get_attribute($this->env, $this->source, twig_get_attribute($this->env, $this->source, ($context["state"] ?? null), "layout", [], "any", false, false, false, 49), "js", [], "any", false, false, false, 49);
            echo "
    </script>
";
        }
        // line 52
        echo "
<script>
    var count = 0;
    var total = ";
        // line 55
        echo twig_length_filter($this->env, ($context["riot_tags"] ?? null));
        echo ";
    var d_quickcheckout_store =  d_quickcheckout.createStore(";
        // line 56
        echo json_encode(($context["state"] ?? null));
        echo ");
    
    ";
        // line 58
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["riot_tags"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["riot_tag"]) {
            // line 59
            echo "        riot.compile('";
            echo $context["riot_tag"];
            echo "', function(){
            count++;
            if(total == count){
                start();
            }
        });
    ";
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['riot_tag'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 66
        echo "
    
    function start(){

        riot.compile('catalog/view/theme/default/template/extension/module/d_quickcheckout.tag', function() {

          riot.mount(document.getElementById('d_quickcheckout'));
        })
    }
    
</script>";
    }

    public function getTemplateName()
    {
        return "default/template/extension/module/d_quickcheckout.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  146 => 66,  132 => 59,  128 => 58,  123 => 56,  119 => 55,  114 => 52,  108 => 49,  95 => 39,  89 => 36,  85 => 34,  72 => 23,  70 => 22,  67 => 21,  56 => 12,  54 => 11,  46 => 8,  37 => 1,);
    }

    public function getSourceContext()
    {
        return new Source("", "default/template/extension/module/d_quickcheckout.twig", "");
    }
}
