import{C as r,N as m,P as f,u as c,O as P,L,q as h,Q as l,R as v,S as R,J as S,T as u,U as T,V as b,W as g,X as j,Y as _,Z as x,j as A}from"./entry.182f7a9e.js";const B=r({name:"LayoutLoader",inheritAttrs:!1,props:{name:String,layoutProps:Object},async setup(a,o){const t=await l[a.name]().then(e=>e.default||e);return()=>u(t,a.layoutProps,o.slots)}}),O=r({name:"NuxtLayout",inheritAttrs:!1,props:{name:{type:[String,Boolean,Object],default:null}},setup(a,o){const t=S(),e=m(f),s=e===c()?P():e,n=L(()=>A(a.name)??s.meta.layout??"default"),i=h();o.expose({layoutRef:i});const p=t.deferHydration();return()=>{const d=n.value&&n.value in l,y=s.meta.layoutTransition??v;return R(j,d&&y,{default:()=>u(g,{suspensible:!0,onResolve:()=>{b(p)}},{default:()=>u(C,{layoutProps:T(o.attrs,{ref:i}),key:n.value,name:n.value,shouldProvide:!a.name,hasTransition:!!y},o.slots)})}).default()}}}),C=r({name:"NuxtLayoutProvider",inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean}},setup(a,o){const t=a.name;return a.shouldProvide&&_(x,{isCurrent:e=>t===(e.meta.layout??"default")}),()=>{var e,s;return!t||typeof t=="string"&&!(t in l)?(s=(e=o.slots).default)==null?void 0:s.call(e):u(B,{key:t,layoutProps:a.layoutProps,name:t},o.slots)}}});export{O as _};
