diff --git a/dist/index.js b/dist/index.js index 5e36c1d..82fc10f 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,2 +1,2 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("bluebird"),require("fs"),require("child_process"),require("crypto"),require("os"),require("path"),require("regenerator-runtime")):"function"==typeof define&&define.amd?define(["bluebird","fs","child_process","crypto","os","path","regenerator-runtime"],e):"object"==typeof exports?exports["electron-sudo"]=e(require("bluebird"),require("fs"),require("child_process"),require("crypto"),require("os"),require("path"),require("regenerator-runtime")):t["electron-sudo"]=e(t.bluebird,t.fs,t.child_process,t.crypto,t.os,t.path,t["regenerator-runtime"])}(this,function(t,e,r,n,u,o,i){return function(t){function e(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return t[n].call(u.exports,u,u.exports,e),u.loaded=!0,u.exports}var r={};return e.m=t,e.c=r,e.p="./dist",e(0)}([function(t,e,r){t.exports=r(61)},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(32)("wks"),u=r(22),o=r(3).Symbol,i="function"==typeof o,a=t.exports=function(t){return n[t]||(n[t]=i&&o[t]||(i?o:u)("Symbol."+t))};a.store=n},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e,r){var n=r(13);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){var n=r(3),u=r(1),o=r(11),i=r(9),a="prototype",c=function(t,e,r){var s,f,p,l=t&c.F,d=t&c.G,v=t&c.S,h=t&c.P,y=t&c.B,x=t&c.W,b=d?u:u[e]||(u[e]={}),m=b[a],w=d?n:v?n[e]:(n[e]||{})[a];d&&(r=e);for(s in r)f=!l&&w&&void 0!==w[s],f&&s in b||(p=f?w[s]:r[s],b[s]=d&&"function"!=typeof w[s]?r[s]:y&&f?o(p,n):x&&w[s]==p?function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e[a]=t[a],e}(p):h&&"function"==typeof p?o(Function.call,p):p,h&&((b.virtual||(b.virtual={}))[s]=p,t&c.R&&m&&!m[s]&&i(m,s,p)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,r){var n=r(4),u=r(46),o=r(35),i=Object.defineProperty;e.f=r(7)?Object.defineProperty:function(t,e,r){if(n(t),e=o(e,!0),n(r),u)try{return i(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){t.exports=!r(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){var n=r(6),u=r(17);t.exports=r(7)?function(t,e,r){return n.f(t,e,u(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var n=r(47),u=r(26);t.exports=function(t){return n(u(t))}},function(t,e,r){var n=r(25);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,u){return t.call(e,r,n,u)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports={}},function(t,e,r){var n=r(55),u=r(28);t.exports=Object.keys||function(t){return n(t,u)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){var n=r(6).f,u=r(8),o=r(2)("toStringTag");t.exports=function(t,e,r){t&&!u(t=r?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},function(t,e,r){var n=r(26);t.exports=function(t){return Object(n(t))}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){"use strict";var n=r(108)(!0);r(50)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var u=r(71),o=n(u),i=r(70),a=n(i),c="function"==typeof a.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===c(o.default)?function(t){return"undefined"==typeof t?"undefined":c(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"==typeof t?"undefined":c(t)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(13),u=r(3).document,o=n(u)&&n(u.createElement);t.exports=function(t){return o?u.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,r){var n=r(4),u=r(101),o=r(28),i=r(31)("IE_PROTO"),a=function(){},c="prototype",s=function(){var t,e=r(27)("iframe"),n=o.length,u="<",i=">";for(e.style.display="none",r(45).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(u+"script"+i+"document.F=Object"+u+"/script"+i),t.close(),s=t.F;n--;)delete s[c][o[n]];return s()};t.exports=Object.create||function(t,e){var r;return null!==t?(a[c]=n(t),r=new a,a[c]=null,r[i]=t):r=s(),void 0===e?r:u(r,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var n=r(32)("keys"),u=r(22);t.exports=function(t){return n[t]||(n[t]=u(t))}},function(t,e,r){var n=r(3),u="__core-js_shared__",o=n[u]||(n[u]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){var n=r(33),u=Math.min;t.exports=function(t){return t>0?u(n(t),9007199254740991):0}},function(t,e,r){var n=r(13);t.exports=function(t,e){if(!n(t))return t;var r,u;if(e&&"function"==typeof(r=t.toString)&&!n(u=r.call(t)))return u;if("function"==typeof(r=t.valueOf)&&!n(u=r.call(t)))return u;if(!e&&"function"==typeof(r=t.toString)&&!n(u=r.call(t)))return u;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n=r(3),u=r(1),o=r(18),i=r(37),a=r(6).f;t.exports=function(t){var e=u.Symbol||(u.Symbol=o?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:i.f(t)})}},function(t,e,r){e.f=r(2)},function(t,e,r){var n=r(44),u=r(2)("iterator"),o=r(15);t.exports=r(1).getIteratorMethod=function(t){if(void 0!=t)return t[u]||t["@@iterator"]||o[n(t)]}},function(t,e,r){r(112);for(var n=r(3),u=r(9),o=r(15),i=r(2)("toStringTag"),a=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var s=a[c],f=n[s],p=f&&f.prototype;p&&!p[i]&&u(p,i,s),o[s]=o.Array}},function(t,e,r){t.exports={default:r(79),__esModule:!0}},function(t,e,r){t.exports={default:r(84),__esModule:!0}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var u=r(64),o=n(u);e.default=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);ec;)n(a,r=e[c++])&&(~o(s,r)||s.push(r));return s}},function(t,e,r){t.exports=r(9)},function(t,e,r){var n,u,o,i=r(11),a=r(93),c=r(45),s=r(27),f=r(3),p=f.process,l=f.setImmediate,d=f.clearImmediate,v=f.MessageChannel,h=0,y={},x="onreadystatechange",b=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},m=function(t){b.call(t.data)};l&&d||(l=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return y[++h]=function(){a("function"==typeof t?t:Function(t),e)},n(h),h},d=function(t){delete y[t]},"process"==r(14)(p)?n=function(t){p.nextTick(i(b,t,1))}:v?(u=new v,o=u.port2,u.port1.onmessage=m,n=i(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(n=function(t){f.postMessage(t+"","*")},f.addEventListener("message",m,!1)):n=x in s("script")?function(t){c.appendChild(s("script"))[x]=function(){c.removeChild(this),b.call(t)}}:function(t){setTimeout(i(b,t,1),0)}),t.exports={set:l,clear:d}},function(t,e){},function(t,e){t.exports=require("bluebird")},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(62);e.default=function(){var t=process,e=t.platform;switch(e){case"darwin":return n.SudoerDarwin;case"win32":return n.SudoerWin32;case"linux":return n.SudoerLinux;default:throw new Error("Unsupported platform: "+e)}}()},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.SudoerWin32=e.SudoerLinux=e.SudoerDarwin=void 0;var u=r(40),o=n(u),i=r(42),a=n(i),c=r(43),s=n(c),f=r(41),p=n(f),l=r(65),d=n(l),v=r(59),h=r(68),y=n(h),x=r(76),b=n(x),m=r(75),w=n(m),_=r(24),g=n(_),k=r(72),j=n(k),O=r(73),S=n(O),E=r(124),P=r(60),M=r(125),F=r(123),A=r(63),T=(0,v.promisify)(P.readdir),q=(0,v.promisify)(P.unlink),D=(0,v.promisify)(P.rmdir),I=(0,v.promisify)(P.stat),B=(0,v.promisify)(A.mkdir),R=(0,v.promisify)(P.chmod),N=process,L=N.platform,C=N.env,W=function(){function t(e){(0,j.default)(this,t),this.platform=L,this.options=e,this.cp=null,this.tmpdir=(0,E.tmpdir)()}return(0,S.default)(t,[{key:"hash",value:function t(e){var t=(0,F.createHash)("sha256");return t.update("electron-sudo"),t.update(this.options.name||""),t.update(e||new Buffer(0)),t.digest("hex").slice(-32)}},{key:"joinEnv",value:function(t){var e=t.env,r=[];if(e&&"object"==("undefined"==typeof e?"undefined":(0,g.default)(e)))for(var n in e)r.push(n.concat("=",e[n]));return r}},{key:"escapeDoubleQuotes",value:function(t){return t.replace(/"/g,'\\"')}},{key:"encloseDoubleQuotes",value:function(t){return t.replace(/(.+)/g,'"$1"')}},{key:"kill",value:function(t){}}]),t}(),Q=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));return r.options.name||(r.options.name="Electron"),r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"copy",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n,u,o,i,a,c,f,l,v,h;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,I(e);case 2:if(n=t.sent,u=493,!n.isDirectory()){t.next=55;break}return t.prev=5,t.next=8,I(r);case 8:if(o=t.sent,!o.isDirectory()){t.next=14;break}return t.next=12,R(r,u);case 12:t.next=18;break;case 14:return t.next=16,q(r);case 16:return t.next=18,B(r,u);case 18:t.next=24;break;case 20:return t.prev=20,t.t0=t.catch(5),t.next=24,B(r,u);case 24:return i=!0,a=!1,c=void 0,t.prev=27,t.next=30,T(e);case 30:t.t1=t.sent,f=(0,d.default)(t.t1);case 32:if(i=(l=f.next()).done){t.next=39;break}return v=l.value,t.next=36,this.copy((0,M.join)(e,v),(0,M.join)(r,v));case 36:i=!0,t.next=32;break;case 39:t.next=45;break;case 41:t.prev=41,t.t2=t.catch(27),a=!0,c=t.t2;case 45:t.prev=45,t.prev=46,!i&&f.return&&f.return();case 48:if(t.prev=48,!a){t.next=51;break}throw c;case 51:return t.finish(48);case 52:return t.finish(45);case 53:t.next=71;break;case 55:return t.prev=55,t.next=58,I(r);case 58:if(h=t.sent,!h.isDirectory()){t.next=64;break}return t.next=62,D(r);case 62:t.next=66;break;case 64:return t.next=66,R(r,u);case 66:t.next=70;break;case 68:t.prev=68,t.t3=t.catch(55);case 70:return t.abrupt("return",new p.default(function(t,n){var o=(0,P.createReadStream)(e);o.on("error",n);var i=(0,P.createWriteStream)(r,{mode:u});i.on("error",n),i.on("close",t),o.pipe(i)}));case 71:case"end":return t.stop()}},t,this,[[5,20],[27,41,45,53],[46,,48,52],[55,68]])}));return t}()},{key:"remove",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.startsWith(r.tmpdir)){t.next=2;break}throw new Error("Try to remove suspicious target: "+e+".");case 2:return e=n.escapeDoubleQuotes((0,M.normalize)(e)),t.prev=3,t.next=6,(0,A.exec)('rm -rf "'+e+'"');case 6:i=t.sent,u(i),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),o(t.t0);case 13:case"end":return t.stop()}},t,n,[[3,10]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"reset",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,A.exec)("/usr/bin/sudo -k");case 2:case"end":return t.stop()}},t,this)}));return t}()}]),e}(W),U=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));if(t.icns&&"string"!=typeof t.icns)throw new Error("options.icns must be a string if provided.");if(t.icns&&0===t.icns.trim().length)throw new Error("options.icns must be a non-empty string if provided.");return r.up=!1,r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"isValidName",value:function(t){return/^[a-z0-9 ]+$/i.test(t)&&t.trim().length>0&&t.length<70}},{key:"joinEnv",value:function(t){var e=t.env,r=[];if(e&&"object"==("undefined"==typeof e?"undefined":(0,g.default)(e)))for(var n in e)r.push(n.concat("=",e[n]));return r}},{key:"exec",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i,a,c,f;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=r,a=i.joinEnv(n),c=["/usr/bin/sudo -n",a.join(" "),"-s",e].join(" "),f=void 0,t.next=3,i.reset();case 3:return t.prev=3,t.next=6,(0,A.exec)(c,n);case 6:f=t.sent,u(f),t.next=24;break;case 10:return t.prev=10,t.t0=t.catch(3),t.prev=12,t.next=15,i.prompt();case 15:return t.next=17,(0,A.exec)(c,n);case 17:f=t.sent,u(f),t.next=24;break;case 21:t.prev=21,t.t1=t.catch(12),o(t.t1);case 24:case"end":return t.stop()}},t,r,[[3,10],[12,21]])}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"spawn",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n=this,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(o,i){var c,f,p;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n,f="/usr/bin/sudo",p=void 0,t.next=3,c.reset();case 3:return t.next=5,c.prompt();case 5:p=(0,A.spawn)(f,["-n","-s","-E",[e].concat((0,a.default)(r)).join(" ")],u),p.on("error",function(){var t=(0,v.coroutine)(s.default.mark(function t(e){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i(e);case 1:case"end":return t.stop()}},t,n)}));return function(e){return t.apply(this,arguments)}}()),c.cp=p,o(p);case 9:case"end":return t.stop()}},t,n)}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"prompt",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){var e,r=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(n,u){var o,i,a,c;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.tmpdir){t.next=2;break}return t.abrupt("return",u(new Error("Requires os.tmpdir() to be defined.")));case 2:if(C.USER){t.next=4;break}return t.abrupt("return",u(new Error("Requires env['USER'] to be defined.")));case 4:return e.up=!0,t.next=7,e.readIcns();case 7:return o=t.sent,i=e.hash(o),a=(0,M.join)((0,M.dirname)(__filename)+"/bin","applet.app"),c=(0,M.join)(e.tmpdir,i,e.options.name+".app"),t.prev=10,t.next=13,(0,A.mkdir)((0,M.dirname)(c));case 13:t.next=19;break;case 15:if(t.prev=15,t.t0=t.catch(10),"EEXIST"===t.t0.code){t.next=19;break}return t.abrupt("return",u(t.t0));case 19:return t.prev=19,t.next=22,e.copy(a,c);case 22:return t.next=24,e.icon(c);case 24:return t.next=26,e.propertyList(c);case 26:return t.next=28,e.open(c);case 28:return t.next=30,e.remove(c);case 30:t.next=35;break;case 32:return t.prev=32,t.t1=t.catch(19),t.abrupt("return",u(t.t1));case 35:return t.abrupt("return",n(i));case 36:case"end":return t.stop()}},t,r,[[10,15],[19,32]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"icon",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n.options.icns){t.next=2;break}return t.abrupt("return",u());case 2:return t.next=4,r.copy(n.options.icns,(0,M.join)(e,"Contents","Resources","applet.icns"));case 4:return i=t.sent,t.abrupt("return",u(i));case 6:case"end":return t.stop()}},t,n)}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"open",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.escapeDoubleQuotes((0,M.normalize)(e)),t.prev=1,t.next=4,(0,A.exec)('open -n -W "'+e+'"');case 4:return i=t.sent,t.abrupt("return",u(i));case 8:return t.prev=8,t.t0=t.catch(1),t.abrupt("return",o(t.t0));case 11:case"end":return t.stop()}},t,n,[[1,8]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"readIcns",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(n,u){var o;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&"darwin"===L){t.next=2;break}return t.abrupt("return",n(new Buffer(0)));case 2:return t.prev=2,t.next=5,(0,A.readFile)(e);case 5:return o=t.sent,t.abrupt("return",n(o));case 9:return t.prev=9,t.t0=t.catch(2),t.abrupt("return",u(t.t0));case 12:case"end":return t.stop()}},t,r,[[2,9]])}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"propertyList",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i,a,c,f;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=r.escapeDoubleQuotes((0,M.join)(e,"Contents","Info.plist")),a=r.escapeDoubleQuotes("CFBundleName"),c=r.options.name+" Password Prompt",!/'/.test(c)){t.next=3;break}return t.abrupt("return",o(new Error("Value should not contain single quotes.")));case 3:return t.next=5,(0,A.exec)('defaults write "'+i+'" "'+a+"\" '"+c+"'");case 5:return f=t.sent,t.abrupt("return",u(f));case 7:case"end":return t.stop()}},t,n)}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()}]),e}(Q),Y=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));return r.binary=null,r.paths=["/usr/bin/gksudo","/usr/bin/pkexec","./bin/gksudo"],r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"getBinary",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){var e=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.default.all(this.paths.map(function(){var t=(0,v.coroutine)(s.default.mark(function t(r){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,A.stat)(r);case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",null);case 10:case"end":return t.stop()}},t,e,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()));case 2:return t.t0=function(t){return t},t.abrupt("return",t.sent.filter(t.t0)[0]);case 4:case"end":return t.stop()}},t,this)}));return t}()},{key:"exec",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,i){var a,c,f;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r,c=void 0,a.binary){t.next=5;break}return t.next=4,a.getBinary();case 4:a.binary=t.sent;case 5:return n.env instanceof Object&&!n.env.DISPLAY&&(n.env=(0,o.default)(n.env,{DISPLAY:":0"})),f=void 0,/gksudo/i.test(a.binary)?f="--preserve-env --sudo-mode "+('--description="'+a.escapeDoubleQuotes(a.options.name)+'"'):/pkexec/i.test(a.binary)&&(f="--disable-internal-agent"),e=r.binary+" "+f+" "+e,t.prev=9,t.next=12,(0,A.exec)(e,n);case 12:return c=t.sent,t.abrupt("return",u(c));case 16:return t.prev=16,t.t0=t.catch(9),t.abrupt("return",i(t.t0));case 19:case"end":return t.stop()}},t,r,[[9,16]])}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"spawn",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n,u=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(a,c){var f,p;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n.binary){t.next=4;break}return t.next=3,n.getBinary();case 3:n.binary=t.sent;case 4:return i.env instanceof Object&&!i.env.DISPLAY&&(i.env=(0,o.default)(i.env,{DISPLAY:":0"})),f=[],/gksudo/i.test(n.binary)?(f.push("--preserve-env"),f.push("--sudo-mode"),f.push('--description="'+n.escapeDoubleQuotes(n.options.name)+'"'),f.push("--sudo-mode")):/pkexec/i.test(n.binary)&&f.push("--disable-internal-agent"),f.push(e),f.push(r),t.prev=9,p=(0,A.spawn)(n.binary,f,i),t.abrupt("return",a(p));case 14:return t.prev=14,t.t0=t.catch(9),t.abrupt("return",c(t.t0));case 17:case"end":return t.stop()}},t,u,[[9,14]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()}]),e}(Q),z=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));return r.bundled=(0,M.join)(__dirname,"bin","elevate.exe"),r.binary=null,r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"writeBatch",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r,n){var u,o,i,a,c;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,A.exec)("echo %temp%");case 2:return u=t.sent.stdout.toString().replace(/\r\n$/,""),o=u+"\\batch-"+Math.random()+".bat",i=u+"\\output-"+Math.random(),a=this.joinEnv(n),c="setlocal enabledelayedexpansion\r\n",a.length&&(c+="set "+a.join("\r\nset ")+"\r\n"),c+=r&&r.length?e+" "+r.join(" "):e,t.next=11,(0,A.writeFile)(o,c+" > "+i+" 2>&1");case 11:return t.next=13,(0,A.writeFile)(i,"");case 13:return t.abrupt("return",{batch:o,output:i});case 14:case"end":return t.stop()}},t,this)}));return t}()},{key:"watchOutput",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n,u;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.next=3,(0,A.readFile)(e.files.output);case 3:return n=t.sent,e.stdout.emit("data",n),u=(0,P.watchFile)(e.files.output,{persistent:!0,interval:1},function(){var t=(0,P.createReadStream)(e.files.output,{start:u.last}),r=0;t.on("data",function(t){r+=t.length,e&&e.stdout.emit("data",t)}),t.on("close",function(){e.last+=r})}),e.last=n.length,e.on("exit",function(){r.clean(e)}),t.abrupt("return",e);case 9:case"end":return t.stop()}},t,this)}));return t}()},{key:"prepare",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){var e,r=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(n,u){var o,i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.binary){t.next=2;break}return t.abrupt("return",n(e.binary));case 2:return o=(0,M.join)(r.tmpdir,"elevate.exe"),t.next=5,(0,A.stat)(o);case 5:if(t.sent){t.next=12;break}i=(0,P.createWriteStream)(o),(0,P.createReadStream)(e.bundled).pipe(i),i.on("close",function(){return e.binary=o,n(e.binary)}),i.on("error",function(t){return u(t)}),t.next=14;break;case 12:e.binary=o,n(e.binary);case 14:case"end":return t.stop()}},t,r)}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"exec",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n,u,o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,n=void 0,u=void 0,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(a,c){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.prepare();case 3:return t.next=5,r.writeBatch(e,[],i);case 5:return n=t.sent,e=r.encloseDoubleQuotes(r.binary)+" -wait "+n.batch,t.next=9,(0,A.exec)(e,i);case 9:return t.next=11,(0,A.readFile)(n.output);case 11:return u=t.sent,t.abrupt("return",a(u));case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",c(t.t0));case 18:case"end":return t.stop()}},t,o,[[0,15]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"spawn",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n,u,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.writeBatch(e,r,i);case 2:return n=t.sent,u=[],o=void 0,u.push("-wait"),u.push(n.batch),t.next=9,this.prepare();case 9:return o=(0,A.spawn)(this.binary,u,i,{wait:!1}),o.files=n,t.next=13,this.watchOutput(o);case 13:return t.abrupt("return",o);case 14:case"end":return t.stop()}},t,this)}));return t}()},{key:"clean",value:function(t){(0,P.unwatchFile)(t.files.output),(0,P.unlink)(t.files.batch),(0,P.unlink)(t.files.output)}}]),e}(W);e.SudoerDarwin=U,e.SudoerLinux=Y,e.SudoerWin32=z},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function u(t){return function(){var e=arguments;return new h.default(function(r,n){t.apply(void 0,Array.prototype.slice.call(e).concat([function(){arguments[0]instanceof Error?n(arguments[0]):r.apply(void 0,(0,d.default)(Array.prototype.slice.call(arguments,1))); -}]))})}}function o(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=_.default.spawn(t,e,(0,c.default)({},r,{shell:!0}));return n.output={stdout:new Buffer(0),stderr:new Buffer(0)},n.stdout.on("data",function(t){n.output.stdout=i(t,n.output.stdout)}),n.stderr.on("data",function(t){n.output.stderr=i(t,n.output.stderr)}),n}function i(t,e){return t instanceof Buffer||(t=new Buffer(t,"utf8")),!e instanceof Buffer&&(e=new Buffer(0)),Buffer.concat([e,t])}Object.defineProperty(e,"__esModule",{value:!0}),e.open=e.stat=e.mkdir=e.exec=e.spawn=e.writeFile=e.readFile=void 0;var a=r(74),c=n(a),s=r(43),f=n(s),p=r(59),l=r(42),d=n(l),v=r(41),h=n(v),y=function(){var t=(0,p.coroutine)(f.default.mark(function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new h.default(function(t,n){_.default.exec(e,r,function(e,r,u){return e?n(e):t({stdout:r,stderr:u})})}));case 1:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}(),x=function(){var t=(0,p.coroutine)(f.default.mark(function t(e){var r,n;return f.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=u(m.default.stat),t.prev=1,t.next=4,r(e);case 4:return n=t.sent,t.abrupt("return",n);case 8:return t.prev=8,t.t0=t.catch(1),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[1,8]])}));return function(e){return t.apply(this,arguments)}}(),b=r(60),m=n(b),w=r(122),_=n(w),g=u(m.default.open),k=u(m.default.mkdir),j=u(m.default.readFile),O=u(m.default.writeFile);e.readFile=j,e.writeFile=O,e.spawn=o,e.exec=y,e.mkdir=k,e.stat=x,e.open=g},function(t,e,r){t.exports={default:r(77),__esModule:!0}},function(t,e,r){t.exports={default:r(78),__esModule:!0}},function(t,e,r){t.exports={default:r(80),__esModule:!0}},function(t,e,r){t.exports={default:r(81),__esModule:!0}},function(t,e,r){t.exports={default:r(82),__esModule:!0}},function(t,e,r){t.exports={default:r(83),__esModule:!0}},function(t,e,r){t.exports={default:r(85),__esModule:!0}},function(t,e,r){t.exports={default:r(86),__esModule:!0}},function(t,e){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var u=r(67),o=n(u);e.default=function(){function t(t,e){for(var r=0;rf;)if(a=c[f++],a!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===r)return t||f||0;return!t&&-1}}},function(t,e,r){"use strict";var n=r(6),u=r(17);t.exports=function(t,e,r){e in t?n.f(t,e,u(0,r)):t[e]=r}},function(t,e,r){var n=r(16),u=r(30),o=r(19);t.exports=function(t){var e=n(t),r=u.f;if(r)for(var i,a=r(t),c=o.f,s=0;a.length>s;)c.call(t,i=a[s++])&&e.push(i);return e}},function(t,e,r){var n=r(11),u=r(49),o=r(48),i=r(4),a=r(34),c=r(38),s={},f={},e=t.exports=function(t,e,r,p,l){var d,v,h,y,x=l?function(){return t}:c(t),b=n(r,p,e?2:1),m=0;if("function"!=typeof x)throw TypeError(t+" is not iterable!");if(o(x)){for(d=a(t.length);d>m;m++)if(y=e?b(i(v=t[m])[0],v[1]):b(t[m]),y===s||y===f)return y}else for(h=x.call(t);!(v=h.next()).done;)if(y=u(h,b,v.value,e),y===s||y===f)return y};e.BREAK=s,e.RETURN=f},function(t,e){t.exports=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},function(t,e,r){var n=r(14);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){"use strict";var n=r(29),u=r(17),o=r(20),i={};r(9)(i,r(2)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=n(i,{next:u(1,r)}),o(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){var n=r(16),u=r(10);t.exports=function(t,e){for(var r,o=u(t),i=n(o),a=i.length,c=0;a>c;)if(o[r=i[c++]]===e)return r}},function(t,e,r){var n=r(22)("meta"),u=r(13),o=r(8),i=r(6).f,a=0,c=Object.isExtensible||function(){return!0},s=!r(12)(function(){return c(Object.preventExtensions({}))}),f=function(t){i(t,n,{value:{i:"O"+ ++a,w:{}}})},p=function(t,e){if(!u(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,n)){if(!c(t))return"F";if(!e)return"E";f(t)}return t[n].i},l=function(t,e){if(!o(t,n)){if(!c(t))return!0;if(!e)return!1;f(t)}return t[n].w},d=function(t){return s&&v.NEED&&c(t)&&!o(t,n)&&f(t),t},v=t.exports={KEY:n,NEED:!1,fastKey:p,getWeak:l,onFreeze:d}},function(t,e,r){var n=r(3),u=r(57).set,o=n.MutationObserver||n.WebKitMutationObserver,i=n.process,a=n.Promise,c="process"==r(14)(i);t.exports=function(){var t,e,r,s=function(){var n,u;for(c&&(n=i.domain)&&n.exit();t;){u=t.fn,t=t.next;try{u()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(c)r=function(){i.nextTick(s)};else if(o){var f=!0,p=document.createTextNode("");new o(s).observe(p,{characterData:!0}),r=function(){p.data=f=!f}}else if(a&&a.resolve){var l=a.resolve();r=function(){l.then(s)}}else r=function(){u.call(n,s)};return function(n){var u={fn:n,next:void 0};e&&(e.next=u),t||(t=u,r()),e=u}}},function(t,e,r){"use strict";var n=r(16),u=r(30),o=r(19),i=r(21),a=r(47),c=Object.assign;t.exports=!c||r(12)(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=c({},t)[r]||Object.keys(c({},e)).join("")!=n})?function(t,e){for(var r=i(t),c=arguments.length,s=1,f=u.f,p=o.f;c>s;)for(var l,d=a(arguments[s++]),v=f?n(d).concat(f(d)):n(d),h=v.length,y=0;h>y;)p.call(d,l=v[y++])&&(r[l]=d[l]);return r}:c},function(t,e,r){var n=r(6),u=r(4),o=r(16);t.exports=r(7)?Object.defineProperties:function(t,e){u(t);for(var r,i=o(e),a=i.length,c=0;a>c;)n.f(t,r=i[c++],e[r]);return t}},function(t,e,r){var n=r(10),u=r(53).f,o={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return u(t)}catch(t){return i.slice()}};t.exports.f=function(t){return i&&"[object Window]"==o.call(t)?a(t):u(n(t))}},function(t,e,r){var n=r(5),u=r(1),o=r(12);t.exports=function(t,e){var r=(u.Object||{})[t]||Object[t],i={};i[t]=e(r),n(n.S+n.F*o(function(){r(1)}),"Object",i)}},function(t,e,r){var n=r(9);t.exports=function(t,e,r){for(var u in e)r&&t[u]?t[u]=e[u]:n(t,u,e[u]);return t}},function(t,e,r){var n=r(13),u=r(4),o=function(t,e){if(u(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=r(11)(Function.call,r(52).f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return o(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:o}},function(t,e,r){"use strict";var n=r(3),u=r(1),o=r(6),i=r(7),a=r(2)("species");t.exports=function(t){var e="function"==typeof u[t]?u[t]:n[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e,r){var n=r(4),u=r(25),o=r(2)("species");t.exports=function(t,e){var r,i=n(t).constructor;return void 0===i||void 0==(r=n(i)[o])?e:u(r)}},function(t,e,r){var n=r(33),u=r(26);t.exports=function(t){return function(e,r){var o,i,a=String(u(e)),c=n(r),s=a.length;return c<0||c>=s?t?"":void 0:(o=a.charCodeAt(c),o<55296||o>56319||c+1===s||(i=a.charCodeAt(c+1))<56320||i>57343?t?a.charAt(c):o:t?a.slice(c,c+2):(o-55296<<10)+(i-56320)+65536)}}},function(t,e,r){var n=r(33),u=Math.max,o=Math.min;t.exports=function(t,e){return t=n(t),t<0?u(t+e,0):o(t,e)}},function(t,e,r){var n=r(4),u=r(38);t.exports=r(1).getIterator=function(t){var e=u(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},function(t,e,r){"use strict";var n=r(11),u=r(5),o=r(21),i=r(49),a=r(48),c=r(34),s=r(90),f=r(38);u(u.S+u.F*!r(51)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,u,p,l=o(t),d="function"==typeof this?this:Array,v=arguments.length,h=v>1?arguments[1]:void 0,y=void 0!==h,x=0,b=f(l);if(y&&(h=n(h,v>2?arguments[2]:void 0,2)),void 0==b||d==Array&&a(b))for(e=c(l.length),r=new d(e);e>x;x++)s(r,x,y?h(l[x],x):l[x]);else for(p=b.call(l),r=new d;!(u=p.next()).done;x++)s(r,x,y?i(p,h,[u.value,x],!0):u.value);return r.length=x,r}})},function(t,e,r){"use strict";var n=r(87),u=r(96),o=r(15),i=r(10);t.exports=r(50)(Array,"Array",function(t,e){this._t=i(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,u(1)):"keys"==e?u(0,r):"values"==e?u(0,t[r]):u(0,[r,t[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(t,e,r){var n=r(5);n(n.S+n.F,"Object",{assign:r(100)})},function(t,e,r){var n=r(5);n(n.S,"Object",{create:r(29)})},function(t,e,r){var n=r(5);n(n.S+n.F*!r(7),"Object",{defineProperty:r(6).f})},function(t,e,r){var n=r(21),u=r(54);r(103)("getPrototypeOf",function(){return function(t){return u(n(t))}})},function(t,e,r){var n=r(5);n(n.S,"Object",{setPrototypeOf:r(105).set})},function(t,e,r){"use strict";var n,u,o,i=r(18),a=r(3),c=r(11),s=r(44),f=r(5),p=r(13),l=r(25),d=r(88),v=r(92),h=r(107),y=r(57).set,x=r(99)(),b="Promise",m=a.TypeError,w=a.process,_=a[b],w=a.process,g="process"==s(w),k=function(){},j=!!function(){try{var t=_.resolve(1),e=(t.constructor={})[r(2)("species")]=function(t){t(k,k)};return(g||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof e}catch(t){}}(),O=function(t,e){return t===e||t===_&&e===o},S=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},E=function(t){return O(_,t)?new P(t):new u(t)},P=u=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw m("Bad Promise constructor");e=t,r=n}),this.resolve=l(e),this.reject=l(r)},M=function(t){try{t()}catch(t){return{error:t}}},F=function(t,e){if(!t._n){t._n=!0;var r=t._c;x(function(){for(var n=t._v,u=1==t._s,o=0,i=function(e){var r,o,i=u?e.ok:e.fail,a=e.resolve,c=e.reject,s=e.domain;try{i?(u||(2==t._h&&q(t),t._h=1),i===!0?r=n:(s&&s.enter(),r=i(n),s&&s.exit()),r===e.promise?c(m("Promise-chain cycle")):(o=S(r))?o.call(r,a,c):a(r)):c(n)}catch(t){c(t)}};r.length>o;)i(r[o++]);t._c=[],t._n=!1,e&&!t._h&&A(t)})}},A=function(t){y.call(a,function(){var e,r,n,u=t._v;if(T(t)&&(e=M(function(){g?w.emit("unhandledRejection",u,t):(r=a.onunhandledrejection)?r({promise:t,reason:u}):(n=a.console)&&n.error&&n.error("Unhandled promise rejection",u)}),t._h=g||T(t)?2:1),t._a=void 0,e)throw e.error})},T=function(t){if(1==t._h)return!1;for(var e,r=t._a||t._c,n=0;r.length>n;)if(e=r[n++],e.fail||!T(e.promise))return!1;return!0},q=function(t){y.call(a,function(){var e;g?w.emit("rejectionHandled",t):(e=a.onrejectionhandled)&&e({promise:t,reason:t._v})})},D=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),F(e,!0))},I=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw m("Promise can't be resolved itself");(e=S(t))?x(function(){var n={_w:r,_d:!1};try{e.call(t,c(I,n,1),c(D,n,1))}catch(t){D.call(n,t)}}):(r._v=t,r._s=1,F(r,!1))}catch(t){D.call({_w:r,_d:!1},t)}}};j||(_=function(t){d(this,_,b,"_h"),l(t),n.call(this);try{t(c(I,this,1),c(D,this,1))}catch(t){D.call(this,t)}},n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=r(104)(_.prototype,{then:function(t,e){var r=E(h(this,_));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=g?w.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&F(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),P=function(){var t=new n;this.promise=t,this.resolve=c(I,t,1),this.reject=c(D,t,1)}),f(f.G+f.W+f.F*!j,{Promise:_}),r(20)(_,b),r(106)(b),o=r(1)[b],f(f.S+f.F*!j,b,{reject:function(t){var e=E(this),r=e.reject;return r(t),e.promise}}),f(f.S+f.F*(i||!j),b,{resolve:function(t){if(t instanceof _&&O(t.constructor,this))return t;var e=E(this),r=e.resolve;return r(t),e.promise}}),f(f.S+f.F*!(j&&r(51)(function(t){_.all(t).catch(k)})),b,{all:function(t){var e=this,r=E(e),n=r.resolve,u=r.reject,o=M(function(){var r=[],o=0,i=1;v(t,!1,function(t){var a=o++,c=!1;r.push(void 0),i++,e.resolve(t).then(function(t){c||(c=!0,r[a]=t,--i||n(r))},u)}),--i||n(r)});return o&&u(o.error),r.promise},race:function(t){var e=this,r=E(e),n=r.reject,u=M(function(){v(t,!1,function(t){e.resolve(t).then(r.resolve,n)})});return u&&n(u.error),r.promise}})},function(t,e,r){"use strict";var n=r(3),u=r(8),o=r(7),i=r(5),a=r(56),c=r(98).KEY,s=r(12),f=r(32),p=r(20),l=r(22),d=r(2),v=r(37),h=r(36),y=r(97),x=r(91),b=r(94),m=r(4),w=r(10),_=r(35),g=r(17),k=r(29),j=r(102),O=r(52),S=r(6),E=r(16),P=O.f,M=S.f,F=j.f,A=n.Symbol,T=n.JSON,q=T&&T.stringify,D="prototype",I=d("_hidden"),B=d("toPrimitive"),R={}.propertyIsEnumerable,N=f("symbol-registry"),L=f("symbols"),C=f("op-symbols"),W=Object[D],Q="function"==typeof A,U=n.QObject,Y=!U||!U[D]||!U[D].findChild,z=o&&s(function(){return 7!=k(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,e,r){var n=P(W,e);n&&delete W[e],M(t,e,r),n&&t!==W&&M(W,e,n)}:M,K=function(t){var e=L[t]=k(A[D]);return e._k=t,e},G=Q&&"symbol"==typeof A.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof A},J=function(t,e,r){return t===W&&J(C,e,r),m(t),e=_(e,!0),m(r),u(L,e)?(r.enumerable?(u(t,I)&&t[I][e]&&(t[I][e]=!1),r=k(r,{enumerable:g(0,!1)})):(u(t,I)||M(t,I,g(1,{})),t[I][e]=!0),z(t,e,r)):M(t,e,r)},$=function(t,e){m(t);for(var r,n=x(e=w(e)),u=0,o=n.length;o>u;)J(t,r=n[u++],e[r]);return t},H=function(t,e){return void 0===e?k(t):$(k(t),e)},V=function(t){var e=R.call(this,t=_(t,!0));return!(this===W&&u(L,t)&&!u(C,t))&&(!(e||!u(this,t)||!u(L,t)||u(this,I)&&this[I][t])||e)},X=function(t,e){if(t=w(t),e=_(e,!0),t!==W||!u(L,e)||u(C,e)){var r=P(t,e);return!r||!u(L,e)||u(t,I)&&t[I][e]||(r.enumerable=!0),r}},Z=function(t){for(var e,r=F(w(t)),n=[],o=0;r.length>o;)u(L,e=r[o++])||e==I||e==c||n.push(e);return n},tt=function(t){for(var e,r=t===W,n=F(r?C:w(t)),o=[],i=0;n.length>i;)!u(L,e=n[i++])||r&&!u(W,e)||o.push(L[e]);return o};Q||(A=function(){if(this instanceof A)throw TypeError("Symbol is not a constructor!");var t=l(arguments.length>0?arguments[0]:void 0),e=function(r){this===W&&e.call(C,r),u(this,I)&&u(this[I],t)&&(this[I][t]=!1),z(this,t,g(1,r))};return o&&Y&&z(W,t,{configurable:!0,set:e}),K(t)},a(A[D],"toString",function(){return this._k}),O.f=X,S.f=J,r(53).f=j.f=Z,r(19).f=V,r(30).f=tt,o&&!r(18)&&a(W,"propertyIsEnumerable",V,!0),v.f=function(t){return K(d(t))}),i(i.G+i.W+i.F*!Q,{Symbol:A});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;et.length>rt;)d(et[rt++]);for(var et=E(d.store),rt=0;et.length>rt;)h(et[rt++]);i(i.S+i.F*!Q,"Symbol",{for:function(t){return u(N,t+="")?N[t]:N[t]=A(t)},keyFor:function(t){if(G(t))return y(N,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),i(i.S+i.F*!Q,"Object",{create:H,defineProperty:J,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:tt}),T&&i(i.S+i.F*(!Q||s(function(){var t=A();return"[null]"!=q([t])||"{}"!=q({a:t})||"{}"!=q(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!G(t)){for(var e,r,n=[t],u=1;arguments.length>u;)n.push(arguments[u++]);return e=n[1],"function"==typeof e&&(r=e),!r&&b(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!G(e))return e}),n[1]=e,q.apply(T,n)}}}),A[D][B]||r(9)(A[D],B,A[D].valueOf),p(A,"Symbol"),p(Math,"Math",!0),p(n.JSON,"JSON",!0)},function(t,e,r){r(36)("asyncIterator")},function(t,e,r){r(36)("observable")},function(t,e){t.exports=require("child_process")},function(t,e){t.exports=require("crypto")},function(t,e){t.exports=require("os")},function(t,e){t.exports=require("path")},function(t,e){t.exports=require("regenerator-runtime")}])}); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("bluebird"),require("fs"),require("child_process"),require("crypto"),require("os"),require("path"),require("regenerator-runtime")):"function"==typeof define&&define.amd?define(["bluebird","fs","child_process","crypto","os","path","regenerator-runtime"],e):"object"==typeof exports?exports["electron-sudo"]=e(require("bluebird"),require("fs"),require("child_process"),require("crypto"),require("os"),require("path"),require("regenerator-runtime")):t["electron-sudo"]=e(t.bluebird,t.fs,t.child_process,t.crypto,t.os,t.path,t["regenerator-runtime"])}(this,function(t,e,r,n,u,o,i){return function(t){function e(n){if(r[n])return r[n].exports;var u=r[n]={exports:{},id:n,loaded:!1};return t[n].call(u.exports,u,u.exports,e),u.loaded=!0,u.exports}var r={};return e.m=t,e.c=r,e.p="./dist",e(0)}([function(t,e,r){t.exports=r(61)},function(t,e){var r=t.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(t,e,r){var n=r(32)("wks"),u=r(22),o=r(3).Symbol,i="function"==typeof o,a=t.exports=function(t){return n[t]||(n[t]=i&&o[t]||(i?o:u)("Symbol."+t))};a.store=n},function(t,e){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,e,r){var n=r(13);t.exports=function(t){if(!n(t))throw TypeError(t+" is not an object!");return t}},function(t,e,r){var n=r(3),u=r(1),o=r(11),i=r(9),a="prototype",c=function(t,e,r){var s,f,p,l=t&c.F,d=t&c.G,v=t&c.S,h=t&c.P,y=t&c.B,x=t&c.W,b=d?u:u[e]||(u[e]={}),m=b[a],w=d?n:v?n[e]:(n[e]||{})[a];d&&(r=e);for(s in r)f=!l&&w&&void 0!==w[s],f&&s in b||(p=f?w[s]:r[s],b[s]=d&&"function"!=typeof w[s]?r[s]:y&&f?o(p,n):x&&w[s]==p?function(t){var e=function(e,r,n){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,r)}return new t(e,r,n)}return t.apply(this,arguments)};return e[a]=t[a],e}(p):h&&"function"==typeof p?o(Function.call,p):p,h&&((b.virtual||(b.virtual={}))[s]=p,t&c.R&&m&&!m[s]&&i(m,s,p)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e,r){var n=r(4),u=r(46),o=r(35),i=Object.defineProperty;e.f=r(7)?Object.defineProperty:function(t,e,r){if(n(t),e=o(e,!0),n(r),u)try{return i(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){t.exports=!r(12)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e,r){var n=r(6),u=r(17);t.exports=r(7)?function(t,e,r){return n.f(t,e,u(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var n=r(47),u=r(26);t.exports=function(t){return n(u(t))}},function(t,e,r){var n=r(25);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,u){return t.call(e,r,n,u)}}return function(){return t.apply(e,arguments)}}},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e){t.exports={}},function(t,e,r){var n=r(55),u=r(28);t.exports=Object.keys||function(t){return n(t,u)}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){t.exports=!0},function(t,e){e.f={}.propertyIsEnumerable},function(t,e,r){var n=r(6).f,u=r(8),o=r(2)("toStringTag");t.exports=function(t,e,r){t&&!u(t=r?t:t.prototype,o)&&n(t,o,{configurable:!0,value:e})}},function(t,e,r){var n=r(26);t.exports=function(t){return Object(n(t))}},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+n).toString(36))}},function(t,e,r){"use strict";var n=r(108)(!0);r(50)(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,r=this._i;return r>=e.length?{value:void 0,done:!0}:(t=n(e,r),this._i+=t.length,{value:t,done:!1})})},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var u=r(71),o=n(u),i=r(70),a=n(i),c="function"==typeof a.default&&"symbol"==typeof o.default?function(t){return typeof t}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};e.default="function"==typeof a.default&&"symbol"===c(o.default)?function(t){return"undefined"==typeof t?"undefined":c(t)}:function(t){return t&&"function"==typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"==typeof t?"undefined":c(t)}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(13),u=r(3).document,o=n(u)&&n(u.createElement);t.exports=function(t){return o?u.createElement(t):{}}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,r){var n=r(4),u=r(101),o=r(28),i=r(31)("IE_PROTO"),a=function(){},c="prototype",s=function(){var t,e=r(27)("iframe"),n=o.length,u="<",i=">";for(e.style.display="none",r(45).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(u+"script"+i+"document.F=Object"+u+"/script"+i),t.close(),s=t.F;n--;)delete s[c][o[n]];return s()};t.exports=Object.create||function(t,e){var r;return null!==t?(a[c]=n(t),r=new a,a[c]=null,r[i]=t):r=s(),void 0===e?r:u(r,e)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var n=r(32)("keys"),u=r(22);t.exports=function(t){return n[t]||(n[t]=u(t))}},function(t,e,r){var n=r(3),u="__core-js_shared__",o=n[u]||(n[u]={});t.exports=function(t){return o[t]||(o[t]={})}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){var n=r(33),u=Math.min;t.exports=function(t){return t>0?u(n(t),9007199254740991):0}},function(t,e,r){var n=r(13);t.exports=function(t,e){if(!n(t))return t;var r,u;if(e&&"function"==typeof(r=t.toString)&&!n(u=r.call(t)))return u;if("function"==typeof(r=t.valueOf)&&!n(u=r.call(t)))return u;if(!e&&"function"==typeof(r=t.toString)&&!n(u=r.call(t)))return u;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n=r(3),u=r(1),o=r(18),i=r(37),a=r(6).f;t.exports=function(t){var e=u.Symbol||(u.Symbol=o?{}:n.Symbol||{});"_"==t.charAt(0)||t in e||a(e,t,{value:i.f(t)})}},function(t,e,r){e.f=r(2)},function(t,e,r){var n=r(44),u=r(2)("iterator"),o=r(15);t.exports=r(1).getIteratorMethod=function(t){if(void 0!=t)return t[u]||t["@@iterator"]||o[n(t)]}},function(t,e,r){r(112);for(var n=r(3),u=r(9),o=r(15),i=r(2)("toStringTag"),a=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],c=0;c<5;c++){var s=a[c],f=n[s],p=f&&f.prototype;p&&!p[i]&&u(p,i,s),o[s]=o.Array}},function(t,e,r){t.exports={default:r(79),__esModule:!0}},function(t,e,r){t.exports={default:r(84),__esModule:!0}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var u=r(64),o=n(u);e.default=function(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);ec;)n(a,r=e[c++])&&(~o(s,r)||s.push(r));return s}},function(t,e,r){t.exports=r(9)},function(t,e,r){var n,u,o,i=r(11),a=r(93),c=r(45),s=r(27),f=r(3),p=f.process,l=f.setImmediate,d=f.clearImmediate,v=f.MessageChannel,h=0,y={},x="onreadystatechange",b=function(){var t=+this;if(y.hasOwnProperty(t)){var e=y[t];delete y[t],e()}},m=function(t){b.call(t.data)};l&&d||(l=function(t){for(var e=[],r=1;arguments.length>r;)e.push(arguments[r++]);return y[++h]=function(){a("function"==typeof t?t:Function(t),e)},n(h),h},d=function(t){delete y[t]},"process"==r(14)(p)?n=function(t){p.nextTick(i(b,t,1))}:v?(u=new v,o=u.port2,u.port1.onmessage=m,n=i(o.postMessage,o,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(n=function(t){f.postMessage(t+"","*")},f.addEventListener("message",m,!1)):n=x in s("script")?function(t){c.appendChild(s("script"))[x]=function(){c.removeChild(this),b.call(t)}}:function(t){setTimeout(i(b,t,1),0)}),t.exports={set:l,clear:d}},function(t,e){},function(t,e){t.exports=require("bluebird")},function(t,e){t.exports=require("fs")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(62);e.default=function(){var t=process,e=t.platform;switch(e){case"darwin":return n.SudoerDarwin;case"win32":return n.SudoerWin32;case"linux":return n.SudoerLinux;default:throw new Error("Unsupported platform: "+e)}}()},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(e,"__esModule",{value:!0}),e.SudoerWin32=e.SudoerLinux=e.SudoerDarwin=void 0;var u=r(40),o=n(u),i=r(42),a=n(i),c=r(43),s=n(c),f=r(41),p=n(f),l=r(65),d=n(l),v=r(59),h=r(68),y=n(h),x=r(76),b=n(x),m=r(75),w=n(m),_=r(24),g=n(_),k=r(72),j=n(k),O=r(73),S=n(O),E=r(124),P=r(60),M=r(125),F=r(123),A=r(63),T=(0,v.promisify)(P.readdir),q=(0,v.promisify)(P.unlink),D=(0,v.promisify)(P.rmdir),I=(0,v.promisify)(P.stat),B=(0,v.promisify)(A.mkdir),R=(0,v.promisify)(P.chmod),N=process,L=N.platform,C=N.env,W=function(){function t(e){(0,j.default)(this,t),this.platform=L,this.options=e,this.cp=null,this.tmpdir=(0,E.tmpdir)()}return(0,S.default)(t,[{key:"hash",value:function t(e){var t=(0,F.createHash)("sha256");return t.update("electron-sudo"),t.update(this.options.name||""),t.update(e||new Buffer(0)),t.digest("hex").slice(-32)}},{key:"joinEnv",value:function(t){var e=t.env,r=[];if(e&&"object"==("undefined"==typeof e?"undefined":(0,g.default)(e)))for(var n in e)r.push(n.concat("=",e[n]));return r}},{key:"escapeDoubleQuotes",value:function(t){return t.replace(/"/g,'\\"')}},{key:"encloseDoubleQuotes",value:function(t){return t.replace(/(.+)/g,'"$1"')}},{key:"kill",value:function(t){}}]),t}(),Q=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));return r.options.name||(r.options.name="Electron"),r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"copy",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n,u,o,i,a,c,f,l,v,h;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,I(e);case 2:if(n=t.sent,u=493,!n.isDirectory()){t.next=55;break}return t.prev=5,t.next=8,I(r);case 8:if(o=t.sent,!o.isDirectory()){t.next=14;break}return t.next=12,R(r,u);case 12:t.next=18;break;case 14:return t.next=16,q(r);case 16:return t.next=18,B(r,u);case 18:t.next=24;break;case 20:return t.prev=20,t.t0=t.catch(5),t.next=24,B(r,u);case 24:return i=!0,a=!1,c=void 0,t.prev=27,t.next=30,T(e);case 30:t.t1=t.sent,f=(0,d.default)(t.t1);case 32:if(i=(l=f.next()).done){t.next=39;break}return v=l.value,t.next=36,this.copy((0,M.join)(e,v),(0,M.join)(r,v));case 36:i=!0,t.next=32;break;case 39:t.next=45;break;case 41:t.prev=41,t.t2=t.catch(27),a=!0,c=t.t2;case 45:t.prev=45,t.prev=46,!i&&f.return&&f.return();case 48:if(t.prev=48,!a){t.next=51;break}throw c;case 51:return t.finish(48);case 52:return t.finish(45);case 53:t.next=71;break;case 55:return t.prev=55,t.next=58,I(r);case 58:if(h=t.sent,!h.isDirectory()){t.next=64;break}return t.next=62,D(r);case 62:t.next=66;break;case 64:return t.next=66,R(r,u);case 66:t.next=70;break;case 68:t.prev=68,t.t3=t.catch(55);case 70:return t.abrupt("return",new p.default(function(t,n){var o=(0,P.createReadStream)(e);o.on("error",n);var i=(0,P.createWriteStream)(r,{mode:u});i.on("error",n),i.on("close",t),o.pipe(i)}));case 71:case"end":return t.stop()}},t,this,[[5,20],[27,41,45,53],[46,,48,52],[55,68]])}));return t}()},{key:"remove",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.startsWith(r.tmpdir)){t.next=2;break}throw new Error("Try to remove suspicious target: "+e+".");case 2:return e=n.escapeDoubleQuotes((0,M.normalize)(e)),t.prev=3,t.next=6,(0,A.exec)('rm -rf "'+e+'"');case 6:i=t.sent,u(i),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(3),o(t.t0);case 13:case"end":return t.stop()}},t,n,[[3,10]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"reset",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,A.exec)("/usr/bin/sudo -k");case 2:case"end":return t.stop()}},t,this)}));return t}()}]),e}(W),U=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));if(t.icns&&"string"!=typeof t.icns)throw new Error("options.icns must be a string if provided.");if(t.icns&&0===t.icns.trim().length)throw new Error("options.icns must be a non-empty string if provided.");return r.up=!1,r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"isValidName",value:function(t){return/^[a-z0-9 ]+$/i.test(t)&&t.trim().length>0&&t.length<70}},{key:"joinEnv",value:function(t){var e=t.env,r=[];if(e&&"object"==("undefined"==typeof e?"undefined":(0,g.default)(e)))for(var n in e)r.push(n.concat("=",e[n]));return r}},{key:"exec",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i,a,c,f;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=r,a=i.joinEnv(n),c=["/usr/bin/sudo -n",a.join(" "),"-s",e].join(" "),f=void 0,t.next=3,i.reset();case 3:return t.prev=3,t.next=6,(0,A.exec)(c,n);case 6:f=t.sent,u(f),t.next=24;break;case 10:return t.prev=10,t.t0=t.catch(3),t.prev=12,t.next=15,i.prompt();case 15:return t.next=17,(0,A.exec)(c,n);case 17:f=t.sent,u(f),t.next=24;break;case 21:t.prev=21,t.t1=t.catch(12),o(t.t1);case 24:case"end":return t.stop()}},t,r,[[3,10],[12,21]])}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"spawn",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n=this,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(o,i){var c,f,p;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return c=n,f="/usr/bin/sudo",p=void 0,t.next=3,c.reset();case 3:return t.next=5,c.prompt();case 5:p=(0,A.spawn)(f,["-n","-s","-E",[e].concat((0,a.default)(r)).join(" ")],u),p.on("error",function(){var t=(0,v.coroutine)(s.default.mark(function t(e){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:i(e);case 1:case"end":return t.stop()}},t,n)}));return function(e){return t.apply(this,arguments)}}()),c.cp=p,o(p);case 9:case"end":return t.stop()}},t,n)}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"prompt",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){var e,r=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(n,u){var o,i,a,c;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e.tmpdir){t.next=2;break}return t.abrupt("return",u(new Error("Requires os.tmpdir() to be defined.")));case 2:if(C.USER){t.next=4;break}return t.abrupt("return",u(new Error("Requires env['USER'] to be defined.")));case 4:return e.up=!0,t.next=7,e.readIcns();case 7:return o=t.sent,i=e.hash(o),a=(0,M.join)((0,M.dirname)(__filename)+"/bin","applet.app"),c=(0,M.join)(e.tmpdir,i,e.options.name+".app"),t.prev=10,t.next=13,(0,A.mkdir)((0,M.dirname)(c));case 13:t.next=19;break;case 15:if(t.prev=15,t.t0=t.catch(10),"EEXIST"===t.t0.code){t.next=19;break}return t.abrupt("return",u(t.t0));case 19:return t.prev=19,t.next=22,e.copy(a,c);case 22:return t.next=24,e.icon(c);case 24:return t.next=26,e.propertyList(c);case 26:return t.next=28,e.open(c);case 28:return t.next=30,e.remove(c);case 30:t.next=35;break;case 32:return t.prev=32,t.t1=t.catch(19),t.abrupt("return",u(t.t1));case 35:return t.abrupt("return",n(i));case 36:case"end":return t.stop()}},t,r,[[10,15],[19,32]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"icon",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n.options.icns){t.next=2;break}return t.abrupt("return",u());case 2:return t.next=4,r.copy(n.options.icns,(0,M.join)(e,"Contents","Resources","applet.icns"));case 4:return i=t.sent,t.abrupt("return",u(i));case 6:case"end":return t.stop()}},t,n)}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"open",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=r.escapeDoubleQuotes((0,M.normalize)(e)),t.prev=1,t.next=4,(0,A.exec)('open -n -W "'+e+'"');case 4:return i=t.sent,t.abrupt("return",u(i));case 8:return t.prev=8,t.t0=t.catch(1),t.abrupt("return",o(t.t0));case 11:case"end":return t.stop()}},t,n,[[1,8]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"readIcns",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(n,u){var o;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e&&"darwin"===L){t.next=2;break}return t.abrupt("return",n(new Buffer(0)));case 2:return t.prev=2,t.next=5,(0,A.readFile)(e);case 5:return o=t.sent,t.abrupt("return",n(o));case 9:return t.prev=9,t.t0=t.catch(2),t.abrupt("return",u(t.t0));case 12:case"end":return t.stop()}},t,r,[[2,9]])}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"propertyList",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,o){var i,a,c,f;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(i=r.escapeDoubleQuotes((0,M.join)(e,"Contents","Info.plist")),a=r.escapeDoubleQuotes("CFBundleName"),c=r.options.name+" Password Prompt",!/'/.test(c)){t.next=3;break}return t.abrupt("return",o(new Error("Value should not contain single quotes.")));case 3:return t.next=5,(0,A.exec)('defaults write "'+i+'" "'+a+"\" '"+c+"'");case 5:return f=t.sent,t.abrupt("return",u(f));case 7:case"end":return t.stop()}},t,n)}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()}]),e}(Q),Y=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));return r.binary=null,r.paths=["/usr/bin/gksudo","/usr/bin/pkexec","./bin/gksudo"],r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"getBinary",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){var e=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,p.default.all(this.paths.map(function(){var t=(0,v.coroutine)(s.default.mark(function t(r){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,A.stat)(r);case 3:return r=t.sent,t.abrupt("return",r);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",null);case 10:case"end":return t.stop()}},t,e,[[0,7]])}));return function(e){return t.apply(this,arguments)}}()));case 2:return t.t0=function(t){return t},t.abrupt("return",t.sent.filter(t.t0)[0]);case 4:case"end":return t.stop()}},t,this)}));return t}()},{key:"exec",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(u,i){var a,c,f;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(a=r,c=void 0,a.binary){t.next=5;break}return t.next=4,a.getBinary();case 4:a.binary=t.sent;case 5:return n.env instanceof Object&&!n.env.DISPLAY&&(n.env=(0,o.default)(n.env,{DISPLAY:":0"})),f=void 0,/gksudo/i.test(a.binary)?f="--preserve-env --sudo-mode "+('--description="'+a.escapeDoubleQuotes(a.options.name)+'"'):/pkexec/i.test(a.binary)&&(f="--disable-internal-agent"),e=r.binary+" "+f+" "+e,t.prev=9,t.next=12,(0,A.exec)(e,n);case 12:return c=t.sent,t.abrupt("return",u(c));case 16:return t.prev=16,t.t0=t.catch(9),t.abrupt("return",i(t.t0));case 19:case"end":return t.stop()}},t,r,[[9,16]])}));return function(e,r){return t.apply(this,arguments)}}()));case 1:case"end":return t.stop()}},t,this)}));return t}()},{key:"spawn",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n,u=this,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return n=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(a,c){var f,p;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(n.binary){t.next=4;break}return t.next=3,n.getBinary();case 3:n.binary=t.sent;case 4:return i.env instanceof Object&&!i.env.DISPLAY&&(i.env=(0,o.default)(i.env,{DISPLAY:":0"})),f=[],/gksudo/i.test(n.binary)?(f.push("--preserve-env"),f.push("--sudo-mode"),f.push('--description="'+n.escapeDoubleQuotes(n.options.name)+'"'),f.push("--sudo-mode")):/pkexec/i.test(n.binary)&&f.push("--disable-internal-agent"),f.push(e),f.push(r),t.prev=9,p=(0,A.spawn)(n.binary,f,i),t.abrupt("return",a(p));case 14:return t.prev=14,t.t0=t.catch(9),t.abrupt("return",c(t.t0));case 17:case"end":return t.stop()}},t,u,[[9,14]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()}]),e}(Q),z=function(t){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,j.default)(this,e);var r=(0,b.default)(this,(e.__proto__||(0,y.default)(e)).call(this,t));return r.bundled=(0,M.join)(__dirname,"bin","elevate.exe"),r.binary=null,r}return(0,w.default)(e,t),(0,S.default)(e,[{key:"writeBatch",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r,n){var u,o,i,a,c;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,A.exec)("echo %temp%");case 2:return u=t.sent.stdout.toString().replace(/\r\n$/,""),o=u+"\\batch-"+Math.random()+".bat",i=u+"\\output-"+Math.random(),a=this.joinEnv(n),c="setlocal enabledelayedexpansion\r\n",a.length&&(c+="set "+a.join("\r\nset ")+"\r\n"),c+=r&&r.length?e+" "+r.join(" "):e,t.next=11,(0,A.writeFile)(o,c+" > "+i+" 2>&1");case 11:return t.next=13,(0,A.writeFile)(i,"");case 13:return t.abrupt("return",{batch:o,output:i});case 14:case"end":return t.stop()}},t,this)}));return t}()},{key:"watchOutput",value:function(){function t(t){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n,u;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,t.next=3,(0,A.readFile)(e.files.output);case 3:return n=t.sent,e.stdout.emit("data",n),u=(0,P.watchFile)(e.files.output,{persistent:!0,interval:1},function(){var t=(0,P.createReadStream)(e.files.output,{start:u.last}),r=0;t.on("data",function(t){r+=t.length,e&&e.stdout.emit("data",t)}),t.on("close",function(){e.last+=r})}),e.last=n.length,e.on("exit",function(){r.clean(e)}),t.abrupt("return",e);case 9:case"end":return t.stop()}},t,this)}));return t}()},{key:"prepare",value:function(){function t(){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(){var e,r=this;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return e=this,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(n,u){var o,i;return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.binary){t.next=2;break}return t.abrupt("return",n(e.binary));case 2:return o=(0,M.join)(r.tmpdir,"elevate.exe"),t.next=5,(0,A.stat)(o);case 5:if(t.sent){t.next=12;break}i=(0,P.createWriteStream)(o),(0,P.createReadStream)(e.bundled).pipe(i),i.on("close",function(){return e.binary=o,n(e.binary)}),i.on("error",function(t){return u(t)}),t.next=14;break;case 12:e.binary=o,n(e.binary);case 14:case"end":return t.stop()}},t,r)}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"exec",value:function(){function t(t,r){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e){var r,n,u,o=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=this,n=void 0,u=void 0,t.abrupt("return",new p.default(function(){var t=(0,v.coroutine)(s.default.mark(function t(a,c){return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.prepare();case 3:return t.next=5,r.writeBatch(e,[],i);case 5:return n=t.sent,e=r.encloseDoubleQuotes(r.binary)+" -wait "+n.batch,t.next=9,(0,A.exec)(e,i);case 9:return t.next=11,(0,A.readFile)(n.output);case 11:return u=t.sent,t.abrupt("return",a(u));case 15:return t.prev=15,t.t0=t.catch(0),t.abrupt("return",c(t.t0));case 18:case"end":return t.stop()}},t,o,[[0,15]])}));return function(e,r){return t.apply(this,arguments)}}()));case 2:case"end":return t.stop()}},t,this)}));return t}()},{key:"spawn",value:function(){function t(t,r,n){return e.apply(this,arguments)}var e=(0,v.coroutine)(s.default.mark(function t(e,r){var n,u,o,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return s.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.writeBatch(e,r,i);case 2:return n=t.sent,u=[],o=void 0,u.push("-wait"),u.push(n.batch),console.log(n),t.next=10,this.prepare();case 10:return console.log(this.binary,u,i,{wait:!1}),o=(0,A.spawn)(this.binary,u,i,{wait:!1}),o.files=n,t.next=15,this.watchOutput(o);case 15:return console.log(o),t.abrupt("return",o);case 17:case"end":return t.stop()}},t,this)}));return t}()},{key:"clean",value:function(t){(0,P.unwatchFile)(t.files.output),(0,P.unlink)(t.files.batch),(0,P.unlink)(t.files.output)}}]),e}(W);e.SudoerDarwin=U,e.SudoerLinux=Y,e.SudoerWin32=z},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function u(t){return function(){var e=arguments;return new h.default(function(r,n){t.apply(void 0,Array.prototype.slice.call(e).concat([function(){arguments[0]instanceof Error?n(arguments[0]):r.apply(void 0,(0, +d.default)(Array.prototype.slice.call(arguments,1)))}]))})}}function o(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=_.default.spawn(t,e,(0,c.default)({},r,{shell:!0}));return n.output={stdout:new Buffer(0),stderr:new Buffer(0)},n.stdout.on("data",function(t){n.output.stdout=i(t,n.output.stdout)}),n.stderr.on("data",function(t){n.output.stderr=i(t,n.output.stderr)}),n}function i(t,e){return t instanceof Buffer||(t=new Buffer(t,"utf8")),!e instanceof Buffer&&(e=new Buffer(0)),Buffer.concat([e,t])}Object.defineProperty(e,"__esModule",{value:!0}),e.open=e.stat=e.mkdir=e.exec=e.spawn=e.writeFile=e.readFile=void 0;var a=r(74),c=n(a),s=r(43),f=n(s),p=r(59),l=r(42),d=n(l),v=r(41),h=n(v),y=function(){var t=(0,p.coroutine)(f.default.mark(function t(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return f.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new h.default(function(t,n){_.default.exec(e,r,function(e,r,u){return e?n(e):t({stdout:r,stderr:u})})}));case 1:case"end":return t.stop()}},t,this)}));return function(e,r){return t.apply(this,arguments)}}(),x=function(){var t=(0,p.coroutine)(f.default.mark(function t(e){var r,n;return f.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=u(m.default.stat),t.prev=1,t.next=4,r(e);case 4:return n=t.sent,t.abrupt("return",n);case 8:return t.prev=8,t.t0=t.catch(1),t.abrupt("return",null);case 11:case"end":return t.stop()}},t,this,[[1,8]])}));return function(e){return t.apply(this,arguments)}}(),b=r(60),m=n(b),w=r(122),_=n(w),g=u(m.default.open),k=u(m.default.mkdir),j=u(m.default.readFile),O=u(m.default.writeFile);e.readFile=j,e.writeFile=O,e.spawn=o,e.exec=y,e.mkdir=k,e.stat=x,e.open=g},function(t,e,r){t.exports={default:r(77),__esModule:!0}},function(t,e,r){t.exports={default:r(78),__esModule:!0}},function(t,e,r){t.exports={default:r(80),__esModule:!0}},function(t,e,r){t.exports={default:r(81),__esModule:!0}},function(t,e,r){t.exports={default:r(82),__esModule:!0}},function(t,e,r){t.exports={default:r(83),__esModule:!0}},function(t,e,r){t.exports={default:r(85),__esModule:!0}},function(t,e,r){t.exports={default:r(86),__esModule:!0}},function(t,e){"use strict";e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}},function(t,e,r){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}e.__esModule=!0;var u=r(67),o=n(u);e.default=function(){function t(t,e){for(var r=0;rf;)if(a=c[f++],a!=a)return!0}else for(;s>f;f++)if((t||f in c)&&c[f]===r)return t||f||0;return!t&&-1}}},function(t,e,r){"use strict";var n=r(6),u=r(17);t.exports=function(t,e,r){e in t?n.f(t,e,u(0,r)):t[e]=r}},function(t,e,r){var n=r(16),u=r(30),o=r(19);t.exports=function(t){var e=n(t),r=u.f;if(r)for(var i,a=r(t),c=o.f,s=0;a.length>s;)c.call(t,i=a[s++])&&e.push(i);return e}},function(t,e,r){var n=r(11),u=r(49),o=r(48),i=r(4),a=r(34),c=r(38),s={},f={},e=t.exports=function(t,e,r,p,l){var d,v,h,y,x=l?function(){return t}:c(t),b=n(r,p,e?2:1),m=0;if("function"!=typeof x)throw TypeError(t+" is not iterable!");if(o(x)){for(d=a(t.length);d>m;m++)if(y=e?b(i(v=t[m])[0],v[1]):b(t[m]),y===s||y===f)return y}else for(h=x.call(t);!(v=h.next()).done;)if(y=u(h,b,v.value,e),y===s||y===f)return y};e.BREAK=s,e.RETURN=f},function(t,e){t.exports=function(t,e,r){var n=void 0===r;switch(e.length){case 0:return n?t():t.call(r);case 1:return n?t(e[0]):t.call(r,e[0]);case 2:return n?t(e[0],e[1]):t.call(r,e[0],e[1]);case 3:return n?t(e[0],e[1],e[2]):t.call(r,e[0],e[1],e[2]);case 4:return n?t(e[0],e[1],e[2],e[3]):t.call(r,e[0],e[1],e[2],e[3])}return t.apply(r,e)}},function(t,e,r){var n=r(14);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){"use strict";var n=r(29),u=r(17),o=r(20),i={};r(9)(i,r(2)("iterator"),function(){return this}),t.exports=function(t,e,r){t.prototype=n(i,{next:u(1,r)}),o(t,e+" Iterator")}},function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},function(t,e,r){var n=r(16),u=r(10);t.exports=function(t,e){for(var r,o=u(t),i=n(o),a=i.length,c=0;a>c;)if(o[r=i[c++]]===e)return r}},function(t,e,r){var n=r(22)("meta"),u=r(13),o=r(8),i=r(6).f,a=0,c=Object.isExtensible||function(){return!0},s=!r(12)(function(){return c(Object.preventExtensions({}))}),f=function(t){i(t,n,{value:{i:"O"+ ++a,w:{}}})},p=function(t,e){if(!u(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!o(t,n)){if(!c(t))return"F";if(!e)return"E";f(t)}return t[n].i},l=function(t,e){if(!o(t,n)){if(!c(t))return!0;if(!e)return!1;f(t)}return t[n].w},d=function(t){return s&&v.NEED&&c(t)&&!o(t,n)&&f(t),t},v=t.exports={KEY:n,NEED:!1,fastKey:p,getWeak:l,onFreeze:d}},function(t,e,r){var n=r(3),u=r(57).set,o=n.MutationObserver||n.WebKitMutationObserver,i=n.process,a=n.Promise,c="process"==r(14)(i);t.exports=function(){var t,e,r,s=function(){var n,u;for(c&&(n=i.domain)&&n.exit();t;){u=t.fn,t=t.next;try{u()}catch(n){throw t?r():e=void 0,n}}e=void 0,n&&n.enter()};if(c)r=function(){i.nextTick(s)};else if(o){var f=!0,p=document.createTextNode("");new o(s).observe(p,{characterData:!0}),r=function(){p.data=f=!f}}else if(a&&a.resolve){var l=a.resolve();r=function(){l.then(s)}}else r=function(){u.call(n,s)};return function(n){var u={fn:n,next:void 0};e&&(e.next=u),t||(t=u,r()),e=u}}},function(t,e,r){"use strict";var n=r(16),u=r(30),o=r(19),i=r(21),a=r(47),c=Object.assign;t.exports=!c||r(12)(function(){var t={},e={},r=Symbol(),n="abcdefghijklmnopqrst";return t[r]=7,n.split("").forEach(function(t){e[t]=t}),7!=c({},t)[r]||Object.keys(c({},e)).join("")!=n})?function(t,e){for(var r=i(t),c=arguments.length,s=1,f=u.f,p=o.f;c>s;)for(var l,d=a(arguments[s++]),v=f?n(d).concat(f(d)):n(d),h=v.length,y=0;h>y;)p.call(d,l=v[y++])&&(r[l]=d[l]);return r}:c},function(t,e,r){var n=r(6),u=r(4),o=r(16);t.exports=r(7)?Object.defineProperties:function(t,e){u(t);for(var r,i=o(e),a=i.length,c=0;a>c;)n.f(t,r=i[c++],e[r]);return t}},function(t,e,r){var n=r(10),u=r(53).f,o={}.toString,i="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],a=function(t){try{return u(t)}catch(t){return i.slice()}};t.exports.f=function(t){return i&&"[object Window]"==o.call(t)?a(t):u(n(t))}},function(t,e,r){var n=r(5),u=r(1),o=r(12);t.exports=function(t,e){var r=(u.Object||{})[t]||Object[t],i={};i[t]=e(r),n(n.S+n.F*o(function(){r(1)}),"Object",i)}},function(t,e,r){var n=r(9);t.exports=function(t,e,r){for(var u in e)r&&t[u]?t[u]=e[u]:n(t,u,e[u]);return t}},function(t,e,r){var n=r(13),u=r(4),o=function(t,e){if(u(t),!n(e)&&null!==e)throw TypeError(e+": can't set as prototype!")};t.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{n=r(11)(Function.call,r(52).f(Object.prototype,"__proto__").set,2),n(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return o(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:o}},function(t,e,r){"use strict";var n=r(3),u=r(1),o=r(6),i=r(7),a=r(2)("species");t.exports=function(t){var e="function"==typeof u[t]?u[t]:n[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},function(t,e,r){var n=r(4),u=r(25),o=r(2)("species");t.exports=function(t,e){var r,i=n(t).constructor;return void 0===i||void 0==(r=n(i)[o])?e:u(r)}},function(t,e,r){var n=r(33),u=r(26);t.exports=function(t){return function(e,r){var o,i,a=String(u(e)),c=n(r),s=a.length;return c<0||c>=s?t?"":void 0:(o=a.charCodeAt(c),o<55296||o>56319||c+1===s||(i=a.charCodeAt(c+1))<56320||i>57343?t?a.charAt(c):o:t?a.slice(c,c+2):(o-55296<<10)+(i-56320)+65536)}}},function(t,e,r){var n=r(33),u=Math.max,o=Math.min;t.exports=function(t,e){return t=n(t),t<0?u(t+e,0):o(t,e)}},function(t,e,r){var n=r(4),u=r(38);t.exports=r(1).getIterator=function(t){var e=u(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return n(e.call(t))}},function(t,e,r){"use strict";var n=r(11),u=r(5),o=r(21),i=r(49),a=r(48),c=r(34),s=r(90),f=r(38);u(u.S+u.F*!r(51)(function(t){Array.from(t)}),"Array",{from:function(t){var e,r,u,p,l=o(t),d="function"==typeof this?this:Array,v=arguments.length,h=v>1?arguments[1]:void 0,y=void 0!==h,x=0,b=f(l);if(y&&(h=n(h,v>2?arguments[2]:void 0,2)),void 0==b||d==Array&&a(b))for(e=c(l.length),r=new d(e);e>x;x++)s(r,x,y?h(l[x],x):l[x]);else for(p=b.call(l),r=new d;!(u=p.next()).done;x++)s(r,x,y?i(p,h,[u.value,x],!0):u.value);return r.length=x,r}})},function(t,e,r){"use strict";var n=r(87),u=r(96),o=r(15),i=r(10);t.exports=r(50)(Array,"Array",function(t,e){this._t=i(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,r=this._i++;return!t||r>=t.length?(this._t=void 0,u(1)):"keys"==e?u(0,r):"values"==e?u(0,t[r]):u(0,[r,t[r]])},"values"),o.Arguments=o.Array,n("keys"),n("values"),n("entries")},function(t,e,r){var n=r(5);n(n.S+n.F,"Object",{assign:r(100)})},function(t,e,r){var n=r(5);n(n.S,"Object",{create:r(29)})},function(t,e,r){var n=r(5);n(n.S+n.F*!r(7),"Object",{defineProperty:r(6).f})},function(t,e,r){var n=r(21),u=r(54);r(103)("getPrototypeOf",function(){return function(t){return u(n(t))}})},function(t,e,r){var n=r(5);n(n.S,"Object",{setPrototypeOf:r(105).set})},function(t,e,r){"use strict";var n,u,o,i=r(18),a=r(3),c=r(11),s=r(44),f=r(5),p=r(13),l=r(25),d=r(88),v=r(92),h=r(107),y=r(57).set,x=r(99)(),b="Promise",m=a.TypeError,w=a.process,_=a[b],w=a.process,g="process"==s(w),k=function(){},j=!!function(){try{var t=_.resolve(1),e=(t.constructor={})[r(2)("species")]=function(t){t(k,k)};return(g||"function"==typeof PromiseRejectionEvent)&&t.then(k)instanceof e}catch(t){}}(),O=function(t,e){return t===e||t===_&&e===o},S=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},E=function(t){return O(_,t)?new P(t):new u(t)},P=u=function(t){var e,r;this.promise=new t(function(t,n){if(void 0!==e||void 0!==r)throw m("Bad Promise constructor");e=t,r=n}),this.resolve=l(e),this.reject=l(r)},M=function(t){try{t()}catch(t){return{error:t}}},F=function(t,e){if(!t._n){t._n=!0;var r=t._c;x(function(){for(var n=t._v,u=1==t._s,o=0,i=function(e){var r,o,i=u?e.ok:e.fail,a=e.resolve,c=e.reject,s=e.domain;try{i?(u||(2==t._h&&q(t),t._h=1),i===!0?r=n:(s&&s.enter(),r=i(n),s&&s.exit()),r===e.promise?c(m("Promise-chain cycle")):(o=S(r))?o.call(r,a,c):a(r)):c(n)}catch(t){c(t)}};r.length>o;)i(r[o++]);t._c=[],t._n=!1,e&&!t._h&&A(t)})}},A=function(t){y.call(a,function(){var e,r,n,u=t._v;if(T(t)&&(e=M(function(){g?w.emit("unhandledRejection",u,t):(r=a.onunhandledrejection)?r({promise:t,reason:u}):(n=a.console)&&n.error&&n.error("Unhandled promise rejection",u)}),t._h=g||T(t)?2:1),t._a=void 0,e)throw e.error})},T=function(t){if(1==t._h)return!1;for(var e,r=t._a||t._c,n=0;r.length>n;)if(e=r[n++],e.fail||!T(e.promise))return!1;return!0},q=function(t){y.call(a,function(){var e;g?w.emit("rejectionHandled",t):(e=a.onrejectionhandled)&&e({promise:t,reason:t._v})})},D=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),F(e,!0))},I=function(t){var e,r=this;if(!r._d){r._d=!0,r=r._w||r;try{if(r===t)throw m("Promise can't be resolved itself");(e=S(t))?x(function(){var n={_w:r,_d:!1};try{e.call(t,c(I,n,1),c(D,n,1))}catch(t){D.call(n,t)}}):(r._v=t,r._s=1,F(r,!1))}catch(t){D.call({_w:r,_d:!1},t)}}};j||(_=function(t){d(this,_,b,"_h"),l(t),n.call(this);try{t(c(I,this,1),c(D,this,1))}catch(t){D.call(this,t)}},n=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},n.prototype=r(104)(_.prototype,{then:function(t,e){var r=E(h(this,_));return r.ok="function"!=typeof t||t,r.fail="function"==typeof e&&e,r.domain=g?w.domain:void 0,this._c.push(r),this._a&&this._a.push(r),this._s&&F(this,!1),r.promise},catch:function(t){return this.then(void 0,t)}}),P=function(){var t=new n;this.promise=t,this.resolve=c(I,t,1),this.reject=c(D,t,1)}),f(f.G+f.W+f.F*!j,{Promise:_}),r(20)(_,b),r(106)(b),o=r(1)[b],f(f.S+f.F*!j,b,{reject:function(t){var e=E(this),r=e.reject;return r(t),e.promise}}),f(f.S+f.F*(i||!j),b,{resolve:function(t){if(t instanceof _&&O(t.constructor,this))return t;var e=E(this),r=e.resolve;return r(t),e.promise}}),f(f.S+f.F*!(j&&r(51)(function(t){_.all(t).catch(k)})),b,{all:function(t){var e=this,r=E(e),n=r.resolve,u=r.reject,o=M(function(){var r=[],o=0,i=1;v(t,!1,function(t){var a=o++,c=!1;r.push(void 0),i++,e.resolve(t).then(function(t){c||(c=!0,r[a]=t,--i||n(r))},u)}),--i||n(r)});return o&&u(o.error),r.promise},race:function(t){var e=this,r=E(e),n=r.reject,u=M(function(){v(t,!1,function(t){e.resolve(t).then(r.resolve,n)})});return u&&n(u.error),r.promise}})},function(t,e,r){"use strict";var n=r(3),u=r(8),o=r(7),i=r(5),a=r(56),c=r(98).KEY,s=r(12),f=r(32),p=r(20),l=r(22),d=r(2),v=r(37),h=r(36),y=r(97),x=r(91),b=r(94),m=r(4),w=r(10),_=r(35),g=r(17),k=r(29),j=r(102),O=r(52),S=r(6),E=r(16),P=O.f,M=S.f,F=j.f,A=n.Symbol,T=n.JSON,q=T&&T.stringify,D="prototype",I=d("_hidden"),B=d("toPrimitive"),R={}.propertyIsEnumerable,N=f("symbol-registry"),L=f("symbols"),C=f("op-symbols"),W=Object[D],Q="function"==typeof A,U=n.QObject,Y=!U||!U[D]||!U[D].findChild,z=o&&s(function(){return 7!=k(M({},"a",{get:function(){return M(this,"a",{value:7}).a}})).a})?function(t,e,r){var n=P(W,e);n&&delete W[e],M(t,e,r),n&&t!==W&&M(W,e,n)}:M,K=function(t){var e=L[t]=k(A[D]);return e._k=t,e},G=Q&&"symbol"==typeof A.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof A},J=function(t,e,r){return t===W&&J(C,e,r),m(t),e=_(e,!0),m(r),u(L,e)?(r.enumerable?(u(t,I)&&t[I][e]&&(t[I][e]=!1),r=k(r,{enumerable:g(0,!1)})):(u(t,I)||M(t,I,g(1,{})),t[I][e]=!0),z(t,e,r)):M(t,e,r)},$=function(t,e){m(t);for(var r,n=x(e=w(e)),u=0,o=n.length;o>u;)J(t,r=n[u++],e[r]);return t},H=function(t,e){return void 0===e?k(t):$(k(t),e)},V=function(t){var e=R.call(this,t=_(t,!0));return!(this===W&&u(L,t)&&!u(C,t))&&(!(e||!u(this,t)||!u(L,t)||u(this,I)&&this[I][t])||e)},X=function(t,e){if(t=w(t),e=_(e,!0),t!==W||!u(L,e)||u(C,e)){var r=P(t,e);return!r||!u(L,e)||u(t,I)&&t[I][e]||(r.enumerable=!0),r}},Z=function(t){for(var e,r=F(w(t)),n=[],o=0;r.length>o;)u(L,e=r[o++])||e==I||e==c||n.push(e);return n},tt=function(t){for(var e,r=t===W,n=F(r?C:w(t)),o=[],i=0;n.length>i;)!u(L,e=n[i++])||r&&!u(W,e)||o.push(L[e]);return o};Q||(A=function(){if(this instanceof A)throw TypeError("Symbol is not a constructor!");var t=l(arguments.length>0?arguments[0]:void 0),e=function(r){this===W&&e.call(C,r),u(this,I)&&u(this[I],t)&&(this[I][t]=!1),z(this,t,g(1,r))};return o&&Y&&z(W,t,{configurable:!0,set:e}),K(t)},a(A[D],"toString",function(){return this._k}),O.f=X,S.f=J,r(53).f=j.f=Z,r(19).f=V,r(30).f=tt,o&&!r(18)&&a(W,"propertyIsEnumerable",V,!0),v.f=function(t){return K(d(t))}),i(i.G+i.W+i.F*!Q,{Symbol:A});for(var et="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),rt=0;et.length>rt;)d(et[rt++]);for(var et=E(d.store),rt=0;et.length>rt;)h(et[rt++]);i(i.S+i.F*!Q,"Symbol",{for:function(t){return u(N,t+="")?N[t]:N[t]=A(t)},keyFor:function(t){if(G(t))return y(N,t);throw TypeError(t+" is not a symbol!")},useSetter:function(){Y=!0},useSimple:function(){Y=!1}}),i(i.S+i.F*!Q,"Object",{create:H,defineProperty:J,defineProperties:$,getOwnPropertyDescriptor:X,getOwnPropertyNames:Z,getOwnPropertySymbols:tt}),T&&i(i.S+i.F*(!Q||s(function(){var t=A();return"[null]"!=q([t])||"{}"!=q({a:t})||"{}"!=q(Object(t))})),"JSON",{stringify:function(t){if(void 0!==t&&!G(t)){for(var e,r,n=[t],u=1;arguments.length>u;)n.push(arguments[u++]);return e=n[1],"function"==typeof e&&(r=e),!r&&b(e)||(e=function(t,e){if(r&&(e=r.call(this,t,e)),!G(e))return e}),n[1]=e,q.apply(T,n)}}}),A[D][B]||r(9)(A[D],B,A[D].valueOf),p(A,"Symbol"),p(Math,"Math",!0),p(n.JSON,"JSON",!0)},function(t,e,r){r(36)("asyncIterator")},function(t,e,r){r(36)("observable")},function(t,e){t.exports=require("child_process")},function(t,e){t.exports=require("crypto")},function(t,e){t.exports=require("os")},function(t,e){t.exports=require("path")},function(t,e){t.exports=require("regenerator-runtime")}])}); \ No newline at end of file diff --git a/src/lib/sudoer.js b/src/lib/sudoer.js index f44485c..eabbe61 100644 --- a/src/lib/sudoer.js +++ b/src/lib/sudoer.js @@ -494,10 +494,13 @@ class SudoerWin32 extends Sudoer { cp; sudoArgs.push('-wait'); sudoArgs.push(files.batch); + console.log(files); await this.prepare(); + console.log(this.binary, sudoArgs, options, {wait: false}); cp = spawn(this.binary, sudoArgs, options, {wait: false}); cp.files = files; await this.watchOutput(cp); + console.log(cp); return cp; }