varOS;!function(t){lete;!function(e){classr{constructor(e){this.worker=newWorker(e.asFileHandle().getlink()),this.jobs={},this.worker.onmessage=t=>{lete=t.data,r=this.jobs[e.id];r?"log"===e.type?r.logger&&(e.error?r.logger.error(e.result):r.logger.info(e.result)):(r.callback(e),deletethis.jobs[e.id]):console.log("Unable to identify result of job",e.id,e)};constr={};for(consteint.setting.system.packages){consto=t.setting.system.packages[e];r[e]={path:o.path,name:o.pkgname}}this.submit("sdk-setup",{REST:t.API.REST,pkgs:r})}newJobID(){return"job_"+Math.random().toString(36).replace(".","")}exectue_job(t,e,r,o,s){consti=this.newJobID(),n={id:i,cmd:t,data:e,root:r};this.jobs[i]={callback:o,logger:s},this.worker.postMessage(n)}submit(t,e,r,o){returnnewPromise((s,i)=>{this.exectue_job(t,e,r,t=>{if(t.error)returni(t.error);s(t.result)},o)})}terminate(){this.worker.terminate()}}classo{constructor(t,e){this.root=e,this.logger=t,o.worker||(o.worker=newr("pkg://libantosdk/core/worker.js"))}require(t){returnthis.run("sdk-import",t.map(t=>t+".worker.js"))}compile(t,e){returnnewPromise(async(r,o)=>{try{awaitthis.require([t]),r(awaitthis.run(t+"-compile",e))}catch(t){o(__e(t))}})}run(t,e){returno.worker.submit(t,e,this.root,this.logger)}batch(t,e){returne.root&&(this.root=e.root),newPromise(async(r,o)=>{try{e.targets||o("No target found");for(constroft){constt=e.targets[r];if(!t)returno(__("No target: "+r));if(t.depend&&awaitthis.batch(t.depend,e),t.require&&awaitthis.require(t.require),this.logger&&this.logger.info(__(`### RUNNING STAGE: ${r}###`).__()),t.jobs)for(consteoft.jobs)awaitthis.run(e.name,e.data)}r(void0)}catch(t){o(t)}})}}lets;e.AntOSDKBuilder=o,function(t){classeextendst.RemoteFileHandle{constructor(t){super(t);conste="pkg://libantosdk/"+this.genealogy.join("/");this.setPath(e.asFileHandle().path)}}t.SDKFileHandle=e,t.register("^sdk$",e)}(s=e.VFS||(e.VFS={}))}(e=t.API||(t.API={}))}(OS||(OS={})),function(){}.call(this);