<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Jurisdiction: <?php echo e($mapItem->title); ?></title>
    <style>
        body {
            font-family: Arial, sans-serif;
            font-size: 12px;
            line-height: 1.4;
            color: #333;
        }
        .header {
            text-align: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ddd;
        }
        .logo {
            max-height: 60px;
            margin-bottom: 10px;
        }
        h1 {
            font-size: 22px;
            color: #004080;
            margin-bottom: 5px;
        }
        h2 {
            font-size: 18px;
            color: #004080;
            margin-top: 20px;
            margin-bottom: 10px;
            border-bottom: 1px solid #eee;
            padding-bottom: 5px;
        }
        h3 {
            font-size: 16px;
            color: #004080;
            margin-top: 15px;
            margin-bottom: 8px;
        }
        table {
            width: 100%;
            border-collapse: collapse;
            margin-bottom: 20px;
        }
        table, th, td {
            border: 1px solid #ddd;
        }
        th {
            background-color: #f5f5f5;
            font-weight: bold;
            text-align: left;
            padding: 8px;
        }
        td {
            padding: 8px;
        }
        .green { color: #008000; font-weight: bold; }
        .yellow { color: #F0A30A; font-weight: bold; }
        .red { color: #e74c3c; font-weight: bold; }
        .none { color: #333; }
        .commodity-value { font-weight: bold; }
        .footer {
            text-align: center;
            font-size: 12px;
            color: #333;
            margin-top: 30px;
            padding-top: 10px;
            border-top: 1px solid #ddd;
        }
        .section {
            margin-bottom: 25px;
        }
        .section-divider {
            border-top: 1px dashed #ccc;
            margin: 25px 0;
        }
    </style>
</head>
<body>
    <div class="header">
        <h1>Jurisdiction: <?php echo e($mapItem->title); ?></h1>
        <p>Generated on: <?php echo e(date('d F Y')); ?></p>
        <p><?php echo $disclaimer; ?></p>
    </div>

    <h2>Country Information</h2>
    <table>
        <tr>
            <th width="30%">Country</th>
            <td><?php echo e($mapItem->title); ?></td>
        </tr>
        <tr>
            <th>Year</th>
            <td><?php echo e($mapItem->year); ?></td>
        </tr>
        <tr>
            <th>Automatic Early Termination</th>
            <td>
                <?php switch($mapItem->aet):
                    case ('shall_apply'): ?>
                        shall apply
                        <?php break; ?>
                    <?php case ('shall_not_apply'): ?>
                        shall not apply
                        <?php break; ?>
                    <?php case ('enforceable_but_not_required'): ?>
                        enforceable but not required
                        <?php break; ?>
                    <?php default: ?>
                        <?php echo e($mapItem->aet); ?>

                <?php endswitch; ?>
            </td>
        </tr>
        <?php if($mapItem->aet_comment): ?>
        <tr>
            <th>AET Comment</th>
            <td><?php echo $mapItem->aet_comment; ?></td>
        </tr>
        <?php endif; ?>
    </table>

    <h2>Netting Map Summary</h2>
    <?php if(count($mapInformations) > 0): ?>        <?php
            // Group by counterparty type and settlement type
            $groupedInformations = $mapInformations->groupBy('counterparty_type');

            // Define the order of counterparty types
            $counterpartyOrder = ['corporate_corporate', 'bank_corporate', 'bank_bank'];
            $settlementOrder = ['physical', 'financial'];

            $isFirstItem = true;
        ?>

        <?php $__currentLoopData = $counterpartyOrder; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $counterpartyType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
            <?php if(isset($groupedInformations[$counterpartyType])): ?>
                <?php
                    $counterpartyGroup = $groupedInformations[$counterpartyType];
                    $settlementGroups = $counterpartyGroup->groupBy('settlement_type');
                ?>

                <h2>
                    <?php switch($counterpartyType):
                        case ('corporate_corporate'): ?>
                            Counterparty Type: Corporate - Corporate
                            <?php break; ?>
                        <?php case ('bank_corporate'): ?>
                            Counterparty Type: Bank - Corporate
                            <?php break; ?>
                        <?php case ('bank_bank'): ?>
                            Counterparty Type: Bank - Bank
                            <?php break; ?>
                        <?php default: ?>
                            Counterparty Type: <?php echo e(ucfirst(str_replace('_', ' ', $counterpartyType))); ?>

                    <?php endswitch; ?>
                </h2>

                <?php $__currentLoopData = $settlementOrder; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $settlementType): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php if(isset($settlementGroups[$settlementType])): ?>
                        <h3>
                            <?php switch($settlementType):
                                case ('physical'): ?>
                                    Settlement Type: Physical
                                    <?php break; ?>
                                <?php case ('financial'): ?>
                                    Settlement Type: Financial
                                    <?php break; ?>
                                <?php default: ?>
                                    Settlement Type: <?php echo e(ucfirst($settlementType)); ?>

                            <?php endswitch; ?>
                        </h3>

                        <?php $__currentLoopData = $settlementGroups[$settlementType]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $mapInformation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if(!$isFirstItem): ?>
                                <div class="section-divider"></div>
                            <?php endif; ?>

                            <div class="section">
                                <table>
                                    <tr>
                                        <th width="30%">Relevant Commodity</th>
                                        <td>
                                            <span class="commodity-value">
                                                <?php switch($mapInformation->relevant_commodity):
                                                    case ('power_gas'): ?>
                                                        Power/Gas
                                                        <?php break; ?>
                                                    <?php case ('power_gas_co2'): ?>
                                                        Power/Gas/CO2 Emissions
                                                        <?php break; ?>
                                                    <?php case ('power_gas_green'): ?>
                                                        Power/Gas/Green certificates
                                                        <?php break; ?>
                                                    <?php case ('power_gas_co2_green'): ?>
                                                        Power/Gas/CO2 Emissions/Green certificates
                                                        <?php break; ?>
                                                    <?php default: ?>
                                                        <?php echo e($mapInformation->relevant_commodity); ?>

                                                <?php endswitch; ?>
                                            </span>
                                        </td>
                                    </tr>
                                    <tr>
                                        <th>Colour Coding</th>
                                        <td class="<?php echo e($mapInformation->color); ?>">
                                            <span class="<?php echo e($mapInformation->color); ?>">
                                                <?php switch($mapInformation->color):
                                                    case ('green'): ?>
                                                        Green
                                                        <?php break; ?>
                                                    <?php case ('yellow'): ?>
                                                        Yellow
                                                        <?php break; ?>
                                                    <?php case ('red'): ?>
                                                        Red
                                                        <?php break; ?>
                                                    <?php default: ?>
                                                        None
                                                <?php endswitch; ?>
                                            </span>
                                        </td>
                                    </tr>
                                    <?php if($mapInformation->counterparty_comment): ?>
                                    <tr>
                                        <th>Counterparty Comment</th>
                                        <td><?php echo $mapInformation->counterparty_comment; ?></td>
                                    </tr>
                                    <?php endif; ?>
                                    <?php if($mapInformation->comment): ?>
                                    <tr>
                                        <th>Comment</th>
                                        <td><?php echo $mapInformation->comment; ?></td>
                                    </tr>
                                    <?php endif; ?>
                                </table>
                            </div>
                            <?php $isFirstItem = false; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php else: ?>
        <p>No map information records available for this country.</p>
    <?php endif; ?>

    <div class="footer">
        <p>© <?php echo e(date('Y')); ?> EFET - European Federation of Energy Traders</p>
    </div>
</body>
</html>
<?php /**PATH /var/www/html/resources/views/pdf/map-item.blade.php ENDPATH**/ ?>