<?php $attributes ??= new \Illuminate\View\ComponentAttributeBag;

$__newAttributes = [];
$__propNames = \Illuminate\View\ComponentAttributeBag::extractPropNames(([
    'telefones' => [],
]));

foreach ($attributes->all() as $__key => $__value) {
    if (in_array($__key, $__propNames)) {
        $$__key = $$__key ?? $__value;
    } else {
        $__newAttributes[$__key] = $__value;
    }
}

$attributes = new \Illuminate\View\ComponentAttributeBag($__newAttributes);

unset($__propNames);
unset($__newAttributes);

foreach (array_filter(([
    'telefones' => [],
]), 'is_string', ARRAY_FILTER_USE_KEY) as $__key => $__value) {
    $$__key = $$__key ?? $__value;
}

$__defined_vars = get_defined_vars();

foreach ($attributes->all() as $__key => $__value) {
    if (array_key_exists($__key, $__defined_vars)) unset($$__key);
}

unset($__defined_vars, $__key, $__value); ?>

<?php
    $maxGroups = 1;
    $maxNumbers = 4;
    $needsToggle = count($telefones) > $maxGroups;

    if (! $needsToggle) {
        foreach (array_slice($telefones, 0, $maxGroups) as $grupo) {
            if (count($grupo['numeros'] ?? []) > $maxNumbers) {
                $needsToggle = true;
                break;
            }
        }
    }
?>

<article class="ma-org-card ma-org-card--contacts">
    <h2 class="ma-org-card__title"><?php echo e(__('Contatos')); ?></h2>

    <ul class="ma-org-contacts list-unstyled mb-0" data-ma-contacts-list>
        <?php $__empty_1 = true; $__currentLoopData = $telefones; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $groupIndex => $telefone): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <?php
                $hideGroup = $groupIndex >= $maxGroups;
            ?>
            <li class="<?php echo \Illuminate\Support\Arr::toCssClasses([
                'ma-org-contacts__group',
                'd-none' => $hideGroup,
            ]); ?>" <?php if($hideGroup): ?> data-ma-contacts-collapsed <?php endif; ?>>
                <h3 class="ma-org-contacts__group-title"><?php echo e($telefone['telefone']); ?></h3>
                <ul class="ma-org-contacts__numbers list-unstyled mb-0">
                    <?php $__currentLoopData = $telefone['numeros']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $numIndex => $numero): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php
                            $hideNumber = ! $hideGroup && $numIndex >= $maxNumbers;
                        ?>
                        <li class="<?php echo \Illuminate\Support\Arr::toCssClasses([
                            'ma-org-contacts__number',
                            'd-none' => $hideNumber,
                        ]); ?>" <?php if($hideNumber): ?> data-ma-contacts-collapsed <?php endif; ?>>
                            <i class="fa-solid fa-phone ma-org-contacts__icon" aria-hidden="true"></i>
                            <a class="ma-org-contacts__link" href="tel:<?php echo e($numero['link']); ?>">
                                <?php echo e($numero['numero']); ?>

                            </a>
                        </li>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </ul>
            </li>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <li class="ma-org-contacts__empty"><?php echo e(__('Nenhum telefone encontrado.')); ?></li>
        <?php endif; ?>
    </ul>

    <?php if($needsToggle): ?>
        <button type="button"
            class="btn btn-light ma-org-contacts__toggle"
            data-ma-contacts-toggle
            data-label-more="<?php echo e(__('Ver mais')); ?>"
            data-label-less="<?php echo e(__('Mostrar menos')); ?>"
            aria-expanded="false">
            <?php echo e(__('Ver mais')); ?>

        </button>
    <?php endif; ?>
</article>
<?php /**PATH /var/www/html/portal/resources/views/components/mobiangra/contatos-list.blade.php ENDPATH**/ ?>