<!-- Special Attendance Menu Item -->
<li class="sidebar-menu-item {{ set_active(['admin/special-attendance/*']) }}">
    <a href="javascript:void(0)"
        class="parent-item-content has-arrow {{ menu_active_by_route(['tardy-rules.*', 'tardy-records.*', 'tardy-request.*']) }}">
        <span>
            {{ _trans('common.Special Attendance') }}
        </span>
    </a>
    <ul
        class="child-menu-list {{ set_active(['admin/special-attendance*', 'admin/special-attendance/create', 'admin/special-attendance/edit', 'admin/special-attendance/types', 'admin/special-attendance/types/*', 'admin/special-attendance/tardy-records/*', 'admin/special-attendance/tardy-request*']) }}">
        <!-- Tardy Rules -->
        <li class="nav-item {{ menu_active_by_route('tardy-rules.*') }}">
            <a href="{{ route('tardy-rules.index') }}" class="{{ set_active('admin/special-attendance/tardy-rules') }}">
                <span>{{ _trans('common.Complience') }}</span>
            </a>
        </li>
        <!-- Tardy Records -->
        <li class="nav-item {{ menu_active_by_route(['tardy-records.*', 'tardy-request.create']) }}">
            <a href="{{ route('tardy-records.index') }}"
                class="{{ set_active('admin/special-attendance/tardy-records') }}">
                <span>{{ _trans('common.Complience Records') }}</span>
            </a>
        </li>
        <!-- Tardy Requests -->
        <li class="nav-item {{ menu_active_by_route(['tardy-request.index', 'tardy-request.edit']) }}">
            <a href="{{ route('tardy-request.index') }}"
                class="{{ set_active('admin/special-attendance/tardy-request') }}">
                <span>{{ _trans('common.Complience Requests') }}</span>
            </a>
        </li>
    </ul>
</li>

<!-- Duty Calendar Menu Item -->
<li class="sidebar-menu-item {{ set_active(['admin/special-attendance/duty-calendar/*', 'hrm/weekend/*', 'hrm/holiday/*', 'hrm/duty/*', 'hrm/shift/*']) }}">
    <a href="javascript:void(0)" class="parent-item-content has-arrow {{ menu_active_by_route(['duty.calendar.*', 'dutySchedule.*', 'shift.*']) }}">
        <span>
            {{ _trans('common.Duty calendar') }}
        </span>
    </a>
    <ul class="child-menu-list {{ set_active(['admin/special-attendance*', 'hrm/weekend/*', 'hrm/holiday/*', 'hrm/shift*', 'hrm/duty*']) }}">
        
        <!-- Conditional Elements for Non-Main Companies -->
        @if (!isMainCompany())
            @if (hasPermission('weekend_read'))
                <li class="nav-item {{ menu_active_by_route(['weekendSetup.index']) }}">
                    <a href="{{ route('weekendSetup.index') }}"
                        class="{{ set_active([route('weekendSetup.index')]) }}">
                        <span>{{ _trans('attendance.Weekend Setup') }}</span>
                    </a>
                </li>
            @endif
            @if (hasPermission('holiday_read'))
                <li
                    class="nav-item {{ menu_active_by_route(['holidaySetup.index', 'holidaySetup.create', 'holidaySetup.show']) }}">
                    <a href="{{ route('holidaySetup.index') }}"
                        class="{{ menu_active_by_route(['holidaySetup.index', 'holidaySetup.create', 'holidaySetup.show']) }}">
                        <span>{{ _trans('attendance.Holiday Setup') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('schedule_read'))
                <li
                    class="nav-item {{ menu_active_by_route(['dutySchedule.index', 'dutySchedule.create', 'dutySchedule.show']) }}">
                    <a href="{{ route('dutySchedule.index') }}"
                        class="{{ menu_active_by_route(['dutySchedule.index', 'dutySchedule.create', 'dutySchedule.show']) }}">
                        <span>{{ _trans('attendance.Duty Schedule') }}</span>
                    </a>
                </li>
            @endif
             <!-- Duty calendar -->
            <li class="nav-item {{ menu_active_by_route('duty.calendar.*') }}">
                <a href="{{ route('duty.calendar.index') }}" class=" {{ set_active('admin/special-attendance/duty-calendar') }}">
                    <span>{{ _trans('common.Duty calendar') }}</span>
                </a>
            </li>
        @endif
    </ul>
</li>
