
<?php
    $isMaster = auth()->check() && auth()->user()->is_master;
    $hasAnyItem = false;

    $applicationName = setting('application_name', config('app.name'));
    $companyName = setting('company_name', 'Aumni Techworks LLP');
?>

<nav class="offcanvas-lg offcanvas-start ams-sidebar"
     tabindex="-1"
     id="amsSidebar"
     aria-label="Main navigation">

    
    <div class="offcanvas-header">
        <span class="ams-sidebar__wordmark"><?php echo e($applicationName); ?></span>
        <button type="button"
                class="btn-close"
                data-bs-dismiss="offcanvas"
                data-bs-target="#amsSidebar"
                aria-label="Close"></button>
    </div>

    <div class="offcanvas-body">
        <div class="ams-sidebar__inner">

            <a class="ams-sidebar__brand d-none d-lg-flex"
               href="<?php echo e(Route::has('dashboard') ? route('dashboard') : url('/')); ?>">
                <?php $logo = setting('company_logo'); ?>

                <?php if($logo): ?>
                    <span class="ams-sidebar__mark ams-sidebar__mark--logo" aria-hidden="true">
                        <img src="<?php echo e(Illuminate\Support\Facades\Storage::disk('public')->url($logo)); ?>" alt="">
                    </span>
                <?php else: ?>
                    <span class="ams-sidebar__mark" aria-hidden="true">
                        <i class="bi bi-box-seam"></i>
                    </span>
                <?php endif; ?>

                <span class="min-width-0">
                    <span class="ams-sidebar__wordmark d-block ams-truncate"><?php echo e($applicationName); ?></span>
                    <span class="ams-sidebar__tagline d-block ams-truncate"><?php echo e($companyName); ?></span>
                </span>
            </a>

            <div class="ams-sidebar__nav ams-scroll-thin">
                <?php $__currentLoopData = config('ams.navigation', []); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $group): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <?php
                        $items = collect($group['items'] ?? [])
                            ->filter(fn (array $item): bool => Route::has($item['route']))
                            ->filter(fn (array $item): bool => ! ($item['master'] ?? false) || $isMaster);

                        $hasAnyItem = $hasAnyItem || $items->isNotEmpty();
                    ?>

                    <?php if($items->isNotEmpty()): ?>
                        <?php if(! empty($group['section'])): ?>
                            <div class="ams-nav__section"><?php echo e($group['section']); ?></div>
                        <?php endif; ?>

                        <?php $__currentLoopData = $items; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php $active = request()->routeIs($item['pattern']); ?>

                            <a class="ams-nav__link <?php echo e($active ? 'is-active' : ''); ?>"
                               href="<?php echo e(route($item['route'])); ?>"
                               <?php if($active): ?> aria-current="page" <?php endif; ?>>
                                <i class="bi bi-<?php echo e($item['icon']); ?>" aria-hidden="true"></i>
                                <span><?php echo e($item['label']); ?></span>
                            </a>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                <?php if($hasAnyItem): ?>
                    
                    <div class="ams-nav__end" aria-hidden="true"></div>
                <?php else: ?>
                    <p class="ams-nav__empty mb-0">
                        No modules are available yet. Menu entries appear as each
                        module is installed.
                    </p>
                <?php endif; ?>
            </div>

            <div class="ams-sidebar__footer">
                <div class="ams-sidebar__meta">
                    <strong><?php echo e($companyName); ?></strong>
                    <?php echo e($applicationName); ?> v<?php echo e(config('ams.version')); ?>

                </div>
            </div>

        </div>
    </div>

</nav>
<?php /**PATH /Users/aviii/Desktop/Aumni AMS/resources/views/partials/sidebar.blade.php ENDPATH**/ ?>