<!DOCTYPE html>
<html dir="ltr" lang="en">
@include('backend.layouts.head')

<body class="skin-blue fixed-layout">
    <div class="preloader">
        <div class="loader">
            <div class="loader__figure"></div>
            <p class="loader__label">CarBaba</p>
        </div>
    </div>
    @include('backend.layouts.nav')
	@include('backend.layouts.sidebar')
    {{-- @include('backend.layouts.breadcrumb') --}}
	@yield('content')

    @include('backend.layouts.footer')
    <script>
        $('body').on('keypress',".stop_first_space", function(e){
            if (e.which === 32 && !this.value.length)
            e.preventDefault();
    });
    </script>
    @stack('custom-script')

</body>
<script>
    document.addEventListener('DOMContentLoaded', function() {
        
    // Get the current URL path
    var path = window.location.pathname;

    // Extract the route name from the path
    var route = path.split('/').pop();

    // Find all sidebar menu items
    var menuItems = document.querySelectorAll('#sidebarnav li');

    // Loop through each menu item
    // menuItems.forEach(function(item) {
    //     // Get the routes that should make this item active
    //     var routes = item.getAttribute('data-route').split(',');

    //     // Check if the current route matches any of the item's routes
    //     if (routes.some(r => path.includes(r))) {
    //         // Add 'active' class to the item
    //         item.classList.add('active');

    //         // If this is a submenu item, also activate its parent
    //         var parent = item.closest('ul').closest('li');
    //         if (parent) {
    //             parent.classList.add('active');
    //         }
    //     }
    // });
   
});
</script>
</html>
