import{u as d}from"./C0vPOvVt.js";import{f as C,W as f,p as s,aB as k,aC as v}from"./BmsEUx_s.js";import{u as _}from"./D9cbKXFb.js";import{p as b,k as x,l as t,G as I,H as P,F as L,m as c}from"./BO9AmBA3.js";import{u as l}from"./C5qGsXp4.js";const M=Symbol("CMS_PAGE_LAYOUT");function h(n){b(M,n)}const G=x({__name:"CmsPage",props:{content:{}},setup(n){const i=n,{routeName:m}=C();if(m.value==="frontend.navigation.page"){d();const{category:a}=f(),{updateCategory:o}=_();o(a.value)}const r=t(()=>{var a;return((a=i.content)==null?void 0:a.sections)||[]}),u=t(()=>r.value.some(a=>a.type==="sidebar"));h({layout:u.value?"sidebar":"full-width"}),l(r.value);const g=()=>r.value.map(o=>({name:`CmsSection${s(o.type)}`,component:L(`CmsSection${s(o.type)}`),section:o})).map(o=>{const{cssClasses:p,layoutStyles:e}=k(o.section);return typeof o.component=="string"?c("div",{},"There is no "+o.component):(e!=null&&e.backgroundImage&&(e.backgroundImage=v(e.backgroundImage,o.section)),c(o.component,{content:o.section,class:{...p,"max-w-screen-2xl mx-auto":(e==null?void 0:e.sizingMode)==="boxed"},style:{backgroundColor:e==null?void 0:e.backgroundColor,backgroundImage:e==null?void 0:e.backgroundImage,backgroundSize:e==null?void 0:e.backgroundSize}}))});return(a,o)=>(I(),P(g))}});export{G as _};