<?php

declare(strict_types=1);

use Fisharebest\Webtrees\Individual;
use Fisharebest\Webtrees\Module\CompactTreeChartModule;
use Illuminate\Support\Collection;

/**
 * @var Collection<int,Individual> $ancestors
 * @var CompactTreeChartModule $module
 */

?>
<table class="text-center w-100 h-100 wt-chart-compact-table" role="presentation">
    <tr>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(16)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td class="h-100">
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(18)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(24)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(26)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(16)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(18)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(24)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(26)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(8)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-left', ['module' => $module, 'individual' => $ancestors->get(8)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(4)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-right', ['module' => $module, 'individual' => $ancestors->get(9)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(9)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(12)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-left', ['module' => $module, 'individual' => $ancestors->get(12)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(6)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-right', ['module' => $module, 'individual' => $ancestors->get(13)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(13)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(17)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(19)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(25)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(27)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(17)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(4)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(19)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(25)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(6)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(27)]) ?>
        </td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(2)]) ?>
        </td>
        <td></td>
        <td colspan="3">
            <table class="w-100">
                <tr>
                    <td class="w-25">
                        <?= view('modules/compact-chart/arrow-left', ['module' => $module, 'individual' => $ancestors->get(2)]) ?>
                    </td>
                    <td class="w-50">
                        <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(1)]) ?>
                    </td>
                    <td class="w-25">
                        <?= view('modules/compact-chart/arrow-right', ['module' => $module, 'individual' => $ancestors->get(3)]) ?>
                    </td>
                </tr>
            </table>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(3)]) ?>
        </td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(20)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(5)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(22)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(28)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(7)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(30)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(20)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(22)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(28)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-up', ['module' => $module, 'individual' => $ancestors->get(30)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(10)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-left', ['module' => $module, 'individual' => $ancestors->get(10)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(5)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-right', ['module' => $module, 'individual' => $ancestors->get(11)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(11)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(14)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-left', ['module' => $module, 'individual' => $ancestors->get(14)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(7)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/arrow-right', ['module' => $module, 'individual' => $ancestors->get(15)]) ?>
        </td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(15)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(21)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(23)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(29)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/arrow-down', ['module' => $module, 'individual' => $ancestors->get(31)]) ?>
        </td>
    </tr>
    <tr>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(21)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(23)]) ?>
        </td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(29)]) ?>
        </td>
        <td></td>
        <td></td>
        <td></td>
        <td>
            <?= view('modules/compact-chart/individual', ['individual' => $ancestors->get(31)]) ?>
        </td>
    </tr>
</table>
