import{J as V,X as h,Y as b,K as y,L as C,M as w,O as v,P as x,A as c,B as t,C as $,N as T,E as d,S as a,c as N,Q as i,b as n,V as k,G as p,U as B}from"#entry";import{V as A}from"./C63UuyGC.js";import{V as H,a as M}from"./DlybGOWB.js";import{V as S}from"./DArAxlee.js";import"./BML-0xFj.js";import"./DSnRMG2T.js";import"./CIr4U5gS.js";const L={class:"font-weight-semibold"},O=V({__name:"[slug]",async setup(P){let s,l;const{t:o}=h(),{$notify:u}=b(),m=y("settings"),f=C(),{data:e,refresh:_}=([s,l]=w(()=>T(`/api/pages/${f.params.slug}`,"$HgIisT4fpk")),s=await s,l(),s);if(!e.value)throw v({status:404,statusMessage:"Page not found"});x(()=>({title:`${m.value.title} - ${e.value?.title}`}));async function g(){if(e.value)try{await $fetch(`/api/pages/${e.value.id}`,{method:"PUT",body:{...e.value,visible:!0}}),_(),u(o("common.enabled"))}catch(r){u(String(r))}}return(r,E)=>(d(),c($,null,{default:t(()=>[a(e)?.visible?B("",!0):(d(),c(A,{key:0,type:"warning",rounded:"",class:"mb-4"},{append:t(()=>[n(k,{color:"warning",onClick:g},{default:t(()=>[p(i(a(o)("common.enable")),1)]),_:1})]),default:t(()=>[N("span",L,i(a(o)("admin.page_is_disabled")),1)]),_:1})),n(H,null,{default:t(()=>[n(M,{class:"text-h4 font-weight-bold"},{default:t(()=>[p(i(a(e)?.title),1)]),_:1}),n(S,{innerHTML:a(e)?.content},null,8,["innerHTML"])]),_:1})]),_:1}))}});export{O as default};
