var path=require("path"),fs=require("fs"),_0777=parseInt("0777",8);function mkdirP(r,t,e,i){"function"==typeof t?(e=t,t={}):t&&"object"==typeof t||(t={mode:t});var o=t.mode,a=t.fs||fs;void 0===o&&(o=_0777&~process.umask()),i||(i=null);var c=e||function(){};r=path.resolve(r),a.mkdir(r,o,function(e){if(!e)return c(null,i=i||r);switch(e.code){case"ENOENT":mkdirP(path.dirname(r),t,function(e,i){e?c(e,i):mkdirP(r,t,c,i)});break;default:a.stat(r,function(r,t){r||!t.isDirectory()?c(e,i):c(null,i)})}})}module.exports=mkdirP.mkdirp=mkdirP.mkdirP=mkdirP,mkdirP.sync=function r(t,e,i){e&&"object"==typeof e||(e={mode:e});var o=e.mode,a=e.fs||fs;void 0===o&&(o=_0777&~process.umask()),i||(i=null),t=path.resolve(t);try{a.mkdirSync(t,o),i=i||t}catch(o){switch(o.code){case"ENOENT":r(t,e,i=r(path.dirname(t),e,i));break;default:var c;try{c=a.statSync(t)}catch(r){throw o}if(!c.isDirectory())throw o}}return i};