import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{a as t,c as n,p as r,r as i,t as a}from"./vendor-react-iIHq6SOl.js";import{o,r as s}from"./main-DgxOmW_I.js";var c=e(r(),1),l=a(),u=o(`/image/icon.png`);function d({children:e}){let r=n(),{user:a,logoutContext:o}=s(),[d,f]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let e=()=>{window.innerWidth>=901?f(!0):f(!1)};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[]),(0,c.useEffect)(()=>{window.innerWidth<901&&f(!1)},[r.pathname]);let p=()=>r.pathname.startsWith(`/admin/permohonan`)?`Data Permohonan`:r.pathname.startsWith(`/admin/tanggal-diblokir`)?`Kalender & Blokir`:r.pathname.startsWith(`/admin/kontak`)?`Kontak & Telepon`:r.pathname.startsWith(`/admin/review`)?`Rating & Review`:r.pathname.startsWith(`/admin/dinas`)?`Master Data Dinas`:r.pathname.startsWith(`/admin/users`)?`Manajemen Admin`:`Dashboard Utama`,m=a?.name||a?.nama||localStorage.getItem(`admin_nama`)||`Admin`;return(0,l.jsxs)(`div`,{style:{minHeight:`100vh`,display:`flex`,flexDirection:`column`},children:[(0,l.jsx)(`style`,{children:`
        /* Reset & Base Admin Variables */
        :root {
            --navy-admin: #0028B3;
            --navy-dark-admin: #001178;
            --green-soft: #C5DBFF;
            --gray-bg: #F6F7FA;
            --border: #E4E7ED;
        }
        
        .admin-overlay { position: fixed; inset: 0; background: rgba(0,17,120,0.45); backdrop-filter: blur(4px); z-index: 600; opacity: 0; visibility: hidden; transition: opacity 0.35s ease, visibility 0.35s ease; }
        .admin-overlay.active { opacity: 1; visibility: visible; }
        
        .admin-sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: 270px; max-width: 82vw; background: white; box-shadow: 4px 0 24px rgba(0,17,120,0.06); border-right: 1px solid var(--border); z-index: 601; transform: translateX(-100%); transition: transform 0.35s cubic-bezier(0.4,0,0.2,1); display: flex; flex-direction: column; }
        .admin-sidebar.active { transform: translateX(0); }
        
        .admin-sidebar-header { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--border); position: relative; }
        .admin-sidebar-logo { height: 38px; width: auto; flex-shrink: 0; }
        .admin-sidebar-title { font-size: 14px; font-weight: 700; color: #001178; line-height: 1.3; }
        .admin-sidebar-sub { font-size: 11.5px; color: #64748B; margin-top: 2px; }
        
        .admin-sidebar-nav { padding: 16px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow-y: auto; }
        .admin-nav-btn { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; border: none; background: transparent; color: #64748B; font-size: 13.5px; font-weight: 600; cursor: pointer; text-align: left; text-decoration: none; transition: all 0.2s cubic-bezier(0.4,0,0.2,1); }
        .admin-nav-btn svg { width: 18px; height: 18px; flex-shrink: 0; }
        .admin-nav-btn:hover { background: #C5DBFF; color: #001178; }
        .admin-nav-btn.active { background: #C5DBFF; color: #001178; font-weight: 700; box-shadow: 0 2px 6px rgba(117,195,255,0.15); }
        
        .admin-sidebar-footer { padding: 16px 18px 20px; border-top: 1px solid var(--border); }
        .admin-side-info { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
        .admin-side-avatar { width: 36px; height: 36px; border-radius: 50%; background: #C5DBFF; color: #001178; font-size: 13.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 2px 6px rgba(117,195,255,0.15); }
        .admin-side-name { font-size: 13.5px; font-weight: 700; color: #0F172A; line-height: 1.3; }
        .admin-side-role { font-size: 11.5px; color: #64748B; margin-top: 1px; }
        
        .admin-logout-btn { width: 100%; background: var(--gray-bg); color: #0F172A; border: 1px solid var(--border); border-radius: 8px; padding: 11px; font-size: 13px; font-weight: 700; cursor: pointer; transition: all 0.2s; min-height: 42px; }
        .admin-logout-btn:hover { background: #FEE2E2; color: #B91C1C; border-color: #FCA5A5; }

        .admin-topbar { background: #fff; color: var(--navy-dark-admin); box-shadow: 0 1px 4px rgba(0,17,120,0.06); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 200; }
        .admin-topbar-inner { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; flex-wrap: wrap; gap: 10px; }
        
        .admin-main { padding: 16px; flex: 1; width: 100%; box-sizing: border-box; background: var(--gray-bg); }

        @media (min-width: 601px) {
            .admin-main { padding: 24px 28px; }
        }

        @media (min-width: 901px) {
            .admin-topbar { display: none !important; }
            .admin-overlay { display: none !important; }
            .admin-sidebar { transform: translateX(0) !important; }
            .admin-main { margin-left: 270px !important; width: calc(100% - 270px) !important; padding: 32px 40px; transition: margin-left 0.35s cubic-bezier(0.4,0,0.2,1); }
        }
      `}),(0,l.jsx)(`div`,{className:`admin-topbar`,children:(0,l.jsx)(`div`,{className:`admin-topbar-inner`,children:(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`12px`},children:[(0,l.jsx)(`button`,{style:{width:`36px`,height:`36px`,borderRadius:`8px`,border:`1px solid #E5E7EB`,background:`white`,color:`#222`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:`pointer`,flexShrink:0},onClick:()=>f(!0),"aria-label":`Buka Menu`,children:(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:`18`,height:`18`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`line`,{x1:`3`,y1:`12`,x2:`21`,y2:`12`}),(0,l.jsx)(`line`,{x1:`3`,y1:`6`,x2:`21`,y2:`6`}),(0,l.jsx)(`line`,{x1:`3`,y1:`18`,x2:`21`,y2:`18`})]})}),(0,l.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`10px`},children:[(0,l.jsx)(`img`,{src:u,alt:`Logo`,style:{height:`32px`,width:`auto`},referrerPolicy:`no-referrer`}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{style:{fontSize:`13.5px`,fontWeight:`700`,color:`#001178`,lineHeight:`1.2`},children:p()}),(0,l.jsx)(`div`,{style:{fontSize:`11px`,color:`#6B7280`},children:`Sistem Kunjungan Kerja`})]})]})]})})}),(0,l.jsx)(`div`,{className:`admin-overlay ${d?`active`:``}`,onClick:()=>f(!1)}),(0,l.jsxs)(`div`,{className:`admin-sidebar ${d?`active`:``}`,children:[(0,l.jsxs)(`div`,{className:`admin-sidebar-header`,children:[(0,l.jsx)(`img`,{src:u,alt:`Logo`,className:`admin-sidebar-logo`,referrerPolicy:`no-referrer`}),(0,l.jsx)(`div`,{children:(0,l.jsx)(`div`,{className:`admin-sidebar-title`,children:`Sistem Kunjungan Kerja`})})]}),(0,l.jsxs)(`div`,{className:`admin-sidebar-nav`,children:[(0,l.jsxs)(i,{to:`/admin/dashboard`,className:`admin-nav-btn ${r.pathname===`/admin/dashboard`||r.pathname===`/admin`?`active`:``}`,onClick:()=>f(!1),children:[(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`3`,width:`7`,height:`9`}),(0,l.jsx)(`rect`,{x:`14`,y:`3`,width:`7`,height:`5`}),(0,l.jsx)(`rect`,{x:`14`,y:`12`,width:`7`,height:`9`}),(0,l.jsx)(`rect`,{x:`3`,y:`16`,width:`7`,height:`5`})]}),`Dashboard Utama`]}),(0,l.jsxs)(i,{to:`/admin/permohonan`,className:`admin-nav-btn ${r.pathname.startsWith(`/admin/permohonan`)?`active`:``}`,onClick:()=>f(!1),children:[(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`path`,{d:`M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z`}),(0,l.jsx)(`polyline`,{points:`14 2 14 8 20 8`}),(0,l.jsx)(`line`,{x1:`16`,y1:`13`,x2:`8`,y2:`13`}),(0,l.jsx)(`line`,{x1:`16`,y1:`17`,x2:`8`,y2:`17`}),(0,l.jsx)(`polyline`,{points:`10 9 9 9 8 9`})]}),`Data Permohonan`]}),(0,l.jsxs)(i,{to:`/admin/tanggal-diblokir`,className:`admin-nav-btn ${r.pathname.startsWith(`/admin/tanggal-diblokir`)?`active`:``}`,onClick:()=>f(!1),children:[(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`rect`,{x:`3`,y:`4`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,l.jsx)(`line`,{x1:`16`,y1:`2`,x2:`16`,y2:`6`}),(0,l.jsx)(`line`,{x1:`8`,y1:`2`,x2:`8`,y2:`6`}),(0,l.jsx)(`line`,{x1:`3`,y1:`10`,x2:`21`,y2:`10`})]}),`Kalender & Blokir`]}),(0,l.jsxs)(i,{to:`/admin/kontak`,className:`admin-nav-btn ${r.pathname.startsWith(`/admin/kontak`)?`active`:``}`,onClick:()=>f(!1),children:[(0,l.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,l.jsx)(`path`,{d:`M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z`})}),`Kontak & Telepon`]}),(0,l.jsxs)(i,{to:`/admin/review`,className:`admin-nav-btn ${r.pathname.startsWith(`/admin/review`)?`active`:``}`,onClick:()=>f(!1),children:[(0,l.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,l.jsx)(`polygon`,{points:`12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2`})}),`Rating & Review`]}),a?.dinas_id===null&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(i,{to:`/admin/dinas`,className:`admin-nav-btn ${r.pathname.startsWith(`/admin/dinas`)?`active`:``}`,onClick:()=>f(!1),children:[(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`path`,{d:`M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z`}),(0,l.jsx)(`polyline`,{points:`3.27 6.96 12 12.01 20.73 6.96`}),(0,l.jsx)(`line`,{x1:`12`,y1:`22.08`,x2:`12`,y2:`12`})]}),`Master Data Dinas`]}),(0,l.jsxs)(i,{to:`/admin/users`,className:`admin-nav-btn ${r.pathname.startsWith(`/admin/users`)?`active`:``}`,onClick:()=>f(!1),children:[(0,l.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,l.jsx)(`path`,{d:`M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2`}),(0,l.jsx)(`circle`,{cx:`9`,cy:`7`,r:`4`}),(0,l.jsx)(`path`,{d:`M23 21v-2a4 4 0 0 0-3-3.87`}),(0,l.jsx)(`path`,{d:`M16 3.13a4 4 0 0 1 0 7.75`})]}),`Manajemen Admin`]})]})]}),(0,l.jsxs)(`div`,{className:`admin-sidebar-footer`,children:[(0,l.jsxs)(`div`,{className:`admin-side-info`,children:[(0,l.jsx)(`div`,{className:`admin-side-avatar`,children:m?m.charAt(0).toUpperCase():`A`}),(0,l.jsxs)(`div`,{children:[(0,l.jsx)(`div`,{className:`admin-side-name`,children:m}),(0,l.jsx)(`div`,{className:`admin-side-role`,children:a?.dinas?`Admin ${a.dinas.singkatan}`:`Super Admin`})]})]}),(0,l.jsx)(`button`,{className:`admin-logout-btn`,onClick:()=>{o()},children:`Keluar Sesi`})]})]}),(0,l.jsx)(`main`,{className:`admin-main`,children:e||(0,l.jsx)(t,{})})]})}export{d as t};