import"../root/root-legacy.js";import"../platform/platform.js";import"../common/common-legacy.js";import"../text_utils/text_utils-legacy.js";import{Runtime as t}from"../root/root.js";let o;async function e(e){console.timeStamp("Root.Runtime.startApplication");const r={};for(let t=0;t<Root.allDescriptors.length;++t){const o=Root.allDescriptors[t];r[o.name]=o}const n=Root.applicationDescriptor.modules,i=[],s=[];for(let t=0;t<n.length;++t){const o=n[t],e=o.name;i.push(r[e]),"autostart"===o.type&&s.push(e)}for(let t=0;t<i.length;++t)i[t].name=n[t].name,i[t].condition=n[t].condition;const a=t.Runtime.instance({forceNew:!0,moduleDescriptors:i});self.runtime=a,s&&await a.loadAutoStartModules(s),o()}self.Runtime=self.Runtime||{},Runtime=Runtime||{},Root.allDescriptors=Root.allDescriptors||[],Root.applicationDescriptor=Root.applicationDescriptor||void 0,Runtime.appStarted=new Promise(t=>{o=t});var r=Object.freeze({__proto__:null,startApplication:e,startWorker:async function(t){return e().then((function(){self.postMessage("workerReady")}))}});export{r as RuntimeInstantiator};
