!function(){function e(n){if(!u.existsSync(n)){var r=s.dirname(n);e(r);u.existsSync(n)||u.mkdirSync(n)}}function n(e){var n=u.statSync(e);return n&&n.isDirectory()}function r(){var e=new Error,n=e.stack.split("\n")[3].split(":")[1];return n}function t(e,r){if(!u.existsSync(e))return!1;for(var a=u.readdirSync(e),i=[],o=0;o<a.length;o++){var c=s.join(e,a[o]);if(n(c))i.push(c);else if(u.statSync(c).mtime>r)return!0}for(o=0;o<i.length;o++){c=i[o];if(t(c))return!0}return!1}function a(e){function r(e){if(n(e))for(var a=u.readdirSync(e),i=0;i<a.length;i++){var o=a[i];r(s.join(e,o))}else t++}var t=0;r(e);return t}function i(r,t,a,o){if(u.existsSync(r))if(n(r)){e(t);for(var c=u.readdirSync(r),l=0;l<c.length;l++){var f=c[l];i(s.join(r,f),s.join(t,f),a,o)}}else{var h=u.statSync(r);if(!a&&u.existsSync(t)){var d=u.statSync(t);if(h.mtime<=d.mtime)return}e(s.dirname(t));o?u.writeFile(t,u.readFileSync(r),function(e){if(e)throw e;o()}):u.writeFileSync(t,u.readFileSync(r));a||u.utimesSync(t,h.atime,h.mtime)}}function o(e,n){var r=s.join(e,n);return r==s.resolve(r)?r:null}var c={},u=require("fs"),s=require("path");c.ensureDir=e;c.isdir=n;c.getAllFiles=function(e,r){fullPath=s.join(e,r);if(!n(fullPath))return[r];for(var t=u.readdirSync(fullPath),a=[],i=0;i<t.length;i++){var o=t[i],l=s.join(r,o);a=a.concat(c.getAllFiles(e,l))}return a};c.expandFolder=function(e){var r={files:[],folders:[]};if(u.existsSync(e)&&n(e))for(var t=u.readdirSync(e),a=0;a<t.length;a++){var i=t[a];n(s.join(e,i))?r.folders.push(i):r.files.push(i)}return r};c.num2char=function(e){var n;n=e>=0&&10>e?e+"0".charCodeAt(0):e>=10&&36>e?e-10+"A".charCodeAt(0):e-36+"a".charCodeAt(0);return String.fromCharCode(n)};c.char2num=function(e){return e>="0"&&"9">=e?e.charCodeAt(0)-"0".charCodeAt(0):e>="A"&&"Z">=e?e.charCodeAt(0)-"A".charCodeAt(0)+10:e.charCodeAt(0)-"a".charCodeAt(0)+36};c.mt2Date=function(e){var n=new Date;n.setFullYear(c.char2num(e[0])+2e3);n.setMonth(c.char2num(e[1])-1);n.setDate(c.char2num(e[2]));n.setHours(c.char2num(e[3]));n.setMinutes(c.char2num(e[4]));n.setSeconds(c.char2num(e[5]));return n};c.date2MT=function(e){return c.num2char(e.getFullYear()-2e3)+c.num2char(e.getMonth()+1)+c.num2char(e.getDate())+c.num2char(e.getHours())+c.num2char(e.getMinutes())+c.num2char(e.getSeconds())};c.getMT=function(e){if(!u.existsSync(e))return"0";var n=u.statSync(e).mtime;return c.date2MT(n)};c.setMT=function(e,n){var r=c.mt2Date(n);u.utimesSync(e,r,r)};c.getLogLine=function(e){for(var n=new Date,r=[n.getFullYear()+"-"+(n.getMonth()+1)+"-"+n.getDate()+","+n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()],t=0;t<e.length;t++){var a=e[t];"object"==typeof a&&(a=JSON.stringify(a));r.push(a)}return r.join(" ")};c.logger=function(e){var n=s.basename(e.filename),t={info:function(){console.log.apply(console,arguments)},debug:function(){for(var e=[n+":"+r()+":"],t=0;t<arguments.length;t++)e.push(arguments[t]);console.log.apply(console,e)},dir:function(){for(var e=[n+":"+r()+":"],t=0;t<arguments.length;t++)e.push(arguments[t]);console.dir.apply(console,e)}};t.log=t.debug;return t};var l=(c.logger(module),function(e){var r;if(u.existsSync(e)){r=u.readdirSync(e);r.forEach(function(r){var t=s.join(e,r);n(t)?l(t):u.unlinkSync(t)});u.rmdirSync(e)}});c.deleteFolderRecursive=l;c.checkFolderNewerThan=t;c.readSrcLength=a;c.copy=i;c.checkPathSafety=o;module.exports=c}();