<div class="modal fade" id="add-endpoint-modal" tabindex="-1" role="dialog" aria-labelledby="add-endpoint-modal-title"
    aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="add-endpoint-modal-title">{{ i18n("endpoint_notifications.add_new_endpoint") }}</h5>
                <div class="modal-close">
                    <div class="confirm-closing" style="display: none;">
                        <span class='mx-2' style="vertical-align: middle;"><b>{{ i18n("endpoint_notifications.validation.abort_add_endpoint") }}</b></span>
                        <div class="btn-group btn-group-sm">
                            <button class="btn btn-secondary cancel" type="button">{{ i18n("cancel") }}</button>
                            <button data-bs-dismiss="modal" class="btn btn-danger confirm" type="button">{{ i18n("abort") }}</button>
                        </div>
                    </div>
                    <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                </div>
            </div>
            <form autocomplete="off">
                <div class="modal-body">
                    <div class="mb-3 row">
                        <label class="col-form-label col-sm-3" for="endpoint-name-input">
                            <b>{{ i18n("endpoint_notifications.name") }}</b>
                        </label>
                        <div class="col-sm-7">
                            <input data-validation-empty-message="{{ i18n('validation.empty_name') }}" required name="name" type="text" class="form-control" id="endpoint-name-input">
                        </div>
                    </div>
                    <div class="mb-3 row">
                        <label class="col-form-label col-sm-3" for="endpoint-type-select">
                            <b>{{ i18n("endpoint_notifications.type") }}</b>
                        </label>
                        <div class="col-sm-7">
                            <select required name="type" class="form-select" id="endpoint-type-select">
                                {%
                                    local selected = false
                                    for endpoint_key, endpoint in pairsByKeys(endpoints, asc) do
                                %}
                                    <option {{ (selected and 'selected' or '') }} value="{{ endpoint_key }}">{{ i18n('endpoint_notifications.types.'..endpoint_key) or endpoint.name }}</option>
                                    {% selected = false %}
                                {% end %}
                            </select>
                        </div>
                    </div>
                    <div style="display: none;" class="endpoint-template-container border-top pt-2">

                    </div>
                    <span class="invalid-feedback invalid-data-response"></span>
                </div>
                <div class="modal-footer">
                    <button type="submit" class="btn btn-primary">{{i18n("add")}}</button>
                </div>
            </form>
        </div>
    </div>
</div>
