<%=raw app.core.View.getTemplate( 'appointment-detail-nav', { a : a, activeTab : 'chat' } ) %>
<div class="row">
    <div class="col-sm-12">
        <div class="card">
            <div class="card-body">
                <div data-id="chat-frame-container">
                    <% if ( 0 < chats.length ) {    %>
                        <div class="chat-frame">
                            <% for ( var ci = 0; ci < chats.length; ci++ ) {    %>
                                <%=raw app.core.View.getTemplate( 'appointment-detail-chat-message', { c : chats[ ci ] } ) %>
                            <% }    %>
                        </div>
                    <% } else { %>
                        <p data-id="no-messages">
                            <%= _lc( 'NO_CHAT_MESSAGES' ) %>
                        </p>
                    <% }    %>
                </div>
            </div>
            <div class="card-footer">
                <div class="input-group mb-3">
                    <input type="text"
                           class="form-control"
                           <%= app.model.SessionUser.getUserProfile().isAnonymousInGroup( a.getTeamId() ) ? 'disabled="disabled"' : '' %>
                           data-id="input-chat-message"
                           placeholder="<%= _lc( 'YOUR_CHAT_MESSAGE' ) %>" />
                    <div class="input-group-append">
                        <button class="btn btn-primary"
                                type="button"
                                data-id="btn-send-chat">
                            <i class="fas fa-share-square"></i>
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
