varOS;!function(t){lete;!function(e){classi{constructor(e){this.worker=newWorker(e.asFileHandle().getlink()),this.jobs={},this.worker.onmessage=t=>{lete=t.data,i=this.jobs[e.id];i?"log"===e.type?i.logger&&(e.error?i.logger.error(e.result):!1===e.show_time&&i.logger.print?i.logger.print(e.result):i.logger.info(e.result)):(i.callback(e),deletethis.jobs[e.id]):console.log("Unable to identify result of job",e.id,e)};consti={};for(consteint.setting.system.packages){consts=t.setting.system.packages[e];i[e]={path:s.path,name:s.pkgname}}this.submit("sdk-setup",{REST:t.API.REST,pkgs:i})}newJobID(){return"job_"+Math.random().toString(36).replace(".","")}exectue_job(t,e,i,s,r){consto=this.newJobID(),n={id:o,cmd:t,data:e,root:i};this.jobs[o]={callback:s,logger:r},this.worker.postMessage(n)}submit(t,e,i,s){returnnewPromise((r,o)=>{this.exectue_job(t,e,i,t=>{if(t.error)returno(t.error);r(t.result)},s)})}terminate(){this.worker.terminate()}}classs{constructor(t,e){this.root=e,this.logger=t,s.worker||(s.worker=newi("pkg://libantosdk/core/worker.js"))}require(t){returnthis.run("sdk-import",t.map(t=>t+".worker.js"))}compile(t,e){returnnewPromise(async(i,s)=>{try{awaitthis.require([t]),i(awaitthis.run(t+"-compile",e))}catch(t){s(__e(t))}})}run(e,i){return"sdk-run-app"===e?newPromise(async(e,s)=>{try{lets=i;1==s.split("://").length&&(s=`${this.root}/${i}`);constr=await(s+"/package.json").asFileHandle().read("json");returnr.text=r.name,r.path=s,r.filename=r.pkgname,r.type="app",r.mime="antos/app",r.icon&&(r.icon=`${r.path}/${r.icon}`),r.iconclass||r.icon||(r.iconclass="fa fa-adn"),this.logger.info(__("Installing...")),t.setting.system.packages[r.pkgname]=r,r.app?(this.logger.info(__("Running {0}...",r.app)),t.GUI.forceLaunch(r.app,[])):this.logger.error(__("{0} is not an application",r.pkgname)),e(void0)}catch(t){s(t)}}):s.worker.submit(e,i,this.root,this.logger)}batch(t,e){returne.root&&(this.root=e.root),newPromise(async(i,s)=>{try{e.targets||s("No target found");for(constioft){constt=e.targets[i];if(!t)returns(__("No target: {0}",i));if(t.depend&&awaitthis.batch(t.depend,e),t.require&&awaitthis.require(t.require),this.logger&&this.logger.info(__("### RUNNING STAGE: {0}###",i).__()),t.jobs)for(consteoft.jobs)awaitthis.run(e.name,e.data)}i(void0)}catch(t){s(t)}})}}letr;e.AntOSDKBuilder=s,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)}(r=e.VFS||(e.VFS={}))}(e=t.API||(t.API={}))}(OS||(OS={})),function(t){lete;!function(e){classi{constructor(t){this.target=t}info(t){this.log("info",t,!0)}warn(t){this.log("warn",t,!0)}error(t){this.log("error",t,!0)}log(t,e,i){lets=$("<pre></pre>").attr("class","sdk-log-"+t);if(i){lett=newDate,i=t.getDate()+"/"+(t.getMonth()+1)+"/"+t.getFullYear()+" "+t.getHours()+":"+t.getMinutes()+":"+t.getSeconds();s.text(`[${i}]: ${e.__()}`)}elses.text(e.__());$(this.target).append(s),$(this.target).scrollTop($(this.target)[0].scrollHeight)}print(t){t.match(/warn/i)?this.log("warn",t,!1):t.match(/error/i)?this.log("error",t,!1):this.log("info",t,!1)}clear(){$(this.target).empty()}}classsextendse.BaseApplication{constructor(t){super("libantosdk",t)}main(){this.logger=newi(this.find("container")),this.sdk=newt.API.AntOSDKBuilder(this.logger,""),this.filehandle=void0,this.options=void0,this.targets=this.find("target-list"),this.args&&this.args.length>0&&(this.filehandle=this.args[0].path.asFileHandle()),this.find("btnbuild").onbtclick=t=>{conste=this.targets.selectedItem;e&&this.load(this.compile([e.data.text]))},this.find("btnclear").onbtclick=t=>{this.logger.clear()},this.find("btnrefresh").onbtclick=t=>{this.open()},this.find("btnopen").onbtclick=asynct=>{try{constt=awaitthis.openDialog("FileDialog",{title:__("Select build file"),mimes:this.meta().mimes});this.filehandle=t.file.path.asFileHandle(),this.open()}catch(t){this.logger.error(t.toString())}},this.open()}open(){void0!==this.filehandle&&this.filehandle.re