"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WeappCompileCache=exports.WeappCache=exports.WeappRemoteVendor=exports.WeappRemoteLog=exports.WeappRemoteTemp=exports.WeappRemoteData=exports.WeappRemote=exports.WeappFileSystem=exports.WeappBackgroudData=exports.WeappStorage=exports.WeappSimulator=exports.CrashPath=exports.WeappVendor=exports.UserDataPath=exports.getDataPath=void 0,exports.cleanDir=cleanDir,exports.makeSureSimulatorDirExist=makeSureSimulatorDirExist;const tslib_1=require("tslib"),path=tslib_1.__importStar(require("path")),fse=require("fs-extra");let platformCrashPath;async function cleanDir(e,p=!1){try{if(!fse.existsSync(e))return;if((await fse.lstat(e)).isDirectory()){const t=await fse.readdir(e);if(t.length>0)for(const p of t)await cleanDir(path.join(e,p),!0);p&&await fse.rmdir(e)}else p&&await fse.unlink(e)}catch(e){}}function makeSureSimulatorDirExist(){fse.mkdirpSync(exports.WeappStorage),fse.mkdirpSync(exports.WeappBackgroudData),fse.mkdirpSync(exports.WeappFileSystem)}exports.getDataPath=()=>"",exports.UserDataPath=(0,exports.getDataPath)(),exports.WeappVendor=path.join(exports.UserDataPath,"WeappVendor"),platformCrashPath="win32"===process.platform?path.join(exports.UserDataPath,"./Crashpad/reports"):path.join(exports.UserDataPath,"../Crashpad/completed"),exports.CrashPath=platformCrashPath,exports.WeappSimulator=path.join(exports.UserDataPath,"WeappSimulator"),exports.WeappStorage=path.join(exports.WeappSimulator,"WeappStorage"),exports.WeappBackgroudData=path.join(exports.WeappSimulator,"WeappBackgroudData"),exports.WeappFileSystem=path.join(exports.WeappSimulator,"WeappFileSystem"),makeSureSimulatorDirExist(),exports.WeappRemote=path.join(exports.UserDataPath,"WeappRemote"),fse.mkdirpSync(exports.WeappRemote),exports.WeappRemoteData=path.join(exports.UserDataPath,"WeappRemote","data"),cleanDir(exports.WeappRemoteData),fse.mkdirpSync(exports.WeappRemoteData),exports.WeappRemoteTemp=path.join(exports.UserDataPath,"WeappRemote","temp"),cleanDir(exports.WeappRemoteTemp),fse.mkdirpSync(exports.WeappRemoteTemp),exports.WeappRemoteLog=path.join(exports.UserDataPath,"WeappRemote","log"),cleanDir(exports.WeappRemoteLog),fse.mkdirpSync(exports.WeappRemoteLog),exports.WeappRemoteVendor=path.join(exports.UserDataPath,"WeappRemote","vendor"),fse.mkdirpSync(exports.WeappRemoteVendor),exports.WeappCache=path.join(exports.UserDataPath,"WeappCache"),exports.WeappCompileCache=path.join(exports.WeappCache,"WeappCompileCache");