import{r as D}from"../chunks/CZYpLWSB.js";import{t as g,a as d,e as H}from"../chunks/CtC4lu6g.js";import{c as v,r as e,t as y,p as K,as as L,Q as M,R as Q,f as k,a as R,s as f,g as o,n as q}from"../chunks/D30UtQFu.js";import{s as w}from"../chunks/DXfZ6d09.js";import{i as B}from"../chunks/DX_wSwg8.js";import{e as j,i as E}from"../chunks/JJhhPwf1.js";import{s as T}from"../chunks/DtgN2C6t.js";import{a as C,s as S}from"../chunks/CczGQeYs.js";import{d as F}from"../chunks/DHVVTbQN.js";/* empty css                */import{p as G}from"../chunks/CyjC7qJT.js";import{t as I}from"../chunks/nfWZ5D1C.js";const J=async({data:s,url:a})=>{if(!s.user&&!a.pathname.startsWith("/mgr/login"))throw D(302,"/mgr/login");return{...s}},da=Object.freeze(Object.defineProperty({__proto__:null,load:J},Symbol.toStringTag,{value:"Module"}));var N=g("<aside><!></aside>");function U(s,a){var r=N();let i;var u=v(r);T(u,()=>a.children),e(r),y(n=>i=C(r,1,"toast svelte-1o3394e",null,i,n),[()=>({"toast--success":a.type==="success","toast--danger":a.type==="danger"})]),d(s,r)}async function V(){await fetch("/mgr/login",{method:"DELETE"}),window.location.reload()}var X=g('<a class="nav-item svelte-st4f7u"> </a>'),Y=g('<nav class="nav svelte-st4f7u"></nav> <div><button class="btn btn--light">Wyloguj</button></div>',1),Z=g('<header class="header container svelte-st4f7u"><div>Admin</div> <!></header> <main class="container"><!></main> <div class="toast-list svelte-st4f7u"></div>',1);function va(s,a){K(a,!0);let r=[{path:"/mgr/home",name:"Home"},{path:"/mgr/aktualnosci",name:"Aktualności"},{path:"/mgr/kadra",name:"Kadra"}],i=L(M([]));I.subscribe(t=>{Q(i,t,!0)});var u=Z(),n=k(u),A=f(v(n),2);{var O=t=>{var l=Y(),m=k(l);j(m,21,()=>r,E,(W,b)=>{var c=X(),z=v(c,!0);e(c),y(()=>{S(c,"href",o(b).path),S(c,"aria-current",G.url.pathname===o(b).path?"page":void 0),w(z,o(b).name)}),d(W,c)}),e(m);var _=f(m,2),p=v(_);p.__click=[V],e(_),d(t,l)};B(A,t=>{a.data.user&&t(O)})}e(n);var h=f(n,2),P=v(h);T(P,()=>a.children),e(h);var x=f(h,2);j(x,21,()=>o(i),E,(t,l)=>{U(t,{get type(){return o(l).type},children:(m,_)=>{q();var p=H();y(()=>w(p,o(l).message)),d(m,p)}})}),e(x),d(s,u),R()}F(["click"]);export{va as component,da as universal};
