<?php
    $menuItems = [
        'admin' => [
            ['route' => 'home', 'icon' => 'house', 'label' => 'Panel'],
        ],
        'editor' => [
            ['route' => 'home', 'icon' => 'house', 'label' => 'Panel'],
            ['route' => 'superadmin.users.index', 'icon' => 'user', 'label' => 'Usuarios'],
            ['route' => 'superadmin.contract-template.index', 'icon' => 'document', 'label' => 'Plantillas de contrato'],
        ],
        'super_admin' => [
            ['route' => 'home', 'icon' => 'house', 'label' => 'Panel'],
            ['route' => 'superadmin.users.index', 'icon' => 'user', 'label' => 'Usuarios'],
            ['route' => 'superadmin.template-variables.index', 'icon' => 'codebreak', 'label' => 'Variables'],
            ['route' => 'superadmin.section-rules.index', 'icon' => 'codebreak', 'label' => 'Controles - Reglas'],
            ['route' => 'superadmin.contract-template.index', 'icon' => 'document', 'label' => 'Plantillas de contrato'],
        ],
    ];
?>
<div x-data="{ openSidebar: false }">
    <!-- BACKDROP (solo en mobile) -->
    <div x-show="openSidebar" @click="openSidebar = false" class="fixed inset-0 z-40 bg-black/50 lg:hidden"
        x-transition.opacity></div>

    <!-- SIDEBAR -->
    <div :class="{ 'translate-x-0': openSidebar, '-translate-x-full': !openSidebar }"
        class="overflow-y-auto fixed top-0 left-0 z-[200] h-screen w-[240px] border-r border-r-gray-400 bg-primary100 transform transition-transform duration-300 ease-in-out lg:translate-x-0">
        <div class="flex flex-col h-full p-4 justify-between min-h-[700px]">
            <div class="flex flex-col gap-4">
                <a href="/" class="text-white inline-block mb-8">
                    <?php if (isset($component)) { $__componentOriginalb1d76caee4a8fe9b22aa99d46c64b51c = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginalb1d76caee4a8fe9b22aa99d46c64b51c = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.icons.logo','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('icons.logo'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginalb1d76caee4a8fe9b22aa99d46c64b51c)): ?>
<?php $attributes = $__attributesOriginalb1d76caee4a8fe9b22aa99d46c64b51c; ?>
<?php unset($__attributesOriginalb1d76caee4a8fe9b22aa99d46c64b51c); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalb1d76caee4a8fe9b22aa99d46c64b51c)): ?>
<?php $component = $__componentOriginalb1d76caee4a8fe9b22aa99d46c64b51c; ?>
<?php unset($__componentOriginalb1d76caee4a8fe9b22aa99d46c64b51c); ?>
<?php endif; ?>
                </a>
                <!-- Menú -->
                <?php if(auth()->check()): ?>
                    <?php $__currentLoopData = auth()->user()->roles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $role): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <?php if(isset($menuItems[$role->name])): ?>
                            <?php $__currentLoopData = $menuItems[$role->name]; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <?php if (isset($component)) { $__componentOriginal7e0186e860361050546cc182608bf7dc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal7e0186e860361050546cc182608bf7dc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.menu.link','data' => ['route' => $item['route'],'icon' => $item['icon']]] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('menu.link'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['route' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($item['route']),'icon' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($item['icon'])]); ?><?php echo e($item['label']); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal7e0186e860361050546cc182608bf7dc)): ?>
<?php $attributes = $__attributesOriginal7e0186e860361050546cc182608bf7dc; ?>
<?php unset($__attributesOriginal7e0186e860361050546cc182608bf7dc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7e0186e860361050546cc182608bf7dc)): ?>
<?php $component = $__componentOriginal7e0186e860361050546cc182608bf7dc; ?>
<?php unset($__componentOriginal7e0186e860361050546cc182608bf7dc); ?>
<?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                <?php endif; ?>
                <?php if(auth()->guard()->check()): ?>
                    <?php if(auth()->user()->hasRole('admin') || auth()->user()->hasRole('editor')): ?>
                        <?php if (isset($component)) { $__componentOriginal58d30d03d1b81dc88a0ad9e7845f78b3 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal58d30d03d1b81dc88a0ad9e7845f78b3 = $attributes; } ?>
<?php $component = App\View\Components\Menu\SidebarContracts::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('menu.sidebar-contracts'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Menu\SidebarContracts::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal58d30d03d1b81dc88a0ad9e7845f78b3)): ?>
<?php $attributes = $__attributesOriginal58d30d03d1b81dc88a0ad9e7845f78b3; ?>
<?php unset($__attributesOriginal58d30d03d1b81dc88a0ad9e7845f78b3); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal58d30d03d1b81dc88a0ad9e7845f78b3)): ?>
<?php $component = $__componentOriginal58d30d03d1b81dc88a0ad9e7845f78b3; ?>
<?php unset($__componentOriginal58d30d03d1b81dc88a0ad9e7845f78b3); ?>
<?php endif; ?>
                    <?php endif; ?>
                <?php endif; ?>

                <form method="POST" action="<?php echo e(route('logout')); ?>">
                    <?php echo csrf_field(); ?>
                    <?php if (isset($component)) { $__componentOriginal7e0186e860361050546cc182608bf7dc = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal7e0186e860361050546cc182608bf7dc = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.menu.link','data' => ['class' => 'mb-12','onclick' => 'event.preventDefault();
                                        this.closest(\'form\').submit();','route' => 'logout','icon' => 'logout']] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('menu.link'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['class' => 'mb-12','onclick' => 'event.preventDefault();
                                        this.closest(\'form\').submit();','route' => 'logout','icon' => 'logout']); ?>Cerrar
                        sesión <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal7e0186e860361050546cc182608bf7dc)): ?>
<?php $attributes = $__attributesOriginal7e0186e860361050546cc182608bf7dc; ?>
<?php unset($__attributesOriginal7e0186e860361050546cc182608bf7dc); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal7e0186e860361050546cc182608bf7dc)): ?>
<?php $component = $__componentOriginal7e0186e860361050546cc182608bf7dc; ?>
<?php unset($__componentOriginal7e0186e860361050546cc182608bf7dc); ?>
<?php endif; ?>
                </form>
            </div>
        </div>
    </div>

    <!-- NAVBAR -->
    <nav class="fixed top-0 left-0 z-50 bg-gray-300 w-full lg:hidden">
        <div class="container">
            <div class="flex justify-between items-center h-[80px]">
                <a href="/" class="text-[#111418] text-base font-medium">
                    <?php echo e(config('app.name', 'HouseContract')); ?>

                </a>

                <!-- BOTÓN HAMBURGUESA SOLO EN MOBILE -->
                <button type="button" class="h-11 w-11 flex justify-center items-center lg:hidden"
                    @click="openSidebar = true">
                    <svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
                        stroke-width="1.5" stroke="currentColor">
                        <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 9h16.5m-16.5 6.75h16.5" />
                    </svg>
                </button>
            </div>
        </div>
    </nav>
</div><?php /**PATH /home/cnllsandbox/public_html/house-contract.cnll-sandbox.com/resources/views/components/menu/sidebar.blade.php ENDPATH**/ ?>