import{x as i,y as E,C as N,E as e,z as O,ax as j,J as A,L as z}from"./vendor-CsGITfgk.js";import{bv as J,bw as K,bx as Q,by as R,g as V}from"./index-GCDRvGOr.js";function F(n){return i(J,n,{fetchPolicy:"cache-and-network"})}function U(n){return i(K,n,{fetchPolicy:"cache-and-network"})}function _(n){return E(Q,n,{fetchPolicy:"cache-and-network"})}function H(n){const g=N(R,""),{storeId:u,userId:f,cultureName:r}=V,m=e(()=>({storeId:u,userId:f,cultureName:r,permalink:O(n)})),{result:y,loading:d,error:p}=_(m),t=e(()=>p.value?null:y.value?.slugInfo),v=e(()=>t.value?.entityInfo?.outline),a=e(()=>t.value?.entityInfo?.objectType),I=e(()=>t.value?{metaKeywords:t.value?.entityInfo?.metaKeywords,metaDescription:t.value?.entityInfo?.metaDescription,pageTitle:t.value?.entityInfo?.pageTitle}:null),D=e(()=>a.value==="ContentFile"),P=e(()=>a.value==="Pages"),l=e(()=>({id:t?.value?.entityInfo?.objectId||"?",cultureName:r,storeId:u})),{load:C,result:s,loading:h,error:b}=F(l),{load:w,result:T,loading:G,error:L}=U(l),S=e(()=>{if(b.value)return null;let o;return typeof s?.value?.page?.content=="string"&&(o=JSON.parse(s.value.page.content)),x(o)?o:null}),k=e(()=>L.value?null:T?.value?.pageDocument||null);function x(o){const c=o;return Array.isArray(c?.content)&&typeof c?.settings=="object"}return j(v,async o=>{await z(),g.value=o??""},{immediate:!0}),{loading:e(()=>d.value||h.value||G.value),slugInfo:t,objectType:a,hasContent:D,pageContent:S,seoInfo:A(I),fetchContent:C,hasPageDocumentContent:P,pageDocumentContent:k,fetchPageDocumentContent:w}}export{H as u};
//# sourceMappingURL=useSlugInfo-vjQlUSx_.js.map
