const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/builder-io-C3tnJe78.js","assets/customComponents-twZNGYGk.js","assets/index-Dqv5IkpS.js","assets/vendor-bSWkQivH.js","assets/index-CHJVabrQ.css","assets/customComponents-CoXMEGm4.css","assets/slug-content-BX-4zVI0.js","assets/useSlugInfo-cU0FszRY.js","assets/slug-content-RU2OMyzC.css","assets/internal-DrRneqKX.js"])))=>i.map(i=>d[i]);
import{O as V,a7 as B,bK as R,d as _}from"./index-Dqv5IkpS.js";import{K as T,B as a,r as w,av as L,S as M,L as g,M as o,P as c,a7 as d,b,ak as I,V as x}from"./vendor-bSWkQivH.js";function D(p){const n=p.filter(r=>r.isActive&&r.state!=="empty").sort((r,m)=>r.priority-m.priority);return n.length?n[0].state==="ready"?n[0].id:"loader":null}const K={class:"matcher"},N={key:3},Q=T({__name:"matcher",props:{pathMatch:{}},setup(p){const n=p,r={builderIo:1,slugContent:2,internal:3},m=I(()=>_(()=>import("./builder-io-C3tnJe78.js"),__vite__mapDeps([0,1,2,3,4,5]))),C=I(()=>_(()=>import("./slug-content-BX-4zVI0.js"),__vite__mapDeps([6,2,3,4,7,8]))),h=I(()=>_(()=>import("./internal-DrRneqKX.js"),__vite__mapDeps([9,2,3,4]))),{modulesSettings:A,themeContext:O}=V(),s=a(()=>{var t;return{...r,...(t=O.value.settings.previewers_settings)==null?void 0:t.priorities}}),S=B("view"),f=a(()=>{var t;return(t=A.value)==null?void 0:t.find(e=>e.moduleId==="VirtoCommerce.BuilderIO")}),E=a(()=>{var t,e;return(e=(t=f.value)==null?void 0:t.settings.find(u=>u.name==="BuilderIO.Enable"))==null?void 0:e.value}),P=a(()=>{var t,e;return(e=(t=f.value)==null?void 0:t.settings.find(u=>u.name==="BuilderIO.PublicApiKey"))==null?void 0:e.value}),i=w({builderIo:{id:"builderIo",priority:s.value.builderIo,state:"initial",isActive:E.value},slugContent:{id:"slugContent",priority:s.value.slugContent,state:"initial",isActive:!0},internal:{id:"internal",priority:s.value.internal,state:"initial",isActive:!0}}),l=a(()=>D(Object.values(i.value)));function y(t,e){i.value[e]&&(i.value[e].state=t)}const k=a(()=>Array.isArray(n.pathMatch)?n.pathMatch:["/"]);return L(S,t=>{t==="default"?i.value.slugContent.priority=Math.min(...Object.values(s.value))-1:i.value.slugContent.priority=s.value.slugContent,window.scrollTo({top:0,behavior:"smooth"})},{immediate:!0}),(t,e)=>{const u=M("VcLoaderOverlay");return o(),g("div",K,[i.value.slugContent.isActive?(o(),c(b(C),{key:0,"is-visible":l.value==="slugContent","path-match":k.value,onSetState:e[0]||(e[0]=v=>y(v,"slugContent"))},null,8,["is-visible","path-match"])):d("",!0),i.value.builderIo.isActive?(o(),c(b(m),{key:1,"is-visible":l.value==="builderIo","api-key":P.value,onSetState:e[1]||(e[1]=v=>y(v,"builderIo"))},null,8,["is-visible","api-key"])):d("",!0),i.value.internal.isActive?(o(),c(b(h),{key:2,"is-visible":l.value==="internal",onSetState:e[2]||(e[2]=v=>y(v,"internal"))},null,8,["is-visible"])):d("",!0),l.value==="loader"?(o(),g("div",N,[x(u)])):d("",!0),l.value?d("",!0):(o(),c(R,{key:4}))])}}});export{Q as default};
//# sourceMappingURL=matcher-BgIWde4G.js.map
