/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/v8flags@4.0.1/index.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
var os=require("os"),fs=require("fs"),path=require("path"),crypto=require("crypto"),execFile=require("child_process").execFile,configPath=require("./config-path.js")(process.platform),env=process.env,user=env.LOGNAME||env.USER||env.LNAME||env.USERNAME||"",exclusions=["--help","--completion-bash"],CACHE_VERSION=3,configfile=".v8flags-"+CACHE_VERSION+"-"+process.versions.v8+"."+crypto.createHash("sha256").update(user).digest("hex")+".json",failureMessage=["Unable to cache a config file for v8flags to your home directory","or a temporary folder. To fix this problem, please correct your","environment by setting HOME=/path/to/home or TEMP=/path/to/temp.","NOTE: the user running this must be able to access provided path.","If all else fails, please open an issue here:","http://github.com/gulpjs/v8flags"].join("\n");function fail(e){return e.message+="\n\n"+failureMessage,e}function openConfig(e){fs.mkdir(configPath,(function(){tryOpenConfig(path.join(configPath,configfile),(function(n,o){return n?tryOpenConfig(path.join(os.tmpdir(),configfile),e):e(null,o)}))}))}function tryOpenConfig(e,n){try{var o=require(e);process.nextTick((function(){n(null,o)}))}catch(o){fs.open(e,"w+",(function(e,o){return e?n(e):n(null,o)}))}}function normalizeFlagName(e){return e.trim()}function getFlags(e){var n=Array.from(process.allowedNodeEnvironmentFlags);execFile(process.execPath,["--v8-options"],(function(o,r){if(o)e(o);else{var i=r.indexOf("\nOptions:");if(i>=0){var t=(r=r.slice(i)).match(/^\s\s--[\w-]+/gm);t&&(n=n.concat(t.map(normalizeFlagName).filter((function(e){return-1===exclusions.indexOf(e)}))))}e(null,n)}}))}function writeConfig(e,n,o){var r=JSON.stringify(n),i=Buffer.from(r);return fs.write(e,i,0,i.length,0,(function(r){fs.close(e,(function(e){var i=r||e;return o(i?fail(i):null,n)}))}))}module.exports=function(e){if(process.versions&&process.versions.electron)return process.nextTick((function(){e(null,[])}));openConfig((function(n,o){if(!n&&"number"!=typeof o)return e(null,o);getFlags((function(r,i){return r?e(r):n?e(fail(n),i):writeConfig(o,i,e)}))}))},module.exports.configfile=configfile,module.exports.configPath=configPath;
//# sourceMappingURL=/sm/6f0f1494434b69a350c3600d4a30b70b09928a935f70b70d4ba11cb91be51832.map