{% from "components/input/_macro.njk" import onsInput %}
{% from "components/question/_macro.njk" import onsQuestion %}

{%
    call onsQuestion({
        "title": "Get a confirmation email",
        "description": "<p>Enter your email address if you would like to be sent confirmation that you have completed your survey</p>",
        "legendIsQuestionTitle": true
    })
%}
    {{
        onsInput({
            "id": "email-example-mutually-exclusive",
            "type": "email",
            "label": {
                "text": "Email address",
                "description": "This will not be stored and only used once to send your confirmation"
            },
            "dontWrap": true,
            "mutuallyExclusive": {
                "or": "Or",
                "deselectMessage": "Selecting this will clear your email",
                "deselectGroupAdjective": "cleared",
                "deselectExclusiveOptionAdjective": "deselected",
                "exclusiveOptions": [
                    {
                        "id": "email-checkbox-example-mutually-exclusive",
                        "name": "no-email",
                        "value": "no-email",
                        "label": {
                            "text": "I don’t want to receive a confirmation email"
                        }
                    }
                ]
            }
        })
    }}
{% endcall %}
