<section id="midi-stats-stats-tab" class="tab{{#if tab.active}} active{{/if}}" data-group="{{tab.group}}" data-tab="{{tab.id}}">
    {{#each stats}}
        <div class="form-group">
            <div class="midi-qol-box" id={{@key}}>
                <div class="midi-qol-target-name" id="@key">
                    <h4><i class="fas fa-up-down-left-right-v"></i> {{this.name}}</h4>
                </div>
                <div id={{@key}}-X>
                    <table>
                        <thead>
                            <tr>
                                <th colspan="7">Attacks</th>
                                <th colspan="2">Damage</th>
                            </tr>
                            <tr>
                                <th></th>
                                <th>#rolls</th>
                                <th>#Crits</th>
                                <th>#Fumb</th>
                                <th>#20s</th>
                                <th>#Hits</th>
                                <th>Ave</th>
                                <th>Total</th>
                                <th>Applied</th>
                            </tr>
                        </thead>
                        <tbody style="text-align: center;">
                            {{#with this.session}}
                                <tr>
                                    <td style="text-align: left;">
                                    <h3>Session</h3>
                                    </td>
                                    <td>{{numAttacks}}</td>
                                    <td>{{numAttackCritical}}</td>
                                    <td>{{numAttackFumble}}</td>
                                    <td>{{numAttack20}}</td>
                                    <td>{{numDamageRolls}}</td>
                                    <td></td>
                                    <td>{{damageTotalAverage}}</td>
                                    <td>{{damageAppliedAverage}}</td>

                                </tr>
                            {{/with}}
                            {{#with this.lifetime}}
                                <tr>
                                    <td style="text-align: left;">
                                    <h3>Lifetime</h3>
                                    </td>
                                    <td>{{numAttacks}}</td>
                                    <td>{{numAttackCritical}}</td>
                                    <td>{{numAttackFumble}}</td>
                                    <td>{{numAttack20}}</td>
                                    <td>{{numDamageRolls}}</td>
                                    <td></td>
                                    <td>{{damageTotalAverage}}</td>
                                    <td>{{damageAppliedAverage}}</td>
                                </tr>
                            {{/with}}
                            <div id={{@key}}-Items>
                                {{#each this.itemStats}}
                                    <tr id={{@key}}-Items-X>
                                        <td style="text-align: left;">
                                            <h4>{{this.name}}</h4>
                                        </td>
                                        {{#with this.session}}
                                            <td>{{numAttacks}}</td>
                                            <td>{{numAttackCritical}}</td>
                                            <td>{{numAttackFumble}}</td>
                                            <td>{{numAttack20}}</td>
                                            <td>{{numDamageRolls}}</td>
                                            <td>{{attackRollAverage}}</td>
                                            <td>{{damageTotalAverage}}</td>
                                            <td>{{damageAppliedAverage}}</td>
                                        {{/with}}
                                    </tr>
                                {{/each}}
                            </div>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    {{/each}}
</section>