{{-- AdminSidebar (sidebar.md) — collapsible 280px / 80px, sticky on desktop, drawer overlay on mobile. Reads appShell() state from the parent layout. Nav is data-driven from $groups below. Routes that already exist are wired to real route() helpers; the rest use the target paths from sidebar.md and will resolve once their controllers are built. --}} @php // Helper: is the current request within this match pattern? $isActive = fn (?string $pattern) => $pattern && request()->is($pattern); $groups = [ [ 'label' => 'Umum', 'access' => 'operator', 'items' => [ ['icon' => 'squares-2x2', 'label' => 'Dashboard', 'href' => route('dashboard'), 'match' => 'portal/dashboard', 'access' => 'operator'], ], ], [ 'label' => 'Pelayanan Publik', 'access' => 'operator', 'items' => [ ['icon' => 'identification', 'label' => 'KTP', 'href' => route('ktp-requests.index'), 'match' => 'portal/ktp-requests*', 'badge' => 'ktp', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('ktp-requests.index')], ['label' => 'Pending', 'href' => route('ktp-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('ktp-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('ktp-requests.index').'?status=rejected'], ]], ['icon' => 'document-check', 'label' => 'KIA', 'href' => route('kia-requests.index'), 'match' => 'portal/kia-requests*', 'badge' => 'kia', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('kia-requests.index')], ['label' => 'Pending', 'href' => route('kia-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('kia-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('kia-requests.index').'?status=rejected'], ]], ['icon' => 'heart', 'label' => 'Pernikahan', 'href' => route('marriage-requests.index'), 'match' => 'portal/marriage-requests*', 'badge' => 'marriage', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('marriage-requests.index')], ['label' => 'Pending', 'href' => route('marriage-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('marriage-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('marriage-requests.index').'?status=rejected'], ]], ['icon' => 'pencil-square', 'label' => 'Pergantian Nama', 'href' => route('name-change-requests.index'), 'match' => 'portal/name-change-requests*', 'badge' => 'name-change', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('name-change-requests.index')], ['label' => 'Pending', 'href' => route('name-change-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('name-change-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('name-change-requests.index').'?status=rejected'], ]], ['icon' => 'user-group', 'label' => 'Kartu Keluarga', 'href' => route('family-card-requests.index'), 'match' => 'portal/family-card-requests*', 'badge' => 'family-card', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('family-card-requests.index')], ['label' => 'Pending', 'href' => route('family-card-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('family-card-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('family-card-requests.index').'?status=rejected'], ]], ['icon' => 'clipboard-document-check', 'label' => 'Surat Izin Kegiatan', 'href' => route('event-permit-requests.index'), 'match' => 'portal/event-permit-requests*', 'badge' => 'event-permit', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('event-permit-requests.index')], ['label' => 'Pending', 'href' => route('event-permit-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('event-permit-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('event-permit-requests.index').'?status=rejected'], ]], ['icon' => 'home-modern', 'label' => 'Surat Tanah', 'href' => route('land-cert-requests.index'), 'match' => 'portal/land-cert-requests*', 'badge' => 'land-certificate', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('land-cert-requests.index')], ['label' => 'Pending', 'href' => route('land-cert-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('land-cert-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('land-cert-requests.index').'?status=rejected'], ]], ['icon' => 'building-office-2', 'label' => 'Administrasi Rumah', 'href' => route('house-purchase-requests.index'), 'match' => 'portal/house-purchase-requests*', 'badge' => 'house-purchase', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Pengajuan', 'href' => route('house-purchase-requests.index')], ['label' => 'Pending', 'href' => route('house-purchase-requests.index').'?status=pending'], ['label' => 'Disetujui', 'href' => route('house-purchase-requests.index').'?status=approved'], ['label' => 'Ditolak', 'href' => route('house-purchase-requests.index').'?status=rejected'], ]], ], ], [ 'label' => 'Disnaker', 'access' => 'admin', 'items' => [ ['icon' => 'chart-bar-square', 'label' => 'Dashboard Disnaker', 'href' => route('disnaker.dashboard'), 'match' => 'portal/disnaker*', 'access' => 'admin', 'sub' => [ ['label' => 'Dashboard', 'href' => route('disnaker.dashboard')], ['label' => 'Informasi', 'href' => route('disnaker.articles.index')], ['label' => 'Katalog Barang', 'href' => route('disnaker.catalog')], ['label' => 'Gudang', 'href' => route('disnaker.stock')], ['label' => 'Arus Barang', 'href' => route('disnaker.stock-movements')], ['label' => 'Kas', 'href' => route('disnaker.cash')], ['label' => 'Kalender', 'href' => route('disnaker.events.index')], ['label' => 'Dokumen', 'href' => route('disnaker.documents.index')], ['label' => 'Layanan', 'href' => route('disnaker.dashboard') . '#disnaker-layanan'], ['label' => 'Pengaduan', 'href' => route('disnaker.dashboard') . '#disnaker-pengaduan'], ]], ], ], [ 'label' => 'Data Kependudukan', 'access' => 'admin', 'items' => [ ['icon' => 'users', 'label' => 'Data Penduduk', 'href' => '/admin/citizens', 'match' => 'admin/citizens*', 'access' => 'admin', 'sub' => [ ['label' => 'Semua Penduduk', 'href' => '/admin/citizens'], ['label' => 'Penduduk Aktif', 'href' => '/admin/citizens?status=active'], ['label' => 'Tidak Aktif', 'href' => '/admin/citizens?status=inactive'], ]], ['icon' => 'folder-open', 'label' => 'Kartu Keluarga', 'href' => '/admin/family', 'match' => 'admin/family*', 'access' => 'admin', 'sub' => [ ['label' => 'Semua KK', 'href' => '/admin/family'], ['label' => 'Riwayat Dokumen', 'href' => '/admin/document-history'], ]], ], ], [ 'label' => 'Regulasi', 'access' => 'admin', 'items' => [ ['icon' => 'scale', 'label' => 'Regulasi Layanan', 'href' => '/admin/regulations', 'match' => 'admin/regulations*', 'access' => 'admin', 'sub' => [ ['label' => 'Regulasi KTP', 'href' => '/admin/regulations/ktp'], ['label' => 'Regulasi KIA', 'href' => '/admin/regulations/kia'], ['label' => 'Regulasi Pernikahan', 'href' => '/admin/regulations/marriage'], ['label' => 'Regulasi Pergantian Nama', 'href' => '/admin/regulations/name-change'], ['label' => 'Regulasi Kartu Keluarga', 'href' => '/admin/regulations/family-card'], ['label' => 'Regulasi Surat Tanah', 'href' => '/admin/regulations/land-certificate'], ['label' => 'Regulasi Rumah', 'href' => '/admin/regulations/house-purchase'], ['label' => 'Regulasi Izin Kegiatan', 'href' => '/admin/regulations/event-permit'], ]], ], ], [ 'label' => 'Website CMS', 'access' => 'admin', 'items' => [ ['icon' => 'globe-alt', 'label' => 'Kelola Website', 'href' => '/admin/cms', 'match' => 'admin/cms*', 'access' => 'admin', 'sub' => [ ['label' => 'Homepage', 'href' => '/admin/cms/home'], ['label' => 'Profil Pemerintahan', 'href' => '/admin/cms/profile'], ['label' => 'Berita', 'href' => '/admin/cms/news'], ['label' => 'Kategori Berita', 'href' => '/admin/cms/news/categories'], ['label' => 'FAQ', 'href' => '/admin/cms/faq'], ['label' => 'Media Library', 'href' => '/admin/cms/media'], ]], ], ], [ 'label' => 'Laporan', 'access' => 'admin', 'items' => [ ['icon' => 'check-badge', 'label' => 'Top Week', 'href' => route('top-week.index'), 'match' => 'portal/top-week', 'access' => 'admin'], ['icon' => 'chart-bar-square', 'label' => 'Pelaporan', 'href' => '/admin/reports', 'match' => 'admin/reports*', 'access' => 'admin', 'sub' => [ ['label' => 'Statistik Pelayanan', 'href' => '/admin/reports/services'], ['label' => 'Statistik Penduduk', 'href' => '/admin/reports/citizens'], ['label' => 'Export Data', 'href' => '/admin/reports/export'], ]], ], ], [ 'label' => 'Manajemen Pegawai', 'access' => 'admin', 'items' => [ ['icon' => 'user-cog', 'label' => 'Pegawai Gov', 'href' => route('disnaker.users.index'), 'match' => 'portal/disnaker/users*', 'access' => 'admin', 'sub' => [ ['label' => 'Daftar Pegawai', 'href' => route('disnaker.users.index')], ['label' => 'Tambah Pegawai', 'href' => route('disnaker.users.create')], ['label' => 'Hak Akses (Roles)', 'href' => route('disnaker.users.index') . '#roles'], ]], ['icon' => 'users', 'label' => 'Manajemen Pengguna', 'href' => route('admin.users.index'), 'match' => 'admin/users*', 'access' => 'admin', 'sub' => [ ['label' => 'Daftar Pengguna', 'href' => route('admin.users.index')], ['label' => 'Tambah Pengguna', 'href' => route('admin.users.create')], ['label' => 'Hak Akses (Roles)', 'href' => route('admin.users.index') . '#roles'], ]], ], ], [ 'label' => 'Notifikasi', 'access' => 'operator', 'items' => [ ['icon' => 'bell', 'label' => 'Notifikasi', 'href' => '/admin/notifications', 'match' => 'admin/notifications*', 'access' => 'operator', 'sub' => [ ['label' => 'Semua Notifikasi', 'href' => '/admin/notifications'], ['label' => 'Antrian Discord', 'href' => '/admin/notifications/discord'], ]], ], ], [ 'label' => 'Keamanan', 'access' => 'admin', 'items' => [ ['icon' => 'shield-check', 'label' => 'Audit & Log', 'href' => '/admin/audit', 'match' => 'admin/audit*', 'access' => 'admin', 'sub' => [ ['label' => 'Audit Log', 'href' => '/admin/audit/log'], ['label' => 'Login History', 'href' => '/admin/audit/login'], ['label' => 'Riwayat Persetujuan', 'href' => '/admin/audit/approvals'], ]], ], ], [ 'label' => 'Pengembangan', 'access' => 'operator', 'items' => [ ['icon' => 'beaker', 'label' => 'Dev UI Kit', 'href' => route('dev.uikit'), 'match' => 'dev/uikit', 'access' => 'operator'], ['icon' => 'swatch', 'label' => 'UI Docs', 'href' => route('ui-docs.batch1'), 'match' => 'portal/ui-docs*', 'access' => 'operator', 'sub' => [ ['label' => 'Batch 1: Layout & Grid', 'href' => route('ui-docs.batch1')], ['label' => 'Batch 2: Forms', 'href' => route('ui-docs.batch2')], ['label' => 'Batch 3: Navigasi', 'href' => route('ui-docs.batch3')], ['label' => 'Batch 4: Feedback', 'href' => route('ui-docs.batch4')], ['label' => 'Batch 5: UI Elements', 'href' => route('ui-docs.batch5')], ]], ], ], [ 'label' => 'Pengaturan', 'access' => 'admin', 'items' => [ ['icon' => 'cog-6-tooth', 'label' => 'Pengaturan', 'href' => '/admin/settings', 'match' => 'admin/settings*', 'access' => 'admin', 'sub' => [ ['label' => 'Umum', 'href' => '/admin/settings/general'], ['label' => 'Tema', 'href' => '/admin/settings/theme'], ['label' => 'SMTP', 'href' => '/admin/settings/smtp'], ['label' => 'Discord', 'href' => '/admin/settings/discord'], ['label' => 'Tanda Tangan', 'href' => '/admin/settings/signature'], ['label' => 'Watermark', 'href' => '/admin/settings/watermark'], ]], ], ], ]; @endphp {{-- Mobile overlay --}}