import{q as h,b as k}from"./customComponents-8Hj9M-RR.js";import{C as f,q as l,x as d,as as B,cr as b,cc as y,D as v,a3 as _,E as i,Q as O,u as I,K as S}from"./vendor-BGtMsOoo.js";import{O as D}from"./index-CRze-aDK.js";const K={key:0},N=f({__name:"vp-builder-io",props:{content:{}},setup(a){const n=a,{modulesSettings:c}=D(),o=l(()=>{var e;return(e=c.value)==null?void 0:e.find(t=>t.moduleId==="VirtoCommerce.BuilderIO")}),p=l(()=>{var e,t;return((t=(e=o.value)==null?void 0:e.settings.find(C=>C.name==="BuilderIO.PublicApiKey"))==null?void 0:t.value)||"NO_KEY"}),s=d(!1),u=d(null);function m(){u.value=null,s.value=!1}B(n,()=>{r()}),b(()=>{n.content?r():m()});function r(){if(!n.content)return;const e=JSON.parse(n.content);u.value={data:{blocks:e}},s.value=!0}y((e,t)=>{e.path!==t.path&&(m(),r())});const g=()=>k;return(e,t)=>e.content?(i(),v("div",K,[O(I(h),{model:"page",content:u.value,"api-key":p.value,"custom-components":g()},null,8,["content","api-key","custom-components"])])):_("",!0)}}),E=f({__name:"virto-pages",props:{pageDocument:{}},setup(a){const n=a,c=l(()=>{var o;return((o=n.pageDocument)==null?void 0:o.source)==="builder.io"});return(o,p)=>{var s;return i(),v("div",null,[c.value?(i(),S(N,{key:0,content:(s=o.pageDocument)==null?void 0:s.content},null,8,["content"])):_("",!0)])}}});export{E as default};
//# sourceMappingURL=virto-pages-B3YBRsfP.js.map
