<?php

/* @websiteWidgets/form_elements/templates/select.twig.html */
class __TwigTemplate_2d058de5f6492336abde91e21dd31a8578285664d083041b5989d257e8d2978b extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = [
        ];
    }

    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        echo "<div data-widget-id=\"";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getWidgetId", [], "method"), "html", null, true);
        echo "\" class=\"moto-widget moto-widget-form_elements-select moto-preset-";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getCurrentPreset", [], "method"), "html", null, true);
        echo " ";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getSpacing", [0 => "classes"], "method"), "html", null, true);
        echo "\" data-widget=\"form_elements.select\">
    ";
        // line 2
        if ((isset($context["isPreview"]) ? $context["isPreview"] : null)) {
            // line 3
            echo "        <div class=\"moto-widget-cover\"></div>
    ";
        }
        // line 5
        echo "    <div class=\"moto-form__element moto-form__element_select\" ng-class=\"{'moto-form__element_invalid' : (\$FORM.\$submitted || \$FORM['";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getFieldName", [], "method"), "html", null, true);
        echo "'].\$touched) && \$FORM['";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getFieldName", [], "method"), "html", null, true);
        echo "'].\$invalid}\">
        <div class=\"moto-form__field\">
            <select class=\"moto-form__field-control moto-form__field-control_select\" name=\"";
        // line 7
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getFieldName", [], "method"), "html", null, true);
        echo "\" ng-change=\"onFieldChanged('";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getFieldName", [], "method"), "html", null, true);
        echo "')\" ng-model=\"message['";
        echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getFieldName", [], "method"), "html", null, true);
        echo "']\"";
        if ( !(isset($context["isPreview"]) ? $context["isPreview"] : null)) {
            echo " ng-init=\"message['";
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getFieldName", [], "method"), "html", null, true);
            echo "'] = '";
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getSelectedOptionValue", [], "method"), "html", null, true);
            echo "'\"";
        }
        if ($this->getAttribute($this->getAttribute($this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "properties", []), "validation", []), "required", [])) {
            echo " required";
        }
        echo ">
                ";
        // line 8
        if ((isset($context["isPreview"]) ? $context["isPreview"] : null)) {
            // line 9
            echo "                <option value=\"\">";
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getPreviewOptionLabel", [], "method"), "html", null, true);
            echo "</option>
                ";
        } else {
            // line 11
            echo "                ";
            $context['_parent'] = $context;
            $context['_seq'] = twig_ensure_traversable($this->getAttribute($this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "properties", []), "options", []));
            foreach ($context['_seq'] as $context["_key"] => $context["option"]) {
                // line 12
                echo "                <option value=\"";
                echo twig_escape_filter($this->env, $this->getAttribute($context["option"], "value", []), "html", null, true);
                echo "\"";
                if ($this->getAttribute($context["option"], "selected", [])) {
                    echo " selected";
                }
                echo ">";
                echo twig_escape_filter($this->env, $this->getAttribute($context["option"], "label", []), "html", null, true);
                echo "</option>
                ";
            }
            $_parent = $context['_parent'];
            unset($context['_seq'], $context['_iterated'], $context['_key'], $context['option'], $context['_parent'], $context['loop']);
            $context = array_intersect_key($context, $_parent) + $_parent;
            // line 14
            echo "                ";
        }
        // line 15
        echo "            </select>
        </div>
        ";
        // line 17
        if ((isset($context["isPreview"]) ? $context["isPreview"] : null)) {
            // line 18
            echo "            <div class=\"moto-form__errors moto-form__errors_only-first\"></div>
        ";
        } else {
            // line 20
            echo "            <div data-moto-form-errors class=\"moto-form__errors moto-form__errors_only-first\"
                 data-field-name=\"";
            // line 21
            echo twig_escape_filter($this->env, $this->getAttribute((isset($context["currentWidget"]) ? $context["currentWidget"] : null), "getFieldName", [], "method"), "html", null, true);
            echo "\"
                 data-form=\"\$FORM\"></div>
        ";
        }
        // line 24
        echo "    </div>
</div>";
    }

    public function getTemplateName()
    {
        return "@websiteWidgets/form_elements/templates/select.twig.html";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  111 => 24,  105 => 21,  102 => 20,  98 => 18,  96 => 17,  92 => 15,  89 => 14,  74 => 12,  69 => 11,  63 => 9,  61 => 8,  42 => 7,  34 => 5,  30 => 3,  28 => 2,  19 => 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 Twig_Source("", "@websiteWidgets/form_elements/templates/select.twig.html", "/data05/c3111787/public_html/brcc.me.uk/mt-includes/widgets/form_elements/templates/select.twig.html");
    }
}
