@php
    $routesData = [];
    foreach (\Illuminate\Support\Facades\Route::getRoutes() as $route) {
        $name = $route->getName();
        if (strpos($name, 'owner') !== false) {
            $routeData = [
                $name => url($route->uri()),
            ];

            $routesData[] = $routeData;
        }
    }
@endphp
<nav class="navbar-wrapper bg--dark d-flex align-items-center ms-0">
    <div class="navbar__left">
        <div class="sidebar__logo py-0">
            <a href="{{ route('supervisor.dashboard') }}" class="sidebar__main-logo">
                <img src="{{ siteLogo() }}" alt="image">
            </a>
        </div>
    </div>
    <div class="navbar__right">
        <ul class="navbar__action-list">
            <li>
                <button type="button" class="primary--layer" data-bs-toggle="tooltip" data-bs-placement="bottom"
                    title="@lang('Visit Website')">
                    <a href="{{ route('home') }}" target="_blank"><i class="las la-globe"></i></a>
                </button>
            </li>
            <li class="dropdown d-flex profile-dropdown">
                <button type="button" data-bs-toggle="dropdown" data-display="static" aria-haspopup="true"
                    aria-expanded="false">
                    <span class="navbar-user">
                        <span class="navbar-user__thumb">
                            <img src="{{ getImage(getFilePath('supervisor') . '/' . authUser('supervisor')->image, getFileSize('supervisor')) }}"
                                alt="image">
                        </span>
                        <span class="navbar-user__info">
                            <span class="navbar-user__name">{{ authUser('supervisor')->username }}</span>
                        </span>
                        <span class="icon"><i class="las la-chevron-circle-down"></i></span>
                    </span>
                </button>
                <div class="dropdown-menu dropdown-menu--sm p-0 border-0 box--shadow1 dropdown-menu-right">
                    <a href="{{ route('supervisor.profile') }}"
                        class="dropdown-menu__item d-flex align-items-center px-3 py-2">
                        <i class="dropdown-menu__icon las la-user-circle"></i>
                        <span class="dropdown-menu__caption">@lang('Profile')</span>
                    </a>
                    <a href="{{ route('supervisor.password') }}"
                        class="dropdown-menu__item d-flex align-items-center px-3 py-2">
                        <i class="dropdown-menu__icon las la-key"></i>
                        <span class="dropdown-menu__caption">@lang('Password')</span>
                    </a>
                    <a href="{{ route('supervisor.logout') }}"
                        class="dropdown-menu__item d-flex align-items-center px-3 py-2">
                        <i class="dropdown-menu__icon las la-sign-out-alt"></i>
                        <span class="dropdown-menu__caption">@lang('Logout')</span>
                    </a>
                </div>
                <button type="button" class="breadcrumb-nav-open ms-2 d-none">
                    <i class="las la-sliders-h"></i>
                </button>
            </li>
        </ul>
    </div>
</nav>

@push('script')
    <script>
        "use strict";
        var routes = @json($routesData);

        $('.navbar__action-list .dropdown-menu').on('click', function(event) {
            event.stopPropagation();
        });
    </script>
    <script src="{{ asset('assets/admin/js/search.js') }}"></script>
    <script>
        "use strict";

        function getEmptyMessage() {
            return `<li class="text-muted">
                <div class="empty-search text-center">
                    <img src="{{ getImage('assets/images/empty_list.png') }}" alt="empty">
                    <p class="text-muted">No search result found</p>
                </div>
            </li>`
        }
    </script>
@endpush




@push('style')
    <style>
         .sidebar__logo .sidebar__main-logo img {
            max-height: 60px;
        }
        @media (max-width: 767px) {
            .navbar__right {
                margin-top: 0px;
            }
            .sidebar__logo .sidebar__main-logo img {
                max-height: 50px;
            }
            .profile-dropdown{
                flex:unset;
            }
        }

        @media (max-width: 424px) {
            .navbar-wrapper {
                flex-direction: column;
                gap: 20px;
            }

            .navbar__left {
                justify-content: center;
            }

            .sidebar__logo .sidebar__main-logo img {
                max-height: 50px;
            }
            .profile-dropdown{
                flex:1;
            }
        }

        .navbar__action-list {
            justify-content: end;
        }


    </style>
@endpush
