import{v as u,ab as d,l as _,r as n,ax as f,aC as L,ac as M,a7 as g,aO as w,af as P,g as m}from"./vendor-core-CzvSW5ae.js";import{c as T}from"./useCompMetaLocalStore-eE-CBcE9.js";import{E as v,q as r}from"./index-B5qe6yln.js";import{_ as b}from"./index.vue_vue_type_script_setup_true_lang-DM_Wm4GD.js";import{_ as I}from"./EmptyStatusContainer.vue_vue_type_script_setup_true_lang-CofI0Rvq.js";import"./vendor-ui-DXwyveTF.js";import"./useVscodeOpen-Dx3IRL0P.js";import"./useMessage-CYVXvlqq.js";const O={class:"size-full"},R=u({__name:"index",props:{version:{},compAttrs:{}},setup(a){return(l,e)=>(d(),_("div",O,[n(b,{compAttrs:a.compAttrs,version:a.version,compType:f(v).IFRAME_ROUTES.ITEM.PREVIEW_LOCAL},null,8,["compAttrs","version","compType"])]))}}),k={class:"size-full"},j=u({__name:"index",setup(a){const l=L(),{compId:e}=l.params,t=T(e)(),h=new Map;M(v.PROVIDE_KEY_CALLBACKS,h);const o=P(!1),s=m(()=>t.detail),E=m(()=>Object.keys(s.value??{}).length>0);async function A(){if(!e)return;o.value=!0;const c=await r.v1Comp.compcontrollerLocalcompdetailbypathhash({fullPathHash:e}),i=await r.v1Comp.compcontrollerDep({compPath:c.data.path}),{thirdParty:p=[]}=i.data,y=p.map(x=>x.name),C=await r.v1Module.modulecontrollerPrebuild({deps:y}),{entryNameToFile:D={}}=C.data;t.setDetail(c.data),t.setDep(p),t.setDepToFile(D),o.value=!1}return g(async()=>{await A()}),(c,i)=>(d(),_("div",k,[n(f(I),{isEmpty:!E.value,loading:o.value,class:"size-full"},{default:w(()=>[n(R,{compAttrs:s.value,version:s.value.version},null,8,["compAttrs","version"])]),_:1},8,["isEmpty","loading"])]))}});export{j as default};
