(()=>{"use strict";var e={658:function(e,n,r){var o=this&&this.__awaiter||function(e,n,r,o){return new(r||(r=Promise))((function(t,i){function s(e){try{c(o.next(e))}catch(e){i(e)}}function u(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?t(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(s,u)}c((o=o.apply(e,n||[])).next())}))};Object.defineProperty(n,"__esModule",{value:!0}),n.runServer=void 0;const t=r(81),i=r(147),s=r(37),u=r(17),c=e=>{const n="node_modules/@omega-edit/server",r=[u.join(e,`${n}/bin`),u.join(e,`${n}/out/bin`)];for(var o=0;o<r.length;o++)if(i.existsSync(r[o]))return u.resolve(r[o]);return d(u.join(e,"../"))},d=e=>e.endsWith("node_modules")?c(e.replace("node_modules","")):i.readdirSync(e).includes("node_modules")?c(e):d(u.join(e,"../"));n.runServer=function(e,n="127.0.0.1",r=undefined,c=undefined){return o(this,void 0,void 0,(function*(){const a=[`--interface=${n}`,`--port=${e}`];return r&&a.push(`--pidfile=${r}`),c&&i.existsSync(c)&&a.push(`-Dlogback.configurationFile=${c}`),yield function(e){return o(this,void 0,void 0,(function*(){const n=u.join(d(u.resolve(__dirname)),"win32"===s.platform()?"omega-edit-grpc-server.bat":"omega-edit-grpc-server");i.chmodSync(n,"755");const r=t.spawn(n,e,{cwd:u.dirname(n),stdio:"ignore",detached:!0});return r.on("error",(e=>{if(!e.message.includes("Call cancelled"))throw e})),r}))}(a)}))}},81:e=>{e.exports=require("child_process")},147:e=>{e.exports=require("fs")},37:e=>{e.exports=require("os")},17:e=>{e.exports=require("path")}},n={},r=function r(o){var t=n[o];if(void 0!==t)return t.exports;var i=n[o]={exports:{}};return e[o].call(i.exports,i,i.exports,r),i.exports}(658);module.exports=r})();
//# sourceMappingURL=index.js.map