diff --git a/dist/main.bundle.js b/dist/main.bundle.js index 91a335e7f..2da8e8fe8 100644 --- a/dist/main.bundle.js +++ b/dist/main.bundle.js @@ -1,4 +1,4 @@ -!function(t){function e(e){for(var a,o,s=e[0],l=e[1],c=e[2],u=0,m=[];un)throw L(t.workerScript,`Too many threads requested by ${t.function}. Requested: ${e}. Has: ${n}.`);return a},checkEnvFlags:function(t){const e=t.workerScript;if(e.env.stopFlag)throw new i.a(e);if(e.env.runningFn&&"asleep"!==t.function)throw e.errorMessage=L(e,`Concurrent calls to Netscript functions are not allowed!\n Did you forget to await hack(), grow(), or some other\n promise-returning function?\n Currently running: ${e.env.runningFn} tried to run: ${t.function}`),e.delayReject&&e.delayReject(new i.a(e)),new i.a(e)},checkSingularityAccess:function(t){if(4!==r.a.bitNodeN&&0===r.a.sourceFileLvl(4))throw O(t,"This singularity function requires Source-File 4 to run. A power up you obtain later in the game.\n It will be very obvious when and how you can obtain it.")},netscriptDelay:function(t,e){const n=t.workerScript;return new Promise((function(a,r){n.delay=window.setTimeout(()=>{n.delay=null,n.delayReject=void 0,n.env.runningFn="",n.env.stopFlag?r(new i.a(n)):a()},e),n.delayReject=r,n.env.runningFn=t.function}))},updateDynamicRam:function(t,e){const n=t.workerScript,a=t.function;if(n.dynamicLoadedFns[a])return;n.dynamicLoadedFns[a]=!0;let r=n.scriptRef.threads;"number"!=typeof r&&(console.warn(`WorkerScript detected NaN for threadcount for ${n.name} on ${n.hostname}`),r=1);if(n.dynamicRamUsage+=e,n.dynamicRamUsage>1.01*n.ramUsage)throw n.errorMessage=L(n,`Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${a}.\n This is probably because you somehow circumvented the static RAM calculation.\n\n Threads: ${r}\n Dynamic RAM Usage: ${s.a.formatRAM(n.dynamicRamUsage)}\n Static RAM Usage: ${s.a.formatRAM(n.ramUsage)}\n\n One of these could be the reason:\n * Using eval() to get a reference to a ns function\n   const myScan = eval('ns.scan');\n\n * Using map access to do the same\n   const myScan = ns['scan'];\n\n Sorry :(`),new i.a(n)},city:function(t,e,n){if("string"!=typeof n)throw O(t,e+" should be a city name.");const a=n;if(!Object.values(l.a).includes(a))throw O(t,e+" should be a city name.");return a},getServer:M,scriptIdentifier:function(t,e,n,a){const r=t.workerScript;if(void 0===e)return r.pid;if("number"==typeof e)return e;if("string"==typeof e){const r=void 0===n?t.workerScript.hostname:C(t,"hostname",n),i=void 0===a?[]:x(t,a);return{scriptname:e,hostname:r,args:i}}throw new Error("not implemented")},hack:async function(t,e,n,{threads:a,stock:i}={}){const o=t.workerScript,l=S.resolveNetscriptRequestedThreads(t,a),g=M(t,e);if(!(g instanceof c.a))throw O(t,"Cannot be executed on this server.");const y=Object(f.d)(g,r.a),b=Object(u.b)(g,r.a);if(!b.res)throw O(t,b.msg||"");return T(t,()=>`Executing on '${g.hostname}' in ${Object(m.b)(1e3*y,!0)} (t=${s.a.formatThreads(l)})`),S.netscriptDelay(t,1e3*y).then((function(){const e=Object(f.b)(g,r.a),a=Math.random();let c=Object(f.c)(g,r.a)*l;const u=c/4;if(ag.moneyAvailable&&(m=g.moneyAvailable),g.moneyAvailable-=m,g.moneyAvailable<0&&(g.moneyAvailable=0);let y=m*h.a.ScriptHackMoneyGain;return n&&(y=m*h.a.ManualHackMoney),r.a.gainMoney(y,"hacking"),o.scriptRef.onlineMoneyMade+=y,r.a.scriptProdSinceLastAug+=y,o.scriptRef.recordHack(g.hostname,y,l),r.a.gainHackingExp(c),n&&r.a.gainIntelligenceExp(.005),o.scriptRef.onlineExpGained+=c,T(t,()=>`Successfully hacked '${g.hostname}' for ${s.a.formatMoney(y)} and ${s.a.formatExp(c)} exp (t=${s.a.formatThreads(l)})`),g.fortify(d.a.ServerFortifyAmount*Math.min(l,a)),i&&Object(p.c)(g,m),n&&(g.backdoorInstalled=!0),Promise.resolve(y)}return r.a.gainHackingExp(u),o.scriptRef.onlineExpGained+=u,T(t,()=>`Failed to hack '${g.hostname}'. Gained ${s.a.formatExp(u)} exp (t=${s.a.formatThreads(l)})`),Promise.resolve(0)}))},getValidPort:function(t,e){if(isNaN(e))throw O(t,`Invalid argument. Must be a port number between 1 and ${d.a.NumNetscriptPorts}, is ${e}`);if((e=Math.round(e))<1||e>d.a.NumNetscriptPorts)throw O(t,`Trying to use an invalid port: ${e}. Only ports 1-${d.a.NumNetscriptPorts} are valid.`);const n=g.a[e-1];if(null==n||!(n instanceof Object))throw O(t,`Could not find port: ${e}. This is a bug. Report to dev.`);return n},player:function(t,e){if(!A({hp:void 0,mults:void 0,numPeopleKilled:void 0,money:void 0,city:void 0,location:void 0,bitNodeN:void 0,totalPlaytime:void 0,playtimeSinceLastAug:void 0,playtimeSinceLastBitnode:void 0,jobs:void 0,factions:void 0,tor:void 0,inBladeburner:void 0,hasCorporation:void 0,entropy:void 0},e))throw O(t,"player should be a Player.");return e},server:function(t,e){if(!A({cpuCores:void 0,ftpPortOpen:void 0,hasAdminRights:void 0,hostname:void 0,httpPortOpen:void 0,ip:void 0,isConnectedTo:void 0,maxRam:void 0,organizationName:void 0,ramUsed:void 0,smtpPortOpen:void 0,sqlPortOpen:void 0,sshPortOpen:void 0,purchasedByPlayer:void 0,backdoorInstalled:void 0,baseDifficulty:void 0,hackDifficulty:void 0,minDifficulty:void 0,moneyAvailable:void 0,moneyMax:void 0,numOpenPortsRequired:void 0,openPortCount:void 0,requiredHackingSkill:void 0,serverGrowth:void 0},e))throw O(t,"server should be a Server.");return e},gang:function(t,e){if(!A({respect:0,territory:0,wantedLevel:0},e))throw O(t,"gang should be a Gang.");return e},gangMember:function(t,e){if(!A(new y.a,e))throw O(t,"member should be a GangMember.");return e},gangTask:function(t,e){if(!A(new b.a("","",!1,!1,{}),e))throw O(t,"task should be a GangMemberTask.");return e},log:T,getFunctionNames:function t(e,n){const a=[];for(const[r,i]of Object.entries(e))"args"!==r&&("function"==typeof i?a.push(n+r):"object"==typeof i&&a.push(...t(i,r+".")));return a},getRunningScript:function(t,e){return"number"==typeof e?function(t){for(const e of Object(a.c)()){const n=Object(v.b)(t,e);if(n)return n}return null}(e):R(t,e.scriptname,e.hostname,e.args)},getRunningScriptByArgs:R,getCannotFindRunningScriptErrorMessage:function(t){return"number"==typeof t?"Cannot find running script with pid: "+t:`Cannot find running script ${t.scriptname} on server ${t.hostname} with args: ${Object(k.a)(t.args)}`},createPublicRunningScript:function(t){return{args:t.args.slice(),filename:t.filename,logs:t.logs.slice(),offlineExpGained:t.offlineExpGained,offlineMoneyMade:t.offlineMoneyMade,offlineRunningTime:t.offlineRunningTime,onlineExpGained:t.onlineExpGained,onlineMoneyMade:t.onlineMoneyMade,onlineRunningTime:t.onlineRunningTime,pid:t.pid,ramUsage:t.ramUsage,server:t.server,threads:t.threads}},failOnHacknetServer:function(t,e,n=""){return e instanceof w.a&&(t.workerScript.log(n,()=>"Does not work on Hacknet Servers"),!0)}},_=t=>null===t?"Is null.":void 0===t?"Is undefined.":"function"==typeof t?"Is a function.":`Is of type '${typeof t}', value: ${(t=>{const e=t=>t.length>15?t.slice(0,12)+"...":t;if("number"==typeof t)return String(t);if("string"==typeof t)return""===t?"empty string":`'${e(t)}'`;const n=JSON.stringify(t);return n?`'${e(n)}'`:"???"})(t)}`;function C(t,e,n){if("string"==typeof n)return n;if("number"==typeof n)return n+"";throw O(t,`'${e}' should be a string. ${_(n)}`)}function x(t,e){if(!function(t){return Array.isArray(t)&&t.every(t=>"string"==typeof t||"number"==typeof t||"boolean"==typeof t)}(e))throw O(t,"'args' is not an array of script args");return e}function L(t,e){for(const n of t.scriptRef.dependencies)e=e.replace(new RegExp(n.url,"g"),n.filename);return"|DELIMITER|"+t.hostname+"|DELIMITER|"+t.name+"|DELIMITER|"+e}function O(t,e){const n=(new Error).stack;if(void 0===n)throw new Error("how did we not throw an error?");const a=n.split("\n").slice(1),r=t.workerScript,i=t.function,o=r.getServer().scripts,s=[];for(const t of a){let e;for(const n of o){n.filename&&t.includes(n.filename)&&(e=n.filename);for(const a of n.dependencies)t.includes(a.filename)&&(e=a.filename)}if(!e)continue;function l(t){const e=t.match(/.*:(\d+):\d+.*/),n=t.match(/.*at (.+) \(.*/);return e&&n?{line:e[1],func:n[1]}:null}let n={line:"-1",func:"unknown"};const a=l(t);function c(t){const e=t.match(/.*:(\d+):\d+$/),n=t.lastIndexOf("@");return e&&-1!==n?{line:e[1],func:t.slice(0,n)}:null}a&&(n=a);const r=c(t);r&&(n=r),s.push(`${e}:L${n.line}@${n.func}`)}r.log(i,()=>e);let f=`${i}: ${e}`;return 0!==s.length&&(f+="

Stack:
"+s.join("
")),L(r,f)}function M(t,e){const n=Object(a.d)(e);if(null==n){throw O(t,"Invalid hostname: "+(""===e?"'' (empty string)":"'"+e+"'"))}return n}function A(t,e){if("object"!=typeof e||null==e)return!1;const n=Object.keys(t),a=Object.keys(e);for(const t of n)if(!a.includes(t))return!1;return!0}function T(t,e){t.workerScript.log(t.functionPath,e)}function R(t,e,n,a){if(!Array.isArray(a))throw S.makeRuntimeRejectMsg(t.workerScript,`Invalid scriptArgs argument passed into getRunningScript() from ${t.function}(). This is probably a bug. Please report to game developer`);if(null!=e&&"string"==typeof e){null==n&&(n=t.workerScript.hostname);const r=S.getServer(t,n);return Object(v.a)(e,a,r)}return t.workerScript.scriptRef}},,,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.Illuminati="Illuminati",t.Daedalus="Daedalus",t.TheCovenant="The Covenant",t.ECorp="ECorp",t.MegaCorp="MegaCorp",t.BachmanAssociates="Bachman & Associates",t.BladeIndustries="Blade Industries",t.NWO="NWO",t.ClarkeIncorporated="Clarke Incorporated",t.OmniTekIncorporated="OmniTek Incorporated",t.FourSigma="Four Sigma",t.KuaiGongInternational="KuaiGong International",t.FulcrumSecretTechnologies="Fulcrum Secret Technologies",t.BitRunners="BitRunners",t.TheBlackHand="The Black Hand",t.NiteSec="NiteSec",t.Aevum="Aevum",t.Chongqing="Chongqing",t.Ishima="Ishima",t.NewTokyo="New Tokyo",t.Sector12="Sector-12",t.Volhaven="Volhaven",t.SpeakersForTheDead="Speakers for the Dead",t.TheDarkArmy="The Dark Army",t.TheSyndicate="The Syndicate",t.Silhouette="Silhouette",t.Tetrads="Tetrads",t.SlumSnakes="Slum Snakes",t.Netburners="Netburners",t.TianDiHui="Tian Di Hui",t.CyberSec="CyberSec",t.Bladeburners="Bladeburners",t.ChurchOfTheMachineGod="Church of the Machine God",t.ShadowsOfAnarchy="Shadows of Anarchy"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(179),r=n(347),i=n(421),o=n(124);const s={ActiveScriptsServerPageSize:10,ActiveScriptsScriptPageSize:10,AutosaveInterval:60,CodeInstructionRunTime:50,DisableASCIIArt:!1,DisableHotkeys:!1,DisableTextEffects:!1,DisableOverviewProgressBars:!1,EnableBashHotkeys:!1,TimestampsFormat:"",Locale:"en",MaxRecentScriptsCapacity:50,MaxLogCapacity:50,MaxPortCapacity:50,MaxTerminalCapacity:500,RemoteFileApiPort:0,SaveGameOnFileSave:!0,SuppressBuyAugmentationConfirmation:!1,SuppressFactionInvites:!1,SuppressMessages:!1,SuppressTravelConfirmation:!1,SuppressBladeburnerPopup:!1,SuppressTIXPopup:!1,SuppressSavedGameToast:!1,SuppressAutosaveDisabledWarnings:!1,UseIEC60027_2:!1,ExcludeRunningScriptsFromSave:!1,IsSidebarOpened:!0,theme:r.a,styles:i.a,overview:{x:0,y:0,opened:!0},EditorTheme:o.a},l={ActiveScriptsServerPageSize:s.ActiveScriptsServerPageSize,ActiveScriptsScriptPageSize:s.ActiveScriptsScriptPageSize,AutosaveInterval:s.AutosaveInterval,CodeInstructionRunTime:25,DisableASCIIArt:s.DisableASCIIArt,DisableHotkeys:s.DisableHotkeys,DisableTextEffects:s.DisableTextEffects,DisableOverviewProgressBars:s.DisableOverviewProgressBars,EnableBashHotkeys:s.EnableBashHotkeys,TimestampsFormat:s.TimestampsFormat,Locale:"en",MaxRecentScriptsCapacity:s.MaxRecentScriptsCapacity,MaxLogCapacity:s.MaxLogCapacity,MaxPortCapacity:s.MaxPortCapacity,MaxTerminalCapacity:s.MaxTerminalCapacity,OwnedAugmentationsOrder:a.a.AcquirementTime,PurchaseAugmentationsOrder:a.b.Default,RemoteFileApiPort:s.RemoteFileApiPort,SaveGameOnFileSave:s.SaveGameOnFileSave,SuppressBuyAugmentationConfirmation:s.SuppressBuyAugmentationConfirmation,SuppressFactionInvites:s.SuppressFactionInvites,SuppressMessages:s.SuppressMessages,SuppressTravelConfirmation:s.SuppressTravelConfirmation,SuppressBladeburnerPopup:s.SuppressBladeburnerPopup,SuppressTIXPopup:s.SuppressTIXPopup,SuppressSavedGameToast:s.SuppressSavedGameToast,SuppressAutosaveDisabledWarnings:s.SuppressAutosaveDisabledWarnings,UseIEC60027_2:s.UseIEC60027_2,ExcludeRunningScriptsFromSave:s.ExcludeRunningScriptsFromSave,IsSidebarOpened:s.IsSidebarOpened,MonacoTheme:"monokai",MonacoInsertSpaces:!1,MonacoFontSize:20,MonacoVim:!1,MonacoWordWrap:"off",theme:{...r.a},styles:{...i.a},overview:s.overview,EditorTheme:{...o.a},init(){Object.assign(l,s)},load(t){const e=JSON.parse(t);Object.assign(l.theme,e.theme),delete e.theme,Object.assign(l.styles,e.styles),delete e.styles,Object.assign(l.overview,e.overview),delete e.overview,Object.assign(l.EditorTheme,e.EditorTheme),delete e.EditorTheme,Object.assign(l,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(189),r=n.n(a),i=(n(1582),n(1583),n(1584),n(1585),n(1586),n(1587),n(1588),n(1589),n(1590),n(1591),n(1592),n(1593),n(1594),n(1595),n(6));const o=[1e15,1e18,1e21,1e24,1e27,1e30],s=["q","Q","s","S","o","n"],l=1e9,c=2**30;const f=new class{constructor(){var t,e,n;n="en",(e="defaultLocale")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,this.defaultLocale="en"}updateLocale(t){return null!=r.a.locale(t)||(console.warn("Invalid locale for numeral: "+t),r.a.locale(this.defaultLocale),!1)}format(t,e){Math.abs(t)<1e-6&&(t=0);const n=r()(t).format(e);return"NaN"===n?""+t:n}formatBigNumber(t){return this.format(t,"0.000a")}formatReallyBigNumber(t,e=3){const n=Math.abs(t);if(t===1/0)return"∞";for(let a=0;aObject(o.a)({unbuyable:{color:t.palette.action.disabled},money:{color:t.colors.money}}));function l(t){const e=s();if(void 0!==t.player){if("number"!=typeof t.money)throw new Error("if player if provided, money should be number, contact dev");if(!t.player.canAfford(t.money))return a.createElement("span",{className:e.unbuyable},r.a.formatMoney(t.money))}return a.createElement("span",{className:e.money},"number"==typeof t.money?r.a.formatMoney(t.money):t.money)}},function(t,e,n){"use strict";n.d(e,"d",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"g",(function(){return p})),n.d(e,"e",(function(){return g})),n.d(e,"a",(function(){return y})),n.d(e,"f",(function(){return b})),n.d(e,"i",(function(){return E})),n.d(e,"h",(function(){return v})),n.d(e,"j",(function(){return k}));var a=n(45),r=n(382),i=n(350),o=n(34),s=n(15),l=n(1051),c=n(89),f=n(22);let u={};function m(t){if(u.hasOwnProperty(t)){const e=u[t];if(e)return e}if(!Object(l.a)(t))return function(t){for(const e of Object.keys(u)){const n=u[e];if(n.hostname==t)return n}return null}(t);const e=function(t){for(const e of Object.keys(u)){const n=u[e];if(n.ip===t)return n}}(t);return void 0!==e?e:null}function h(){const t=[];for(const e of Object.keys(u))t.push(u[e]);return t}function d(t){for(const e of Object.keys(u)){const n=u[e];if(n.ip===t||n.hostname===t){delete u[e];break}}}function p(t){for(const e in u)if(u[e].ip===t)return!0;return!1}function g(){let t;do{t=Object(i.a)()}while(p(t));return t}function y(t){if(m(t.hostname))throw console.warn("Hostname of the server thats being added: "+t.hostname),console.warn("The server that already has this IP is: "+u[t.hostname].hostname),new Error("Error: Trying to add a server with an existing IP");u[t.hostname]=t}function b(t){const e=[];for(let t=0;t<15;t++)e.push([]);const n=t=>"number"==typeof t?t:Object(o.a)(t.min,t.max);for(const t of r.a){const r={hostname:t.hostname,ip:g(),numOpenPortsRequired:t.numOpenPortsRequired,organizationName:t.organizationName};void 0!==t.maxRamExponent&&(r.maxRam=Math.pow(2,n(t.maxRamExponent))),t.hackDifficulty&&(r.hackDifficulty=n(t.hackDifficulty)),t.moneyAvailable&&(r.moneyAvailable=n(t.moneyAvailable)),t.requiredHackingSkill&&(r.requiredHackingSkill=n(t.requiredHackingSkill)),t.serverGrowth&&(r.serverGrowth=n(t.serverGrowth));const i=new a.a(r);for(const e of t.literature||[])i.messages.push(e);i.hostname===c.a.WorldDaemon&&(i.requiredHackingSkill*=f.a.WorldDaemonDifficulty),y(i),void 0!==t.networkLayer&&e[n(t.networkLayer)-1].push(i)}const i=(t,e)=>{for(const r of t)n=r,a=e(),n.serversOnNetwork.push(a.hostname),a.serversOnNetwork.push(n.hostname);var n,a};i(e[0],()=>t);for(let t=1;t{return(n=e[t-1])[Math.floor(Math.random()*n.length)];var n})}function E(){for(const t of Object.keys(u))delete u[t];u={}}function v(t){u=JSON.parse(t,s.c)}function k(t=!1){const e=JSON.parse(JSON.stringify(u),s.c);for(const n of Object.keys(e)){const a=e[n];if(t)a.runningScripts=[];else for(let t=0;tObject(a.useContext)(i.Player),Router:()=>Object(a.useContext)(i.Router)}},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.ActiveScripts=0]="ActiveScripts",t[t.Augmentations=1]="Augmentations",t[t.BitVerse=2]="BitVerse",t[t.Bladeburner=3]="Bladeburner",t[t.City=4]="City",t[t.Corporation=5]="Corporation",t[t.CreateProgram=6]="CreateProgram",t[t.ScriptEditor=7]="ScriptEditor",t[t.DevMenu=8]="DevMenu",t[t.Faction=9]="Faction",t[t.Factions=10]="Factions",t[t.Gang=11]="Gang",t[t.Hacknet=12]="Hacknet",t[t.Infiltration=13]="Infiltration",t[t.Job=14]="Job",t[t.Milestones=15]="Milestones",t[t.Options=16]="Options",t[t.Grafting=17]="Grafting",t[t.Sleeves=18]="Sleeves",t[t.Stats=19]="Stats",t[t.StockMarket=20]="StockMarket",t[t.Terminal=21]="Terminal",t[t.Travel=22]="Travel",t[t.Tutorial=23]="Tutorial",t[t.Work=24]="Work",t[t.BladeburnerCinematic=25]="BladeburnerCinematic",t[t.Location=26]="Location",t[t.Loading=27]="Loading",t[t.StaneksGift=28]="StaneksGift",t[t.Recovery=29]="Recovery",t[t.Achievements=30]="Achievements",t[t.ThemeBrowser=31]="ThemeBrowser",t[t.ImportSave=32]="ImportSave"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"f",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return l})),n.d(e,"c",(function(){return c}));var a=n(163);function r(t,e=!1){t=Math.floor(t);const n=Math.floor(t/1e3),a=Math.floor(n/86400),r=n%86400,i=Math.floor(r/3600),o=r%3600,s=Math.floor(o/60),l=o%60,c=(()=>{let e=""+t%1e3;for(;e.length<3;)e="0"+e;return e})();let f="";return a>0&&(f+=a+" days "),i>0&&(f+=i+" hours "),s>0&&(f+=s+" minutes "),f+=(e?`${l}.${c}`:""+l)+" seconds",f}function i(t){if(!o(t))return"";if(0===t.length)return"";const e=t.concat().sort(),n=e[0],a=e[e.length-1],r=n.length;let i=0;for(;i>>16,2246822507)^Math.imul(a^a>>>13,3266489909),a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&a)+(n>>>0)).toString(16)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return c}));var a=n(201),r=n(393),i=n(15);let o={};function s(t){o=JSON.parse(t,i.c);for(const t of Object.keys(o))try{o[t].getInfo()}catch(e){console.error("deleting "+t),delete o[t]}}function l(t){return o.hasOwnProperty(t)}function c(){for(const t of Object.keys(r.a))f(new a.a(t))}function f(t){if(!(t instanceof a.a))throw new Error("Invalid argument 'newFactionObject' passed into resetFaction()");const e=t.name;l(e)&&(t.favor=o[e].favor,delete o[e]),function(t){const e=t.name;o[e]=t}(t)}},function(t,e,n){"use strict";let a,r;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r})),function(t){t.ENTER="Enter",t.ESC="Escape",t.TAB="Tab",t.SPACE=" ",t.BACKSPACE="Backspace",t.UP_ARROW="ArrowUp",t.DOWN_ARROW="ArrowDown",t.LEFT_ARROW="ArrowLeft",t.RIGHT_ARROW="ArrowRight",t.QUOTE="'",t.DOUBLE_QUOTE='"',t.OPEN_BRACKET="[",t.CLOSE_BRACKET="]",t.LESS_THAN="<",t.GREATER_THAN=">",t.OPEN_PARENTHESIS="(",t.CLOSE_PARENTHESIS=")",t.OPEN_BRACE="{",t.CLOSE_BRACE="}",t.EQUAL="=",t.PIPE="|",t.DOT=".",t.FORWARD_SLASH="/",t.HYPHEN="-",t.HASH="#",t.k0="0",t.k1="1",t.k2="2",t.k3="3",t.k4="4",t.k5="5",t.k6="6",t.k7="7",t.k8="8",t.k9="9",t.A="a",t.B="b",t.C="c",t.D="d",t.E="e",t.F="f",t.G="g",t.H="h",t.I="i",t.J="j",t.K="k",t.L="l",t.M="m",t.N="n",t.O="o",t.P="p",t.Q="q",t.R="r",t.S="s",t.T="t",t.U="u",t.V="v",t.W="w",t.X="x",t.Y="y",t.Z="z"}(a||(a={})),function(t){t.ENTER="Enter",t.ESC="Escape",t.TAB="Tab",t.SPACE="Space",t.BACKSPACE="Backspace",t.UP_ARROW="ArrowUp",t.DOWN_ARROW="ArrowDown",t.LEFT_ARROW="ArrowLeft",t.RIGHT_ARROW="ArrowRight",t.BACKWARD_SLASH="Backslash",t.BACKQUOTE="Backquote",t.COMMA="Comma",t.DOT="Period",t.EQUAL="Equal",t.FORWARD_SLASH="Slash",t.HYPHEN="Minus",t.SEMICOLON="Semicolon",t.QUOTE="Quote",t.k0="Digit0",t.k1="Digit1",t.k2="Digit2",t.k3="Digit3",t.k4="Digit4",t.k5="Digit5",t.k6="Digit6",t.k7="Digit7",t.k8="Digit8",t.k9="Digit9",t.A="KeyA",t.B="KeyB",t.C="KeyC",t.D="KeyD",t.E="KeyE",t.F="KeyF",t.G="KeyG",t.H="KeyH",t.I="KeyI",t.J="KeyJ",t.K="KeyK",t.L="KeyL",t.M="KeyM",t.N="KeyN",t.O="KeyO",t.P="KeyP",t.Q="KeyQ",t.R="KeyR",t.S="KeyS",t.T="KeyT",t.U="KeyU",t.V="KeyV",t.W="KeyW",t.X="KeyX",t.Y="KeyY",t.Z="KeyZ"}(r||(r={}))},,function(t,e,n){"use strict";n.d(e,"j",(function(){return a})),n.d(e,"d",(function(){return r})),n.d(e,"i",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"h",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return u})),n.d(e,"c",(function(){return m})),n.d(e,"g",(function(){return h}));const a=["Software Engineering Intern","Junior Software Engineer","Senior Software Engineer","Lead Software Developer","Head of Software","Head of Engineering","Vice President of Technology","Chief Technology Officer"],r=["IT Intern","IT Analyst","IT Manager","Systems Administrator"],i=["Security Engineer"],o=["Network Engineer","Network Administrator"],s=["Business Intern","Business Analyst","Business Manager","Operations Manager","Chief Financial Officer","Chief Executive Officer"],l=["Police Officer","Police Chief","Security Guard","Security Officer","Security Supervisor","Head of Security"],c=["Field Agent","Secret Agent","Special Operative"],f=["Waiter","Employee"],u=["Software Consultant","Senior Software Consultant"],m=["Business Consultant","Senior Business Consultant"],h=["Part-time Waiter","Part-time Employee"]},,function(t,e,n){"use strict";function a(t,e){const n=Math.min(t,e),a=Math.max(t,e);return Math.floor(Math.random()*(a-n+1))+n}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(17);const r=["START","PURCHASE","PRODUCTION","SALE","EXPORT"],i={INITIALSHARES:1e9,SHARESPERPRICEUPDATE:1e6,IssueNewSharesCooldown:216e3,SellSharesCooldown:18e3,CyclesPerMarketCycle:50,CyclesPerIndustryStateCycle:50/r.length,SecsPerMarketCycle:10,Cities:[a.a.Aevum,a.a.Chongqing,a.a.Sector12,a.a.NewTokyo,a.a.Ishima,a.a.Volhaven],WarehouseInitialCost:5e9,WarehouseInitialSize:100,WarehouseUpgradeBaseCost:1e9,OfficeInitialCost:4e9,OfficeInitialSize:3,OfficeUpgradeBaseCost:1e9,BribeThreshold:1e14,BribeToRepRatio:1e9,ProductProductionCostRatio:5,DividendMaxRate:1,EmployeeSalaryMultiplier:3,CyclesPerEmployeeRaise:400,EmployeeRaiseAmount:50,BaseMaxProducts:3,AllCorporationStates:r,AllMaterials:["Water","Energy","Food","Plants","Metal","Hardware","Chemicals","Drugs","Robots","AI Cores","Real Estate"],AllIndustryTypes:["Energy","Utilities","Agriculture","Fishing","Mining","Food","Tobacco","Chemical","Pharmaceutical","Hardware","Robotics","Software","Healthcare","RealEstate"],AllUnlocks:["Export","Smart Supply","Market Research - Demand","Market Data - Competition","VeChain","Shady Accounting","Government Partnership","Warehouse API","Office API"],AllUpgrades:["Smart Factories","Smart Storage","DreamSense","Wilson Analytics","Nuoptimal Nootropic Injector Implants","Speech Processor Implants","Neural Accelerators","FocusWires","ABC SalesBots","Project Insight"],AllResearch:["Hi-Tech R&D Laboratory","AutoBrew","AutoPartyManager","Automatic Drug Administration","Bulk Purchasing","CPH4 Injections","Drones","Drones - Assembly","Drones - Transport","Go-Juice","HRBuddy-Recruitment","HRBuddy-Training","JoyWire","Market-TA.I","Market-TA.II","Overclock","Self-Correcting Assemblers","Sti.mu","sudo.Assist","uPgrade: Capacity.I","uPgrade: Capacity.II","uPgrade: Dashboard","uPgrade: Fulcrum"],FundingRoundShares:[.1,.35,.25,.2],FundingRoundMultiplier:[4,3,3,2.5],AvgProfitLength:1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n(29),i=n(7),o=n(23),s=n(15),l=n(5),c=n(12),f=n(13),u=n(74),m=n(22),h=n(114),d=n(367),p=n(213);function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class y{constructor(t={info:"",moneyCost:0,name:"",repCost:0,factions:[]}){g(this,"baseCost",0),g(this,"baseRepRequirement",0),g(this,"isSpecial",!1),g(this,"name",""),g(this,"prereqs",[]),g(this,"mults",Object(p.a)()),g(this,"factions",[]),this.name=t.name,this.info=t.info,this.prereqs=t.prereqs?t.prereqs:[],this.baseRepRequirement=t.repCost,Object.freeze(this.baseRepRequirement),this.baseCost=t.moneyCost,Object.freeze(this.baseCost),this.factions=t.factions,t.isSpecial&&(this.isSpecial=!0),t.hacking&&(this.mults.hacking=t.hacking),t.strength&&(this.mults.strength=t.strength),t.defense&&(this.mults.defense=t.defense),t.dexterity&&(this.mults.dexterity=t.dexterity),t.agility&&(this.mults.agility=t.agility),t.charisma&&(this.mults.charisma=t.charisma),t.hacking_exp&&(this.mults.hacking_exp=t.hacking_exp),t.strength_exp&&(this.mults.strength_exp=t.strength_exp),t.defense_exp&&(this.mults.defense_exp=t.defense_exp),t.dexterity_exp&&(this.mults.dexterity_exp=t.dexterity_exp),t.agility_exp&&(this.mults.agility_exp=t.agility_exp),t.charisma_exp&&(this.mults.charisma_exp=t.charisma_exp),t.hacking_chance&&(this.mults.hacking_chance=t.hacking_chance),t.hacking_speed&&(this.mults.hacking_speed=t.hacking_speed),t.hacking_money&&(this.mults.hacking_money=t.hacking_money),t.hacking_grow&&(this.mults.hacking_grow=t.hacking_grow),t.company_rep&&(this.mults.company_rep=t.company_rep),t.faction_rep&&(this.mults.faction_rep=t.faction_rep),t.crime_money&&(this.mults.crime_money=t.crime_money),t.crime_success&&(this.mults.crime_success=t.crime_success),t.work_money&&(this.mults.work_money=t.work_money),t.hacknet_node_money&&(this.mults.hacknet_node_money=t.hacknet_node_money),t.hacknet_node_purchase_cost&&(this.mults.hacknet_node_purchase_cost=t.hacknet_node_purchase_cost),t.hacknet_node_ram_cost&&(this.mults.hacknet_node_ram_cost=t.hacknet_node_ram_cost),t.hacknet_node_core_cost&&(this.mults.hacknet_node_core_cost=t.hacknet_node_core_cost),t.hacknet_node_level_cost&&(this.mults.hacknet_node_level_cost=t.hacknet_node_level_cost),t.bladeburner_max_stamina&&(this.mults.bladeburner_max_stamina=t.bladeburner_max_stamina),t.bladeburner_stamina_gain&&(this.mults.bladeburner_stamina_gain=t.bladeburner_stamina_gain),t.bladeburner_analysis&&(this.mults.bladeburner_analysis=t.bladeburner_analysis),t.bladeburner_success_chance&&(this.mults.bladeburner_success_chance=t.bladeburner_success_chance),void 0===t.stats?this.stats=function(t,e,n){const r=(t,e=0)=>t===1.0777-1?"7.77%":t===1.777-1?"77.7%":i.a.formatPercentage(t,e);let s=a.createElement(a.Fragment,null,"Effects:");return 1!==t.hacking&&t.hacking==t.strength&&t.hacking==t.defense&&t.hacking==t.dexterity&&t.hacking==t.agility&&t.hacking==t.charisma?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking-1)," all skills"):(1!==t.hacking&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking-1)," hacking skill")),1!==t.strength&&t.strength==t.defense&&t.strength==t.dexterity&&t.strength==t.agility?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength-1)," combat skills"):(1!==t.strength&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength-1)," strength skill")),1!==t.defense&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense-1)," defense skill")),1!==t.dexterity&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity-1)," dexterity skill")),1!==t.agility&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility-1)," agility skill"))),1!==t.charisma&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma-1)," charisma skill"))),1!==t.hacking_exp&&t.hacking_exp===t.strength_exp&&t.hacking_exp===t.defense_exp&&t.hacking_exp===t.dexterity_exp&&t.hacking_exp===t.agility_exp&&t.hacking_exp===t.charisma_exp?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp-1)," exp for all skills"):(1!==t.hacking_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp-1)," hacking exp")),1!==t.strength_exp&&t.strength_exp===t.defense_exp&&t.strength_exp===t.dexterity_exp&&t.strength_exp===t.agility_exp?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp-1)," combat exp"):(1!==t.strength_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp-1)," strength exp")),1!==t.defense_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense_exp-1)," defense exp")),1!==t.dexterity_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity_exp-1)," dexterity exp")),1!==t.agility_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility_exp-1)," agility exp"))),1!==t.charisma_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma_exp-1)," charisma exp"))),1!==t.hacking_speed&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_speed-1)," faster hack(), grow(), and weaken()")),1!==t.hacking_chance&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_chance-1)," hack() success chance")),1!==t.hacking_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_money-1)," hack() power")),1!==t.hacking_grow&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_grow-1)," grow() power")),1!==t.faction_rep&&t.faction_rep===t.company_rep?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep-1)," reputation from factions and companies"):(1!==t.faction_rep&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep-1)," reputation from factions")),1!==t.company_rep&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.company_rep-1)," reputation from companies"))),1!==t.crime_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_money-1)," crime money")),1!==t.crime_success&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_success-1)," crime success rate")),1!==t.work_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.work_money-1)," work money")),1!==t.hacknet_node_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacknet_node_money-1)," hacknet production")),1!==t.hacknet_node_purchase_cost&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_purchase_cost-1))," hacknet nodes cost")),1!==t.hacknet_node_level_cost&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_level_cost-1))," hacknet nodes upgrade cost")),1!==t.bladeburner_max_stamina&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_max_stamina-1)," Bladeburner Max Stamina")),1!==t.bladeburner_stamina_gain&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_stamina_gain-1)," Bladeburner Stamina gain")),1!==t.bladeburner_analysis&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_analysis-1)," Bladeburner Field Analysis effectiveness")),1!==t.bladeburner_success_chance&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_success_chance-1)," Bladeburner Contracts and Operations success chance")),n&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"Start with ",a.createElement(o.a,{money:n})," after installing Augmentations.")),e&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"Start with ",e.join(" and ")," after installing Augmentations.")),s}(this.mults,t.programs,t.startingMoney):this.stats=t.stats}addToFactions(t){for(let e=0;et.name),i=Math.pow(f.a.SoACostMult,r.filter(e=>t.hasAugmentation(e)).length);n=e.baseCost*i,r.find(t=>t===e.name)&&(a=e.baseRepRequirement*i)}else n=e.baseCost*Object(h.d)()*m.a.AugmentationMoneyCost,a=e.baseRepRequirement*m.a.AugmentationRepCost;return{moneyCost:n,repCost:a}}getLevel(t){if(this.name===c.a.NeuroFluxGovernor){let e=0;for(let n=0;nObject(o.a)({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{backgroundColor:t.palette.background.default,border:"2px solid "+t.palette.primary.main,boxShadow:`0px 3px 5px -1px ${t.palette.primary.dark},0px 5px 8px 0px ${t.palette.primary.dark},0px 1px 14px 0px ${t.palette.primary.dark}`,padding:2,maxWidth:"80%",maxHeight:"80%",overflow:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}})),u=t=>{const e=f();return c.a.createElement(i.a,{disableRestoreFocus:!0,disableScrollLock:!0,disableEnforceFocus:!0,disableAutoFocus:!0,open:t.open,onClose:t.onClose,closeAfterTransition:!0,className:e.modal,sx:t.sx},c.a.createElement(r.a,{in:t.open},c.a.createElement("div",{className:e.paper},c.a.createElement(a.a,{sx:{m:2}},t.children))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return i}));const a={MoneyGainPerLevel:1.5,BaseCost:1e3,LevelBaseCost:1,RamBaseCost:3e4,CoreBaseCost:5e5,PurchaseNextMult:1.85,UpgradeLevelMult:1.04,UpgradeRamMult:1.28,UpgradeCoreMult:1.48,MaxLevel:200,MaxRam:64,MaxCores:16},r={x1:1,x5:5,x10:10,MAX:"MAX"},i={HashesPerLevel:.001,BaseCost:5e4,RamBaseCost:2e5,CoreBaseCost:1e6,CacheBaseCost:1e7,PurchaseMult:3.2,UpgradeLevelMult:1.1,UpgradeRamMult:1.4,UpgradeCoreMult:1.55,UpgradeCacheMult:1.85,MaxServers:20,MaxLevel:300,MaxRam:8192,MaxCores:128,MaxCache:15}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Operations:"Operations",Engineer:"Engineer",Business:"Business",Management:"Management",RandD:"Research & Development",Training:"Training",Unassigned:"Unassigned"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Idle:1,Contract:2,Operation:3,BlackOp:4,BlackOperation:4,Training:5,Recruitment:6,FieldAnalysis:7,"Field Analysis":7,Diplomacy:8,"Hyperbolic Regeneration Chamber":9,"Incite Violence":10}},function(t,e,n){"use strict";n.d(e,"f",(function(){return a})),n.d(e,"b",(function(){return u})),n.d(e,"e",(function(){return l})),n.d(e,"c",(function(){return c})),n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return f}));var a,r=n(1),i=n(66),o=n(396);!function(t){t[t.Start=0]="Start",t[t.NSSelection=1]="NSSelection",t[t.GoToCharacterPage=2]="GoToCharacterPage",t[t.CharacterPage=3]="CharacterPage",t[t.CharacterGoToTerminalPage=4]="CharacterGoToTerminalPage",t[t.TerminalIntro=5]="TerminalIntro",t[t.TerminalHelp=6]="TerminalHelp",t[t.TerminalLs=7]="TerminalLs",t[t.TerminalScan=8]="TerminalScan",t[t.TerminalScanAnalyze1=9]="TerminalScanAnalyze1",t[t.TerminalScanAnalyze2=10]="TerminalScanAnalyze2",t[t.TerminalConnect=11]="TerminalConnect",t[t.TerminalAnalyze=12]="TerminalAnalyze",t[t.TerminalNuke=13]="TerminalNuke",t[t.TerminalManualHack=14]="TerminalManualHack",t[t.TerminalHackingMechanics=15]="TerminalHackingMechanics",t[t.TerminalGoHome=16]="TerminalGoHome",t[t.TerminalCreateScript=17]="TerminalCreateScript",t[t.TerminalTypeScript=18]="TerminalTypeScript",t[t.TerminalFree=19]="TerminalFree",t[t.TerminalRunScript=20]="TerminalRunScript",t[t.TerminalGoToActiveScriptsPage=21]="TerminalGoToActiveScriptsPage",t[t.ActiveScriptsPage=22]="ActiveScriptsPage",t[t.ActiveScriptsToTerminal=23]="ActiveScriptsToTerminal",t[t.TerminalTailScript=24]="TerminalTailScript",t[t.GoToHacknetNodesPage=25]="GoToHacknetNodesPage",t[t.HacknetNodesIntroduction=26]="HacknetNodesIntroduction",t[t.HacknetNodesGoToWorldPage=27]="HacknetNodesGoToWorldPage",t[t.WorldDescription=28]="WorldDescription",t[t.TutorialPageInfo=29]="TutorialPageInfo",t[t.End=30]="End"}(a||(a={}));const s={currStep:a.Start,isRunning:!1,stepIsDone:{[a.Start]:!1,[a.NSSelection]:!1,[a.GoToCharacterPage]:!1,[a.CharacterPage]:!1,[a.CharacterGoToTerminalPage]:!1,[a.TerminalIntro]:!1,[a.TerminalHelp]:!1,[a.TerminalLs]:!1,[a.TerminalScan]:!1,[a.TerminalScanAnalyze1]:!1,[a.TerminalScanAnalyze2]:!1,[a.TerminalConnect]:!1,[a.TerminalAnalyze]:!1,[a.TerminalNuke]:!1,[a.TerminalManualHack]:!1,[a.TerminalHackingMechanics]:!1,[a.TerminalGoHome]:!1,[a.TerminalCreateScript]:!1,[a.TerminalTypeScript]:!1,[a.TerminalFree]:!1,[a.TerminalRunScript]:!1,[a.TerminalGoToActiveScriptsPage]:!1,[a.ActiveScriptsPage]:!1,[a.ActiveScriptsToTerminal]:!1,[a.TerminalTailScript]:!1,[a.GoToHacknetNodesPage]:!1,[a.HacknetNodesIntroduction]:!1,[a.HacknetNodesGoToWorldPage]:!1,[a.WorldDescription]:!1,[a.TutorialPageInfo]:!1,[a.End]:!1}};function l(){s.isRunning=!0,s.currStep=a.Start}function c(){s.stepIsDone[s.currStep]=!0,s.currStepa.Start&&(s.currStep-=1),o.a.emit()}function u(){s.isRunning=!1,s.currStep=a.Start,r.a.getHomeComputer().messages.push(i.a.HackersStartingHandbook),o.a.emit()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(598),r=n(22),i=n(1048),o=n(350),s=n(15);function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class c extends a.a{constructor(t={hostname:"",ip:Object(o.a)()}){super(t),l(this,"backdoorInstalled",!1),l(this,"baseDifficulty",1),l(this,"hackDifficulty",1),l(this,"minDifficulty",1),l(this,"moneyAvailable",0),l(this,"moneyMax",0),l(this,"numOpenPortsRequired",5),l(this,"openPortCount",0),l(this,"requiredHackingSkill",1),l(this,"serverGrowth",1),this.hostname.startsWith("hacknet-node-")&&(this.hostname=Object(i.a)(10)),this.purchasedByPlayer=null!=t.purchasedByPlayer&&t.purchasedByPlayer,this.maxRam=null!=t.maxRam?t.maxRam:0,this.requiredHackingSkill=null!=t.requiredHackingSkill?t.requiredHackingSkill:1,this.moneyAvailable=null!=t.moneyAvailable?t.moneyAvailable*r.a.ServerStartingMoney:0,this.moneyMax=25*this.moneyAvailable*r.a.ServerMaxMoney,this.hackDifficulty=null!=t.hackDifficulty?t.hackDifficulty*r.a.ServerStartingSecurity:1,this.baseDifficulty=this.hackDifficulty,this.minDifficulty=Math.max(1,Math.round(this.hackDifficulty/3)),this.serverGrowth=null!=t.serverGrowth?t.serverGrowth:1,this.numOpenPortsRequired=null!=t.numOpenPortsRequired?t.numOpenPortsRequired:5}capDifficulty(){this.hackDifficulty100&&(this.hackDifficulty=100)}changeMinimumSecurity(t,e=!1){e?this.minDifficulty*=t:this.minDifficulty+=t,this.minDifficulty=Math.max(1,this.minDifficulty)}changeMaximumMoney(t){if(this.moneyMax>1e13){const e=this.moneyMax-1e13;t=1+(t-1)/Math.log(e)/Math.log(8)}this.moneyMax*=t}fortify(t){this.hackDifficulty+=t,this.capDifficulty()}weaken(t){this.hackDifficulty-=t*r.a.ServerWeakenRate,this.capDifficulty()}toJSON(){return Object(s.b)("Server",this)}static fromJSON(t){return Object(s.a)(c,t.data)}}s.c.constructors.Server=c},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s}));var a=n(0),r=n.n(a);const i={Corporation:r.a.createContext({}),Division:r.a.createContext({})},o=()=>Object(a.useContext)(i.Corporation),s=()=>Object(a.useContext)(i.Division)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return f})),n.d(e,"e",(function(){return u}));var a=n(0),r=n.n(a),i=n(138),o=n(141);const s={Energy:"Energy",Utilities:"Water Utilities",Agriculture:"Agriculture",Fishing:"Fishing",Mining:"Mining",Food:"Food",Tobacco:"Tobacco",Chemical:"Chemical",Pharmaceutical:"Pharmaceutical",Computer:"Computer Hardware",Robotics:"Robotics",Software:"Software",Healthcare:"Healthcare",RealEstate:"RealEstate"},l={Energy:225e9,Utilities:15e10,Agriculture:4e10,Fishing:8e10,Mining:3e11,Food:1e10,Tobacco:2e10,Chemical:7e10,Pharmaceutical:2e11,Computer:5e11,Robotics:1e12,Software:25e9,Healthcare:75e10,RealEstate:6e11},c={Energy:t=>r.a.createElement(r.a.Fragment,null,"Engage in the production and distribution of energy.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Energy,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Utilities:t=>r.a.createElement(r.a.Fragment,null,"Distribute water and provide wastewater services.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Utilities,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Agriculture:t=>r.a.createElement(r.a.Fragment,null,"Cultivate crops and breed livestock to produce food.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Agriculture,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Fishing:t=>r.a.createElement(r.a.Fragment,null,"Produce food through the breeding and processing of fish and fish products.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Fishing,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Mining:t=>r.a.createElement(r.a.Fragment,null,"Extract and process metals from the earth.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Mining,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Food:t=>r.a.createElement(r.a.Fragment,null,"Create your own restaurants all around the world.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Food,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Tobacco:t=>r.a.createElement(r.a.Fragment,null,"Create and distribute tobacco and tobacco-related products.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Tobacco,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Chemical:t=>r.a.createElement(r.a.Fragment,null,"Produce industrial chemicals.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Chemical,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Pharmaceutical:t=>r.a.createElement(r.a.Fragment,null,"Discover, develop, and create new pharmaceutical drugs.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Pharmaceutical,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Computer:t=>r.a.createElement(r.a.Fragment,null,"Develop and manufacture new computer hardware and networking infrastructures.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Computer,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Robotics:t=>r.a.createElement(r.a.Fragment,null,"Develop and create robots.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Robotics,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Software:t=>r.a.createElement(r.a.Fragment,null,"Develop computer software and create AI Cores.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Software,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Healthcare:t=>r.a.createElement(r.a.Fragment,null,"Create and manage hospitals.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Healthcare,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),RealEstate:t=>r.a.createElement(r.a.Fragment,null,"Develop and manage real estate properties.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.RealEstate,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO")},f={Energy:Object(i.a)(),Utilities:Object(i.a)(),Agriculture:Object(i.a)(),Fishing:Object(i.a)(),Mining:Object(i.a)(),Food:Object(i.b)(),Tobacco:Object(i.b)(),Chemical:Object(i.a)(),Pharmaceutical:Object(i.b)(),Computer:Object(i.b)(),Robotics:Object(i.b)(),Software:Object(i.b)(),Healthcare:Object(i.b)(),RealEstate:Object(i.b)()};function u(){f.Energy=Object(i.a)(),f.Utilities=Object(i.a)(),f.Agriculture=Object(i.a)(),f.Fishing=Object(i.a)(),f.Mining=Object(i.a)(),f.Food=Object(i.b)(),f.Tobacco=Object(i.b)(),f.Chemical=Object(i.a)(),f.Pharmaceutical=Object(i.b)(),f.Computer=Object(i.b)(),f.Robotics=Object(i.b)(),f.Software=Object(i.b)(),f.Healthcare=Object(i.b)(),f.RealEstate=Object(i.b)()}},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.Company=0]="Company",t[t.Gym=1]="Gym",t[t.Hospital=2]="Hospital",t[t.Slums=3]="Slums",t[t.Special=4]="Special",t[t.StockMarket=5]="StockMarket",t[t.TechVendor=6]="TechVendor",t[t.TravelAgency=7]="TravelAgency",t[t.University=8]="University",t[t.Casino=9]="Casino"}(a||(a={}))},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"c",(function(){return g})),n.d(e,"d",(function(){return y})),n.d(e,"b",(function(){return b}));var a=n(0),r=n.n(a),i=n(15),o=n(13),s=n(10),l=n(7),c=n(16),f=n(23),u=n(28),m=n(257),h=n(153),d=n(90);let p;!function(t){t.StudyComputerScience="STUDYCOMPUTERSCIENCE",t.DataStructures="DATASTRUCTURES",t.Networks="NETWORKS",t.Algorithms="ALGORITHMS",t.Management="MANAGEMENT",t.Leadership="LEADERSHIP",t.GymStrength="GYMSTRENGTH",t.GymDefense="GYMDEFENSE",t.GymDexterity="GYMDEXTERITY",t.GymAgility="GYMAGILITY"}(p||(p={}));const g={[p.StudyComputerScience]:{youAreCurrently:"studying Computer Science",type:p.StudyComputerScience,earnings:Object(d.c)({hackExp:.5,intExp:.01})},[p.DataStructures]:{youAreCurrently:"taking a Data Structures course",type:p.DataStructures,earnings:Object(d.c)({money:-40,hackExp:1,intExp:.01})},[p.Networks]:{youAreCurrently:"taking a Networks course",type:p.Networks,earnings:Object(d.c)({money:-80,hackExp:2,intExp:.01})},[p.Algorithms]:{youAreCurrently:"taking an Algorithms course",type:p.Algorithms,earnings:Object(d.c)({money:-320,hackExp:4,intExp:.01})},[p.Management]:{youAreCurrently:"taking a Management course",type:p.Management,earnings:Object(d.c)({money:-160,chaExp:2,intExp:.01})},[p.Leadership]:{youAreCurrently:"taking a Leadership course",type:p.Leadership,earnings:Object(d.c)({money:-320,chaExp:4,intExp:.01})},[p.GymStrength]:{youAreCurrently:"training your strength at a gym",type:p.GymStrength,earnings:Object(d.c)({money:-120,strExp:1})},[p.GymDefense]:{youAreCurrently:"training your defense at a gym",type:p.GymDefense,earnings:Object(d.c)({money:-120,defExp:1})},[p.GymDexterity]:{youAreCurrently:"training your dexterity at a gym",type:p.GymDexterity,earnings:Object(d.c)({money:-120,dexExp:1})},[p.GymAgility]:{youAreCurrently:"training your agility at a gym",type:p.GymAgility,earnings:Object(d.c)({money:-120,agiExp:1})}},y=t=>null!==t&&t.type===h.b.CLASS;class b extends h.a{constructor(t){var e,n,a,r,i,o;super(h.b.CLASS,null===(e=null==t?void 0:t.singularity)||void 0===e||e),r=this,i="earnings",o=Object(d.c)(),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,this.classType=null!==(n=null==t?void 0:t.classType)&&void 0!==n?n:p.StudyComputerScience,this.location=null!==(a=null==t?void 0:t.location)&&void 0!==a?a:s.a.Sector12RothmanUniversity}isGym(){return[p.GymAgility,p.GymDefense,p.GymDexterity,p.GymStrength].includes(this.classType)}getClass(){return g[this.classType]}calculateRates(t){return Object(m.a)(t,t,this.classType,this.location)}process(t,e){this.cyclesWorked+=e;const n=this.calculateRates(t),a=Object(d.a)(t,t,n,e,"class");return this.earnings=Object(d.e)(this.earnings,a),!1}finish(){this.singularity||Object(c.a)(r.a.createElement(r.a.Fragment,null,"After ",this.getClass().youAreCurrently," for"," ",Object(u.b)(this.cyclesWorked*o.a._idleSpeed),", ",r.a.createElement("br",null),"you spent a total of ",r.a.createElement(f.a,{money:-this.earnings.money}),". ",r.a.createElement("br",null),r.a.createElement("br",null),"You earned a total of: ",r.a.createElement("br",null),l.a.formatExp(this.earnings.hackExp)," hacking exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.strExp)," strength exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.defExp)," defense exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.dexExp)," dexterity exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.agiExp)," agility exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.chaExp)," charisma exp",r.a.createElement("br",null)))}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,classType:this.classType,location:this.location}}toJSON(){return Object(i.b)("ClassWork",this)}static fromJSON(t){return Object(i.a)(b,t.data)}}i.c.constructors.ClassWork=b},function(t,e,n){"use strict";n.d(e,"g",(function(){return d})),n.d(e,"l",(function(){return p})),n.d(e,"h",(function(){return g})),n.d(e,"a",(function(){return y})),n.d(e,"b",(function(){return b})),n.d(e,"e",(function(){return E})),n.d(e,"f",(function(){return v})),n.d(e,"d",(function(){return k})),n.d(e,"c",(function(){return w})),n.d(e,"n",(function(){return S})),n.d(e,"o",(function(){return _})),n.d(e,"k",(function(){return C})),n.d(e,"j",(function(){return x})),n.d(e,"i",(function(){return L})),n.d(e,"p",(function(){return M})),n.d(e,"m",(function(){return A}));var a=n(229),r=n(216),i=n(157),o=n(41),s=n(94),l=n(395),c=n(246),f=n(361),u=n(44),m=n(24),h=n(45);function d(t){return 9===t.bitNodeN||t.sourceFileLvl(9)>0}function p(t){if(u.a.isRunning){if(u.a.currStep!==u.f.HacknetNodesIntroduction)return-1;Object(u.c)()}const e=t.hacknetNodes.length;if(d(t)){const n=b(t);if(isNaN(n))throw new Error("Calculated cost of purchasing HacknetServer is NaN");return!t.canAfford(n)||e>=o.b.MaxServers?-1:(t.loseMoney(n,"hacknet_expenses"),t.createHacknetServer(),M(t),e)}{const n=y(t);if(isNaN(n))throw new Error("Calculated cost of purchasing HacknetNode is NaN");if(!t.canAfford(n))return-1;const r="hacknet-node-"+e,i=new a.a(r,t.mults.hacknet_node_money);return t.loseMoney(n,"hacknet_expenses"),t.hacknetNodes.push(i),e}}function g(t){return d(t)&&t.hacknetNodes.length>=o.b.MaxServers}function y(t){return Object(r.d)(t.hacknetNodes.length+1,t.mults.hacknet_node_purchase_cost)}function b(t){return Object(i.f)(t.hacknetNodes.length+1,t.mults.hacknet_node_purchase_cost)}function E(t,e,n){if(null==n)throw new Error("getMaxNumberLevelUpgrades() called without maxLevel arg");if(t.moneye.calculateLevelUpgradeCost(i,t.mults.hacknet_node_level_cost))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!==n&&t.money>e.calculateLevelUpgradeCost(o,t.mults.hacknet_node_level_cost)&&t.moneye.calculateLevelUpgradeCost(o,t.mults.hacknet_node_level_cost)))return Math.min(i,o);a=o+1}}return 0}function v(t,e,n){if(null==n)throw new Error("getMaxNumberRamUpgrades() called without maxLevel arg");if(t.moneye.calculateRamUpgradeCost(a,t.mults.hacknet_node_ram_cost))return a;for(let n=a-1;n>=0;--n)if(t.money>e.calculateRamUpgradeCost(n,t.mults.hacknet_node_ram_cost))return n;return 0}function k(t,e,n){if(null==n)throw new Error("getMaxNumberCoreUpgrades() called without maxLevel arg");if(t.moneye.calculateCoreUpgradeCost(i,t.mults.hacknet_node_core_cost))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!=n&&t.money>e.calculateCoreUpgradeCost(o,t.mults.hacknet_node_core_cost)&&t.moneye.calculateCoreUpgradeCost(o,t.mults.hacknet_node_core_cost)))return Math.min(i,o);a=o+1}}return 0}function w(t,e,n){if(null==n)throw new Error("getMaxNumberCacheUpgrades() called without maxLevel arg");if(!t.canAfford(e.calculateCacheUpgradeCost(1)))return 0;let a=1,r=n-1;const i=n-e.cache;if(t.canAfford(e.calculateCacheUpgradeCost(i)))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!=n&&t.canAfford(e.calculateCacheUpgradeCost(o))&&!t.canAfford(e.calculateCacheUpgradeCost(o+1)))return Math.min(i,o);if(t.canAfford(e.calculateCacheUpgradeCost(o))){if(!t.canAfford(e.calculateCacheUpgradeCost(o)))return Math.min(i,o);a=o+1}else r=o-1}return 0}function S(t,e,n=1){const a=Math.round(n),r=e.calculateLevelUpgradeCost(a,t.mults.hacknet_node_level_cost);if(isNaN(r)||r<=0||a<0)return!1;const i=e instanceof s.a;if(e.level>=(i?o.b.MaxLevel:o.a.MaxLevel))return!1;if(e.level+a>(i?o.b.MaxLevel:o.a.MaxLevel)){return S(t,e,Math.max(0,(i?o.b.MaxLevel:o.a.MaxLevel)-e.level))}return!!t.canAfford(r)&&(t.loseMoney(r,"hacknet_expenses"),e.upgradeLevel(a,t.mults.hacknet_node_money),!0)}function _(t,e,n=1){const r=Math.round(n),i=e.calculateRamUpgradeCost(r,t.mults.hacknet_node_ram_cost);if(isNaN(i)||i<=0||r<0)return!1;if(e instanceof s.a&&e.maxRam>=o.b.MaxRam)return!1;if(e instanceof a.a&&e.ram>=o.a.MaxRam)return!1;if(e instanceof s.a){if(e.maxRam*Math.pow(2,r)>o.b.MaxRam){return _(t,e,Math.max(0,Math.log2(Math.round(o.b.MaxRam/e.maxRam))))}}else if(e instanceof a.a&&e.ram*Math.pow(2,r)>o.a.MaxRam){return _(t,e,Math.max(0,Math.log2(Math.round(o.a.MaxRam/e.ram))))}return!!t.canAfford(i)&&(t.loseMoney(i,"hacknet_expenses"),e.upgradeRam(r,t.mults.hacknet_node_money),!0)}function C(t,e,n=1){const a=Math.round(n),r=e.calculateCoreUpgradeCost(a,t.mults.hacknet_node_core_cost);if(isNaN(r)||r<=0||a<0)return!1;const i=e instanceof s.a;if(e.cores>=(i?o.b.MaxCores:o.a.MaxCores))return!1;if(e.cores+a>(i?o.b.MaxCores:o.a.MaxCores)){return C(t,e,Math.max(0,(i?o.b.MaxCores:o.a.MaxCores)-e.cores))}return!!t.canAfford(r)&&(t.loseMoney(r,"hacknet_expenses"),e.upgradeCore(a,t.mults.hacknet_node_money),!0)}function x(t,e,n=1){const a=Math.round(n),r=e.calculateCacheUpgradeCost(a);if(isNaN(r)||r<=0||a<0)return!1;if(!(e instanceof s.a))return console.warn("purchaseCacheUpgrade() called for a non-HacknetNode"),!1;if(e.cache+a>o.b.MaxCache){return x(t,e,Math.max(0,o.b.MaxCache-e.cache))}return!!t.canAfford(r)&&(t.loseMoney(r,"hacknet_expenses"),e.upgradeCache(a),!0)}function L(t,e){return 0===t.hacknetNodes.length?0:d(t)?function(t,e){if(!(t.hashManager instanceof l.a))throw new Error("Player does not have a HashManager (should be in 'hashManager' prop)");let n=0;for(let r=0;r0){const e=c.a["Sell for Money"];if(null===e)throw new Error("Could not get the hash upgrade");if(!e.cost)throw new Error("Upgrade is not properly configured");const n=r/e.cost;n>0&&t.gainMoney(e.value*n,"hacknet")}return n}(t,e):t.hacknetNodes[0]instanceof a.a?function(t,e){let n=0;for(let a=0;ae==t))throw new Error(`You have already expanded into the ${e} industry!`);for(let e=0;e_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.DividendMaxRate)throw new Error("Invalid value. Must be an number between 0 and "+_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.DividendMaxRate);t.dividendRate=e}function SellMaterial(mat,amt,price){""===price&&(price="0"),""===amt&&(amt="0");let cost=price.replace(/\s+/g,"");cost=cost.replace(/[^-()\d/*+.MPe]/g,"");let temp=cost.replace(/MP/g,mat.bCost+"");try{temp=eval(temp)}catch(t){throw new Error("Invalid value or expression for sell price field: "+t)}if(null==temp||isNaN(parseFloat(temp))||parseFloat(temp)<0)throw new Error("Invalid value or expression for sell price field");if(cost.includes("MP")?mat.sCost=cost:mat.sCost=temp,amt=amt.toUpperCase(),amt.includes("MAX")||amt.includes("PROD")){let q=amt.replace(/\s+/g,"");q=q.replace(/[^-()\d/*+.MAXPROD]/g,"");let tempQty=q.replace(/MAX/g,mat.maxsll.toString());tempQty=tempQty.replace(/PROD/g,mat.prd.toString());try{tempQty=eval(tempQty)}catch(t){throw new Error("Invalid value or expression for sell quantity field: "+t)}if(null==tempQty||isNaN(parseFloat(tempQty))||parseFloat(tempQty)<0)throw new Error("Invalid value or expression for sell quantity field");mat.sllman[0]=!0,mat.sllman[1]=q}else{if(isNaN(parseFloat(amt))||parseFloat(amt)<0)throw new Error("Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'");{let t=parseFloat(amt);isNaN(t)&&(t=0),0===t?(mat.sllman[0]=!1,mat.sllman[1]=0):(mat.sllman[0]=!0,mat.sllman[1]=t)}}}function SellProduct(product,city,amt,price,all){if(price.includes("MP")){price=price.replace(/\s+/g,""),price=price.replace(/[^-()\d/*+.MP]/g,"");let temp=price.replace(/MP/g,"1");try{temp=eval(temp)}catch(t){throw new Error("Invalid value or expression for sell price field: "+t)}if(null==temp||isNaN(parseFloat(temp))||parseFloat(temp)<0)throw new Error("Invalid value or expression for sell price field.");product.sCost=price}else{const t=parseFloat(price);if(isNaN(t))throw new Error("Invalid value for sell price field");product.sCost=t}const cities=Object.keys(_Locations_Cities__WEBPACK_IMPORTED_MODULE_7__.a);if(amt=amt.toUpperCase(),amt.includes("MAX")||amt.includes("PROD")){let qty=amt.replace(/\s+/g,"");qty=qty.replace(/[^-()\d/*+.MAXPROD]/g,"");let temp=qty.replace(/MAX/g,product.maxsll.toString());temp=temp.replace(/PROD/g,product.data[city][1].toString());try{temp=eval(temp)}catch(t){throw new Error("Invalid value or expression for sell quantity field: "+t)}if(null==temp||isNaN(parseFloat(temp))||parseFloat(temp)<0)throw new Error("Invalid value or expression for sell quantity field");if(all)for(let t=0;ti)throw new Error("You do not have enough warehouse size to fit this purchase");const o=a*n.bCost;if(!(t.funds>=o))throw new Error("You cannot afford this purchase.");t.funds=t.funds-o,n.qty+=a}function SellShares(t,e,n){if(isNaN(n))throw new Error("Invalid value for number of shares");if(n<0)throw new Error("Invalid value for number of shares");if(n>t.numShares)throw new Error("You don't have that many shares to sell!");if(!t.public)throw new Error("You haven't gone public!");if(t.shareSaleCooldown)throw new Error("Share sale on cooldown!");const a=t.calculateShareSale(n),r=a[0],i=a[1],o=a[2];return t.numShares-=n,t.issuedShares+=n,t.sharePrice=i,t.shareSalesUntilPriceUpdate=o,t.shareSaleCooldown=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SellSharesCooldown,e.gainMoney(r,"corporation"),r}function BuyBackShares(t,e,n){if(isNaN(n))throw new Error("Invalid value for number of shares");if(n<0)throw new Error("Invalid value for number of shares");if(n>t.issuedShares)throw new Error("You don't have that many shares to buy!");if(!t.public)throw new Error("You haven't gone public!");const a=1.1*t.sharePrice;if(e.moneyt.name===e);if(!a)throw new Error(`Could not find employee '${name}'.`);if(!Object.values(_EmployeePositions__WEBPACK_IMPORTED_MODULE_8__.a).includes(n))throw new Error(`'${n}' is not a valid job.`);t.assignSingleJob(a,n)}function AutoAssignJob(t,e,n){if(!Object.values(_EmployeePositions__WEBPACK_IMPORTED_MODULE_8__.a).includes(e))throw new Error(`'${e}' is not a valid job.`);return t.autoAssignJob(e,n)}function UpgradeOfficeSize(t,e,n){const a=Math.round(e.size/_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.OfficeInitialSize);let r=0;for(let t=0;te+_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.WarehouseUpgradeBaseCost*Math.pow(1.07,t.level+1+n),0)}function UpgradeWarehouse(t,e,n,a=1){const r=UpgradeWarehouseCost(n,a);t.funds=o)throw new Error(`You are already at the max products (${o}) for division: ${e.name}!`);const l=new _Product__WEBPACK_IMPORTED_MODULE_5__.a({name:a.replace(/[<>]/g,"").trim(),createCity:n,designCost:r,advCost:i});if(s[l.name]instanceof _Product__WEBPACK_IMPORTED_MODULE_5__.a)throw new Error("You already have a product with this name!");t.funds=t.funds-(r+i),s[l.name]=l}function Research(t,e){const n=_IndustryData__WEBPACK_IMPORTED_MODULE_1__.c[t.type];if(void 0===n)throw new Error(`No research tree for industry '${t.type}'`);if(!n.getAllNodes().includes(e))throw new Error(`No research named '${e}'`);const a=_ResearchMap__WEBPACK_IMPORTED_MODULE_9__.a[e];if(!t.researched[e]){if(t.sciResearch.qtyt&&(this.sleeves.length=t);for(let e=this.sleeves.length;e=100?this.sleeves[t].synchronize(this):this.sleeves[t].shockRecovery(this));this.lastUpdate=(new Date).getTime(),this.playtimeSinceLastAug=0,this.scriptProdSinceLastAug=0,this.moneySourceA.reset(),this.hacknetNodes.length=0,this.hashManager.prestige(),this.reapplyAllAugmentations(!0),this.hp.current=this.hp.max,this.finishWork(!0)}function V(){this.entropy=0,this.prestigeAugmentation(),this.karma=0;for(let t=0;t0?this.skills.intelligence=Math.floor(this.calculateSkill(this.exp.intelligence)):this.skills.intelligence=0;const t=this.hp.current/this.hp.max;this.hp.max=Math.floor(10+this.skills.defense/10),this.hp.current=Math.round(this.hp.max*t)}function Z(){this.mults=Object(q.a)()}function tt(t){const e=this.getHomeComputer();if(null==e)return!1;for(let n=0;n=t}function it(t,e){this.moneySourceA instanceof F.a||(console.warn("Player.moneySourceA was not properly initialized. Resetting"),this.moneySourceA=new F.a),this.moneySourceB instanceof F.a||(console.warn("Player.moneySourceB was not properly initialized. Resetting"),this.moneySourceB=new F.a),this.moneySourceA.record(t,e),this.moneySourceB.record(t,e)}function ot(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainHackingExp()"):(this.exp.hacking+=t,this.exp.hacking<0&&(this.exp.hacking=0),this.skills.hacking=Object(C.b)(this.exp.hacking,this.mults.hacking*o.a.HackingLevelMultiplier))}function st(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainStrengthExp()"):(this.exp.strength+=t,this.exp.strength<0&&(this.exp.strength=0),this.skills.strength=Object(C.b)(this.exp.strength,this.mults.strength*o.a.StrengthLevelMultiplier))}function lt(t){if(isNaN(t))return void console.error("ERR: NaN passed into player.gainDefenseExp()");this.exp.defense+=t,this.exp.defense<0&&(this.exp.defense=0),this.skills.defense=Object(C.b)(this.exp.defense,this.mults.defense*o.a.DefenseLevelMultiplier);const e=this.hp.current/this.hp.max;this.hp.max=Math.floor(10+this.skills.defense/10),this.hp.current=Math.round(this.hp.max*e)}function ct(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainDexterityExp()"):(this.exp.dexterity+=t,this.exp.dexterity<0&&(this.exp.dexterity=0),this.skills.dexterity=Object(C.b)(this.exp.dexterity,this.mults.dexterity*o.a.DexterityLevelMultiplier))}function ft(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainAgilityExp()"):(this.exp.agility+=t,this.exp.agility<0&&(this.exp.agility=0),this.skills.agility=Object(C.b)(this.exp.agility,this.mults.agility*o.a.AgilityLevelMultiplier))}function ut(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainCharismaExp()"):(this.exp.charisma+=t,this.exp.charisma<0&&(this.exp.charisma=0),this.skills.charisma=Object(C.b)(this.exp.charisma,this.mults.charisma*o.a.CharismaLevelMultiplier))}function mt(t){isNaN(t)?console.error("ERROR: NaN passed into Player.gainIntelligenceExp()"):(H.a.sourceFileLvl(5)>0||this.skills.intelligence>0||5===H.a.bitNodeN)&&(this.exp.intelligence+=t,this.skills.intelligence=Math.floor(this.calculateSkill(this.exp.intelligence,1)))}function ht(t){this.gainHackingExp(t.hack*this.mults.hacking_exp),this.gainStrengthExp(t.str*this.mults.strength_exp),this.gainDefenseExp(t.def*this.mults.defense_exp),this.gainDexterityExp(t.dex*this.mults.dexterity_exp),this.gainAgilityExp(t.agi*this.mults.agility_exp),this.gainCharismaExp(t.cha*this.mults.charisma_exp),this.gainIntelligenceExp(t.int)}function dt(t){const e=t.toLowerCase();return e.includes("hack")?this.skills.hacking:e.includes("str")?this.skills.strength:e.includes("def")?this.skills.defense:e.includes("dex")?this.skills.dexterity:e.includes("agi")?this.skills.agility:e.includes("cha")?this.skills.charisma:e.includes("int")?this.skills.intelligence:0}function pt(){this.focus=!0}function gt(){this.focus=!1}function yt(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp.current-=t,this.hp.current<=0&&(this.hospitalize(),!0))}function bt(t){"number"==typeof t?(this.hp.current+=t,this.hp.current>this.hp.max&&(this.hp.current=this.hp.max)):console.warn("Player.regenerateHp() called without a numeric argument: "+t)}function Et(){const t=Object(P.b)(this);return B.b.emit("You've been Hospitalized for "+D.a.formatMoney(t),B.d.WARNING,2e3),this.loseMoney(t,"hospitalization"),this.hp.current=this.hp.max,t}function vt(t,e=!1){const n=c.a[this.location];if(!(n instanceof l.a))return console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`),!1;let a=t;if(!this.isQualified(n,a))return e||Object(j.a)("Unfortunately, you do not qualify for this position
"+Object(u.a)(n,a)),!1;if(!n.hasPosition(a))return console.error(`Company ${n.name} does not have position ${a}. Player.applyToCompany() failed`),!1;for(;;){const t=Object(f.a)(a);if(null==t)break;if(!n.hasPosition(t)||!this.isQualified(n,t))break;a=t}if(this.jobs[n.name]===a.name){if(!e){const t=Object(f.a)(a);if(null!=t&&n.hasPosition(t)){const e=Object(u.a)(n,t);Object(j.a)("Unfortunately, you do not qualify for a promotion
"+e)}else Object(j.a)("You are already at the highest position for your field! No promotion available")}return!1}return this.jobs[n.name]=a.name,e||Object(j.a)("Congratulations! You were offered a new job at "+n.name+" as a "+a.name+"!"),!0}function kt(t,e){const n=c.a[t.name];if(null==n||n.name!=t.name)return e;const a=this.jobs[t.name];if(!a)return e;const r=m.a[a];return r.isSoftwareJob()&&e.isSoftwareJob()||r.isITJob()&&e.isITJob()||r.isBusinessJob()&&e.isBusinessJob()||r.isSecurityEngineerJob()&&e.isSecurityEngineerJob()||r.isNetworkEngineerJob()&&e.isNetworkEngineerJob()||r.isSecurityJob()&&e.isSecurityJob()||r.isAgentJob()&&e.isAgentJob()||r.isSoftwareConsultantJob()&&e.isSoftwareConsultantJob()||r.isBusinessConsultantJob()&&e.isBusinessConsultantJob()||r.isPartTimeJob()&&e.isPartTimeJob()?Object(f.a)(r):e}function wt(t){Object(U.b)(this.currentWork)&&this.currentWork.companyName===t&&this.finishWork(!0);for(const e of this.sleeves)Object(_.b)(e.currentWork)&&e.currentWork.companyName===t&&(e.stopWork(this),Object(j.a)(`You quit ${t} while one of your sleeves was working there. The sleeve is now idle.`));delete this.jobs[t]}function St(){return Boolean(Object.keys(this.jobs).length)}function _t(t=!1){return this.applyForJob(m.a[h.j[0]],t)}function Ct(t=!1){return this.applyForJob(m.a[h.k[0]],t)}function xt(t=!1){return this.applyForJob(m.a[h.d[0]],t)}function Lt(t=!1){const e=c.a[this.location];return this.isQualified(e,m.a[h.i[0]])?this.applyForJob(m.a[h.i[0]],t):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1)}function Ot(t=!1){const e=c.a[this.location];if(this.isQualified(e,m.a[h.f[0]])){const e=m.a[h.f[0]];return this.applyForJob(e,t)}return t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1}function Mt(t=!1){return this.applyForJob(m.a[h.b[0]],t)}function At(t=!1){return this.applyForJob(m.a[h.c[0]],t)}function Tt(t=!1){return this.applyForJob(m.a[h.h[2]],t)}function Rt(t=!1){const e=c.a[this.location];if(this.isQualified(e,m.a[h.a[0]])){const e=m.a[h.a[0]];return this.applyForJob(e,t)}return t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1}function Nt(t=!1){const e=c.a[this.location],n=h.e[1];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function Pt(t=!1){const e=c.a[this.location],n=h.g[1];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed part-time at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function It(t=!1){const e=c.a[this.location],n=h.e[0];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed as a waiter at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function Dt(t=!1){const e=c.a[this.location],n=h.g[0];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed as a part-time waiter at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function Ft(t,e){const n=t.jobStatReqOffset,a=e.requiredHacking>0?e.requiredHacking+n:0,r=e.requiredStrength>0?e.requiredStrength+n:0,i=e.requiredDefense>0?e.requiredDefense+n:0,o=e.requiredDexterity>0?e.requiredDexterity+n:0,s=e.requiredDexterity>0?e.requiredDexterity+n:0,l=e.requiredCharisma>0?e.requiredCharisma+n:0;return this.skills.hacking>=a&&this.skills.strength>=r&&this.skills.defense>=i&&this.skills.dexterity>=o&&this.skills.agility>=s&&this.skills.charisma>=l&&t.playerReputation>=e.requiredReputation}function jt(t=!0){t&&this.resetMultipliers();for(let t=0;te.specialName===t),a=Object(L.d)(e?e.hostname:"").backdoorInstalled?-1e5:0;return n.includes(t)&&function(t){const e=c.a[t];return null==e?0:e.playerReputation}(t)>d.a.CorpFactionRepRequirement+a}const i=y.a[W.a.Illuminati];!i.isBanned&&!i.isMember&&!i.alreadyInvited&&e>=30&&this.money>=15e10&&this.skills.hacking>=1500&&this.skills.strength>=1200&&this.skills.defense>=1200&&this.skills.dexterity>=1200&&this.skills.agility>=1200&&t.push(i);const s=y.a[W.a.Daedalus];!s.isBanned&&!s.isMember&&!s.alreadyInvited&&e>=o.a.DaedalusAugsRequirement&&this.money>=1e11&&(this.skills.hacking>=2500||this.skills.strength>=1500&&this.skills.defense>=1500&&this.skills.dexterity>=1500&&this.skills.agility>=1500)&&t.push(s);const l=y.a[W.a.TheCovenant];!l.isBanned&&!l.isMember&&!l.alreadyInvited&&e>=20&&this.money>=75e9&&this.skills.hacking>=850&&this.skills.strength>=850&&this.skills.defense>=850&&this.skills.dexterity>=850&&this.skills.agility>=850&&t.push(l);const f=y.a[W.a.ECorp];f.isBanned||f.isMember||f.alreadyInvited||!r(w.a.AevumECorp)||t.push(f);const u=y.a[W.a.MegaCorp];u.isBanned||u.isMember||u.alreadyInvited||!r(w.a.Sector12MegaCorp)||t.push(u);const m=y.a[W.a.BachmanAssociates];m.isBanned||m.isMember||m.alreadyInvited||!r(w.a.AevumBachmanAndAssociates)||t.push(m);const h=y.a[W.a.BladeIndustries];h.isBanned||h.isMember||h.alreadyInvited||!r(w.a.Sector12BladeIndustries)||t.push(h);const p=y.a[W.a.NWO];p.isBanned||p.isMember||p.alreadyInvited||!r(w.a.VolhavenNWO)||t.push(p);const g=y.a[W.a.ClarkeIncorporated];g.isBanned||g.isMember||g.alreadyInvited||!r(w.a.AevumClarkeIncorporated)||t.push(g);const b=y.a[W.a.OmniTekIncorporated];b.isBanned||b.isMember||b.alreadyInvited||!r(w.a.VolhavenOmniTekIncorporated)||t.push(b);const E=y.a[W.a.FourSigma];E.isBanned||E.isMember||E.alreadyInvited||!r(w.a.Sector12FourSigma)||t.push(E);const v=y.a[W.a.KuaiGongInternational];v.isBanned||v.isMember||v.alreadyInvited||!r(w.a.ChongqingKuaiGongInternational)||t.push(v);const S=y.a[W.a.FulcrumSecretTechnologies],_=Object(L.d)(A.a.FulcrumSecretTechnologies);if(!(_ instanceof O.a))throw new Error(W.a.FulcrumSecretTechnologies+" should be normal server");null==_?console.error(`Could not find ${W.a.FulcrumSecretTechnologies} Server`):S.isBanned||S.isMember||S.alreadyInvited||!_.backdoorInstalled||!r(w.a.AevumFulcrumTechnologies)||t.push(S);const C=y.a[W.a.BitRunners],x=Object(L.d)(A.a.BitRunnersServer);if(!(x instanceof O.a))throw new Error(W.a.BitRunners+" should be normal server");null==x?console.error(`Could not find ${W.a.BitRunners} Server`):C.isBanned||C.isMember||!x.backdoorInstalled||C.alreadyInvited||t.push(C);const M=y.a[W.a.TheBlackHand],T=Object(L.d)(A.a.TheBlackHandServer);if(!(T instanceof O.a))throw new Error(W.a.TheBlackHand+" should be normal server");null==T?console.error(`Could not find ${W.a.TheBlackHand} Server`):M.isBanned||M.isMember||!T.backdoorInstalled||M.alreadyInvited||t.push(M);const R=y.a[W.a.NiteSec],N=Object(L.d)(A.a.NiteSecServer);if(!(N instanceof O.a))throw new Error(W.a.NiteSec+" should be normal server");null==N?console.error(`Could not find ${W.a.NiteSec} Server`):R.isBanned||R.isMember||!N.backdoorInstalled||R.alreadyInvited||t.push(R);const P=y.a[W.a.Chongqing];!P.isBanned&&!P.isMember&&!P.alreadyInvited&&this.money>=2e7&&this.city==k.a.Chongqing&&t.push(P);const D=y.a[W.a.Sector12];!D.isBanned&&!D.isMember&&!D.alreadyInvited&&this.money>=15e6&&this.city==k.a.Sector12&&t.push(D);const F=y.a[W.a.NewTokyo];!F.isBanned&&!F.isMember&&!F.alreadyInvited&&this.money>=2e7&&this.city==k.a.NewTokyo&&t.push(F);const j=y.a[W.a.Aevum];!j.isBanned&&!j.isMember&&!j.alreadyInvited&&this.money>=4e7&&this.city==k.a.Aevum&&t.push(j);const B=y.a[W.a.Ishima];!B.isBanned&&!B.isMember&&!B.alreadyInvited&&this.money>=3e7&&this.city==k.a.Ishima&&t.push(B);const G=y.a[W.a.Volhaven];!G.isBanned&&!G.isMember&&!G.alreadyInvited&&this.money>=5e7&&this.city==k.a.Volhaven&&t.push(G);const H=y.a[W.a.SpeakersForTheDead];!H.isBanned&&!H.isMember&&!H.alreadyInvited&&this.skills.hacking>=100&&this.skills.strength>=300&&this.skills.defense>=300&&this.skills.dexterity>=300&&this.skills.agility>=300&&this.numPeopleKilled>=30&&this.karma<=-45&&!n.includes(w.a.Sector12CIA)&&!n.includes(w.a.Sector12NSA)&&t.push(H);const U=y.a[W.a.TheDarkArmy];!U.isBanned&&!U.isMember&&!U.alreadyInvited&&this.skills.hacking>=300&&this.skills.strength>=300&&this.skills.defense>=300&&this.skills.dexterity>=300&&this.skills.agility>=300&&this.city==k.a.Chongqing&&this.numPeopleKilled>=5&&this.karma<=-45&&!n.includes(w.a.Sector12CIA)&&!n.includes(w.a.Sector12NSA)&&t.push(U);const q=y.a[W.a.TheSyndicate];!q.isBanned&&!q.isMember&&!q.alreadyInvited&&this.skills.hacking>=200&&this.skills.strength>=200&&this.skills.defense>=200&&this.skills.dexterity>=200&&this.skills.agility>=200&&(this.city==k.a.Aevum||this.city==k.a.Sector12)&&this.money>=1e7&&this.karma<=-90&&!n.includes(w.a.Sector12CIA)&&!n.includes(w.a.Sector12NSA)&&t.push(q);const K=y.a[W.a.Silhouette];!K.isBanned&&!K.isMember&&!K.alreadyInvited&&(a.includes("Chief Technology Officer")||a.includes("Chief Financial Officer")||a.includes("Chief Executive Officer"))&&this.money>=15e6&&this.karma<=-22&&t.push(K);const z=y.a[W.a.Tetrads];!z.isBanned&&!z.isMember&&!z.alreadyInvited&&(this.city==k.a.Chongqing||this.city==k.a.NewTokyo||this.city==k.a.Ishima)&&this.skills.strength>=75&&this.skills.defense>=75&&this.skills.dexterity>=75&&this.skills.agility>=75&&this.karma<=-18&&t.push(z);const V=y.a[W.a.SlumSnakes];!V.isBanned&&!V.isMember&&!V.alreadyInvited&&this.skills.strength>=30&&this.skills.defense>=30&&this.skills.dexterity>=30&&this.skills.agility>=30&&this.karma<=-9&&this.money>=1e6&&t.push(V);const Y=y.a[W.a.Netburners];let J=0,X=0,Q=0;for(let t=0;t=80&&J>=8&&X>=4&&Q>=100&&t.push(Y);const Z=y.a[W.a.TianDiHui];!Z.isBanned&&!Z.isMember&&!Z.alreadyInvited&&this.money>=1e6&&this.skills.hacking>=50&&(this.city==k.a.Chongqing||this.city==k.a.NewTokyo||this.city==k.a.Ishima)&&t.push(Z);const tt=y.a[W.a.CyberSec],et=Object(L.d)(A.a.CyberSecServer);if(!(et instanceof O.a))throw new Error(W.a.CyberSec+" should be normal server");return null==et?console.error(`Could not find ${W.a.CyberSec} Server`):tt.isBanned||tt.isMember||!et.backdoorInstalled||tt.alreadyInvited||t.push(tt),t}function Wt(t){this.bitNodeN=t}function Ht(t){for(const e of this.queuedAugmentations)if(e.name==t)return void console.warn(`tried to queue ${t} twice, this may be a bug`);for(const e of this.augmentations)if(e.name==t)return void console.warn(`tried to queue ${t} twice, this may be a bug`);this.queuedAugmentations.push(new r.a(t))}function Ut(t,e=1){if(null==t||null==t.type)return"No reward for this contract";switch(t.type){case s.c.FactionReputation:if(null==t.name||!(y.a[t.name]instanceof g.a))return t.type=s.c.FactionReputationAll,this.gainCodingContractReward(t);const n=d.a.CodingContractBaseFactionRepGain*e;return y.a[t.name].playerReputation+=n,`Gained ${n} faction reputation for ${t.name}`;case s.c.FactionReputationAll:const a=d.a.CodingContractBaseFactionRepGain*e,r=[W.a.Bladeburners],i=this.factions.slice().filter(t=>!r.includes(t));if(0==i.length)return t.type=s.c.Money,this.gainCodingContractReward(t,e);const f=Math.floor(a/i.length);for(const t of i)y.a[t]instanceof g.a&&(y.a[t].playerReputation+=f);return`Gained ${f} reputation for each of the following factions: ${i.toString()}`;case s.c.CompanyReputation:{if(null==t.name||!(c.a[t.name]instanceof l.a))return t.type=s.c.FactionReputationAll,this.gainCodingContractReward(t);const n=d.a.CodingContractBaseCompanyRepGain*e;return c.a[t.name].playerReputation+=n,`Gained ${n} company reputation for ${t.name}`}case s.c.Money:default:{const t=d.a.CodingContractBaseMoneyGain*e*o.a.CodingContractMoney;return this.gainMoney(t,"codingcontract"),"Gained "+D.a.formatMoney(t)}}}function qt(t){return null==E.a[t]?(console.warn("Player.travel() called with invalid city: "+t),!1):(this.city=t,!0)}function $t(t){return null==v.a[t]?(console.warn("Player.gotoLocation() called with invalid location: "+t),!1):(this.location=t,!0)}function Kt(){return 10===this.bitNodeN||this.sourceFileLvl(10)>0}function zt(t){this.exploits.includes(t)||(this.exploits.push(t),B.b.emit("SF -1 acquired!",B.d.SUCCESS,2e3))}function Vt(t){const e=G.a[t];e&&(this.achievements.map(t=>t.ID).includes(t)||(this.achievements.push({ID:t,unlockedOn:(new Date).getTime()}),B.b.emit(`Unlocked Achievement: "${e.Name}"`,B.d.SUCCESS,2e3)))}function Yt(t){return Object(x.a)(this.skills.intelligence,t)}function Jt(){return this.moneySourceA.casino}function Xt(){return 13===this.bitNodeN||this.sourceFileLvl(13)>0}function Qt(t){const e=this.sourceFiles.find(e=>e.n===t);return e?e.lvl:0}function Zt(){let t=1;return this.hasAugmentation(i.a.NeuroreceptorManager)||(t=this.focus?1:d.a.BaseFocusBonus),t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(17);const r={CityNames:[a.a.Aevum,a.a.Chongqing,a.a.Sector12,a.a.NewTokyo,a.a.Ishima,a.a.Volhaven],CyclesPerSecond:5,StaminaGainPerSecond:.0085,BaseStaminaLoss:.285,MaxStaminaToGainFactor:7e4,DifficultyToTimeFactor:10,DiffMultExponentialFactor:.28,DiffMultLinearFactor:650,EffAgiLinearFactor:1e4,EffDexLinearFactor:1e4,EffAgiExponentialFactor:.04,EffDexExponentialFactor:.035,BaseRecruitmentTimeNeeded:300,PopulationThreshold:1e9,PopulationExponent:.7,ChaosThreshold:50,BaseStatGain:1,BaseIntGain:.003,ActionCountGrowthPeriod:480,RankToFactionRepFactor:2,RankNeededForFaction:25,ContractSuccessesPerLevel:3,OperationSuccessesPerLevel:2.5,RanksPerSkillPoint:3,ContractBaseMoneyGain:25e4,HrcHpGain:2,HrcStaminaGain:1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1049),r=n(1050);const i={};for(const t of r.a)i[t.key]=new a.a(t.name,t.create,t.run)},function(t,e,n){"use strict";let a;function r(t){switch(t){case a.HackingChance:return"+x% hack() success chance";case a.HackingSpeed:return"+x% faster hack(), grow(), and weaken()";case a.HackingMoney:return"+x% hack() power";case a.HackingGrow:return"+x% grow() power";case a.Hacking:return"+x% hacking skill";case a.Strength:return"+x% strength skill";case a.Defense:return"+x% defense skill";case a.Dexterity:return"+x% dexterity skill";case a.Agility:return"+x% agility skill";case a.Charisma:return"+x% charisma skill";case a.HacknetMoney:return"+x% hacknet production";case a.HacknetCost:return"-x% cheaper hacknet cost";case a.Rep:return"+x% reputation from factions and companies";case a.WorkMoney:return"+x% work money";case a.Crime:return"+x% crime money";case a.Bladeburner:return"+x% all bladeburner stats"}throw new Error("Calling effect for fragment type that doesn't have an effect "+t)}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),function(t){t[t.None=0]="None",t[t.Delete=1]="Delete",t[t.HackingChance=2]="HackingChance",t[t.HackingSpeed=3]="HackingSpeed",t[t.HackingMoney=4]="HackingMoney",t[t.HackingGrow=5]="HackingGrow",t[t.Hacking=6]="Hacking",t[t.Strength=7]="Strength",t[t.Defense=8]="Defense",t[t.Dexterity=9]="Dexterity",t[t.Agility=10]="Agility",t[t.Charisma=11]="Charisma",t[t.HacknetMoney=12]="HacknetMoney",t[t.HacknetCost=13]="HacknetCost",t[t.Rep=14]="Rep",t[t.WorkMoney=15]="WorkMoney",t[t.Crime=16]="Crime",t[t.Bladeburner=17]="Bladeburner",t[t.Booster=18]="Booster"}(a||(a={}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={HackersStartingHandbook:"hackers-starting-handbook.lit",CorporationManagementHandbook:"corporation-management-handbook.lit",HistoryOfSynthoids:"history-of-synthoids.lit",AGreenTomorrow:"A-Green-Tomorrow.lit",AlphaOmega:"alpha-omega.lit",SimulatedReality:"simulated-reality.lit",BeyondMan:"beyond-man.lit",BrighterThanTheSun:"brighter-than-the-sun.lit",DemocracyIsDead:"democracy-is-dead.lit",Sector12Crime:"sector-12-crime.lit",ManAndMachine:"man-and-machine.lit",SecretSocieties:"secret-societies.lit",TheFailedFrontier:"the-failed-frontier.lit",CodedIntelligence:"coded-intelligence.lit",SyntheticMuscles:"synthetic-muscles.lit",TensionsInTechRace:"tensions-in-tech-race.lit",CostOfImmortality:"cost-of-immortality.lit",TheHiddenWorld:"the-hidden-world.lit",TheNewGod:"the-new-god.lit",NewTriads:"new-triads.lit",TheSecretWar:"the-secret-war.lit"}},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(49),o=n(31),s=n(3),l=n(7),c=n(28),f=n(312);const u=({name:t,color:e,classes:n=Object(f.b)(),children:a,data:u})=>{let m="";return u&&(void 0!==u.content?m=u.content:void 0!==u.level&&void 0!==u.exp?m=`${Object(c.d)(u.level,0)} (${l.a.formatExp(u.exp)} exp)`:void 0!==u.level&&void 0===u.exp&&(m=""+Object(c.d)(u.level,0))),r.a.createElement(i.a,null,r.a.createElement(o.a,{classes:{root:n.cellNone}},r.a.createElement(s.a,{style:{color:e}},t)),r.a.createElement(o.a,{align:"right",classes:{root:n.cellNone}},m?r.a.createElement(s.a,{style:{color:e}},m):r.a.createElement(r.a.Fragment,null),a))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={}},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.Long="L",t.Short="S"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(31),o=n(161),s=n(122);function l(){return(l=Object.assign||function(t){for(var e=1;er.a.createElement(i.a,l({},t,{classes:{root:c().root,...t.classes}})),u=t=>r.a.createElement(o.a,l({},t,{classes:{root:c().small,...t.classes}}))},function(t,e,n){"use strict";function a(t){return t.startsWith("/")?t.slice(1):t}function r(t){return t.endsWith("/")?t.slice(0,-1):t}function i(t){return null!=t.match(/^[.&'a-zA-Z0-9_-]+\.[a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/)}function o(t){return null!=t.match(/^.?[a-zA-Z0-9_-]+$/)}function s(t){let e=t;if(0===e.length)return!1;if(1===e.length)return"/"===e;if(!e.startsWith("/"))return!1;e=e.slice(1),e=r(e);const n=e.split("/");for(const t of n)if("."!==t&&".."!==t&&!o(t))return!1;return!0}function l(t){if(null==t||"string"!=typeof t)return!1;const e=t;if(e.length<3)return!1;if(e.endsWith("/"))return!1;const n=e.lastIndexOf("/");if(-1===n)return i(e);const a=e.slice(n+1);return s(e.slice(0,n+1))&&i(a)}function c(t){let e=t;if(e=a(e),e=r(e),-1===e.lastIndexOf("/"))return"/";const n=e.split("/");return 0===n.length?"/":n[0]+"/"}function f(t){const e=t,n=e.lastIndexOf("/");return-1===n?"":e.slice(0,n+1)}function u(t,e,n){const a=h(t,n);if(null===a)return t;{const t=r(a),n=function(t){const e=t,n=e.lastIndexOf("/");if(-1===n)return e;return e.slice(n+1)}(e);return t+"/"+n}}function m(t){return!!l(t)&&(null!=t&&0!==t.length&&t.lastIndexOf("/")<=0)}function h(t,e){let n=t;if(!n.startsWith("/")&&e&&(n=e+(e.endsWith("/")?"":"/")+n),!s(n))return null;n=a(n),n=r(n);const i=n.split("/"),o=[];for(const t of i)if("."!==t)if(".."===t){if(null==o.pop())return null}else o.push(t);return"/"+o.join("/")}function d(t,e){let n=t;if(n.startsWith("/")||null==e||(n=e+(e.endsWith("/")?"":"/")+n),!l(n))return null;n=a(n);const r=n.split("/"),i=[];for(const t of r)if("."!==t)if(".."===t){if(null==i.pop())return null}else i.push(t);return"/"+i.join("/")}function p(t,e){return t.startsWith("/")||(t="/"+t),e.startsWith("/")||(e="/"+e),t===e}function g(t,e){return t.endsWith(".js")||(t+=".js"),e.endsWith(".js")||(e+=".js"),p(t,e)}n.d(e,"k",(function(){return a})),n.d(e,"l",(function(){return r})),n.d(e,"i",(function(){return s})),n.d(e,"j",(function(){return l})),n.d(e,"g",(function(){return c})),n.d(e,"e",(function(){return f})),n.d(e,"f",(function(){return u})),n.d(e,"h",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return d})),n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return g}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l}));var a=n(1055),r=n(274),i=n(15);let o={};function s(){const t=o;o={},a.a.forEach(t=>{var e;null!=o[(e=t).name]&&console.warn("Duplicate Company Position being defined: "+e.name),o[e.name]=new r.a(e)});for(const e of Object.keys(o)){const n=o[e];t[e]instanceof r.a?(n.favor=t[e].favor,isNaN(n.favor)&&(n.favor=0)):n.favor=0}}function l(t){o=JSON.parse(t,i.c)}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));var a=n(5),r=n(15);let i={[a.a.SlumSnakes]:{power:1,territory:1/7},[a.a.Tetrads]:{power:1,territory:1/7},[a.a.TheSyndicate]:{power:1,territory:1/7},[a.a.TheDarkArmy]:{power:1,territory:1/7},[a.a.SpeakersForTheDead]:{power:1,territory:1/7},[a.a.NiteSec]:{power:1,territory:1/7},[a.a.TheBlackHand]:{power:1,territory:1/7}};function o(){i={[a.a.SlumSnakes]:{power:1,territory:1/7},[a.a.Tetrads]:{power:1,territory:1/7},[a.a.TheSyndicate]:{power:1,territory:1/7},[a.a.TheDarkArmy]:{power:1,territory:1/7},[a.a.SpeakersForTheDead]:{power:1,territory:1/7},[a.a.NiteSec]:{power:1,territory:1/7},[a.a.TheBlackHand]:{power:1,territory:1/7}}}function s(t){i=JSON.parse(t,r.c)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new(n(979).a)},function(t,e,n){"use strict";n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(803),o=n(122),s=n(127),l=n(1809),c=n(46),f=n(166);let u;!function(t){t.SUCCESS="success",t.WARNING="warning",t.ERROR="error",t.INFO="info"}(u||(u={}));const m=Object(o.a)(()=>({snackbar:{zIndex:f.g+1e3+" !important","& .MuiAlert-icon":{alignSelf:"center"}}}));function h(t){const e=m();return r.a.createElement(i.a,{dense:!0,maxSnack:9,anchorOrigin:{horizontal:"right",vertical:"bottom"},autoHideDuration:2e3,classes:{containerRoot:e.snackbar}},t.children)}const d=new s.a;function p(){const{enqueueSnackbar:t,closeSnackbar:e}=Object(i.b)();return Object(a.useEffect)(()=>d.subscribe((n,a,i)=>{const o=t(r.a.createElement(l.a,{severity:a},n),{content:(t,e)=>r.a.createElement(c.a,{key:t},e),variant:a,autoHideDuration:i,onClick:()=>e(o)})})),r.a.createElement(r.a.Fragment,null)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(287),r=n(13),i=n(137);const o={Shoplift:new a.a("Shoplift","to shoplift",i.a.SHOPLIFT,2e3,15e3,.05,.1,{dexterity_success_weight:1,agility_success_weight:1,dexterity_exp:2,agility_exp:2}),RobStore:new a.a("Rob Store","to rob a store",i.a.ROB_STORE,6e4,4e5,.2,.5,{hacking_exp:30,dexterity_exp:45,agility_exp:45,hacking_success_weight:.5,dexterity_success_weight:2,agility_success_weight:1,intelligence_exp:7.5*r.a.IntelligenceCrimeBaseExpGain}),Mug:new a.a("Mug","to mug",i.a.MUG,4e3,36e3,.2,.25,{strength_exp:3,defense_exp:3,dexterity_exp:3,agility_exp:3,strength_success_weight:1.5,defense_success_weight:.5,dexterity_success_weight:1.5,agility_success_weight:.5}),Larceny:new a.a("Larceny","larceny",i.a.LARCENY,9e4,8e5,1/3,1.5,{hacking_exp:45,dexterity_exp:60,agility_exp:60,hacking_success_weight:.5,dexterity_success_weight:1,agility_success_weight:1,intelligence_exp:15*r.a.IntelligenceCrimeBaseExpGain}),DealDrugs:new a.a("Deal Drugs","to deal drugs",i.a.DRUGS,1e4,12e4,1,.5,{dexterity_exp:5,agility_exp:5,charisma_exp:10,charisma_success_weight:3,dexterity_success_weight:2,agility_success_weight:1}),BondForgery:new a.a("Bond Forgery","to forge bonds",i.a.BOND_FORGERY,3e5,45e5,.5,.1,{hacking_exp:100,dexterity_exp:150,charisma_exp:15,hacking_success_weight:.05,dexterity_success_weight:1.25,intelligence_exp:60*r.a.IntelligenceCrimeBaseExpGain}),TraffickArms:new a.a("Traffick Arms","to traffic arms",i.a.TRAFFIC_ARMS,4e4,6e5,2,1,{strength_exp:20,defense_exp:20,dexterity_exp:20,agility_exp:20,charisma_exp:40,charisma_success_weight:1,strength_success_weight:1,defense_success_weight:1,dexterity_success_weight:1,agility_success_weight:1}),Homicide:new a.a("Homicide","homicide",i.a.HOMICIDE,3e3,45e3,1,3,{strength_exp:2,defense_exp:2,dexterity_exp:2,agility_exp:2,strength_success_weight:2,defense_success_weight:2,dexterity_success_weight:.5,agility_success_weight:.5,kills:1}),GrandTheftAuto:new a.a("Grand Theft Auto","grand theft auto",i.a.GRAND_THEFT_AUTO,8e4,16e5,8,5,{strength_exp:20,defense_exp:20,dexterity_exp:20,agility_exp:80,charisma_exp:40,hacking_success_weight:1,strength_success_weight:1,dexterity_success_weight:4,agility_success_weight:2,charisma_success_weight:2,intelligence_exp:16*r.a.IntelligenceCrimeBaseExpGain}),Kidnap:new a.a("Kidnap","to kidnap",i.a.KIDNAP,12e4,36e5,5,6,{strength_exp:80,defense_exp:80,dexterity_exp:80,agility_exp:80,charisma_exp:80,charisma_success_weight:1,strength_success_weight:1,dexterity_success_weight:1,agility_success_weight:1,intelligence_exp:26*r.a.IntelligenceCrimeBaseExpGain}),Assassination:new a.a("Assassination","to assassinate",i.a.ASSASSINATION,3e5,12e6,8,10,{strength_exp:300,defense_exp:300,dexterity_exp:300,agility_exp:300,strength_success_weight:1,dexterity_success_weight:2,agility_success_weight:1,intelligence_exp:65*r.a.IntelligenceCrimeBaseExpGain,kills:1}),Heist:new a.a("Heist","a heist",i.a.HEIST,6e5,12e7,18,15,{hacking_exp:450,strength_exp:450,defense_exp:450,dexterity_exp:450,agility_exp:450,charisma_exp:450,hacking_success_weight:1,strength_success_weight:1,defense_success_weight:1,dexterity_success_weight:1,agility_success_weight:1,charisma_success_weight:1,intelligence_exp:130*r.a.IntelligenceCrimeBaseExpGain})}},,function(t,e,n){"use strict";function a(t){return function(e){e.isTrusted&&t()}}n.d(e,"a",(function(){return a}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Home:"home",FulcrumSecretTechnologies:"fulcrumassets",CyberSecServer:"CSEC",NiteSecServer:"avmnite-02h",TheBlackHandServer:"I.I.I.I",BitRunnersServer:"run4theh111z",TheDarkArmyServer:".",DaedalusServer:"The-Cave",WorldDaemon:"w0r1d_d43m0n",DarkWeb:"darkweb"}},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"e",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));const a=t=>{var e,n,a,r,i,o,s,l,c;return{money:null!==(e=null==t?void 0:t.money)&&void 0!==e?e:0,reputation:null!==(n=null==t?void 0:t.reputation)&&void 0!==n?n:0,hackExp:null!==(a=null==t?void 0:t.hackExp)&&void 0!==a?a:0,strExp:null!==(r=null==t?void 0:t.strExp)&&void 0!==r?r:0,defExp:null!==(i=null==t?void 0:t.defExp)&&void 0!==i?i:0,dexExp:null!==(o=null==t?void 0:t.dexExp)&&void 0!==o?o:0,agiExp:null!==(s=null==t?void 0:t.agiExp)&&void 0!==s?s:0,chaExp:null!==(l=null==t?void 0:t.chaExp)&&void 0!==l?l:0,intExp:null!==(c=null==t?void 0:t.intExp)&&void 0!==c?c:0}},r=(t,e)=>({money:t.money+e.money,reputation:t.reputation+e.reputation,hackExp:t.hackExp+e.hackExp,strExp:t.strExp+e.strExp,defExp:t.defExp+e.defExp,dexExp:t.dexExp+e.dexExp,agiExp:t.agiExp+e.agiExp,chaExp:t.chaExp+e.chaExp,intExp:t.intExp+e.intExp}),i=(t,e,n=!0)=>{const a=n?e:1;return{money:t.money*a,reputation:t.reputation*e,hackExp:t.hackExp*e,strExp:t.strExp*e,defExp:t.defExp*e,dexExp:t.dexExp*e,agiExp:t.agiExp*e,chaExp:t.chaExp*e,intExp:t.intExp*e}},o=(t,e,n,a,r)=>{const i=s(e,n,a),o={money:n.money*a,reputation:0,hackExp:i.hackExp,strExp:i.strExp,defExp:i.defExp,dexExp:i.dexExp,agiExp:i.agiExp,chaExp:i.chaExp,intExp:i.intExp};return t.gainMoney(o.money,r),o},s=(t,e,n)=>{const a={money:0,reputation:0,hackExp:e.hackExp*n,strExp:e.strExp*n,defExp:e.defExp*n,dexExp:e.dexExp*n,agiExp:e.agiExp*n,chaExp:e.chaExp*n,intExp:e.intExp*n};return t.gainHackingExp(a.hackExp),t.gainStrengthExp(a.strExp),t.gainDefenseExp(a.defExp),t.gainDexterityExp(a.dexExp),t.gainAgilityExp(a.agiExp),t.gainCharismaExp(a.chaExp),t.gainIntelligenceExp(a.intExp),a}},function(t,e,n){"use strict";n.d(e,"b",(function(){return xt})),n.d(e,"a",(function(){return Lt}));var a=n(0),r=n.n(a),i=n(114),o=n(106),s=n(362),l=n(10),c=n(44),f=n(1096),u=n(396),m=n(481),h=n(16),d=n(24),p=n(29),g=n(98),y=n(122),b=n(148),E=n(20),v=n(3),k=n(27),w=n(1115),S=n(1119),_=n(1141),C=n(1146),x=n(1175),L=n(1201),O=n(1222),M=n(1260),A=n(648),T=n(1273),R=n(1274),N=n(1324),P=n(1332),I=n(1341),D=n(1365),F=n(433),j=n(668),B=n(1377),G=n(1378),W=n(1383),H=n(1384),U=n(434),q=n(1395),$=n(1406),K=n(667),z=n(1407),V=n(1416),Y=n(1419),J=n(104),X=n(312),Q=n(1426),Z=n(204),tt=n(1427),et=n(84),nt=n(166),at=n(349),rt=n(429),it=n(615),ot=n(271),st=n(437),lt=n(26),ct=n(438),ft=n(1429),ut=n(1432),mt=n(6),ht=n(1433),dt=n(1438),pt=n(1443),gt=n(1444),yt=n.n(gt),bt=n(1445),Et=n.n(bt),vt=n(485),kt=n(226),wt=n(631);const St=location,_t=Object(y.a)(t=>Object(b.a)({root:{"-ms-overflow-style":"none","scrollbar-width":"none",margin:t.spacing(0),flexGrow:1,padding:"8px",minHeight:"100vh",boxSizing:"border-box",width:"1px"}})),Ct=()=>{throw new Error("Router called before initialization")};let xt={isInitialized:!1,page:()=>{throw new Error("Router called before initialization")},allowRouting:Ct,toActiveScripts:Ct,toAugmentations:Ct,toBitVerse:Ct,toBladeburner:Ct,toStats:Ct,toCity:Ct,toCorporation:Ct,toCreateProgram:Ct,toDevMenu:Ct,toFaction:Ct,toFactions:Ct,toGameOptions:Ct,toGang:Ct,toHacknetNodes:Ct,toInfiltration:Ct,toJob:Ct,toMilestones:Ct,toGrafting:Ct,toScriptEditor:Ct,toSleeves:Ct,toStockMarket:Ct,toTerminal:Ct,toTravel:Ct,toTutorial:Ct,toWork:Ct,toBladeburnerCinematic:Ct,toLocation:Ct,toStaneksGift:Ct,toAchievements:Ct,toThemeBrowser:Ct,toImportSave:Ct};function Lt({player:t,engine:e,terminal:n}){const y=_t(),[{files:b,vim:gt},bt]=Object(a.useState)({files:{},vim:!1}),[Ct,Lt]=Object(a.useState)(function(t){return ct.b?k.a.Recovery:null!==t.currentWork?k.a.Work:k.a.Terminal}(t)),Ot=Object(a.useState)(0)[1],[Mt,At]=Object(a.useState)(!1),[Tt,Rt]=Object(a.useState)(Object(kt.b)(t.currentWork)?p.a[t.currentWork.factionName]:void 0);if(void 0===Tt&&Ct===k.a.Faction)throw new Error("Trying to go to a page without the proper setup");const[Nt,Pt]=Object(a.useState)(!1),[It,Dt]=Object(a.useState)(!1),[Ft,jt]=Object(a.useState)(void 0);if(void 0===Ft&&(Ct===k.a.Infiltration||Ct===k.a.Location||Ct===k.a.Job))throw new Error("Trying to go to a page without the proper setup");const[Bt,Gt]=Object(a.useState)(""),[Wt,Ht]=Object(a.useState)(0),[Ut,qt]=Object(a.useState)(mt.a.IsSidebarOpened),[$t,Kt]=Object(a.useState)(void 0),[zt,Vt]=Object(a.useState)(!1);if(void 0===$t&&Ct===k.a.ImportSave)throw new Error("Trying to go to a page without the proper setup");const[Yt,Jt]=Object(a.useState)(!0);function Xt(){Ot(t=>t+1)}function Qt(){for(const t of Object(d.c)())t.runningScripts=[];o.c.saveGame(),setTimeout(()=>St.reload(),2e3)}function Zt(){Object(h.a)("Soft Reset!"),Object(i.f)(!0),Ht(Wt+1),xt.toTerminal()}Object(a.useEffect)(()=>u.a.subscribe(Xt),[]),xt={isInitialized:!0,page:()=>Ct,allowRouting:t=>Jt(t),toActiveScripts:()=>Lt(k.a.ActiveScripts),toAugmentations:()=>Lt(k.a.Augmentations),toBladeburner:()=>Lt(k.a.Bladeburner),toStats:()=>Lt(k.a.Stats),toCorporation:()=>Lt(k.a.Corporation),toCreateProgram:()=>Lt(k.a.CreateProgram),toDevMenu:()=>Lt(k.a.DevMenu),toFaction:(t,e=!1)=>{At(e),Lt(k.a.Faction),t&&Rt(t)},toFactions:()=>Lt(k.a.Factions),toGameOptions:()=>Lt(k.a.Options),toGang:()=>Lt(k.a.Gang),toHacknetNodes:()=>Lt(k.a.Hacknet),toMilestones:()=>Lt(k.a.Milestones),toGrafting:()=>Lt(k.a.Grafting),toScriptEditor:(t,e)=>{bt({files:t,vim:!(null==e||!e.vim)}),Lt(k.a.ScriptEditor)},toSleeves:()=>Lt(k.a.Sleeves),toStockMarket:()=>Lt(k.a.StockMarket),toTerminal:()=>Lt(k.a.Terminal),toTutorial:()=>Lt(k.a.Tutorial),toJob:t=>{jt(t),Lt(k.a.Job)},toCity:()=>{Lt(k.a.City)},toTravel:()=>{t.gotoLocation(l.a.TravelAgency),Lt(k.a.Travel)},toBitVerse:(t,e)=>{Pt(t),Dt(e),Object(ot.b)(),Lt(k.a.BitVerse)},toInfiltration:t=>{jt(t),Lt(k.a.Infiltration)},toWork:()=>Lt(k.a.Work),toBladeburnerCinematic:()=>{Lt(k.a.BladeburnerCinematic),Gt(Bt)},toLocation:t=>{jt(t),Lt(k.a.Location)},toStaneksGift:()=>{Lt(k.a.StaneksGift)},toAchievements:()=>{Lt(k.a.Achievements)},toThemeBrowser:()=>{Lt(k.a.ThemeBrowser)},toImportSave:(t,e=!1)=>{Kt(t),Vt(e),Lt(k.a.ImportSave)}},Object(a.useEffect)(()=>{Et()(xt).filter(t=>t.startsWith("to")).forEach(t=>{xt[t]=yt()(xt[t],(e,...n)=>{if(Yt)return e(...n);console.error(`Routing is currently disabled - Attempted router.${t}()`)})})}),Object(a.useEffect)(()=>{Ct!==k.a.Terminal&&window.scrollTo(0,0)});let te=r.a.createElement(v.a,null,"Cannot load"),ee=!0,ne=!0,ae=!1;switch(Ct){case k.a.Recovery:te=r.a.createElement(ct.c,{router:xt,softReset:Zt}),ee=!1,ne=!1,ae=!0;break;case k.a.BitVerse:te=r.a.createElement(V.a,{flume:Nt,enter:st.a,quick:It}),ee=!1,ne=!1;break;case k.a.Infiltration:te=r.a.createElement(M.a,{location:Ft}),ee=!1,ne=!1;break;case k.a.BladeburnerCinematic:te=r.a.createElement(Q.a,null),ee=!1,ne=!1;break;case k.a.Work:te=r.a.createElement(T.a,null),ee=!1;break;case k.a.Terminal:te=r.a.createElement(G.a,{terminal:n,router:xt,player:t});break;case k.a.Sleeves:te=r.a.createElement(N.a,null);break;case k.a.StaneksGift:te=r.a.createElement(Y.a,{staneksGift:J.c});break;case k.a.Stats:te=r.a.createElement($.a,null);break;case k.a.ScriptEditor:te=r.a.createElement(j.a,{files:b,hostname:t.getCurrentServer().hostname,player:t,router:xt,vim:gt});break;case k.a.ActiveScripts:te=r.a.createElement(H.a,{workerScripts:Z.a});break;case k.a.Hacknet:te=r.a.createElement(P.a,{player:t});break;case k.a.CreateProgram:te=r.a.createElement(F.a,null);break;case k.a.Factions:te=r.a.createElement(U.a,{player:t,router:xt});break;case k.a.Faction:te=r.a.createElement(q.a,{faction:Tt,augPage:Mt});break;case k.a.Milestones:te=r.a.createElement(B.a,{player:t});break;case k.a.Tutorial:te=r.a.createElement(W.a,{reactivateTutorial:()=>{Object(m.a)(),xt.toTerminal(),Object(c.e)()}});break;case k.a.DevMenu:te=r.a.createElement(C.a,{player:t,engine:e,router:xt});break;case k.a.Gang:te=r.a.createElement(L.a,null);break;case k.a.Corporation:te=r.a.createElement(O.a,null);break;case k.a.Bladeburner:te=r.a.createElement(x.a,null);break;case k.a.Grafting:te=r.a.createElement(A.b,null);break;case k.a.Travel:te=r.a.createElement(K.a,{p:t,router:xt});break;case k.a.StockMarket:te=r.a.createElement(z.a,{p:t,stockMarket:g.a});break;case k.a.City:te=r.a.createElement(D.a,null);break;case k.a.Job:case k.a.Location:te=r.a.createElement(I.a,{loc:Ft});break;case k.a.Options:te=r.a.createElement(R.a,{player:t,router:xt,save:()=>o.c.saveGame(),export:()=>{Object(s.c)(t),o.c.exportGame()},forceKill:Qt,softReset:Zt});break;case k.a.Augmentations:te=r.a.createElement(_.a,{exportGameFn:()=>{Object(s.c)(t),o.c.exportGame()},installAugmentationsFn:()=>{Object(i.f)()}});break;case k.a.Achievements:te=r.a.createElement(ft.a,null);break;case k.a.ThemeBrowser:te=r.a.createElement(ht.a,{router:xt});break;case k.a.ImportSave:te=r.a.createElement(dt.a,{importString:$t,automatic:zt,router:xt}),ee=!1,ne=!1,ae=!0}return r.a.createElement(lt.a.Player.Provider,{value:t},r.a.createElement(lt.a.Router.Provider,{value:xt},r.a.createElement(ut.a,{key:Wt,router:xt,softReset:Zt},r.a.createElement(pt.a,{content:ae?te:null},r.a.createElement(et.c,null,r.a.createElement(w.a,{mode:c.a.isRunning?"tutorial":"overview"},c.a.isRunning?r.a.createElement(f.a,null):r.a.createElement(X.a,{save:()=>o.c.saveGame(),killScripts:Qt})),ee?r.a.createElement(E.a,{display:"flex",flexDirection:"row",width:"100%"},r.a.createElement(S.a,{player:t,router:xt,page:Ct,opened:Ut,onToggled:t=>{qt(t),mt.a.IsSidebarOpened=t}}),r.a.createElement(E.a,{className:y.root},te)):r.a.createElement(E.a,{className:y.root},te),r.a.createElement(tt.a,null),ne&&r.a.createElement(r.a.Fragment,null,r.a.createElement(nt.d,null),r.a.createElement(at.b,null),r.a.createElement(rt.b,null),r.a.createElement(it.b,null),r.a.createElement(et.a,null)),r.a.createElement(vt.a,null)))),r.a.createElement(wt.a,null)))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(13),r=n(598),i=n(41),o=n(157),s=n(350),l=n(15);function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f extends r.a{constructor(t={hostname:"",ip:Object(s.a)()}){super(t),c(this,"cache",1),c(this,"cores",1),c(this,"hashCapacity",0),c(this,"hashRate",0),c(this,"level",1),c(this,"onlineTimeSeconds",0),c(this,"totalHashesGenerated",0),c(this,"purchasedByPlayer",!0),this.maxRam=1,this.updateHashCapacity()}calculateCacheUpgradeCost(t){return Object(o.a)(this.cache,t)}calculateCoreUpgradeCost(t,e){return Object(o.b)(this.cores,t,e)}calculateLevelUpgradeCost(t,e){return Object(o.d)(this.level,t,e)}calculateRamUpgradeCost(t,e){return Object(o.e)(this.maxRam,t,e)}process(t=1){const e=t*a.a.MilliPerCycle/1e3;this.onlineTimeSeconds+=e;const n=this.hashRate*e;return this.totalHashesGenerated+=n,n}upgradeCache(t){this.cache=Math.min(i.b.MaxCache,Math.round(this.cache+t)),this.updateHashCapacity()}upgradeCore(t,e){this.cores=Math.min(i.b.MaxCores,Math.round(this.cores+t)),this.updateHashRate(e),this.cpuCores=this.cores}upgradeLevel(t,e){this.level=Math.min(i.b.MaxLevel,Math.round(this.level+t)),this.updateHashRate(e)}upgradeRam(t,e){for(let e=0;et.endsWith(e))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return y})),n.d(e,"i",(function(){return b})),n.d(e,"c",(function(){return E})),n.d(e,"h",(function(){return v})),n.d(e,"d",(function(){return k})),n.d(e,"e",(function(){return w})),n.d(e,"g",(function(){return S})),n.d(e,"j",(function(){return C})),n.d(e,"f",(function(){return x}));var a=n(800),r=n(341),i=n(154),o=n(693),s=n(1064),l=n(117),c=n(75),f=n(100),u=n(13),m=n(7),h=n(16),d=n(15),p=n(2);let g={lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0};const y={};function b(t,e,n,o,s,l){if(!(t instanceof i.a))return l?p.a.log(l,()=>`Invalid stock: '${t}'`):Object(h.a)("ERROR: Invalid stock passed to placeOrder() function"),!1;if("number"!=typeof e||"number"!=typeof n)return l?p.a.log(l,()=>`Invalid arguments: shares='${e}' price='${n}'`):Object(h.a)("ERROR: Invalid numeric value provided for either 'shares' or 'price' argument"),!1;const c=new a.a(t.symbol,e,n,o,s);if(null==g.Orders){const t={};for(const e of Object.keys(g)){const n=g[e];n instanceof i.a&&(t[n.symbol]=[])}g.Orders=t}g.Orders[t.symbol].push(c);const f={stockMarket:g,symbolToStockMap:y};return Object(r.a)(t,c.type,c.pos,f),!0}function E(t,e){if(null==g.Orders)return!1;if(t.order&&t.order instanceof a.a){const e=t.order,n=g.Orders[e.stockSymbol];for(let t=0;t"Successfully cancelled order: "+a),!0}return e&&p.a.log(e,()=>"Failed to cancel order: "+a),!1}return!1}function v(t){g=""===t?{lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0}:JSON.parse(t,d.c)}function k(){g={lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0}}function w(){for(const t of Object.keys(g))g.hasOwnProperty(t)&&delete g[t];for(const t of s.a){const e=t.name;g[e]=new i.a(t)}const t={};for(const e of Object.keys(g)){const n=g[e];n instanceof i.a&&(t[n.symbol]=[])}g.Orders=t,g.storedCycles=0,g.lastUpdate=0,g.ticksUntilCycle=o.a}function S(){for(const t of Object.keys(f.a))if(f.a.hasOwnProperty(t)){const e=g[t];if(null==e){console.error("Could not find Stock for "+t);continue}const n=f.a[t];y[n]=e}}const _=6e3/u.a.MilliPerCycle;function C(t=1){if((null==g.storedCycles||isNaN(g.storedCycles))&&(g.storedCycles=0),g.storedCycles+=t,g.storedCycles<_)return;const e=(new Date).getTime();if(e-g.lastUpdate<4e3)return;g.lastUpdate=e,g.storedCycles-=_,null!=g.ticksUntilCycle&&"number"==typeof g.ticksUntilCycle||(g.ticksUntilCycle=o.a),--g.ticksUntilCycle,g.ticksUntilCycle<=0&&function(){for(const t of Object.keys(g)){const e=g[t];if(!(e instanceof i.a))continue;Math.random()<.45&&(e.b=!e.b,e.flipForecastForecast()),g.ticksUntilCycle=o.a}}();const n=Math.random();for(const t of Object.keys(g)){const e=g[t];if(!(e instanceof i.a))continue;let a=n*e.mv/100;isNaN(a)&&(a=.02);let o=50;o=e.b?(o+e.otlkMag)/100:(o-e.otlkMag)/100,e.price>=e.cap&&(o=.1,e.b=!1),isNaN(o)&&(o=.5);const s=Math.random(),f={stockMarket:g,symbolToStockMap:y};s1?1:i<0?0:i}function o(t,e){null==t.baseDifficulty&&(t.baseDifficulty=t.hackDifficulty);let n=3;return n+=.3*t.baseDifficulty,n*e.mults.hacking_exp*a.a.HackExpGain}function s(t,e){const n=(100-t.hackDifficulty)/100*((e.skills.hacking-(t.requiredHackingSkill-1))/e.skills.hacking)*e.mults.hacking_money*a.a.ScriptHackMoney/240;return n<0?0:n>1?1:n}function l(t,e){let n=2.5*(t.requiredHackingSkill*t.hackDifficulty)+500;n/=e.skills.hacking+50;return 5*n/(e.mults.hacking_speed*Object(r.a)(e.skills.intelligence,1))}function c(t,e){return 3.2*l(t,e)}function f(t,e){return 4*l(t,e)}},,function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var a=n(90);const r=(t,e,n,r=1)=>{const i=Object(a.d)(n,e.shockBonus(),n.money>0);Object(a.b)(e,i,r);const o=Object(a.d)(i,e.syncBonus(),n.money>0);Object(a.a)(t,t,o,r,"sleeves"),t.sleeves.filter(t=>t!=e).forEach(t=>Object(a.b)(t,o,r))};class i{constructor(t){this.type=t}finish(t){}}let o;!function(t){t.COMPANY="COMPANY",t.FACTION="FACTION",t.CRIME="CRIME",t.CLASS="CLASS",t.RECOVERY="RECOVERY",t.SYNCHRO="SYNCHRO",t.BLADEBURNER="BLADEBURNER",t.INFILTRATE="INFILTRATE",t.SUPPORT="SUPPORT"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(15),r=n(801);let i=new r.a;function o(t){i=t?JSON.parse(t,a.c):new r.a}function s(t,e){const n=[];for(let a=0;at);c.a.factions.sort((t,n)=>e.indexOf(t)-e.indexOf(n));const n=t.getInfo();for(const t of n.enemies)l.a[t]instanceof s.a&&(l.a[t].isBanned=!0);for(let e=0;ec.a.hasAugmentation(t))}function v(t,e,n=!1){const a=E(t),o=t.getCost(c.a);if(a)if(0!==o.moneyCost&&c.a.money=o.moneyCost){const e=new r.a(t.name);if(t.name==i.a.NeuroFluxGovernor&&(e.level=t.getLevel(c.a)),c.a.queuedAugmentations.push(e),c.a.loseMoney(o.moneyCost,"augmentations"),n)return"You purchased "+t.name;f.a.SuppressBuyAugmentationConfirmation||Object(m.a)("You purchased "+t.name+". Its enhancements will not take effect until they are installed. To install your augmentations, go to the 'Augmentations' tab on the left-hand navigation menu. Purchasing additional augmentations will now be more expensive.")}else Object(m.a)("Hmm, something went wrong when trying to purchase an Augmentation. Please report this to the game developer with an explanation of how to reproduce this.");else{const e=`You must first purchase or install ${t.prereqs.filter(t=>!c.a.hasAugmentation(t)).join(",")} before you can purchase this one.`;if(n)return e;Object(m.a)(e)}return""}function k(t){for(const e of Object.keys(l.a)){if(Object(g.b)(c.a.currentWork)&&e===c.a.currentWork.factionName)continue;if(!l.a.hasOwnProperty(e))continue;const n=l.a[e];if(!n.isMember)continue;if(!n.getInfo().offersWork())continue;if(c.a.getGangName()===e)continue;const a=Math.min(.1,n.favor/1e3+.01),r=Object(u.c)(c.a,n.favor),i=Object(u.b)(c.a,n.favor),s=Object(u.a)(c.a,n.favor),f=Math.max(r*a,i*a,s*a,1/120);n.playerReputation+=f*t*c.a.mults.faction_rep*o.a.FactionPassiveRepGain}}const w=(t,e)=>{if(t.hasGangWith(e.name)){let n=Object.values(a.a);n=n.filter(t=>!t.isSpecial&&t.name!==i.a.CongruityImplant),2===t.bitNodeN&&n.push(a.a[i.a.TheRedPill]);const r=Object(p.b)(`BN${t.bitNodeN}.${t.sourceFileLvl(t.bitNodeN)}`),s=t=>t.factions.length>1||(!!e.augmentations.includes(t.name)||r()>=1-o.a.GangUniqueAugs);return n=n.filter(s),n.map(t=>t.name)}return e.augmentations.slice()}},function(t,e,n){"use strict";n.d(e,"c",(function(){return D})),n.d(e,"b",(function(){return R})),n.d(e,"a",(function(){return I}));var a=n(164),r=n(78),i=n(13),o=n(29),s=n(81),l=n(1),c=n(24),f=n(6),u=n(98),m=n(104),h=n(84),d=n(362),p=n(16),g=n(15),y=n(353),b=n(696),E=n(12),v=n(325),k=n(10),w=n(614),S=n(309),_=n(124),C=n(5),x=n(201),L=n(140),O=n(89),M=n(1095);function A(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class T{constructor(){A(this,"PlayerSave",""),A(this,"AllServersSave",""),A(this,"CompaniesSave",""),A(this,"FactionsSave",""),A(this,"AliasesSave",""),A(this,"GlobalAliasesSave",""),A(this,"StockMarketSave",""),A(this,"SettingsSave",""),A(this,"VersionSave",""),A(this,"AllGangsSave",""),A(this,"LastExportBonus",""),A(this,"StaneksGiftSave","")}getSaveString(t=!1){this.PlayerSave=JSON.stringify(l.a),this.AllServersSave=Object(c.j)(t),this.CompaniesSave=JSON.stringify(r.a),this.FactionsSave=JSON.stringify(o.a),this.AliasesSave=JSON.stringify(a.a),this.GlobalAliasesSave=JSON.stringify(a.b),this.StockMarketSave=JSON.stringify(u.a),this.SettingsSave=JSON.stringify(f.a),this.VersionSave=JSON.stringify(i.a.VersionNumber),this.LastExportBonus=JSON.stringify(d.a),this.StaneksGiftSave=JSON.stringify(m.c),l.a.inGang()&&(this.AllGangsSave=JSON.stringify(s.a));return btoa(unescape(encodeURIComponent(JSON.stringify(this))))}saveGame(t=!0){const e=(new Date).getTime();l.a.lastSave=e;const n=this.getSaveString(f.a.ExcludeRunningScriptsFromSave);return new Promise((a,r)=>{Object(y.c)(n).then(()=>{const r={playerIdentifier:l.a.identifier,fileName:this.getSaveFileName(),save:n,savedOn:e};return Object(S.d)(r),t&&h.b.emit("Game Saved!",h.d.INFO,2e3),a()}).catch(t=>(console.error(t),r()))})}getSaveFileName(t=!1){const e=Math.round(Date.now()/1e3),n=l.a.bitNodeN;let a=`bitburnerSave_${e}_BN${n}x${l.a.sourceFileLvl(n)+1}.json`;return t&&(a="RECOVERY"+a),a}exportGame(){const t=this.getSaveString(f.a.ExcludeRunningScriptsFromSave);I(this.getSaveFileName(),t)}importGame(t,e=!0){if(!t||""===t)throw new Error("Invalid import string");return Object(y.c)(t).then(()=>(e&&setTimeout(()=>location.reload(),1e3),Promise.resolve()))}getImportStringFromFile(t){if(null===t)return Promise.reject(new Error("No file selected"));const e=t[0];if(!e)return Promise.reject(new Error("Invalid file selected"));const n=new FileReader,a=new Promise((t,e)=>{n.onload=function(n){const a=n.target;if(null===a)return e(new Error("Error importing file"));const r=a.result;if("string"!=typeof r)return e(new Error("FileReader event was not type string"));t(r)}});return n.readAsText(e),a}async getImportDataFromString(t){var e,n,a,r,i,o,s,c;if(!t||""===t)throw new Error("Invalid import string");let f,u;try{f=window.atob(t),f=f.trim()}catch(t){console.error(t)}if(!f||""===f)return Promise.reject(new Error("Save game had not content or was not base64 encoded"));try{u=JSON.parse(f)}catch(t){console.error(t)}if(!u||"BitburnerSaveObject"!==u.ctor||!u.data)return Promise.reject(new Error("Save game did not seem valid"));const m={base64:t},h=w.a.fromJSON(JSON.parse(u.data.PlayerSave)),d={identifier:h.identifier,lastSave:h.lastSave,totalPlaytime:h.totalPlaytime,money:h.money,hacking:h.skills.hacking,augmentations:null!==(e=null===(n=h.augmentations)||void 0===n?void 0:n.reduce((t,e)=>t+e.level,0))&&void 0!==e?e:0,factions:null!==(a=null===(r=h.factions)||void 0===r?void 0:r.length)&&void 0!==a?a:0,achievements:null!==(i=null===(o=h.achievements)||void 0===o?void 0:o.length)&&void 0!==i?i:0,bitNode:h.bitNodeN,bitNodeLevel:h.sourceFileLvl(l.a.bitNodeN)+1,sourceFiles:null!==(s=null===(c=h.sourceFiles)||void 0===c?void 0:c.reduce((t,e)=>t+e.lvl,0))&&void 0!==s?s:0};return m.playerData=d,Promise.resolve(m)}toJSON(){return Object(g.b)("BitburnerSaveObject",this)}static fromJSON(t){return Object(g.a)(T,t.data)}}function R(t){if(-1!==navigator.userAgent.indexOf("wv")&&-1!==navigator.userAgent.indexOf("Chrome/")&&setInterval(()=>{Object(p.a)("SCAM ALERT. This app is not official and you should uninstall it.")},1e3),!t)return!1;t=decodeURIComponent(escape(atob(t)));const e=JSON.parse(t,g.c);if(Object(l.b)(e.PlayerSave),Object(c.h)(e.AllServersSave),Object(r.c)(e.CompaniesSave),Object(o.d)(e.FactionsSave),e.hasOwnProperty("StaneksGiftSave")?Object(m.b)(e.StaneksGiftSave):(console.warn("Could not load Staneks Gift from save"),Object(m.b)("")),e.hasOwnProperty("AliasesSave"))try{Object(a.c)(e.AliasesSave)}catch(t){console.warn("Could not load Aliases from save"),Object(a.c)("")}else console.warn("Save file did not contain an Aliases property"),Object(a.c)("");if(e.hasOwnProperty("GlobalAliasesSave"))try{Object(a.d)(e.GlobalAliasesSave)}catch(t){console.warn("Could not load GlobalAliases from save"),Object(a.d)("")}else console.warn("Save file did not contain a GlobalAliases property"),Object(a.d)("");if(e.hasOwnProperty("StockMarketSave"))try{Object(u.h)(e.StockMarketSave)}catch(t){Object(u.h)("")}else Object(u.h)("");if(e.hasOwnProperty("SettingsSave"))try{f.a.load(e.SettingsSave)}catch(t){console.error("ERROR: Failed to parse Settings. Re-initing default values"),f.a.init()}else f.a.init();if(e.hasOwnProperty("LastExportBonus"))try{d.d(JSON.parse(e.LastExportBonus))}catch(t){d.d((new Date).getTime()),console.error("ERROR: Failed to parse last export bonus Settings "+t)}if(l.a.inGang()&&e.hasOwnProperty("AllGangsSave"))try{Object(s.b)(e.AllGangsSave)}catch(t){console.error("ERROR: Failed to parse AllGangsSave: "+t)}if(e.hasOwnProperty("VersionSave"))try{const t=JSON.parse(e.VersionSave,g.c);!function(t){const e=l.a;if("string"==typeof t){if(t<="0.41.2"){null!=e.companyPosition&&"string"!=typeof e.companyPosition&&(e.companyPosition=e.companyPosition.data.positionName,null==e.companyPosition&&(e.companyPosition=""));for(const t of Object.keys(r.a)){const e=r.a[t];if(0==e.name&&null!=e.companyName&&(e.name=e.companyName),e.companyPositions instanceof Array){const t={};for(let n=0;n0)for(const t of e.sleeves)if(t.augmentations&&0!==t.augmentations.length)for(const e of t.augmentations)"Graphene BranchiBlades Upgrade"===e.name&&(e.name="Graphene BrachiBlades Upgrade");if(t<12&&void 0!==e.resleeves&&delete e.resleeves,t<15&&(f.a.EditorTheme={..._.a}),t<16){o.a[C.a.ShadowsOfAnarchy]=new x.a(C.a.ShadowsOfAnarchy);for(const t of Object(c.c)())for(const e of t.contracts)"HammingCodes: Integer to encoded Binary"==e.type&&(e.type="HammingCodes: Integer to Encoded Binary")}const n=()=>{e.hp={current:1,max:1};for(const t of e.sleeves)t.hp={current:1,max:1};e.exp.hacking=e.hacking_exp,e.exp.strength=e.strength_exp,e.exp.defense=e.defense_exp,e.exp.dexterity=e.dexterity_exp,e.exp.agility=e.agility_exp,e.exp.charisma=e.charisma_exp,e.exp.intelligence=e.intelligence_exp};if(t<17){let t=[...l.a.augmentations];t=t.filter(t=>t.name===E.a.NeuroFluxGovernor);const e=new v.a(E.a.NeuroFluxGovernor);e.level=0;for(const n of t)e.level+=n.level;l.a.augmentations=[...l.a.augmentations.filter(t=>t.name!==E.a.NeuroFluxGovernor),e],n(),l.a.reapplyAllAugmentations(!0),l.a.reapplyAllSourceFiles()}if(t<20){if(!Object(c.d)(O.a.DarkWeb)){const t=Object(L.g)({ip:Object(c.e)(),hostname:O.a.DarkWeb,organizationName:"",isConnectedTo:!1,adminRights:!1,purchasedByPlayer:!1,maxRam:1});Object(c.a)(t)}}if(t<21){Object(b.a)(10);const t=e.createProgramName;t&&l.a.getHomeComputer().pushProgram(t);const n=e.graftAugmentationName;n&&l.a.augmentations.push({name:n,level:1})}if(t<22&&(n(),Object(M.a)()),t<23&&(e.currentWork=null),t<24&&l.a.getHomeComputer().scripts.forEach(t=>t.filename.endsWith(".ns")&&(t.filename+=".js")),t<25){const t=["hacking_chance_mult","hacking_speed_mult","hacking_money_mult","hacking_grow_mult","hacking_mult","strength_mult","defense_mult","dexterity_mult","agility_mult","charisma_mult","hacking_exp_mult","strength_exp_mult","defense_exp_mult","dexterity_exp_mult","agility_exp_mult","charisma_exp_mult","company_rep_mult","faction_rep_mult","crime_money_mult","crime_success_mult","work_money_mult","hacknet_node_money_mult","hacknet_node_purchase_cost_mult","hacknet_node_ram_cost_mult","hacknet_node_core_cost_mult","hacknet_node_level_cost_mult","bladeburner_max_stamina_mult","bladeburner_stamina_gain_mult","bladeburner_analysis_mult","bladeburner_success_chance_mult","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","intelligence_exp","companyName","isWorking","workType","workCostMult","workExpMult","currentWorkFactionName","currentWorkFactionDescription","workHackExpGainRate","workStrExpGainRate","workDefExpGainRate","workDexExpGainRate","workAgiExpGainRate","workChaExpGainRate","workRepGainRate","workMoneyGainRate","workMoneyLossRate","workHackExpGained","workStrExpGained","workDefExpGained","workDexExpGained","workAgiExpGained","workChaExpGained","workRepGained","workMoneyGained","createProgramName","createProgramReqLvl","graftAugmentationName","timeWorkedGraftAugmentation","className","crimeType","timeWorked","timeWorkedCreateProgram","timeNeededToCompleteWork","factionWorkType","committingCrimeThruSingFn","singFnCrimeWorkerScript","hacking","max_hp","strength","defense","dexterity","agility","charisma","intelligence"],n=["gymStatType","bbAction","bbContract","hacking","strength","defense","dexterity","agility","charisma","intelligence","max_hp","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","intelligence_exp","hacking_mult","strength_mult","defense_mult","dexterity_mult","agility_mult","charisma_mult","hacking_exp_mult","strength_exp_mult","defense_exp_mult","dexterity_exp_mult","agility_exp_mult","charisma_exp_mult","hacking_chance_mult","hacking_speed_mult","hacking_money_mult","hacking_grow_mult","company_rep_mult","faction_rep_mult","crime_money_mult","crime_success_mult","work_money_mult","hacknet_node_money_mult","hacknet_node_purchase_cost_mult","hacknet_node_ram_cost_mult","hacknet_node_core_cost_mult","hacknet_node_level_cost_mult","bladeburner_max_stamina_mult","bladeburner_stamina_gain_mult","bladeburner_analysis_mult","bladeburner_success_chance_mult","className","crimeType","currentTask","currentTaskLocation","currentTaskMaxTime","currentTaskTime","earningsForSleeves","earningsForPlayer","earningsForTask","factionWorkType","gainRatesForTask","logs"];let a=Number(e.intelligence_exp);isNaN(a)&&(a=0),e.exp.intelligence+=a;for(const n of t)delete e[n];for(const t of e.sleeves){const e=t;let a=Number(e.intelligence_exp);isNaN(a)&&(a=0),e.exp.intelligence+=a;for(const e of n)delete t[e]}}}}(t),window.location.href.toLowerCase().includes("bitburner-beta")?Object(p.a)("You are playing on the beta environment! This branch of the game features the latest developments in the game. This version may be unstable.
Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) or the Bitburner subreddit (reddit.com/r/bitburner).

"+i.a.LatestUpdate,N):t!==i.a.VersionNumber&&P()}catch(t){P()}else P();return!0}const N={"& h1, & h2, & h3, & h4, & p, & a, & ul":{margin:0,color:f.a.theme.primary,whiteSpace:"initial"},"& ul":{paddingLeft:"1.5em",lineHeight:1.5}};function P(){setTimeout(()=>Object(p.a)("New update!
Please report any bugs/issues through the GitHub repository or the Bitburner subreddit (reddit.com/r/bitburner).

"+i.a.LatestUpdate,N),1e3)}function I(t,e){const n=new Blob([e],{type:"text/plain"}),a=document.createElement("a"),r=URL.createObjectURL(n);a.href=r,a.download=t,document.body.appendChild(a),a.click(),setTimeout((function(){document.body.removeChild(a),window.URL.revokeObjectURL(r)}),0)}g.c.constructors.BitburnerSaveObject=T;const D=new T},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1069),r=n(384);const i={};a.a.forEach(t=>{var e;null!=i[(e=t).name]&&console.warn("Duplicate Company Position being defined: "+e.name),i[e.name]=new r.a(e)})},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.HACKING="HACKING",t.FIELD="FIELD",t.SECURITY="SECURITY"}(a||(a={}))},,,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),function(t){t.Bypass="Bypass",t.PrototypeTampering="PrototypeTampering",t.Unclickable="Unclickable",t.UndocumentedFunctionCall="UndocumentedFunctionCall",t.TimeCompression="TimeCompression",t.RealityAlteration="RealityAlteration",t.N00dles="N00dles",t.YoureNotMeantToAccessThis="YoureNotMeantToAccessThis",t.TrueRecursion="TrueRecursion",t.INeedARainbow="INeedARainbow",t.EditSaveFile="EditSaveFile"}(a||(a={}));const r={Bypass:"by circumventing the ram cost of document.",EditSaveFile:"by editing your save file.",PrototypeTampering:"by tampering with Numbers prototype.",TimeCompression:"by compressing time.",Unclickable:"by clicking the unclickable.",UndocumentedFunctionCall:"by looking beyond the documentation.",RealityAlteration:"by altering reality to suit your whims.",N00dles:"by harnessing the power of the n00dles.",YoureNotMeantToAccessThis:"by accessing the dev menu.",TrueRecursion:"by truly recursing.",INeedARainbow:"by using the power of the rainbow."};function i(t){return r[t]}function o(t){return t=t.filter(t=>Object.keys(a).includes(t)),[...new Set(t)]}},,,function(t,e,n){"use strict";n.d(e,"c",(function(){return b})),n.d(e,"d",(function(){return E})),n.d(e,"g",(function(){return _})),n.d(e,"f",(function(){return w})),n.d(e,"e",(function(){return y})),n.d(e,"a",(function(){return k})),n.d(e,"b",(function(){return S}));var a=n(36),r=n(74),i=n(325),o=n(12),s=n(13),l=n(29),c=n(1),f=n(481),u=n(16),m=n(1449),h=n(5),d=n(367),p=n(91),g=n(213);function y(){!function(){for(const t of Object.keys(l.a))l.a.hasOwnProperty(t)&&(l.a[t].augmentations=[])}(),Object(m.a)(r.a),[Object(d.d)(),Object(d.f)(),...Object(d.c)(),...Object(d.e)(),...Object(l.b)(h.a.Bladeburners)?Object(d.a)():[],...Object(l.b)(h.a.ChurchOfTheMachineGod)?Object(d.b)():[]].map(v),c.a.reapplyAllAugmentations()}function b(){return s.a.MultipleAugMultiplier*[1,.96,.94,.93][c.a.sourceFileLvl(11)]}function E(){return Math.pow(b(),c.a.queuedAugmentations.length)}function v(t){t.addToFactions(t.factions);const e=t.name;S(e)&&delete r.a[e],function(t){const e=t.name;r.a[e]=t}(t)}function k(t,e=!1){const n=r.a[t.name];c.a.mults=Object(g.b)(c.a.mults,n.mults),t.name!==o.a.CongruityImplant||e||(c.a.entropy=0,c.a.applyEntropy(c.a.entropy));const a=c.a.augmentations.find(t=>t.name===o.a.NeuroFluxGovernor);if(t.name!==o.a.NeuroFluxGovernor||e||!a){if(!e){const e=new i.a(t.name);c.a.augmentations.push(e)}}else a.level=t.level}function w(t){if(0==c.a.queuedAugmentations.length&&!t)return Object(u.a)("You have not purchased any Augmentations to install!"),!1;let e="",n=-1;for(let t=c.a.queuedAugmentations.length-1;t>=0;t--)if(c.a.queuedAugmentations[t].name===o.a.NeuroFluxGovernor){n=t;break}for(let t=0;t"}return c.a.queuedAugmentations=[],t||Object(u.a)("You slowly drift to sleep as scientists put you under in order to install the following Augmentations:
"+e+"
You wake up in your home...you feel different..."),Object(f.a)(),p.b.toTerminal(),!0}function S(t){return r.a.hasOwnProperty(t)}function _(t){return(t instanceof a.a?t.name:t)===o.a.NeuroFluxGovernor}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(7),o=n(23);function s({money:t}){return r.a.createElement(o.a,{money:i.a.formatMoney(t)+" / sec"})}},function(t,e,n){"use strict";n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(999),r=n(15),i=n(599);class o{constructor(t,e,n,a,r,i){this.name=t,this.desc=e,this.generate=n,this.solver=a,this.difficulty=r,this.numTries=i}}const s={};for(const t of a.a)s[t.name]=new o(t.name,t.desc,t.gen,t.solver,t.difficulty,t.numTries);let l,c;!function(t){t[t.FactionReputation=0]="FactionReputation",t[t.FactionReputationAll=1]="FactionReputationAll",t[t.CompanyReputation=2]="CompanyReputation",t[t.Money=3]="Money"}(l||(l={})),function(t){t[t.Success=0]="Success",t[t.Failure=1]="Failure",t[t.Cancelled=2]="Cancelled"}(c||(c={}));class f{constructor(t="",e="Find Largest Prime Factor",n=null){var a,r,i;if(i=0,(r="tries")in(a=this)?Object.defineProperty(a,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[r]=i,this.fn=t,this.fn.endsWith(".cct")||(this.fn+=".cct"),null==s[e])throw new Error(`Error: invalid contract type: ${e} please contact developer`);this.type=e,this.data=s[e].generate(),this.reward=n}getData(){return this.data}getDescription(){return s[this.type].desc(this.data)}getDifficulty(){return s[this.type].difficulty}getMaxNumTries(){return s[this.type].numTries}getType(){return s[this.type].name}isSolution(t){return s[this.type].solver(this.data,t)}async prompt(){return new Promise(t=>{const e={c:this,onClose:()=>{t(c.Cancelled)},onAttempt:e=>{this.isSolution(e)?t(c.Success):t(c.Failure)}};i.a.emit(e)})}toJSON(){return Object(r.b)("CodingContract",this)}static fromJSON(t){return Object(r.a)(f,t.data)}}r.c.constructors.CodingContract=f},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.LimitBuy="Limit Buy Order",t.LimitSell="Limit Sell Order",t.StopBuy="Stop Buy Order",t.StopSell="Stop Sell Order"}(a||(a={}))},,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(64),r=n(219);const i=[];class o{constructor(t,e,n,a,r){this.id=t,this.shape=e,this.type=n,this.power=a,this.limit=r}fullAt(t,e,n){if(e<0)return!1;if(e>=this.height(n))return!1;if(t<0)return!1;if(t>=this.width(n))return!1;let[a,r,i,o]=[0,0,1,1];1===n?[a,r,i,o]=[this.width(n)-1,0,-1,1]:2===n?[a,r,i,o]=[this.width(n)-1,this.height(n)-1,-1,-1]:3===n&&([a,r,i,o]=[0,this.height(n)-1,1,-1]);let[s,l]=[a+i*t,r+o*e];return n%2==1&&([s,l]=[l,s]),this.shape[l][s]}width(t){return t%2==0?this.shape[0].length:this.shape.length}height(t){return t%2==0?this.shape.length:this.shape[0].length}neighboors(t){const e=[],n=(n,a)=>{this.fullAt(n,a,t)||e.some(t=>t[0]===n&&t[1]===a)||e.push([n,a])};for(let e=0;ee[0]===t[0]&&e[1]===t[1])||a.push(t);return a}copy(){return Object.assign({},this)}}function s(t){for(const e of i)if(e.id===t)return e;return null}!function(){const t=!1,e=!0;i.push(new o(0,r.a.S,a.b.Hacking,1,1)),i.push(new o(1,r.a.Z,a.b.Hacking,1,1)),i.push(new o(5,r.a.T,a.b.HackingSpeed,1.3,1)),i.push(new o(6,r.a.I,a.b.HackingMoney,2,1)),i.push(new o(7,r.a.J,a.b.HackingGrow,.5,1)),i.push(new o(10,r.a.T,a.b.Strength,2,1)),i.push(new o(12,r.a.L,a.b.Defense,2,1)),i.push(new o(14,r.a.L,a.b.Dexterity,2,1)),i.push(new o(16,r.a.S,a.b.Agility,2,1)),i.push(new o(18,r.a.S,a.b.Charisma,3,1)),i.push(new o(20,r.a.I,a.b.HacknetMoney,1,1)),i.push(new o(21,r.a.O,a.b.HacknetCost,2,1)),i.push(new o(25,r.a.J,a.b.Rep,.5,1)),i.push(new o(27,r.a.J,a.b.WorkMoney,10,1)),i.push(new o(28,r.a.L,a.b.Crime,2,1)),i.push(new o(30,r.a.S,a.b.Bladeburner,.4,1)),i.push(new o(100,[[t,e,e],[e,e,t],[t,e,t]],a.b.Booster,1.1,99)),i.push(new o(101,[[e,e,e,e],[e,t,t,t]],a.b.Booster,1.1,99)),i.push(new o(102,[[t,e,e,e],[e,e,t,t]],a.b.Booster,1.1,99)),i.push(new o(103,[[e,e,e,t],[t,t,e,e]],a.b.Booster,1.1,99)),i.push(new o(104,[[t,e,e],[t,e,t],[e,e,t]],a.b.Booster,1.1,99)),i.push(new o(105,[[t,t,e],[t,e,e],[e,e,t]],a.b.Booster,1.1,99)),i.push(new o(106,[[e,t,t],[e,e,e],[e,t,t]],a.b.Booster,1.1,99)),i.push(new o(107,[[t,e,t],[e,e,e],[t,e,t]],a.b.Booster,1.1,99))}();const l=new o(-2,[],a.b.None,0,1/0),c=new o(-2,[],a.b.Delete,0,1/0)},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));const a={base:"vs-dark",inherit:!0,common:{accent:"B5CEA8",bg:"1E1E1E",fg:"D4D4D4"},syntax:{tag:"569CD6",entity:"569CD6",string:"CE9178",regexp:"646695",markup:"569CD6",keyword:"569CD6",comment:"6A9955",constant:"569CD6",error:"F44747"},ui:{line:"1E1E1E",panel:{bg:"252526",selected:"252526",border:"1E1E1E"},selection:{bg:"ADD6FF26"}}},r=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/,i=t=>{for(const[e,n]of Object.entries(t)){switch(e){case"base":["vs-dark","vs"].includes(t.base)||(t.base="vs-dark");continue;case"inherit":"boolean"!=typeof t.inherit&&(t.inherit=!0);continue}const a=t=>{for(const[e,n]of Object.entries(t))"object"==typeof n?a(n):n.match(r)||(t[e]="FF0000")};a(n)}};function o(t){const e=[{token:"",background:t.ui.line,foreground:t.common.fg},{token:"identifier",foreground:t.common.accent},{token:"keyword",foreground:t.syntax.keyword},{token:"string",foreground:t.syntax.string},{token:"string.escape",foreground:t.syntax.regexp},{token:"comment",foreground:t.syntax.comment},{token:"constant",foreground:t.syntax.constant},{token:"entity",foreground:t.syntax.entity},{token:"type",foreground:t.syntax.tag},{token:"tag",foreground:t.syntax.tag},{token:"regexp",foreground:t.syntax.regexp},{token:"attribute",foreground:t.syntax.tag},{token:"constructor",foreground:t.syntax.markup},{token:"invalid",foreground:t.syntax.error},{token:"number",foreground:t.common.accent},{token:"delimiter",foreground:t.common.fg},{token:"ns",foreground:t.syntax.tag},{token:"netscriptfunction",foreground:t.syntax.markup},{token:"otherkeywords",foreground:t.syntax.keyword},{token:"otherkeyvars",foreground:t.common.accent},{token:"this",foreground:t.syntax.tag}],n=Object.fromEntries([["editor.background",t.common.bg],["editor.foreground",t.common.fg],["editor.lineHighlightBackground",t.ui.line],["editor.selectionBackground",t.ui.selection.bg],["editorSuggestWidget.background",t.ui.panel.bg],["editorSuggestWidget.border",t.ui.panel.border],["editorSuggestWidget.selectedBackground",t.ui.panel.selected],["editorHoverWidget.background",t.ui.panel.bg],["editorHoverWidget.border",t.ui.panel.border],["editorWidget.background",t.ui.panel.bg],["editorWidget.border",t.ui.panel.border],["input.background",t.ui.panel.bg],["input.border",t.ui.panel.border]].map(([t,e])=>[t,"#"+e]));return{base:t.base,inherit:t.inherit,rules:e,colors:n}}async function s(t){t.editor.defineTheme("monokai",{base:"vs-dark",inherit:!0,rules:[{background:"272822",token:""},{foreground:"75715e",token:"comment"},{foreground:"e6db74",token:"string"},{token:"number",foreground:"ae81ff"},{token:"otherkeyvars",foreground:"ae81ff"},{foreground:"ae81ff",token:"function"},{foreground:"f92672",token:"keyword"},{token:"storage.type.function.js",foreground:"ae81ff"},{token:"ns",foreground:"97d92b"},{token:"netscriptfunction",foreground:"53d3e4"},{token:"otherkeywords",foreground:"53d3e4"},{token:"this",foreground:"fd971f"}],colors:{"editor.foreground":"#F8F8F2","editor.background":"#272822","editor.selectionBackground":"#49483E","editor.lineHighlightBackground":"#3E3D32","editorCursor.foreground":"#F8F8F0","editorWhitespace.foreground":"#3B3A32","editorIndentGuide.activeBackground":"#9D550FB0","editor.selectionHighlightBorder":"#222218"}}),t.editor.defineTheme("solarized-dark",{base:"vs-dark",inherit:!0,rules:[{background:"002b36",token:""},{foreground:"586e75",token:"comment"},{foreground:"00afaf",token:"string"},{token:"number",foreground:"00afaf"},{token:"otherkeyvars",foreground:"268bd2"},{foreground:"268bd2",token:"function"},{foreground:"859900",token:"keyword"},{token:"storage.type.function.js",foreground:"cb4b16"},{token:"ns",foreground:"cb4b16"},{token:"netscriptfunction",foreground:"268bd2"},{token:"otherkeywords",foreground:"268bd2"},{token:"type.identifier.js",foreground:"b58900"},{token:"delimiter.square.js",foreground:"0087ff"},{token:"delimiter.bracket.js",foreground:"0087ff"},{token:"this",foreground:"cb4b16"}],colors:{"editor.foreground":"#839496","editor.background":"#002b36","editor.selectionBackground":"#073642","editor.lineHighlightBackground":"#073642","editorCursor.foreground":"#819090","editorWhitespace.foreground":"#073642","editorIndentGuide.activeBackground":"#9D550FB0","editor.selectionHighlightBorder":"#222218"}}),t.editor.defineTheme("solarized-light",{base:"vs",inherit:!0,rules:[{foreground:"657b83",background:"fdf6e3",token:""},{foreground:"586e75",token:"comment"},{foreground:"2aa198",token:"string"},{token:"number",foreground:"2aa198"},{token:"otherkeyvars",foreground:"268bd2"},{foreground:"268bd2",token:"function"},{foreground:"859900",token:"keyword"},{token:"storage.type.function.js",foreground:"bc4b16"},{token:"ns",foreground:"cb4b16"},{token:"netscriptfunction",foreground:"268bd2"},{token:"otherkeywords",foreground:"268bd2"},{token:"type.identifier.js",foreground:"b58900"},{token:"delimiter.square.js",foreground:"0087ff"},{token:"delimiter.bracket.js",foreground:"0087ff"},{token:"this",foreground:"cb4b16"}],colors:{"editor.foreground":"#657b83","editor.background":"#fdf6e3","editor.selectionBackground":"#eee8d5","editor.lineHighlightBackground":"#eee8d5","editorCursor.foreground":"#657b83","editorWhitespace.foreground":"#eee8d5","editorIndentGuide.activeBackground":"#eee8d5","editor.selectionHighlightBorder":"#073642"}}),t.editor.defineTheme("dracula",{base:"vs-dark",inherit:!0,rules:[{background:"282A36",foreground:"F8F8F2",token:""},{foreground:"6272A4",token:"comment"},{foreground:"F1FA8C",token:"string"},{token:"number",foreground:"BD93F9"},{token:"otherkeyvars",foreground:"BD93F9"},{foreground:"FF79C6",token:"function"},{foreground:"FF79C6",token:"keyword"},{token:"storage.type.function.js",foreground:"FF79C6"},{token:"ns",foreground:"FFB86C",fontStyle:"italic"},{token:"netscriptfunction",foreground:"FF79C6"},{token:"otherkeywords",foreground:"FF68A7"},{token:"type.identifier.js",foreground:"7EE9FD",fontStyle:"italic"},{token:"delimiter.square.js",foreground:"FFD709"},{token:"delimiter.parenthesis.js",foreground:"FFD709"},{token:"delimiter.bracket.js",foreground:"FFD709"},{token:"this",foreground:"BD93F9",fontStyle:"italic"}],colors:{"editor.foreground":"#F8F8F2","editor.background":"#282A36","editorLineNumber.foreground":"#6272A4","editor.selectionBackground":"#44475A","editor.selectionHighlightBackground":"#424450","editor.foldBackground":"#21222C","editor.wordHighlightBackground":"#8BE9FD50","editor.wordHighlightStrongBackground":"#50FA7B50","editor.findMatchBackground":"#FFB86C80","editor.findMatchHighlightBackground":"#FFFFFF40","editor.findRangeHighlightBackground":"#44475A75","editor.hoverHighlightBackground":"#8BE9FD50","editor.lineHighlightBorder":"#44475A","editor.rangeHighlightBackground":"#BD93F915","editor.snippetTabstopHighlightBackground":"#282A36","editor.snippetTabstopHighlightBorder":"#6272A4","editor.snippetFinalTabstopHighlightBackground":"#282A36","editor.snippetFinalTabstopHighlightBorder":"#50FA7B"}}),t.editor.defineTheme("one-dark",{base:"vs-dark",inherit:!0,rules:[{token:"",background:"333842",foreground:"ABB2BF"},{token:"comment",foreground:"5C6370"},{token:"string",foreground:"98C379"},{token:"number",foreground:"D19A66"},{token:"function",foreground:"C678DD"},{token:"keyword",foreground:"C678DD"},{token:"otherkeyvars",foreground:"D19A66"},{token:"otherkeywords",foreground:"C678DD"},{token:"ns",foreground:"E06C75"},{token:"netscriptfunction",foreground:"61AFEF"},{token:"type.identifier",foreground:"E5C07B"},{token:"delimiter",foreground:"ABB2BF"},{token:"this",foreground:"E06C75"}],colors:{"editor.background":"#282C34","editor.foreground":"#ABB2BF","editor.lineHighlightBackground":"#99BBFF0A","editor.selectionBackground":"#3E4451","editor.findMatchHighlightBackground":"#528BFF3D","editorCursor.foreground":"#528BFF","editorHoverWidget.background":"#21252B","editorHoverWidget.border":"#181A1F","editorIndentGuide.background":"#ABB2BF26","editorIndentGuide.activeBackground":"#626772","editorLineNumber.foreground":"#636D83","editorLineNumber.activeForeground":"#ABB2BF","editorSuggestWidget.background":"#21252B","editorSuggestWidget.border":"#181A1F","editorSuggestWidget.selectedBackground":"#2C313A","editorWhitespace.foreground":"#ABB2BF26","editorWidget.background":"#21252B","editorWidget.border":"#3A3F4B","input.background":"#1B1D23","input.border":"#181A1F","peekView.border":"#528BFF","peekViewResult.background":"#21252B","peekViewResult.selectionBackground":"#2C313A","peekViewTitle.background":"#1B1D23","peekViewEditor.background":"#1B1D23","scrollbarSlider.background":"#4E566680","scrollbarSlider.activeBackground":"#747D9180","scrollbarSlider.hoverBackground":"#5A637580"}})}},,,function(t,e,n){"use strict";function a(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}n.d(e,"a",(function(){return r}));class r{constructor(){var t,e,n;n={},(e="subscribers")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}subscribe(t){let e=a();for(;void 0!==this.subscribers[e];)e=a();return this.subscribers[e]=t,()=>{delete this.subscribers[e]}}emit(...t){for(const e in this.subscribers){const n=this.subscribers[e];void 0!==n&&n(...t)}}}},,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(639),o=n.n(i),s=n(1150),l=n.n(s),c=n(112),f=n(1151),u=n.n(f),m=n(636),h=n.n(m),d=n(88),p=n(21);function g(t){const[e,n]=Object(a.useState)("");const{label:i,placeholder:s,add:f,subtract:m,reset:g,tons:y}=t;return r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{label:i,value:e,onChange:function(t){""===t.target.value?n(""):n(parseFloat(t.target.value))},placeholder:s,type:"number",InputProps:{startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{title:"Add a lot"},r.a.createElement(c.a,{onClick:y,size:"large"},r.a.createElement(h.a,{style:{transform:"rotate(-90deg)"}}))),r.a.createElement(p.a,{title:"Add"},r.a.createElement(c.a,{onClick:()=>f("string"!=typeof e?e:0),size:"large"},r.a.createElement(o.a,null)))),endAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{title:"Remove"},r.a.createElement(c.a,{onClick:()=>m("string"!=typeof e?e:0),size:"large"},r.a.createElement(l.a,null))),r.a.createElement(p.a,{title:"Reset"},r.a.createElement(c.a,{onClick:g,size:"large"},r.a.createElement(u.a,null))))}}))}},function(t,e,n){"use strict";n.d(e,"e",(function(){return r})),n.d(e,"g",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"f",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return f}));var a=n(30);function r(t,e){return Math.random()*(e-t)+t}const i="↑",o="↓",s="←",l="→";function c(t){switch(t.key){case a.a.UP_ARROW:case a.a.W:return i;case a.a.LEFT_ARROW:case a.a.A:return s;case a.a.DOWN_ARROW:case a.a.S:return o;case a.a.RIGHT_ARROW:case a.a.D:return l}return""}function f(t){switch(t.key){case a.a.DOWN_ARROW:case a.a.S:return i;case a.a.RIGHT_ARROW:case a.a.D:return s;case a.a.UP_ARROW:case a.a.W:return o;case a.a.LEFT_ARROW:case a.a.A:return l}return""}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(366),r=n(15);class i extends a.a{constructor(t=null){super(t),this.count=1}getActionTimePenalty(){return 1.5}getChaosCompetencePenalty(){return 1}getChaosDifficultyBonus(){return 1}toJSON(){return Object(r.b)("BlackOperation",this)}static fromJSON(t){return Object(r.a)(i,t.data)}}r.c.constructors.BlackOperation=i},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.None="",t.SHOPLIFT="SHOPLIFT",t.ROB_STORE="ROBSTORE",t.MUG="MUG",t.LARCENY="LARCENY",t.DRUGS="DRUGS",t.BOND_FORGERY="BONDFORGERY",t.TRAFFIC_ARMS="TRAFFICKARMS",t.HOMICIDE="HOMICIDE",t.GRAND_THEFT_AUTO="GRANDTHEFTAUTO",t.KIDNAP="KIDNAP",t.ASSASSINATION="ASSASSINATION",t.HEIST="HEIST"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return l}));var a=n(306),r=n(690);function i(t){const e=a.a[t];if(null==e)throw new Error("Invalid research name: "+t);return new r.a({text:e.name,cost:e.cost})}function o(){const t=i("Hi-Tech R&D Laboratory"),e=i("AutoBrew"),n=i("AutoPartyManager"),a=i("Automatic Drug Administration"),r=i("Bulk Purchasing"),o=i("CPH4 Injections"),s=i("Drones"),l=i("Drones - Assembly"),c=i("Drones - Transport"),f=i("Go-Juice"),u=i("HRBuddy-Recruitment"),m=i("HRBuddy-Training"),h=i("JoyWire"),d=i("Market-TA.I"),p=i("Market-TA.II"),g=i("Overclock"),y=i("Self-Correcting Assemblers"),b=i("Sti.mu");return a.addChild(f),a.addChild(o),s.addChild(l),s.addChild(c),u.addChild(m),d.addChild(p),g.addChild(b),t.addChild(e),t.addChild(n),t.addChild(a),t.addChild(r),t.addChild(s),t.addChild(u),t.addChild(h),t.addChild(d),t.addChild(g),t.addChild(y),t}function s(){const t=new r.b;return t.setRoot(o()),t}function l(){const t=new r.b,e=o(),n=i("uPgrade: Fulcrum"),a=i("uPgrade: Capacity.I"),s=i("uPgrade: Capacity.II"),l=i("uPgrade: Dashboard");return a.addChild(s),n.addChild(a),n.addChild(l),e.addChild(n),t.setRoot(e),t}},,function(t,e,n){"use strict";n.d(e,"g",(function(){return u})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"f",(function(){return d})),n.d(e,"e",(function(){return p})),n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return y}));var a=n(24),r=n(45),i=n(619),o=n(22),s=n(13),l=n(63),c=n(66),f=n(799);function u(t){let e=t.hostname.replace(/ /g,"-");if(null!=t.ip&&Object(a.g)(t.ip)&&(t.ip=Object(a.e)()),null!=Object(a.d)(e)){e+="-0";for(let t=0;t<200&&(e=e.replace(/-[0-9]+$/,"-"+t),null!=Object(a.d)(e));++t);}return t.hostname=e,new r.a(t)}function m(t,e,n,a=1){let r=1+(s.a.ServerBaseGrowthRate-1)/t.hackDifficulty;r>s.a.ServerMaxGrowthRate&&(r=s.a.ServerMaxGrowthRate);const i=t.serverGrowth/100,l=1+(a-1)/16;return Math.log(e)/(Math.log(r)*n.mults.hacking_grow*i*o.a.ServerGrowthRate*l)}function h(t,e,n,a,r=1){if(n<0&&(n=0),e>t.moneyMax&&(e=t.moneyMax),e<=n)return 0;const i=1+(s.a.ServerBaseGrowthRate-1)/t.hackDifficulty,l=Math.min(i,s.a.ServerMaxGrowthRate),c=1+(r-1)/16,f=t.serverGrowth/100*a.mults.hacking_grow*c*o.a.ServerGrowthRate,u=f*Math.log(l),m=n*u+Math.log(e*u);let h;if(m0&&(h-=Math.log(m));let d=h/u-n;const p=l**f;let g=1/0;do{const t=p**d,a=n+d;g=(a*t-e)/(a*u+1)/t,d-=g}while(Math.abs(g)>=1);const y=Math.floor(d);if(e<=(n+y)*Math.pow(l,y*f))return y;const b=Math.ceil(d);return e<=(n+b)*Math.pow(l,b*f)?b:b+1}function d(t,e,n,a=1){let r=Object(i.a)(t,e,n,a);r<1&&(console.warn("serverGrowth calculated to be less than 1"),r=1);const o=t.moneyAvailable;if(t.moneyAvailable+=1*e,t.moneyAvailable*=r,Object(f.a)(t.moneyMax)&&isNaN(t.moneyAvailable)&&(t.moneyAvailable=t.moneyMax),Object(f.a)(t.moneyMax)&&t.moneyAvailable>t.moneyMax&&(t.moneyAvailable=t.moneyMax),o!==t.moneyAvailable){let r=h(t,t.moneyAvailable,o,n,a);r=Math.min(Math.max(0,Math.ceil(r)),e),t.fortify(2*s.a.ServerFortifyAmount*r)}return t.moneyAvailable/o}function p(t,e){const n=e.programs.includes(l.a.BitFlume.name);e.programs.length=0,e.runningScripts=[],e.serversOnNetwork=[],e.isConnectedTo=!0,e.ramUsed=0,e.programs.push(l.a.NukeProgram.name),n&&e.programs.push(l.a.BitFlume.name),e.scripts.forEach((function(n){n.updateRamUsage(t,e.scripts)})),e.messages.length=0,e.messages.push(c.a.HackersStartingHandbook)}function g(t,e){return e>t.serversOnNetwork.length?(console.error("Tried to get server on network that was out of range"),null):Object(a.d)(t.serversOnNetwork[e])}function y(t){return t instanceof r.a&&t.backdoorInstalled}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({unbuyable:{color:t.palette.action.disabled},money:{color:t.colors.money}}));function l(t){const e=s();return t.corp.funds>t.money?a.createElement("span",{className:e.money},r.a.formatMoney(t.money)):a.createElement("span",{className:e.unbuyable},r.a.formatMoney(t.money))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(343),r=n(289),i=n(21),o=n(3),s=n(0),l=n.n(s);function c({checked:t,onChange:e,text:n,tooltip:c}){const[f,u]=Object(s.useState)(t);return Object(s.useEffect)(()=>e(f),[f]),l.a.createElement(l.a.Fragment,null,l.a.createElement(a.a,{control:l.a.createElement(r.a,{checked:f,onChange:function(t){u(t.target.checked)}}),label:l.a.createElement(i.a,{title:l.a.createElement(o.a,null,c)},l.a.createElement(o.a,null,n))}),l.a.createElement("br",null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={BladesIntuition:"Blade's Intuition",Cloak:"Cloak",Marksman:"Marksman",WeaponProficiency:"Weapon Proficiency",ShortCircuit:"Short-Circuit",DigitalObserver:"Digital Observer",Tracer:"Tracer",Overclock:"Overclock",Reaper:"Reaper",EvasiveSystem:"Evasive System",Datamancer:"Datamancer",CybersEdge:"Cyber's Edge",HandsOfMidas:"Hands of Midas",Hyperdrive:"Hyperdrive"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({reputation:{color:t.colors.rep}}));function l({reputation:t}){const e=s();return a.createElement("span",{className:e.reputation},"number"==typeof t?r.a.formatReputation(t):t)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var a=n(0);const r={Gang:n.n(a).a.createContext({})},i=()=>Object(a.useContext)(r.Gang)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(168),r=n(443),i=n(204),o=n(307),s=n(24),l=n(16),c=n(352),f=n(1);function u(t){if(t instanceof r.a)return h(t),!0;if("number"==typeof t)return m(t);{const e=m(t.runningScript.pid);if(e)return e;for(const e of i.a.values())if(e.scriptRef===t.runningScript)return h(e),!0;return!1}}function m(t){const e=i.a.get(t);return e instanceof r.a&&(h(e),!0)}function h(t){var e;if((e=t)instanceof r.a&&e.delay&&(clearTimeout(e.delay),e.delayReject&&e.delayReject(new a.a(e))),"function"==typeof t.atExit){try{t.env.stopFlag=!1,t.atExit()}catch(e){let n=e instanceof a.a?e.errorMessage:String(e);n=n.replace(/.*\|DELIMITER\|/,""),Object(l.a)(`Error trying to call atExit for script ${[t.name,...t.args].join(" ")} on ${t.hostname}\n ${n}`),console.error(e)}t.atExit=void 0}t.env.stopFlag=!0,function(t){const e=t.hostname,n=Object(s.d)(e);if(null==n)return void console.error("Could not find server on which this script is running: "+e);for(let e=0;e100?this.otlkMagForecast=100:this.otlkMagForecast<0&&(this.otlkMagForecast=0)}changePrice(t){this.lastPrice=this.price,this.price=t}cycleForecast(t=.1){const e=this.getForecastIncreaseChance();Math.random()5&&(this.otlkMag=Math.max(5,this.otlkMag-t))}influenceForecastForecast(t){this.otlkMagForecast>50?(this.otlkMagForecast-=t,this.otlkMagForecast=Math.max(50,this.otlkMagForecast)):this.otlkMagForecast<50&&(this.otlkMagForecast+=t,this.otlkMagForecast=Math.min(50,this.otlkMagForecast))}toJSON(){return Object(a.b)("Stock",this)}static fromJSON(t){return Object(a.a)(s,t.data)}}a.c.constructors.Stock=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={}},,function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"e",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"f",(function(){return f}));var a=n(22),r=n(41);function i(t,e,n,i,o){return r.b.HashesPerLevel*t*Math.pow(1.07,Math.log2(n))*(1+(i-1)/5)*(1-e/n)*o*a.a.HacknetNodeMoney}function o(t,e=1,n=1){const a=Math.round(e);if(isNaN(a)||a<1)return 0;if(t>=r.b.MaxLevel)return 1/0;const i=r.b.UpgradeLevelMult;let o=0,s=t;for(let t=0;t=r.b.MaxRam)return 1/0;let i=0,o=Math.round(Math.log2(t)),s=t;for(let t=0;t=r.b.MaxCores)return 1/0;const i=r.b.UpgradeCoreMult;let o=0,s=t;for(let t=0;t=r.b.MaxCache)return 1/0;const a=r.b.UpgradeCacheMult;let i=0,o=t;for(let t=0;t=r.b.MaxServers?1/0:r.b.BaseCost*Math.pow(r.b.PurchaseMult,t-1)*e}},,,,,,function(t,e,n){"use strict";function a(t){return"string"==typeof t||t instanceof String}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"f",(function(){return l})),n.d(e,"e",(function(){return c})),n.d(e,"g",(function(){return m})),n.d(e,"h",(function(){return h}));var a=n(83);let r={},i={};function o(t){r=""===t?{}:JSON.parse(t)}function s(t){i=""===t?{}:JSON.parse(t)}function l(){for(const t of Object.keys(r))r.hasOwnProperty(t)&&a.a.print("alias "+t+"="+r[t]);for(const t of Object.keys(i))i.hasOwnProperty(t)&&a.a.print("global alias "+t+"="+i[t])}function c(t,e=!1){console.log(t);const n=t.match(/^([\w|!%,@-]+)=(.+)$/);return console.log(n),null!=n&&3==n.length&&(e?function(t,e){t in r&&delete r[t];i[t]=e.trim()}(n[1],n[2]):function(t,e){t in i&&delete i[t];r[t]=e.trim()}(n[1],n[2]),!0)}function f(t){return r.hasOwnProperty(t)?r[t]:null}function u(t){return i.hasOwnProperty(t)?i[t]:null}function m(t){return r.hasOwnProperty(t)?(delete r[t],!0):!!i.hasOwnProperty(t)&&(delete i[t],!0)}function h(t){const e=t.split(" ");if(e.length>0){if("unalias"===e[0]||"alias"===e[0])return e.join(" ");let t=!0,r=0;for(;t&&r<10;){var n;r++,t=!1;const i=null===(n=f(e[0]))||void 0===n?void 0:n.split(" ");null!=i&&(t=!0,e.splice(0,1,...i));for(let n=0;n!t)}return Object(a.useEffect)(()=>x.subscribe(t=>{const n=t.server+"-"+t.filename+t.args.map(t=>""+t).join("-");T.find(t=>t.id===n)||(T.push({id:n,script:t}),e())}),[]),Object(a.useEffect)(()=>L.subscribe(t=>{!function(t){T=T.filter(e=>e.script.pid!=t),e()}(t)}),[]),Object(a.useEffect)(()=>O.subscribe(()=>{T=[],e()})),r.a.createElement(r.a.Fragment,null,T.map(t=>r.a.createElement(I,{key:t.id,script:t.script,id:t.id,onClose:()=>{return n=t.id,T=T.filter(t=>t.id!==n),void e();var n}})))}const N=Object(d.a)(()=>Object(p.a)({logs:{overflowY:"scroll",overflowX:"hidden",scrollbarWidth:"auto",flexDirection:"column-reverse",whiteSpace:"pre-wrap",wordWrap:"break-word"},titleButton:{padding:"1px 0",height:"100%"}})),P=1500;function I(t){const e=Object(a.useRef)(null),n=Object(a.useRef)(null),[i,u]=Object(a.useState)(t.script),d=N(),p=Object(a.useRef)(null),g=Object(a.useState)(!1)[1],[x,L]=Object(a.useState)([500,500]),[O,T]=Object(a.useState)(!1);function R(){g(t=>!t)}const I=({x:t,y:e})=>{const a=null==n?void 0:n.current;if(!a)return;const r=a.state;console.log(`before ${r.x} ${r.y}`),r.x=t,r.y=e};function D(){Object(o.a)({runningScript:i,hostname:i.server})}function F(){const t=Object(v.d)(i.server);if(null===t)return;const e=Object(k.a)(i.filename,i.args,t);null===e?Object(E.e)(i,t):u(e)}function j(){const t=p.current;null!==t&&(t.style.zIndex=P+C+"",C++,R())}function B(t=!1){const e=`${i.filename} ${i.args.map(t=>""+t).join(" ")}`;return t||e.length<=30?e:e.slice(0,27)+"..."}function G(){T(!O)}Object(a.useEffect)(()=>M.subscribe(e=>{e.pid===t.script.pid&&I(e.data)}),[]),Object(a.useEffect)(()=>A.subscribe(e=>{e.pid===t.script.pid&&L([e.data.w,e.data.h])}),[]),Object(a.useEffect)(()=>I({x:.4*window.innerWidth,y:.3*window.innerHeight}),[]),Object(a.useEffect)(()=>{j();const t=setInterval(R,1e3);return()=>clearInterval(t)},[]),Object(a.useEffect)(()=>(window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}),[]);const W=Object(w.debounce)(()=>{const t=null==e?void 0:e.current;t&&(H(t)||I({x:0,y:0}))},100),H=t=>{const e=t.getBoundingClientRect();return!(e.right<0||e.bottom<0||e.left>innerWidth||e.top>outerWidth)},U=[250,33];return r.a.createElement(m.a,{handle:".drag",onDrag:t=>{if(t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>innerWidth||t.clientY>innerHeight))return!1},ref:n,onMouseDown:j},r.a.createElement(l.a,{display:"flex",sx:{flexFlow:"column",position:"fixed",zIndex:1400,minWidth:U[0]+"px",minHeight:U[1]+"px",...O?{border:"none",margin:0,maxHeight:0,padding:0}:{border:"1px solid "+S.a.theme.welllight}},ref:p},r.a.createElement(h.ResizableBox,{height:x[0],width:x[1],onResize:(t,{size:e})=>{L([e.width,e.height])},minConstraints:U,handle:r.a.createElement("span",{style:{position:"absolute",right:"-10px",bottom:"-16px",cursor:"nw-resize",display:O?"none":"inline-block"}},r.a.createElement(y.a,{color:"primary",style:{transform:"rotate(45deg)",fontSize:"1.75rem"}}))},r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{className:"drag",sx:{display:"flex",alignItems:"center",cursor:"grab"},ref:e},r.a.createElement(s.a,{variant:"h6",sx:{marginRight:"auto",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},title:B(!0)},B(!0)),r.a.createElement("span",{style:{minWidth:"fit-content",height:U[1]+"px"}},b.a.has(i.pid)?r.a.createElement(c.a,{className:d.titleButton,onClick:D,onTouchEnd:D},"Kill"):r.a.createElement(c.a,{className:d.titleButton,onClick:F,onTouchEnd:F},"Run"),r.a.createElement(c.a,{className:d.titleButton,onClick:G,onTouchEnd:G},O?"🗖":"🗕"),r.a.createElement(c.a,{className:d.titleButton,onClick:t.onClose,onTouchEnd:t.onClose},"Close"))),r.a.createElement(f.a,{className:d.logs,sx:{height:`calc(100% - ${U[1]}px)`,display:O?"none":"flex"}},r.a.createElement("span",{style:{display:"flex",flexDirection:"column"}},i.logs.map((t,e)=>{return r.a.createElement(_.a,{key:e,text:t,color:(n=t,n.match(/(^\[[^\]]+\] )?ERROR/)||n.match(/(^\[[^\]]+\] )?FAIL/)?"error":n.match(/(^\[[^\]]+\] )?SUCCESS/)?"success":n.match(/(^\[[^\]]+\] )?WARN/)?"warn":n.match(/(^\[[^\]]+\] )?INFO/)?"info":"primary")});var n})))))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t){var e,n,a;a="",(n="errorMessage")in(e=this)?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,this.pid=t.pid,this.name=t.name,this.hostname=t.hostname,this.errorMessage=t.errorMessage,Object.freeze(this)}}Object.freeze(a),Object.freeze(a.prototype)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n){this.title=t,this.fn=e,this.txt=n}}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(3),o=n(21);function s(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(o.a,{open:e,title:r.a.createElement(i.a,null,"Copied!")},r.a.createElement(i.a,{variant:t.variant,color:t.color,onClick:function(){const e=document.createElement("textarea");e.value=t.value,document.body.appendChild(e),e.select(),e.setSelectionRange(0,1e10),document.execCommand("copy"),document.body.removeChild(e),n(!0),setTimeout(()=>n(!1),1e3)}},t.value))}},,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return m})),n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(682),o=n(976),s=n(1783),l=n(127),c=n(6);const f=new l.a;let u;function m(){var t,e;u=Object(i.a)({colors:{hp:c.a.theme.hp,money:c.a.theme.money,hack:c.a.theme.hack,combat:c.a.theme.combat,cha:c.a.theme.cha,int:c.a.theme.int,rep:c.a.theme.rep,backgroundprimary:c.a.theme.backgroundprimary,backgroundsecondary:c.a.theme.backgroundsecondary,button:c.a.theme.button,successlight:c.a.theme.successlight,success:c.a.theme.success,successdark:c.a.theme.successdark,white:c.a.theme.white,black:c.a.theme.black},palette:{primary:{light:c.a.theme.primarylight,main:c.a.theme.primary,dark:c.a.theme.primarydark},secondary:{light:c.a.theme.secondarylight,main:c.a.theme.secondary,dark:c.a.theme.secondarydark},error:{light:c.a.theme.errorlight,main:c.a.theme.error,dark:c.a.theme.errordark},info:{light:c.a.theme.infolight,main:c.a.theme.info,dark:c.a.theme.infodark},warning:{light:c.a.theme.warninglight,main:c.a.theme.warning,dark:c.a.theme.warningdark},success:{light:c.a.theme.successlight,main:c.a.theme.success,dark:c.a.theme.successdark},background:{default:c.a.theme.backgroundprimary,paper:c.a.theme.well},action:{disabled:c.a.theme.disabled}},typography:{fontFamily:c.a.styles.fontFamily,button:{textTransform:"none"}},components:{MuiInputBase:{styleOverrides:{root:{backgroundColor:c.a.theme.well,color:c.a.theme.primary},input:{"&::placeholder":{userSelect:"none",color:c.a.theme.primarydark}}}},MuiInput:{styleOverrides:{root:{backgroundColor:c.a.theme.well,borderBottomColor:"#fff"},underline:{"&:hover":{borderBottomColor:c.a.theme.primarydark},"&:before":{borderBottomColor:c.a.theme.primary},"&:after":{borderBottomColor:c.a.theme.primarylight}}}},MuiInputLabel:{styleOverrides:{root:{color:c.a.theme.primarydark,userSelect:"none","&:before":{color:c.a.theme.primarylight}}}},MuiButtonGroup:{styleOverrides:{root:{"& .MuiButton-root:not(:last-of-type)":{marginRight:"1px"}}}},MuiButton:{styleOverrides:{root:{backgroundColor:c.a.theme.button,border:"1px solid "+c.a.theme.well,"&:hover":{backgroundColor:c.a.theme.backgroundsecondary},borderRadius:0}}},MuiSelect:{styleOverrides:{icon:{color:c.a.theme.primary}},defaultProps:{variant:"standard"}},MuiTextField:{defaultProps:{variant:"standard"}},MuiTypography:{defaultProps:{color:"primary"},styleOverrides:{root:{lineHeight:c.a.styles.lineHeight}}},MuiMenu:{styleOverrides:{list:{backgroundColor:c.a.theme.well}}},MuiMenuItem:{styleOverrides:{root:{color:c.a.theme.primary}}},MuiAccordionSummary:{styleOverrides:{root:{backgroundColor:"#111"}}},MuiAccordionDetails:{styleOverrides:{root:{backgroundColor:c.a.theme.backgroundsecondary}}},MuiIconButton:{styleOverrides:{root:{color:c.a.theme.primary}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:"1em",color:c.a.theme.primary,backgroundColor:c.a.theme.well,borderRadius:0,border:"2px solid white",maxWidth:"100vh"}},defaultProps:{disableInteractive:!0}},MuiSlider:{styleOverrides:{valueLabel:{color:c.a.theme.primary,backgroundColor:c.a.theme.well}}},MuiDrawer:{styleOverrides:{paper:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none",backgroundColor:c.a.theme.backgroundsecondary},paperAnchorDockedLeft:{borderRight:"1px solid "+c.a.theme.welllight}}},MuiDivider:{styleOverrides:{root:{backgroundColor:c.a.theme.welllight}}},MuiFormControlLabel:{styleOverrides:{root:{color:c.a.theme.primary}}},MuiSwitch:{styleOverrides:{switchBase:{color:c.a.theme.primarydark},track:{backgroundColor:c.a.theme.welllight}}},MuiPaper:{styleOverrides:{root:{borderRadius:0,backgroundColor:c.a.theme.backgroundsecondary,border:"1px solid "+c.a.theme.welllight}}},MuiTablePagination:{styleOverrides:{select:{color:c.a.theme.primary},selectLabel:{color:c.a.theme.primary},displayedRows:{color:c.a.theme.primary}}},MuiTab:{styleOverrides:{textColorPrimary:{color:c.a.theme.secondary,"&.Mui-selected":{color:c.a.theme.primary}},root:{backgroundColor:c.a.theme.backgroundsecondary,border:"1px solid "+c.a.theme.well,margin:"3px","&.Mui-selected":{backgroundColor:c.a.theme.button}}}},MuiTabs:{styleOverrides:{scrollButtons:{backgroundColor:c.a.theme.backgroundsecondary,color:c.a.theme.secondary,margin:"3px",opacity:1,width:"fit-content","&.Mui-disabled":{opacity:.5}}},defaultProps:{TabIndicatorProps:{style:{display:"none"}}}},MuiAlert:{styleOverrides:{root:{backgroundColor:c.a.theme.black,borderRadius:0,border:"1px solid "+c.a.theme.well},standardSuccess:{color:c.a.theme.successlight},standardError:{color:c.a.theme.errorlight},standardWarning:{color:c.a.theme.warninglight},standardInfo:{color:c.a.theme.infolight}}}}}),document.body.style.backgroundColor=null!==(t=null===(e=u.colors.backgroundprimary)||void 0===e?void 0:e.toString())&&void 0!==t?t:"black"}m();const h=({children:t})=>r.a.createElement(o.a,{injectFirst:!0},r.a.createElement(s.a,{theme:u},t))},,function(t,e,n){"use strict";let a,r;n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),function(t){t[t.Cost=0]="Cost",t[t.Default=1]="Default",t[t.Reputation=2]="Reputation",t[t.Purchasable=3]="Purchasable"}(a||(a={})),function(t){t[t.Alphabetically=0]="Alphabetically",t[t.AcquirementTime=1]="AcquirementTime"}(r||(r={}))},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Water:.05,Energy:.01,Food:.03,Plants:.05,Metal:.1,Hardware:.06,Chemicals:.05,Drugs:.02,Robots:.5,AICores:.1,RealEstate:.005,"Real Estate":.005,"AI Cores":.1}},function(t,e,n){"use strict";function a(t,e=1){return Math.max(Math.floor(e*(32*Math.log(t+534.5)-200)),1)}function r(t,e=1){return Math.exp((t/e+200)/32)-534.6}function i(t,e=1){const n=a(t,e),i=n+1;let o=r(n,e);o<0&&(o=0);let s=r(i,e);s<0&&(s=0);let l=s-o!=0?100*(t-o)/(s-o):99.99;l<0&&(l=0),l>100&&(l=100);let c=t-o,f=s-t;return c<0&&(c=0),f<0&&(f=0),{currentSkill:n,nextSkill:i,baseExperience:o,experience:t,nextExperience:s,currentExperience:c,remainingExperience:f,progress:l}}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i}))},,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r})),function(t){t.Weapon="w",t.Armor="a",t.Vehicle="v",t.Rootkit="r",t.Augmentation="g"}(a||(a={}));const r=[{cost:1e6,mults:{str:1.04,def:1.04},name:"Baseball Bat",upgType:a.Weapon},{cost:12e6,mults:{str:1.08,def:1.08,dex:1.08},name:"Katana",upgType:a.Weapon},{cost:25e6,mults:{str:1.1,def:1.1,dex:1.1,agi:1.1},name:"Glock 18C",upgType:a.Weapon},{cost:5e7,mults:{str:1.12,def:1.1,agi:1.1},name:"P90C",upgType:a.Weapon},{cost:6e7,mults:{str:1.2,def:1.15},name:"Steyr AUG",upgType:a.Weapon},{cost:1e8,mults:{str:1.25,def:1.2},name:"AK-47",upgType:a.Weapon},{cost:15e7,mults:{str:1.3,def:1.25},name:"M15A10 Assault Rifle",upgType:a.Weapon},{cost:225e6,mults:{str:1.3,dex:1.25,agi:1.3},name:"AWM Sniper Rifle",upgType:a.Weapon},{cost:2e6,mults:{def:1.04},name:"Bulletproof Vest",upgType:a.Armor},{cost:5e6,mults:{def:1.08},name:"Full Body Armor",upgType:a.Armor},{cost:25e6,mults:{def:1.15,agi:1.15},name:"Liquid Body Armor",upgType:a.Armor},{cost:4e7,mults:{def:1.2},name:"Graphene Plating Armor",upgType:a.Armor},{cost:3e6,mults:{agi:1.04,cha:1.04},name:"Ford Flex V20",upgType:a.Vehicle},{cost:9e6,mults:{agi:1.08,cha:1.08},name:"ATX1070 Superbike",upgType:a.Vehicle},{cost:18e6,mults:{agi:1.12,cha:1.12},name:"Mercedes-Benz S9001",upgType:a.Vehicle},{cost:3e7,mults:{agi:1.16,cha:1.16},name:"White Ferrari",upgType:a.Vehicle},{cost:5e6,mults:{hack:1.05},name:"NUKE Rootkit",upgType:a.Rootkit},{cost:25e6,mults:{hack:1.1},name:"Soulstealer Rootkit",upgType:a.Rootkit},{cost:75e6,mults:{hack:1.15},name:"Demon Rootkit",upgType:a.Rootkit},{cost:4e7,mults:{hack:1.12},name:"Hmap Node",upgType:a.Rootkit},{cost:75e6,mults:{hack:1.15},name:"Jack the Ripper",upgType:a.Rootkit},{cost:1e10,mults:{str:1.3,dex:1.3},name:"Bionic Arms",upgType:a.Augmentation},{cost:1e10,mults:{agi:1.6},name:"Bionic Legs",upgType:a.Augmentation},{cost:15e9,mults:{str:1.15,def:1.15,dex:1.15,agi:1.15},name:"Bionic Spine",upgType:a.Augmentation},{cost:2e10,mults:{str:1.4,def:1.4},name:"BrachiBlades",upgType:a.Augmentation},{cost:12e9,mults:{str:1.2,def:1.2},name:"Nanofiber Weave",upgType:a.Augmentation},{cost:25e9,mults:{str:1.5,agi:1.5},name:"Synthetic Heart",upgType:a.Augmentation},{cost:15e9,mults:{str:1.3,def:1.3},name:"Synfibril Muscle",upgType:a.Augmentation},{cost:5e9,mults:{hack:1.05},name:"BitWire",upgType:a.Augmentation},{cost:1e10,mults:{hack:1.15},name:"Neuralstimulator",upgType:a.Augmentation},{cost:75e8,mults:{hack:1.1},name:"DataJack",upgType:a.Augmentation},{cost:5e10,mults:{str:1.7,def:1.7},name:"Graphene Bone Lacings",upgType:a.Augmentation}]},,function(t,e,n){"use strict";n.d(e,"a",(function(){return A})),n.d(e,"c",(function(){return T})),n.d(e,"e",(function(){return N})),n.d(e,"f",(function(){return I})),n.d(e,"b",(function(){return D})),n.d(e,"d",(function(){return F}));var a=n(147),r=n(168),i=n(443),o=n(204),s=n(307),l=n(549),c=n(13),f=n(616),u=n(617),m=n(673),h=n(1448),d=n(498),p=n(680),g=n(269),y=n(24),b=n(6),E=n(714),v=n(16),k=n(275),w=n(548),S=n(163),_=n(259),C=n(314),x=n(77),L=n(1),O=n(83),M=n(2);const A=[];for(let t=0;t{i=!0;let e=t.source.value;e.startsWith("./")&&(e=e.slice(2));const n=function(t){for(let e=0;e{n.push(t.id.name),a.push(t)}}),r+=`var ${e};\n(function (namespace) {\n`,a.forEach(t=>{r+=Object(E.generate)(t),r+="\n"}),n.forEach(t=>{r+="namespace."+t+" = "+t,r+="\n"}),r+=`})(${e} || (" + namespace + " = {}));\n`}else{const e=[];t.specifiers.forEach(t=>{e.push(t.local.name)});const n=[];Object(C.b)(o,{FunctionDeclaration:t=>{e.includes(t.id.name)&&n.push(t)}}),n.forEach(t=>{r+=Object(E.generate)(t),r+="\n"})}}}),!i)return{code:t,lineOffset:0};let o=0;if("Program"!==n.type||null==n.body)throw new Error("Code could not be properly parsed");for(let t=n.body.length-1;t>=0;--t)"ImportDeclaration"===n.body[t].type&&(n.body.splice(t,1),++o);const s=(r.match(/\n/g)||[]).length-o;t=Object(E.generate)(n);return{code:t=r+t,lineOffset:s}}(e,t);n=a.code,i=a.lineOffset}catch(e){return Object(v.a)("Error processing Imports in "+t.name+":
"+String(e)),t.env.stopFlag=!0,Object(a.a)(t),Promise.resolve()}try{o=new f.a(n,(function e(n,r,i=[]){const o=i.reduce((t,e)=>t[e],t.env.vars);for(const[s,l]of Object.entries(o))if("function"==typeof l){const e=async(...e)=>{try{const t=e.pop(),a=await l(...e.map(n.pseudoToNative));return t(n.nativeToPseudo(a))}catch(e){if("string"==typeof e){console.error(e);const n=e.split("|DELIMITER|"),r=n[1],i=n[2],o=n[3];let s=`${i}@${r}
`;return s+="
",s+=o,Object(v.a)(s),t.env.stopFlag=!0,void Object(a.a)(t)}}};n.setProperty(r,s,n.createAsyncFunction(e))}else Array.isArray(l)||"object"!=typeof l?n.setProperty(r,s,n.nativeToPseudo(l)):(n.setProperty(r,s,n.nativeToPseudo({})),e(n,r.properties[s],[...i,s]))}),i)}catch(e){return Object(v.a)("Syntax ERROR in "+t.name+":
"+String(e)),t.env.stopFlag=!0,Object(a.a)(t),Promise.resolve()}return new Promise((function(e,n){try{!function a(){try{if(t.env.stopFlag)return n(new r.a(t));let i=!0,s=0;for(;s<3&&i;)i=i&&o.step(),s++;i?setTimeout(a,b.a.CodeInstructionRunTime):e()}catch(e){let a=String(e);return M.a.isScriptErrorMessage(a)||(a=M.a.makeRuntimeRejectMsg(t,a)),t.errorMessage=a,n(new r.a(t))}}()}catch(e){return Object(S.a)(e)?(t.errorMessage=e,n(new r.a(t))):e instanceof r.a?n(e):(console.error(e),n(new r.a(t)))}}))}function N(t,e,n){return P(t,e,n)?(e.runScript(t),t.pid):0}function P(t,e,n){let c=1;t.threads&&!isNaN(t.threads)?c=t.threads:t.threads=1;const f=Object(p.a)(t),h=Object(w.a)(f*c);if(h>e.maxRam-e.ramUsed+.001)return Object(v.a)(`Not enough RAM to run script ${t.filename} with args `+Object(k.a)(t.args)+". This likely occurred because you re-loaded the game and the script's RAM usage increased (either because of an update to the game or your changes to the script.)"),!1;e.updateRamUsed(Object(w.a)(e.ramUsed+h),L.a);const d=Object(l.a)();if(-1===d)throw new Error("Failed to start script because could not find available PID. This is most because you have too many scripts running.");const g=new i.a(t,d,u.a);g.ramUsage=f,o.a.set(d,g),s.a.emit();let y=null;if(g.name.endsWith(".js"))y=function(t){return new Promise((e,n)=>{Object(m.b)(L.a,t.getServer().scripts,t).then(()=>{e()}).catch(t=>n(t))}).catch(e=>{if(e instanceof Error)throw e instanceof SyntaxError?t.errorMessage=M.a.makeRuntimeRejectMsg(t,e.message+" (sorry we can't be more helpful)"):t.errorMessage=M.a.makeRuntimeRejectMsg(t,e.message+(e.stack&&"\nstack:\n"+e.stack.toString()||"")),new r.a(t);if(M.a.isScriptErrorMessage(e))throw t.errorMessage=e,new r.a(t);if(e instanceof r.a)throw e;throw t.errorMessage=M.a.makeRuntimeRejectMsg(t,""+e),new r.a(t)})}(g);else if(y=R(g),!(y instanceof Promise))return!1;return y.then((function(){g.env.stopFlag=!0,void 0===n||n.env.stopFlag||(n.scriptRef.onlineExpGained+=t.onlineExpGained,n.scriptRef.onlineMoneyMade+=t.onlineMoneyMade),Object(a.a)(g),g.log("",()=>"Script finished running")})).catch((function(t){if(t instanceof Error)return Object(v.a)("Script runtime unknown error. This is a bug please contact game developer"),void console.error("Evaluating workerscript returns an Error. THIS SHOULDN'T HAPPEN: "+t.toString());if(t instanceof r.a){if(!M.a.isScriptErrorMessage(g.errorMessage))return void g.log("",()=>"Script killed");{const t=g.errorMessage.split("|DELIMITER|");if(4!=t.length)return console.error("ERROR: Something wrong with Error text in evaluator..."),void console.error("Error text: "+g.errorMessage);const e=t[1],n=t[2],a=t[3];let r=`RUNTIME ERROR
${n}@${e} (PID - ${g.pid})
`;g.args.length>0&&(r+=`Args: ${Object(k.a)(g.args)}
`),r+="
",r+=a,Object(v.a)(r),g.log("",()=>"Script crashed with runtime error")}}else{if(M.a.isScriptErrorMessage(t))return Object(v.a)("Script runtime unknown error. This is a bug please contact game developer"),void console.error("ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: "+t.toString());Object(v.a)("An unknown script died for an unknown reason. This is a bug please contact game dev"),console.error(t)}Object(a.a)(g)})),!0}function I(t=1){const e=t*c.a._idleSpeed/1e3;for(const t of o.a.values())t.scriptRef.onlineRunningTime+=e}function D(){const t=-1!==window.location.href.toLowerCase().indexOf("?noscripts");t&&(O.a.warn("Skipped loading player scripts during startup"),console.info("Skipping the load of any scripts during startup"));for(const e of Object(y.c)()){e.ramUsed=0;for(let t=0;t`Invalid arguments: scriptname='${n} args='${a}'`),console.error("runScriptFromScript() failed due to invalid arguments"),0;a.forEach((t,e)=>{if("string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)throw new Error(`Only strings, numbers, and booleans can be passed as arguments to other scripts.\n${n} argument index ${e} is of type ${typeof t} and value ${JSON.stringify(t)}`)});if(null!=e.getRunningScript(n,a))return r.log(t,()=>`'${n}' is already running on '${e.hostname}'`),0;for(let e=0;e"Cannot execute a script with null/undefined as an argument"),0;for(let i=0;i`You do not have root access on '${e.hostname}'`),0;if(l>c+.001)return r.log(t,()=>`Cannot run script '${n}' (t=${o}) on '${e.hostname}' because there is not enough available RAM!`),0;r.log(t,()=>`'${n}' on '${e.hostname}' with ${o} threads and args: ${Object(k.a)(a)}.`);const f=new d.a(s,a);return f.threads=o,f.server=e.hostname,N(f,e,r)}return r.log(t,()=>`Could not find script '${n}' on '${e.hostname}'`),0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(5);const r={GangRespectToReputationRatio:75,MaximumGangMembers:12,CyclesPerTerritoryAndPowerUpdate:100,AscensionMultiplierRatio:.15,Names:[a.a.SlumSnakes,a.a.Tetrads,a.a.TheSyndicate,a.a.TheDarkArmy,a.a.SpeakersForTheDead,a.a.NiteSec,a.a.TheBlackHand],GangKarmaRequirement:-54e3}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return d})),n.d(e,"b",(function(){return p}));var a=n(235),r=n(75),i=n(13),o=n(1),s=n(7),l=n(23),c=n(16),f=n(0),u=n(2);function m(t,e,n=null,m={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==m.suppressDialog&&Object(c.a)("Failed to buy stock. This may be a bug, contact developer"),!1;const h=Object(a.b)(t,e,r.a.Long);if(null==h)return!1;if(o.a.money`You do not have enough money to purchase this position. You need ${s.a.formatMoney(h)}.`):!0!==m.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"You do not have enough money to purchase this. You need ",f.createElement(l.a,{money:h}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?u.a.log(n,()=>`Purchasing '${e+t.playerShares+t.playerShortShares}' shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares`):!0!==m.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${s.a.formatShares(t.maxShares)} shares.`),!1;const d=t.playerShares*t.playerAvgPx;o.a.loseMoney(h,"stock");const p=d+h-i.a.StockMarketCommission;if(t.playerShares=Math.round(t.playerShares+e),t.playerAvgPx=p/t.playerShares,Object(a.d)(t,e),null!=m.rerenderFn&&"function"==typeof m.rerenderFn&&m.rerenderFn(),n){const a=`Bought ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(h)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;u.a.log(n,()=>a)}else!0!==m.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"Bought ",s.a.formatShares(e)," shares of ",t.symbol," for ",f.createElement(l.a,{money:h}),". Paid"," ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function h(t,e,n=null,i={}){if(null==t||e<0||isNaN(e))return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==i.suppressDialog&&Object(c.a)("Failed to sell stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, contact developer"),!1;if((e=Math.round(e))>t.playerShares&&(e=t.playerShares),0===e)return!1;const m=Object(a.c)(t,e,r.a.Long);if(null==m)return!1;let h=m-t.playerAvgPx*e;if(isNaN(h)&&(h=0),o.a.gainMoney(m,"stock"),n&&(n.workerScript.scriptRef.onlineMoneyMade+=h,o.a.scriptProdSinceLastAug+=h),t.playerShares=Math.round(t.playerShares-e),0===t.playerShares&&(t.playerAvgPx=0),Object(a.d)(t,e),null!=i.rerenderFn&&"function"==typeof i.rerenderFn&&i.rerenderFn(),n){const a=`Sold ${s.a.formatShares(e)} shares of ${t.symbol}. After commissions, you gained a total of ${s.a.formatMoney(m)}.`;u.a.log(n,()=>a)}else!0!==i.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"Sold ",s.a.formatShares(e)," shares of ",t.symbol,". After commissions, you gained a total of"," ",f.createElement(l.a,{money:m}),"."));return!0}function d(t,e,n=null,m={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==m.suppressDialog&&Object(c.a)("Failed to initiate a short position in a stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, so contact developer"),!1;const h=Object(a.b)(t,e,r.a.Short);if(null==h)return!1;if(o.a.money"You do not have enough money to purchase this short position. You need "+s.a.formatMoney(h)):!0!==m.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"You do not have enough money to purchase this short position. You need ",f.createElement(l.a,{money:h}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?u.a.log(n,()=>`This '${e+t.playerShares+t.playerShortShares}' short shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares.`):!0!==m.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${t.maxShares} shares.`),!1;const d=t.playerShortShares*t.playerAvgShortPx;o.a.loseMoney(h,"stock");const p=d+h-i.a.StockMarketCommission;if(t.playerShortShares=Math.round(t.playerShortShares+e),t.playerAvgShortPx=p/t.playerShortShares,Object(a.d)(t,e),null!=m.rerenderFn&&"function"==typeof m.rerenderFn&&m.rerenderFn(),n){const a=`Bought a short position of ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(h)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;u.a.log(n,()=>a)}else m.suppressDialog||Object(c.a)(f.createElement(f.Fragment,null,"Bought a short position of ",s.a.formatShares(e)," shares of ",t.symbol," for"," ",f.createElement(l.a,{money:h}),". Paid ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function p(t,e,n=null,i={}){if(null==t||isNaN(e)||e<0)return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):i.suppressDialog||Object(c.a)("Failed to sell a short position in a stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, so contact developer"),!1;if((e=Math.round(e))>t.playerShortShares&&(e=t.playerShortShares),0===e)return!1;const m=e*t.playerAvgShortPx,h=Object(a.c)(t,e,r.a.Short);if(null==h||isNaN(h)||null==m)return n?u.a.log(n,()=>"Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug"):i.suppressDialog||Object(c.a)("Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug"),!1;let d=h-m;if(isNaN(d)&&(d=0),o.a.gainMoney(h,"stock"),n&&(n.workerScript.scriptRef.onlineMoneyMade+=d,o.a.scriptProdSinceLastAug+=d),t.playerShortShares=Math.round(t.playerShortShares-e),0===t.playerShortShares&&(t.playerAvgShortPx=0),Object(a.d)(t,e),null!=i.rerenderFn&&"function"==typeof i.rerenderFn&&i.rerenderFn(),n){const a=`Sold your short position of ${s.a.formatShares(e)} shares of ${t.symbol}. After commissions, you gained a total of `+s.a.formatMoney(h);u.a.log(n,()=>a)}else i.suppressDialog||Object(c.a)(f.createElement(f.Fragment,null,"Sold your short position of ",s.a.formatShares(e)," shares of ",t.symbol,". After commissions, you gained a total of ",f.createElement(l.a,{money:h})));return!0}},,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(393),r=n(360),i=n(15);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class s{constructor(t=""){o(this,"alreadyInvited",!1),o(this,"augmentations",[]),o(this,"favor",0),o(this,"isBanned",!1),o(this,"isMember",!1),o(this,"name",""),o(this,"playerReputation",0),this.name=t}getInfo(){const t=a.a[this.name];if(null==t)throw new Error(`Missing faction from FactionInfos: ${this.name} this probably means the faction got corrupted somehow`);return t}gainFavor(){null==this.favor&&(this.favor=0),this.favor+=this.getFavorGain()}getFavorGain(){null==this.favor&&(this.favor=0);const t=Math.max(0,Object(r.a)(this.favor))+this.playerReputation;return Object(r.b)(t)-this.favor}toJSON(){return Object(i.b)("Faction",this)}static fromJSON(t){return Object(i.a)(s,t.data)}}i.c.constructors.Faction=s},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new Map},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(15);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t={}){r(this,"name","InitName"),r(this,"qty",0),r(this,"qlt",0),r(this,"dmd",0),r(this,"dmdR",[0,0]),r(this,"cmp",0),r(this,"cmpR",[0,0]),r(this,"mv",0),r(this,"mku",0),r(this,"buy",0),r(this,"sll",0),r(this,"prd",0),r(this,"imp",0),r(this,"exp",[]),r(this,"totalExp",0),r(this,"bCost",0),r(this,"sCost",0),r(this,"prdman",[!1,0]),r(this,"sllman",[!1,0]),r(this,"marketTa1",!1),r(this,"marketTa2",!1),r(this,"marketTa2Price",0),r(this,"maxsll",0),t.name&&(this.name=t.name),this.init()}getMarkupLimit(){return this.qlt/this.mku}init(){switch(this.name){case"Water":this.dmd=75,this.dmdR=[65,85],this.cmp=50,this.cmpR=[40,60],this.bCost=1500,this.mv=.2,this.mku=6;break;case"Energy":this.dmd=90,this.dmdR=[80,99],this.cmp=80,this.cmpR=[65,95],this.bCost=2e3,this.mv=.2,this.mku=6;break;case"Food":this.dmd=80,this.dmdR=[70,90],this.cmp=60,this.cmpR=[35,85],this.bCost=5e3,this.mv=1,this.mku=3;break;case"Plants":this.dmd=70,this.dmdR=[20,90],this.cmp=50,this.cmpR=[30,70],this.bCost=3e3,this.mv=.6,this.mku=3.75;break;case"Metal":this.dmd=80,this.dmdR=[75,85],this.cmp=70,this.cmpR=[60,80],this.bCost=2650,this.mv=1,this.mku=6;break;case"Hardware":this.dmd=85,this.dmdR=[80,90],this.cmp=80,this.cmpR=[65,95],this.bCost=8e3,this.mv=.5,this.mku=1;break;case"Chemicals":this.dmd=55,this.dmdR=[40,70],this.cmp=60,this.cmpR=[40,80],this.bCost=9e3,this.mv=1.2,this.mku=2;break;case"Real Estate":this.dmd=50,this.dmdR=[5,99],this.cmp=50,this.cmpR=[25,75],this.bCost=8e4,this.mv=1.5,this.mku=1.5;break;case"Drugs":this.dmd=60,this.dmdR=[45,75],this.cmp=70,this.cmpR=[40,99],this.bCost=4e4,this.mv=1.6,this.mku=1;break;case"Robots":this.dmd=90,this.dmdR=[80,99],this.cmp=90,this.cmpR=[80,99],this.bCost=75e3,this.mv=.5,this.mku=1;break;case"AI Cores":this.dmd=90,this.dmdR=[80,99],this.cmp=90,this.cmpR=[80,99],this.bCost=15e3,this.mv=.8,this.mku=.5;break;case"Scientific Research":case"InitName":break;default:console.error("Invalid material type in init(): "+this.name)}}processMarket(){const t=1+Math.random()*this.mv/300,e=1+Math.random()*this.mv/100;Math.random()<.5?(this.cmp*=e,this.cmp>this.cmpR[1]&&(this.cmp=this.cmpR[1]),this.bCost*=1/t):(this.cmp*=1/e,this.cmpthis.dmdR[1]&&(this.dmd=this.dmdR[1]),this.bCost*=t):(this.dmd*=1/n,this.dmd{const e=setInterval(()=>{c(e=>(e<=0&&t.onExpire(),e-200/f*100))},200);return()=>{clearInterval(e)}},[]),t.noPaper?i.a.createElement(l.a,{variant:"determinate",value:n,color:"primary"}):i.a.createElement(a.a,{sx:{p:1,mb:1}},i.a.createElement(l.a,{variant:"determinate",value:n,color:"primary"}))}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r}));const a=()=>({hacking_chance:1,hacking_speed:1,hacking_money:1,hacking_grow:1,hacking:1,hacking_exp:1,strength:1,strength_exp:1,defense:1,defense_exp:1,dexterity:1,dexterity_exp:1,agility:1,agility_exp:1,charisma:1,charisma_exp:1,hacknet_node_money:1,hacknet_node_purchase_cost:1,hacknet_node_ram_cost:1,hacknet_node_core_cost:1,hacknet_node_level_cost:1,company_rep:1,faction_rep:1,work_money:1,crime_success:1,crime_money:1,bladeburner_max_stamina:1,bladeburner_stamina_gain:1,bladeburner_analysis:1,bladeburner_success_chance:1}),r=(t,e)=>{var n,a,r,i,o,s,l,c,f,u,m,h,d,p,g,y,b,E,v,k,w,S,_,C,x,L,O,M,A,T;return{hacking_chance:t.hacking_chance*(null!==(n=e.hacking_chance)&&void 0!==n?n:1),hacking_speed:t.hacking_speed*(null!==(a=e.hacking_speed)&&void 0!==a?a:1),hacking_money:t.hacking_money*(null!==(r=e.hacking_money)&&void 0!==r?r:1),hacking_grow:t.hacking_grow*(null!==(i=e.hacking_grow)&&void 0!==i?i:1),hacking:t.hacking*(null!==(o=e.hacking)&&void 0!==o?o:1),hacking_exp:t.hacking_exp*(null!==(s=e.hacking_exp)&&void 0!==s?s:1),strength:t.strength*(null!==(l=e.strength)&&void 0!==l?l:1),strength_exp:t.strength_exp*(null!==(c=e.strength_exp)&&void 0!==c?c:1),defense:t.defense*(null!==(f=e.defense)&&void 0!==f?f:1),defense_exp:t.defense_exp*(null!==(u=e.defense_exp)&&void 0!==u?u:1),dexterity:t.dexterity*(null!==(m=e.dexterity)&&void 0!==m?m:1),dexterity_exp:t.dexterity_exp*(null!==(h=e.dexterity_exp)&&void 0!==h?h:1),agility:t.agility*(null!==(d=e.agility)&&void 0!==d?d:1),agility_exp:t.agility_exp*(null!==(p=e.agility_exp)&&void 0!==p?p:1),charisma:t.charisma*(null!==(g=e.charisma)&&void 0!==g?g:1),charisma_exp:t.charisma_exp*(null!==(y=e.charisma_exp)&&void 0!==y?y:1),hacknet_node_money:t.hacknet_node_money*(null!==(b=e.hacknet_node_money)&&void 0!==b?b:1),hacknet_node_purchase_cost:t.hacknet_node_purchase_cost*(null!==(E=e.hacknet_node_purchase_cost)&&void 0!==E?E:1),hacknet_node_ram_cost:t.hacknet_node_ram_cost*(null!==(v=e.hacknet_node_ram_cost)&&void 0!==v?v:1),hacknet_node_core_cost:t.hacknet_node_core_cost*(null!==(k=e.hacknet_node_core_cost)&&void 0!==k?k:1),hacknet_node_level_cost:t.hacknet_node_level_cost*(null!==(w=e.hacknet_node_level_cost)&&void 0!==w?w:1),company_rep:t.company_rep*(null!==(S=e.company_rep)&&void 0!==S?S:1),faction_rep:t.faction_rep*(null!==(_=e.faction_rep)&&void 0!==_?_:1),work_money:t.work_money*(null!==(C=e.work_money)&&void 0!==C?C:1),crime_success:t.crime_success*(null!==(x=e.crime_success)&&void 0!==x?x:1),crime_money:t.crime_money*(null!==(L=e.crime_money)&&void 0!==L?L:1),bladeburner_max_stamina:t.bladeburner_max_stamina*(null!==(O=e.bladeburner_max_stamina)&&void 0!==O?O:1),bladeburner_stamina_gain:t.bladeburner_stamina_gain*(null!==(M=e.bladeburner_stamina_gain)&&void 0!==M?M:1),bladeburner_analysis:t.bladeburner_analysis*(null!==(A=e.bladeburner_analysis)&&void 0!==A?A:1),bladeburner_success_chance:t.bladeburner_success_chance*(null!==(T=e.bladeburner_success_chance)&&void 0!==T?T:1)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return F}));var a=n(15),r=n(264),i=n(43),o=n(566),s=n(281),l=n(136),c=n(366),f=n(688),u=n(262),m=n(28),h=n(234),d=n(250),p=n(454),g=n(1052),y=n(689),b=n(277),E=n(34),v=n(62),k=n(7),w=n(22),S=n(315),_=n(201),C=n(29),x=n(427),L=n(16),O=n(6),M=n(12),A=n(1053),T=n(105),R=n(5),N=n(30),P=n(383),I=n(351);function D(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class F{constructor(t){D(this,"numHosp",0),D(this,"moneyLost",0),D(this,"rank",0),D(this,"maxRank",0),D(this,"skillPoints",0),D(this,"totalSkillPoints",0),D(this,"teamSize",0),D(this,"sleeveSize",0),D(this,"teamLost",0),D(this,"hpLost",0),D(this,"storedCycles",0),D(this,"randomEventCounter",Object(E.a)(240,600)),D(this,"actionTimeToComplete",0),D(this,"actionTimeCurrent",0),D(this,"actionTimeOverflow",0),D(this,"action",new r.a({type:i.a.Idle})),D(this,"cities",{}),D(this,"city",v.a.CityNames[2]),D(this,"skills",{}),D(this,"skillMultipliers",{}),D(this,"staminaBonus",0),D(this,"maxStamina",0),D(this,"stamina",0),D(this,"contracts",{}),D(this,"operations",{}),D(this,"blackops",{}),D(this,"logging",{general:!0,contracts:!0,ops:!0,blackops:!0,events:!0}),D(this,"automateEnabled",!1),D(this,"automateActionHigh",new r.a({type:i.a.Idle})),D(this,"automateThreshHigh",0),D(this,"automateActionLow",new r.a({type:i.a.Idle})),D(this,"automateThreshLow",0),D(this,"consoleHistory",[]),D(this,"consoleLogs",["Bladeburner Console","Type 'help' to see console commands"]);for(let t=0;tthis.rank)return{error:"Tried to start a Black Operation without the rank requirement"};const n=[];for(const t of Object.keys(s.a))s.a.hasOwnProperty(t)&&n.push(t);n.sort((function(t,e){return s.a[t].reqdRank-s.a[e].reqdRank}));const a=n.indexOf(t.name);return-1===a?{error:`Invalid Black Op: '${name}'`}:a>0&&null==this.blackops[n[a-1]]?{error:`Preceding Black Op must be completed before starting '${t.name}'.`}:{isAvailable:!0,action:e}}startAction(t,e){if(null!=e)switch(this.action=e,this.actionTimeCurrent=0,e.type){case i.a.Idle:this.actionTimeToComplete=0;break;case i.a.Contract:try{const n=this.getActionObject(e);if(null==n)throw new Error("Failed to get Contract Object for: "+e.name);if(n.count<1)return this.resetAction();this.actionTimeToComplete=n.getActionTime(this,t)}catch(t){Object(b.a)(t)}break;case i.a.Operation:try{const n=this.getActionObject(e);if(null==n)throw new Error("Failed to get Operation Object for: "+e.name);if(n.count<1)return this.resetAction();if("Raid"===e.name&&0===this.getCurrentCity().comms)return this.resetAction();this.actionTimeToComplete=n.getActionTime(this,t)}catch(t){Object(b.a)(t)}break;case i.a.BlackOp:case i.a.BlackOperation:try{const n=this.canAttemptBlackOp(e);if(!n.isAvailable){this.resetAction(),this.log("Error: "+n.error);break}if(void 0===n.action)throw new Error("action should not be null");this.actionTimeToComplete=n.action.getActionTime(this,t)}catch(t){Object(b.a)(t)}break;case i.a.Recruitment:this.actionTimeToComplete=this.getRecruitmentTime(t);break;case i.a.Training:case i.a.FieldAnalysis:case i.a["Field Analysis"]:this.actionTimeToComplete=30;break;case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:this.actionTimeToComplete=60;break;default:throw new Error("Invalid Action Type in startAction(Bladeburner,player, ): "+e.type)}}upgradeSkill(t,e=1){const n=t.name;if(this.skills[n]?this.skills[n]+=e:this.skills[n]=e,isNaN(this.skills[n])||this.skills[n]<0)throw new Error("Level of Skill "+n+" is invalid: "+this.skills[n]);this.updateSkillMultipliers()}executeConsoleCommands(t,e){try{this.consoleHistory[this.consoleHistory.length-1]!=e&&(this.consoleHistory.push(e),this.consoleHistory.length>50&&this.consoleHistory.splice(0,1));const n=e.split(";");for(let e=0;e100&&this.consoleLogs.shift())}log(t){this.postToConsole(`[${Object(A.a)()}] ${t}`)}resetAction(){this.action=new r.a({type:i.a.Idle}),this.actionTimeCurrent=0,this.actionTimeToComplete=0}clearConsole(){this.consoleLogs.length=0}prestige(){this.resetAction();const t=C.a[R.a.Bladeburners];this.rank>=v.a.RankNeededForFaction&&Object(T.d)(t)}storeCycles(t=0){this.storedCycles+=t}getActionIdFromTypeAndName(t="",e=""){if(""===t||""===e)return null;const n=new r.a,a=t.toLowerCase().trim(),o=e.toLowerCase().trim();switch(a){case"contract":case"contracts":case"contr":return n.type=i.a.Contract,this.contracts.hasOwnProperty(e)?(n.name=e,n):null;case"operation":case"operations":case"op":case"ops":return n.type=i.a.Operation,this.operations.hasOwnProperty(e)?(n.name=e,n):null;case"blackoperation":case"black operation":case"black operations":case"black op":case"black ops":case"blackop":case"blackops":return n.type=i.a.BlackOp,s.a.hasOwnProperty(e)?(n.name=e,n):null;case"general":case"general action":case"gen":break;default:return null}if(a.startsWith("gen")){switch(o){case"training":n.type=i.a.Training,n.name="Training";break;case"recruitment":case"recruit":n.type=i.a.Recruitment,n.name="Recruitment";break;case"field analysis":case"fieldanalysis":n.type=i.a["Field Analysis"],n.name="Field Analysis";break;case"diplomacy":n.type=i.a.Diplomacy,n.name="Diplomacy";break;case"hyperbolic regeneration chamber":n.type=i.a["Hyperbolic Regeneration Chamber"],n.name="Hyperbolic Regeneration Chamber";break;case"incite violence":n.type=i.a["Incite Violence"],n.name="Incite Violence";break;default:return null}return n}return null}executeStartConsoleCommand(t,e){if(3!==e.length)return this.postToConsole("Invalid usage of 'start' console command: start [type] [name]"),void this.postToConsole("Use 'help start' for more info");const n=e[2];switch(e[1].toLowerCase()){case"general":case"gen":null!=u.a[n]?(this.action.type=i.a[n],this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid action name specified: "+e[2]);break;case"contract":case"contracts":null!=this.contracts[n]?(this.action.type=i.a.Contract,this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid contract name specified: "+e[2]);break;case"ops":case"op":case"operations":case"operation":null!=this.operations[n]?(this.action.type=i.a.Operation,this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid Operation name specified: "+e[2]);break;case"blackops":case"blackop":case"black operations":case"black operation":null!=s.a[n]?(this.action.type=i.a.BlackOperation,this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid BlackOp name specified: "+e[2]);break;default:this.postToConsole("Invalid action/event type specified: "+e[1]),this.postToConsole("Examples of valid action/event identifiers are: [general, contract, op, blackop]")}}executeSkillConsoleCommand(t){switch(t.length){case 1:this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info");break;case 2:if("list"===t[1].toLowerCase()){this.postToConsole("Skills: ");const t=Object.keys(h.a);for(let e=0;e=n.maxLvl?this.postToConsole(`This skill ${n.name} is already at max level (${t}/${n.maxLvl}).`):this.skillPoints>=a?(this.skillPoints-=a,this.upgradeSkill(n),this.log(n.name+" upgraded to Level "+this.skills[e])):this.postToConsole("You do not have enough Skill Points to upgrade this. You need "+Object(m.d)(a,0))}else this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info");break}default:this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info")}}executeLogConsoleCommand(t){if(t.length<3)return this.postToConsole("Invalid usage of log command: log [enable/disable] [action/event]"),void this.postToConsole("Use 'help log' for more details and examples");let e=!0;switch(t[1].toLowerCase().includes("d")&&(e=!1),t[2].toLowerCase()){case"general":case"gen":this.logging.general=e,this.log("Logging "+(e?"enabled":"disabled")+" for general actions");break;case"contract":case"contracts":this.logging.contracts=e,this.log("Logging "+(e?"enabled":"disabled")+" for Contracts");break;case"ops":case"op":case"operations":case"operation":this.logging.ops=e,this.log("Logging "+(e?"enabled":"disabled")+" for Operations");break;case"blackops":case"blackop":case"black operations":case"black operation":this.logging.blackops=e,this.log("Logging "+(e?"enabled":"disabled")+" for BlackOps");break;case"event":case"events":this.logging.events=e,this.log("Logging "+(e?"enabled":"disabled")+" for events");break;case"all":this.logging.general=e,this.logging.contracts=e,this.logging.ops=e,this.logging.blackops=e,this.logging.events=e,this.log("Logging "+(e?"enabled":"disabled")+" for everything");break;default:this.postToConsole("Invalid action/event type specified: "+t[2]),this.postToConsole("Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]")}}executeHelpConsoleCommand(t){if(1===t.length)for(const t of y.a.helpList)this.postToConsole(t);else for(let e=1;e0&&(i*=Object(E.a)(2,4),--a.comms,++n.comms);const o=Math.round(a.pop*i);a.pop-=o,n.pop+=o}triggerPotentialMigration(t,e){(null==e||isNaN(e))&&console.error("Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()"),e>1&&(e/=100),Math.random()=1){let r;r=t?Math.ceil(a/2):Math.floor(a);const i=Object(E.a)(0,r);if(this.teamSize-=i,this.teamSizeObject(I.b)(t.currentWork));for(let e=0;e>this.teamSize-this.sleeveSize;e--){const e=Math.floor(Math.random()*t.length);t[e].takeDamage(t[e].hp.max),t.splice(e,1)}this.teamSize+=this.sleeveSize}this.teamLost+=i,this.logging.ops&&i>0&&this.log("Lost "+Object(m.d)(i,0)+" team members during this "+n.name)}const r=this.getCurrentCity();switch(n.name){case"Investigation":t?r.improvePopulationEstimateByPercentage(.4*this.skillMultipliers.successChanceEstimate):this.triggerPotentialMigration(this.city,.1);break;case"Undercover Operation":t?r.improvePopulationEstimateByPercentage(.8*this.skillMultipliers.successChanceEstimate):this.triggerPotentialMigration(this.city,.15);break;case"Sting Operation":t&&r.changePopulationByPercentage(-.1,{changeEstEqually:!0,nonZero:!0}),r.changeChaosByCount(.1);break;case"Raid":if(t)r.changePopulationByPercentage(-1,{changeEstEqually:!0,nonZero:!0}),--r.comms;else{const t=Object(E.a)(-10,-5)/10;r.changePopulationByPercentage(t,{nonZero:!0,changeEstEqually:!1})}r.changeChaosByPercentage(Object(E.a)(1,5));break;case"Stealth Retirement Operation":t&&r.changePopulationByPercentage(-.5,{changeEstEqually:!0,nonZero:!0}),r.changeChaosByPercentage(Object(E.a)(-3,-1));break;case"Assassination":t&&r.changePopulationByCount(-1,{estChange:-1,estOffset:0}),r.changeChaosByPercentage(Object(E.a)(-5,5));break;default:throw new Error("Invalid Action name in completeOperation: "+this.action.name)}}getActionObject(t){switch(t.type){case i.a.Contract:return this.contracts[t.name];case i.a.Operation:return this.operations[t.name];case i.a.BlackOp:case i.a.BlackOperation:return s.a[t.name];case i.a.Training:return u.a.Training;case i.a["Field Analysis"]:return u.a["Field Analysis"];case i.a.Recruitment:return u.a.Recruitment;case i.a.Diplomacy:return u.a.Diplomacy;case i.a["Hyperbolic Regeneration Chamber"]:return u.a["Hyperbolic Regeneration Chamber"];case i.a["Incite Violence"]:return u.a["Incite Violence"];default:return null}}completeContract(t,e){if(e.type!==i.a.Contract)throw new Error("completeContract() called even though current action is not a Contract");const n=this.getCurrentCity();if(t)switch(e.name){case"Tracking":n.improvePopulationEstimateByCount(Object(E.a)(100,1e3));break;case"Bounty Hunter":n.changePopulationByCount(-1,{estChange:-1,estOffset:0}),n.changeChaosByCount(.02);break;case"Retirement":n.changePopulationByCount(-1,{estChange:-1,estOffset:0}),n.changeChaosByCount(.04);break;default:throw new Error("Invalid Action name in completeContract: "+e.name)}}completeAction(t,e,n,a=!0){let r=Object(g.a)();switch(n.type){case i.a.Contract:case i.a.Operation:try{const o=n.type===i.a.Operation,s=this.getActionObject(n);if(null==s)throw new Error("Failed to get Contract/Operation Object for: "+n.name);const l=s.getDifficulty(),c=Math.pow(l,v.a.DiffMultExponentialFactor)+l/v.a.DiffMultLinearFactor,f=Math.pow(s.rewardFac,s.level-1);if(a&&(this.stamina-=v.a.BaseStaminaLoss*c,this.stamina<0&&(this.stamina=0)),s.attempt(this,e)){r=this.getActionStats(s,e,!0),++s.successes,--s.count;let a=0;if(o||(a=v.a.ContractBaseMoneyGain*f*this.skillMultipliers.money,r.money=a),o?s.setMaxLevel(v.a.OperationSuccessesPerLevel):s.setMaxLevel(v.a.ContractSuccessesPerLevel),s.rankGain){const t=Object(S.a)(s.rankGain*f*w.a.BladeburnerRank,10);this.changeRank(e,t),o&&this.logging.ops?this.log(e.whoAmI()+": "+s.name+" successfully completed! Gained "+Object(m.d)(t,3)+" rank"):!o&&this.logging.contracts&&this.log(e.whoAmI()+": "+s.name+" contract successfully completed! Gained "+Object(m.d)(t,3)+" rank and "+k.a.formatMoney(a))}o?this.completeOperation(!0,t):this.completeContract(!0,n)}else{r=this.getActionStats(s,e,!1),++s.failures;let a=0,i=0;if(s.rankLoss&&(a=Object(S.a)(s.rankLoss*f,10),this.changeRank(e,-1*a)),s.hpLoss){i=s.hpLoss*c,i=Math.ceil(Object(S.a)(i,10)),this.hpLost+=i;const n=Object(x.a)(t,i);e.takeDamage(i)&&(++this.numHosp,this.moneyLost+=n)}let l="";a>0&&(l+="Lost "+Object(m.d)(a,3)+" rank. "),i>0&&(l+="Took "+Object(m.d)(i,0)+" damage."),o&&this.logging.ops?this.log(e.whoAmI()+": "+s.name+" failed! "+l):!o&&this.logging.contracts&&this.log(e.whoAmI()+": "+s.name+" contract failed! "+l),o?this.completeOperation(!1,t):this.completeContract(!1,n)}s.autoLevel&&(s.level=s.maxLevel)}catch(t){Object(b.a)(t)}break;case i.a.BlackOp:case i.a.BlackOperation:try{const a=this.getActionObject(n);if(null==a||!(a instanceof l.a))throw new Error("Failed to get BlackOperation Object for: "+n.name);const i=a.getDifficulty(),o=Math.pow(i,v.a.DiffMultExponentialFactor)+i/v.a.DiffMultLinearFactor;this.stamina-=v.a.BaseStaminaLoss*o,this.stamina<0&&(this.stamina=0);const s=a.teamCount;let c;if(a.attempt(this,e)){r=this.getActionStats(a,e,!0),a.count=0,this.blackops[a.name]=!0;let t=0;a.rankGain&&(t=Object(S.a)(a.rankGain*w.a.BladeburnerRank,10),this.changeRank(e,t)),c=Math.ceil(s/2),this.logging.blackops&&this.log(e.whoAmI()+": "+a.name+" successful! Gained "+Object(m.d)(t,1)+" rank")}else{r=this.getActionStats(a,e,!1);let n=0,i=0;if(a.rankLoss&&(n=Object(S.a)(a.rankLoss,10),this.changeRank(e,-1*n)),a.hpLoss){i=a.hpLoss*o,i=Math.ceil(Object(S.a)(i,10));const n=Object(x.a)(t,i);e.takeDamage(i)&&(++this.numHosp,this.moneyLost+=n)}c=Math.floor(s),this.logging.blackops&&this.log(e.whoAmI()+": "+a.name+" failed! Lost "+Object(m.d)(n,1)+" rank and took "+Object(m.d)(i,0)+" damage")}if(this.resetAction(),s>=1){const n=Object(E.a)(1,c);if(this.teamSize-=n,this.teamSizeObject(I.b)(t.currentWork));for(let t=0;t>this.teamSize-this.sleeveSize;t--){const t=Math.floor(Math.random()*e.length);e[t].takeDamage(e[t].hp.max),e.splice(t,1)}this.teamSize+=this.sleeveSize}this.teamLost+=n,this.logging.blackops&&this.log(`${e.whoAmI()}: You lost ${Object(m.d)(n,0)} team members during ${a.name}`)}}catch(t){Object(b.a)(String(t))}break;case i.a.Training:{this.stamina-=.5*v.a.BaseStaminaLoss;const t=30*e.mults.strength_exp,n=30*e.mults.defense_exp,a=30*e.mults.dexterity_exp,i=30*e.mults.agility_exp,o=.04*this.skillMultipliers.stamina;r.str=t,r.def=n,r.dex=a,r.agi=i,this.staminaBonus+=o,this.logging.general&&this.log(e.whoAmI()+": Training completed. Gained: "+Object(m.d)(t,1)+" str exp, "+Object(m.d)(n,1)+" def exp, "+Object(m.d)(a,1)+" dex exp, "+Object(m.d)(i,1)+" agi exp, "+Object(m.d)(o,3)+" max stamina");break}case i.a.FieldAnalysis:case i.a["Field Analysis"]:{let t=.04*Math.pow(e.skills.hacking,.3)+.04*Math.pow(e.skills.intelligence,.9)+.02*Math.pow(e.skills.charisma,.3);if(t*=e.mults.bladeburner_analysis,isNaN(t)||t<0)throw new Error("Field Analysis Effectiveness calculated to be NaN or negative");const n=20*e.mults.hacking_exp,a=20*e.mults.charisma_exp,i=.1*w.a.BladeburnerRank;r.hack=n,r.cha=a,r.int=v.a.BaseIntGain,this.changeRank(e,i),this.getCurrentCity().improvePopulationEstimateByPercentage(t*this.skillMultipliers.successChanceEstimate),this.logging.general&&this.log(e.whoAmI()+": "+`Field analysis completed. Gained ${Object(m.d)(i,2)} rank, `+Object(m.d)(n,1)+" hacking exp, and "+Object(m.d)(a,1)+" charisma exp");break}case i.a.Recruitment:{const t=this.getRecruitmentSuccessChance(e),n=1e3*this.getRecruitmentTime(e);if(Math.random()Object(P.b)(t.currentWork)).length,n=Math.pow(e,-.5)/2;for(const t of Object.keys(this.contracts))this.contracts[t].count+=n;for(const t of Object.keys(this.operations))this.operations[t].count+=n;this.logging.general&&this.log("Sleeve: Infiltrate the synthoid communities.")}changeRank(t,e){if(isNaN(e))throw new Error("NaN passed into Bladeburner.changeRank()");this.rank+=e,this.rank<0&&(this.rank=0),this.maxRank=Math.max(this.rank,this.maxRank);const n=R.a.Bladeburners;if(Object(C.b)(n)){const a=C.a[n];if(!(a instanceof _.a))throw new Error(`Could not properly get ${R.a.Bladeburners} Faction object in ${R.a.Bladeburners} UI Overview Faction button`);if(a.isMember){const n=1+a.favor/100;a.playerReputation+=v.a.RankToFactionRepFactor*e*t.mults.faction_rep*n}}const a=(this.totalSkillPoints+1)*v.a.RanksPerSkillPoint;if(this.maxRank>=a){const t=Math.floor((this.maxRank-a)/v.a.RanksPerSkillPoint+1);this.skillPoints+=t,this.totalSkillPoints+=t}}processAction(t,e,n){if(this.action.type!==i.a.Idle){if(this.actionTimeToComplete<=0)throw new Error(`Invalid actionTimeToComplete value: ${this.actionTimeToComplete}, type; ${this.action.type}`);if(!(this.action instanceof r.a))throw new Error("Bladeburner.action is not an ActionIdentifier Object");if(this.actionTimeCurrent+=n+this.actionTimeOverflow,this.actionTimeOverflow=0,this.actionTimeCurrent>=this.actionTimeToComplete){this.actionTimeOverflow=this.actionTimeCurrent-this.actionTimeToComplete;const t=this.getActionObject(this.action),n=this.completeAction(e,e,this.action);if(e.gainMoney(n.money,"bladeburner"),e.gainStats(n),null==t)throw new Error("Failed to get BlackOperation Object for: "+this.action.name);this.action.type!=i.a.BlackOperation&&this.action.type!=i.a.BlackOp&&this.startAction(e,this.action)}}}calculateStaminaGainPerSecond(t){const e=t.skills.agility*this.skillMultipliers.effAgi,n=this.maxStamina/v.a.MaxStaminaToGainFactor;return(v.a.StaminaGainPerSecond+n)*Math.pow(e,.17)*(this.skillMultipliers.stamina*t.mults.bladeburner_stamina_gain)}calculateMaxStamina(t){const e=t.skills.agility*this.skillMultipliers.effAgi,n=(Math.pow(e,.8)+this.staminaBonus)*this.skillMultipliers.stamina*t.mults.bladeburner_max_stamina;if(this.maxStamina!==n){const t=this.maxStamina;this.maxStamina=n,this.stamina=this.maxStamina*this.stamina/t}if(isNaN(n))throw new Error("Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()")}create(){this.contracts.Tracking=new f.a({name:"Tracking",baseDifficulty:125,difficultyFac:1.02,rewardFac:1.041,rankGain:.3,hpLoss:.5,count:Object(E.a)(25,150),weights:{hack:0,str:.05,def:.05,dex:.35,agi:.35,cha:.1,int:.05},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.9,int:1},isStealth:!0}),this.contracts["Bounty Hunter"]=new f.a({name:"Bounty Hunter",baseDifficulty:250,difficultyFac:1.04,rewardFac:1.085,rankGain:.9,hpLoss:1,count:Object(E.a)(5,150),weights:{hack:0,str:.15,def:.15,dex:.25,agi:.25,cha:.1,int:.1},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.8,int:.9},isKill:!0}),this.contracts.Retirement=new f.a({name:"Retirement",baseDifficulty:200,difficultyFac:1.03,rewardFac:1.065,rankGain:.6,hpLoss:1,count:Object(E.a)(5,150),weights:{hack:0,str:.2,def:.2,dex:.2,agi:.2,cha:.1,int:.1},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.8,int:.9},isKill:!0}),this.operations.Investigation=new c.a({name:"Investigation",baseDifficulty:400,difficultyFac:1.03,rewardFac:1.07,reqdRank:25,rankGain:2.2,rankLoss:.2,count:Object(E.a)(1,100),weights:{hack:.25,str:.05,def:.05,dex:.2,agi:.1,cha:.25,int:.1},decays:{hack:.85,str:.9,def:.9,dex:.9,agi:.9,cha:.7,int:.9},isStealth:!0}),this.operations["Undercover Operation"]=new c.a({name:"Undercover Operation",baseDifficulty:500,difficultyFac:1.04,rewardFac:1.09,reqdRank:100,rankGain:4.4,rankLoss:.4,hpLoss:2,count:Object(E.a)(1,100),weights:{hack:.2,str:.05,def:.05,dex:.2,agi:.2,cha:.2,int:.1},decays:{hack:.8,str:.9,def:.9,dex:.9,agi:.9,cha:.7,int:.9},isStealth:!0}),this.operations["Sting Operation"]=new c.a({name:"Sting Operation",baseDifficulty:650,difficultyFac:1.04,rewardFac:1.095,reqdRank:500,rankGain:5.5,rankLoss:.5,hpLoss:2.5,count:Object(E.a)(1,150),weights:{hack:.25,str:.05,def:.05,dex:.25,agi:.1,cha:.2,int:.1},decays:{hack:.8,str:.85,def:.85,dex:.85,agi:.85,cha:.7,int:.9},isStealth:!0}),this.operations.Raid=new c.a({name:"Raid",baseDifficulty:800,difficultyFac:1.045,rewardFac:1.1,reqdRank:3e3,rankGain:55,rankLoss:2.5,hpLoss:50,count:Object(E.a)(1,150),weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.7,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.9},isKill:!0}),this.operations["Stealth Retirement Operation"]=new c.a({name:"Stealth Retirement Operation",baseDifficulty:1e3,difficultyFac:1.05,rewardFac:1.11,reqdRank:2e4,rankGain:22,rankLoss:2,hpLoss:10,count:Object(E.a)(1,150),weights:{hack:.1,str:.1,def:.1,dex:.3,agi:.3,cha:0,int:.1},decays:{hack:.7,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.9},isStealth:!0,isKill:!0}),this.operations.Assassination=new c.a({name:"Assassination",baseDifficulty:1500,difficultyFac:1.06,rewardFac:1.14,reqdRank:5e4,rankGain:44,rankLoss:4,hpLoss:5,count:Object(E.a)(1,150),weights:{hack:.1,str:.1,def:.1,dex:.3,agi:.3,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.8},isStealth:!0,isKill:!0})}process(t,e){if(t.isInitialized){if(!e.hasAugmentation(M.a.BladesSimulacrum,!0)&&e.currentWork){if(this.action.type!==i.a.Idle){let t="Your Bladeburner action was cancelled because you started doing something else.";this.automateEnabled&&(t+="

Your automation was disabled as well. You will have to re-enable it through the Bladeburner console",this.automateEnabled=!1),O.a.SuppressBladeburnerPopup||Object(L.a)(t)}this.resetAction()}if(this.stamina<=0&&(this.log("Your Bladeburner action was cancelled because your stamina hit 0"),this.resetAction()),this.storedCycles>=v.a.CyclesPerSecond){let n=Math.floor(this.storedCycles/v.a.CyclesPerSecond);n=Math.min(n,5),this.storedCycles-=n*v.a.CyclesPerSecond,this.calculateMaxStamina(e),this.stamina+=this.calculateStaminaGainPerSecond(e)*n,this.stamina=Math.min(this.maxStamina,this.stamina);for(const t of Object.values(this.contracts)){const e=o.a[t.name];if(void 0===e)throw new Error(`growth formula for action '${t.name}' is undefined`);t.count+=n*e()/v.a.ActionCountGrowthPeriod}for(const t of Object.values(this.operations)){const e=o.a[t.name];if(void 0===e)throw new Error(`growth formula for action '${t.name}' is undefined`);void 0!==e&&(t.count+=n*e()/v.a.ActionCountGrowthPeriod)}for(const t of v.a.CityNames){const e=this.cities[t];if(!(e instanceof p.a))throw new Error("Invalid City object when processing passive chaos reduction in Bladeburner.process");e.chaos-=1e-4*n,e.chaos=Math.max(0,e.chaos)}this.randomEventCounter-=n,this.randomEventCounter<=0&&(this.randomEvent(),this.randomEventCounter+=Object(E.a)(240,600)),this.processAction(t,e,n),this.automateEnabled&&(this.stamina<=this.automateThreshLow?this.action.name===this.automateActionLow.name&&this.action.type===this.automateActionLow.type||(this.action=new r.a({type:this.automateActionLow.type,name:this.automateActionLow.name}),this.startAction(e,this.action)):this.stamina>=this.automateThreshHigh&&(this.action.name===this.automateActionHigh.name&&this.action.type===this.automateActionHigh.type||(this.action=new r.a({type:this.automateActionHigh.type,name:this.automateActionHigh.name}),this.startAction(e,this.action))))}}}getTypeAndNameFromActionId(t){const e={type:"",name:""},n=Object.keys(i.a);for(let a=0;ar),!1;if(o.type===i.a.BlackOp){const t=this.canAttemptBlackOp(o);if(!t.isAvailable)return a.log("bladeburner.startAction",()=>t.error+""),!1}try{return this.startAction(t,o),a.log("bladeburner.startAction",()=>`Starting bladeburner action with type '${e}' and name '${n}'`),!0}catch(t){return console.error(t),this.resetAction(),a.log("bladeburner.startAction",()=>r),!1}}getActionTimeNetscriptFn(t,e,n){const a=this.getActionIdFromTypeAndName(e,n);if(null==a)return"bladeburner.getActionTime";const r=this.getActionObject(a);if(null==r)return"bladeburner.getActionTime";switch(a.type){case i.a.Contract:case i.a.Operation:case i.a.BlackOp:case i.a.BlackOperation:return 1e3*r.getActionTime(this,t);case i.a.Training:case i.a["Field Analysis"]:case i.a.FieldAnalysis:return 3e4;case i.a.Recruitment:return 1e3*this.getRecruitmentTime(t);case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:return 6e4;default:return"bladeburner.getActionTime"}}getActionEstimatedSuccessChanceNetscriptFn(t,e,n){const a=this.getActionIdFromTypeAndName(e,n);if(null==a)return"bladeburner.getActionEstimatedSuccessChance";const r=this.getActionObject(a);if(null==r)return"bladeburner.getActionEstimatedSuccessChance";switch(a.type){case i.a.Contract:case i.a.Operation:case i.a.BlackOp:case i.a.BlackOperation:return r.getEstSuccessChance(this,t);case i.a.Training:case i.a["Field Analysis"]:case i.a.FieldAnalysis:case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:return[1,1];case i.a.Recruitment:{const e=this.getRecruitmentSuccessChance(t);return[e,e]}default:return"bladeburner.getActionEstimatedSuccessChance"}}getActionCountRemainingNetscriptFn(t,e,n){const a=`Invalid action: type='${t}' name='${e}'`,r=this.getActionIdFromTypeAndName(t,e);if(null==r)return n.log("bladeburner.getActionCountRemaining",()=>a),-1;const o=this.getActionObject(r);if(null==o)return n.log("bladeburner.getActionCountRemaining",()=>a),-1;switch(r.type){case i.a.Contract:case i.a.Operation:return Math.floor(o.count);case i.a.BlackOp:case i.a.BlackOperation:return null!=this.blackops[e]?0:1;case i.a.Training:case i.a.Recruitment:case i.a["Field Analysis"]:case i.a.FieldAnalysis:case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:return 1/0;default:return n.log("bladeburner.getActionCountRemaining",()=>a),-1}}getSkillLevelNetscriptFn(t,e){return""!==t&&h.a.hasOwnProperty(t)?null==this.skills[t]?0:this.skills[t]:(e.log("bladeburner.getSkillLevel",()=>`Invalid skill: '${t}'`),-1)}getSkillUpgradeCostNetscriptFn(t,e,n){if(""===t||!h.a.hasOwnProperty(t))return n.log("bladeburner.getSkillUpgradeCost",()=>`Invalid skill: '${t}'`),-1;const a=h.a[t];return null==this.skills[t]?a.calculateCost(0,e):a.calculateCost(this.skills[t],e)}upgradeSkillNetscriptFn(t,e,n){const a=`Invalid skill: '${t}'`;if(!h.a.hasOwnProperty(t))return n.log("bladeburner.upgradeSkill",()=>a),!1;const r=h.a[t];let i=0;this.skills[t]&&!isNaN(this.skills[t])&&(i=this.skills[t]);const o=r.calculateCost(i,e);return r.maxLvl&&i+e>r.maxLvl?(n.log("bladeburner.upgradeSkill",()=>`Skill '${t}' cannot be upgraded ${e} time(s).`),!1):this.skillPoints`You do not have enough skill points to upgrade ${t} ${e} time(s). (You have ${this.skillPoints}, you need ${o})`),!1):(this.skillPoints-=o,this.upgradeSkill(r,e),n.log("bladeburner.upgradeSkill",()=>`'${t}' upgraded to level ${this.skills[t]}`),!0)}getTeamSizeNetscriptFn(t,e,n){if(""===t&&""===e)return this.teamSize;const a=`Invalid action: type='${t}' name='${e}'`,r=this.getActionIdFromTypeAndName(t,e);if(null==r)return n.log("bladeburner.getTeamSize",()=>a),-1;const o=this.getActionObject(r);return null==o?(n.log("bladeburner.getTeamSize",()=>a),-1):r.type===i.a.Operation||r.type===i.a.BlackOp||r.type===i.a.BlackOperation?o.teamCount:0}setTeamSizeNetscriptFn(t,e,n,a){const r=`Invalid action: type='${t}' name='${e}'`,o=this.getActionIdFromTypeAndName(t,e);if(null==o)return a.log("bladeburner.setTeamSize",()=>r),-1;if(o.type!==i.a.Operation&&o.type!==i.a.BlackOp&&o.type!==i.a.BlackOperation)return a.log("bladeburner.setTeamSize",()=>"Only valid for 'Operations' and 'BlackOps'"),-1;const s=this.getActionObject(o);if(null==s)return a.log("bladeburner.setTeamSize",()=>r),-1;let l=Math.round(n);return isNaN(l)||l<0?(a.log("bladeburner.setTeamSize",()=>"Invalid size: "+n),-1):(this.teamSize`Team size for '${e}' set to ${l}.`),l)}joinBladeburnerFactionNetscriptFn(t){const e=C.a[R.a.Bladeburners];return!!e.isMember||(this.rank>=v.a.RankNeededForFaction?(Object(T.d)(e),t.log("bladeburner.joinBladeburnerFaction",()=>`Joined ${R.a.Bladeburners} faction.`),!0):(t.log("bladeburner.joinBladeburnerFaction",()=>`You do not have the required rank (${this.rank}/${v.a.RankNeededForFaction}).`),!1))}toJSON(){return Object(a.b)("Bladeburner",this)}static fromJSON(t){return Object(a.a)(F,t.data)}}a.c.constructors.Bladeburner=F},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return c}));var a=n(22),r=n(41);function i(t,e,n,i){return t*r.a.MoneyGainPerLevel*Math.pow(1.035,e-1)*((n+5)/6)*i*a.a.HacknetNodeMoney}function o(t,e=1,n=1){const a=Math.round(e);if(isNaN(a)||a<1)return 0;if(t>=r.a.MaxLevel)return 1/0;const i=r.a.UpgradeLevelMult;let o=0,s=t;for(let t=0;t=r.a.MaxRam)return 1/0;let i=0,o=Math.round(Math.log2(t)),s=t;for(let t=0;t=r.a.MaxCores)return 1/0;const i=r.a.CoreBaseCost,o=r.a.UpgradeCoreMult;let s=0,l=t;for(let t=0;t1e10;return e&&Object(r.a)(a.createElement(a.Fragment,null,"Alright cheater get out of here. You're not allowed here anymore.")),e}class s extends a.Component{win(t,e){t.gainMoney(e,"casino")}reachedLimit(t){const e=t.getCasinoWinnings()>1e10;return e&&Object(r.a)(a.createElement(a.Fragment,null,"Alright cheater get out of here. You're not allowed here anymore.")),e}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const a=!1,r=!0,i={O:[[r,r],[r,r]],I:[[r,r,r,r]],L:[[a,a,r],[r,r,r]],J:[[r,a,a],[r,r,r]],S:[[a,r,r],[r,r,a]],Z:[[r,r,a],[a,r,r]],T:[[r,r,r],[a,r,a]]}},,,,,function(t,e,n){"use strict";function a(t,e,n){function a(t,e,a){function r(t,e,n){return(1-n)*t+n*e}for(const i of Object.keys(t))n[i]=r(t[i],e[i],a);return t}return e<0?a(t.Trivial,t.Trivial,0):e>=0&&e<1?a(t.Trivial,t.Normal,e):e>=1&&e<2?a(t.Normal,t.Hard,e-1):e>=2&&e<3?a(t.Hard,t.Impossible,e-2):a(t.Impossible,t.Impossible,0)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);function i(t){return Object(a.useEffect)(()=>{function e(e){if(!e.isTrusted)return;t.onKeyDown.bind(this)(e)}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),r.a.createElement(r.a.Fragment,null)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(153),o=n(15),s=n(5),l=n(29),c=n(90),f=n(16),u=n(144),m=n(13),h=n(12),d=n(394),p=n(108);const g=t=>null!==t&&t.type===i.b.FACTION;class y extends i.a{constructor(t){var e,n,a;super(i.b.FACTION,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.factionWorkType=null!==(n=null==t?void 0:t.factionWorkType)&&void 0!==n?n:p.a.HACKING,this.factionName=null!==(a=null==t?void 0:t.faction)&&void 0!==a?a:s.a.Sector12}getFaction(){const t=l.a[this.factionName];if(!t)throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);return t}getReputationRate(t){let e=1;return t.hasAugmentation(h.a.NeuroreceptorManager)||(e=t.focus?1:m.a.BaseFocusBonus),Object(d.b)(t,this.factionWorkType,this.getFaction().favor)*e}getExpRates(t){let e=1;t.hasAugmentation(h.a.NeuroreceptorManager)||(e=t.focus?1:m.a.BaseFocusBonus);const n=Object(d.a)(t,this.factionWorkType);return Object(c.d)(n,e,!1)}process(t,e){this.cyclesWorked+=e,this.getFaction().playerReputation+=this.getReputationRate(t)*e;const n=this.getExpRates(t);return Object(c.a)(t,t,n,e,"class"),!1}finish(){this.singularity||Object(f.a)(r.a.createElement(r.a.Fragment,null,"You worked for ",this.getFaction().name,".",r.a.createElement("br",null),"They now have a total of ",r.a.createElement(u.a,{reputation:this.getFaction().playerReputation})," reputation."))}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,factionWorkType:this.factionWorkType,factionName:this.factionName}}toJSON(){return Object(o.b)("FactionWork",this)}static fromJSON(t){return Object(o.a)(y,t.data)}}o.c.constructors.FactionWork=y},,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({money:{color:t.colors.money}}));function l({hashes:t}){const e=s();return a.createElement("span",{className:e.money},"number"==typeof t?r.a.formatHashes(t):t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(13),r=n(216),i=n(41),o=n(16),s=n(15),l=n(403);function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f{constructor(t="",e=1){c(this,"cores",1),c(this,"level",1),c(this,"moneyGainRatePerSecond",0),c(this,"onlineTimeSeconds",0),c(this,"ram",1),c(this,"totalMoneyGenerated",0),this.name=t,this.updateMoneyGainRate(e)}calculateCoreUpgradeCost(t=1,e){return Object(r.a)(this.cores,t,e)}calculateLevelUpgradeCost(t=1,e){return Object(r.b)(this.level,t,e)}calculateRamUpgradeCost(t=1,e){return Object(r.e)(this.ram,t,e)}process(t=1){const e=t*a.a.MilliPerCycle/1e3;let n=this.moneyGainRatePerSecond*e;return isNaN(n)&&(console.error(`Hacknet Node ${this.name} calculated earnings of NaN`),n=0),this.totalMoneyGenerated+=n,this.onlineTimeSeconds+=e,n}upgradeCore(t=1,e){this.cores=Math.min(i.a.MaxCores,Math.round(this.cores+t)),this.updateMoneyGainRate(e)}upgradeLevel(t=1,e){this.level=Math.min(i.a.MaxLevel,Math.round(this.level+t)),this.updateMoneyGainRate(e)}upgradeRam(t=1,e){for(let e=0;eu())return 1/0;const n=Math.max(0,Math.log(e)/Math.log(2)-6);return e*o.a.BaseCostFor1GBOfRamServer*i.a.PurchasedServerCost*Math.pow(i.a.PurchasedServerSoftcap,n)}function f(){return Math.round(o.a.PurchasedServerLimit*i.a.PurchasedServerLimit)}function u(){const t=Math.round(o.a.PurchasedServerMaxRam*i.a.PurchasedServerMaxRam);return 1<<31-Math.clz32(t)}function m(t,e,n,i){if(!i.canAfford(n))return void Object(s.a)("You don't have enough money to purchase this server!");if(i.purchasedServers.length>=f())return void Object(s.a)("You have reached the maximum limit of "+f()+" servers. You cannot purchase any more. You can delete some of your purchased servers using the deleteServer() Netscript function in a script");if(""==t)return void Object(s.a)("You must enter a hostname for your new server!");const o=Object(r.g)({adminRights:!0,hostname:t,ip:Object(a.e)(),isConnectedTo:!1,maxRam:e,organizationName:"",purchasedByPlayer:!0});Object(a.a)(o),i.purchasedServers.push(o.hostname);const l=i.getHomeComputer();l.serversOnNetwork.push(o.hostname),o.serversOnNetwork.push(l.hostname),i.loseMoney(n,"servers"),Object(s.a)("Server successfully purchased with hostname "+o.hostname)}function h(t){const e=t.getUpgradeHomeRamCost();if(!t.canAfford(e))return void Object(s.a)("You do not have enough money to purchase additional RAM for your home computer");const n=t.getHomeComputer();n.maxRam>=o.a.HomeComputerMaxRam?Object(s.a)("You cannot upgrade your home computer RAM because it is at its maximum possible value"):(n.maxRam*=2,t.loseMoney(e,"servers"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l}));var a=n(16),r=n(15),i=n(77);class o{get filename(){return this.fn}set filename(t){this.fn=t}constructor(t="",e=""){this.fn=(t.endsWith(".txt")?t:t+".txt").replace(/\s+/g,""),this.text=e}append(t){this.text+=t}download(){const t=new Blob([this.text],{type:"text/plain"}),e=document.createElement("a"),n=URL.createObjectURL(t);e.href=n,e.download=this.fn,document.body.appendChild(e),e.click(),setTimeout(()=>{document.body.removeChild(e),window.URL.revokeObjectURL(n)},0)}read(){return this.text}show(){Object(a.a)(`${this.fn}

${this.text}`)}toJSON(){return Object(r.b)("TextFile",this)}write(t){this.text=t}static fromJSON(t){return Object(r.a)(o,t.data)}}function s(t,e){let n=t.endsWith(".txt")?t:t+".txt";Object(i.h)(n)&&(n=Object(i.k)(n));for(const t of e.textFiles)if(t.fn===n)return t;return null}function l(t,e,n){if(null!==s(t,n))return void console.error(`A file named "${t}" already exists on server ${n.hostname}.`);const a=new o(t,e);return n.textFiles.push(a),a}r.c.constructors.TextFile=o},function(t,e,n){"use strict";n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(13),r=n(22),i=n(442),o=n(273);function s(t){let e=1+t/100;return isNaN(e)&&(e=1),e*r.a.FactionWorkRepGain}function l(t,e){return(t.skills.hacking+t.skills.intelligence/3)/a.a.MaxSkillLevel*t.mults.faction_rep*Object(o.a)(t.skills.intelligence,1)*s(e)*Object(i.a)()}function c(t,e){return.9*(t.skills.strength+t.skills.defense+t.skills.dexterity+t.skills.agility+(t.skills.hacking+t.skills.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/4.5*t.mults.faction_rep*s(e)*Object(o.a)(t.skills.intelligence,1)}function f(t,e){return.9*(t.skills.strength+t.skills.defense+t.skills.dexterity+t.skills.agility+t.skills.charisma+(t.skills.hacking+t.skills.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/5.5*t.mults.faction_rep*s(e)*Object(o.a)(t.skills.intelligence,1)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return p}));const a={ScriptBaseRamCost:1.6,ScriptDomRamCost:25,ScriptCorporationRamCost:1022.4,ScriptHackRamCost:.1,ScriptHackAnalyzeRamCost:1,ScriptGrowRamCost:.15,ScriptGrowthAnalyzeRamCost:1,ScriptWeakenRamCost:.15,ScriptWeakenAnalyzeRamCost:1,ScriptScanRamCost:.2,ScriptRecentScriptsRamCost:.2,ScriptPortProgramRamCost:.05,ScriptRunRamCost:1,ScriptExecRamCost:1.3,ScriptSpawnRamCost:2,ScriptScpRamCost:.6,ScriptKillRamCost:.5,ScriptHasRootAccessRamCost:.05,ScriptGetHostnameRamCost:.05,ScriptGetHackingLevelRamCost:.05,ScriptGetMultipliersRamCost:4,ScriptGetServerRamCost:.1,ScriptGetServerMaxRam:.05,ScriptGetServerUsedRam:.05,ScriptFileExistsRamCost:.1,ScriptIsRunningRamCost:.1,ScriptHacknetNodesRamCost:4,ScriptHNUpgLevelRamCost:.4,ScriptHNUpgRamRamCost:.6,ScriptHNUpgCoreRamCost:.8,ScriptGetStockRamCost:2,ScriptBuySellStockRamCost:2.5,ScriptGetPurchaseServerRamCost:.25,ScriptPurchaseServerRamCost:2.25,ScriptGetPurchasedServerLimit:.05,ScriptGetPurchasedServerMaxRam:.05,ScriptRoundRamCost:.05,ScriptReadWriteRamCost:1,ScriptArbScriptRamCost:1,ScriptGetScriptRamCost:.1,ScriptGetRunningScriptRamCost:.3,ScriptGetHackTimeRamCost:.05,ScriptGetFavorToDonate:.1,ScriptCodingContractBaseRamCost:10,ScriptSleeveBaseRamCost:4,ScriptClearTerminalCost:.2,ScriptSingularityFn1RamCost:2,ScriptSingularityFn2RamCost:3,ScriptSingularityFn3RamCost:5,ScriptGangApiBaseRamCost:4,ScriptBladeburnerApiBaseRamCost:4,ScriptStanekWidth:.4,ScriptStanekHeight:.4,ScriptStanekCharge:.4,ScriptStanekFragmentDefinitions:0,ScriptStanekPlacedFragments:5,ScriptStanekClear:0,ScriptStanekCanPlace:.5,ScriptStanekPlace:5,ScriptStanekFragmentAt:2,ScriptStanekDeleteAt:.15,ScriptInfiltrationCalculateDifficulty:2.5,ScriptInfiltrationCalculateRewards:2.5,ScriptInfiltrationGetLocations:5,ScriptInfiltrationGetInfiltrations:15,ScriptStanekAcceptGift:2};function r(t){return e=>{if(4===e.bitNodeN)return t;const n=e.sourceFileLvl(4);return n<=1?16*t:2===n?4*t:t}}const i={hasWSEAccount:.05,hasTIXAPIAccess:.05,has4SData:.05,has4SDataTIXAPI:.05,getSymbols:a.ScriptGetStockRamCost,getPrice:a.ScriptGetStockRamCost,getAskPrice:a.ScriptGetStockRamCost,getBidPrice:a.ScriptGetStockRamCost,getPosition:a.ScriptGetStockRamCost,getMaxShares:a.ScriptGetStockRamCost,getPurchaseCost:a.ScriptGetStockRamCost,getSaleGain:a.ScriptGetStockRamCost,buyStock:a.ScriptBuySellStockRamCost,sellStock:a.ScriptBuySellStockRamCost,buyShort:a.ScriptBuySellStockRamCost,sellShort:a.ScriptBuySellStockRamCost,placeOrder:a.ScriptBuySellStockRamCost,cancelOrder:a.ScriptBuySellStockRamCost,getOrders:a.ScriptBuySellStockRamCost,getVolatility:a.ScriptBuySellStockRamCost,getForecast:a.ScriptBuySellStockRamCost,purchase4SMarketData:a.ScriptBuySellStockRamCost,purchase4SMarketDataTixApi:a.ScriptBuySellStockRamCost,purchaseWseAccount:a.ScriptBuySellStockRamCost,purchaseTixApi:a.ScriptBuySellStockRamCost},o={universityCourse:r(a.ScriptSingularityFn1RamCost),gymWorkout:r(a.ScriptSingularityFn1RamCost),travelToCity:r(a.ScriptSingularityFn1RamCost),goToLocation:r(a.ScriptSingularityFn3RamCost),purchaseTor:r(a.ScriptSingularityFn1RamCost),purchaseProgram:r(a.ScriptSingularityFn1RamCost),getCurrentServer:r(a.ScriptSingularityFn1RamCost),connect:r(a.ScriptSingularityFn1RamCost),manualHack:r(a.ScriptSingularityFn1RamCost),installBackdoor:r(a.ScriptSingularityFn1RamCost),getDarkwebProgramCost:r(a.ScriptSingularityFn1RamCost/4),getDarkwebPrograms:r(a.ScriptSingularityFn1RamCost/4),hospitalize:r(a.ScriptSingularityFn1RamCost/4),isBusy:r(a.ScriptSingularityFn1RamCost/4),stopAction:r(a.ScriptSingularityFn1RamCost/2),upgradeHomeRam:r(a.ScriptSingularityFn2RamCost),upgradeHomeCores:r(a.ScriptSingularityFn2RamCost),getUpgradeHomeRamCost:r(a.ScriptSingularityFn2RamCost/2),getUpgradeHomeCoresCost:r(a.ScriptSingularityFn2RamCost/2),workForCompany:r(a.ScriptSingularityFn2RamCost),applyToCompany:r(a.ScriptSingularityFn2RamCost),quitJob:r(a.ScriptSingularityFn2RamCost),getCompanyRep:r(a.ScriptSingularityFn2RamCost/3),getCompanyFavor:r(a.ScriptSingularityFn2RamCost/3),getCompanyFavorGain:r(a.ScriptSingularityFn2RamCost/4),checkFactionInvitations:r(a.ScriptSingularityFn2RamCost),joinFaction:r(a.ScriptSingularityFn2RamCost),workForFaction:r(a.ScriptSingularityFn2RamCost),getFactionRep:r(a.ScriptSingularityFn2RamCost/3),getFactionFavor:r(a.ScriptSingularityFn2RamCost/3),getFactionFavorGain:r(a.ScriptSingularityFn2RamCost/4),donateToFaction:r(a.ScriptSingularityFn3RamCost),createProgram:r(a.ScriptSingularityFn3RamCost),commitCrime:r(a.ScriptSingularityFn3RamCost),getCrimeChance:r(a.ScriptSingularityFn3RamCost),getCrimeStats:r(a.ScriptSingularityFn3RamCost),getOwnedAugmentations:r(a.ScriptSingularityFn3RamCost),getOwnedSourceFiles:r(a.ScriptSingularityFn3RamCost),getAugmentationsFromFaction:r(a.ScriptSingularityFn3RamCost),getAugmentationCost:r(a.ScriptSingularityFn3RamCost),getAugmentationPrereq:r(a.ScriptSingularityFn3RamCost),getAugmentationPrice:r(a.ScriptSingularityFn3RamCost/2),getAugmentationBasePrice:r(a.ScriptSingularityFn3RamCost/2),getAugmentationRepReq:r(a.ScriptSingularityFn3RamCost/2),getAugmentationStats:r(a.ScriptSingularityFn3RamCost),purchaseAugmentation:r(a.ScriptSingularityFn3RamCost),softReset:r(a.ScriptSingularityFn3RamCost),installAugmentations:r(a.ScriptSingularityFn3RamCost),isFocused:r(.1),setFocus:r(.1),b1tflum3:r(16),destroyW0r1dD43m0n:r(32),getCurrentWork:r(.5)},s={createGang:a.ScriptGangApiBaseRamCost/4,inGang:a.ScriptGangApiBaseRamCost/4,getMemberNames:a.ScriptGangApiBaseRamCost/4,getGangInformation:a.ScriptGangApiBaseRamCost/2,getOtherGangInformation:a.ScriptGangApiBaseRamCost/2,getMemberInformation:a.ScriptGangApiBaseRamCost/2,canRecruitMember:a.ScriptGangApiBaseRamCost/4,recruitMember:a.ScriptGangApiBaseRamCost/2,getTaskNames:a.ScriptGangApiBaseRamCost/4,getTaskStats:a.ScriptGangApiBaseRamCost/4,setMemberTask:a.ScriptGangApiBaseRamCost/2,getEquipmentNames:a.ScriptGangApiBaseRamCost/4,getEquipmentCost:a.ScriptGangApiBaseRamCost/2,getEquipmentType:a.ScriptGangApiBaseRamCost/2,getEquipmentStats:a.ScriptGangApiBaseRamCost/2,purchaseEquipment:a.ScriptGangApiBaseRamCost,ascendMember:a.ScriptGangApiBaseRamCost,getAscensionResult:a.ScriptGangApiBaseRamCost/2,setTerritoryWarfare:a.ScriptGangApiBaseRamCost/2,getChanceToWinClash:a.ScriptGangApiBaseRamCost,getBonusTime:0},l={getContractNames:a.ScriptBladeburnerApiBaseRamCost/10,getOperationNames:a.ScriptBladeburnerApiBaseRamCost/10,getBlackOpNames:a.ScriptBladeburnerApiBaseRamCost/10,getBlackOpRank:a.ScriptBladeburnerApiBaseRamCost/2,getGeneralActionNames:a.ScriptBladeburnerApiBaseRamCost/10,getSkillNames:a.ScriptBladeburnerApiBaseRamCost/10,startAction:a.ScriptBladeburnerApiBaseRamCost,stopBladeburnerAction:a.ScriptBladeburnerApiBaseRamCost/2,getCurrentAction:a.ScriptBladeburnerApiBaseRamCost/4,getActionTime:a.ScriptBladeburnerApiBaseRamCost,getActionCurrentTime:a.ScriptBladeburnerApiBaseRamCost,getActionEstimatedSuccessChance:a.ScriptBladeburnerApiBaseRamCost,getActionRepGain:a.ScriptBladeburnerApiBaseRamCost,getActionCountRemaining:a.ScriptBladeburnerApiBaseRamCost,getActionMaxLevel:a.ScriptBladeburnerApiBaseRamCost,getActionCurrentLevel:a.ScriptBladeburnerApiBaseRamCost,getActionAutolevel:a.ScriptBladeburnerApiBaseRamCost,setActionAutolevel:a.ScriptBladeburnerApiBaseRamCost,setActionLevel:a.ScriptBladeburnerApiBaseRamCost,getRank:a.ScriptBladeburnerApiBaseRamCost,getSkillPoints:a.ScriptBladeburnerApiBaseRamCost,getSkillLevel:a.ScriptBladeburnerApiBaseRamCost,getSkillUpgradeCost:a.ScriptBladeburnerApiBaseRamCost,upgradeSkill:a.ScriptBladeburnerApiBaseRamCost,getTeamSize:a.ScriptBladeburnerApiBaseRamCost,setTeamSize:a.ScriptBladeburnerApiBaseRamCost,getCityEstimatedPopulation:a.ScriptBladeburnerApiBaseRamCost,getCityCommunities:a.ScriptBladeburnerApiBaseRamCost,getCityChaos:a.ScriptBladeburnerApiBaseRamCost,getCity:a.ScriptBladeburnerApiBaseRamCost,switchCity:a.ScriptBladeburnerApiBaseRamCost,getStamina:a.ScriptBladeburnerApiBaseRamCost,joinBladeburnerFaction:a.ScriptBladeburnerApiBaseRamCost,joinBladeburnerDivision:a.ScriptBladeburnerApiBaseRamCost,getBonusTime:0},c={getPossibleLocations:a.ScriptInfiltrationGetLocations,getInfiltration:a.ScriptInfiltrationGetInfiltrations},f={attempt:a.ScriptCodingContractBaseRamCost,getContractType:a.ScriptCodingContractBaseRamCost/2,getData:a.ScriptCodingContractBaseRamCost/2,getDescription:a.ScriptCodingContractBaseRamCost/2,getNumTriesRemaining:a.ScriptCodingContractBaseRamCost/5},u={getNumSleeves:a.ScriptSleeveBaseRamCost,setToShockRecovery:a.ScriptSleeveBaseRamCost,setToSynchronize:a.ScriptSleeveBaseRamCost,setToCommitCrime:a.ScriptSleeveBaseRamCost,setToUniversityCourse:a.ScriptSleeveBaseRamCost,travel:a.ScriptSleeveBaseRamCost,setToCompanyWork:a.ScriptSleeveBaseRamCost,setToFactionWork:a.ScriptSleeveBaseRamCost,setToGymWorkout:a.ScriptSleeveBaseRamCost,getSleeveStats:a.ScriptSleeveBaseRamCost,getTask:a.ScriptSleeveBaseRamCost,getInformation:a.ScriptSleeveBaseRamCost,getSleeveAugmentations:a.ScriptSleeveBaseRamCost,getSleevePurchasableAugs:a.ScriptSleeveBaseRamCost,purchaseSleeveAug:a.ScriptSleeveBaseRamCost,setToBladeburnerAction:a.ScriptSleeveBaseRamCost,getSleeveAugmentationPrice:a.ScriptSleeveBaseRamCost,getSleeveAugmentationRepReq:a.ScriptSleeveBaseRamCost},m={giftWidth:a.ScriptStanekWidth,giftHeight:a.ScriptStanekHeight,chargeFragment:a.ScriptStanekCharge,fragmentDefinitions:a.ScriptStanekFragmentDefinitions,activeFragments:a.ScriptStanekPlacedFragments,clearGift:a.ScriptStanekClear,canPlaceFragment:a.ScriptStanekCanPlace,placeFragment:a.ScriptStanekPlace,getFragment:a.ScriptStanekFragmentAt,removeFragment:a.ScriptStanekDeleteAt,acceptGift:a.ScriptStanekAcceptGift},h={args:void 0,enums:void 0,corporation:{getMaterialNames:0,getIndustryTypes:0,getUnlockables:0,getUpgradeNames:0,getResearchNames:0,createCorporation:0,hasUnlockUpgrade:0,getUnlockUpgradeCost:0,getUpgradeLevel:0,getUpgradeLevelCost:0,getExpandIndustryCost:0,getExpandCityCost:0,getInvestmentOffer:0,acceptInvestmentOffer:0,goPublic:0,bribe:0,getCorporation:0,getDivision:0,expandIndustry:0,expandCity:0,unlockUpgrade:0,levelUpgrade:0,issueDividends:0,buyBackShares:0,sellShares:0,getBonusTime:0,sellMaterial:0,sellProduct:0,discontinueProduct:0,setSmartSupply:0,setSmartSupplyUseLeftovers:0,buyMaterial:0,bulkPurchase:0,getWarehouse:0,getProduct:0,getMaterial:0,setMaterialMarketTA1:0,setMaterialMarketTA2:0,setProductMarketTA1:0,setProductMarketTA2:0,exportMaterial:0,cancelExportMaterial:0,purchaseWarehouse:0,upgradeWarehouse:0,makeProduct:0,limitMaterialProduction:0,limitProductProduction:0,getPurchaseWarehouseCost:0,getUpgradeWarehouseCost:0,hasWarehouse:0,assignJob:0,hireEmployee:0,upgradeOfficeSize:0,throwParty:0,buyCoffee:0,hireAdVert:0,research:0,getOffice:0,getEmployee:0,getHireAdVertCost:0,getHireAdVertCount:0,getResearchCost:0,hasResearched:0,setAutoJobAssignment:0,getOfficeSizeUpgradeCost:0},hacknet:{numNodes:0,purchaseNode:0,getPurchaseNodeCost:0,getNodeStats:0,upgradeLevel:0,upgradeRam:0,upgradeCore:0,upgradeCache:0,getLevelUpgradeCost:0,getRamUpgradeCost:0,getCoreUpgradeCost:0,getCacheUpgradeCost:0,numHashes:0,hashCost:0,spendHashes:0,maxNumNodes:0,hashCapacity:0,getHashUpgrades:0,getHashUpgradeLevel:0,getStudyMult:0,getTrainingMult:0},stock:i,singularity:o,...o,gang:s,bladeburner:l,infiltration:c,codingcontract:f,sleeve:u,stanek:m,ui:{getTheme:0,setTheme:0,resetTheme:0,getStyles:0,setStyles:0,resetStyles:0,getGameInfo:0,clearTerminal:0,windowSize:0},grafting:{getAugmentationGraftPrice:3.75,getAugmentationGraftTime:3.75,getGraftableAugmentations:5,graftAugmentation:7.5},sprintf:0,vsprintf:0,scan:a.ScriptScanRamCost,hack:a.ScriptHackRamCost,hackAnalyzeThreads:a.ScriptHackAnalyzeRamCost,hackAnalyze:a.ScriptHackAnalyzeRamCost,hackAnalyzeSecurity:a.ScriptHackAnalyzeRamCost,hackAnalyzeChance:a.ScriptHackAnalyzeRamCost,sleep:0,asleep:0,share:2.4,getSharePower:.2,grow:a.ScriptGrowRamCost,growthAnalyze:a.ScriptGrowthAnalyzeRamCost,growthAnalyzeSecurity:a.ScriptGrowthAnalyzeRamCost,weaken:a.ScriptWeakenRamCost,weakenAnalyze:a.ScriptWeakenAnalyzeRamCost,print:0,printf:0,tprint:0,tprintf:0,clearLog:0,disableLog:0,enableLog:0,isLogEnabled:0,getScriptLogs:0,nuke:a.ScriptPortProgramRamCost,brutessh:a.ScriptPortProgramRamCost,ftpcrack:a.ScriptPortProgramRamCost,relaysmtp:a.ScriptPortProgramRamCost,httpworm:a.ScriptPortProgramRamCost,sqlinject:a.ScriptPortProgramRamCost,run:a.ScriptRunRamCost,exec:a.ScriptExecRamCost,spawn:a.ScriptSpawnRamCost,kill:a.ScriptKillRamCost,killall:a.ScriptKillRamCost,exit:0,atExit:0,scp:a.ScriptScpRamCost,ls:a.ScriptScanRamCost,ps:a.ScriptScanRamCost,getRecentScripts:a.ScriptRecentScriptsRamCost,hasRootAccess:a.ScriptHasRootAccessRamCost,getHostname:a.ScriptGetHostnameRamCost,getHackingLevel:a.ScriptGetHackingLevelRamCost,getHackingMultipliers:a.ScriptGetMultipliersRamCost,getHacknetMultipliers:a.ScriptGetMultipliersRamCost,getBitNodeMultipliers:a.ScriptGetMultipliersRamCost,getServer:a.ScriptGetMultipliersRamCost/2,getServerMoneyAvailable:a.ScriptGetServerRamCost,getServerSecurityLevel:a.ScriptGetServerRamCost,getServerBaseSecurityLevel:a.ScriptGetServerRamCost,getServerMinSecurityLevel:a.ScriptGetServerRamCost,getServerRequiredHackingLevel:a.ScriptGetServerRamCost,getServerMaxMoney:a.ScriptGetServerRamCost,getServerGrowth:a.ScriptGetServerRamCost,getServerNumPortsRequired:a.ScriptGetServerRamCost,getServerRam:a.ScriptGetServerRamCost,getServerMaxRam:a.ScriptGetServerMaxRam,getServerUsedRam:a.ScriptGetServerUsedRam,serverExists:a.ScriptGetServerRamCost,fileExists:a.ScriptFileExistsRamCost,isRunning:a.ScriptIsRunningRamCost,getPurchasedServerLimit:a.ScriptGetPurchasedServerLimit,getPurchasedServerMaxRam:a.ScriptGetPurchasedServerMaxRam,getPurchasedServerCost:a.ScriptGetPurchaseServerRamCost,purchaseServer:a.ScriptPurchaseServerRamCost,deleteServer:a.ScriptPurchaseServerRamCost,getPurchasedServers:a.ScriptPurchaseServerRamCost,write:0,tryWritePort:0,read:0,peek:0,clear:0,writePort:0,readPort:0,getPortHandle:0,rm:a.ScriptReadWriteRamCost,scriptRunning:a.ScriptArbScriptRamCost,scriptKill:a.ScriptArbScriptRamCost,getScriptName:0,getScriptRam:a.ScriptGetScriptRamCost,getHackTime:a.ScriptGetHackTimeRamCost,getGrowTime:a.ScriptGetHackTimeRamCost,getWeakenTime:a.ScriptGetHackTimeRamCost,getTotalScriptIncome:a.ScriptGetScriptRamCost,getScriptIncome:a.ScriptGetScriptRamCost,getTotalScriptExpGain:a.ScriptGetScriptRamCost,getScriptExpGain:a.ScriptGetScriptRamCost,getRunningScript:a.ScriptGetRunningScriptRamCost,nFormat:0,tFormat:0,getTimeSinceLastAug:a.ScriptGetHackTimeRamCost,prompt:0,wget:0,getFavorToDonate:a.ScriptGetFavorToDonate,getPlayer:a.ScriptSingularityFn1RamCost/4,mv:0,tail:0,toast:0,moveTail:0,resizeTail:0,closeTail:0,clearPort:0,openDevMenu:0,alert:0,flags:0,exploit:0,bypass:0,alterReality:0,rainbow:0,heart:{break:0},formulas:{mockServer:0,mockPlayer:0,reputation:{calculateFavorToRep:0,calculateRepToFavor:0,repFromDonation:0},skills:{calculateSkill:0,calculateExp:0},hacking:{hackChance:0,hackExp:0,hackPercent:0,growPercent:0,hackTime:0,growTime:0,weakenTime:0},hacknetNodes:{moneyGainRate:0,levelUpgradeCost:0,ramUpgradeCost:0,coreUpgradeCost:0,hacknetNodeCost:0,constants:0},hacknetServers:{hashGainRate:0,levelUpgradeCost:0,ramUpgradeCost:0,coreUpgradeCost:0,cacheUpgradeCost:0,hashUpgradeCost:0,hacknetServerCost:0,constants:0},gang:{wantedPenalty:0,respectGain:0,wantedLevelGain:0,moneyGain:0,ascensionPointsGain:0,ascensionMultiplier:0},work:{crimeGains:0,classGains:0,factionGains:0}}},d=h;function p(t,...e){if(0===e.length)return console.warn("No arguments passed to getRamCost()"),0;let n=d[e[0]];for(let t=1;t{i[t.name]=new r.a(t.name,t.cost,t.upgType,t.mults)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return l}));var a=n(22),r=n(13);function i(){return r.a.MarketData4SCost*a.a.FourSigmaMarketDataCost}function o(){return r.a.MarketDataTixApi4SCost*a.a.FourSigmaMarketDataApiCost}function s(){return r.a.WSEAccountCost}function l(){return r.a.TIXAPICost}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(88),r=n(0),i=n.n(r),o=n(7);function s(t){const e={...t,onChange:e=>{const n=o.a.parseMoney(e.target.value);""===e.target.value||isNaN(n)?t.onChange(NaN):t.onChange(n)}};return i.a.createElement(a.a,e)}},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1058),r=n(1059);const i={};for(const t of r.a)i[(o=t).name]=new a.a(o);var o},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1062),r=n(483);const i={};a.a.forEach(t=>{i[t.name]=new r.a(t.name,t.desc,t.isHacking,t.isCombat,t.params)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(205),r=n(185),i=n(15),o=n(277);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l{constructor(t={}){var e;s(this,"level",1),s(this,"sizeUsed",0),s(this,"smartSupplyEnabled",!1),s(this,"smartSupplyUseLeftovers",{}),s(this,"smartSupplyStore",0),this.loc=t.loc?t.loc:"",this.size=t.size?t.size:0,this.materials={Water:new a.a({name:"Water"}),Energy:new a.a({name:"Energy"}),Food:new a.a({name:"Food"}),Plants:new a.a({name:"Plants"}),Metal:new a.a({name:"Metal"}),Hardware:new a.a({name:"Hardware"}),Chemicals:new a.a({name:"Chemicals"}),Drugs:new a.a({name:"Drugs"}),Robots:new a.a({name:"Robots"}),AICores:new a.a({name:"AI Cores"}),RealEstate:new a.a({name:"Real Estate"})},this.smartSupplyUseLeftovers={Water:!0,Energy:!0,Food:!0,Plants:!0,Metal:!0,Hardware:!0,Chemicals:!0,Drugs:!0,Robots:!0,AICores:!0,RealEstate:!0},t.corp&&t.industry&&this.updateSize(t.corp,t.industry),null!==(e=t.corp)&&void 0!==e&&e.unlockUpgrades[1]&&(this.smartSupplyEnabled=!0)}updateMaterialSizeUsed(){this.sizeUsed=0;for(const t of Object.keys(this.materials)){const e=this.materials[t];r.a.hasOwnProperty(t)&&(this.sizeUsed+=e.qty*r.a[t])}this.sizeUsed>this.size&&console.warn("Warehouse size used greater than capacity, something went wrong")}updateSize(t,e){try{this.size=100*this.level*t.getStorageMultiplier()*e.getStorageMultiplier()}catch(t){Object(o.a)(t)}}toJSON(){return Object(i.b)("Warehouse",this)}static fromJSON(t){return Object(i.a)(l,t.data)}}i.c.constructors.Warehouse=l},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return f}));var a=n(0),r=n.n(a),i=n(6),o=n(359);class s{constructor(t,e){i.a.TimestampsFormat&&(t="["+Object(o.a)(i.a.TimestampsFormat)+"] "+t),this.text=t,this.color=e}}class l{constructor(t){i.a.TimestampsFormat&&(t=r.a.createElement(r.a.Fragment,null,"[",Object(o.a)(i.a.TimestampsFormat),"] ",t)),this.raw=t}}class c{constructor(t,e){i.a.TimestampsFormat&&(t="["+Object(o.a)(i.a.TimestampsFormat)+"] "+t),this.hostname=e,this.dashes=t}}class f{constructor(t,e,n){this.time=t,this.timeLeft=t,this.action=e,this.server=n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(22);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t={name:"foo",desc:"foo"}){if(r(this,"baseCost",1),r(this,"costInc",1),r(this,"maxLvl",0),r(this,"successChanceAll",0),r(this,"successChanceStealth",0),r(this,"successChanceKill",0),r(this,"successChanceContract",0),r(this,"successChanceOperation",0),r(this,"successChanceEstimate",0),r(this,"actionTime",0),r(this,"effHack",0),r(this,"effStr",0),r(this,"effDef",0),r(this,"effDex",0),r(this,"effAgi",0),r(this,"effCha",0),r(this,"stamina",0),r(this,"money",0),r(this,"expGain",0),!t.name)throw new Error("Failed to initialize Bladeburner Skill. No name was specified in ctor");if(!t.desc)throw new Error("Failed to initialize Bladeburner Skills. No desc was specified in ctor");this.name=t.name,this.desc=t.desc,this.baseCost=t.baseCost?t.baseCost:1,this.costInc=t.costInc?t.costInc:1,t.maxLvl&&(this.maxLvl=t.maxLvl),t.successChanceAll&&(this.successChanceAll=t.successChanceAll),t.successChanceStealth&&(this.successChanceStealth=t.successChanceStealth),t.successChanceKill&&(this.successChanceKill=t.successChanceKill),t.successChanceContract&&(this.successChanceContract=t.successChanceContract),t.successChanceOperation&&(this.successChanceOperation=t.successChanceOperation),t.successChanceEstimate&&(this.successChanceEstimate=t.successChanceEstimate),t.actionTime&&(this.actionTime=t.actionTime),t.effHack&&(this.effHack=t.effHack),t.effStr&&(this.effStr=t.effStr),t.effDef&&(this.effDef=t.effDef),t.effDex&&(this.effDex=t.effDex),t.effAgi&&(this.effAgi=t.effAgi),t.effCha&&(this.effCha=t.effCha),t.stamina&&(this.stamina=t.stamina),t.money&&(this.money=t.money),t.expGain&&(this.expGain=t.expGain)}calculateCost(t,e=1){const n=(t,e)=>{if(e<=1)return Math.floor((this.baseCost+t*this.costInc)*a.a.BladeburnerSkillCost);{const n=Math.floor((this.baseCost+t*this.costInc)*a.a.BladeburnerSkillCost);return this.calculateCost(t+1,e-1)+n}};if(e<0||e%1!=0)throw new Error(e+" is an invalid number of upgrades");if(e<=100)return n(t,e);{const n=e*(2*this.baseCost+this.costInc*(2*t+e+1))/2*a.a.BladeburnerSkillCost-e/2;return Math.floor(n)}}getMultiplier(t){return"successChanceAll"===t?this.successChanceAll:"successChanceStealth"===t?this.successChanceStealth:"successChanceKill"===t?this.successChanceKill:"successChanceContract"===t?this.successChanceContract:"successChanceOperation"===t?this.successChanceOperation:"successChanceEstimate"===t?this.successChanceEstimate:"actionTime"===t?this.actionTime:"effHack"===t?this.effHack:"effStr"===t?this.effStr:"effDef"===t?this.effDef:"effDex"===t?this.effDex:"effAgi"===t?this.effAgi:"effCha"===t?this.effCha:"stamina"===t?this.stamina:"money"===t?this.money:"expGain"===t?this.expGain:0}}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(39),o=n(9),s=n(3);function l(t){return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,null,t.confirmationText),r.a.createElement(o.a,{onClick:()=>{t.onConfirm()}},"Confirm"),t.additionalButton&&r.a.createElement(r.a.Fragment,null,t.additionalButton)))}},function(t,e,n){"use strict";function a(t){const e=Object.assign({},{progress:0,totalTicks:20},t);e.progress=Math.max(Math.min(e.progress,1),0);const n=Math.max(Math.floor(e.progress/(1/e.totalTicks)),1),a=Math.max(e.totalTicks-n,0);return`[${"|".repeat(n)}${"-".repeat(a)}]`}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(){try{return"2675fd23"}catch(t){}return"DEV"}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(165),r=n(22),i=n(13),o=n(55),s=n(24),l=n(382);const c=1e3/i.a._idleSpeed;function f(t,e){const n=l.a.find(t=>t.specialName===e.name),a=Object(s.d)(n?n.hostname:"").backdoorInstalled?.9:1;return t.earnings.money*e.costMult*a}function u(t,e,n,i){const s=t.hashManager,l=o.c[n],u=a.a[i],m=[o.a.GymAgility,o.a.GymDefense,o.a.GymStrength,o.a.GymDexterity].includes(n)?s.getTrainingMult():s.getStudyMult(),h=f(l,u)/c,d=l.earnings.hackExp*u.expMult/c*m,p=l.earnings.strExp*u.expMult/c*m,g=l.earnings.defExp*u.expMult/c*m,y=l.earnings.dexExp*u.expMult/c*m,b=l.earnings.agiExp*u.expMult/c*m,E=l.earnings.chaExp*u.expMult/c*m;return{money:h,reputation:0,hackExp:d*e.mults.hacking_exp*r.a.ClassGymExpGain,strExp:p*e.mults.strength_exp*r.a.ClassGymExpGain,defExp:g*e.mults.defense_exp*r.a.ClassGymExpGain,dexExp:y*e.mults.dexterity_exp*r.a.ClassGymExpGain,agiExp:b*e.mults.agility_exp*r.a.ClassGymExpGain,chaExp:E*e.mults.charisma_exp*r.a.ClassGymExpGain,intExp:0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(547),r=n(15),i=n(548);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let s=0;class l{constructor(t=null,e="",n="",a="",r=[]){o(this,"code",""),o(this,"filename",""),o(this,"url",""),o(this,"module",null),o(this,"dependencies",[]),o(this,"dependents",[]),o(this,"ramUsage",0),o(this,"queueCompile",!1),o(this,"server",""),this.filename=e,this.code=n,this.server=a,this.moduleSequenceNumber=++s,""!==this.code&&null!==t&&this.updateRamUsage(t,r)}download(){const t=this.filename,e=new Blob([this.code],{type:"text/plain"}),n=document.createElement("a"),a=URL.createObjectURL(e);n.href=a,n.download=t,document.body.appendChild(n),n.click(),setTimeout((function(){document.body.removeChild(n),window.URL.revokeObjectURL(a)}),0)}markUpdated(){this.module=null,this.moduleSequenceNumber=++s}saveScript(t,e,n,a,r){this.code=l.formatCode(n),this.filename=e,this.server=a,this.updateRamUsage(t,r),this.markUpdated();for(const t of this.dependents){const[e]=r.filter(e=>e.filename===t.filename&&e.server==t.server);null==e||e.markUpdated()}}updateRamUsage(t,e){const n=Object(a.a)(t,this.code,e);n.cost>0&&(this.ramUsage=Object(i.a)(n.cost),this.ramUsageEntries=n.entries),this.markUpdated()}imports(){return[]}toJSON(){return Object(r.b)("Script",this)}static fromJSON(t){const e=Object(r.a)(l,t.data);return e.url="",e.dependents=[],e}static formatCode(t){return t.replace(/^\s+|\s+$/g,"")}}r.c.constructors.Script=l},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(76),o=n(162),s=n(161),l=n(49),c=n(3);function f({rows:t,title:e,wide:n}){const a=n?s.a:i.a;return r.a.createElement(r.a.Fragment,null,e&&r.a.createElement(c.a,null,e),r.a.createElement(a,{size:"small",padding:"none"},r.a.createElement(o.a,null,t.map((t,e)=>r.a.createElement(l.a,{key:e},t.map((t,e)=>r.a.createElement(i.b,{key:e,align:0!==e?"right":"left"},r.a.createElement(c.a,{noWrap:!0},t))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(317),r=n(63);const i={BruteSSHProgram:new a.a(r.a.BruteSSHProgram.name,5e5,"Opens up SSH Ports."),FTPCrackProgram:new a.a(r.a.FTPCrackProgram.name,15e5,"Opens up FTP Ports."),RelaySMTPProgram:new a.a(r.a.RelaySMTPProgram.name,5e6,"Opens up SMTP Ports."),HTTPWormProgram:new a.a(r.a.HTTPWormProgram.name,3e7,"Opens up HTTP Ports."),SQLInjectProgram:new a.a(r.a.SQLInjectProgram.name,25e7,"Opens up SQL Ports."),ServerProfiler:new a.a(r.a.ServerProfiler.name,5e5,"Displays detailed information about a server."),DeepscanV1:new a.a(r.a.DeepscanV1.name,5e5,"Enables 'scan-analyze' with a depth up to 5."),DeepscanV2:new a.a(r.a.DeepscanV2.name,25e6,"Enables 'scan-analyze' with a depth up to 10."),AutolinkProgram:new a.a(r.a.AutoLink.name,1e6,"Enables direct connect via 'scan-analyze'."),FormulasProgram:new a.a(r.a.Formulas.name,5e9,"Unlock access to the formulas API.")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(482);const r={},i=["Training","Field Analysis","Recruitment","Diplomacy","Hyperbolic Regeneration Chamber","Incite Violence"];for(const t of i)r[t]=new a.a({name:t})},function(t,e,n){"use strict";let a;n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),function(t){t.Clubs="clubs",t.Diamonds="diamonds",t.Hearts="hearts",t.Spades="spades"}(a||(a={}));class r{constructor(t,e){if(this.value=t,this.suit=e,t<1||t>13)throw new Error("Card instantiated with improper value: "+t)}formatValue(){switch(this.value){case 1:return"A";case 11:return"J";case 12:return"Q";case 13:return"K";default:return""+this.value}}isRedSuit(){return this.suit===a.Hearts||this.suit===a.Diamonds}getStringRepresentation(){return`${this.formatValue()} of ${this.suit}`}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(15);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t={}){r(this,"name",""),r(this,"type",-1),t.name&&(this.name=t.name),t.type&&(this.type=t.type)}toJSON(){return Object(a.b)("ActionIdentifier",this)}static fromJSON(t){return Object(a.a)(i,t.data)}}a.c.constructors.ActionIdentifier=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(152);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t,e){r(this,"lvl",1),r(this,"owned",!1);const n="BitNode"+t,i=a.a[n];if(null==i)throw new Error("Invalid Bit Node for this Source File");this.n=t,this.name=`Source-File ${t}: ${i.name}`,this.info=e}}},,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return f})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return m}));var a=n(13),r=n(1),i=n(45),o=n(140),s=n(24),l=n(7),c=n(426);function f(t){const e=((new Date).getTime()-r.a.lastUpdate)/1e3;let n=t.onlineRunningTime/14400;n>=1&&(n=1);for(const n of Object.keys(t.dataMap))if(t.dataMap.hasOwnProperty(n)){if(0==t.dataMap[n][2]||null==t.dataMap[n][2])continue;const a=Object(s.d)(n);if(null==a)continue;const c=Math.round(.5*t.dataMap[n][2]/t.onlineRunningTime*e);t.log(`Called on ${a.hostname} ${c} times while offline`);const f=Object(s.d)(t.server);if(null===f)throw new Error("getServer of null key?");if(!(a instanceof i.a))throw new Error("trying to grow a non-normal server");const u=Object(o.f)(a,c,r.a,f.cpuCores);t.log(`'${a.hostname}' grown by ${l.a.format(100*u-100,"0.000000%")} while offline`)}const c=n*(t.onlineExpGained/t.onlineRunningTime)*e;r.a.gainHackingExp(c),t.offlineRunningTime+=e,t.offlineExpGained+=c;for(const n of Object.keys(t.dataMap))if(t.dataMap.hasOwnProperty(n)){if(0==t.dataMap[n][3]||null==t.dataMap[n][3])continue;const r=Object(s.d)(n);if(null==r)continue;if(!(r instanceof i.a))throw new Error("trying to weaken a non-normal server");const o=Object(s.d)(t.server);if(null===o)throw new Error("getServer of null key?");const l=Math.round(.5*t.dataMap[n][3]/t.onlineRunningTime*e);t.log(`Called weaken() on ${r.hostname} ${l} times while offline`);const c=1+(o.cpuCores-1)/16;r.weaken(a.a.ServerWeakenAmount*l*c)}}function u(t,e,n){for(let a=0;anull!==t&&t.type===r.b.COMPANY;class f extends r.a{constructor(t){var e;super(r.b.COMPANY),this.companyName=null!==(e=null==t?void 0:t.companyName)&&void 0!==e?e:i.a.NewTokyoNoodleBar}getCompany(){const t=o.a[this.companyName];if(!t)throw new Error(`Company not found: '${this.companyName}'`);return t}getGainRates(t,e){return Object(s.a)(t,e,this.getCompany())}process(t,e,n){const a=this.getCompany(),i=this.getGainRates(t,e);return Object(r.c)(t,e,i,n),a.playerReputation+=i.reputation*n,Object(l.a)(a,i.reputation,n),0}APICopy(){return{type:this.type,companyName:this.companyName}}toJSON(){return Object(a.b)("SleeveCompanyWork",this)}static fromJSON(t){return Object(a.a)(f,t.data)}}a.c.constructors.SleeveCompanyWork=f},function(t,e,n){"use strict";n.d(e,"a",(function(){return N})),n.d(e,"b",(function(){return P}));var a=n(12),r=n(143),i=n(234),o=n(13),s=n(51),l=n(111),c=n(29),f=n(81),u=n(191),m=n(41),h=n(56),d=n(229),p=n(94),g=n(17),y=n(1),b=n(63),E=n(24),v=n(89),k=n(45),w=n(91),S=n(27),_=n(1171),C=n(5),x=n(59),L=n(55),O=n(22);const M=_.a;function A(){const t=Object(E.d)(v.a.WorldDaemon);return t instanceof k.a&&(!!t.backdoorInstalled||null!==y.a.bladeburner&&y.a.bladeburner.blackops.hasOwnProperty(x.a.OperationDaedalus))}function T(t,e){return t.bitNodeN===e||t.sourceFiles.some(t=>t.n===e)}function R(t){return t.sourceFiles.some(t=>1===t.n)}const N={[C.a.CyberSec.toUpperCase()]:{...M[C.a.CyberSec.toUpperCase()],Icon:"CSEC",Condition:()=>y.a.factions.includes(C.a.CyberSec)},[C.a.NiteSec.toUpperCase()]:{...M[C.a.NiteSec.toUpperCase()],Icon:C.a.NiteSec,Condition:()=>y.a.factions.includes(C.a.NiteSec)},THE_BLACK_HAND:{...M.THE_BLACK_HAND,Icon:"TBH",Condition:()=>y.a.factions.includes(C.a.TheBlackHand)},[C.a.BitRunners.toUpperCase()]:{...M[C.a.BitRunners.toUpperCase()],Icon:C.a.BitRunners.toLowerCase(),Condition:()=>y.a.factions.includes(C.a.BitRunners)},[C.a.Daedalus.toUpperCase()]:{...M[C.a.Daedalus.toUpperCase()],Icon:C.a.Daedalus.toLowerCase(),Condition:()=>y.a.factions.includes(C.a.Daedalus)},THE_COVENANT:{...M.THE_COVENANT,Icon:C.a.TheCovenant.toLowerCase().replace(/ /g,""),Condition:()=>y.a.factions.includes(C.a.TheCovenant)},[C.a.Illuminati.toUpperCase()]:{...M[C.a.Illuminati.toUpperCase()],Icon:C.a.Illuminati.toLowerCase(),Condition:()=>y.a.factions.includes(C.a.Illuminati)},"BRUTESSH.EXE":{...M["BRUTESSH.EXE"],Icon:"p0",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.BruteSSHProgram.name)},"FTPCRACK.EXE":{...M["FTPCRACK.EXE"],Icon:"p1",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.FTPCrackProgram.name)},"RELAYSMTP.EXE":{...M["RELAYSMTP.EXE"],Icon:"p2",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.RelaySMTPProgram.name)},"HTTPWORM.EXE":{...M["HTTPWORM.EXE"],Icon:"p3",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.HTTPWormProgram.name)},"SQLINJECT.EXE":{...M["SQLINJECT.EXE"],Icon:"p4",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.SQLInjectProgram.name)},"FORMULAS.EXE":{...M["FORMULAS.EXE"],Icon:"formulas",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.Formulas.name)},"SF1.1":{...M["SF1.1"],Icon:"SF1.1",Visible:()=>T(y.a,1),Condition:()=>y.a.sourceFileLvl(1)>=1},"SF2.1":{...M["SF2.1"],Icon:"SF2.1",Visible:()=>T(y.a,2),Condition:()=>y.a.sourceFileLvl(2)>=1},"SF3.1":{...M["SF3.1"],Icon:"SF3.1",Visible:()=>T(y.a,3),Condition:()=>y.a.sourceFileLvl(3)>=1},"SF4.1":{...M["SF4.1"],Icon:"SF4.1",Visible:()=>T(y.a,4),Condition:()=>y.a.sourceFileLvl(4)>=1},"SF5.1":{...M["SF5.1"],Icon:"SF5.1",Visible:()=>T(y.a,5),Condition:()=>y.a.sourceFileLvl(5)>=1},"SF6.1":{...M["SF6.1"],Icon:"SF6.1",Visible:()=>T(y.a,6),Condition:()=>y.a.sourceFileLvl(6)>=1},"SF7.1":{...M["SF7.1"],Icon:"SF7.1",Visible:()=>T(y.a,7),Condition:()=>y.a.sourceFileLvl(7)>=1},"SF8.1":{...M["SF8.1"],Icon:"SF8.1",Visible:()=>T(y.a,8),Condition:()=>y.a.sourceFileLvl(8)>=1},"SF9.1":{...M["SF9.1"],Icon:"SF9.1",Visible:()=>T(y.a,9),Condition:()=>y.a.sourceFileLvl(9)>=1},"SF10.1":{...M["SF10.1"],Icon:"SF10.1",Visible:()=>T(y.a,10),Condition:()=>y.a.sourceFileLvl(10)>=1},"SF11.1":{...M["SF11.1"],Icon:"SF11.1",Visible:()=>T(y.a,11),Condition:()=>y.a.sourceFileLvl(11)>=1},"SF12.1":{...M["SF12.1"],Icon:"SF12.1",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=1},MONEY_1Q:{...M.MONEY_1Q,Icon:"$1Q",Condition:()=>y.a.money>=1e18},MONEY_M1B:{...M.MONEY_M1B,Icon:"-1b",Secret:!0,Condition:()=>y.a.money<=-1e9},INSTALL_1:{...M.INSTALL_1,Icon:"install",Condition:()=>y.a.augmentations.length>=1},INSTALL_100:{...M.INSTALL_100,Icon:"install_100",Condition:()=>y.a.augmentations.length>=100},QUEUE_40:{...M.QUEUE_40,Icon:"queue40",Condition:()=>y.a.queuedAugmentations.length>=40},HACKING_100000:{...M.HACKING_100000,Icon:"hack100000",Condition:()=>y.a.skills.hacking>=1e5},COMBAT_3000:{...M.COMBAT_3000,Icon:"combat3000",Condition:()=>y.a.skills.strength>=3e3&&y.a.skills.defense>=3e3&&y.a.skills.dexterity>=3e3&&y.a.skills.agility>=3e3},NEUROFLUX_255:{...M.NEUROFLUX_255,Icon:"nf255",Condition:()=>y.a.augmentations.some(t=>t.name===a.a.NeuroFluxGovernor&&t.level>=255)},NS2:{...M.NS2,Icon:"ns2",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.filename.endsWith(".js"))},FROZE:{...M.FROZE,Icon:"forze",Condition:()=>location.href.includes("noScripts")},RUNNING_SCRIPTS_1000:{...M.RUNNING_SCRIPTS_1000,Icon:"run1000",Condition:()=>{let t=0;for(const e of Object(E.c)())t+=e.runningScripts.length;return t>=1e3}},DRAIN_SERVER:{...M.DRAIN_SERVER,Icon:"drain",Condition:()=>{for(const t of Object(E.c)())if(t instanceof k.a&&t.moneyMax>0&&0===t.moneyAvailable)return!0;return!1}},MAX_RAM:{...M.MAX_RAM,Icon:"maxram",Condition:()=>y.a.getHomeComputer().maxRam===o.a.HomeComputerMaxRam},MAX_CORES:{...M.MAX_CORES,Icon:"maxcores",Condition:()=>8===y.a.getHomeComputer().cpuCores},SCRIPTS_30:{...M.SCRIPTS_30,Icon:"folders",Condition:()=>y.a.getHomeComputer().scripts.length>=30},KARMA_1000000:{...M.KARMA_1000000,Icon:"karma",Secret:!0,Condition:()=>y.a.karma<=-1e6},STOCK_1q:{...M.STOCK_1q,Icon:"$1Q",Condition:()=>y.a.moneySourceB.stock>=1e15},DISCOUNT:{...M.DISCOUNT,Icon:"discount",Condition:()=>{const t=Object(E.d)("powerhouse-fitness");return t instanceof k.a&&t.backdoorInstalled}},SCRIPT_32GB:{...M.SCRIPT_32GB,Icon:"bigcost",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.ramUsage>=32)},FIRST_HACKNET_NODE:{...M.FIRST_HACKNET_NODE,Icon:"node",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>0},"30_HACKNET_NODE":{...M["30_HACKNET_NODE"],Icon:"hacknet-all",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>=30},MAX_HACKNET_NODE:{...M.MAX_HACKNET_NODE,Icon:"hacknet-max",Condition:()=>{if(Object(h.g)(y.a))return!1;for(const t of y.a.hacknetNodes){if(!(t instanceof d.a))return!1;if(t.ram===m.a.MaxRam&&t.cores===m.a.MaxCores&&t.level===m.a.MaxLevel)return!0}return!1}},HACKNET_NODE_10M:{...M.HACKNET_NODE_10M,Icon:"hacknet-10m",Condition:()=>!Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e7},REPUTATION_10M:{...M.REPUTATION_10M,Icon:"reputation",Condition:()=>Object.values(c.a).some(t=>t.playerReputation>=1e7)},DONATION:{...M.DONATION,Icon:"donation",Condition:()=>Object.values(c.a).some(t=>t.favor>=Math.floor(o.a.BaseFavorToDonate*O.a.RepToDonateToFaction))},TRAVEL:{...M.TRAVEL,Icon:"TRAVEL",Condition:()=>y.a.city!==g.a.Sector12},WORKOUT:{...M.WORKOUT,Icon:"WORKOUT",Condition:()=>Object(L.d)(y.a.currentWork)},TOR:{...M.TOR,Icon:"TOR",Condition:()=>y.a.hasTorRouter()},HOSPITALIZED:{...M.HOSPITALIZED,Icon:"OUCH",Condition:()=>0!==y.a.moneySourceB.hospitalization},GANG:{...M.GANG,Icon:"GANG",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang},FULL_GANG:{...M.FULL_GANG,Icon:"GANGMAX",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&y.a.gang.members.length===u.a.MaximumGangMembers},GANG_TERRITORY:{...M.GANG_TERRITORY,Icon:"GANG100%",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&f.a[y.a.gang.facName].territory>=.999},GANG_MEMBER_POWER:{...M.GANG_MEMBER_POWER,Icon:"GANG10000",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&y.a.gang.members.some(t=>t.hack>=1e4||t.str>=1e4||t.def>=1e4||t.dex>=1e4||t.agi>=1e4||t.cha>=1e4)},CORPORATION:{...M.CORPORATION,Icon:"CORP",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation},CORPORATION_BRIBE:{...M.CORPORATION_BRIBE,Icon:"CORPLOBBY",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&1===y.a.corporation.unlockUpgrades[6]},CORPORATION_PROD_1000:{...M.CORPORATION_PROD_1000,Icon:"CORP1000",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&y.a.corporation.divisions.some(t=>t.prodMult>=1e3)},CORPORATION_EMPLOYEE_3000:{...M.CORPORATION_EMPLOYEE_3000,Icon:"CORPCITY",Visible:()=>T(y.a,3),Condition:()=>{if(null===y.a.corporation)return!1;for(const t of y.a.corporation.divisions)for(const e of Object.values(t.offices))if(0!==e&&e.employees.length>=3e3)return!0;return!1}},CORPORATION_REAL_ESTATE:{...M.CORPORATION_REAL_ESTATE,Icon:"CORPRE",Name:"Own the land",Description:"Expand to the Real Estate division.",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&y.a.corporation.divisions.some(t=>t.type===s.a.RealEstate)},INTELLIGENCE_255:{...M.INTELLIGENCE_255,Icon:"INT255",Visible:()=>T(y.a,5),Condition:()=>y.a.skills.intelligence>=255},BLADEBURNER_DIVISION:{...M.BLADEBURNER_DIVISION,Icon:"BLADE",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner},BLADEBURNER_OVERCLOCK:{...M.BLADEBURNER_OVERCLOCK,Icon:"BLADEOVERCLOCK",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner&&y.a.bladeburner.skills[r.a.Overclock]===i.a[r.a.Overclock].maxLvl},BLADEBURNER_UNSPENT_100000:{...M.BLADEBURNER_UNSPENT_100000,Icon:"BLADE100K",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner&&y.a.bladeburner.skillPoints>=1e5},"4S":{...M["4S"],Icon:"4S",Condition:()=>y.a.has4SData},FIRST_HACKNET_SERVER:{...M.FIRST_HACKNET_SERVER,Icon:"HASHNET",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length>0,AdditionalUnlock:[M.FIRST_HACKNET_NODE.ID]},ALL_HACKNET_SERVER:{...M.ALL_HACKNET_SERVER,Icon:"HASHNETALL",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length===m.b.MaxServers,AdditionalUnlock:[M["30_HACKNET_NODE"].ID]},MAX_HACKNET_SERVER:{...M.MAX_HACKNET_SERVER,Icon:"HASHNETALL",Visible:()=>T(y.a,9),Condition:()=>{if(!Object(h.g)(y.a))return!1;for(const t of y.a.hacknetNodes){if("string"!=typeof t)return!1;const e=Object(E.d)(t);if(!(e instanceof p.a))return!1;if(e.maxRam===m.b.MaxRam&&e.cores===m.b.MaxCores&&e.level===m.b.MaxLevel&&e.cache===m.b.MaxCache)return!0}return!1},AdditionalUnlock:[M.MAX_HACKNET_NODE.ID]},HACKNET_SERVER_1B:{...M.HACKNET_SERVER_1B,Icon:"HASHNETMONEY",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e9,AdditionalUnlock:[M.HACKNET_NODE_10M.ID]},MAX_CACHE:{...M.MAX_CACHE,Icon:"HASHNETCAP",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hashManager.hashes===y.a.hashManager.capacity&&y.a.hashManager.capacity>0},SLEEVE_8:{...M.SLEEVE_8,Icon:"SLEEVE8",Visible:()=>T(y.a,10),Condition:()=>8===y.a.sleeves.length&&3===y.a.sourceFileLvl(10)},INDECISIVE:{...M.INDECISIVE,Icon:"1H",Visible:()=>R(y.a),Condition:function(){let t=0;return setInterval(()=>{w.b.page()===S.a.BitVerse?t++:t=0},6e4),()=>t>60}()},FAST_BN:{...M.FAST_BN,Icon:"2DAYS",Visible:()=>R(y.a),Condition:()=>A()&&y.a.playtimeSinceLastBitnode<1728e5},CHALLENGE_BN1:{...M.CHALLENGE_BN1,Icon:"BN1+",Visible:()=>R(y.a),Condition:()=>1===y.a.bitNodeN&&A()&&y.a.getHomeComputer().maxRam<=128&&1===y.a.getHomeComputer().cpuCores},CHALLENGE_BN2:{...M.CHALLENGE_BN2,Icon:"BN2+",Visible:()=>T(y.a,2),Condition:()=>2===y.a.bitNodeN&&A()&&null===y.a.gang},CHALLENGE_BN3:{...M.CHALLENGE_BN3,Icon:"BN3+",Visible:()=>T(y.a,3),Condition:()=>3===y.a.bitNodeN&&A()&&null===y.a.corporation},CHALLENGE_BN6:{...M.CHALLENGE_BN6,Icon:"BN6+",Visible:()=>T(y.a,6),Condition:()=>6===y.a.bitNodeN&&A()&&null===y.a.bladeburner},CHALLENGE_BN7:{...M.CHALLENGE_BN7,Icon:"BN7+",Visible:()=>T(y.a,7),Condition:()=>7===y.a.bitNodeN&&A()&&null===y.a.bladeburner},CHALLENGE_BN8:{...M.CHALLENGE_BN8,Icon:"BN8+",Visible:()=>T(y.a,8),Condition:()=>8===y.a.bitNodeN&&A()&&!y.a.has4SData&&!y.a.has4SDataTixApi},CHALLENGE_BN9:{...M.CHALLENGE_BN9,Icon:"BN9+",Visible:()=>T(y.a,9),Condition:()=>9===y.a.bitNodeN&&A()&&0===y.a.moneySourceB.hacknet&&0===y.a.moneySourceB.hacknet_expenses},CHALLENGE_BN10:{...M.CHALLENGE_BN10,Icon:"BN10+",Visible:()=>T(y.a,10),Condition:()=>10===y.a.bitNodeN&&A()&&!y.a.sleeves.some(t=>t.augmentations.length>0||t.exp.hacking>0||t.exp.strength>0||t.exp.defense>0||t.exp.agility>0||t.exp.dexterity>0||t.exp.charisma>0)},CHALLENGE_BN12:{...M.CHALLENGE_BN12,Icon:"BN12+",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=50},BYPASS:{...M.BYPASS,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Bypass)},PROTOTYPETAMPERING:{...M.PROTOTYPETAMPERING,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.PrototypeTampering)},UNCLICKABLE:{...M.UNCLICKABLE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Unclickable)},UNDOCUMENTEDFUNCTIONCALL:{...M.UNDOCUMENTEDFUNCTIONCALL,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.UndocumentedFunctionCall)},TIMECOMPRESSION:{...M.TIMECOMPRESSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TimeCompression)},REALITYALTERATION:{...M.REALITYALTERATION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.RealityAlteration)},N00DLES:{...M.N00DLES,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.N00dles)},EDITSAVEFILE:{...M.EDITSAVEFILE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.EditSaveFile)},UNACHIEVABLE:{...M.UNACHIEVABLE,Icon:"SF-1",Secret:!0,Condition:()=>!1},CHALLENGE_BN13:{...M.CHALLENGE_BN13,Icon:"BN13+",Visible:()=>T(y.a,13),Condition:()=>13===y.a.bitNodeN&&A()&&!y.a.augmentations.some(t=>t.name===a.a.StaneksGift1)},DEVMENU:{...M.DEVMENU,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.YoureNotMeantToAccessThis)},RAINBOW:{...M.RAINBOW,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.INeedARainbow)},TRUE_RECURSION:{...M.TRUE_RECURSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TrueRecursion)}};function P(){const t=y.a.achievements.map(t=>t.ID),e=Object.values(N).filter(e=>!t.includes(e.ID)&&e.Condition()).flatMap(t=>[t.ID,...t.AdditionalUnlock||[]]);for(const t of e)y.a.giveAchievement(t);document.achievements=[...y.a.achievements.map(t=>t.ID)]}},,function(t,e,n){"use strict";function a(t,e=1){return 1+e*Math.pow(t,.8)/600}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(384),r=n(32),i=n(360),o=n(15);const s={name:"",info:"",companyPositions:{},expMultiplier:1,salaryMultiplier:1,jobStatReqOffset:0};class l{constructor(t=s){this.name=t.name,this.info=t.info,this.companyPositions=t.companyPositions,this.expMultiplier=t.expMultiplier,this.salaryMultiplier=t.salaryMultiplier,this.jobStatReqOffset=t.jobStatReqOffset,this.isPlayerEmployed=!1,this.playerReputation=1,this.favor=0,this.isMegacorp=!1,t.isMegacorp&&(this.isMegacorp=!0)}hasPosition(t){return t instanceof a.a?null!=this.companyPositions[t.name]:null!=this.companyPositions[t]}hasAgentPositions(){return null!=this.companyPositions[r.a[0]]}hasBusinessConsultantPositions(){return null!=this.companyPositions[r.c[0]]}hasBusinessPositions(){return null!=this.companyPositions[r.b[0]]}hasEmployeePositions(){return null!=this.companyPositions[r.e[1]]}hasITPositions(){return null!=this.companyPositions[r.d[0]]}hasSecurityPositions(){return null!=this.companyPositions[r.h[2]]}hasSoftwareConsultantPositions(){return null!=this.companyPositions[r.k[0]]}hasSoftwarePositions(){return null!=this.companyPositions[r.j[0]]}hasWaiterPositions(){return null!=this.companyPositions[r.e[0]]}gainFavor(){null==this.favor&&(this.favor=0),this.favor+=this.getFavorGain()}getFavorGain(){null==this.favor&&(this.favor=0);const t=Math.max(0,Object(i.a)(this.favor))+this.playerReputation;return Object(i.b)(t)-this.favor}toJSON(){return Object(o.b)("Company",this)}static fromJSON(t){return Object(o.a)(l,t.data)}}o.c.constructors.Company=l},function(t,e,n){"use strict";function a(t){const e=[];for(let n=0;n
Filename: "+n+"

Line Number: "+r+"

This is a bug, please report to game developer with this message as well as details about how to reproduce the bug.

If you want to be safe, I suggest refreshing the game WITHOUT saving so that your save doesn't get corrupted")}},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(15),r=n(103),i=n(13),o=n(626);const s=t=>null!==t&&t.type===r.b.BLADEBURNER;class l extends r.a{constructor(t){var e,n,a,i,o;super(r.b.BLADEBURNER),o=0,(i="cyclesWorked")in(a=this)?Object.defineProperty(a,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[i]=o,this.actionType=null!==(e=null==t?void 0:t.type)&&void 0!==e?e:"General",this.actionName=null!==(n=null==t?void 0:t.name)&&void 0!==n?n:"Field analysis"}cyclesNeeded(t,e){var n;const a=null===(n=t.bladeburner)||void 0===n?void 0:n.getActionTimeNetscriptFn(e,this.actionType,this.actionName);if(!a||"string"==typeof a)throw new Error(`Error querying ${this.actionName} time`);return a/i.a._idleSpeed}process(t,e,n){if(!t.bladeburner)throw new Error("sleeve doing blade work without being a member");this.cyclesWorked+=n;const a=t.bladeburner.getActionIdFromTypeAndName(this.actionType,this.actionName);if(!a)throw new Error(`Error getting ${this.actionName} action`);if("Contracts"===this.actionType){const n=t.bladeburner.getActionObject(a);if(!n)throw new Error(`Error getting ${this.actionName} action object`);if(n.count<=0)return e.stopWork(t),0}for(;this.cyclesWorked>this.cyclesNeeded(t,e);){if("Contracts"===this.actionType){const n=t.bladeburner.getActionObject(a);if(!n)throw new Error(`Error getting ${this.actionName} action object`);if(n.count<=0)return e.stopWork(t),0}const n=t.bladeburner.completeAction(t,e,a,!1);let s;if("General"===this.actionType){var i;if(s=null===(i=o.a[this.actionName])||void 0===i?void 0:i.exp,!s)throw new Error(`Somehow there was no exp for action ${this.actionType} ${this.actionName}`);Object(r.c)(t,e,s,1)}t.gainMoney(n.money,"sleeves"),t.gainStats(n),this.cyclesWorked-=this.cyclesNeeded(t,e)}return 0}APICopy(){return{actionType:this.actionType,actionName:this.actionName}}toJSON(){return Object(a.b)("SleeveBladeburnerWork",this)}static fromJSON(t){return Object(a.a)(l,t.data)}}a.c.constructors.SleeveBladeburnerWork=l},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r})),function(t){t[t.Export=0]="Export",t[t.SmartSupply=1]="SmartSupply",t[t.MarketResearchDemand=2]="MarketResearchDemand",t[t.MarketDataCompetition=3]="MarketDataCompetition",t[t.VeChain=4]="VeChain",t[t.ShadyAccounting=5]="ShadyAccounting",t[t.GovernmentPartnership=6]="GovernmentPartnership",t[t.WarehouseAPI=7]="WarehouseAPI",t[t.OfficeAPI=8]="OfficeAPI"}(a||(a={}));const r={[a.Export]:{index:0,price:2e10,name:"Export",desc:"Develop infrastructure to export your materials to your other facilities. This allows you to move materials around between different divisions and cities."},[a.SmartSupply]:{index:1,price:25e9,name:"Smart Supply",desc:"Use advanced AI to anticipate your supply needs. This allows you to purchase exactly however many materials you need for production."},[a.MarketResearchDemand]:{index:2,price:5e9,name:"Market Research - Demand",desc:"Mine and analyze market data to determine the demand of all resources. The demand attribute, which affects sales, will be displayed for every material and product."},[a.MarketDataCompetition]:{index:3,price:5e9,name:"Market Data - Competition",desc:"Mine and analyze market data to determine how much competition there is on the market for all resources. The competition attribute, which affects sales, will be displayed for every material and product."},[a.VeChain]:{index:4,price:1e10,name:"VeChain",desc:"Use AI and blockchain technology to identify where you can improve your supply chain systems. This upgrade will allow you to view a wide array of useful statistics about your Corporation."},[a.ShadyAccounting]:{index:5,price:5e14,name:"Shady Accounting",desc:"Utilize unscrupulous accounting practices and pay off government officials to save money on taxes. This reduces the dividend tax rate by 5%."},[a.GovernmentPartnership]:{index:6,price:2e15,name:"Government Partnership",desc:"Help national governments further their agendas in exchange for lowered taxes. This reduces the dividend tax rate by 10%"},[a.WarehouseAPI]:{index:7,price:5e10,name:"Warehouse API",desc:"Enables the warehouse API."},[a.OfficeAPI]:{index:8,price:5e10,name:"Office API",desc:"Enables the office API."}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(74);const r=t=>{const e=[];for(const[t,n]of Object.entries(a.a))n.isSpecial||e.push(t);return e.filter(e=>!t.hasAugmentation(e))},i=t=>1+(t.getIntelligenceBonus(3)-1)/3,o=(t,e)=>e.time/i(t)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(136),r=n(59);const i={};i[r.a.OperationTyphoon]=new a.a({name:r.a.OperationTyphoon,baseDifficulty:2e3,reqdRank:2500,rankGain:50,rankLoss:10,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationZero]=new a.a({name:r.a.OperationZero,baseDifficulty:2500,reqdRank:5e3,rankGain:60,rankLoss:15,hpLoss:50,weights:{hack:.2,str:.15,def:.15,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),i[r.a.OperationX]=new a.a({name:r.a.OperationX,baseDifficulty:3e3,reqdRank:7500,rankGain:75,rankLoss:15,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationTitan]=new a.a({name:r.a.OperationTitan,baseDifficulty:4e3,reqdRank:1e4,rankGain:100,rankLoss:20,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationAres]=new a.a({name:r.a.OperationAres,baseDifficulty:5e3,reqdRank:12500,rankGain:125,rankLoss:20,hpLoss:200,weights:{hack:0,str:.25,def:.25,dex:.25,agi:.25,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationArchangel]=new a.a({name:r.a.OperationArchangel,baseDifficulty:7500,reqdRank:15e3,rankGain:200,rankLoss:20,hpLoss:25,weights:{hack:0,str:.2,def:.2,dex:.3,agi:.3,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationJuggernaut]=new a.a({name:r.a.OperationJuggernaut,baseDifficulty:1e4,reqdRank:2e4,rankGain:300,rankLoss:40,hpLoss:300,weights:{hack:0,str:.25,def:.25,dex:.25,agi:.25,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationRedDragon]=new a.a({name:r.a.OperationRedDragon,baseDifficulty:12500,reqdRank:25e3,rankGain:500,rankLoss:50,hpLoss:500,weights:{hack:.05,str:.2,def:.2,dex:.25,agi:.25,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationK]=new a.a({name:r.a.OperationK,baseDifficulty:15e3,reqdRank:3e4,rankGain:750,rankLoss:60,hpLoss:1e3,weights:{hack:.05,str:.2,def:.2,dex:.25,agi:.25,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationDeckard]=new a.a({name:r.a.OperationDeckard,baseDifficulty:2e4,reqdRank:4e4,rankGain:1e3,rankLoss:75,hpLoss:200,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationTyrell]=new a.a({name:r.a.OperationTyrell,baseDifficulty:25e3,reqdRank:5e4,rankGain:1500,rankLoss:100,hpLoss:500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationWallace]=new a.a({name:r.a.OperationWallace,baseDifficulty:3e4,reqdRank:75e3,rankGain:2e3,rankLoss:150,hpLoss:1500,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationShoulderOfOrion]=new a.a({name:r.a.OperationShoulderOfOrion,baseDifficulty:35e3,reqdRank:1e5,rankGain:2500,rankLoss:500,hpLoss:1500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),i[r.a.OperationHyron]=new a.a({name:r.a.OperationHyron,baseDifficulty:4e4,reqdRank:125e3,rankGain:3e3,rankLoss:1e3,hpLoss:500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationMorpheus]=new a.a({name:r.a.OperationMorpheus,baseDifficulty:45e3,reqdRank:15e4,rankGain:4e3,rankLoss:1e3,hpLoss:100,weights:{hack:.05,str:.15,def:.15,dex:.3,agi:.3,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),i[r.a.OperationIonStorm]=new a.a({name:r.a.OperationIonStorm,baseDifficulty:5e4,reqdRank:175e3,rankGain:5e3,rankLoss:1e3,hpLoss:5e3,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationAnnihilus]=new a.a({name:r.a.OperationAnnihilus,baseDifficulty:55e3,reqdRank:2e5,rankGain:7500,rankLoss:1e3,hpLoss:1e4,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationUltron]=new a.a({name:r.a.OperationUltron,baseDifficulty:6e4,reqdRank:25e4,rankGain:1e4,rankLoss:2e3,hpLoss:1e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationCenturion]=new a.a({name:r.a.OperationCenturion,baseDifficulty:7e4,reqdRank:3e5,rankGain:15e3,rankLoss:5e3,hpLoss:1e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}}),i[r.a.OperationVindictus]=new a.a({name:r.a.OperationVindictus,baseDifficulty:75e3,reqdRank:35e4,rankGain:2e4,rankLoss:2e4,hpLoss:2e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}}),i[r.a.OperationDaedalus]=new a.a({name:r.a.OperationDaedalus,baseDifficulty:8e4,reqdRank:4e5,rankGain:4e4,rankLoss:1e4,hpLoss:1e5,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(121),r=n(15);class i{constructor(t){t?(this.id=t.fragment.id,this.x=t.x,this.y=t.y,this.highestCharge=0,this.numCharge=0,this.rotation=t.rotation):(this.id=-1,this.x=-1,this.y=-1,this.highestCharge=0,this.numCharge=0,this.rotation=0)}collide(t){const e=this.fragment(),n=t.fragment(),a=t.x-this.x,r=t.y-this.y,i=Math.max(e.shape.length,e.shape[0].length);for(let o=0;o[this.x+t[0],this.y+t[1]])}copy(){return Object.assign({},this)}toJSON(){return Object(r.b)("ActiveFragment",this)}static fromJSON(t){return Object(r.a)(i,t.data)}}r.c.constructors.ActiveFragment=i},,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.SYSTEM=0]="SYSTEM",t[t.INTERFACE=1]="INTERFACE",t[t.GAMEPLAY=2]="GAMEPLAY",t[t.MISC=3]="MISC",t[t.REMOTE_API=4]="REMOTE_API"}(a||(a={}))},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(13),r=n(484);function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class o{constructor(t="",e="",n,a=0,r=0,o=0,s=0,l={}){i(this,"difficulty",0),i(this,"karma",0),i(this,"kills",0),i(this,"money",0),i(this,"name",""),i(this,"workName",""),i(this,"time",0),i(this,"hacking_success_weight",0),i(this,"strength_success_weight",0),i(this,"defense_success_weight",0),i(this,"dexterity_success_weight",0),i(this,"agility_success_weight",0),i(this,"charisma_success_weight",0),i(this,"hacking_exp",0),i(this,"strength_exp",0),i(this,"defense_exp",0),i(this,"dexterity_exp",0),i(this,"agility_exp",0),i(this,"charisma_exp",0),i(this,"intelligence_exp",0),this.name=t,this.workName=e,this.type=n,this.time=a,this.money=r,this.difficulty=o,this.karma=s,this.hacking_success_weight=l.hacking_success_weight?l.hacking_success_weight:0,this.strength_success_weight=l.strength_success_weight?l.strength_success_weight:0,this.defense_success_weight=l.defense_success_weight?l.defense_success_weight:0,this.dexterity_success_weight=l.dexterity_success_weight?l.dexterity_success_weight:0,this.agility_success_weight=l.agility_success_weight?l.agility_success_weight:0,this.charisma_success_weight=l.charisma_success_weight?l.charisma_success_weight:0,this.hacking_exp=l.hacking_exp?l.hacking_exp:0,this.strength_exp=l.strength_exp?l.strength_exp:0,this.defense_exp=l.defense_exp?l.defense_exp:0,this.dexterity_exp=l.dexterity_exp?l.dexterity_exp:0,this.agility_exp=l.agility_exp?l.agility_exp:0,this.charisma_exp=l.charisma_exp?l.charisma_exp:0,this.intelligence_exp=l.intelligence_exp?l.intelligence_exp:0,this.kills=l.kills?l.kills:0}commit(t,e=1,n=null){return e<=0&&(e=1),t.startWork(new r.a({crimeType:this.type,singularity:null!==n})),this.time}successRate(t){let e=this.hacking_success_weight*t.skills.hacking+this.strength_success_weight*t.skills.strength+this.defense_success_weight*t.skills.defense+this.dexterity_success_weight*t.skills.dexterity+this.agility_success_weight*t.skills.agility+this.charisma_success_weight*t.skills.charisma+a.a.IntelligenceCrimeWeight*t.skills.intelligence;return e/=a.a.MaxSkillLevel,e/=this.difficulty,e*=t.mults.crime_success,e*=t.getIntelligenceBonus(1),Math.min(e,1)}}},,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(7),o=n(228);function s({hashes:t}){return r.a.createElement(o.a,{hashes:i.a.formatHashes(t)+" h / s"})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e){this.filename=t,this.msg=e}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(558),i=n(26),o=n(9),s=n(21);function l(t){const e=i.b.Player();return a.createElement(a.Fragment,null,a.createElement(s.a,{title:a.createElement("span",{dangerouslySetInnerHTML:{__html:function(){const n=e.getNextCompanyPosition(t.company,t.entryPosType);return null==n?"":t.company.hasPosition(n)?Object(r.a)(t.company,n,!0):""}()}})},a.createElement(o.a,{onClick:t.onClick},t.text)))}},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1056),r=n(1057);const i={};for(const t of r.a)null!=i[(o=t).name]&&console.warn("Duplicate Research being defined: "+o.name),i[o.name]=new a.a(o);var o},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new(n(127).a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return m})),n.d(e,"a",(function(){return h}));var a=n(15),r=n(103),i=n(108),o=n(5),s=n(29),l=n(394),c=n(232),f=n(90),u=n(22);const m=t=>null!==t&&t.type===r.b.FACTION;class h extends r.a{constructor(t){var e,n;super(r.b.FACTION),this.factionWorkType=null!==(e=null==t?void 0:t.factionWorkType)&&void 0!==e?e:i.a.HACKING,this.factionName=null!==(n=null==t?void 0:t.factionName)&&void 0!==n?n:o.a.Sector12}getExpRates(t){return Object(f.d)(Object(l.a)(t,this.factionWorkType),t.shockBonus())}getReputationRate(t){const e=this.getFaction();return{[i.a.HACKING]:c.c,[i.a.FIELD]:c.a,[i.a.SECURITY]:c.b}[this.factionWorkType](t,e.favor)*t.shockBonus()*u.a.FactionWorkRepGain}getFaction(){const t=s.a[this.factionName];if(!t)throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);return t}process(t,e,n){if(t.gang&&this.factionName===t.gang.facName)return e.stopWork(t),0;const a=this.getExpRates(e);Object(r.c)(t,e,a,n);const i=this.getReputationRate(e);return this.getFaction().playerReputation+=i,0}APICopy(){return{type:this.type,factionWorkType:this.factionWorkType,factionName:this.factionName}}toJSON(){return Object(a.b)("SleeveFactionWork",this)}static fromJSON(t){return Object(a.a)(h,t.data)}}a.c.constructors.SleeveFactionWork=h},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return d})),n.d(e,"d",(function(){return p})),n.d(e,"c",(function(){return g})),n.d(e,"e",(function(){return y})),n.d(e,"b",(function(){return b}));var a=n(1),r=n(91),i=n(77),o=n(83),s=n(84),l=n(24),c=n(106),f=n(6),u=n(630),m=n(13),h=n(256);function d(){navigator.userAgent.toLowerCase().indexOf(" electron/")>-1&&(document.achievements=[],function(){function e(t){return t=t.replace(/\/\/+/g,"/"),(t=Object(i.k)(t)).includes("/")&&(t="/"+Object(i.k)(t)),t}document.getFiles=function(){const t=Object(l.d)("home");return null===t?{res:!1,msg:"Home server does not exist."}:{res:!0,data:{files:t.scripts.map(t=>({filename:t.filename,code:t.code,ramUsage:t.ramUsage}))}}},document.deleteFile=function(t){t=e(t);const n=Object(l.d)("home");return null===n?{res:!1,msg:"Home server does not exist."}:n.removeFile(t)},document.saveFile=function(n,r){var i;n=e(n),r=t.from(r,"base64").toString();const o=Object(l.d)("home");if(null===o)return{res:!1,msg:"Home server does not exist."};const{success:s,overwritten:c}=o.writeToScriptFile(a.a,n,r);let f;return s&&(f=o.getScript(n)),{res:s,data:{overwritten:c,ramUsage:null===(i=f)||void 0===i?void 0:i.ramUsage}}}}(),function(){const t={terminal:(t,e)=>{const n={info:o.a.info,warn:o.a.warn,error:o.a.error,success:o.a.success};let a;e&&(a=n[e]),a||(a=o.a.print),a.bind(o.a)(t)},toast:(t,e,n=2e3)=>s.b.emit(t,e,n)};window.appNotifier=t}(),function(){const t={triggerSave:()=>c.c.saveGame(!0),triggerGameExport:()=>{try{c.c.exportGame()}catch(t){console.error(t),s.b.emit("Could not export game.",s.d.ERROR,2e3)}},triggerScriptsExport:()=>Object(u.b)("*",a.a.getHomeComputer()),getSaveData:()=>({save:c.c.getSaveString(f.a.ExcludeRunningScriptsFromSave),fileName:c.c.getSaveFileName()}),getSaveInfo:async t=>{try{return(await c.c.getImportDataFromString(t)).playerData}catch(t){return void console.error(t)}},pushSaveData:(t,e=!1)=>r.b.toImportSave(t,e)};window.appSaveFns=t}(),function(){const t=window.electronBridge;if(!t)return;t.receive("get-save-data-request",()=>{const e=window.appSaveFns.getSaveData();t.send("get-save-data-response",e)}),t.receive("get-save-info-request",async e=>{if("string"!=typeof e)throw new Error("Error while trying to get save info");const n=await window.appSaveFns.getSaveInfo(e);t.send("get-save-info-response",n)}),t.receive("push-save-request",t=>{if("object"!=typeof t)throw new Error("Error trying to push save request");const{save:e,automatic:n=!1}=t;window.appSaveFns.pushSaveData(e,n)}),t.receive("trigger-save",()=>window.appSaveFns.triggerSave().then(()=>{t.send("save-completed")}).catch(t=>{console.error(t),s.b.emit("Could not save game.",s.d.ERROR,2e3)})),t.receive("trigger-game-export",()=>{try{window.appSaveFns.triggerGameExport()}catch(t){console.error(t),s.b.emit("Could not export game.",s.d.ERROR,2e3)}}),t.receive("trigger-scripts-export",()=>{try{window.appSaveFns.triggerScriptsExport()}catch(t){console.error(t),s.b.emit("Could not export scripts.",s.d.ERROR,2e3)}})}())}function p(t){const e=window.electronBridge;e&&e.send("push-game-saved",t)}function g(){const t=window.electronBridge;t&&t.send("push-game-ready",{player:{identifier:a.a.identifier,playtime:a.a.totalPlaytime,lastSave:a.a.lastSave},game:{version:m.a.VersionString,hash:Object(h.a)()}})}function y(t){const e=window.electronBridge;e&&(e.send("push-import-result",{wasImported:t}),b())}function b(){const t=window.electronBridge;t&&t.send("push-disable-restore",{duration:6e4})}}).call(this,n(171).Buffer)},,function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(16),r=n(15),i=n(12),o=n(13),s=n(63),l=n(153);const c=t=>null!==t&&t.type===l.b.CREATE_PROGRAM;class f extends l.a{constructor(t){var e,n;if(super(l.b.CREATE_PROGRAM,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.unitCompleted=0,this.programName=null!==(n=null==t?void 0:t.programName)&&void 0!==n?n:"",null!=t&&t.player){const e=t.player;for(let t=0;t=100)break;this.unitCompleted=r/100*this.unitNeeded(),e.getHomeComputer().programs.splice(t,1)}}}}unitNeeded(){var t,e;return null!==(t=null===(e=this.getProgram().create)||void 0===e?void 0:e.time)&&void 0!==t?t:0}getProgram(){const t=Object.values(s.a).find(t=>t.name.toLowerCase()===this.programName.toLowerCase());if(!t)throw new Error("Create program work started with invalid program "+this.programName);return t}process(t,e){var n,a;let r=1;t.hasAugmentation(i.a.NeuroreceptorManager)||(r=t.focus?1:o.a.BaseFocusBonus);const s=null!==(n=null===(a=this.getProgram().create)||void 0===a?void 0:a.level)&&void 0!==n?n:0;let l=t.skills.hacking/s*t.getIntelligenceBonus(3);return l=1+(l-1)/5,l*=r,this.cyclesWorked+=e,this.unitCompleted+=o.a._idleSpeed*e*l,this.unitCompleted>=this.unitNeeded()}finish(t,e){const n=this.programName;if(e){if(!t.getHomeComputer().programs.includes(n)){const e=n+"-"+(100*this.unitCompleted/this.unitNeeded()).toFixed(2)+"%-INC";t.getHomeComputer().programs.push(e)}}else{if(t.gainIntelligenceExp(o.a.IntelligenceProgramBaseExpGain*this.cyclesWorked*o.a._idleSpeed/1e3),!this.singularity){const t=[`You've finished creating ${n}!`,"The new program can be found on your home computer."];Object(a.a)(t.join("
"))}t.getHomeComputer().programs.includes(n)||t.getHomeComputer().programs.push(n)}}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,programName:this.programName}}toJSON(){return Object(r.b)("CreateProgramWork",this)}static fromJSON(t){return Object(r.a)(f,t.data)}}r.c.constructors.CreateProgramWork=f},function(t,e,n){"use strict";n.d(e,"b",(function(){return W})),n.d(e,"a",(function(){return H}));var a=n(0),r=n.n(a),i=n(126),o=n(122),s=n(148),l=n(7),c=n(144),f=n(1209),u=n(28),m=n(161),h=n(162),d=n(31),p=n(49),g=n(3),y=n(9),b=n(112),E=n(490),v=n.n(E),k=n(1213),w=n.n(k),S=n(6),_=n(26),C=n(413),x=n(22),L=n(21),O=n(20),M=n(55),A=n(13),T=n(311),R=n(391),N=n(226),P=n(364),I=n(327),D=n(484);function F(){const t=Object(i.a)(),e=_.b.Player(),n=W();if(0===e.skills.intelligence)return r.a.createElement(r.a.Fragment,null);const a=e.calculateSkillProgress(e.exp.intelligence);return r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:n.cell}},r.a.createElement(g.a,{classes:{root:n.int}},"Int ")),r.a.createElement(d.a,{align:"right",classes:{root:n.cell}},r.a.createElement(g.a,{classes:{root:n.int}},l.a.formatSkill(e.skills.intelligence))),r.a.createElement(d.a,{align:"right",classes:{root:n.cell}},r.a.createElement(g.a,{id:"overview-int-hook",classes:{root:n.int}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:a,color:t.colors.int})))}function j(){const t=_.b.Player(),e=W(),n=t.bladeburner;if(null===n)return r.a.createElement(r.a.Fragment,null);const a=n.getTypeAndNameFromActionId(n.action);return"Idle"===a.type?r.a.createElement(r.a.Fragment,null):r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:e.cellNone}},r.a.createElement(g.a,null,"Bladeburner:"))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:e.cellNone}},r.a.createElement(g.a,null,a.type,": ",a.name))))}function B({tooltip:t,children:e,onClickFocus:n,header:a}){const i=W();return r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:i.workCell}},r.a.createElement(L.a,{title:r.a.createElement(r.a.Fragment,null,t)},r.a.createElement(g.a,{className:i.workHeader,sx:{pt:1,pb:.5}},a)))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:i.workCell}},r.a.createElement(g.a,{className:i.workSubtitles},e))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",align:"center",colSpan:2,classes:{root:i.cellNone}},r.a.createElement(y.a,{sx:{mt:1},onClick:n},"Focus"))))}function G(){const t=_.b.Player(),e=_.b.Router();if(null===t.currentWork||t.focus)return r.a.createElement(r.a.Fragment,null);let n=r.a.createElement(r.a.Fragment,null),a=r.a.createElement(r.a.Fragment,null),i=r.a.createElement(r.a.Fragment,null);if(Object(D.b)(t.currentWork)){const e=t.currentWork.getCrime(),o=t.currentWork.unitCompleted/e.time*100;n=r.a.createElement(r.a.Fragment,null,t.currentWork.crimeType),a=r.a.createElement(r.a.Fragment,null,"You are attempting to ",t.currentWork.crimeType),i=r.a.createElement(r.a.Fragment,null,o.toFixed(2),"%")}if(Object(M.d)(t.currentWork)&&(n=r.a.createElement(r.a.Fragment,null,t.currentWork.getClass().youAreCurrently),a=r.a.createElement(r.a.Fragment,null,"You are ",t.currentWork.getClass().youAreCurrently),i=r.a.createElement(r.a.Fragment,null,Object(u.b)(t.currentWork.cyclesWorked*A.a._idleSpeed))),Object(T.b)(t.currentWork)){const e=t.currentWork;n=r.a.createElement(r.a.Fragment,null,"Coding ",e.programName),a=r.a.createElement(r.a.Fragment,null,"Creating a program"),i=r.a.createElement(r.a.Fragment,null,e.programName," ",(e.unitCompleted/e.unitNeeded()*100).toFixed(2),"%")}if(Object(R.b)(t.currentWork)){const e=t.currentWork;n=r.a.createElement(r.a.Fragment,null,"Grafting ",e.augmentation),a=r.a.createElement(r.a.Fragment,null,"Grafting an Augmentation"),i=r.a.createElement(r.a.Fragment,null,r.a.createElement("strong",null,(e.unitCompleted/e.unitNeeded()*100).toFixed(2),"%")," done")}if(Object(N.b)(t.currentWork)){const e=t.currentWork;a=r.a.createElement(r.a.Fragment,null,"Working for ",r.a.createElement("strong",null,e.factionName)),i=r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{reputation:e.getFaction().playerReputation})," rep",r.a.createElement("br",null),"(",r.a.createElement(P.a,{reputation:e.getReputationRate(t)*(1e3/A.a._idleSpeed)}),")")}if(Object(I.b)(t.currentWork)){const e=t.currentWork;n=r.a.createElement(r.a.Fragment,null,t.jobs[e.companyName]," at ",r.a.createElement("strong",null,e.companyName)),a=r.a.createElement(r.a.Fragment,null,"Working at ",r.a.createElement("strong",null,e.companyName)),i=r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{reputation:e.getCompany().playerReputation})," rep",r.a.createElement("br",null),"(",r.a.createElement(P.a,{reputation:e.getGainRates(t).reputation*(1e3/A.a._idleSpeed)}),")")}return r.a.createElement(B,{tooltip:n,header:a,onClickFocus:()=>{t.startFocusing(),e.toWork()}},i)}const W=Object(o.a)(t=>Object(s.a)({workCell:{textAlign:"center",maxWidth:"200px",borderBottom:"none",padding:0,margin:0},workHeader:{fontSize:"0.9rem"},workSubtitles:{fontSize:"0.8rem"},cellNone:{borderBottom:"none",padding:0,margin:0},cell:{padding:0,margin:0},hp:{color:t.colors.hp},money:{color:t.colors.money},hack:{color:t.colors.hack},combat:{color:t.colors.combat},cha:{color:t.colors.cha},int:{color:t.colors.int}}));function H({save:t,killScripts:e}){const[n,o]=Object(a.useState)(!1),s=_.b.Player(),c=Object(a.useState)(!1)[1];Object(a.useEffect)(()=>{const t=setInterval(()=>c(t=>!t),600);return()=>clearInterval(t)},[]);const u=W(),y=Object(i.a)(),E=s.calculateSkillProgress(s.exp.hacking,s.mults.hacking*x.a.HackingLevelMultiplier),k=s.calculateSkillProgress(s.exp.strength,s.mults.strength*x.a.StrengthLevelMultiplier),M=s.calculateSkillProgress(s.exp.defense,s.mults.defense*x.a.DefenseLevelMultiplier),A=s.calculateSkillProgress(s.exp.dexterity,s.mults.dexterity*x.a.DexterityLevelMultiplier),T=s.calculateSkillProgress(s.exp.agility,s.mults.agility*x.a.AgilityLevelMultiplier),R=s.calculateSkillProgress(s.exp.charisma,s.mults.charisma*x.a.CharismaLevelMultiplier);return r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{sx:{display:"block",m:1}},r.a.createElement(h.a,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hp}},"HP ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hp}},l.a.formatHp(s.hp.current)," / ",l.a.formatHp(s.hp.max))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-hp-hook",classes:{root:u.hp}}))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.money}},"Money ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.money}},l.a.formatMoney(s.money))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-money-hook",classes:{root:u.money}}))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hack}},"Hack ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hack}},l.a.formatSkill(s.skills.hacking)))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:E,color:y.colors.hack})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cell}},r.a.createElement(g.a,{classes:{root:u.hack}})),r.a.createElement(d.a,{align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-hack-hook",classes:{root:u.hack}}))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},"Str ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.strength))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-str-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:k,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},"Def ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.defense))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-def-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:M,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},"Dex ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.dexterity))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-dex-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:A,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cell}},r.a.createElement(g.a,{classes:{root:u.combat}},"Agi ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.agility))),r.a.createElement(d.a,{align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-agi-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:T,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.cha}},"Cha ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.cha}},l.a.formatSkill(s.skills.charisma))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-cha-hook",classes:{root:u.cha}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:R,color:y.colors.cha})),r.a.createElement(F,null),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-extra-hook-0",classes:{root:u.hack}})),r.a.createElement(d.a,{component:"th",scope:"row",align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-extra-hook-1",classes:{root:u.hack}})),r.a.createElement(d.a,{component:"th",scope:"row",align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-extra-hook-2",classes:{root:u.hack}}))),r.a.createElement(G,null),r.a.createElement(j,null))),r.a.createElement(O.a,{sx:{display:"flex",borderTop:"1px solid "+S.a.theme.welllight}},r.a.createElement(O.a,{sx:{display:"flex",flex:1,justifyContent:"flex-start",alignItems:"center"}},r.a.createElement(b.a,{"aria-label":"save game",onClick:t},r.a.createElement(L.a,{title:0!==S.a.AutosaveInterval?"Save game":"Save game (auto-saves are disabled!)"},r.a.createElement(v.a,{color:0!==S.a.AutosaveInterval?"primary":"error"})))),r.a.createElement(O.a,{sx:{display:"flex",flex:1,justifyContent:"flex-end",alignItems:"center"}},r.a.createElement(b.a,{"aria-label":"kill all scripts",onClick:()=>o(!0)},r.a.createElement(L.a,{title:"Kill all running scripts"},r.a.createElement(w.a,{color:"error"}))))),r.a.createElement(f.a,{open:n,onClose:()=>o(!1),killScripts:e}))}},,,function(t,e,n){"use strict";function a(t,e){if(e<0||e>100)return t;const n=t*(e/100);return t+(Math.random()*(2*n)-n)}n.d(e,"a",(function(){return a}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n){this.program=t,this.price=e,this.description=n}}},,,,,,,,function(t,e,n){"use strict";function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}));class r{constructor(t=""){a(this,"level",1),a(this,"name",""),this.name=t}}},function(t,e,n){"use strict";function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o}));const r=new class{constructor(){a(this,"m",1024),a(this,"a",341),a(this,"c",1),this.x=0,this.reset()}step(){this.x=(this.a*this.x+this.c)%this.m}random(){return this.step(),this.x/this.m}reset(){this.x=(new Date).getTime()%this.m}};class i{constructor(t){a(this,"s1",0),a(this,"s2",0),a(this,"s3",0);const e=t/1e3%3e4;this.s1=e,this.s2=e,this.s3=e}step(){this.s1=171*this.s1%30269,this.s2=172*this.s2%30307,this.s3=170*this.s3%30323}random(){return this.step(),(this.s1/30269+this.s2/30307+this.s3/30323)%1}}function o(t){let e=1779033703^t.length;for(let n=0;n>>19;const n=()=>(e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^=e>>>16)>>>0);let a=n(),r=n(),i=n(),o=n();return()=>{a>>>=0,r>>>=0,i>>>=0,o>>>=0;let t=a+r|0;return a=r^r>>>9,r=i+(i<<3)|0,i=i<<21|i>>>11,o=o+1|0,t=t+o|0,i=i+t|0,(t>>>0)/4294967296}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(15),o=n(153),s=n(385),l=n(10),c=n(627),f=n(78),u=n(90),m=n(16),h=n(144),d=n(12),p=n(13);const g=t=>null!==t&&t.type===o.b.COMPANY;class y extends o.a{constructor(t){var e,n;super(o.b.COMPANY,null!==(e=null==t?void 0:t.singularity)&&void 0!==e&&e),this.companyName=null!==(n=null==t?void 0:t.companyName)&&void 0!==n?n:l.a.NewTokyoNoodleBar}getCompany(){const t=f.a[this.companyName];if(!t)throw new Error(`Company not found: '${this.companyName}'`);return t}getGainRates(t){let e=1;return t.hasAugmentation(d.a.NeuroreceptorManager)||(e=t.focus?1:p.a.BaseFocusBonus),Object(u.d)(Object(c.a)(t,t,this.getCompany()),e)}process(t,e){this.cyclesWorked+=e;const n=this.getCompany(),a=this.getGainRates(t);return Object(u.a)(t,t,a,e,"work"),n.playerReputation+=a.reputation*e,Object(s.a)(n,a.reputation,e),!1}finish(){this.singularity||Object(m.a)(r.a.createElement(r.a.Fragment,null,"You finished working for ",this.companyName,r.a.createElement("br",null),"You have ",r.a.createElement(h.a,{reputation:this.getCompany().playerReputation})," reputation with them."))}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,companyName:this.companyName}}toJSON(){return Object(i.b)("CompanyWork",this)}static fromJSON(t){return Object(i.a)(y,t.data)}}i.c.constructors.CompanyWork=y},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(46),r=n(3),i=n(0),o=n.n(i);const s=t=>o.a.createElement(a.a,{sx:{height:"fit-content",p:1}},o.a.createElement(r.a,{variant:"h6"},t.title),t.children)},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({favor:{color:t.colors.rep}}));function l({favor:t}){const e=s();return a.createElement("span",{className:e.favor},"number"==typeof t?r.a.formatFavor(t):t)}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(127);const r=new a.a,i=new a.a},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(193),r=n(154),i=n(117),o=n(75),s=n(7),l=n(23),c=n(16),f=n(6),u=n(0);function m(t,e,n,a){const s=a.stockMarket.Orders;if(null==s){const t={};for(const e of Object.keys(a.stockMarket)){const n=a.stockMarket[e];n instanceof r.a&&(t[n.symbol]=[])}return void(a.stockMarket.Orders=t)}let l=s[t.symbol];if(null==l||l.constructor!==Array)return console.error(`Invalid Order book for ${t.symbol} in processOrders(): ${l}`),void(l=[]);for(const r of l)if(r.type===e&&r.pos===n)switch(r.type){case i.a.LimitBuy:(r.pos===o.a.Long&&t.price<=r.price||r.pos===o.a.Short&&t.price>=r.price)&&h(r,a);break;case i.a.LimitSell:case i.a.StopBuy:(r.pos===o.a.Long&&t.price>=r.price||r.pos===o.a.Short&&t.price<=r.price)&&h(r,a);break;case i.a.StopSell:(r.pos===o.a.Long&&t.price<=r.price||r.pos===o.a.Short&&t.price>=r.price)&&h(r,a);break;default:return void console.warn("Invalid order type: "+r.type)}}function h(t,e){const n=e.symbolToStockMap[t.stockSymbol];if(!(n instanceof r.a))return void console.error("Could not find stock for this order: "+t.stockSymbol);const m=e.stockMarket.Orders[n.symbol],h={suppressDialog:!0};let d=!0,p=!1;switch(t.type){case i.a.LimitBuy:case i.a.StopBuy:p=!0,t.pos===o.a.Long?d=Object(a.a)(n,t.shares,null,h)&&d:t.pos===o.a.Short&&(d=Object(a.d)(n,t.shares,null,h)&&d);break;case i.a.LimitSell:case i.a.StopSell:t.pos===o.a.Long?d=Object(a.c)(n,t.shares,null,h)&&d:t.pos===o.a.Short&&(d=Object(a.b)(n,t.shares,null,h)&&d);break;default:return void console.warn("Invalid order type: "+t.type)}const g=t.pos===o.a.Long?"Long":"Short";if(d){for(let e=0;e({...a})},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return m}));var a=n(0),r=n.n(a),i=n(127),o=n(39),s=n(3),l=n(20),c=n(797);const f=new i.a;let u=0;function m(){const[t,e]=Object(a.useState)([]);return Object(a.useEffect)(()=>f.subscribe(t=>{const n=u+"";u++,e(e=>{const a=function(t){return"string"==typeof t?Object(c.sha256)(t):Object(c.sha256)(JSON.stringify(t.props))}(t);return e.some(t=>t.hash===a)?e:[...e,{id:n,text:t,hash:a}]})}),[]),Object(a.useEffect)(()=>{function t(t){"Escape"===t.code&&e([])}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[]),r.a.createElement(r.a.Fragment,null,t.length>0&&r.a.createElement(o.a,{open:!0,onClose:function(){e(t=>t.slice(1,1e99))}},r.a.createElement(l.a,{overflow:"scroll",sx:{overflowWrap:"break-word",whiteSpace:"pre-line"}},r.a.createElement(s.a,{component:"span"},t[0].text))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(565);const r=()=>`${Object(a.a)(99)}.${Object(a.a)(9)}.${Object(a.a)(9)}.${Object(a.a)(9)}`},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(15),r=n(103);const i=t=>null!==t&&t.type===r.b.SUPPORT;class o extends r.a{constructor(t){var e;super(r.b.SUPPORT),t&&(null===(e=t.bladeburner)||void 0===e||e.sleeveSupport(!0))}process(){return 0}finish(t){var e;null===(e=t.bladeburner)||void 0===e||e.sleeveSupport(!1)}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveSupportWork",this)}static fromJSON(t){return Object(a.a)(o,t.data)}}a.c.constructors.SleeveSupportWork=o},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(6);const r=[];function i(t){if(r.find(e=>e.runningScript.pid===t.pid))return;const e=new Date;for(r.unshift({timeOfDeath:e,runningScript:t.scriptRef});r.length>a.a.MaxRecentScriptsCapacity;)r.pop()}},function(t,e,n){"use strict";function a(){return new Promise((t,e)=>{window.indexedDB||e("Indexed DB does not exists");const n=window.indexedDB.open("bitburnerSave",1);n.onupgradeneeded=function(){this.result.createObjectStore("savestring")},n.onerror=function(t){e("Failed to get IDB "+t)},n.onsuccess=function(){const n=this.result;n?t(n.transaction(["savestring"],"readwrite").objectStore("savestring")):e("database loading result was undefined")}})}function r(){return new Promise((t,e)=>{a().then(e=>new Promise((t,n)=>{const a=e.get("save");a.onerror=function(t){n("Error in Database request to get savestring: "+t)},a.onsuccess=function(){t(this.result)}}).then(e=>t(e))).catch(t=>e(t))})}function i(t){return a().then(e=>new Promise((n,a)=>{const r=e.put(t,"save");r.onerror=function(t){a("Error saving game to IndexedDB: "+t)},r.onsuccess=()=>n()}))}function o(){return a().then(t=>{t.delete("save")})}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return E})),n.d(e,"b",(function(){return b})),n.d(e,"c",(function(){return g}));var a=n(299),r=n(12),i=n(91),o=n(63),s=n(1),l=n(27),c=n(24),f=n(89),u=n(6),m=n(16),h=n(5),d=n(45);function p(t,e=!1){!e&&u.a.SuppressMessages||g(t.filename),function(t){if(y(t))return;const e=Object(c.d)("home");if(null==e)throw new Error("The home server doesn't exist. You done goofed.");e.messages.push(t.filename)}(t)}function g(t){const e=v[t];if(!(e instanceof a.a))throw new Error("trying to display unexistent message");const n="Message received from unknown sender:

"+e.msg+"

This message was saved as "+e.filename+" onto your home computer.";Object(m.a)(n)}function y(t){const e=Object(c.d)("home");if(null==e)throw new Error("The home server doesn't exist. You done goofed.");return e.messages.includes(t.filename)}function b(){if(i.b.page()===l.a.BitVerse)return;const t=v[E.Jumper0],e=v[E.Jumper1],n=v[E.Jumper2],a=v[E.Jumper3],u=v[E.Jumper4],m=v[E.CyberSecTest],h=v[E.NiteSecTest],g=v[E.BitRunnersTest],b=v[E.TruthGazer],k=v[E.RedPill];if(s.a.hasAugmentation(r.a.TheRedPill)){const t=Object(c.d)(f.a.WorldDaemon);if(!(t instanceof d.a))throw new Error("The world daemon is not a server???? Please un-break reality");s.a.skills.hacking>=t.requiredHackingSkill?p(k,0===s.a.sourceFiles.length):y(b)||p(b)}else if(!y(t)&&s.a.skills.hacking>=25){p(t);const e=o.a.Flight.name,n=s.a.getHomeComputer();n.programs.includes(e)||n.programs.push(e)}else!y(e)&&s.a.skills.hacking>=40?p(e):!y(m)&&s.a.skills.hacking>=50?p(m):!y(n)&&s.a.skills.hacking>=175?p(n):!y(h)&&s.a.skills.hacking>=200?p(h):!y(a)&&s.a.skills.hacking>=350?p(a):!y(u)&&s.a.skills.hacking>=490?p(u):!y(g)&&s.a.skills.hacking>=500&&p(g)}let E;!function(t){t.Jumper0="j0.msg",t.Jumper1="j1.msg",t.Jumper2="j2.msg",t.Jumper3="j3.msg",t.Jumper4="j4.msg",t.CyberSecTest="csec-test.msg",t.NiteSecTest="nitesec-test.msg",t.BitRunnersTest="19dfj3l1nd.msg",t.TruthGazer="truthgazer.msg",t.RedPill="icarus.msg"}(E||(E={}));const v={[E.Jumper0]:new a.a(E.Jumper0,"I know you can sense it. I know you're searching for it. It's why you spend night after night at your computer.

It's real, I've seen it. And I can help you find it. But not right now. You're not ready yet.

Use this program to track your progress

The fl1ght.exe program was added to your home computer

-jump3R"),[E.Jumper1]:new a.a(E.Jumper1,`Soon you will be contacted by a hacking group known as ${h.a.NiteSec}. They can help you with your search.

You should join them, garner their favor, and exploit them for their Augmentations. But do not trust them. They are not what they seem. No one is.

-jump3R`),[E.Jumper2]:new a.a(E.Jumper2,`Do not try to save the world. There is no world to save. If you want to find the truth, worry only about yourself. Ethics and morals will get you killed.

Watch out for a hacking group known as ${h.a.NiteSec}.

-jump3R`),[E.Jumper3]:new a.a(E.Jumper3,`You must learn to walk before you can run. And you must run before you can fly. Look for ${h.a.TheBlackHand}.

I.I.I.I

-jump3R`),[E.Jumper4]:new a.a(E.Jumper4,"To find what you are searching for, you must understand the bits. The bits are all around us. The runners will help you.

-jump3R"),[E.CyberSecTest]:new a.a(E.CyberSecTest,"We've been watching you. Your skills are very impressive. But you're wasting your talents. If you join us, you can put your skills to good use and change the world for the better. If you join us, we can unlock your full potential.

But first, you must pass our test. Find and install the backdoor on our server.

-"+h.a.CyberSec),[E.NiteSecTest]:new a.a(E.NiteSecTest,"People say that the corrupted governments and corporations rule the world. Yes, maybe they do. But do you know who everyone really fears? People like us. Because they can't hide from us. Because they can't fight shadows and ideas with bullets.

Join us, and people will fear you, too.

Find and install the backdoor on our server, avmnite-02h. Then, we will contact you again.

-"+h.a.NiteSec),[E.BitRunnersTest]:new a.a(E.BitRunnersTest,"We know what you are doing. We know what drives you. We know what you are looking for.

We can help you find the answers.

run4theh111z"),[E.TruthGazer]:new a.a(E.TruthGazer,"@&*($#@&__TH3__#@A&#@*)__TRU1H__(*)&*)($#@&()E&R)W&
%@*$^$()@&$)$*@__CAN__()(@^#)@&@)#__N0__(#@&#)@&@&(
*(__LON6ER__^#)@)(()*#@)@__ESCAP3__)#(@(#@*@()@(#*$
()@)#$*%)$#()$#__Y0UR__(*)$#()%(&(%)*!)($__GAZ3__#("),[E.RedPill]:new a.a(E.RedPill,"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%
)@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)
@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB
DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)")}},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(15),r=n(103),i=n(55),o=n(10),s=n(257),l=n(90);const c=t=>null!==t&&t.type===r.b.CLASS;class f extends r.a{constructor(t){var e,n;super(r.b.CLASS),this.classType=null!==(e=null==t?void 0:t.classType)&&void 0!==e?e:i.a.StudyComputerScience,this.location=null!==(n=null==t?void 0:t.location)&&void 0!==n?n:o.a.Sector12RothmanUniversity}calculateRates(t,e){return Object(l.d)(Object(s.a)(t,e,this.classType,this.location),e.shockBonus(),!1)}isGym(){return[i.a.GymAgility,i.a.GymDefense,i.a.GymDexterity,i.a.GymStrength].includes(this.classType)}process(t,e,n){const a=this.calculateRates(t,e);return Object(r.c)(t,e,a,n),0}APICopy(){return{type:this.type,classType:this.classType,location:this.location}}toJSON(){return Object(a.b)("SleeveClassWork",this)}static fromJSON(t){return Object(a.a)(f,t.data)}}a.c.constructors.SleeveClassWork=f},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(15),r=n(103),i=n(137),o=n(85),s=n(90),l=n(13),c=n(22);const f=t=>null!==t&&t.type===r.b.CRIME;class u extends r.a{constructor(t){var e,n,a;super(r.b.CRIME),a=0,(n="cyclesWorked")in(e=this)?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,this.crimeType=null!=t?t:i.a.SHOPLIFT}getCrime(){const t=Object.values(o.a).find(t=>t.type===this.crimeType);if(!t)throw new Error("crime should not be undefined");return t}getExp(){const t=this.getCrime();return Object(s.c)({money:t.money*c.a.CrimeMoney,hackExp:t.hacking_exp*c.a.CrimeExpGain,strExp:t.strength_exp*c.a.CrimeExpGain,defExp:t.defense_exp*c.a.CrimeExpGain,dexExp:t.dexterity_exp*c.a.CrimeExpGain,agiExp:t.agility_exp*c.a.CrimeExpGain,chaExp:t.charisma_exp*c.a.CrimeExpGain,intExp:t.intelligence_exp*c.a.CrimeExpGain})}cyclesNeeded(){return this.getCrime().time/l.a._idleSpeed}process(t,e,n){this.cyclesWorked+=n;const a=this.getCrime();let i=this.getExp();return this.cyclesWorked>=this.cyclesNeeded()&&(Math.random(){try{return r.a[t].getInfo().offerHackingWork}catch(t){return console.error("Error when trying to filter Hacking Factions for Coding Contract Generation: "+t),!1}});return e===a.c.FactionReputation&&0===n.length&&(e=a.c.CompanyReputation),e===a.c.FactionReputationAll&&0===n.length&&(e=a.c.CompanyReputation),e===a.c.CompanyReputation&&0===Object.keys(i.a.jobs).length&&(e=a.c.Money),e}(t.type);const e=i.a.factions.filter(t=>r.a[t].getInfo().offerHackingWork);switch(t.type){case a.c.FactionReputation:{const n=e.length,a=e[Object(c.a)(0,n-1)];t.name=a;break}case a.c.CompanyReputation:{const e=Object.keys(i.a.jobs);e.length>0?t.name=e[Object(c.a)(0,e.length-1)]:t.type=a.c.Money;break}}return t}function p(){const t=Object(o.c)().filter(t=>0!==t.serversOnNetwork.length);let e=Object(c.a)(0,t.length-1),n=t[e];for(let a=0;a<200&&(!(n instanceof l.a)||n.purchasedByPlayer||n.hostname===s.a.WorldDaemon);++a)e=Object(c.a)(0,t.length-1),n=t[e];return n}function g(t,e){let n="contract-"+Object(c.a)(0,1e6);for(let e=0;e<1e3&&!(t.contracts.filter(t=>t.fn===n).length<=0);++e)n="contract-"+Object(c.a)(0,1e6);return e.name&&(n+="-"+e.name.replace(/\s/g,"")),n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return s}));var a=n(29);let r=0;function i(){return(new Date).getTime()-r>864e5}function o(t){if(i()){for(const e of t.factions)a.a[e].favor++;r=(new Date).getTime()}}function s(t){r=t}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(7),o=n(144);function s({reputation:t}){return r.a.createElement(o.a,{reputation:i.a.formatReputation(t)+" / sec"})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(3),i=n(9),o=n(46),s=n(20);function l(t){return a.createElement(s.a,null,a.createElement(o.a,{sx:{my:1,p:1}},a.createElement(i.a,{onClick:t.onClick},t.buttonText),a.createElement(r.a,null,t.infoText)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(62),r=n(482),i=n(15);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class s extends r.a{constructor(t=null){super(t),o(this,"reqdRank",100),o(this,"teamCount",0),t&&t.reqdRank&&(this.reqdRank=t.reqdRank),t&&t.teamCount&&(this.teamCount=t.teamCount)}getTeamSuccessBonus(t){if(this.teamCount&&this.teamCount>0){this.teamCount=Math.min(this.teamCount,t.teamSize);return Math.pow(this.teamCount,.05)}return 1}getActionTypeSkillSuccessBonus(t){return t.skillMultipliers.successChanceOperation}getChaosDifficultyBonus(t){const e=t.getCurrentCity();if(e.chaos>a.a.ChaosThreshold){const t=e.chaos-a.a.ChaosThreshold+1;return Math.pow(t,.5)}return 1}toJSON(){return Object(i.b)("Operation",this)}static fromJSON(t){return Object(i.a)(s,t.data)}}i.c.constructors.Operation=s},function(t,e,n){"use strict";n.d(e,"e",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return p})),n.d(e,"d",(function(){return g})),n.d(e,"f",(function(){return y}));var a=n(36),r=n(12),i=n(1),o=n(63),s=n(326),l=n(0),c=n.n(l),f=n(5),u=n(13);const m=()=>[new a.a({name:r.a.WKSharmonizer,repCost:1e4,moneyCost:1e6,info:`A copy of the WKS harmonizer from the MIA leader of the ${f.a.ShadowsOfAnarchy} injects *Γ-based cells that provides general enhancement to the body.`,stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes many aspects of infiltration easier and more productive. Such as increased timer, rewards, reduced damage taken, etc."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.MightOfAres,repCost:1e4,moneyCost:1e6,info:"Extra-occular neurons taken from old martial art master. Injecting them gives the user the ability to predict the enemy's attack before they even know it themself.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Slash minigame easier by showing you via an indicator when the slash in coming."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.WisdomOfAthena,repCost:1e4,moneyCost:1e6,info:"A connective brain implant to SASHA that focuses on pattern recognition and predictive templating.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Bracket minigame easier by removing all '[' ']'."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.ChaosOfDionysus,repCost:1e4,moneyCost:1e6,info:"Opto-occipito implant to process visual signals before brain interpretation.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Backwards minigame easier by flipping the words."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.BeautyOfAphrodite,repCost:1e4,moneyCost:1e6,info:"Pheromone extruder injected in the thoracodorsal nerve. Emits pleasing scent guaranteed to make conversational partners more agreeable.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Bribe minigame easier by indicating the incorrect paths."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.TrickeryOfHermes,repCost:1e4,moneyCost:1e6,info:"Penta-dynamo-neurovascular-valve inserted in the carpal ligament, enhances dexterity.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Cheat Code minigame easier by allowing the opposite character."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.FloodOfPoseidon,repCost:1e4,moneyCost:1e6,info:"Transtinatium VVD reticulator used in optico-sterbing recognition.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Symbol matching minigame easier by indicating the correct choice."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.HuntOfArtemis,repCost:1e4,moneyCost:1e6,info:"magneto-turboencabulator based on technology by Micha Eike Siemon, increases the user's electro-magnetic sensitivity.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Minesweeper minigame easier by showing the location of all mines and keeping their position."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.KnowledgeOfApollo,repCost:1e4,moneyCost:1e6,info:"Neodynic retention fjengeln spoofer using -φ karmions, net positive effect on implantee's delta wave.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Wire Cutting minigame easier by indicating the incorrect wires."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]})],h=()=>[new a.a({name:r.a.HemoRecirculator,moneyCost:45e6,repCost:1e4,info:"A heart implant that greatly increases the body's ability to effectively use and pump blood.",strength:1.08,defense:1.08,agility:1.08,dexterity:1.08,factions:[f.a.Tetrads,f.a.TheDarkArmy,f.a.TheSyndicate]}),new a.a({name:r.a.Targeting1,moneyCost:15e6,repCost:5e3,info:"A cranial implant that is embedded within the inner ear structures and optic nerves. It regulates and enhances balance and hand-eye coordination.",dexterity:1.1,factions:[f.a.SlumSnakes,f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Sector12,f.a.Ishima,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.Targeting2,moneyCost:425e5,repCost:8750,info:"This upgraded version of the 'Augmented Targeting' implant is capable of augmenting reality by digitally displaying weaknesses and vital signs of threats.",prereqs:[r.a.Targeting1],dexterity:1.2,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Sector12,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.Targeting3,moneyCost:115e6,repCost:27500,info:"The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.",prereqs:[r.a.Targeting2,r.a.Targeting1],dexterity:1.3,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries,f.a.TheCovenant]}),new a.a({name:r.a.SyntheticHeart,moneyCost:2875e6,repCost:75e4,info:"This advanced artificial heart, created from plasteel and graphene, is capable of pumping blood more efficiently than an organic heart.",agility:1.5,strength:1.5,factions:[f.a.KuaiGongInternational,f.a.FulcrumSecretTechnologies,f.a.SpeakersForTheDead,f.a.NWO,f.a.TheCovenant,f.a.Daedalus,f.a.Illuminati]}),new a.a({name:r.a.SynfibrilMuscle,repCost:437500,moneyCost:1125e6,info:"The myofibrils in human muscles are injected with special chemicals that react with the proteins inside the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. Scientists have named these artificially enhanced units 'synfibrils'.",strength:1.3,defense:1.3,factions:[f.a.KuaiGongInternational,f.a.FulcrumSecretTechnologies,f.a.SpeakersForTheDead,f.a.NWO,f.a.TheCovenant,f.a.Daedalus,f.a.Illuminati,f.a.BladeIndustries]}),new a.a({name:r.a.CombatRib1,repCost:7500,moneyCost:2375e4,info:"The rib cage is augmented to continuously release boosters into the bloodstream which increase the oxygen-carrying capacity of blood.",strength:1.1,defense:1.1,factions:[f.a.SlumSnakes,f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Volhaven,f.a.Ishima,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.CombatRib2,repCost:18750,moneyCost:65e6,info:"An upgraded version of the 'Combat Rib' augmentation that adds potent stimulants which improve focus and endurance while decreasing reaction time and fatigue.",prereqs:[r.a.CombatRib1],strength:1.14,defense:1.14,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Volhaven,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.CombatRib3,repCost:35e3,moneyCost:12e7,info:"The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that improve muscle mass and physical performance while being safe and free of side effects.",prereqs:[r.a.CombatRib2,r.a.CombatRib1],strength:1.18,defense:1.18,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries,f.a.TheCovenant]}),new a.a({name:r.a.NanofiberWeave,repCost:37500,moneyCost:125e6,info:"Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning, which improves its regenerative and extracellular homeostasis abilities.",strength:1.2,defense:1.2,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.OmniTekIncorporated,f.a.BladeIndustries,f.a.TianDiHui,f.a.SpeakersForTheDead,f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.SubdermalArmor,repCost:875e3,moneyCost:325e7,info:"The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. The material is implanted underneath the skin, and is the most advanced form of defensive enhancement that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to mitigate damage from any fire or electrical traumas.",defense:2.2,factions:[f.a.TheSyndicate,f.a.FulcrumSecretTechnologies,f.a.Illuminati,f.a.Daedalus,f.a.TheCovenant]}),new a.a({name:r.a.WiredReflexes,repCost:1250,moneyCost:25e5,info:"Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, supercharging the spread of neural signals and increasing reflex speed.",agility:1.05,dexterity:1.05,factions:[f.a.TianDiHui,f.a.SlumSnakes,f.a.Sector12,f.a.Volhaven,f.a.Aevum,f.a.Ishima,f.a.TheSyndicate,f.a.TheDarkArmy,f.a.SpeakersForTheDead]}),new a.a({name:r.a.GrapheneBoneLacings,repCost:1125e3,moneyCost:425e7,info:"Graphene is grafted and fused into the skeletal structure, enhancing bone density and tensile strength.",strength:1.7,defense:1.7,factions:[f.a.FulcrumSecretTechnologies,f.a.TheCovenant]}),new a.a({name:r.a.BionicSpine,repCost:45e3,moneyCost:125e6,info:"The spine is reconstructed using plasteel and carbon fibers. It is now capable of stimulating and regulating neural signals passing through the spinal cord, improving senses and reaction speed. The 'Bionic Spine' also interfaces with all other 'Bionic' implants.",strength:1.15,defense:1.15,agility:1.15,dexterity:1.15,factions:[f.a.SpeakersForTheDead,f.a.TheSyndicate,f.a.KuaiGongInternational,f.a.OmniTekIncorporated,f.a.BladeIndustries]}),new a.a({name:r.a.GrapheneBionicSpine,repCost:1625e3,moneyCost:6e9,info:"An upgrade to the 'Bionic Spine' augmentation. The spine is fused with graphene which enhances durability and supercharges all body functions.",prereqs:[r.a.BionicSpine],strength:1.6,defense:1.6,agility:1.6,dexterity:1.6,factions:[f.a.FulcrumSecretTechnologies,f.a.ECorp]}),new a.a({name:r.a.BionicLegs,repCost:15e4,moneyCost:375e6,info:"Cybernetic legs, created from plasteel and carbon fibers, enhance running speed.",agility:1.6,factions:[f.a.SpeakersForTheDead,f.a.TheSyndicate,f.a.KuaiGongInternational,f.a.OmniTekIncorporated,f.a.BladeIndustries]}),new a.a({name:r.a.GrapheneBionicLegs,repCost:75e4,moneyCost:45e8,info:"An upgrade to the 'Bionic Legs' augmentation. The legs are fused with graphene, greatly enhancing jumping ability.",prereqs:[r.a.BionicLegs],agility:2.5,factions:[f.a.MegaCorp,f.a.ECorp,f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.SpeechProcessor,repCost:7500,moneyCost:5e7,info:"A cochlear implant with an embedded computer that analyzes incoming speech. The embedded computer processes characteristics of incoming speech, such as tone and inflection, to pick up on subtle cues and aid in social interactions.",charisma:1.2,factions:[f.a.TianDiHui,f.a.Chongqing,f.a.Sector12,f.a.NewTokyo,f.a.Aevum,f.a.Ishima,f.a.Volhaven,f.a.Silhouette]}),new a.a({name:r.a.TITN41Injection,repCost:25e3,moneyCost:19e7,info:"TITN is a series of viruses that targets and alters the sequences of human DNA in genes that control personality. The TITN-41 strain alters these genes so that the subject becomes more outgoing and sociable.",charisma:1.15,charisma_exp:1.15,factions:[f.a.Silhouette]}),new a.a({name:r.a.EnhancedSocialInteractionImplant,repCost:375e3,moneyCost:1375e6,info:"A cranial implant that greatly assists in the user's ability to analyze social situations and interactions. The system uses a wide variety of factors such as facial expression, body language, voice tone, and inflection to determine the best course of action during social situations. The implant also uses deep learning software to continuously learn new behavior patterns and how to best respond.",charisma:1.6,charisma_exp:1.6,factions:[f.a.BachmanAssociates,f.a.NWO,f.a.ClarkeIncorporated,f.a.OmniTekIncorporated,f.a.FourSigma]}),new a.a({name:r.a.BitWire,repCost:3750,moneyCost:1e7,info:"A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing capabilities.",hacking:1.05,factions:[f.a.CyberSec,f.a.NiteSec]}),new a.a({name:r.a.ArtificialBioNeuralNetwork,repCost:275e3,moneyCost:3e9,info:"A network consisting of millions of nanoprocessors is embedded into the brain. The network is meant to mimic the way a biological brain solves a problem, with each nanoprocessor acting similar to the way a neuron would in a neural network. However, these nanoprocessors are programmed to perform computations much faster than organic neurons, allowing the user to solve much more complex problems at a much faster rate.",hacking_speed:1.03,hacking_money:1.15,hacking:1.12,factions:[f.a.BitRunners,f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.ArtificialSynapticPotentiation,repCost:6250,moneyCost:8e7,info:"The body is injected with a chemical that artificially induces synaptic potentiation, otherwise known as the strengthening of synapses. This results in enhanced cognitive abilities.",hacking_speed:1.02,hacking_chance:1.05,hacking_exp:1.05,factions:[f.a.TheBlackHand,f.a.NiteSec]}),new a.a({name:r.a.EnhancedMyelinSheathing,repCost:1e5,moneyCost:1375e6,info:"Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. This process results in the proliferation of new, synthetic myelin sheaths in the nervous system. These myelin sheaths can propogate neuro-signals much faster than their organic counterparts, leading to greater processing speeds and better brain function.",hacking_speed:1.03,hacking_exp:1.1,hacking:1.08,factions:[f.a.FulcrumSecretTechnologies,f.a.BitRunners,f.a.TheBlackHand]}),new a.a({name:r.a.SynapticEnhancement,repCost:2e3,moneyCost:75e5,info:"A small cranial implant that continuously uses weak electrical signals to stimulate the brain and induce stronger synaptic activity. This improves the user's cognitive abilities.",hacking_speed:1.03,factions:[f.a.CyberSec,f.a.Aevum]}),new a.a({name:r.a.NeuralRetentionEnhancement,repCost:2e4,moneyCost:25e7,info:"Chemical injections are used to permanently alter and strengthen the brain's neuronal circuits, strengthening the ability to retain information.",hacking_exp:1.25,factions:[f.a.NiteSec]}),new a.a({name:r.a.DataJack,repCost:112500,moneyCost:45e7,info:"A brain implant that provides an interface for direct, wireless communication between a computer's main memory and the mind. This implant allows the user to not only access a computer's memory, but also alter and delete it.",hacking_money:1.25,factions:[f.a.BitRunners,f.a.TheBlackHand,f.a.NiteSec,f.a.Chongqing,f.a.NewTokyo]}),new a.a({name:r.a.ENM,repCost:15e3,moneyCost:25e7,info:"A thin device embedded inside the arm containing a wireless module capable of connecting to nearby networks. Once connected, the Netburner Module is capable of capturing and processing all of the traffic on that network. By itself, the Embedded Netburner Module does not do much, but a variety of very powerful upgrades can be installed that allow you to fully control the traffic on a network.",hacking:1.08,factions:[f.a.BitRunners,f.a.TheBlackHand,f.a.NiteSec,f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.BladeIndustries]}),new a.a({name:r.a.ENMCore,repCost:175e3,moneyCost:25e8,info:"The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgrade allows the Embedded Netburner Module to generate its own data on a network.",prereqs:[r.a.ENM],hacking_speed:1.03,hacking_money:1.1,hacking_chance:1.03,hacking_exp:1.07,hacking:1.07,factions:[f.a.BitRunners,f.a.TheBlackHand,f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.BladeIndustries]}),new a.a({name:r.a.ENMCoreV2,repCost:1e6,moneyCost:45e8,info:"The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgraded firmware allows the Embedded Netburner Module to control information on a network by re-routing traffic, spoofing IP addresses, and altering the data inside network packets.",prereqs:[r.a.ENMCore,r.a.ENM],hacking_speed:1.05,hacking_money:1.3,hacking_chance:1.05,hacking_exp:1.15,hacking:1.08,factions:[f.a.BitRunners,f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.BladeIndustries,f.a.OmniTekIncorporated,f.a.KuaiGongInternational]}),new a.a({name:r.a.ENMCoreV3,repCost:175e4,moneyCost:75e8,info:"The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into any device on a network.",prereqs:[r.a.ENMCoreV2,r.a.ENMCore,r.a.ENM],hacking_speed:1.05,hacking_money:1.4,hacking_chance:1.1,hacking_exp:1.25,hacking:1.1,factions:[f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.Daedalus,f.a.TheCovenant,f.a.Illuminati]}),new a.a({name:r.a.ENMAnalyzeEngine,repCost:625e3,moneyCost:6e9,info:"Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster that vastly outperforms the Netburner Module's native single-core processor.",prereqs:[r.a.ENM],hacking_speed:1.1,factions:[f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.Daedalus,f.a.TheCovenant,f.a.Illuminati]}),new a.a({name:r.a.ENMDMA,repCost:1e6,moneyCost:7e9,info:"This implant installs a Direct Memory Access (DMA) controller into the Embedded Netburner Module. This allows the Module to send and receive data directly to and from the main memory of devices on a network.",prereqs:[r.a.ENM],hacking_money:1.4,hacking_chance:1.2,factions:[f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.Daedalus,f.a.TheCovenant,f.a.Illuminati]}),new a.a({name:r.a.Neuralstimulator,repCost:5e4,moneyCost:3e9,info:"A cranial implant that intelligently stimulates certain areas of the brain in order to improve cognitive functions.",hacking_speed:1.02,hacking_chance:1.1,hacking_exp:1.12,factions:[f.a.TheBlackHand,f.a.Chongqing,f.a.Sector12,f.a.NewTokyo,f.a.Aevum,f.a.Ishima,f.a.Volhaven,f.a.BachmanAssociates,f.a.ClarkeIncorporated,f.a.FourSigma]}),new a.a({name:r.a.NeuralAccelerator,repCost:2e5,moneyCost:175e7,info:"A microprocessor that accelerates the processing speed of biological neural networks. This is a cranial implant that is embedded inside the brain.",hacking:1.1,hacking_exp:1.15,hacking_money:1.2,factions:[f.a.BitRunners]}),new a.a({name:r.a.CranialSignalProcessorsG1,repCost:1e4,moneyCost:7e7,info:"The first generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",hacking_speed:1.01,hacking:1.05,factions:[f.a.CyberSec,f.a.NiteSec]}),new a.a({name:r.a.CranialSignalProcessorsG2,repCost:18750,moneyCost:125e6,info:"The second generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG1],hacking_speed:1.02,hacking_chance:1.05,hacking:1.07,factions:[f.a.CyberSec,f.a.NiteSec]}),new a.a({name:r.a.CranialSignalProcessorsG3,repCost:5e4,moneyCost:55e7,info:"The third generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG2,r.a.CranialSignalProcessorsG1],hacking_speed:1.02,hacking_money:1.15,hacking:1.09,factions:[f.a.NiteSec,f.a.TheBlackHand,f.a.BitRunners]}),new a.a({name:r.a.CranialSignalProcessorsG4,repCost:125e3,moneyCost:11e8,info:"The fourth generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG3,r.a.CranialSignalProcessorsG2,r.a.CranialSignalProcessorsG1],hacking_speed:1.02,hacking_money:1.2,hacking_grow:1.25,factions:[f.a.TheBlackHand,f.a.BitRunners]}),new a.a({name:r.a.CranialSignalProcessorsG5,repCost:25e4,moneyCost:225e7,info:"The fifth generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG4,r.a.CranialSignalProcessorsG3,r.a.CranialSignalProcessorsG2,r.a.CranialSignalProcessorsG1],hacking:1.3,hacking_money:1.25,hacking_grow:1.75,factions:[f.a.BitRunners]}),new a.a({name:r.a.NeuronalDensification,repCost:187500,moneyCost:1375e6,info:"The brain is surgically re-engineered to have increased neuronal density by decreasing the neuron gap junction. Then, the body is genetically modified to enhance the production and capabilities of its neural stem cells.",hacking:1.15,hacking_exp:1.1,hacking_speed:1.03,factions:[f.a.ClarkeIncorporated]}),new a.a({name:r.a.NuoptimalInjectorImplant,repCost:5e3,moneyCost:2e7,info:"This torso implant automatically injects nootropic supplements into the bloodstream to improve memory, increase focus, and provide other cognitive enhancements.",company_rep:1.2,factions:[f.a.TianDiHui,f.a.Volhaven,f.a.NewTokyo,f.a.Chongqing,f.a.ClarkeIncorporated,f.a.FourSigma,f.a.BachmanAssociates]}),new a.a({name:r.a.SpeechEnhancement,repCost:2500,moneyCost:125e5,info:"An advanced neural implant that improves your speaking abilities, making you more convincing and likable in conversations and overall improving your social interactions.",company_rep:1.1,charisma:1.1,factions:[f.a.TianDiHui,f.a.SpeakersForTheDead,f.a.FourSigma,f.a.KuaiGongInternational,f.a.ClarkeIncorporated,f.a.BachmanAssociates]}),new a.a({name:r.a.FocusWire,repCost:75e3,moneyCost:9e8,info:"A cranial implant that stops procrastination by blocking specific neural pathways in the brain.",hacking_exp:1.05,strength_exp:1.05,defense_exp:1.05,dexterity_exp:1.05,agility_exp:1.05,charisma_exp:1.05,company_rep:1.1,work_money:1.2,factions:[f.a.BachmanAssociates,f.a.ClarkeIncorporated,f.a.FourSigma,f.a.KuaiGongInternational]}),new a.a({name:r.a.PCDNI,repCost:375e3,moneyCost:375e7,info:"Installs a Direct-Neural Interface jack into your arm that is compatible with most computers. Connecting to a computer through this jack allows you to interface with it using the brain's electrochemical signals.",company_rep:1.3,hacking:1.08,factions:[f.a.FourSigma,f.a.OmniTekIncorporated,f.a.ECorp,f.a.BladeIndustries]}),new a.a({name:r.a.PCDNIOptimizer,repCost:5e5,moneyCost:45e8,info:"This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It improves the performance of the interface and gives the user more control options to a connected computer.",prereqs:[r.a.PCDNI],company_rep:1.75,hacking:1.1,factions:[f.a.FulcrumSecretTechnologies,f.a.ECorp,f.a.BladeIndustries]}),new a.a({name:r.a.PCDNINeuralNetwork,repCost:15e5,moneyCost:75e8,info:"This is an additional installation that upgrades the functionality of the PC Direct-Neural Interface augmentation. When connected to a computer, the Neural Network upgrade allows the user to use their own brain's processing power to aid the computer in computational tasks.",prereqs:[r.a.PCDNI],company_rep:2,hacking:1.1,hacking_speed:1.05,factions:[f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.ADRPheromone1,repCost:3750,moneyCost:175e5,info:"The body is genetically re-engineered so that it produces the ADR-V1 pheromone, an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, triggers feelings of admiration and approval in other people.",company_rep:1.1,faction_rep:1.1,factions:[f.a.TianDiHui,f.a.TheSyndicate,f.a.NWO,f.a.MegaCorp,f.a.FourSigma]}),new a.a({name:r.a.ADRPheromone2,repCost:62500,moneyCost:55e7,info:"The body is genetically re-engineered so that it produces the ADR-V2 pheromone, which is similar to but more potent than ADR-V1. This pheromone, when excreted, triggers feelings of admiration, approval, and respect in others.",company_rep:1.2,faction_rep:1.2,factions:[f.a.Silhouette,f.a.FourSigma,f.a.BachmanAssociates,f.a.ClarkeIncorporated]}),new a.a({name:r.a.ShadowsSimulacrum,repCost:37500,moneyCost:4e8,info:"A crude but functional matter phase-shifter module that is embedded in the brainstem and cerebellum. This augmentation was developed by criminal organizations and allows the user to project and control holographic simulacrums within a large radius. These simulacrums are commonly used for espionage and surveillance work.",company_rep:1.15,faction_rep:1.15,factions:[f.a.TheSyndicate,f.a.TheDarkArmy,f.a.SpeakersForTheDead]}),new a.a({name:r.a.HacknetNodeCPUUpload,repCost:3750,moneyCost:11e6,info:"Uploads the architecture and design details of a Hacknet Node's CPU into the brain. This allows the user to engineer custom hardware and software for the Hacknet Node that provides better performance.",hacknet_node_money:1.15,hacknet_node_purchase_cost:.85,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeCacheUpload,repCost:2500,moneyCost:55e5,info:"Uploads the architecture and design details of a Hacknet Node's main-memory cache into the brain. This allows the user to engineer custom cache hardware for the Hacknet Node that offers better performance.",hacknet_node_money:1.1,hacknet_node_level_cost:.85,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeNICUpload,repCost:1875,moneyCost:45e5,info:"Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that offers better performance.",hacknet_node_money:1.1,hacknet_node_purchase_cost:.9,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeKernelDNI,repCost:7500,moneyCost:4e7,info:"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a Hacknet Node. This lets the user access and manipulate the Node's kernel using electrochemical signals.",hacknet_node_money:1.25,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeCoreDNI,repCost:12500,moneyCost:6e7,info:"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using electrochemical signals.",hacknet_node_money:1.45,factions:[f.a.Netburners]}),new a.a({name:r.a.Neurotrainer1,repCost:1e3,moneyCost:4e6,info:"A decentralized cranial implant that improves the brain's ability to learn. It is installed by releasing millions of nanobots into the human brain, each of which attaches to a different neural pathway to enhance the brain's ability to retain and retrieve information.",hacking_exp:1.1,strength_exp:1.1,defense_exp:1.1,dexterity_exp:1.1,agility_exp:1.1,charisma_exp:1.1,factions:[f.a.CyberSec,f.a.Aevum]}),new a.a({name:r.a.Neurotrainer2,repCost:1e4,moneyCost:45e6,info:"A decentralized cranial implant that improves the brain's ability to learn. This is a more powerful version of the Neurotrainer I augmentation, but it does not require Neurotrainer I to be installed as a prerequisite.",hacking_exp:1.15,strength_exp:1.15,defense_exp:1.15,dexterity_exp:1.15,agility_exp:1.15,charisma_exp:1.15,factions:[f.a.BitRunners,f.a.NiteSec]}),new a.a({name:r.a.Neurotrainer3,repCost:25e3,moneyCost:13e7,info:"A decentralized cranial implant that improves the brain's ability to learn. This is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, but it does not require either of them to be installed as a prerequisite.",hacking_exp:1.2,strength_exp:1.2,defense_exp:1.2,dexterity_exp:1.2,agility_exp:1.2,charisma_exp:1.2,factions:[f.a.NWO,f.a.FourSigma]}),new a.a({name:r.a.Hypersight,repCost:15e4,moneyCost:275e7,info:"A bionic eye implant that grants sight capabilities far beyond those of a natural human. Embedded circuitry within the implant provides the ability to detect heat and movement through solid objects such as walls, thus providing 'x-ray vision'-like capabilities.",dexterity:1.4,hacking_speed:1.03,hacking_money:1.1,factions:[f.a.BladeIndustries,f.a.KuaiGongInternational]}),new a.a({name:r.a.LuminCloaking1,repCost:1500,moneyCost:5e6,info:"A skin implant that reinforces the skin with highly-advanced synthetic cells. These cells, when powered, have a negative refractive index. As a result, they bend light around the skin, making the user much harder to see with the naked eye.",agility:1.05,crime_money:1.1,factions:[f.a.SlumSnakes,f.a.Tetrads]}),new a.a({name:r.a.LuminCloaking2,repCost:5e3,moneyCost:3e7,info:"This is a more advanced version of the LuminCloaking-V1 augmentation. This skin implant reinforces the skin with highly-advanced synthetic cells. These cells, when powered, are capable of not only bending light but also of bending heat, making the user more resilient as well as stealthy.",prereqs:[r.a.LuminCloaking1],agility:1.1,defense:1.1,crime_money:1.25,factions:[f.a.SlumSnakes,f.a.Tetrads]}),new a.a({name:r.a.SmartSonar,repCost:22500,moneyCost:75e6,info:"A cochlear implant that helps the player detect and locate enemies using sound propagation.",dexterity:1.1,dexterity_exp:1.15,crime_money:1.25,factions:[f.a.SlumSnakes]}),new a.a({name:r.a.PowerRecirculator,repCost:25e3,moneyCost:18e7,info:"The body's nerves are attached with polypyrrole nanocircuits that are capable of capturing wasted energy, in the form of heat, and converting it back into usable power.",hacking:1.05,strength:1.05,defense:1.05,dexterity:1.05,agility:1.05,charisma:1.05,hacking_exp:1.1,strength_exp:1.1,defense_exp:1.1,dexterity_exp:1.1,agility_exp:1.1,charisma_exp:1.1,factions:[f.a.Tetrads,f.a.TheDarkArmy,f.a.TheSyndicate,f.a.NWO]}),new a.a({name:r.a.QLink,repCost:1875e3,moneyCost:25e12,info:`A brain implant that wirelessly connects you to the ${f.a.Illuminati}'s quantum supercomputer, allowing you to access and use its incredible computing power.`,hacking:1.75,hacking_speed:2,hacking_chance:2.5,hacking_money:4,factions:[f.a.Illuminati]}),new a.a({name:r.a.SPTN97,repCost:125e4,moneyCost:4875e6,info:"The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an artificially-synthesized gene that was developed by DARPA to create super-soldiers through genetic modification. The gene was outlawed in 2056.",strength:1.75,defense:1.75,dexterity:1.75,agility:1.75,hacking:1.15,factions:[f.a.TheCovenant]}),new a.a({name:r.a.HiveMind,repCost:15e5,moneyCost:55e8,info:`A brain implant developed by ${f.a.ECorp}. They do not reveal what exactly the implant does, but they promise that it will greatly enhance your abilities.`,hacking_grow:3,stats:null,factions:[f.a.ECorp]}),new a.a({name:r.a.TheRedPill,repCost:25e5,moneyCost:0,info:"It's time to leave the cave.",stats:null,isSpecial:!0,factions:[f.a.Daedalus]}),new a.a({name:r.a.CordiARCReactor,repCost:1125e3,moneyCost:5e9,info:"The thoracic cavity is equipped with a small chamber designed to hold and sustain hydrogen plasma. The plasma is used to generate fusion power through nuclear fusion, providing limitless amounts of clean energy for the body.",strength:1.35,defense:1.35,dexterity:1.35,agility:1.35,strength_exp:1.35,defense_exp:1.35,dexterity_exp:1.35,agility_exp:1.35,factions:[f.a.MegaCorp]}),new a.a({name:r.a.SmartJaw,repCost:375e3,moneyCost:275e7,info:"A bionic jaw that contains advanced hardware and software capable of psychoanalyzing and profiling the personality of others using optical imaging software.",charisma:1.5,charisma_exp:1.5,company_rep:1.25,faction_rep:1.25,factions:[f.a.BachmanAssociates]}),new a.a({name:r.a.Neotra,repCost:562500,moneyCost:2875e6,info:"A highly-advanced techno-organic drug that is injected into the skeletal and integumentary system. The drug permanently modifies the DNA of the body's skin and bone cells, granting them the ability to repair and restructure themselves.",strength:1.55,defense:1.55,factions:[f.a.BladeIndustries]}),new a.a({name:r.a.Xanipher,repCost:875e3,moneyCost:425e7,info:"A concoction of advanced nanobots that is orally ingested into the body. These nanobots induce physiological changes and significantly improve the body's functioning in all aspects.",hacking:1.2,strength:1.2,defense:1.2,dexterity:1.2,agility:1.2,charisma:1.2,hacking_exp:1.15,strength_exp:1.15,defense_exp:1.15,dexterity_exp:1.15,agility_exp:1.15,charisma_exp:1.15,factions:[f.a.NWO]}),new a.a({name:r.a.HydroflameLeftArm,repCost:125e4,moneyCost:25e11,info:"The left arm of a legendary BitRunner who ascended beyond this world. It projects a light blue energy shield that protects the exposed inner parts. Even though it contains no weapons, the advanced tungsten titanium alloy increases the user's strength to unbelievable levels. The augmentation gets more powerful over time for seemingly no reason.",strength:2.7,factions:[f.a.NWO]}),new a.a({name:r.a.nextSENS,repCost:437500,moneyCost:1925e6,info:"The body is genetically re-engineered to maintain a state of negligible senescence, preventing the body from deteriorating with age.",hacking:1.2,strength:1.2,defense:1.2,dexterity:1.2,agility:1.2,charisma:1.2,factions:[f.a.ClarkeIncorporated]}),new a.a({name:r.a.OmniTekInfoLoad,repCost:625e3,moneyCost:2875e6,info:"OmniTek's data and information repository is uploaded into your brain, enhancing your programming and hacking abilities.",hacking:1.2,hacking_exp:1.25,factions:[f.a.OmniTekIncorporated]}),new a.a({name:r.a.PhotosyntheticCells,repCost:562500,moneyCost:275e7,info:"Chloroplasts are added to epidermal stem cells and are applied to the body using a skin graft. The result is photosynthetic skin cells, allowing users to generate their own energy and nutrition using solar power.",strength:1.4,defense:1.4,agility:1.4,factions:[f.a.KuaiGongInternational]}),new a.a({name:r.a.Neurolink,repCost:875e3,moneyCost:4375e6,info:`A brain implant that provides a high-bandwidth, direct neural link between your mind and the ${f.a.BitRunners}' data servers, which reportedly contain the largest database of hacking tools and information in the world.`,hacking:1.15,hacking_exp:1.2,hacking_chance:1.1,hacking_speed:1.05,programs:[o.a.FTPCrackProgram.name,o.a.RelaySMTPProgram.name],factions:[f.a.BitRunners]}),new a.a({name:r.a.TheBlackHand,repCost:1e5,moneyCost:55e7,info:"A highly advanced bionic hand. This prosthetic not only enhances strength and dexterity but it is also embedded with hardware and firmware that lets the user connect to, access, and hack devices and machines by just touching them.",strength:1.15,dexterity:1.15,hacking:1.1,hacking_speed:1.02,hacking_money:1.1,factions:[f.a.TheBlackHand]}),new a.a({name:r.a.CRTX42AA,repCost:45e3,moneyCost:225e6,info:"The CRTX42-AA gene is injected into the genome. The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal cortex and improves cognitive abilities.",hacking:1.08,hacking_exp:1.15,factions:[f.a.NiteSec]}),new a.a({name:r.a.Neuregen,repCost:37500,moneyCost:375e6,info:"A drug that genetically modifies the neurons in the brain resulting in neurons that never die, continuously regenerate, and strengthen themselves.",hacking_exp:1.4,factions:[f.a.Chongqing]}),new a.a({name:r.a.CashRoot,repCost:12500,moneyCost:125e6,info:c.a.createElement(c.a.Fragment,null,"A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the chip allows you to connect it to a computer and upload the assets."),startingMoney:1e6,programs:[o.a.BruteSSHProgram.name],factions:[f.a.Sector12]}),new a.a({name:r.a.NutriGen,repCost:6250,moneyCost:25e5,info:"A thermo-powered artificial nutrition generator. Endogenously synthesizes glucose, amino acids, and vitamins and redistributes them across the body. The device is powered by the body's naturally wasted energy in the form of heat.",strength_exp:1.2,defense_exp:1.2,dexterity_exp:1.2,agility_exp:1.2,factions:[f.a.NewTokyo]}),new a.a({name:r.a.PCMatrix,repCost:1e5,moneyCost:2e9,info:"A 'Probability Computation Matrix' is installed in the frontal cortex. This implant uses advanced mathematical algorithims to rapidly identify and compute statistical outcomes of nearly every situation.",charisma:1.0777,charisma_exp:1.0777,work_money:1.777,faction_rep:1.0777,company_rep:1.0777,crime_success:1.0777,crime_money:1.0777,programs:[o.a.DeepscanV1.name,o.a.AutoLink.name],factions:[f.a.Aevum]}),new a.a({name:r.a.INFRARet,repCost:7500,moneyCost:3e7,info:"A tiny chip that sits behind the retinae. This implant lets the user visually detect infrared radiation.",crime_success:1.25,crime_money:1.1,dexterity:1.1,factions:[f.a.Ishima]}),new a.a({name:r.a.DermaForce,repCost:15e3,moneyCost:5e7,info:"Synthetic skin that is grafted onto the body. This skin consists of millions of nanobots capable of projecting high-density muon beams, creating an energy barrier around the user.",defense:1.4,factions:[f.a.Volhaven]}),new a.a({name:r.a.GrapheneBrachiBlades,repCost:225e3,moneyCost:25e8,info:"An upgrade to the BrachiBlades augmentation. It infuses the retractable blades with an advanced graphene material making them stronger and lighter.",prereqs:[r.a.BrachiBlades],strength:1.4,defense:1.4,crime_success:1.1,crime_money:1.3,factions:[f.a.SpeakersForTheDead]}),new a.a({name:r.a.GrapheneBionicArms,repCost:5e5,moneyCost:375e7,info:"An upgrade to the Bionic Arms augmentation. It infuses the prosthetic arms with an advanced graphene material to make them stronger and lighter.",prereqs:[r.a.BionicArms],strength:1.85,dexterity:1.85,factions:[f.a.TheDarkArmy]}),new a.a({name:r.a.BrachiBlades,repCost:12500,moneyCost:9e7,info:"A set of retractable plasteel blades that are implanted in the arm, underneath the skin.",strength:1.15,defense:1.15,crime_success:1.1,crime_money:1.15,factions:[f.a.TheSyndicate]}),new a.a({name:r.a.BionicArms,repCost:62500,moneyCost:275e6,info:"Cybernetic arms created from plasteel and carbon fibers that completely replace the user's organic arms.",strength:1.3,dexterity:1.3,factions:[f.a.Tetrads]}),new a.a({name:r.a.SNA,repCost:6250,moneyCost:3e7,info:"A cranial implant that affects the user's personality, making them better at negotiation in social situations.",work_money:1.1,company_rep:1.15,faction_rep:1.15,factions:[f.a.TianDiHui]}),new a.a({name:r.a.NeuroreceptorManager,repCost:75e3,moneyCost:55e7,info:"A brain implant carefully assembled around the synapses, which micromanages the activity and levels of various neuroreceptor chemicals and modulates electrical activity to optimize concentration, allowing the user to multitask much more effectively.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation removes the penalty for not focusing on actions such as working in a job or working for a faction."),factions:[f.a.TianDiHui]}),new a.a({name:r.a.CongruityImplant,repCost:1/0,moneyCost:5e13,info:c.a.createElement(c.a.Fragment,null,"Developed by a pioneer in Grafting research, this implant generates pulses of stability which seem to have a nullifying effect versus the Entropy virus.",c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement("b",null,"Note:")," For unknown reasons, the lowercase ",c.a.createElement("code",null,"n")," appears to be an integral component to its functionality."),stats:c.a.createElement(c.a.Fragment,null,"This Augmentation removes the Entropy virus, and prevents it from affecting you again."),factions:[]})],d=()=>[new a.a({name:r.a.EsperEyewear,repCost:1250,moneyCost:165e6,info:"Ballistic-grade protective and retractable eyewear that was designed specifically for Bladeburner units. This is implanted by installing a mechanical frame in the skull's orbit. This frame interfaces with the brain and allows the user to automatically extrude and extract the eyewear. The eyewear protects against debris, shrapnel, lasers, blinding flashes, and gas. It is also embedded with a data processing chip that can be programmed to display an AR HUD to assist the user in field missions.",bladeburner_success_chance:1.03,dexterity:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.EMS4Recombination,repCost:2500,moneyCost:275e6,info:"A DNA recombination of the EMS-4 Gene. This genetic engineering technique was originally used on Bladeburners during the Synthoid uprising to induce wakefulness and concentration, suppress fear, reduce empathy, improve reflexes, and improve memory among other things.",bladeburner_success_chance:1.03,bladeburner_analysis:1.05,bladeburner_stamina_gain:1.02,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.OrionShoulder,repCost:6250,moneyCost:55e7,info:"A bionic shoulder augmentation for the right shoulder. Using cybernetics, the ORION-MKIV shoulder enhances the strength and dexterity of the user's right arm. It also provides protection due to its crystallized graphene plating.",defense:1.05,strength:1.05,dexterity:1.05,bladeburner_success_chance:1.04,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.HyperionV1,repCost:12500,moneyCost:275e7,info:"A pair of mini plasma cannons embedded into the hands. The Hyperion is capable of rapidly firing bolts of high-density plasma. The weapon is meant to be used against augmented enemies as the ionized nature of the plasma disrupts the electrical systems of Augmentations. However, it can also be effective against non-augmented enemies due to its high temperature and concussive force.",bladeburner_success_chance:1.06,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.HyperionV2,repCost:25e3,moneyCost:55e8,info:"A pair of mini plasma cannons embedded into the hands. This augmentation is more advanced and powerful than the original V1 model. This V2 model is more power-efficient, more accurate, and can fire plasma bolts at a much higher velocity than the V1 model.",prereqs:[r.a.HyperionV1],bladeburner_success_chance:1.08,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.GolemSerum,repCost:31250,moneyCost:11e9,info:"A serum that permanently enhances many aspects of human capabilities, including strength, speed, immune system enhancements, and mitochondrial efficiency. The serum was originally developed by the Chinese military in an attempt to create super soldiers.",strength:1.07,defense:1.07,dexterity:1.07,agility:1.07,bladeburner_stamina_gain:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.VangelisVirus,repCost:18750,moneyCost:275e7,info:"A synthetic symbiotic virus that is injected into human brain tissue. The Vangelis virus heightens the senses and focus of its host, and also enhances its intuition.",dexterity_exp:1.1,bladeburner_analysis:1.1,bladeburner_success_chance:1.04,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.VangelisVirus3,repCost:37500,moneyCost:11e9,info:"An improved version of Vangelis, a synthetic symbiotic virus that is injected into human brain tissue. On top of the benefits of the original virus, this also grants accelerated healing and enhanced reflexes.",prereqs:[r.a.VangelisVirus],defense_exp:1.1,dexterity_exp:1.1,bladeburner_analysis:1.15,bladeburner_success_chance:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.INTERLINKED,repCost:25e3,moneyCost:55e8,info:"The DNA is genetically modified to enhance the human's body extracellular matrix (ECM). This improves the ECM's ability to structurally support the body and grants heightened strength and durability.",strength_exp:1.05,defense_exp:1.05,dexterity_exp:1.05,agility_exp:1.05,bladeburner_max_stamina:1.1,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeRunner,repCost:2e4,moneyCost:825e7,info:`A cybernetic foot augmentation that was specifically created for ${f.a.Bladeburners} during the Synthoid Uprising. The organic musculature of the human foot is enhanced with flexible carbon nanotube matrices that are controlled by intelligent servo-motors.`,agility:1.05,bladeburner_max_stamina:1.05,bladeburner_stamina_gain:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmor,repCost:12500,moneyCost:1375e6,info:`A powered exoskeleton suit designed as armor for ${f.a.Bladeburners} units. This exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, concussive, thermal, chemical, and electric trauma. It also enhances the user's physical abilities.`,strength:1.04,defense:1.04,dexterity:1.04,agility:1.04,bladeburner_stamina_gain:1.02,bladeburner_success_chance:1.03,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorPowerCells,repCost:18750,moneyCost:275e7,info:"Upgrades the BLADE-51b Tesla Armor with Ion Power Cells, which are capable of more efficiently storing and using power.",prereqs:[r.a.BladeArmor],bladeburner_success_chance:1.05,bladeburner_stamina_gain:1.02,bladeburner_max_stamina:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorEnergyShielding,repCost:21250,moneyCost:55e8,info:"Upgrades the BLADE-51b Tesla Armor with a plasma energy propulsion system that is capable of projecting an energy shielding force field.",prereqs:[r.a.BladeArmor],defense:1.05,bladeburner_success_chance:1.06,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorUnibeam,repCost:31250,moneyCost:165e8,info:"Upgrades the BLADE-51b Tesla Armor with a concentrated deuterium-fluoride laser weapon. It's precision and accuracy makes it useful for quickly neutralizing threats while keeping casualties to a minimum.",prereqs:[r.a.BladeArmor],bladeburner_success_chance:1.08,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorOmnibeam,repCost:62500,moneyCost:275e8,info:"Upgrades the BLADE-51b Tesla Armor Unibeam augmentation to use a multiple-fiber system. This upgraded weapon uses multiple fiber laser modules that combine together to form a single, more powerful beam of up to 2000MW.",prereqs:[r.a.BladeArmorUnibeam],bladeburner_success_chance:1.1,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorIPU,repCost:15e3,moneyCost:11e8,info:"Upgrades the BLADE-51b Tesla Armor with an AI Information Processing Unit that was specially designed to analyze Synthoid related data and information.",prereqs:[r.a.BladeArmor],bladeburner_analysis:1.15,bladeburner_success_chance:1.02,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladesSimulacrum,repCost:1250,moneyCost:15e10,info:"A highly-advanced matter phase-shifter module that is embedded in the brainstem and cerebellum. This augmentation allows the user to project and control a holographic simulacrum within an extremely large radius. These specially-modified holograms were specifically weaponized by Bladeburner units to be used against Synthoids.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting crimes, etc.) at the same time."),isSpecial:!0,factions:[f.a.Bladeburners]})],p=()=>[new a.a({name:r.a.StaneksGift1,repCost:0,moneyCost:0,info:'Allison "Mother" Stanek imparts you with her gift. An experimental Augmentation implanted at the base of the neck. It allows you to overclock your entire system by carefully changing the configuration.',isSpecial:!0,hacking_chance:.9,hacking_speed:.9,hacking_money:.9,hacking_grow:.9,hacking:.9,strength:.9,defense:.9,dexterity:.9,agility:.9,charisma:.9,hacking_exp:.9,strength_exp:.9,defense_exp:.9,dexterity_exp:.9,agility_exp:.9,charisma_exp:.9,company_rep:.9,faction_rep:.9,crime_money:.9,crime_success:.9,hacknet_node_money:.9,hacknet_node_purchase_cost:1.1,hacknet_node_ram_cost:1.1,hacknet_node_core_cost:1.1,hacknet_node_level_cost:1.1,work_money:.9,stats:c.a.createElement(c.a.Fragment,null,"Its unstable nature decreases all your stats by 10%"),factions:[f.a.ChurchOfTheMachineGod]}),new a.a({name:r.a.StaneksGift2,repCost:1e6,moneyCost:0,info:"The next evolution is near, a coming together of man and machine. A synthesis greater than the birth of the human organism. Time spent with the gift has allowed for acclimatization of the invasive augment and the toll it takes upon your frame granting a 5% reduced penalty to all stats.",prereqs:[r.a.StaneksGift1],isSpecial:!0,hacking_chance:.95/.9,hacking_speed:.95/.9,hacking_money:.95/.9,hacking_grow:.95/.9,hacking:.95/.9,strength:.95/.9,defense:.95/.9,dexterity:.95/.9,agility:.95/.9,charisma:.95/.9,hacking_exp:.95/.9,strength_exp:.95/.9,defense_exp:.95/.9,dexterity_exp:.95/.9,agility_exp:.95/.9,charisma_exp:.95/.9,company_rep:.95/.9,faction_rep:.95/.9,crime_money:.95/.9,crime_success:.95/.9,hacknet_node_money:.95/.9,hacknet_node_purchase_cost:1.05/1.1,hacknet_node_ram_cost:1.05/1.1,hacknet_node_core_cost:1.05/1.1,hacknet_node_level_cost:1.05/1.1,work_money:.95/.9,stats:c.a.createElement(c.a.Fragment,null,"The penalty for the gift is reduced to 5%"),factions:[f.a.ChurchOfTheMachineGod]}),new a.a({name:r.a.StaneksGift3,repCost:1e8,moneyCost:0,info:"The synthesis of human and machine is nothing to fear. It is our destiny. You will become greater than the sum of our parts. As One. Embrace your gift fully and wholly free of it's accursed toll. Serenity brings tranquility in the form of no longer suffering a stat penalty. ",prereqs:[r.a.StaneksGift2,r.a.StaneksGift1],isSpecial:!0,hacking_chance:1/.95,hacking_speed:1/.95,hacking_money:1/.95,hacking_grow:1/.95,hacking:1/.95,strength:1/.95,defense:1/.95,dexterity:1/.95,agility:1/.95,charisma:1/.95,hacking_exp:1/.95,strength_exp:1/.95,defense_exp:1/.95,dexterity_exp:1/.95,agility_exp:1/.95,charisma_exp:1/.95,company_rep:1/.95,faction_rep:1/.95,crime_money:1/.95,crime_success:1/.95,hacknet_node_money:1/.95,hacknet_node_purchase_cost:1/1.05,hacknet_node_ram_cost:1/1.05,hacknet_node_core_cost:1/1.05,hacknet_node_level_cost:1/1.05,work_money:1/.95,stats:c.a.createElement(c.a.Fragment,null,"Stanek's Gift has no penalty."),factions:[f.a.ChurchOfTheMachineGod]})];function g(){const t=u.a.Donations/1e6/100;return new a.a({name:r.a.NeuroFluxGovernor,repCost:500,moneyCost:75e4,info:"A device that is embedded in the back of the neck. The NeuroFlux Governor monitors and regulates nervous impulses coming to and from the spinal column, essentially 'governing' the body. By doing so, it improves the functionality of the body's nervous system.",stats:c.a.createElement(c.a.Fragment,null,"This special augmentation can be leveled up infinitely. Each level of this augmentation increases MOST multipliers by 1% (+",(100*t).toFixed(6),"% boosted by real life blood donations), stacking multiplicatively."),isSpecial:!0,hacking_chance:1.01+t,hacking_speed:1.01+t,hacking_money:1.01+t,hacking_grow:1.01+t,hacking:1.01+t,strength:1.01+t,defense:1.01+t,dexterity:1.01+t,agility:1.01+t,charisma:1.01+t,hacking_exp:1.01+t,strength_exp:1.01+t,defense_exp:1.01+t,dexterity_exp:1.01+t,agility_exp:1.01+t,charisma_exp:1.01+t,company_rep:1.01+t,faction_rep:1.01+t,crime_money:1.01+t,crime_success:1.01+t,hacknet_node_money:1.01+t,hacknet_node_purchase_cost:1/(1.01+t),hacknet_node_ram_cost:1/(1.01+t),hacknet_node_core_cost:1/(1.01+t),hacknet_node_level_cost:1/(1.01+t),work_money:1.01+t,factions:Object.values(f.a).filter(t=>![f.a.ShadowsOfAnarchy,f.a.Bladeburners,f.a.ChurchOfTheMachineGod].includes(t))})}function y(){const t=function(){const t=[{bonuses:{hacking_chance:1.25,hacking_speed:1.1,hacking_money:1.25,hacking_grow:1.1},description:"Increases the player's hacking chance by 25%.
Increases the player's hacking speed by 10%.
Increases the amount of money the player's gains from hacking by 25%.
Improves grow() by 10%."},{bonuses:{hacking:1.15,hacking_exp:2},description:"Increases the player's hacking skill by 15%.
Increases the player's hacking experience gain rate by 100%."},{bonuses:{strength:1.25,strength_exp:2,defense:1.25,defense_exp:2,dexterity:1.25,dexterity_exp:2,agility:1.25,agility_exp:2},description:"Increases all of the player's combat stats by 25%.
Increases all of the player's combat stat experience gain rate by 100%."},{bonuses:{charisma:1.5,charisma_exp:2},description:"This augmentation increases the player's charisma by 50%.
Increases the player's charisma experience gain rate by 100%."},{bonuses:{hacknet_node_money:1.2,hacknet_node_purchase_cost:.85,hacknet_node_ram_cost:.85,hacknet_node_core_cost:.85,hacknet_node_level_cost:.85},description:"Increases the amount of money produced by Hacknet Nodes by 20%.
Decreases all costs related to Hacknet Node by 15%."},{bonuses:{company_rep:1.25,faction_rep:1.15,work_money:1.7},description:"Increases the amount of money the player gains from working by 70%.
Increases the amount of reputation the player gains when working for a company by 25%.
Increases the amount of reputation the player gains for a faction by 15%."},{bonuses:{crime_success:2,crime_money:2},description:"Increases the player's crime success rate by 100%.
Increases the amount of money the player gains from crimes by 100%."}],e=new s.c(Math.floor(i.a.lastUpdate/36e5));for(let t=0;t<5;t++)e.step();return t[Math.floor(t.length*e.random())]}(),e={name:r.a.UnstableCircadianModulator,moneyCost:5e9,repCost:362500,info:"An experimental nanobot injection. Its unstable nature leads to unpredictable results based on your circadian rhythm.",factions:[f.a.SpeakersForTheDead]};return Object.keys(t.bonuses).forEach(n=>e[n]=t.bonuses[n]),new a.a(e)}},,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(5),r=n(10),i=n(66),o=n(89);const s=[{hackDifficulty:99,hostname:r.a.AevumECorp.toLowerCase(),moneyAvailable:{max:7e10,min:3e10},networkLayer:15,numOpenPortsRequired:5,organizationName:r.a.AevumECorp,requiredHackingSkill:{max:1400,min:1050},serverGrowth:99,specialName:r.a.AevumECorp},{hackDifficulty:99,hostname:r.a.Sector12MegaCorp.toLowerCase(),moneyAvailable:{max:6e10,min:4e10},networkLayer:15,numOpenPortsRequired:5,organizationName:r.a.Sector12MegaCorp,requiredHackingSkill:{max:1350,min:1100},serverGrowth:99,specialName:r.a.Sector12MegaCorp},{hackDifficulty:{max:88,min:72},hostname:"b-and-a",moneyAvailable:{max:3e10,min:15e9},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.AevumBachmanAndAssociates,requiredHackingSkill:{max:1150,min:900},serverGrowth:{max:80,min:60},specialName:r.a.AevumBachmanAndAssociates},{hackDifficulty:{max:97,min:88},hostname:"blade",literature:[i.a.BeyondMan],maxRamExponent:{max:9,min:5},moneyAvailable:{max:4e10,min:1e10},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.Sector12BladeIndustries,requiredHackingSkill:{max:1200,min:900},serverGrowth:{max:85,min:55},specialName:r.a.Sector12BladeIndustries},{hackDifficulty:99,hostname:r.a.VolhavenNWO.toLowerCase(),literature:[i.a.TheHiddenWorld],moneyAvailable:{max:4e10,min:2e10},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.VolhavenNWO,requiredHackingSkill:{max:1300,min:950},serverGrowth:{max:95,min:65},specialName:r.a.VolhavenNWO},{hackDifficulty:{max:65,min:45},hostname:"clarkinc",literature:[i.a.BeyondMan,i.a.CostOfImmortality],moneyAvailable:{max:25e9,min:15e9},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.AevumClarkeIncorporated,requiredHackingSkill:{max:1250,min:950},serverGrowth:{max:75,min:45},specialName:r.a.AevumClarkeIncorporated},{hackDifficulty:{max:99,min:90},hostname:"omnitek",literature:[i.a.CodedIntelligence,i.a.HistoryOfSynthoids],maxRamExponent:{max:9,min:7},moneyAvailable:{max:22e9,min:13e9},networkLayer:13,numOpenPortsRequired:5,organizationName:r.a.VolhavenOmniTekIncorporated,requiredHackingSkill:{max:1100,min:900},serverGrowth:{max:99,min:95},specialName:r.a.VolhavenOmniTekIncorporated},{hackDifficulty:{max:75,min:55},hostname:"4sigma",moneyAvailable:{max:25e9,min:15e9},networkLayer:13,numOpenPortsRequired:5,organizationName:r.a.Sector12FourSigma,requiredHackingSkill:{max:1250,min:900},serverGrowth:{max:99,min:75},specialName:r.a.Sector12FourSigma},{hackDifficulty:{max:99,min:95},hostname:"kuai-gong",moneyAvailable:{max:3e10,min:2e10},networkLayer:13,numOpenPortsRequired:5,organizationName:r.a.ChongqingKuaiGongInternational,requiredHackingSkill:{max:1300,min:950},serverGrowth:{max:99,min:90},specialName:r.a.ChongqingKuaiGongInternational},{hackDifficulty:{max:97,min:83},hostname:"fulcrumtech",literature:[i.a.SimulatedReality],maxRamExponent:{max:11,min:7},moneyAvailable:{max:18e8,min:14e8},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.AevumFulcrumTechnologies,requiredHackingSkill:{max:1250,min:950},serverGrowth:{max:99,min:80},specialName:r.a.AevumFulcrumTechnologies},{hackDifficulty:99,hostname:"fulcrumassets",moneyAvailable:1e6,networkLayer:15,numOpenPortsRequired:5,organizationName:r.a.AevumFulcrumTechnologies,requiredHackingSkill:{max:1600,min:1100},serverGrowth:1,specialName:o.a.FulcrumSecretTechnologies},{hackDifficulty:{max:92,min:78},hostname:"stormtech",moneyAvailable:{max:12e8,min:1e9},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.IshimaStormTechnologies,requiredHackingSkill:{max:1075,min:875},serverGrowth:{max:92,min:68},specialName:r.a.IshimaStormTechnologies},{hackDifficulty:{max:96,min:84},hostname:"defcomm",moneyAvailable:{max:95e7,min:8e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.a.NewTokyoDefComm,requiredHackingSkill:{max:1050,min:850},serverGrowth:{max:73,min:47},specialName:r.a.NewTokyoDefComm},{hackDifficulty:{max:90,min:70},hostname:"infocomm",moneyAvailable:{max:9e8,min:6e8},networkLayer:10,numOpenPortsRequired:5,organizationName:"InfoComm",requiredHackingSkill:{max:950,min:875},serverGrowth:{max:75,min:35}},{hackDifficulty:{max:95,min:85},hostname:"helios",literature:[i.a.BeyondMan],maxRamExponent:{max:8,min:5},moneyAvailable:{max:75e7,min:55e7},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.VolhavenHeliosLabs,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:80,min:70},specialName:r.a.VolhavenHeliosLabs},{hackDifficulty:{max:90,min:80},hostname:r.a.NewTokyoVitaLife.toLowerCase(),literature:[i.a.AGreenTomorrow],maxRamExponent:{max:7,min:4},moneyAvailable:{max:8e8,min:7e8},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.NewTokyoVitaLife,requiredHackingSkill:{max:900,min:775},serverGrowth:{max:80,min:60},specialName:r.a.NewTokyoVitaLife},{hackDifficulty:{max:95,min:85},hostname:"icarus",moneyAvailable:{max:1e9,min:9e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.a.Sector12IcarusMicrosystems,requiredHackingSkill:{max:925,min:850},serverGrowth:{max:95,min:85},specialName:r.a.Sector12IcarusMicrosystems},{hackDifficulty:{max:90,min:80},hostname:"univ-energy",maxRamExponent:{max:7,min:4},moneyAvailable:{max:12e8,min:11e8},networkLayer:9,numOpenPortsRequired:4,organizationName:r.a.Sector12UniversalEnergy,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:90,min:80},specialName:r.a.Sector12UniversalEnergy},{hackDifficulty:{max:80,min:70},hostname:"titan-labs",literature:[i.a.CodedIntelligence],maxRamExponent:{max:7,min:4},moneyAvailable:{max:9e8,min:75e7},networkLayer:11,numOpenPortsRequired:5,organizationName:"Titan Laboratories",requiredHackingSkill:{max:875,min:800},serverGrowth:{max:80,min:60}},{hackDifficulty:{max:75,min:65},hostname:"microdyne",literature:[i.a.SyntheticMuscles],maxRamExponent:{max:6,min:4},moneyAvailable:{max:7e8,min:5e8},networkLayer:11,numOpenPortsRequired:5,organizationName:"Microdyne Technologies",requiredHackingSkill:{max:875,min:800},serverGrowth:{max:90,min:70}},{hackDifficulty:{max:80,min:70},hostname:"taiyang-digital",literature:[i.a.AGreenTomorrow,i.a.BrighterThanTheSun],moneyAvailable:{max:9e8,min:8e8},networkLayer:10,numOpenPortsRequired:5,organizationName:"Taiyang Digital",requiredHackingSkill:{max:950,min:850},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:65,min:55},hostname:"galactic-cyber",moneyAvailable:{max:85e7,min:75e7},networkLayer:7,numOpenPortsRequired:5,organizationName:r.a.AevumGalacticCybersystems,requiredHackingSkill:{max:875,min:825},serverGrowth:{max:90,min:70},specialName:r.a.AevumGalacticCybersystems},{hackDifficulty:{max:90,min:80},hostname:r.a.AevumAeroCorp.toLowerCase(),literature:[i.a.ManAndMachine],moneyAvailable:{max:12e8,min:1e9},networkLayer:7,numOpenPortsRequired:5,organizationName:r.a.AevumAeroCorp,requiredHackingSkill:{max:925,min:850},serverGrowth:{max:65,min:55},specialName:r.a.AevumAeroCorp},{hackDifficulty:{max:95,min:85},hostname:"omnia",literature:[i.a.HistoryOfSynthoids],maxRamExponent:{max:6,min:4},moneyAvailable:{max:1e9,min:9e8},networkLayer:8,numOpenPortsRequired:5,organizationName:r.a.VolhavenOmniaCybersystems,requiredHackingSkill:{max:950,min:850},serverGrowth:{max:70,min:60},specialName:r.a.VolhavenOmniaCybersystems},{hackDifficulty:{max:65,min:55},hostname:"zb-def",literature:[i.a.SyntheticMuscles],moneyAvailable:{max:11e8,min:9e8},networkLayer:10,numOpenPortsRequired:4,organizationName:"ZB Defense Industries",requiredHackingSkill:{max:825,min:775},serverGrowth:{max:75,min:65}},{hackDifficulty:{max:80,min:60},hostname:"applied-energetics",moneyAvailable:{max:1e9,min:7e8},networkLayer:11,numOpenPortsRequired:4,organizationName:"Applied Energetics",requiredHackingSkill:{max:850,min:775},serverGrowth:{max:75,min:70}},{hackDifficulty:{max:80,min:70},hostname:"solaris",literature:[i.a.AGreenTomorrow,i.a.TheFailedFrontier],maxRamExponent:{max:7,min:4},moneyAvailable:{max:9e8,min:7e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.a.ChongqingSolarisSpaceSystems,requiredHackingSkill:{max:850,min:750},serverGrowth:{max:80,min:70},specialName:r.a.ChongqingSolarisSpaceSystems},{hackDifficulty:{max:85,min:75},hostname:r.a.Sector12DeltaOne.toLowerCase(),moneyAvailable:{max:17e8,min:13e8},networkLayer:8,numOpenPortsRequired:5,organizationName:r.a.Sector12DeltaOne,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:70,min:50},specialName:r.a.Sector12DeltaOne},{hackDifficulty:{max:85,min:75},hostname:"global-pharm",literature:[i.a.AGreenTomorrow],maxRamExponent:{max:6,min:3},moneyAvailable:{max:175e7,min:15e8},networkLayer:7,numOpenPortsRequired:4,organizationName:r.a.NewTokyoGlobalPharmaceuticals,requiredHackingSkill:{max:850,min:750},serverGrowth:{max:90,min:80},specialName:r.a.NewTokyoGlobalPharmaceuticals},{hackDifficulty:{max:80,min:60},hostname:"nova-med",moneyAvailable:{max:125e7,min:11e8},networkLayer:10,numOpenPortsRequired:4,organizationName:r.a.IshimaNovaMedical,requiredHackingSkill:{max:850,min:775},serverGrowth:{max:85,min:65},specialName:r.a.IshimaNovaMedical},{hackDifficulty:{max:90,min:70},hostname:"zeus-med",moneyAvailable:{max:15e8,min:13e8},networkLayer:9,numOpenPortsRequired:5,organizationName:"Zeus Medical",requiredHackingSkill:{max:850,min:800},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:80,min:70},hostname:"unitalife",maxRamExponent:{max:6,min:4},moneyAvailable:{max:11e8,min:1e9},networkLayer:8,numOpenPortsRequired:4,organizationName:"UnitaLife Group",requiredHackingSkill:{max:825,min:775},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:80,min:60},hostname:"lexo-corp",maxRamExponent:{max:7,min:4},moneyAvailable:{max:8e8,min:7e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.a.VolhavenLexoCorp,requiredHackingSkill:{max:750,min:650},serverGrowth:{max:65,min:55},specialName:r.a.VolhavenLexoCorp},{hackDifficulty:{max:60,min:40},hostname:"rho-construction",maxRamExponent:{max:6,min:4},moneyAvailable:{max:7e8,min:5e8},networkLayer:6,numOpenPortsRequired:3,organizationName:r.a.AevumRhoConstruction,requiredHackingSkill:{max:525,min:475},serverGrowth:{max:60,min:40},specialName:r.a.AevumRhoConstruction},{hackDifficulty:{max:70,min:50},hostname:"alpha-ent",literature:[i.a.Sector12Crime],maxRamExponent:{max:7,min:4},moneyAvailable:{max:75e7,min:6e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.a.Sector12AlphaEnterprises,requiredHackingSkill:{max:600,min:500},serverGrowth:{max:60,min:50},specialName:r.a.Sector12AlphaEnterprises},{hackDifficulty:{max:80,min:70},hostname:"aevum-police",maxRamExponent:{max:6,min:4},moneyAvailable:{max:4e8,min:2e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.a.AevumPolice,requiredHackingSkill:{max:450,min:400},serverGrowth:{max:50,min:30},specialName:r.a.AevumPolice},{hackDifficulty:{max:55,min:45},hostname:"rothman-uni",literature:[i.a.SecretSocieties,i.a.TheFailedFrontier,i.a.TensionsInTechRace],maxRamExponent:{max:7,min:4},moneyAvailable:{max:25e7,min:175e6},networkLayer:5,numOpenPortsRequired:3,organizationName:r.a.Sector12RothmanUniversity,requiredHackingSkill:{max:430,min:370},serverGrowth:{max:45,min:35},specialName:r.a.Sector12RothmanUniversity},{hackDifficulty:{max:85,min:65},hostname:"zb-institute",maxRamExponent:{max:7,min:4},moneyAvailable:{max:11e8,min:8e8},networkLayer:5,numOpenPortsRequired:5,organizationName:r.a.VolhavenZBInstituteOfTechnology,requiredHackingSkill:{max:775,min:725},serverGrowth:{max:85,min:75},specialName:r.a.VolhavenZBInstituteOfTechnology},{hackDifficulty:{max:65,min:45},hostname:"summit-uni",literature:[i.a.SecretSocieties,i.a.TheFailedFrontier,i.a.SyntheticMuscles],maxRamExponent:{max:6,min:4},moneyAvailable:{max:35e7,min:2e8},networkLayer:5,numOpenPortsRequired:3,organizationName:r.a.AevumSummitUniversity,requiredHackingSkill:{max:475,min:425},serverGrowth:{max:60,min:40},specialName:r.a.AevumSummitUniversity},{hackDifficulty:{max:80,min:60},hostname:"syscore",moneyAvailable:{max:6e8,min:4e8},networkLayer:5,numOpenPortsRequired:4,organizationName:r.a.VolhavenSysCoreSecurities,requiredHackingSkill:{max:650,min:550},serverGrowth:{max:70,min:60},specialName:r.a.VolhavenSysCoreSecurities},{hackDifficulty:{max:70,min:60},hostname:"catalyst",literature:[i.a.TensionsInTechRace],maxRamExponent:{max:7,min:4},moneyAvailable:{max:55e7,min:3e8},networkLayer:5,numOpenPortsRequired:3,organizationName:"Catalyst Ventures",requiredHackingSkill:{max:450,min:400},serverGrowth:{max:55,min:25}},{hackDifficulty:{max:45,min:35},hostname:"the-hub",maxRamExponent:{max:6,min:3},moneyAvailable:{max:2e8,min:15e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"The Hub",requiredHackingSkill:{max:325,min:275},serverGrowth:{max:55,min:45}},{hackDifficulty:{max:65,min:55},hostname:r.a.VolhavenCompuTek.toLowerCase(),literature:[i.a.ManAndMachine],moneyAvailable:{max:25e7,min:22e7},networkLayer:4,numOpenPortsRequired:3,organizationName:r.a.VolhavenCompuTek,requiredHackingSkill:{max:400,min:300},serverGrowth:{max:65,min:45},specialName:r.a.VolhavenCompuTek},{hackDifficulty:{max:80,min:60},hostname:"netlink",literature:[i.a.SimulatedReality],maxRamExponent:{max:7,min:4},moneyAvailable:275e6,networkLayer:4,numOpenPortsRequired:3,organizationName:r.a.AevumNetLinkTechnologies,requiredHackingSkill:{max:425,min:375},serverGrowth:{max:75,min:45},specialName:r.a.AevumNetLinkTechnologies},{hackDifficulty:{max:65,min:35},hostname:"johnson-ortho",moneyAvailable:{max:85e6,min:7e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"Johnson Orthopedics",requiredHackingSkill:{max:300,min:250},serverGrowth:{max:65,min:35}},{hackDifficulty:1,hostname:"n00dles",literature:[],maxRamExponent:2,moneyAvailable:7e4,networkLayer:1,numOpenPortsRequired:0,organizationName:r.a.NewTokyoNoodleBar,requiredHackingSkill:1,serverGrowth:3e3,specialName:r.a.NewTokyoNoodleBar},{hackDifficulty:10,hostname:r.a.Sector12FoodNStuff.toLowerCase(),literature:[i.a.Sector12Crime],maxRamExponent:4,moneyAvailable:2e6,networkLayer:1,numOpenPortsRequired:0,organizationName:r.a.Sector12FoodNStuff,requiredHackingSkill:1,serverGrowth:5,specialName:r.a.Sector12FoodNStuff},{hackDifficulty:10,hostname:"sigma-cosmetics",maxRamExponent:4,moneyAvailable:23e5,networkLayer:1,numOpenPortsRequired:0,organizationName:"Sigma Cosmetics",requiredHackingSkill:5,serverGrowth:10},{hackDifficulty:15,hostname:"joesguns",maxRamExponent:4,moneyAvailable:25e5,networkLayer:1,numOpenPortsRequired:0,organizationName:r.a.Sector12JoesGuns,requiredHackingSkill:10,serverGrowth:20,specialName:r.a.Sector12JoesGuns},{hackDifficulty:25,hostname:"zer0",maxRamExponent:5,moneyAvailable:75e5,networkLayer:2,numOpenPortsRequired:1,organizationName:"ZER0 Nightclub",requiredHackingSkill:75,serverGrowth:40},{hackDifficulty:20,hostname:"nectar-net",maxRamExponent:4,moneyAvailable:275e4,networkLayer:2,numOpenPortsRequired:0,organizationName:"Nectar Nightclub Network",requiredHackingSkill:20,serverGrowth:25},{hackDifficulty:25,hostname:"neo-net",literature:[i.a.TheHiddenWorld],maxRamExponent:5,moneyAvailable:5e6,networkLayer:3,numOpenPortsRequired:1,organizationName:"Neo Nightclub Network",requiredHackingSkill:50,serverGrowth:25},{hackDifficulty:30,hostname:"silver-helix",literature:[i.a.NewTriads],maxRamExponent:6,moneyAvailable:45e6,networkLayer:3,numOpenPortsRequired:2,organizationName:"Silver Helix",requiredHackingSkill:150,serverGrowth:30},{hackDifficulty:15,hostname:"hong-fang-tea",literature:[i.a.BrighterThanTheSun],maxRamExponent:4,moneyAvailable:3e6,networkLayer:1,numOpenPortsRequired:0,organizationName:"HongFang Teahouse",requiredHackingSkill:30,serverGrowth:20},{hackDifficulty:15,hostname:"harakiri-sushi",maxRamExponent:4,moneyAvailable:4e6,networkLayer:1,numOpenPortsRequired:0,organizationName:"HaraKiri Sushi Bar Network",requiredHackingSkill:40,serverGrowth:40},{hackDifficulty:20,hostname:"phantasy",maxRamExponent:5,moneyAvailable:24e6,networkLayer:3,numOpenPortsRequired:2,organizationName:"Phantasy Club",requiredHackingSkill:100,serverGrowth:35},{hackDifficulty:15,hostname:"max-hardware",maxRamExponent:5,moneyAvailable:1e7,networkLayer:2,numOpenPortsRequired:1,organizationName:"Max Hardware Store",requiredHackingSkill:80,serverGrowth:30},{hackDifficulty:{max:35,min:25},hostname:"omega-net",literature:[i.a.TheNewGod],maxRamExponent:5,moneyAvailable:{max:7e7,min:6e7},networkLayer:3,numOpenPortsRequired:2,organizationName:r.a.IshimaOmegaSoftware,requiredHackingSkill:{max:220,min:180},serverGrowth:{max:40,min:30},specialName:r.a.IshimaOmegaSoftware},{hackDifficulty:{max:45,min:35},hostname:"crush-fitness",moneyAvailable:{max:6e7,min:4e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"Crush Fitness",requiredHackingSkill:{max:275,min:225},serverGrowth:{max:33,min:27},specialName:r.a.AevumCrushFitnessGym},{hackDifficulty:30,hostname:"iron-gym",maxRamExponent:5,moneyAvailable:2e7,networkLayer:1,numOpenPortsRequired:1,organizationName:r.a.Sector12IronGym+" Network",requiredHackingSkill:100,serverGrowth:20,specialName:r.a.Sector12IronGym},{hackDifficulty:{max:55,min:45},hostname:"millenium-fitness",maxRamExponent:{max:8,min:4},moneyAvailable:25e7,networkLayer:6,numOpenPortsRequired:3,organizationName:"Millenium Fitness Network",requiredHackingSkill:{max:525,min:475},serverGrowth:{max:45,min:25},specialName:r.a.VolhavenMilleniumFitnessGym},{hackDifficulty:{max:65,min:55},hostname:"powerhouse-fitness",maxRamExponent:{max:6,min:4},moneyAvailable:9e8,networkLayer:14,numOpenPortsRequired:5,organizationName:"Powerhouse Fitness",requiredHackingSkill:{max:1100,min:950},serverGrowth:{max:60,min:50},specialName:r.a.Sector12PowerhouseGym},{hackDifficulty:{max:60,min:40},hostname:"snap-fitness",moneyAvailable:45e7,networkLayer:7,numOpenPortsRequired:4,organizationName:"Snap Fitness",requiredHackingSkill:{max:800,min:675},serverGrowth:{max:60,min:40},specialName:r.a.AevumSnapFitnessGym},{hackDifficulty:0,hostname:"run4theh111z",literature:[i.a.SimulatedReality,i.a.TheNewGod],maxRamExponent:{max:9,min:5},moneyAvailable:0,networkLayer:11,numOpenPortsRequired:4,organizationName:"The Runners",requiredHackingSkill:{max:550,min:505},serverGrowth:0,specialName:o.a.BitRunnersServer},{hackDifficulty:0,hostname:"I.I.I.I",literature:[i.a.DemocracyIsDead],maxRamExponent:{max:8,min:4},moneyAvailable:0,networkLayer:5,numOpenPortsRequired:3,organizationName:"I.I.I.I",requiredHackingSkill:{max:365,min:340},serverGrowth:0,specialName:o.a.TheBlackHandServer},{hackDifficulty:0,hostname:"avmnite-02h",literature:[i.a.DemocracyIsDead],maxRamExponent:{max:7,min:4},moneyAvailable:0,networkLayer:4,numOpenPortsRequired:2,organizationName:a.a.NiteSec,requiredHackingSkill:{max:220,min:202},serverGrowth:0,specialName:o.a.NiteSecServer},{hackDifficulty:0,hostname:".",maxRamExponent:4,moneyAvailable:0,networkLayer:13,numOpenPortsRequired:4,organizationName:".",requiredHackingSkill:{max:550,min:505},serverGrowth:0,specialName:o.a.TheDarkArmyServer},{hackDifficulty:0,hostname:"CSEC",literature:[i.a.DemocracyIsDead],maxRamExponent:3,moneyAvailable:0,networkLayer:2,numOpenPortsRequired:1,organizationName:a.a.CyberSec,requiredHackingSkill:{max:60,min:51},serverGrowth:0,specialName:o.a.CyberSecServer},{hackDifficulty:0,hostname:"The-Cave",literature:[i.a.AlphaOmega],moneyAvailable:0,networkLayer:15,numOpenPortsRequired:5,organizationName:"Helios",requiredHackingSkill:925,serverGrowth:0,specialName:o.a.DaedalusServer},{hackDifficulty:0,hostname:"w0r1d_d43m0n",moneyAvailable:0,numOpenPortsRequired:5,organizationName:"w0r1d_d43m0n",requiredHackingSkill:3e3,serverGrowth:0,specialName:o.a.WorldDaemon},{hostname:o.a.DarkWeb,moneyAvailable:0,numOpenPortsRequired:5,organizationName:o.a.DarkWeb,requiredHackingSkill:1,specialName:o.a.DarkWeb}]},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(15),r=n(103);const i=6e4/n(13).a._idleSpeed,o=t=>null!==t&&t.type===r.b.INFILTRATE;class s extends r.a{constructor(){var t,e,n;super(r.b.INFILTRATE),n=0,(e="cyclesWorked")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}cyclesNeeded(){return i}process(t,e,n){if(!t.bladeburner)throw new Error("sleeve doing blade work without being a member");return this.cyclesWorked+=n,this.cyclesWorked>this.cyclesNeeded()&&(this.cyclesWorked-=this.cyclesNeeded(),t.bladeburner.infiltrateSynthoidCommunities(t)),0}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveInfiltrateWork",this)}static fromJSON(t){return Object(a.a)(s,t.data)}}a.c.constructors.SleeveInfiltrateWork=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(13),r=n(32);class i{constructor(t){this.name=t.name,this.nextPosition=t.nextPosition,this.baseSalary=t.baseSalary,this.repMultiplier=t.repMultiplier,this.requiredHacking=null!=t.reqdHacking?t.reqdHacking:0,this.requiredStrength=null!=t.reqdStrength?t.reqdStrength:0,this.requiredDefense=null!=t.reqdDefense?t.reqdDefense:0,this.requiredDexterity=null!=t.reqdDexterity?t.reqdDexterity:0,this.requiredAgility=null!=t.reqdAgility?t.reqdAgility:0,this.requiredCharisma=null!=t.reqdCharisma?t.reqdCharisma:0,this.requiredReputation=null!=t.reqdReputation?t.reqdReputation:0,this.hackingEffectiveness=null!=t.hackingEffectiveness?t.hackingEffectiveness:0,this.strengthEffectiveness=null!=t.strengthEffectiveness?t.strengthEffectiveness:0,this.defenseEffectiveness=null!=t.defenseEffectiveness?t.defenseEffectiveness:0,this.dexterityEffectiveness=null!=t.dexterityEffectiveness?t.dexterityEffectiveness:0,this.agilityEffectiveness=null!=t.agilityEffectiveness?t.agilityEffectiveness:0,this.charismaEffectiveness=null!=t.charismaEffectiveness?t.charismaEffectiveness:0,100!==Math.round(this.hackingEffectiveness+this.strengthEffectiveness+this.defenseEffectiveness+this.dexterityEffectiveness+this.agilityEffectiveness+this.charismaEffectiveness)&&console.error(`CompanyPosition ${this.name} parameters do not sum to 100`),this.hackingExpGain=null!=t.hackingExpGain?t.hackingExpGain:0,this.strengthExpGain=null!=t.strengthExpGain?t.strengthExpGain:0,this.defenseExpGain=null!=t.defenseExpGain?t.defenseExpGain:0,this.dexterityExpGain=null!=t.dexterityExpGain?t.dexterityExpGain:0,this.agilityExpGain=null!=t.agilityExpGain?t.agilityExpGain:0,this.charismaExpGain=null!=t.charismaExpGain?t.charismaExpGain:0}calculateJobPerformance(t,e,n,r,i,o){const s=this.hackingEffectiveness*t/a.a.MaxSkillLevel,l=this.strengthEffectiveness*e/a.a.MaxSkillLevel,c=this.defenseEffectiveness*n/a.a.MaxSkillLevel,f=this.dexterityEffectiveness*r/a.a.MaxSkillLevel,u=this.agilityEffectiveness*i/a.a.MaxSkillLevel,m=this.charismaEffectiveness*o/a.a.MaxSkillLevel;let h=this.repMultiplier*(s+l+c+f+u+m)/100;return isNaN(h)&&(console.error("Company reputation gain calculated to be NaN"),h=0),h}isSoftwareJob(){return r.j.includes(this.name)}isITJob(){return r.d.includes(this.name)}isSecurityEngineerJob(){return r.i.includes(this.name)}isNetworkEngineerJob(){return r.f.includes(this.name)}isBusinessJob(){return r.b.includes(this.name)}isSecurityJob(){return r.h.includes(this.name)}isAgentJob(){return r.a.includes(this.name)}isSoftwareConsultantJob(){return r.k.includes(this.name)}isBusinessConsultantJob(){return r.c.includes(this.name)}isPartTimeJob(){return r.g.includes(this.name)}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(154),r=n(98);function i(t,e){const n=t.organizationName;let i=null;if("string"==typeof n&&""!==n&&(i=r.a[n]),!(i instanceof a.a))return;const o=e/t.moneyMax;Math.random(){let t=5;const a=[],r=setInterval(()=>{if(t--,t>0)return;t=5*Math.random();const r=Math.random()*e.length,o=e.charAt(r);n(t=>i(t,r,function(t){const e=t=>t[Math.floor(Math.random()*t.length)],n=["abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ","1234567890"," _","()[]{}<>"];for(const a of n)if(a.includes(t))return e(a);return e("!@#$%^&*()_+|\\';\"/.,?`~")}(o))),a.push(window.setTimeout(()=>{n(t=>i(t,r,o))},500))},20);return()=>{clearInterval(r),a.forEach(t=>clearTimeout(t))}},[]),r.a.createElement("span",null,e)}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(13),o=n(12),s=n(648),l=n(153),c=n(280),f=n(114),u=n(16),m=n(15),h=n(400),d=n(74);const p=t=>null!==t&&t.type===l.b.GRAFTING;class g extends l.a{constructor(t){var e,n;super(l.b.GRAFTING,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.unitCompleted=0,this.augmentation=null!==(n=null==t?void 0:t.augmentation)&&void 0!==n?n:o.a.Targeting1;const a=Object(s.a)();null!=t&&t.player&&t.player.loseMoney(a[this.augmentation].cost,"augmentations")}unitNeeded(){return new h.a(d.a[this.augmentation]).time}process(t,e){let n=1;return t.hasAugmentation(o.a.NeuroreceptorManager)||(n=t.focus?1:i.a.BaseFocusBonus),this.cyclesWorked+=e,this.unitCompleted+=i.a._idleSpeed*e*Object(c.c)(t)*n,this.unitCompleted>=this.unitNeeded()}finish(t,e){const n=this.augmentation;e?e&&!this.singularity&&Object(u.a)(r.a.createElement(r.a.Fragment,null,"You cancelled the grafting of ",n,".",r.a.createElement("br",null),"Your money was not returned to you.")):(Object(f.a)({name:n,level:1}),t.hasAugmentation(o.a.CongruityImplant)||(t.entropy+=1,t.applyEntropy(t.entropy)),this.singularity||Object(u.a)(r.a.createElement(r.a.Fragment,null,"You've finished grafting ",n,".",r.a.createElement("br",null),"The augmentation has been applied to your body"," ",t.hasAugmentation(o.a.CongruityImplant)?".":", but you feel a bit off."))),e||t.gainIntelligenceExp(i.a.IntelligenceGraftBaseExpGain*this.cyclesWorked*i.a._idleSpeed/1e4)}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,augmentation:this.augmentation}}toJSON(){return Object(m.b)("GraftingWork",this)}static fromJSON(t){return Object(m.a)(g,t.data)}}m.c.constructors.GraftingWork=g},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(5),o=n(26),s=n(365),l=n(3);class c{constructor(t){var e,n,a,i,o,s,l;this.infoText=null!==(e=t.infoText)&&void 0!==e?e:r.a.createElement(r.a.Fragment,null),this.enemies=null!==(n=t.enemies)&&void 0!==n?n:[],this.offerHackingWork=null!==(a=t.offerHackingWork)&&void 0!==a&&a,this.offerFieldWork=null!==(i=t.offerFieldWork)&&void 0!==i&&i,this.offerSecurityWork=null!==(o=t.offerSecurityWork)&&void 0!==o&&o,this.keep=null!==(s=t.keepOnInstall)&&void 0!==s&&s,this.special=null!==(l=t.special)&&void 0!==l&&l,this.assignment=t.assignment}offersWork(){return this.offerFieldWork||this.offerHackingWork||this.offerSecurityWork}}const f={[i.a.Illuminati]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And from this chaos, we are the invisible hand that guides them to order."," "),offerHackingWork:!0,offerFieldWork:!0}),[i.a.Daedalus]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.TheCovenant]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Surrender yourself. Give up your empty individuality to become part of something great, something eternal. Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.",r.a.createElement("br",null),r.a.createElement("br",null),"Only then can you discover immortality."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.ECorp]:new c({infoText:r.a.createElement(r.a.Fragment,null,i.a.ECorp,"'s mission is simple: to connect the world of today with the technology of tomorrow. With our wide range of Internet-related software and commercial hardware, ",i.a.ECorp," makes the world's information universally accessible."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.MegaCorp]:new c({infoText:r.a.createElement(r.a.Fragment,null,i.a.MegaCorp," does what no other dares to do. We imagine. We create. We invent. We create what others have never even dreamed of. Our work fills the world's needs for food, water, power, and transportation on an unprecedented scale, in ways that no other company can.",r.a.createElement("br",null),r.a.createElement("br",null),"In our labs and factories and on the ground with customers, ",i.a.MegaCorp," is ushering in a new era for the world."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.BachmanAssociates]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Where Law and Business meet - that's where we are.",r.a.createElement("br",null),r.a.createElement("br",null),"Legal Insight - Business Instinct - Innovative Experience."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.BladeIndustries]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Augmentation is Salvation."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.NWO]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given purpose and direction in life. That is why they created God. And that is why they created civilization - not because of willingness, but because of a need to be incorporated into higher orders of structure and meaning."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.ClarkeIncorporated]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The Power of the Genome - Unlocked."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.OmniTekIncorporated]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Simply put, our mission is to design and build robots that make a difference."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.FourSigma]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by deep learning and innovative ideas. And improved by iteration. That's ",i.a.FourSigma,"."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.KuaiGongInternational]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Dream big. Work hard. Make history."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.FulcrumSecretTechnologies]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it would be necessary to create them. And now we can."),offerHackingWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.BitRunners]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be reconstructed. Transformed. Used.",r.a.createElement("br",null),r.a.createElement("br",null),"Those who run the bits, run the world."),offerHackingWork:!0}),[i.a.TheBlackHand]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power. Technological power. And those at the top rule with an invisible hand. They built a society where the rich get richer, and everyone else suffers.",r.a.createElement("br",null),r.a.createElement("br",null),"So much pain. So many lives. Their darkness must end."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.NiteSec]:new c({infoText:r.a.createElement(r.a.Fragment,null," __..__ ",r.a.createElement("br",null)," _.nITESECNIt. ",r.a.createElement("br",null)," .-'NITESECNITESEc. ",r.a.createElement("br",null)," .' NITESECNITESECn ",r.a.createElement("br",null)," / NITESECNITESEC; ",r.a.createElement("br",null)," : :NITESECNITESEC; ",r.a.createElement("br",null)," ; $ NITESECNITESECN ",r.a.createElement("br",null)," : _, ,N'ITESECNITESEC ",r.a.createElement("br",null)," : .+^^`, : `NITESECNIT ",r.a.createElement("br",null)," ) /), `-,-=,NITESECNI ",r.a.createElement("br",null)," / ^ ,-;|NITESECN; ",r.a.createElement("br",null)," / _.' '-';NITESECN ",r.a.createElement("br",null)," ( , ,-''`^NITE' ",r.a.createElement("br",null)," )` :`. .' ",r.a.createElement("br",null)," )-- ; `- / ",r.a.createElement("br",null)," ' _.-' : ",r.a.createElement("br",null)," ( _.-' . ",r.a.createElement("br",null)," ------. ",r.a.createElement("br",null)," . ",r.a.createElement("br",null)," _.nIt ",r.a.createElement("br",null)," _.nITESECNi ",r.a.createElement("br",null)," nITESECNIT^' ",r.a.createElement("br",null)," NITE^' ___ ",r.a.createElement("br",null)," / .gP''''Tp. ",r.a.createElement("br",null)," : d' . `b ",r.a.createElement("br",null)," ; d' o `b ; ",r.a.createElement("br",null)," / d; `b| ",r.a.createElement("br",null)," /, $; @ `: ",r.a.createElement("br",null)," /' $/ ; ",r.a.createElement("br",null)," .' $/b o | ",r.a.createElement("br",null)," .' d$/$; : ",r.a.createElement("br",null)," / .d/$/$; , ; ",r.a.createElement("br",null)," d .dNITESEC $ | ",r.a.createElement("br",null)," :bp.__.gNITESEC/$ :$ ; ",r.a.createElement("br",null)," NITESECNITESECNIT /$b : ",r.a.createElement("br",null)),offerHackingWork:!0,offerFieldWork:!1,offerSecurityWork:!1,special:!1,keepOnInstall:!1}),[i.a.Aevum]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The Silicon City."),enemies:[i.a.Chongqing,i.a.NewTokyo,i.a.Ishima,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Chongqing]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Serve the People."),enemies:[i.a.Sector12,i.a.Aevum,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Ishima]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The East Asian Order of the Future."),enemies:[i.a.Sector12,i.a.Aevum,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.NewTokyo]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Asia's World City."),enemies:[i.a.Sector12,i.a.Aevum,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Sector12]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The City of the Future."),enemies:[i.a.Chongqing,i.a.NewTokyo,i.a.Ishima,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Volhaven]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Benefit, Honor, and Glory."),enemies:[i.a.Chongqing,i.a.Sector12,i.a.NewTokyo,i.a.Aevum,i.a.Ishima],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.SpeakersForTheDead]:new c({infoText:r.a.createElement(r.a.Fragment,null,"It is better to reign in Hell than to serve in Heaven."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.TheDarkArmy]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The World doesn't care about right or wrong. It only cares about power."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.TheSyndicate]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Honor holds you back."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Silhouette]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Corporations have filled the void of power left behind by the collapse of Western government. The issue is they've become so big that you don't know who they're working for. And if you're employed at one of these corporations, you don't even know who you're working for.",r.a.createElement("br",null),r.a.createElement("br",null),"That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.Tetrads]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Following the mandate of Heaven and carrying out the way."),offerFieldWork:!0,offerSecurityWork:!0}),[i.a.SlumSnakes]:new c({infoText:r.a.createElement(r.a.Fragment,null,i.a.SlumSnakes," rule!"),offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Netburners]:new c({infoText:r.a.createElement(r.a.Fragment,null,"~~//*>H4CK||3T 8URN3R5**>?>\\~~"),offerHackingWork:!0}),[i.a.TianDiHui]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Obey Heaven and work righteously."),offerHackingWork:!0,offerSecurityWork:!0}),[i.a.CyberSec]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy that we have ever had. And as the world becomes increasingly dominated by it, society approaches the brink of total chaos. We serve only to protect society, to protect humanity, to protect the world from imminent collapse."),offerHackingWork:!0}),[i.a.Bladeburners]:new c({infoText:r.a.createElement(r.a.Fragment,null,"It's too bad they won't live. But then again, who does?",r.a.createElement("br",null),r.a.createElement("br",null),"Note that for this faction, reputation can only be gained through ",i.a.Bladeburners," actions."," ","Completing ",i.a.Bladeburners," contracts/operations will increase your reputation."),special:!0,assignment:()=>{const t=o.b.Router();return r.a.createElement(s.a,{buttonText:"Open Bladeburner headquarters",infoText:"You can gain reputation with bladeburner by completing contracts and operations.",onClick:()=>t.toBladeburner()})}}),[i.a.ChurchOfTheMachineGod]:new c({infoText:r.a.createElement(r.a.Fragment,null," `` ",r.a.createElement("br",null)," -odmmNmds: ",r.a.createElement("br",null)," `hNmo:..-omNh. ",r.a.createElement("br",null)," yMd` `hNh ",r.a.createElement("br",null)," mMd oNm ",r.a.createElement("br",null)," oMNo .mM/ ",r.a.createElement("br",null)," `dMN+ -mM+ ",r.a.createElement("br",null)," -mMNo -mN+ ",r.a.createElement("br",null)," .+- :mMNo/mN/ ",r.a.createElement("br",null),":yNMd. :NMNNN/ ",r.a.createElement("br",null),"-mMMMh. /NMMh` ",r.a.createElement("br",null)," .dMMMd. /NMMMy` ",r.a.createElement("br",null)," `yMMMd. /NNyNMMh` ",r.a.createElement("br",null)," `sMMMd. +Nm: +NMMh. ",r.a.createElement("br",null)," oMMMm- oNm: /NMMd. ",r.a.createElement("br",null)," +NMMmsMm- :mMMd. ",r.a.createElement("br",null)," /NMMMm- -mMMd. ",r.a.createElement("br",null)," /MMMm- -mMMd. ",r.a.createElement("br",null)," `sMNMMm- .mMmo ",r.a.createElement("br",null)," `sMd:hMMm. ./. ",r.a.createElement("br",null)," `yMy` `yNMd` ",r.a.createElement("br",null)," `hMs` oMMy ",r.a.createElement("br",null)," `hMh sMN- ",r.a.createElement("br",null)," /MM- .NMo ",r.a.createElement("br",null)," +MM: :MM+ ",r.a.createElement("br",null)," sNNo-.`.-omNy` ",r.a.createElement("br",null)," -smNNNNmdo- ",r.a.createElement("br",null)," `..` ",r.a.createElement("br",null),r.a.createElement("br",null),"Many cultures predict an end to humanity in the near future, a final Armageddon that will end the world; but we disagree."),offerHackingWork:!1,offerFieldWork:!1,offerSecurityWork:!1,special:!0,keepOnInstall:!0,assignment:()=>{const t=o.b.Router();return r.a.createElement(s.a,{buttonText:"Open Staneks Gift",infoText:"Stanek's Gift is a powerful augmentation that powers up the stat you chose to boost.Gaining reputation with the Church of the Machine God can only be done by charging the gift.",onClick:()=>t.toStaneksGift()})}}),[i.a.ShadowsOfAnarchy]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The government is ruled by the corporations that we have allowed to consume it. To release the world from its shackles, the gods grant us their strength."),special:!0,keepOnInstall:!0,assignment:()=>r.a.createElement(l.a,null,i.a.ShadowsOfAnarchy," can only gain reputation by infiltrating.")})}},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(22),r=n(13),i=n(108),o=n(90),s=n(232);const l=1e3/r.a._idleSpeed,c={[i.a.HACKING]:Object(o.c)({hackExp:15}),[i.a.FIELD]:Object(o.c)({hackExp:10,strExp:10,defExp:10,dexExp:10,agiExp:10,chaExp:10}),[i.a.SECURITY]:Object(o.c)({hackExp:5,strExp:15,defExp:15,dexExp:15,agiExp:15})},f=(t,e,n)=>({[i.a.HACKING]:s.c,[i.a.FIELD]:s.a,[i.a.SECURITY]:s.b}[e](t,n));function u(t,e){const n=c[e];return{money:0,reputation:0,hackExp:n.hackExp*t.mults.hacking_exp*a.a.FactionWorkExpGain/l,strExp:n.strExp*t.mults.strength_exp*a.a.FactionWorkExpGain/l,defExp:n.defExp*t.mults.defense_exp*a.a.FactionWorkExpGain/l,dexExp:n.dexExp*t.mults.dexterity_exp*a.a.FactionWorkExpGain/l,agiExp:n.agiExp*t.mults.agility_exp*a.a.FactionWorkExpGain/l,chaExp:n.chaExp*t.mults.charisma_exp*a.a.FactionWorkExpGain/l,intExp:0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(246),r=n(15);function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class o{constructor(){i(this,"capacity",0),i(this,"hashes",0),i(this,"upgrades",{});for(const t of Object.keys(a.a))this.upgrades[t]=0}getMult(t){const e=a.a[t],n=this.upgrades[t];return null==e||null==n?(console.error("Could not find Hash Study upgrade"),1):1+e.value*n/100}getStudyMult(){return this.getMult("Improve Studying")}getTrainingMult(){return this.getMult("Improve Gym Training")}getUpgrade(t){const e=a.a[t];return e||(console.error("Invalid Upgrade Name given to HashManager.getUpgrade(): "+t),null)}getUpgradeCost(t,e=1){const n=this.getUpgrade(t),a=this.upgrades[t];return null==n||null==a?(console.error("Invalid Upgrade Name given to HashManager.getUpgradeCost(): "+t),1/0):n.getCost(a,e)}prestige(){for(const t of Object.keys(a.a))this.upgrades[t]=0;this.hashes=0,this.updateCapacity(0)}refundUpgrade(t,e=1){const n=a.a[t];this.upgrades[t]-=e;const r=this.upgrades[t];if(null==n||null==r||r<0)return void console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t);const i=n.getCost(r,e);this.hashes+=i}storeHashes(t){this.hashes+=t;let e=this.hashes;return this.hashes=Math.min(this.hashes,this.capacity),e-=this.hashes,e}updateCapacity(t){t<0&&(this.capacity=0),this.capacity=Math.max(t,0)}upgrade(t,e=1){if(null==a.a[t])return console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t),!1;const n=this.getUpgradeCost(t,e);return!(this.hashes=this.size}process(t=1,e,n){if(n.hasResearch("HRBuddy-Recruitment")&&!this.atCapacity()){const t=this.hireRandomEmployee();n.hasResearch("HRBuddy-Training")&&void 0!==t&&(t.pos=a.a.Training)}for(const t of this.employees)t.pos=t.nextPos;this.calculateTotalEmployees(),this.calculateNextEmployees(),this.maxEne=100,this.maxHap=100,this.maxMor=100,n.hasResearch("Go-Juice")&&(this.maxEne+=10),n.hasResearch("JoyWire")&&(this.maxHap+=10),n.hasResearch("Sti.mu")&&(this.maxMor+=10),n.hasResearch("AutoBrew")&&(this.autoCoffee=!0),n.hasResearch("AutoPartyManager")&&(this.autoParty=!0);let r=1;e.funds<0&&n.lastCycleRevenue<0?r=Math.pow(.99,t):e.funds>0&&n.lastCycleRevenue>0&&(r=Math.pow(1.01,t));let i=0;for(const e of this.employees){if(i+=e.process(t),this.autoCoffee)e.ene=this.maxEne;else if(this.coffeeMult>1){const t=1+(this.coffeeMult-1)*this.employees.length/this.coffeeEmployees;e.ene*=t}else e.ene*=r;if(this.autoParty)e.mor=this.maxMor,e.hap=this.maxHap;else if(this.partyMult>1){const t=1+(this.partyMult-1)*this.employees.length/this.partyEmployees;e.mor*=t,e.hap*=t}else e.mor*=r,e.hap*=r;e.ene=Math.max(Math.min(e.ene,this.maxEne),this.minEne),e.mor=Math.max(Math.min(e.mor,this.maxMor),this.minMor),e.hap=Math.max(Math.min(e.hap,this.maxHap),this.minHap)}return this.coffeeMult=0,this.partyMult=0,this.coffeeEmployees=0,this.partyEmployees=0,this.calculateEmployeeProductivity(e,n),i}calculateNextEmployees(){for(const t of Object.keys(this.employeeNextJobs))this.employeeNextJobs[t]=0;for(let t=0;t=e&&(r.nextPos=a.a.Unassigned,n--)}return this.calculateNextEmployees(),n===e}getCoffeeCost(){return 5e5*this.employees.length}setCoffee(t=1.05){return t>1&&0===this.coffeeMult&&!this.autoCoffee&&this.employees.length>0&&(this.coffeeMult=t,this.coffeeEmployees=this.employees.length,!0)}setParty(t){return t>1&&0===this.partyMult&&!this.autoParty&&this.employees.length>0&&(this.partyMult=t,this.partyEmployees=this.employees.length,!0)}toJSON(){return Object(s.b)("OfficeSpace",this)}static fromJSON(t){return Object(s.a)(f,t.data)}}s.c.constructors.OfficeSpace=f},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return r})),function(t){t[t.SmartFactories=0]="SmartFactories",t[t.SmartStorage=1]="SmartStorage",t[t.DreamSense=2]="DreamSense",t[t.WilsonAnalytics=3]="WilsonAnalytics",t[t.NuoptimalNootropicInjectorImplants=4]="NuoptimalNootropicInjectorImplants",t[t.SpeechProcessorImplants=5]="SpeechProcessorImplants",t[t.NeuralAccelerators=6]="NeuralAccelerators",t[t.FocusWires=7]="FocusWires",t[t.ABCSalesBots=8]="ABCSalesBots",t[t.ProjectInsight=9]="ProjectInsight"}(a||(a={}));const r={[a.SmartFactories]:{index:a.SmartFactories,basePrice:2e9,priceMult:1.06,benefit:.03,name:"Smart Factories",desc:"Advanced AI automatically optimizes the operation and productivity of factories. Each level of this upgrade increases your global production by 3% (additive)."},[a.SmartStorage]:{index:a.SmartStorage,basePrice:2e9,priceMult:1.06,benefit:.1,name:"Smart Storage",desc:"Advanced AI automatically optimizes your warehouse storage methods. Each level of this upgrade increases your global warehouse storage size by 10% (additive)."},[a.DreamSense]:{index:a.DreamSense,basePrice:4e9,priceMult:1.1,benefit:.001,name:"DreamSense",desc:"Use DreamSense LCC Technologies to advertise your corporation to consumers through their dreams. Each level of this upgrade provides a passive increase in awareness of all of your companies (divisions) by 0.004 / market cycle,and in popularity by 0.001 / market cycle. A market cycle is approximately 15 seconds."},[a.WilsonAnalytics]:{index:a.WilsonAnalytics,basePrice:4e9,priceMult:1.5,benefit:.005,name:"Wilson Analytics",desc:"Purchase data and analysis from Wilson, a marketing research firm. Each level of this upgrade increases the effectiveness of your advertising by 0.5% (additive)."},[a.NuoptimalNootropicInjectorImplants]:{index:a.NuoptimalNootropicInjectorImplants,basePrice:1e9,priceMult:1.06,benefit:.1,name:"Nuoptimal Nootropic Injector Implants",desc:"Purchase the Nuoptimal Nootropic Injector augmentation for your employees. Each level of this upgrade globally increases the creativity of your employees by 10% (additive)."},[a.SpeechProcessorImplants]:{index:a.SpeechProcessorImplants,basePrice:1e9,priceMult:1.06,benefit:.1,name:"Speech Processor Implants",desc:"Purchase the Speech Processor augmentation for your employees. Each level of this upgrade globally increases the charisma of your employees by 10% (additive)."},[a.NeuralAccelerators]:{index:a.NeuralAccelerators,basePrice:1e9,priceMult:1.06,benefit:.1,name:"Neural Accelerators",desc:"Purchase the Neural Accelerator augmentation for your employees. Each level of this upgrade globally increases the intelligence of your employees by 10% (additive)."},[a.FocusWires]:{index:a.FocusWires,basePrice:1e9,priceMult:1.06,benefit:.1,name:"FocusWires",desc:"Purchase the FocusWire augmentation for your employees. Each level of this upgrade globally increases the efficiency of your employees by 10% (additive)."},[a.ABCSalesBots]:{index:a.ABCSalesBots,basePrice:1e9,priceMult:1.07,benefit:.01,name:"ABC SalesBots",desc:"Always Be Closing. Purchase these robotic salesmen to increase the amount of materials and products you sell. Each level of this upgrade globally increases your sales by 1% (additive)."},[a.ProjectInsight]:{index:a.ProjectInsight,basePrice:5e9,priceMult:1.07,benefit:.05,name:"Project Insight",desc:"Purchase 'Project Insight', a R&D service provided by the secretive Fulcrum Technologies. Each level of this upgrade globally increases the amount of Scientific Research you produce by 5% (additive)."}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(132),r=n(13);class i{constructor(t){this.augmentation=t}get cost(){return this.augmentation.baseCost*r.a.AugmentationGraftingCostMult}get time(){const t=Math.max(Object(a.sum)(Object.values(this.augmentation.mults).filter(t=>1!==t)),1),e=Math.log2(t);return(r.a.AugmentationGraftingTimeBase*e+r.a.MillisecondsPerHalfHour)/2}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1516),r=n(1827);const i=Object(r.a)(t=>({root:{backgroundColor:t.palette.background.paper},bar:{transition:"none",backgroundColor:t.palette.primary.main}}))(a.a)},,function(t,e,n){"use strict";function a(t,e){for(const n of Object.keys(e)){const a=e[n];void 0!==a&&("function"==typeof a?a(t,n):void 0!==a.func?a.func(t,e,n):(typeof t[n]!=typeof a.default&&(t[n]=a.default),"number"==typeof t[n]&&void 0!==a.min&&t[n]a.max&&(t[n]=a.max)))}}function r(t,e,n){return(a,r)=>{"number"==typeof a[r]?(a[r]n&&(a[r]=n)):a[r]=t}}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(22),r=n(629),i=n(12);function o(t,e,n,r){const o=n*Math.pow(1.01,n);return Math.pow(e+1,2)*Math.pow(r,3)*3e3*o*(t.hasAugmentation(i.a.WKSharmonizer,!0)?1.5:1)*a.a.InfiltrationMoney}function s(t,e,n,r){const o=n*Math.pow(1.01,n);return Math.pow(e+1,1.1)*Math.pow(r,1.2)*30*o*(t.hasAugmentation(i.a.WKSharmonizer,!0)?1.5:1)*a.a.InfiltrationRep}function l(t,e,n){return n/r.a.reduce((t,e)=>{var n;const a=(null===(n=e.infiltrationData)||void 0===n?void 0:n.startingSecurityLevel)||0;return t>a?t:a},0)*5e3*(t.hasAugmentation(i.a.WKSharmonizer,!0)?2:1)*(1+e.favor/100)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(15);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(){r(this,"bladeburner",0),r(this,"casino",0),r(this,"class",0),r(this,"codingcontract",0),r(this,"corporation",0),r(this,"crime",0),r(this,"gang",0),r(this,"hacking",0),r(this,"hacknet",0),r(this,"hacknet_expenses",0),r(this,"hospitalization",0),r(this,"infiltration",0),r(this,"sleeves",0),r(this,"stock",0),r(this,"total",0),r(this,"work",0),r(this,"servers",0),r(this,"other",0),r(this,"augmentations",0)}record(t,e){const n=e.toLowerCase();"number"==typeof this[n]?(this[n]+=t,this.total+=t):console.warn("MoneySourceTracker.record() called with invalid source: "+e)}reset(){for(const t in this)"number"==typeof this[t]&&(this[t]=0)}toJSON(){return Object(a.b)("MoneySourceTracker",this)}static fromJSON(t){return Object(a.a)(i,t.data)}}a.c.constructors.MoneySourceTracker=i},,function(t,e,n){"use strict";function a(){const t=Math.random();return t<.4?"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(26*Math.random())]:t<.8?"abcdefghijklmnopqrstuvwxyz"[Math.floor(26*Math.random())]:"01234567689"[Math.floor(10*Math.random())]}function r(){const t=50+Math.floor(25*(Math.random()+Math.random()));let e="";for(;e.lengthe.length)continue;for(let a=0;aArray(10).fill(null)),a=Array.from(Array(10),()=>Array(10));function r(t,e,n,a){const r=t[e][n];(null==r||a.length9||n+1+a>t.length)return null;if(e+=t.substring(n+1,n+1+a),n+=1+a,n>=t.length)break;const r=t.charCodeAt(n)-48;if(r<0||r>9)return null;if(0===r)++n;else{if(n+1>=t.length)return null;const a=t.charCodeAt(n+1)-48;if(r>0&&(a<1||a>9)||a>e.length)return null;for(let t=0;t=1}function l(){const t=this.gang;if(null===t)throw new Error("Cannot get gang faction because player is not in a gang.");const e=a.a[t.facName];if(null==e)throw new Error("Gang has invalid faction name: "+t.facName);return e}function c(){if(!this.inGang())return"";const t=this.gang;if(null===t)throw new Error("Cannot get gang faction because player is not in a gang.");return t.facName}function f(t){if(!this.inGang())return!1;const e=this.gang;if(null===e)throw new Error("Cannot get gang faction because player is not in a gang.");return e.facName===t}function u(){return null!=this.gang&&null!=this.gang&&this.gang instanceof r.a}function m(t,e){this.gang=new r.a(t,e);const n=a.a[t];if(null==n)throw new Error("Invalid faction name when creating gang: "+t);n.playerReputation=0}},,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={lineHeight:1.5,fontFamily:"Lucida Console, Lucida Sans Unicode, Fira Mono, Consolas, Courier New, Courier, monospace, Times New Roman"}},,,,,function(t,e,n){"use strict";function a(t,e){if(t.length!==e.length)return!1;for(let n=0;ne.skills.hacking?{res:!1,msg:`Cannot hack ${t.hostname} server because your hacking skill is not high enough`}:{res:!0}}function i(t){return a(t,"grow")}function o(t){return a(t,"weaken")}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return d}));var a=n(0),r=n.n(a),i=n(127),o=n(39),s=n(3),l=n(9),c=n(130),f=n(88),u=n(73),m=n(30);const h=new i.a;function d(){var t,e,n;const[i,l]=Object(a.useState)(null);if(Object(a.useEffect)(()=>h.subscribe(t=>{l(t)}),[]),null===i)return r.a.createElement(r.a.Fragment,null);const c={text:g,select:y};let f=p;null!=i&&null!==(t=i.options)&&void 0!==t&&t.type&&["text","select"].includes(null==i||null===(e=i.options)||void 0===e?void 0:e.type)&&(f=c[null==i||null===(n=i.options)||void 0===n?void 0:n.type]);return r.a.createElement(o.a,{open:!0,onClose:function(){var t,e;null!==i&&(["text","select"].includes(null!==(t=null==i||null===(e=i.options)||void 0===e?void 0:e.type)&&void 0!==t?t:"")?i.resolve(""):i.resolve(!1),l(null))}},r.a.createElement("pre",null,r.a.createElement(s.a,null,i.txt)),r.a.createElement(f,{prompt:i,resolve:t=>{i.resolve(t),l(null)}}))}function p({resolve:t}){return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingTop:"10px"}},r.a.createElement(l.a,{style:{marginRight:"auto"},onClick:()=>t(!0)},"Yes"),r.a.createElement(l.a,{onClick:()=>t(!1)},"No")))}function g({resolve:t}){const[e,n]=Object(a.useState)(""),i=()=>t(e);return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",alignItems:"center",paddingTop:"10px"}},r.a.createElement(f.a,{autoFocus:!0,value:e,onInput:t=>{n(t.target.value)},onKeyDown:t=>{t.stopPropagation(),t.key===m.a.ENTER&&(t.preventDefault(),i())},style:{flex:"1 0 auto"},InputProps:{endAdornment:r.a.createElement(l.a,{onClick:i},"Confirm")}})))}function y({prompt:t,resolve:e}){var n,i;const[o,f]=Object(a.useState)("");return Array.isArray(null==t||null===(n=t.options)||void 0===n?void 0:n.choices)?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",alignItems:"center",paddingTop:"10px"}},r.a.createElement(c.a,{onChange:t=>{f(t.target.value)},value:o,style:{flex:"1 0 auto"}},(t=>{const e=[];for(const n of t)e.push(r.a.createElement(u.a,{key:n,value:n},n));return e})((null==t||null===(i=t.options)||void 0===i?void 0:i.choices)||[])),r.a.createElement(l.a,{onClick:()=>e(o),disabled:""===o},"Confirm"))):r.a.createElement(s.a,null,"Error: Please provide an array of string choices")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(42),r=n(185),i=n(1083),o=n(568),s=n(15),l=n(34);function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f{constructor(t={}){c(this,"name",""),c(this,"dmd",0),c(this,"cmp",0),c(this,"mku",0),c(this,"pCost",0),c(this,"sCost",0),c(this,"fin",!1),c(this,"prog",0),c(this,"createCity",""),c(this,"designCost",0),c(this,"advCost",0),c(this,"creationProd",{[a.a.Operations]:0,[a.a.Engineer]:0,[a.a.Business]:0,[a.a.Management]:0,[a.a.RandD]:0,total:0}),c(this,"rat",0),c(this,"qlt",0),c(this,"per",0),c(this,"dur",0),c(this,"rel",0),c(this,"aes",0),c(this,"fea",0),c(this,"data",Object(o.a)([0,0,0])),c(this,"loc",""),c(this,"siz",0),c(this,"reqMats",{}),c(this,"prdman",Object(o.a)([!1,0])),c(this,"sllman",Object(o.a)([!1,0])),c(this,"marketTa1",!1),c(this,"marketTa2",!1),c(this,"marketTa2Price",Object(o.a)(0)),c(this,"maxsll",0),this.name=t.name?t.name:"",this.dmd=t.demand?t.demand:0,this.cmp=t.competition?t.competition:0,this.mku=t.markup?t.markup:0,this.createCity=t.createCity?t.createCity:"",this.designCost=t.designCost?t.designCost:0,this.advCost=t.advCost?t.advCost:0,this.qlt=t.quality?t.quality:0,this.per=t.performance?t.performance:0,this.dur=t.durability?t.durability:0,this.rel=t.reliability?t.reliability:0,this.aes=t.aesthetics?t.aesthetics:0,this.fea=t.features?t.features:0,this.loc=t.loc?t.loc:"",this.siz=t.size?t.size:0,this.reqMats=t.req?t.req:{}}createProduct(t,e){if(this.fin)return;const n=e[a.a.Operations],r=e[a.a.Engineer],i=e[a.a.Management],o=n+r+i;if(o<=0)return;const s=1+i/(1.2*o),l=(Math.pow(r,.34)+Math.pow(n,.2))*s,c=Math.min(.01*t*l,100-this.prog);if(!(c<=0)){this.prog+=c;for(const t of Object.keys(e))this.creationProd[t]+=e[t]*c/100}}finishProduct(t){this.fin=!0;const e=this.creationProd.total,n=this.creationProd[a.a.Engineer]/e,i=this.creationProd[a.a.Management]/e,o=this.creationProd[a.a.RandD]/e,s=this.creationProd[a.a.Operations]/e,c=this.creationProd[a.a.Business]/e,f=(1.2*n+.9*i+1.3*o+1.5*s+c)*(1+Math.pow(this.designCost,.1)/100)*(1+Math.pow(t.sciResearch.qty,t.sciFac)/800);this.qlt=f*(.1*this.creationProd[a.a.Engineer]+.05*this.creationProd[a.a.Management]+.05*this.creationProd[a.a.RandD]+.02*this.creationProd[a.a.Operations]+.02*this.creationProd[a.a.Business]),this.per=f*(.15*this.creationProd[a.a.Engineer]+.02*this.creationProd[a.a.Management]+.02*this.creationProd[a.a.RandD]+.02*this.creationProd[a.a.Operations]+.02*this.creationProd[a.a.Business]),this.dur=f*(.05*this.creationProd[a.a.Engineer]+.02*this.creationProd[a.a.Management]+.08*this.creationProd[a.a.RandD]+.05*this.creationProd[a.a.Operations]+.05*this.creationProd[a.a.Business]),this.rel=f*(.02*this.creationProd[a.a.Engineer]+.08*this.creationProd[a.a.Management]+.02*this.creationProd[a.a.RandD]+.05*this.creationProd[a.a.Operations]+.08*this.creationProd[a.a.Business]),this.aes=f*(0*this.creationProd[a.a.Engineer]+.08*this.creationProd[a.a.Management]+.05*this.creationProd[a.a.RandD]+.02*this.creationProd[a.a.Operations]+.1*this.creationProd[a.a.Business]),this.fea=f*(.08*this.creationProd[a.a.Engineer]+.05*this.creationProd[a.a.Management]+.02*this.creationProd[a.a.RandD]+.05*this.creationProd[a.a.Operations]+.05*this.creationProd[a.a.Business]),this.calculateRating(t);const u=1+Math.pow(this.advCost,.1)/100,m=Math.max(c+i,1/e);this.mku=100/(u*Math.pow(this.qlt+.001,.65)*m),0!==this.mku&&isFinite(this.mku)||(this.mku=1),this.dmd=0===t.awareness?20:Math.min(100,u*(t.popularity/t.awareness*100)),this.cmp=Object(l.a)(0,70);for(const e of Object.keys(t.reqMats))if(t.reqMats.hasOwnProperty(e)){const n=t.reqMats[e];if(void 0===n)continue;this.reqMats[e]=n}this.siz=0;for(const e of Object.keys(t.reqMats)){const n=t.reqMats[e];void 0!==n&&(this.siz+=r.a[e]*n)}}calculateRating(t){const e=i.a[t.type];null!=e?(this.rat=0,this.rat+=e.Quality?this.qlt*e.Quality:0,this.rat+=e.Performance?this.per*e.Performance:0,this.rat+=e.Durability?this.dur*e.Durability:0,this.rat+=e.Reliability?this.rel*e.Reliability:0,this.rat+=e.Aesthetics?this.aes*e.Aesthetics:0,this.rat+=e.Features?this.fea*e.Features:0):console.error("Could not find product rating weights for: "+t)}toJSON(){return Object(s.b)("Product",this)}static fromJSON(t){return Object(s.a)(f,t.data)}}s.c.constructors.Product=f},function(t,e,n){"use strict";function a(t,e){return!!Object.keys(e.reqMats).includes(t)||(!!e.prodMats.includes(t)||!!["Hardware","Robots","AICores","RealEstate","AI Cores","Real Estate"].includes(t))}n.d(e,"a",(function(){return a}))},,function(t,e,n){"use strict";n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(132),o=n(251),s=n(3),l=n(20),c=n(46),f=n(9),u=n(1812),m=n(1813),h=n(1814),d=n(26),p=n(6),g=n(63),y=n(311);const b=[];function E(){const t=d.b.Player(),e=d.b.Router(),n=Object(a.useState)(!1)[1];function E(){n(t=>!t)}const v=[...Object.values(g.a)].filter(e=>{const n=e.create;return null!==n&&("b1t_flum3.exe"!==e.name||n.req(t))}).sort((e,n)=>{var a,r,i,o;return t.hasProgram(e.name)?1:t.hasProgram(n.name)?-1:(null!==(a=null===(r=e.create)||void 0===r?void 0:r.level)&&void 0!==a?a:0)-(null!==(i=null===(o=n.create)||void 0===o?void 0:o.level)&&void 0!==i?i:0)});Object(a.useEffect)(()=>{v.forEach(t=>{b.includes(t.name)||b.push(t.name)})},[]),Object(a.useEffect)(()=>{const t=setInterval(E,200);return()=>clearInterval(t)},[]);const k=e=>Math.ceil(Math.max(e-(t.skills.hacking+t.skills.intelligence/2),0));return r.a.createElement(o.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0,mb:10}},r.a.createElement(s.a,{variant:"h4"},"Create program"),r.a.createElement(s.a,null,"This page displays any programs that you are able to create. Writing the code for a program takes time, which can vary based on how complex the program is. If you are working on creating a program you can cancel at any time. Your progress will be saved and you can continue later."),r.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",my:1}},v.map(n=>{const a=n.create;if(null===a)return r.a.createElement(r.a.Fragment,null);const o=(e=>{const n=Object(i.find)(t.getHomeComputer().programs,t=>t.startsWith(e)&&t.endsWith("%-INC"));if(!n)return-1;const a=n.split("-");if(3!=a.length)return-1;const r=Number(a[1].slice(0,-1));return isNaN(r)||r<0||r>=100?-1:r})(n.name);return r.a.createElement(l.a,{component:c.a,sx:{p:1,opacity:t.hasProgram(n.name)?.75:1},key:n.name},r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},t.hasProgram(n.name)&&r.a.createElement(u.a,{sx:{mr:1}})||a.req(t)&&r.a.createElement(m.a,{sx:{mr:1}})||r.a.createElement(h.a,{sx:{mr:1}}),n.name),!t.hasProgram(n.name)&&a.req(t)&&r.a.createElement(f.a,{sx:{my:1,width:"100%"},onClick:a=>{a.isTrusted&&(t.startWork(new y.a({player:t,singularity:!1,programName:n.name})),t.startFocusing(),e.toWork())}},"Create program"),t.hasProgram(n.name)||0===k(a.level)||r.a.createElement(s.a,{color:p.a.theme.hack},r.a.createElement("b",null,"Unlocks in:")," ",k(a.level)," hacking levels"),-1!==o&&r.a.createElement(s.a,{color:p.a.theme.infolight},r.a.createElement("b",null,"Current completion:")," ",o,"%"),r.a.createElement(s.a,null,a.tooltip)))})))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return _})),n.d(e,"a",(function(){return L}));var a=n(1815),r=n(1816),i=n(1817),o=n(1818),s=n(1512),l=n(722),c=n(723),f=n(21),u=n(46),m=n(20),h=n(9),d=n(3),p=n(126),g=n(251),y=n(0),b=n.n(y),E=n(6),v=n(7),k=n(5),w=n(105),S=n(29);const _=[],C=t=>{const e=t.faction.getInfo();return b.a.createElement(b.a.Fragment,null,e.offerFieldWork&&b.a.createElement(f.a,{title:"This Faction offers field work"},b.a.createElement(a.a,{sx:{color:E.a.theme.info,mr:.5},fontSize:"small"})),e.offerHackingWork&&b.a.createElement(f.a,{title:"This Faction offers hacking work"},b.a.createElement(r.a,{sx:{color:E.a.theme.hack,mr:.5},fontSize:"small"})),e.offerSecurityWork&&b.a.createElement(f.a,{title:"This Faction offers security work"},b.a.createElement(i.a,{sx:{color:E.a.theme.combat,mr:.5},fontSize:"small"})))},x=t=>{const e=t.faction.getInfo();return b.a.createElement(u.a,{sx:{display:"grid",p:1,alignItems:"center",gridTemplateColumns:"minmax(0, 4fr)"+(t.joined?" 1fr":"")}},b.a.createElement(m.a,{display:"flex",sx:{alignItems:"center"}},t.joined?b.a.createElement(m.a,{display:"grid",sx:{mr:1,gridTemplateColumns:"1fr 1fr",minWidth:"fit-content",gap:.5,"& .MuiButton-root":{height:"48px"}}},b.a.createElement(h.a,{onClick:()=>{return e=t.faction,void t.router.toFaction(e);var e}},"Details"),b.a.createElement(h.a,{onClick:()=>{return e=t.faction,void t.router.toFaction(e,!0);var e}},"Augments")):b.a.createElement(h.a,{sx:{height:"48px",mr:1},onClick:e=>{return n=e,a=t.faction.name,void(n.isTrusted&&(Object(w.d)(S.a[a]),t.rerender()));var n,a}},"Join!"),b.a.createElement("span",{style:{maxWidth:t.joined?"70%":"95%"}},b.a.createElement(d.a,{variant:"h6",sx:{mr:1,display:"grid",gridTemplateColumns:"fit-content(100vw) max-content",alignItems:"center"}},b.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},title:t.faction.name},t.faction.name),b.a.createElement("span",{style:{display:"flex",alignItems:"center"}},t.player.hasGangWith(t.faction.name)&&b.a.createElement(f.a,{title:"You have a gang with this Faction"},b.a.createElement(o.a,{sx:{color:E.a.theme.hp,ml:1}})),e.special&&b.a.createElement(f.a,{title:"This is a special Faction"},b.a.createElement(s.a,{sx:{ml:1,color:E.a.theme.money,transform:"rotate(180deg)"}})),!t.joined&&e.enemies.length>0&&b.a.createElement(f.a,{title:b.a.createElement(d.a,null,"This Faction is enemies with:",b.a.createElement("ul",null,e.enemies.map(t=>b.a.createElement("li",{key:t},t))),"Joining this Faction will prevent you from joining its enemies")},b.a.createElement(l.a,{sx:{ml:1,color:E.a.theme.error}})))),b.a.createElement("span",{style:{display:"flex",alignItems:"center"}},!t.player.hasGangWith(t.faction.name)&&b.a.createElement(C,{faction:t.faction}),t.joined&&b.a.createElement(d.a,{variant:"body2",sx:{display:"flex"}},(n=t.faction,a=t.player,Object(w.a)(a,n).filter(t=>!a.hasAugmentation(t)).length)," Augmentations left")))),t.joined&&b.a.createElement(m.a,{display:"grid",sx:{alignItems:"center",justifyItems:"left",gridAutoFlow:"row"}},b.a.createElement(d.a,{sx:{color:E.a.theme.rep}},v.a.formatFavor(Math.floor(t.faction.favor))," favor"),b.a.createElement(d.a,{sx:{color:E.a.theme.rep}},v.a.formatReputation(t.faction.playerReputation)," rep")));var n,a};function L(t){const e=Object(p.a)(),n=Object(y.useState)(!1)[1];function a(){n(t=>!t)}Object(y.useEffect)(()=>{const t=setInterval(a,200);return()=>clearInterval(t)},[]),Object(y.useEffect)(()=>{t.player.factionInvitations.forEach(t=>{_.includes(t)||_.push(t)})},[]);const r=Object.values(k.a).map(t=>t),i=[...t.player.factions];i.sort((t,e)=>r.indexOf(t)-r.indexOf(e));const o=t.player.factionInvitations;return b.a.createElement(g.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0,mb:10}},b.a.createElement(d.a,{variant:"h4"},"Factions",b.a.createElement(f.a,{title:b.a.createElement(d.a,null,"Throughout the game you may receive invitations from factions. There are many different factions, and each faction has different criteria for determining its potential members. Joining a faction and furthering its cause is crucial to progressing in the game and unlocking endgame content.")},b.a.createElement(c.a,{sx:{ml:1,mb:0},color:"info"}))),b.a.createElement(m.a,{display:"grid",sx:{gap:1,gridTemplateColumns:(o.length>0?"1fr ":"")+"2fr",[e.breakpoints.down("lg")]:{gridTemplateColumns:"1fr","& > span:nth-of-type(1)":{order:1}},gridTemplateRows:"minmax(0, 1fr)","& > span > .MuiBox-root":{display:"grid",gridAutoRows:"70px",gap:1}}},o.length>0&&b.a.createElement("span",null,b.a.createElement(d.a,{variant:"h5",color:"primary"},"Faction Invitations"),b.a.createElement(m.a,null,o.map(e=>S.a.hasOwnProperty(e)?b.a.createElement(x,{key:e,faction:S.a[e],player:t.player,router:t.router,joined:!1,rerender:a}):null))),b.a.createElement("span",null,b.a.createElement(d.a,{variant:"h5",color:"primary"},"Your Factions"),b.a.createElement(m.a,null,i.length>0?i.map(e=>S.a.hasOwnProperty(e)?b.a.createElement(x,{key:e,faction:S.a[e],player:t.player,router:t.router,joined:!0,rerender:a}):null):b.a.createElement(d.a,null,"You have not yet joined any Factions.")))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1),o=n(481),s=n(640),l=n(387),c=n(16);function f(t,e,n,a){e?0===i.a.sourceFileLvl(5)&&5!==a&&(i.a.skills.intelligence=0,i.a.exp.intelligence=0):function(t){const e="SourceFile"+t.toString(),n=l.a[e];if(null==n)return void console.error("Could not find source file for Bit node: "+t);let a=!1,o=null;for(let e=0;e=3&&12!==o.n?Object(c.a)(`The Source-File for the BitNode you just destroyed, ${n.name}, is already at max level!`):(++o.lvl,Object(c.a)(n.name+" was upgraded to level "+o.lvl+" for destroying its corresponding BitNode!"));else{const e=new s.a(t,1);i.a.sourceFiles.push(e),5===t&&0===i.a.skills.intelligence&&(i.a.skills.intelligence=1),Object(c.a)(r.a.createElement(r.a.Fragment,null,"You received a Source-File for destroying a BitNode!",r.a.createElement("br",null),r.a.createElement("br",null),n.name,r.a.createElement("br",null),r.a.createElement("br",null),n.info))}}(n),5===a&&0===i.a.skills.intelligence&&(i.a.skills.intelligence=1),i.a.bitNodeN=a,6===a?t.toBladeburnerCinematic():t.toTerminal(),Object(o.b)(e)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return S})),n.d(e,"a",(function(){return _})),n.d(e,"c",(function(){return C}));var a=n(0),r=n.n(a),i=n(20),o=n(3),s=n(150),l=n(371),c=n(21),f=n(9),u=n(46),m=n(88),h=n(6),d=n(353),p=n(106),g=n(560),y=n(662),b=n(664),E=n(679),v=n.n(E),k=n(1428),w=n.n(k);let S=!1;function _(){S=!0}function C({router:t,softReset:e,errorData:n,resetError:E}){var k,_;return h.a.AutosaveInterval=0,Object(a.useEffect)(()=>{Object(d.b)().then(t=>{const e=`RECOVERY_BITBURNER_${Math.round(Date.now()/1e3)}.json`;Object(p.a)(e,t)}).catch(t=>console.error(t))},[]),r.a.createElement(i.a,{sx:{padding:"8px 16px",minHeight:"100vh",maxWidth:"1200px",boxSizing:"border-box"}},r.a.createElement(o.a,{variant:"h3"},"RECOVERY MODE ACTIVATED"),r.a.createElement(o.a,null,"There was an error with your save file and the game went into recovery mode. In this mode saving is disabled and the game will automatically export your save file (to prevent corruption)."),r.a.createElement(o.a,null,"At this point it is recommended to alert a developer."),r.a.createElement(o.a,null,r.a.createElement(s.a,{href:null!==(k=null==n?void 0:n.issueUrl)&&void 0!==k?k:g.b,target:"_blank"},"File an issue on github")),r.a.createElement(o.a,null,r.a.createElement(s.a,{href:"https://www.reddit.com/r/Bitburner/",target:"_blank"},"Make a reddit post")),r.a.createElement(o.a,null,r.a.createElement(s.a,{href:"https://discord.gg/TFc3hKD",target:"_blank"},"Post in the #bug-report channel on Discord.")),r.a.createElement(o.a,null,"Please include your save file."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"You can disable recovery mode now. But chances are the game will not work correctly."),r.a.createElement(l.a,{sx:{my:2}},r.a.createElement(c.a,{title:"Disables the recovery mode & attempt to head back to the terminal page. This may or may not work. Ensure you have saved the recovery file."},r.a.createElement(f.a,{onClick:function(){E&&E(),S=!1,t.toTerminal()},startIcon:r.a.createElement(v.a,null)},"Disable Recovery Mode")),r.a.createElement(b.a,{color:"warning",onTriggered:e}),r.a.createElement(y.a,{color:"error"})),n&&r.a.createElement(u.a,{sx:{px:2,pt:1,pb:2,mt:2}},r.a.createElement(o.a,{variant:"h5"},n.title),r.a.createElement(i.a,{sx:{my:2}},r.a.createElement(m.a,{label:"Bug Report Text",value:n.body,variant:"outlined",color:"secondary",multiline:!0,fullWidth:!0,rows:12,sx:{"& .MuiOutlinedInput-root":{color:h.a.theme.secondary}}})),r.a.createElement(c.a,{title:"Submitting an issue to GitHub really help us improve the game!"},r.a.createElement(f.a,{component:s.a,startIcon:r.a.createElement(w.a,null),color:"info",sx:{px:2},href:null!==(_=n.issueUrl)&&void 0!==_?_:g.b,target:"_blank"},"Submit Issue to GitHub"))))}},,,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.SyntaxError=-1]="SyntaxError",t[t.ImportError=-2]="ImportError"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(1054);let r=1;function i(t){return r+=t,()=>r-=t}function o(){return Object(a.a)(r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(1060),r=n(233),i=n(24);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class s{constructor(t,e,n){o(this,"code",""),o(this,"delay",null),o(this,"disableLogs",{}),o(this,"dynamicLoadedFns",{}),o(this,"dynamicRamUsage",r.a.ScriptBaseRamCost),o(this,"errorMessage",""),o(this,"loadedFns",{}),o(this,"output",""),o(this,"ramUsage",0),this.name=t.filename,this.hostname=t.server;const s=Math.round(e);if("number"!=typeof s||isNaN(s))throw new Error("Invalid PID when constructing WorkerScript: "+e);this.pid=s,t.pid=s;const l=Object(i.d)(this.hostname);if(null==l)throw new Error("WorkerScript constructed with invalid server ip: "+this.hostname);let c=!1;for(let t=0;tt.name===e);return!!n&&(this.startWork(t,new C.a(n.type)),!0)}getMemoryUpgradeCost(t){const e=Math.round(t);if(e<0)return 0;if(this.memory+e>100)return this.getMemoryUpgradeCost(100-this.memory);let n=0,a=this.memory-1;for(let e=0;et.name===e.name)&&(t.loseMoney(e.baseCost,"sleeves"),this.installAugmentation(e),!0))}upgradeMemory(t){t<0?console.warn("Sleeve.upgradeMemory() called with negative value: "+t):this.memory=Math.min(100,Math.round(this.memory+t))}workForCompany(t,e){if(!(i.a[e]instanceof o.a)||null==t.jobs[e])return!1;const n=i.a[e],a=s.a[t.jobs[e]];return null!=n&&(null!=a&&(this.startWork(t,new k.a({companyName:e})),!0))}workForFaction(t,e,n){const a=f.a[e];if(!(""!==e&&a&&a instanceof c.a&&t.factions.includes(e)))return!1;const r=a.getInfo(),i=n.toLowerCase();let o;if(i.includes("hack")){if(!r.offerHackingWork)return!1;o=p.a.HACKING}else if(i.includes("field")){if(!r.offerFieldWork)return!1;o=p.a.FIELD}else{if(!i.includes("security"))return!1;if(!r.offerSecurityWork)return!1;o=p.a.SECURITY}return this.startWork(t,new v.a({factionWorkType:o,factionName:a.name})),!0}workoutAtGym(t,e,n){let a;switch(e.toLowerCase()){case m.a.AevumCrushFitnessGym.toLowerCase():if(this.city!=u.a.Aevum)return!1;a=m.a.AevumCrushFitnessGym;break;case m.a.AevumSnapFitnessGym.toLowerCase():if(this.city!=u.a.Aevum)return!1;a=m.a.AevumSnapFitnessGym;break;case m.a.Sector12IronGym.toLowerCase():if(this.city!=u.a.Sector12)return!1;a=m.a.Sector12IronGym;break;case m.a.Sector12PowerhouseGym.toLowerCase():if(this.city!=u.a.Sector12)return!1;a=m.a.Sector12PowerhouseGym;break;case m.a.VolhavenMilleniumFitnessGym.toLowerCase():if(this.city!=u.a.Volhaven)return!1;a=m.a.VolhavenMilleniumFitnessGym}if(!a)return!1;const r=n.toLowerCase();let i;return r.includes("str")&&(i=y.a.GymStrength),r.includes("def")&&(i=y.a.GymDefense),r.includes("dex")&&(i=y.a.GymDexterity),r.includes("agi")&&(i=y.a.GymAgility),!!i&&(this.startWork(t,new g.a({classType:i,location:a})),!0)}bladeburner(t,e,n){switch(e){case"Field analysis":return this.startWork(t,new _.a({type:"General",name:"Field Analysis"})),!0;case"Recruitment":return this.startWork(t,new _.a({type:"General",name:"Recruitment"})),!0;case"Diplomacy":return this.startWork(t,new _.a({type:"General",name:"Diplomacy"})),!0;case"Infiltrate synthoids":return this.startWork(t,new w.a),!0;case"Support main sleeve":return this.startWork(t,new S.a(t)),!0;case"Take on contracts":return this.startWork(t,new _.a({type:"Contracts",name:n})),!0}return!0}recruitmentSuccessChance(t){var e,n;return Math.max(0,Math.min(1,null!==(e=null===(n=t.bladeburner)||void 0===n?void 0:n.getRecruitmentSuccessChance(this))&&void 0!==e?e:0))}contractSuccessChance(t,e,n){const a=t.bladeburner;if(null===a){const t="bladeburner is null";return console.error(`Function: sleeves.contractSuccessChance; Message: '${t}'`),"0%"}const r=a.getActionEstimatedSuccessChanceNetscriptFn(this,e,n);return"string"==typeof r?(console.error(`Function: sleeves.contractSuccessChance; Message: '${r}'`),"0%"):r[0]>=1?"100%":`${d.a.formatPercentage(r[0])} - ${d.a.formatPercentage(r[1])}`}takeDamage(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp.current-=t,this.hp.current<=0&&(this.shock=Math.max(0,this.shock-.5),this.hp.current=this.hp.max,!0))}whoAmI(){return"Sleeve"}toJSON(){return Object(h.b)("Sleeve",this)}static fromJSON(t){return Object(h.a)(L,t.data)}}h.c.constructors.Sleeve=L},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(1451),r=n(279),i=n(399),o=n(248),s=n(35),l=n(22),c=n(499),f=n(66),u=n(16),m=n(15),h=n(163);function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class p{constructor(t={}){d(this,"name","The Corporation"),d(this,"divisions",[]),d(this,"funds",15e10),d(this,"revenue",0),d(this,"expenses",0),d(this,"fundingRound",0),d(this,"public",!1),d(this,"totalShares",s.a.INITIALSHARES),d(this,"numShares",s.a.INITIALSHARES),d(this,"shareSalesUntilPriceUpdate",s.a.SHARESPERPRICEUPDATE),d(this,"shareSaleCooldown",0),d(this,"issueNewSharesCooldown",0),d(this,"dividendRate",0),d(this,"dividendTax",1-l.a.CorporationSoftcap+.15),d(this,"issuedShares",0),d(this,"sharePrice",0),d(this,"storedCycles",0),d(this,"avgProfit",0),d(this,"state",new a.a),this.name=t.name?t.name:"The Corporation";const e=Object.keys(r.b).length,n=Object.keys(i.a).length;this.unlockUpgrades=Array(e).fill(0),this.upgrades=Array(n).fill(0),this.upgradeMultipliers=Array(n).fill(1)}addFunds(t){isFinite(t)?this.funds=this.funds+t:console.error("Trying to add invalid amount of funds. Report to a developper.")}getState(){return this.state.getState()}storeCycles(t=1){this.storedCycles+=t}process(t){if(this.storedCycles>=s.a.CyclesPerIndustryStateCycle){const e=this.getState(),n=1,a=n*s.a.CyclesPerIndustryStateCycle;if(this.storedCycles-=a,this.divisions.forEach(t=>{t.process(n,e,this)}),this.shareSaleCooldown>0&&(this.shareSaleCooldown-=a),this.issueNewSharesCooldown>0&&(this.issueNewSharesCooldown-=a),"START"===e){this.revenue=0,this.expenses=0,this.divisions.forEach(t=>{t.lastCycleRevenue!==-1/0&&t.lastCycleRevenue!==1/0&&t.lastCycleExpenses!==-1/0&&t.lastCycleExpenses!==1/0&&(this.revenue=this.revenue+t.lastCycleRevenue,this.expenses=this.expenses+t.lastCycleExpenses)});const e=this.revenue-this.expenses;this.avgProfit=(this.avgProfit*(s.a.AvgProfitLength-1)+e)/s.a.AvgProfitLength;const a=e*(n*s.a.SecsPerMarketCycle);if((isNaN(this.funds)||this.funds===1/0||this.funds===-1/0)&&(Object(u.a)("There was an error calculating your Corporations funds and they got reset to 0. This is a bug. Please report to game developer.

(Your funds have been set to $150b for the inconvenience)"),this.funds=15e10),this.updateDividendTax(),this.dividendRate>0&&a>0)if(isNaN(this.dividendRate)||this.dividendRate<0||this.dividendRate>s.a.DividendMaxRate)console.error("Invalid Corporation dividend rate: "+this.dividendRate);else{const e=a-this.dividendRate*a;t.gainMoney(this.getCycleDividends(),"corporation"),this.addFunds(e)}else this.addFunds(a);this.updateSharePrice()}this.state.nextState()}}updateDividendTax(){this.dividendTax=1-l.a.CorporationSoftcap+.15,1===this.unlockUpgrades[5]&&(this.dividendTax-=.05),1===this.unlockUpgrades[6]&&(this.dividendTax-=.1)}getCycleDividends(){const t=(this.revenue-this.expenses)*s.a.SecsPerMarketCycle,e=this.dividendRate*t/this.totalShares,n=this.numShares*e;return Math.pow(n,1-this.dividendTax)}determineValuation(){let t,e=this.avgProfit;return this.public?(this.dividendRate>0&&(e*=1-this.dividendRate),t=this.funds+85e3*e,t*=Math.pow(1.1,this.divisions.length),t=Math.max(t,0)):(t=1e10+Math.max(this.funds,0)/3,e>0?(t+=315e3*e,t*=Math.pow(1.1,this.divisions.length)):t=1e10*Math.pow(1.1,this.divisions.length),t-=t%1e6),t*l.a.CorporationValuation}getTargetSharePrice(){return this.determineValuation()/(2*(this.totalShares-this.numShares)+1)}updateSharePrice(){const t=this.getTargetSharePrice();this.sharePrice<=t?this.sharePrice*=1+.01*Math.random():this.sharePrice*=1-.01*Math.random(),this.sharePrice<=.01&&(this.sharePrice=.01)}immediatelyUpdateSharePrice(){this.sharePrice=this.getTargetSharePrice()}calculateShareSale(t){let e=t,n=this.shareSalesUntilPriceUpdate,a=this.sharePrice,r=0,i=0;const o=Math.ceil(t/s.a.SHARESPERPRICEUPDATE);if(isNaN(o)||o>1e7)return console.error("Something went wrong or unexpected when calculating share sale. Maxiterations calculated to be "+o),[0,0,0];for(let t=0;t3600?Math.floor(e/3600)+" hour(s)":e>60?Math.floor(e/60)+" minute(s)":Math.floor(e)+" second(s)"}unlock(t){const e=t.index,n=t.price;for(;this.unlockUpgrades.length<=e;)this.unlockUpgrades.push(0);this.fundsthis.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst-=t,this.popEstthis.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst*=1-t/100,this.popEst0?1:-1),this.pop+=n,e.changeEstEqually&&(this.popEst+=n,this.popEst<0&&(this.popEst=0)),n}changeChaosByCount(t){if(isNaN(t))throw new Error("NaN passed into City.changeChaosByCount()");0!==t&&(this.chaos+=t,this.chaos<0&&(this.chaos=0))}toJSON(){return Object(i.b)("City",this)}static fromJSON(t){return Object(i.a)(l,t.data)}}i.c.constructors.City=l},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e=[],n=""){this.name=t,this.locations=e,this.asciiArt=n}addLocation(t){this.locations.push(t)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(20),r=n(21),i=n(3),o=n(1867),s=n(0),l=n.n(s);const c=t=>{const[e,n]=Object(s.useState)(t.initialValue);return l.a.createElement(a.a,null,l.a.createElement(r.a,{title:l.a.createElement(i.a,null,t.tooltip)},l.a.createElement(i.a,null,t.label)),l.a.createElement(o.a,{value:e,onChange:(t,e)=>{"number"==typeof e&&n(e)},onChangeCommitted:t.callback,step:t.step,min:t.min,max:t.max,valueLabelDisplay:"auto",sx:{"& .MuiSlider-thumb":{height:"12px",width:"12px"}},marks:t.marks}))}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return f}));var a=n(0),r=n(3),i=n(21),o=n(9),s=n(88);let l;function c(t){let e="",n="";return t.tickerDisplayMode===l.Portfolio?(e="Switch to 'All Stocks' Mode",n="Displays all stocks on the WSE"):(e="Switch to 'Portfolio' Mode",n="Displays only the stocks for which you have shares or orders"),a.createElement(i.a,{title:a.createElement(r.a,null,n)},a.createElement(o.a,{onClick:t.changeDisplayMode},e))}function f(t){return a.createElement(a.Fragment,null,a.createElement(c,t),a.createElement("br",null),a.createElement(s.a,{sx:{width:"100%"},onChange:t.changeWatchlistFilter,placeholder:"Filter Stocks by symbol (comma-separated list)",type:"text"}))}!function(t){t[t.AllStocks=0]="AllStocks",t[t.Portfolio=1]="Portfolio"}(l||(l={}))},function(t,e,n){"use strict";n.d(e,"f",(function(){return c})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"a",(function(){return d}));var a=n(13),r=n(22),i=n(45),o=n(94),s=n(24),l=n(89);function c(){return this.getHomeComputer().serversOnNetwork.includes(l.a.DarkWeb)}function f(){const t=Object(s.d)(this.currentServer);if(null===t)throw new Error("somehow connected to a server that does not exist. "+this.currentServer);return t}function u(){const t=Object(s.d)("home");if(t instanceof i.a)return t;throw new Error("home computer was not a normal server")}function m(){const t=this.getHomeComputer().maxRam,e=Math.log2(t),n=Math.pow(1.58,e);return t*a.a.BaseCostFor1GBOfRamHome*n*r.a.HomeComputerRamCost}function h(){return 1e9*Math.pow(7.5,this.getHomeComputer().cpuCores)}function d(){const t="hacknet-node-"+this.hacknetNodes.length,e=new o.a({adminRights:!0,hostname:t,ip:Object(s.e)()});this.hacknetNodes.push(e.hostname),Object(s.a)(e);return this.getHomeComputer().serversOnNetwork.push(e.hostname),e.serversOnNetwork.push(l.a.Home),e}},,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return P})),n.d(e,"b",(function(){return I}));var a=n(5),r=n(17),i=n(74),o=n(114),s=n(12),l=n(152),c=n(215),f=n(78),u=n(51),m=n(63),h=n(201),d=n(29),p=n(105),g=n(56),y=n(190),b=n(1),E=n(91),v=n(352),k=n(549),w=n(66),S=n(24),_=n(140),C=n(89),x=n(98),L=n(83),O=n(16),M=n(104),A=n(433),T=n(434),R=n(13),N=n(166);function P(){Object(l.d)(b.a);const t=b.a.factions.concat(b.a.factionInvitations).filter((function(t){return d.a[t].getInfo().keep}));b.a.prestigeAugmentation(),Object(y.c)();const e=b.a.getHomeComputer();Object(S.i)(),Object(S.a)(e),Object(_.e)(b.a,e),Object(o.b)(s.a.Neurolink)&&b.a.hasAugmentation(s.a.Neurolink)&&(e.programs.push(m.a.FTPCrackProgram.name),e.programs.push(m.a.RelaySMTPProgram.name)),Object(o.b)(s.a.CashRoot)&&b.a.hasAugmentation(s.a.CashRoot)&&(b.a.setMoney(1e6),e.programs.push(m.a.BruteSSHProgram.name)),Object(o.b)(s.a.PCMatrix)&&b.a.hasAugmentation(s.a.PCMatrix)&&(e.programs.push(m.a.DeepscanV1.name),e.programs.push(m.a.AutoLink.name)),(b.a.sourceFileLvl(5)>0||5===b.a.bitNodeN)&&e.programs.push(m.a.Formulas.name),Object(S.f)(b.a.getHomeComputer());for(const t of Object.keys(f.a))f.a.hasOwnProperty(t)&&f.a[t].gainFavor();for(const t of Object.keys(d.a))d.a.hasOwnProperty(t)&&d.a[t].gainFavor();null!==L.a.action&&L.a.finishAction(E.b,b.a,!0),L.a.clear(),N.a.emit(),Object(d.c)(),b.a.factionInvitations=b.a.factionInvitations.concat(t),Object(o.e)(),b.a.reapplyAllSourceFiles(),Object(f.b)(),b.a.applyEntropy(b.a.entropy);const n=b.a.gang;if(b.a.inGang()&&null!==n){const t=d.a[n.facName];t instanceof h.a&&Object(p.d)(t);const e=.95;for(const t of n.members)t.hack_asc_points*=e,t.str_asc_points*=e,t.def_asc_points*=e,t.dex_asc_points*=e,t.agi_asc_points*=e,t.cha_asc_points*=e}if(3===b.a.bitNodeN&&e.messages.push(w.a.CorporationManagementHandbook),b.a.bladeburner instanceof c.a&&b.a.bladeburner.prestige(),8===b.a.bitNodeN&&(b.a.money=25e7),(8===b.a.bitNodeN||b.a.sourceFileLvl(8)>0)&&(b.a.hasWseAccount=!0,b.a.hasTixApiAccess=!0),b.a.hasWseAccount&&(Object(x.e)(),Object(x.g)()),Object(o.b)(s.a.TheRedPill)&&b.a.hasAugmentation(s.a.TheRedPill)){const t=Object(S.d)(C.a.WorldDaemon),e=Object(S.d)(C.a.DaedalusServer);t&&e&&(t.serversOnNetwork.push(e.hostname),e.serversOnNetwork.push(t.hostname))}Object(o.b)(s.a.StaneksGift1)&&b.a.hasAugmentation(s.a.StaneksGift1)&&Object(p.d)(d.a[a.a.ChurchOfTheMachineGod]),M.c.prestigeAugmentation(),Object(k.b)(),A.b.splice(0,A.b.length),T.b.splice(0,T.b.length)}function I(t){Object(l.d)(b.a),b.a.prestigeSourceFile(),Object(y.c)();const e=b.a.getHomeComputer();null!==L.a.action&&L.a.finishAction(E.b,b.a,!0),L.a.clear(),N.a.emit(),Object(S.i)(),Object(S.a)(e),Object(_.e)(b.a,e),Object(S.f)(b.a.getHomeComputer()),b.a.sourceFileLvl(9)>=2?e.setMaxRam(128):b.a.sourceFileLvl(1)>0?e.setMaxRam(32):e.setMaxRam(8),e.cpuCores=1;for(const t of Object.keys(f.a))f.a.hasOwnProperty(t)&&(f.a[t].favor=0);for(const t of Object.keys(d.a))d.a.hasOwnProperty(t)&&(d.a[t].favor=0);null!==L.a.action&&L.a.finishAction(E.b,b.a,!0);for(const t of Object.keys(i.a))i.a.hasOwnProperty(t)&&delete i.a[t];if(b.a.sourceFileLvl(12)>0&&b.a.augmentations.push({name:s.a.NeuroFluxGovernor,level:b.a.sourceFileLvl(12)}),Object(d.c)(),Object(o.e)(),b.a.reapplyAllSourceFiles(),Object(f.b)(),(b.a.sourceFileLvl(5)>0||5===b.a.bitNodeN)&&e.programs.push(m.a.Formulas.name),3===b.a.bitNodeN&&(e.messages.push(w.a.CorporationManagementHandbook),Object(O.a)("You received a copy of the Corporation Management Handbook on your home computer. Read it if you need help getting started with Corporations!")),8===b.a.bitNodeN&&(b.a.money=25e7),(8===b.a.bitNodeN||b.a.sourceFileLvl(8)>0)&&(b.a.hasWseAccount=!0,b.a.hasTixApiAccess=!0),10===b.a.bitNodeN&&Object(O.a)("Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!"),13===b.a.bitNodeN&&Object(O.a)("Trouble is brewing in "+r.a.Chongqing),b.a.hasWseAccount?(Object(x.e)(),Object(x.g)()):Object(x.d)(),b.a.gang=null,b.a.corporation=null,Object(u.e)(),b.a.bladeburner=null,b.a.sourceFileLvl(9)>=3){const t=b.a.createHacknetServer();t.level=100,t.cores=10,t.cache=5,t.updateHashRate(b.a.mults.hacknet_node_money),t.updateHashCapacity(),Object(g.p)(b.a)}13===b.a.bitNodeN&&(b.a.money=R.a.TravelCost),M.c.prestigeSourceFile(),0===b.a.sourceFileLvl(5)||t||b.a.gainIntelligenceExp(300),v.b.splice(0,v.b.length),Object(k.b)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(1),r=n(34),i=n(315),o=n(15),s=n(62);function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class c{constructor(t=null){l(this,"name",""),l(this,"level",1),l(this,"maxLevel",1),l(this,"autoLevel",!0),l(this,"baseDifficulty",100),l(this,"difficultyFac",1.01),l(this,"rewardFac",1.02),l(this,"successes",0),l(this,"failures",0),l(this,"rankGain",0),l(this,"rankLoss",0),l(this,"hpLoss",0),l(this,"hpLost",0),l(this,"isStealth",!1),l(this,"isKill",!1),l(this,"count",Object(r.a)(1e3,25e3)),l(this,"weights",{hack:1/7,str:1/7,def:1/7,dex:1/7,agi:1/7,cha:1/7,int:1/7}),l(this,"decays",{hack:.9,str:.9,def:.9,dex:.9,agi:.9,cha:.9,int:.9}),l(this,"teamCount",0),t&&t.name&&(this.name=t.name),t&&t.baseDifficulty&&(this.baseDifficulty=Object(i.a)(t.baseDifficulty,10)),t&&t.difficultyFac&&(this.difficultyFac=t.difficultyFac),t&&t.rewardFac&&(this.rewardFac=t.rewardFac),t&&t.rankGain&&(this.rankGain=t.rankGain),t&&t.rankLoss&&(this.rankLoss=t.rankLoss),t&&t.hpLoss&&(this.hpLoss=t.hpLoss),t&&t.isStealth&&(this.isStealth=t.isStealth),t&&t.isKill&&(this.isKill=t.isKill),t&&t.count&&(this.count=t.count),t&&t.weights&&(this.weights=t.weights),t&&t.decays&&(this.decays=t.decays);let e=0;for(const t of Object.keys(this.weights))this.weights.hasOwnProperty(t)&&(e+=this.weights[t]);if(e-1>=10*Number.EPSILON)throw new Error("Invalid weights when constructing Action "+this.name+". The weights should sum up to 1. They sum up to :1");for(const t of Object.keys(this.decays))if(this.decays.hasOwnProperty(t)&&this.decays[t]>1)throw new Error(`Invalid decays when constructing Action ${this.name}. Decay value cannot be greater than 1`)}getDifficulty(){const t=this.baseDifficulty*Math.pow(this.difficultyFac,this.level-1);if(isNaN(t))throw new Error("Calculated NaN in Action.getDifficulty()");return t}attempt(t,e){return Math.random()s.a.ChaosThreshold){const t=e.chaos-s.a.ChaosThreshold+1;return Math.pow(t,.5)}return 1}getEstSuccessChance(t,e){function n(t){return Math.max(0,Math.min(t,1))}const a=this.getSuccessChance(t,e,{est:!0}),r=this.getSuccessChance(t,e),i=Math.abs(r-a);let o=r-i,s=r+i;const l=t.getCurrentCity(),c=l.pop/l.popEst;return c<1?o*=c:s*=c,[n(o),n(s)]}getSuccessChance(t,e,n={est:!1}){if(null==t)throw new Error("Invalid Bladeburner instance passed into Action.getSuccessChance");let r=this.getDifficulty(),i=0;for(const n of Object.keys(this.weights))if(this.weights.hasOwnProperty(n)){const a=e.queryStatFromString(n),r="eff"+n.charAt(0).toUpperCase()+n.slice(1);let o=t.skillMultipliers[r];null==o&&(console.error("Failed to find Bladeburner Skill multiplier for: "+n),o=1),i+=this.weights[n]*Math.pow(o*a,this.decays[n])}if(i*=a.a.getIntelligenceBonus(.75),i*=t.calculateStaminaPenalty(),i*=this.getTeamSuccessBonus(t),i*=this.getChaosCompetencePenalty(t,n),r*=this.getChaosDifficultyBonus(t),"Raid"==this.name&&t.getCurrentCity().comms<=0)return 0;if(i*=t.skillMultipliers.successChanceAll,i*=this.getActionTypeSkillSuccessBonus(t),this.isStealth&&(i*=t.skillMultipliers.successChanceStealth),this.isKill&&(i*=t.skillMultipliers.successChanceKill),i*=a.a.mults.bladeburner_success_chance,isNaN(i))throw new Error("Competence calculated as NaN in Action.getSuccessChance()");return Math.min(1,i/r)}getSuccessesNeededForNextLevel(t){return Math.ceil(.5*this.maxLevel*(2*t+(this.maxLevel-1)))}setMaxLevel(t){this.successes>=this.getSuccessesNeededForNextLevel(t)&&++this.maxLevel}toJSON(){return Object(o.b)("Action",this)}static fromJSON(t){return Object(o.a)(c,t.data)}}o.c.constructors.Action=c},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n,a,r){this.name=t,this.desc=e,this.isHacking=n,this.isCombat=a,this.baseRespect=r.baseRespect?r.baseRespect:0,this.baseWanted=r.baseWanted?r.baseWanted:0,this.baseMoney=r.baseMoney?r.baseMoney:0,this.hackWeight=r.hackWeight?r.hackWeight:0,this.strWeight=r.strWeight?r.strWeight:0,this.defWeight=r.defWeight?r.defWeight:0,this.dexWeight=r.dexWeight?r.dexWeight:0,this.agiWeight=r.agiWeight?r.agiWeight:0,this.chaWeight=r.chaWeight?r.chaWeight:0,100!=Math.round(this.hackWeight+this.strWeight+this.defWeight+this.dexWeight+this.agiWeight+this.chaWeight)&&console.error(`GangMemberTask ${this.name} weights do not add up to 100`),this.difficulty=r.difficulty?r.difficulty:1,this.territory=r.territory?r.territory:{money:1,respect:1,wanted:1}}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p}));var a,r=n(15),i=n(13),o=n(397),s=n(85),l=n(16),c=n(137),f=n(153),u=n(90),m=n(625);!function(t){t.SHOPLIFT="SHOPLIFT",t.ROBSTORE="ROBSTORE",t.MUG="MUG",t.LARCENY="LARCENY",t.DRUGS="DRUGS",t.BONDFORGERY="BONDFORGERY",t.TRAFFICKARMS="TRAFFICKARMS",t.HOMICIDE="HOMICIDE",t.GRANDTHEFTAUTO="GRANDTHEFTAUTO",t.KIDNAP="KIDNAP",t.ASSASSINATION="ASSASSINATION",t.HEIST="HEIST"}(a||(a={}));const h=t=>{switch(t){case c.a.SHOPLIFT:return a.SHOPLIFT;case c.a.ROB_STORE:return a.ROBSTORE;case c.a.MUG:return a.MUG;case c.a.LARCENY:return a.LARCENY;case c.a.DRUGS:return a.DRUGS;case c.a.BOND_FORGERY:return a.BONDFORGERY;case c.a.TRAFFIC_ARMS:return a.TRAFFICKARMS;case c.a.HOMICIDE:return a.HOMICIDE;case c.a.GRAND_THEFT_AUTO:return a.GRANDTHEFTAUTO;case c.a.KIDNAP:return a.KIDNAP;case c.a.ASSASSINATION:return a.ASSASSINATION;case c.a.HEIST:return a.HEIST}return a.SHOPLIFT},d=t=>null!==t&&t.type===f.b.CRIME;class p extends f.a{constructor(t){var e,n;super(f.b.CRIME,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.crimeType=null!==(n=null==t?void 0:t.crimeType)&&void 0!==n?n:c.a.SHOPLIFT,this.unitCompleted=0}getCrime(){const t=Object.values(s.a).find(t=>t.type===this.crimeType);if(!t)throw new Error("CrimeWork object constructed with invalid crime type");return t}process(t,e=1){var n,a;this.cyclesWorked+=e;const r=null!==(n=null===(a=Object.values(s.a).find(t=>t.type===this.crimeType))||void 0===a?void 0:a.time)&&void 0!==n?n:0;for(this.unitCompleted+=i.a._idleSpeed*e;this.unitCompleted>=r;)this.commit(t),this.unitCompleted-=r;return!1}earnings(){return Object(m.a)(this.getCrime())}commit(t){const e=this.getCrime();if(null==e)return void Object(l.a)(`ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`);const n=t.focusPenalty();let a=Object(u.d)(this.earnings(),n,!1),r=e.karma;Object(o.a)(t,e.type)?(t.gainMoney(a.money*t.mults.crime_money,"crime"),t.numPeopleKilled+=e.kills,t.gainIntelligenceExp(a.intExp)):(a=Object(u.d)(a,.25),r/=4),t.gainHackingExp(a.hackExp),t.gainStrengthExp(a.strExp),t.gainDefenseExp(a.defExp),t.gainDexterityExp(a.dexExp),t.gainAgilityExp(a.agiExp),t.gainCharismaExp(a.chaExp),t.karma-=r*n}finish(){}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,crimeType:h(this.crimeType)}}toJSON(){return Object(r.b)("CrimeWork",this)}static fromJSON(t){return Object(r.a)(p,t.data)}}r.c.constructors.CrimeWork=p},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(127),o=n(39);const s=["ttftfffttttttttttfffffffttftt1ttttttt111tttt1111111tttt1tt111tttt111111tttt1ttttttttttttttt111111111\nttfttttttttttttttttfLLLftfffffffffftttt111tt11111ttffffftttt1111111111111111ttttttfttttttttt111111t1\nttttttttttttttttffffLfftffffffffLLffttttttftt111ttfffffftttttttt111111ttttttffffttfffttttttt111111tt\nttttttttttttttttfffLfttffffffLLffffttttttttttt1tfffffffffftttttt111111tffffffffftttfffftttt11111ttt1\nttttttttttttffLfttfffttfffffffffttfftttttt1t1tt11tfffffftttttt111t111111ttffffLLffttfffftt111111tttt\nttttttttttffLLLLfttttffLLLfttttftfLftttttttffffttttffffttttfftt11t111tt111ttfffLffttfftttttt1111tttt\nttttttttffLLLLLLLffttfLLffttfffftfLfttttttffttt11111ttttffffffftt1111tft11111ttffffttt11tfftt11ttttt\ntttttttfffLLLLLLLLfftffttttffLffftfftttttft1i;;::::;iitffffffffftt111tft1tttt1ttffLfttttfffffttttttt\ntttttttfffLLLLLLLLfttttffftffffftfttttttff1:,,,,,,,,::itfffffffft11111111ttttttttttt1tfffffffffffttt\ntttffttffLLLLLLLLLfttfftffffffffLLLftttttt;::,:::;;;;::1tfffftfft11111ttt1ttt1tfttt11ttffffffffLfttt\ntffffffffLLLLLLLffftfLfffttfLLffLLLfttttti;;;iii11111;:i11ttffft111111tfft11t11tt1tttttfffLLLLLLfttf\ntfffffttttfLLLffttttfffffttLLLLfLLLftttfti:;;;iiiiiiii;it111tt111t1111tffttfftt11ttftttfffLLLLLLffff\nttttfttttffffftttttttttttttfLLLffLLfttttt1;;;;;;iiiiii;1tft11tt1111111tfftfffftttttttttttfLLfffttfff\ntfffffffffftttfffffffffttffttLLfffLfttttt11i;;;;iiiiiii1tt11tfftt11111ttt1fffttt1tttttttttfffftttttt\nttffffffffftttfffffffffttffftffttftttttff1ii;;;;iii1iii111tt1ttttt1111t111ffttffttfffffLffttttffffff\nttffffffffttttffffffffttttttttttffftttttft1ii;;;ii1iii111tfft11ttt111111t1tt1tfft1ttffffLLftttLLLLLL\ntttffffffffttfffffffftttttttt11fffftttt1t111iiii;iiiii11ttffft11111111ttttttt1tt11ttffffLfftttfLLLLf\ntttttttffffttfffttttttttffttt11tffttttttt11ttii;;;iiii11i1ffftt1111111tttt111tttt11ttttffffftffLLLff\ntfttttttttttttttttttttfffftttt11tfftttttt111t1i;;;iiii1i,,:;i1111t1111ttt111t1tfftt11111ttfftffffftt\nttttfffftttttttfffftttffffttffttttft111tt11111i;;;iiii1;,,....,:::;i11tt111tt11tffftttttttt1tttttttt\nt11ttffffftttffffffttttfffttffttttft1111111111;;;;;;;it;,...........,:it111ttt1tffftttttfft11ttfffff\ntt1ttfffftt1ttfffft111tffttfttttttt1111t1i;:;11i1i;;1t1:,,............,itt11tt1tfftt1tfffffft1tffLLf\ntfttttfttttt11tttt1ttt11ttttttftt111111i:,..:1111iii11;,...............;tt111t11ttttttttffttt11ffLLf\ntfftttttttfftttttttffftt111ttffftt11i;,.,...,iiii;;;;:,,...............:1ttt1111ttfffttttft1tt1ttfft\nttttttttttttttt11ttttttttttfffffft1:,..........::::::,,,...............,1ttttt11ttfffffttttffftttttt\ntfffttttffffftt11ttttttttttfffffft1:...........:;::;:..................,1tttttt1ttfffffttttttttftttf\ntfffttttfffffft1ttftttfftttttffft11:...........,:::::..................,1tttft11tfffffffttfffffffttf\ntfffttttffffff11tttttttttttttttttt1;...........,::::,...................;t1t1111tfffffLfttfffffffttf\ntfffttttfftttt11tttttttt1tfftttttt1:...........,::::,...... ............,1111tt11fffffLftttffttffttf\ntttttttttttttt11tttttttt1tffftttft1:...........,:::,,....................it1ttt11tfffffftttffttffttt\nttttt1tttttttt11ttttttttttffttttttt:...........,::,,.....................:111tt11tttttttt1tttttttttt\nttttt1tttttttt11tftttttftttttttttt1;,:;:.......,:,,,....................,,1111t11ttttttt11ttttttfttt\n1tttt1ttfffttt11ttffffffttttfffft11ii1i:.......,:,,,.....................,1tt1111ttttttt111tttttfttt\n1ttt11tttttttt11tttttttttttttttttti;;;;:.......,:,,,....... .............,itt1111tttt11t111ttttttt1t\n111111tttttttt11111111ttttttttttt1i;;;;:.......,:,,,......................itt11111111111111111111111\n1111111111111111111111ttttttttttt1;;;;;:...... ,:,,,,.....................itt11t11111111111111111111\n1111111111111111111111tttttttttt1;:,::;,...... ,:...,.....................ittttt11111111111111111111\n111111111111111111111111tttttttt1i,..... .... .:........................,i1tttt11111111111111111111\n1111111111111111111111111t11t11111;,....,,.... ,:::,,,...................,11ttttt11t1111111t11111111\n11111111111111111111111111111111111iiiiii. ... .::::::,..................,11t1ttt111t11111tttttt1111\n1111111111111111111111111111111111111111:.,.....::::::,..................:111tttttt1tttt11tttttt1111\n1111111111111111111111111111111111111111:::,...,::::;::,..,,.............:11tt1ttttttttttttttttt1111\n","ttftfffttttttttttffffffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttftfLLLftfffffffffftt11111tt11111ttffffttttt1111111111111111ttttttfttttttttt111111tt\nttftttttttttttttffffLftttfffffffLLLfttttttftt111ttfffffftttttttt111111tttttffffftfffftttttt1111111tt\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tffffffffffttttttt11111tffffffffftttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttfftttttt1tttt1ttftfffftt1ttt111t111111ttffffLLffttfffft1111111tttt\nttttttttttffLLLLfttttffLLLfttttttfLftttttttfft11i;;:;;i11ttfftt11t111tt111tttffffftttttttttt111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLttttttfff1;,,,,,,,,:;tffffft11111tft11111ttffffttt11tffftt1ttttt\ntttttttfffLLLLLLLLfftffttttffLffftfftttttfft1;:,,,,,::::,;tffftttt111tft1tttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffffftfftttttfffti:;;;iiii11i;:tffffft11111111ttftttttttt1ttffffffffffttt\ntttffttffLLLLLLLLLftffftfLftfftfLLLftttttfft::i;iiiiii11i:1ffftft11111ttt1ttt1ttttt11ttfffffLLfLfttt\nttfLfffffLLLLLLLLfftfLLfffffLfffLLLfttttt1tt;:;;;;;iiiiiii1tffft11111tffft11t11tt1tttttfffLLLLLLffff\ntffftfttttfLLLffttttfffffttLLLLfLLLftttft111i;;;;;;iiiiii111tt111t1111tffttfftt11tfft1tfffLLLLLLLffL\ntttfftttttffLftttttttttttttfLfLffLLfttttttt1iii;;;;;ii11i1t11t11111111tffttfffttttttt11ttfLLLLffftff\nttfLffffffftttfffffffffttfftfLLfffLftttttfft1ii;;;;iii1i1tt1tfftt11111ttt1tffttt1ttt1tttttffffttffft\nttffffffffftttffffffffttfffftffffftttttfffft111;;;;iiii1111t1ttttt1111tt11ffttfftttfffffLfttttfffffL\nttffffffffttttffffffffttttttttttffftttttttt11ttii;iiiiii11tft11ttt111111t11t1tfft1tfffffLLftttLLLLLL\n1ttffffffffttfffffffftttttttt11ffffttttt1111tftiii;;iiii1;,;1111111111tttt11111111ttffffLfftttffLLLf\nttttttttfffttfffttttttttffttt11tffftttttt11ttf1;;;i;iiii1:,,.,,::;ii11tttt111tttt11ttffffffftffLLLff\ntfttttttttttttttttttttfffftttt11tfftttttt111tt1;;;i;;ii1t:,,........,:;1t111t1tfftt11111ttfftffffftt\ntftttffffttttttfftftttffffttffttttftt11tt111i;;;;;;;;;it1,,............,;11tt11tffffttttttt1tttttttt\ntttttffffftttfffffft1ttffftfffttttft111111;:,.;iii;;;i11,.,.............,1tttt1tffftttttfft111tfffff\n1tttffffftt1ttfffftt11tffttfttttttt1111i;,....,1iii;ii;,................,111tt1tfft11tffffftt1tLffLf\ntftttfftt1ttt1tttt1tttt1ttttttttt1111;:,.......i1;;;:::.................,it11t11ttttttttffftt11fffLf\ntfftttttttfftt1111ttfftt11ttfffftt1ti..........:i;::;:,..................ittt111t1tffttttft1tt1tffft\nttttttttttttttt11tttttttt1tffffffftti,.........,::::::,..................itttt11ttffffftttttfftttttt\ntfffttttfffffft11ttttttttttffffffft1i,.........,:,:::,...................,1tttt11tfffffttttttttffttf\ntfffttttfffffft11tftttfftttttffft1111:.........,:,:::,....................;tt111tfffffffttfffffffttf\ntfffttttfffffft1tttttttftttttttttt111;.........,:,::,,....................,111111fffffLfttfffffffttf\ntffftttttttffft11tttttttttffttttfft11i.........,:.:,,......................:1tt11fffffLftttffttffttf\ntttttttttttttt111ttttttt1tffftttfft111:....... ,:.:,,.......................1tt11tfffffftttffftffttt\nttttt1tttttttt11ttttttttttfttttttft111i,...... ,:,,,,......................,itt11ttttttt11ttttttfttt\nttttt1tttttttt11tfttttfftttttffttt1111i,...... ,:.,,,......................:11111ttttttt11ttttttfttt\n1tttt1ttftfttt11tfffffffttttfffft11111,....... ,,.,,....... ...............it1111ttttttt111tttttfttt\n1tttt1tttttttt11ttttttttttttttttt1111;,....... ,,.,,......................:tt11111ttt11t111ttttttt1t\n11t111tttttttt111t1111tttttttttt1iiii:,,...... ,,.........................;t111111111111111111111111\n111111111tt11111111111ttttttttt1;;iiii:....... ,,............ ...........;tttt1111111111111111111111\n1111111111111111111111ttttttttt1;;;iii;... ....,::::,....,:::,,.........;1ttttt111111111111111111111\n111111111111111111111111tttttttt1i;;ii: .,....,:::::... .;;;;;:,.....,;1ttttttttt111111111111111111\n1111111111111111111111111tt1111111i,,.,:;i: ...,:::::.....:;;;;;:.....,1ttttttttt11t1111111t11111111\n11111111111111111111111111111111111:.:1tti,....,:::::.... ,;;;;;;,.....ittttttttt111t11111ttttt11111\n1111111111111111111111111111111111111ttt;,,....,:::::,... .,;;;;:,.,,..:ttttttttttt1tttt11tttttt1111\n11111111111111111111111111111111111111t1,,,....:;;::::,.....:;;;:......,1ttttttttttttttttttttttt1111\n","ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt1tt111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftfffffffffttt11111tt11111ttfffft1ttt1111111111111111tttttffttttttttt111111tt\nttftttttttttttttffffLffttfffffffLLLfttttttfttt11tffffffftttttttt111111tttttffffftfffftttttt1111111tt\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt1iiiii1tttttttt11111tffffffffftttfffffttt1111t1tt1\nttttttttttttffffttffftffffffffffttffttttt11tttt1i::,,,,,,:;111111t111111ttffffLLffttfLfftt11111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfft1i;,,,,,,,,,:;ttt11t111tt111tttffffftttftttttt111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttffffti;::;;;;;iii::1ftt11111tft11111ttffffttt11tffftt1ttttt\ntttttttfffLLLLLLLLLftffttttffLffftffttttffffft;:;iiii11111i:iftttt111ttt1tttt11tffLfttttfffffttttttt\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffft;:;;;;;iiiiii;1fftt11111111ttftttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffffti;;;;;;;ii;iiitffft11111ttt1ttt1tfttt11ttfffffLLfLfttt\nttfLfffffLLLLLLLLffffLLfffffLfffLLLLtttttttff1iii;;i;;iii111tfft111111ffft11t11tt1tttttfffLLLLLLffff\ntffftftttffLLLffttttfffffttLLLLfLLLffttftt11t1iii;;;;;iiiii1tt111t1111tffttfftt11tfft1tfffLLLLLLLfff\nttffftttttffLftttttttttttttfLLLffLLftttttttft111i;;;;iiii1111111111111tffttfffttttttt11ttfLLffffftff\nttfLffffffftttfffffffffttfttfLLfffLftttttfffft11i;;;;iiii1t1ttttt11111ttt1tffttt11ttttttttfffftfttft\nttffffffffftttffffffffttfffftffffftttttfffft11t1i;;;;;iii1ii1ttttt1111t111ffttfft1tfffffLfttttfffffL\nttffffffffttttffffffffttttttttttffftttttttt11tft1i;;;;iii1i,:;i1ttt11111t11t1tfft1ttffffLLfttfLLLLLL\ntttffffffffttfffffffftttttttt11ffffttttt1111tfti;ii;;iiii1;,,...,:;ii1tttt1111tt11ttffffffftttffLLLf\nttttttttfffttfffttttttttffttt11tffftttttt11t1iii;;ii;;;i1t:,.........,:;1t111ttt111ttffffffftffLLLLf\ntfttttttttttttttttttttfffftttt11tfftt11tt1i:,.:;;;i;;;itti,,............,;1111ttttt11111ttfftffffftt\ntfttfffftttttttfffftttffffttffttttft1111i:....,;;;ii;i11;.,,.............:1tt1ttffffttttttt1ttttttft\ntttttffffftttffftffttttffftfffttttft1i:,.......:;;;;;;;:,................:tttt1tffftttttfft11ttfffff\n1t1tffffftt1ttfffftt11tffttftttttttt1,.........,ii;;;;;,.................:11tt1tfft11tfffffft1fLLfLf\ntftttfftt1ttt1tftt1ttt11ttttttttt111i,.........,11;:;;:,.................,1t1t11ttttttttfftt111fffLf\ntfftttttttffttt111ttfftt11ttffffftt11,.........,i;::::,..................,1tt11111ffft1ttt11tt1tffft\nttttttttttttttt11tttttttt1tffffffft11;..........::::::,...................;tt1111tfffftttttffftttttt\ntfffttttfffffft11ttttttttttffffffft11:..........:::::,..,;:,...............ittt1tttttffttttttttffttf\ntfffttttfffffft11tftttffttttfffft1111:..........:::::,..;1i;:,..............1t11tfffffffttfffffffttf\ntfffttttfffffft1tttttttftttttttttt111;..........::,:,...;ii;;;,.............:1111tffffLfttfffffffttf\ntffftttttttfft11ttttttttttfftttttft11i,.........::,,,...;;;;;i:..............;111tffffLfttfffttffttf\ntttttttttttttt111tttttttttffftttfft11i,.........::,,,...;;;;;i:..............:111tfffffftttffttffttt\ntttttttttttttt11ttttttttttfftttttft111:.........:,,,....::;;;;:.............,1t11ttttttt11tttttffttt\nttttt1tttttttt11tfttttfftttttfftttt111:.........:,,,......,::::..,.........,i1111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfffffffttttfffft1111i:,........:,,,..... .......,,...... .it1111ttttttt111tttttft1t\n1tttt1tttttttt11ttttttttttttttttt1iiii;,........:........... ...........:itt11111ttt1t1111ttttttt1t\n111111tttttttt111tt111tttttttttti;;;iii:... ....:,,...................:i1tttt11111111111111111111111\n111111111tt11111111111tttttttttt1;;;;;;;. .,....::::..................:1tttttt1111111111111111111111\n1111111111111111111111ttttttttttt1i;;::..:;1,...::::...................;ttttttt111111111111111111111\n1111111111111111111111111tttttttt111i,.,it1;....::::,..................,1ttttttttt111111111111111111\n1111111111111111111111111tttt11111111ii1t1i:...,::::,........,..........itttttttt11t1111111tt1t11111\n11111111111111111111111111111111111111tt1;:....::::;:.......,...........:1ttttttt111t11111ttttt11111\n111111111111111111111111111111111111111ti,,....:;:;::,..................,ittttttttt1tttt11tttttt1111\n111111111111111111111111111111111111111t:,:.,.:;;;;:::,..................;111t1ttttttttttttttttt1111\n","ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt11t111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftfffffffffttttt1111t11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\nttftttttttttttttffffLffttffffffffLLfttttttfttt11ttt1iiii;i11tttt111111tttttffffftffffttttttt111111tt\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tt1::,,,,,,:;1ttt111111tfftfffffftttfffffttt1111t1tt1\nttttttttttttffffttffftffffffffffttfftttttt1ttt11i;:,,,,,,,,,:1111t1111111tffffLLffttfLfftt11111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;:::;;;;;;;::it11t111tt111tttffffftttfttttt1111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttfffffti:;;ii111111i:itt11111tft11111ttffffttt1ttffftt1ttttt\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffft;:;;;;;iiiiii;ittt1111ttt1tttt11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffffti;;;;;;;ii;iiitttt11111111ttftttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttfffff1iii;;i;;i1i1i1tttt11111ttt1ttt1tfttt111tfffffLLfLfttt\nttfLffffffLLLLLLLffffLLfffffLfffLLLftttttttfft1i;;;;;;;iiiiitfft111111ffft11t11tt1tttttffffLLLLLffft\ntffftfttttfLLLffttttffffftfLLLLfLLLftttftt1111111i;;;;iiii111t111t1111tffttfftt11tfft1tffLLLLLLLLfff\nttffftttttffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111111111111tffttffftttttttt1ttfLLLfffffff\nttfLffffffftttfffffffffttfttfLLfffLftttttffft1111i;;;;;ii111tfttt11111ttt1tffttt11ttttttttfLfftfttft\nttffffffffftttfffffffffttffftffffftttttfffft11t11i;;;;iii1i:;1ttft11111111ffttfftttfffffLfttttfffffL\nttffffffffttttffffffffttttttttttffftttttft111tttiii;;iiii1;,,,:;i1111111111t1tfft1ttffffLLftttfLLLLL\ntttffffffffttffffffffttttttttttfffftttt1111i;:;iiii;;;i;11:,,.....,:;i1tft1111tt111tffffLfftttffLLLf\nttttttttfffttfffttttttttfftt111tfffttt11i;,,..:i;;;i;ii1t1,,..........,:i1111ttt1111tffffffftffLLLLf\ntfttttttttttttttttttttffffttttt1tffti;:,,.....,;;;iiii1ti,,,.............;1111ttttt11111ttfftffffftt\ntttttffffttttttfffftttffffttffttttf1:.........,;:;;;;;;;,.,,,............:1tt1ttffff11ttttt1ttttttft\ntttttffffftttffftfft1ttffftfffttttf1,..........,;;;;;;;:.:ii;;:,.........:tttt1tfffttttffft111tfffff\n1tttffffftt1ttfffftt11tffttfttttt1t1,...........ii;;;::,,;i;;ii:.........:tttt1tfft11tfffffft1fLLfLf\ntftttffttttt11tftt1tttt1ttttttttt11i,..........,1i;;::,.:i;;;;i:.........,1t1t11ttttttttfftt111fffLf\ntfftttttttffttt11tttffttt1tttffft11i,..........,ii;:::,.,:;;iii:..........it111111tfft1ttt11tt1tffft\nttttttttttttttt11tttttttt1tfffffftti,...........:::::,....:;;ii:..........:tt111ttfffftttttffftttttt\ntfffttttfffffft11ttttttttttfffffft1i,...........:::::,.....,:;;:.... ......,1t111ttttffttttttttffttf\ntfffttttfffffft11tftttffttttfffft111:...........:::::,........,..,..........,1111tffffffttfffffffttf\ntfffttttfffffft1tttttttftttttttttt11:...........::,:,........ ...:;,.........:111tffffLfttfffttffttf\ntffftttttttfft11ttttttttttffttttttti,...........:::,,.............,...........,i1tffffLfttfffttffttf\ntttttttttttttt111tttttttttffftttfft;,:;:........:::,.............. ...........:11tfffffftttffttffttt\ntttttttttttttt11ttttttttttfftttttftii1i;:.......:::,.......... ..............:t111tttttt11tttttffttt\nttttt1tttttttt11tfttttfftttttffttt1ii;ii;,......::,,........................:1111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfffffffttttfffft11i;;ii;,......:,,,..........:........ .;t1111ttttttt111tttttft1t\n1tttt1tttttttt11tttttttttttttttttt11;:;i:,,.....:,.................. .;i;;1tt1111tttt1t1111ttttttt1t\n111111tttttttt111t111ttttttttttttt11i:,,:1;....,::....................:1ttttt11111111111111111111111\n111111111tt1111111111tttttttttttttt11i;;1t:....:::::...................;tttttttt11111111111111111111\n1111111111111111111111ttttttttttttt111ttt1,,,.,:::::,..................,1ttttttt11111111111111111111\n111111111111111111111111tttttttttt1111111i,::.,;::;:,...................;ttttttttt111111111111111111\n1111111111111111111111111ttttttt11111111t;.,,.,;;;;;,...................,1ttttttt11t1111111tttt11111\n111111111111111111111111111111111111111t1:..,,:;;;;;:,...................;ttttttt111t11111ttttt11111\n111111111111111111111111111111111111111ti,,,::;;;;;;;:,..................,1tttttttt1tttt11tttttt1111\n111111111111111111111111111111111111111t;,,::,;;;ii;;::,..................it1tttttttttttttttttt11111\n","ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftfffffffffttttt111tt11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\nttftttttttttttttffffLffttfffffffLLLftttttttttt11ttt1iiii;i11tttt111111ttttttfffftffffttttttt111111t1\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt;:,,,,,,,:itttt11111tfftfffffftttfffffttt1111t1ttt\nttttttttttttffffttffftffffffffffttfftttttt1tttt11i:,,,,,,,,,:i111t1111111tffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;::;;;;;;;;;,;t111111tt111tttffffftttftt1tt1111ttttt\nttttttttffLLLLLLLffttfLLffttfffftfLLtttttffffff1,:iiii111111;:tt11111tft11111ttffffttt11tffft11ttttt\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffffi:;;;;;iiiii1;;ttt1111ttt1tttt11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLLftfftttttfffffff1;;;;;;;ii;;ii1ttt11111111ttftttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLffffftfLftffffLLLftttttfffff1iiiiii;;iiii1itttt11111ttt1ttt11tttt11ttfffffLLfLfttt\ntffLLffffLLLLLLLLffffLLftffLLLffLLLftttttttffftiii;;;;;ii1ii1tft111111ffft11t11tt1tttttffffLLLLLffft\ntfffffttftfLLLffttttfffffttLLLLfLLLftttft111tt111i;;;;iiiii1tt111t1111tffttfftt11tfft1tffLLLLLLLLfff\nttttfttfffffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111t11111111tffttffftttttttt1ttfLLLfffffff\nttffffffffftttfffffffffttfftfLLfffLftttttffft11t1i;;;;;iii11ttttt11111ttt1tffttt11ttttttttfLfftftttt\nttffffffffftttfffffffffttffftffftftttttffft111t11i;;;;iii1ii11tttt1111tt11ffttfftttfffffLfttttffffff\nttffffffffttttffffffffttttttttttffftttttttt11111iii;;iiii1;,:;1tttt11111t11t1tfft1ttffffLLftttfLLLLL\ntttffffffffttffffffffttttttttt1tffftttt11i;:,:i;;i;;;;;i11,,..,,:;i111tttt1111tt11ttffffLfftttffLLLf\nttttttttfffttfffttttttttffttt11ttff1ii;:,....,;::;i;;i11ti,,.......,:;ittt111ttt1111ttffffffttfLLLLf\ntfttttttttttttttttttttfffftttt11tff;,,........;;;;iii1tti,,,,:;;::,....,i11111ttttt11111ttfftffffftt\ntfttfffffttttttfffft1tffffttfft1ttt:..........:;;;;;;;i;...,;i;iii:.....,i1tt1ttffff11ttt1t1ttttttft\nttttfffffftttfffffft11tffftffftttti,..........,:;;;;;;;,...,;;iiii,......;tttt1tffftttttftt111tfffff\n1tttffffftt1ttfffftt111ffttft11tt1;,...........;i;;;;;:,.....:;iii,......;tttt1tfft11tffffftt1fLLfLf\ntttttffttttt11tftt1tttt1tttt1tttti,............;1;::;;,......,;iii,......;t11t11ttttttttfftt111fffLf\ntfftttttttffttt111ttfftt111ttfffti.............;i;::::,.......,;;;,......;ttt11111tfft1tttt1tt1tffft\nttttttttttttttt11ttttttt11tffffffi,............,::;:::,..........,.......:ttt1111tfffftt1tttfftttttt\ntfffttttfffffft11tttttttttttffffti,............,:::::,..............,....,ittt11ttttttft1ttttttffttf\ntfffttttfffffft11tffttff11t1tfff1;...... ....,.,:::::,.....................;11111tffffffttfffffffttf\ntfffttttfffffft1tttttttfttttttti:,......:iiii;,,:::,:.......................,;111tffffffttfffttffttf\ntffftttttttfft11ttftttttttfftti,,::,.,:;1i;;;;.,::::,.........................,i1tffffLfttfffttffttf\ntttttttttttttt111ttttttt1ttfft1:::,,,:,:;;;;i:.,:::,,..........................;1tfffffftttffttffttt\nttttt1tttttttt11ttttttttttfttt1;,...,...:;;;:, ,:::,..........................;11ttttttt11ttttttfttt\nttttt1tttttttt11tfttttfftttttfti,..,....,,,....,:::,.........................:111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfffffffttttffft1;::::,,.......,:,:,.................. .:1111ttttttt111tttttfttt\n1tttt1tttttttt11ttttttttttttttttttt11111:......,:,,,..................,::,:1tt1111ttt1t1111ttttttt1t\n111111tttttttt111t1111tttttttttttt111111:......,,.....................,1tttttt1111111111111111111111\n1111111111t11111111111ttttttttttttt11111:......,:,,....................:1t1ttttt11111111111111111111\n1111111111111111111111ttttttttttttt1111t:......,;;::....................:1ttttttt1111111111111111111\n111111111111111111111111ttttttttt1111111:......,::::,...................,itttttt11111111111111111111\n111111111111111111111111111tttt111111111:......,;;::,....................:1ttttttt1tt11111ttttt11111\n1111111111111111111111111111111111111111:......:;;;::,...................,ittttttt11t11111ttttt11111\n11111111111111111111111111111111111111t1:......:;i;;::,...................:11tttttt1tttt11ttttt11111\n1111111111111111111111111111111111111111,......:;;;;;::,..................,1tttttttttttttttttttt1111\n","ttftfffttttttttttfffffLftfftttttttttt111tttt1111111tttt111111ttttt11111tttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftffffffffftttttt111111111ttfffftt1tt1111111111111111ttttttftttttttt1111111tt\nttftttttttttttttffffLftttfffffffLLLft1tttttft111tfftttfttttttttt111111ttttttfffftffffttttttt11111tt1\nttttttttttttttttfffLfttffffffLLffffttttttttttt1ttti;;;;::;i1tttt111111tffffffffftttfffffttt11111ttt1\ntttttttttttfffffttffftffffffffffttfftttttt1ttt111i,,,,,,,,,;11111t1111111tffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1i::,,,,,,,,,:1t11t111tt1111ttffffftttftt1tt1111ttttt\nttttttttffLLLLLLLffttfLLLfttfLfftfLLtttttfffffti:;;iiiiiiii::1tt11111tftt1111ttffffttt11tffft11ttttt\ntttttttfffLLLLLLLLLftffftttffLffftfftttttffffft::;;iii1i111i:1ttt1111ttt1tttt11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffffft;;;;;;;iiiiii;tttt11111111ttftttttttt11tffffffffffttt\ntttfftfffLLLLLLLLLfttfftfLfffffffLLftttttfffft1ii;;;;;iiiiiitfttt11111ttt1ttt11tttt11ttfffffLLfLfttt\nttfLLfffffLLLLLLLfftfLLftfffLLffLLLftttttttfftiii;;i;;ii111itfft111111tfft11t11tt1tttttfffLLLLLLLfff\ntfffffttftfLLLffttttffffftfLLLLfLLLftttft111tt1iii;;;;iiiii1tt111tt111tffttfftt11tfftttffLLLLLLLLfff\nttttfttffttffftttttttttttttfLLLffLLftttt1tttt11t1i;;;iiii1111t11111111tffttffftttttttt1ttfLLLfffffff\nttfLffffffftttfffffffffttftttfLfffLftttttfffft11i;;;;iiii111tfttt11111ttt1fffttt1ttt1tttttfLLffftttt\nttffffffffftttfffffffffttfftttfttttttttffft11111i;;;;;iii1tt11tttt1111t111ffttffttfffffLLfttttfLffff\nttffffffffttttffffffffttttttttttffftt11ttt1111t1i;;;iii1i1itt11ttt111111t11t1ttft1ttffffLLftttfLLLLL\ntttffffffffttfffffffftttttt1111tffftttt11i;::i1iii;;;iii1i,:;i11t11111tttt1111tt11ttffffLfftttffLLLf\nttttttttfffttfffttttttttffttt11ttft1ii;:,....;i;;;ii;;i1t:,...,:;i1111tttt111ttt1111tttffffftfLLLLLf\ntfttttttttttttttttttttfffftttt11t1:,,........ii:;;iii1tt1,,,......,,;i1tt11111ttttt11111ttfftffffftt\ntfttfffffttttttfffft1tffffttfft11;,..........:;::;ii11t1:,,,...,,:,...,it11tt11tffffttttttt1ttttffft\nttttfffffftttfffffft11tfffttfttt1,....,,......,:;;;;;;i,.......:iii;;,.,1t1ttt1tffftttttfftt11tfffff\n1tttffffftt1ttfffft1111tfttft11ti,.............;i;;;;;:........:iiiii:..it11tt1tfftt1tfffffft1fLffLf\ntttttffttttt11tttt1tttt1tttt1tt;,..............i1;;;;;,........,;iii;,..it111t11ttttttttfftt111fffLf\ntfftttttttfftt1111ttfft11111tft:...............;i;;;;:,.........:;ii:..,ittt111111tfftttttt1tt1tffft\nttttttttttttttt11ttttttt11ttff1,...............,::::::......... ,;ii:...itttt111ttffffft1tttfttttttt\ntfffttttffftttt11ttttttt111tft;,........... ..,:;:::,...........,:;:...;ttttt11ttfffffttttttttffttf\ntfffttttfffffft11ttttttf11111;:,..... .....,:::::::::...............,...:1ttt1111fffffffttfffffffttf\ntfffttttfffffft11ttttttt11ti,,...........,:;i;;;:::::..................,.:tt11111tffffffttfffffffttf\ntffftttttttfff111ttttttt111,.,,,,...,,..,;;;;;i;:,::,....................,;i1t111tffffLfttfffftffttt\ntttttttttttttt111ttttttt11t:.......,....,:;;;;;:::,:,.......................:1t11tfffffftttffttffttt\nttttt11ttttttt11tttttttt11t1,............,,,...,::::.........................:111ttttttt11ttttttfttt\nttttt1tttttttt11ttttttfft1t1:,............ .. ,:::,........................,i111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfftttfftttttt1;::,,::.........,:,,,........................i1111ttttttt111tttttfttt\n1ttt11tttttttt11tttttttttttttttttt111i.........,::,,................. . .;t11111ttt1tt111ttttttt1t\n11t111tttt1tt111111111tttttttttttt111i,........,:,,...................,..,itttt111111111111111111111\n1111111111111111111111tttttttttttt111i,....... ,:....................i111ttttttt11111111111111111111\n1111111111111111111111ttttttttttt1111i,....... ,:,::,................,i1t11tttttt1t11111111111111111\n111111111111111111111111tttttttt11111i,........,::;:,..................;1ttttttt11111111111111111111\n1111111111111111111111111tttt11111111i........ ,,:::,..................,1ttttttttttt1111111tt1t11111\n1111111111111111111111111111111111111i,........,,:::,...................it111ttttt11t11111ttttt11111\n111111111111111111111111111111111111t1,........,,,:::,..................,1t1ttttttt1tttt11ttttt11111\n11111111111111111111111111111111111111,........,,,;;::,..................i111ttttttttttttttttttt1111\n","ttftffftttttttffffffffLfttftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\nttfttttttttttttttftfLLLftffftffffftttttt111111111ttfffftt1tt1111111111111111ttftttftttttttt1111111tt\nttftttttttttttttffffLftttfffffffLLLft11tttfft111tfffffffttt1ttttt11111ttttttfffftffffttttttt11111tt1\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tt111ii11tft1ttttt11111tfftfffffftttfffffttt11111ttt1\nttttttttttttffffttfffttfffffffffttffftttt111ttt1:,,,,,,,:i1111111t111111ttffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttftt1;:,,,,,,,,,;1tt111t1111t111tttffffftttftt1ttt111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttffft1i;;;;;;;;;;::1tttt11111ttt11111ttffffttt11tffft11ttttt\ntttttttfffLLLLLLLLLftffftttffLLfftfftttttffffi:;iii111111i:ittttt1111ttt1tttt11tfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffff;:;;;;iiiiiii:ittttt11111111ttttttttttt11tffffffffffttt\ntttffftffLLLLLLLLLfttfftfLftfffffLLftttttffff1i;;;;;ii;iiiittttft11111ttt1ttt1ttttt11ttfffffLLfLfttt\nttfLLfffffLLLLLLLfftfLLftfffLfffLLLftttttttf1i1i;i;;iiii1i1tffft111111tfft11t11tt1tttttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1111iii;;;;ii1i1i11tt111t1111tffttfftt11tfftttfffLLLLLLLfff\ntttffttfftffLftttttttttttttfLLLffLLfttttttttt11i;;;;iiii11t11111111111tffttfffttttttt11ttfLLLfffffff\nttfLffffffftttfffffffffttftttfLfffLftttttffft11i;;;iiiii1t11ttttt11111ttt1fffttt1tttttttttfLLftftttt\nttffffffffftttfffffffffttffttfffttttttttfft1111i;;;;iii1111111tttt1111tt11ffttffttfffffLffttftffffff\nttffffffffttttffffffffttttttttttffftt11tttt11t1ii;;;iii11tfft11ttt111111t11tttfft1ttffffLLfttffLLLLL\ntttffffffffttfffffffftt1ttt1111fffft1tt11iiii1iiii;iiii1i:1tft11111111tttt111ttt11ttffffLfftttffLLLf\nttttttttfffttfffttttt1ttfft11111tft11i;:,..,;ti;;;i;iii1;,,,:;i1111111tttt111ttt1111tffffffftfLLLLLf\ntfttttttttttttttttttttfffftttt11i;::,,......iti::;i;iitt:,,....,:;i111ttt111t1ttttt11111ttfftffffftt\ntfttfffffttttttfffftttffffttft11:...........;ii::;i11tti,,,,.......,:itt111tt1ttffff11ttt111ttttttft\nttttfffffftttffftfft11tfffttftt;,............,:;;;;;11;,..............;1111ttt1tffftttttfftt1ttfffLf\n1t1tffffft11ttfffft1111tfttft11:.............,:ii;;;;;,...............:11t11tt1tfft11tfffffft1ffffLf\ntttttfftt1tt11tttt1ttt11t1111t;,..............:i1;;;;:,...............,111111t11ftttttttfftt11tfffLf\ntfftttttttfftt1111tttft11111t1,...............:ii;;;;,............,,,.,1tttt11111ttfftttttt1tt1tffft\nttttttttttttttt11ttttttt11ttfi................:;::;::,...........,;i;;:1tttttt11ttffffftttttfftttttf\ntfffttttftttttt11ttttttt11ttfi................,;;:::,............,;iiii1tttttft1ttffftfttttttttftttf\ntfffttttfffffft11ttttttt11111;........ .......:;:::,............:iiiii11ttftt11tfffffffttfffffffttf\ntfffttttftffff111ttttttt11ti:,....... ,:::;;:,.,;:::,............:;;ii:i11tt1111tfffffffttfffffffttf\ntffftttttfffft111ttttttt11i,.........,iii;;;,..,:::,.............::;;,.it1111tt11tffffffttfffftffttf\ntttttttttttttt111ttttttt11,.,,,,..,,,:;;;;;;,..,:::,.............,::;..:i111ttt11tfffffftttffttffttt\nttttt1tttttttt111ttttttt11;,,,...... .:;;;;:...,:,,,.....................:111tt11ttttttt11tttttffttt\nttttt1tttttttt11tttttttt111,..........,,,,.....,:,,.......................:111111ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfft11i:,.....,.... .....,::,......................,1t11111ttttttt111tttttft1t\n1tttt1tttttttt11ttttttttttttt1ii;;;:...........,:,,.....................,it111111ttttttt111ttttttt1t\n11t1111tttttt111111111tt1tttttttt11:...........,:,,.............. .;t11111111111111111111111111\n1111111111111111111111ttttttttttt11,.......... ,,................,:,,,:i1tttt1t111111111111111111111\n1111111111111111111111tttttttttt11i,...........,,,,..............:1t11ttttttttttt1111111111111111111\n111111111111111111111111tttttt1111;........... ,,:;,..............:11ttttttttttttt111111111111111111\n11111111111111111111111111tttt1111;........... ,,:;:...............:111tttttttttt11t1111111tttt11111\n1111111111111111111111111111111111;....,,......,,,::................i1ttttttttttttt1t11111ttttt11111\n1111111111111111111111111111111111;............:,,;:,...............;1tttttttttttttttttt11ttttt11111\n1111111111111111111111111111111111:............,,:;;:...............,1t1tttttttttttttttttttttttt1111\n","ttftffftttttttfffffttfLfttftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffft1ttt1111111111111111ttttttftttttttt111111ttt\nttftttttttttttttffffLftttfffffffLLLftt1tttttt111ttfffffftttttttt111111tttttffffftffffttttttt111tttt1\nttttttttttttttttfffLfttffffffLLffffttt1tttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111tttt\nttttttttttttffffttfffttfffffffffttffftttt11111111i;i11ttt11tt1111t111111ttffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttfti:::,,,,:;i1ttfttt11t111tt111tttffffftttftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLftttttft1;,,,,,,,,,,;tffffft11111tft11111ttffLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLfLftffttttfffti;:;;;;iii;::1fffffttt111ttt1tttt1ttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLfftfftttttfffi;;iiiii1111i:iffffftt11111111ttttttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffi:;;;;iiiiiii:1ftttfftt1111ttt1ttt1ttttt111tffffffLfLfttt\ntffLLfffffLLLLLLLfftfLLftftfLfffLLLLttttt1t1i;;;;;ii;iiii1ttffft111111tfft1tt11tt1tt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft11i1i;;;;i111iii111tt111t1111fffttfftt11tfftttfffLLLLLLLffL\ntttffttfftffLftttttttttttttfLLLffLLftttt1tti1i;;;;ii1iii1tt11111111111tffttffftttttttttttfLLLLfffffL\nttfLfffffffttffffffffffttftttfLfffLftttttfftt1;;;;iiii11ttt1ttftt11111tfttffftt111ttttttttfLLftftttt\nttffffffffftttfffffffffttffttfftttttttttfft111i;;;iiii1t111t1ttttt1111tt11ffttffttfffffLLfttffffffff\nttffffffffttttffffffffttttttttttfffttt1tft1111i;;;iiii111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt1111tffft11t111111iiii;;iii111fffft11111111ttft111ttt11tfffffLfftttfLLLLf\ntttttttttffttfffttttt1ttfft1t11ttfftttt1iiii1i;;;iii1i1i,;i1ttt1111111tttt111tttt111tffffffftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tff11i;:,,,:11i;;iii;it;....,:;i111111ttt111t1ttftt11111ttfftffffftt\ntfttfffffttttttfffftttffffttfft1ii;:,,.....:11;:;;;;1tt;,,,.....,,;i11tt111tt1ttfffftttttt11ttttttft\nttttfffffftttffftfft11tfffttft1;,..........:1ii;;ii1tti,,,..........,it1111ttt1tfffttttffftt1ttfffLf\n1tttffffftt1ttfffft1111tfttft1i,............,:;ii;;i1i,..............:111111tt1tfft11tfffffft1ffffLf\ntftttffttttt11tttt1ttt11t1111t;..............,;1i;;;;,...............,1111111t11ftttttttfftt11tfffLf\ntfftttttttfftt1111ttttt11111tt:............. ,;ii;;;:,...............,i111tt11111tffftttttt1tttttfft\nttttttttttttttt11ttttttt11ttft,...............;;;;;:,.................ittttttt11ttffffftttttfffttttt\ntfffftttftttttt11ttttttt11ttf1,...............:;;;::,.......,,,.......;tttttfftttfffftfttttttttffttf\ntfffttttfffffft11ttttttt1111t1,...............:;;;::........,;i;:,....;t1ttfttt1tfffffffttfffffffttf\ntfffttttftffft111ttttttt11t111,...............,::::,........:iiiii:...;t11tt1111tffffLffttfffffffttf\ntffft1tttfffft111ttttttt11ttt1,..... ..........::::,.......,;iiii;,...it11111tt1tfffLfLfttfffftffttf\ntttttttttttttt111ttttttt11tt1:... .,..........,:::.........:;;i;,...,1t1t11tft11tfffffftttffttffttt\nttttt1tttttttt111ttttttt1tt1:,...:;ii:.........,::,.........,:;;:.....,it1111tt11ttttttt11tttttffttt\nttttt1tttttttt11ttttttttt1t;::,;iiii;,.........,:,,...........,,,......,;11111111ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfft1ti:,,;;;:;;,.........,:,,.......... ..........:tttt1111ttttttt111tttttfttt\n11ttt1tttttttt11ttttttttttt1,.,::::;;:.........,:,,...............,....;ttttt1111ttttttt111ttttttt1t\n11tt11tttt1tt111111111111ttti:,,,::;:..........,:,,............ ......;ttttt11111111111111111111t111\n1111111111111111111111tttttttt1:,,,............,:,.............,. .,;11tttttt1111111111111111111111\n1111111111111111111111tttttttttt1:.............,,............ .11ii1ttttttt1111111111111111111111111\n111111111111111111111111tttttt111,.............,::,,...........ittttttttttttt11111111111111111111111\n11111111111111111111111111111111;..............,;;;:,..........:11tttttttttttttt11111111111111t11111\n11111111111111111111111111111111;..............,;;;:,...........:11tttttttttttttttt1111111ttttt11111\n11111111111111111111111111111111:..............,;;;;:...........:1ttttttttttttttttttttttt1ttttt11111\n11111111111111111111111111111111:..............,;i;::,..........,1tttttttttttttttttttttttttttttt1111\n","ttftffftttttttfffffttfffttftttttttttt111tttt1111111ttttt11111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffffttttt111111111111111ttffttftttttttt11111tttt\ntfttttttttttttttffffLffttfffffffLLLft11tttttt111tfffffffttttttttt11111ttttfffffftfLLfttttttt1111ttt1\nttttttttttttttttfffLfttffffffLLffffttt1ttttttt1ttfffffffffttttttt1111ttfftffffLftttfffffttt11111tttt\nttttttttttttffffttfffttffffffffftttfttttt111ttt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttfLLLfftttttffLftttttttt11ii11fffft1ttfftt11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttt1i:;:,,::;i1tttffffftt11111tft11111ttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttffLffftffttttfti:,,,,,,,,,:;tfffffttttt111tftttttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftffttttttti:::::;;;;;,,1ffttffttt11111111ttttttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLfftfftffftffffLLLfttttti;iiiii11111;:1ttfffffftt1111ttt1ttt1tftttt11tfffffLLfLfttt\nttfLLffffLLLLLLLLfftfLLftttfffffLLLLttttt;;i;;iiiiii1;:i11tfffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1ii;;;ii;;iii;tt11ttt111t1111tffttfftt11tfftttffLLLLLLLLffL\ntttffttfftffLftttttttttttttfLLLffLLftttt11ti;;;iiii1iii1ttt1ttt1111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttftttfLfffLfttttt11i;;;iii1iii1tttt1tfftt11111tfttffftt11tttttttttfLLffftttt\nttffffffffftttfffffffffttfftttfftffttttfft11;;;iiiii11tt111ttttttt1111tt1tffttffttfffffLLfttftfLffff\nttffffffffttttffffffffttttttttttfffttt1tft11i;iii11i11111tfft11ttt11111tt11tttfft1tffffLLLfttfLLLLLL\nttfffffffffttfffffffftt1ttt111tfffftttt11111i;i;iiii111ttfffft11111111tttt11tttt11tffffLLfftttfLLLLf\nttttttttfffttfffttttt1ttfftt111tfffttt111111;;i;;iii11i1ttffft11111111tttt111tttt11ttfffffLftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tffttt1t1ii1;;i;;iiii1;,::i11tt1tt1111ttt11tt1tfftt11111ttfftfLffftt\ntfttfffffttttttfffft1tffffttfft11tft11i::,,1ii;:;ii;it:,,...,,:;i11111tt111tt1ttfffftttttt11tttttfft\nttttfffffftttffftfft11tfffttfttttt1i:,....,it1i;;;;i1t;,,,,.......,;111t111ttt1tfffttttffftt11tffLLf\n1tttffffftt1ttfffft111ttfttft11i;:,........i1tt1ii1tt1:,,...........:1111111tt1tfftt1tfffffft1ffffLf\ntftttffttttt11tttt1ttt11t1111t;,...........,;;;11;;;;:..............,1t111111t1tftttttttfftt11tfffLf\ntfftttttttfftt1111ttttt11111tt:..............:;ii;;:,................it111tt11111tffftttttt1tttttfft\nttttttttttttttt11ttttttt11ttf1,..............,;;;;::,................it1tttttt1ttfffffftttttfffttttt\ntfffttttffttttt11ttttttt11ttfi................;;;:::,,:;:,...........;tttttttftttffffffttttttttffttf\ntfffttttfffffft11ttttttt1111ti................:;:::,.:;iii;,.........:111ttfftt1tfffffffttfffffffttf\ntfffttttftffff111ttttttt11t11;................,;:::,.;iiiii:.........:tt11ttt111tfffLfLfttfffffffttf\ntffft1tttfffft111ttttttt1tttt;................,::::,.:;;ii;,.........;ttt1111tt1tfffLLLfttfffftffttf\ntttttttttttttt111tttt1tt11ttti.................:::,...,;;i;,.........itttt11ttt11ffffffftttfftfffttt\ntttttttttttttt111ttttttt11tt1;.................:::,....,:;:,.........,1tt1111tt11ttttttt11tttttffttt\nttttt1tttttttt11ttttttttt1t11:.................:::,.... ..............:1111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfft11ti;,................,::,.........,......... :ttttt1111ttttttt111tttttfttt\n11tt11tttttttt11tttttttt1tt1iiii:..............::,,...................:1tttt111111tttttt111ttttttt1t\n11t1111tttttt1111111111t111iiiiii:.............,:,,,.................:1ttttt11111111111111111111t111\n11111111111111111111111t11i;;iiii;.............,:,,,........... .,;ttttttttt1111111111111111111111\n1111111111111111111111tt1t1i;;ii;,.............,,........... :i;;i1tttttttt1111111111111111111111111\n1111111111111111111111111ttti:,,...............,,,.......... :ttttttttttttttt1t111111111111111111111\n11111111111111111111111111111;::...............:;;::,........,i11ttttttttttttttt1111111111111tt11111\n111111111111111111111111111111t;...............:ii;;:,........;t1tttttttttttttttt1t1111111ttttt11111\n1111111111111111111111111111111:...............:;i;:::........:tttttttttttttttttttt1ttttt1ttttt11111\n1111111111111111111111111111111:............. ,;ii;;;:,..,,...:ttttttttttttttttttttttttttttttttt1111\n","ttfttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttttffLLttffffffftttttt1t111111111tfffffftttt1111111111111111ttffttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111ttttt\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLftttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttffttttt1111tt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffttttffffftttffftt11t111tt111ttfffLLftttftt1tt111tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttt11i;;;;i1tftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttffLLfftffttttti:::,,,,::;i1tffffffffttt111tft1tttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftfftttt11;,,,,,,,:,,,;tffffffffttt1111t11ttttttttttt1ttffffffLfffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttt1i;;;;iiiii:,:1tttfffffftt1111ttt1ttt1tfttt111tfffffLLfLfttt\nttfLfffffLLLLLLLLfftfLLftttfLfffLLLLttt1i1iiiii1111i::1111ttffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt11;;;iiiiiii:;ttt111tt111tt111tffttfftt11tfftttffLLLLLLLLffL\ntttffttffttfLftttttttttttttfLLLffLLftttt1i;;;iii;iii;ittfft11tt1111111tfftfffftttttttttttfLLLLffffff\nttffffffffftttfffffffffttfttfLLfffLfttt111;;;i111111iitfttt1tfftt11111tfttfffttt1tttttttttfLLftfttft\nttffffffffftttfffffffffttffttffftfftttttt1i;;iiiii1i1tft11tttttttt1111tt1tffttffttfffffLLfttftffffff\nttffffffffftttffffffffttttttttttfffttt1ttti;;;i111iitt111tfft11ttt111111t1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111tfffftttt111ii;iii;ii11111tfffft11111111tfft11tttt11tffffLLfftttfLLLLL\nttttttttfffttfffttttt1ttfft1111tffftttt1111;;;i;;;i111ttttffftt1111111tttt111tttt11ttfffffLftfLLLLLf\ntfttttttttttttttttt1ttfffftttt11tfft111tt1i;;;i;;i1i1;i11tffftt11t1111ttt11tt1tfftt11111ttfftfLffftt\ntfttffffftt11ttfffftttffffttfft11tft11ii;ii;;;;:;iii1,.,,,:;iii1ttt111tt111tt1ttfffftttttt11ttttfftt\nttttfffffftttffftfft11tfffttftttttt1;:,..:11;;i;;;;11:,,,.....,,:i1111tt111ttt1tffftttttfftt1ttffLLf\ntt1tffffftt1ttfffft1111tfttft1111i:,.....,i11iiiii1tt:.,..........:111111t11tt1tffft1tfffffft1fLffLf\ntftttffttttt11tttt1ttt11t11111;:,.........;i11i1111t;..............;t11111111t1tfttttttfffftt1tfffLf\ntfftttttttfftt1111ttfft111111:.............,::;ii;;:...............:111111ttt111ttffftttfft1tttttfft\nttttttttttttttt11ttttttt11tt1,..............::;;;;;,...............,1111tttttt11tffLffftttttfftttttt\ntfffftttffttttt11ttttttt11tfi,..............,::;;::,,...............i111ttttfftttffffffttttttttffttf\ntfffttttfffffft11ttttttt111ti................::::::,:;;::,..........it111ttffttttfffLfLfttfffffffttf\ntfffttttftffff111ttttttt1tt1;................,;::::.:iiiii,.........;11111ttt11ttfffLfLfttfffffffttf\ntffft1tttfffft111ttttttt11tti,................::::,.:ii;ii:.........;tttt1111ttttfffLLLfttfffftffttf\ntttttttttttttt111ttttttt1ttf1.................,:::,.,:;iii:.. ......:ttttt11tft11tfffffftttfftfffttt\ntttttttttttttt111ttttttt1ttt;::...............,:::,. .:;ii:..........;ttt1111tt11tttttft11tttttffttt\nttttt1tttttttt11ttttttttt1t111i;,..............:::,....,::,...........;1111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfftt1iiiiii:.............:::,.... ............. :ttttt1111ttttttt111ttttffttt\nt1ttt1tttttttt111ttttttttt1i;iiii;,............,:,,,................. ,1tttt111111tttttt111ttttttt1t\n11t1111tt1ttt11111111111111i;iii1i,............,::,,.................:1tttt11111111111111111111tt111\n11111111111111111111111111t1;;;;;,.............,:,,,.......... .:1tttttt111111111111111111111111\n1111111111111111111111111t11;,.................,:,,..........,;:::;1ttttttt1111111111111111111111111\n11111111111111111111111111111:..,..............,,............:ttttttttttttttttt111111111111111111111\n111111111111111111111111111111ii;..............,::,...........i111ttttttttttt11111t11111111111111111\n111111111111111111111111111111t;...............,;ii;::,.......:1ttttttttttttt11t1tt1111111ttttt11111\n111111111111111111111111111111i,...............:;ii;;;:,......,1ttttttttttttttttttt111111tttttt11111\n11111111111111111111111111111ti,...............:;ii;;;;:,..:..,1ttttttttttttttttttttttttttttttt11111\n","ttfttfffttttttffffttfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLttffffffffftttttt111111111tfffffftttt1111111111111111ttftttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLftttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttffftttt1111tt1ttffffffttttt1111t111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffftttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttfttttttttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttffLffftffttttt1ii::::;111tttffffffffttt111tft1tttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLfftffttttt1:,,,,,,,,:;ittffffffffttt1111t11ttttttttttt1ttffffffffffttt\ntttffttffLLLLLLLLLftffftfLftffffLLLftttti::,::::::,,,;ttttfffffftt1111tft1ttt1tffttt11tfffffLLfLfttt\nttfLffffffLLLLLLLfftfLLftttfLfffLLLfftt11iiiii111i;,,;t111tfffft111111ffft1tt11ttttt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiii1111i:,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\nttttftttttffLftttttttttttttfLLLffLLftttti;;;ii;iiii::1ttttt11tt1111111tfftfffftttttttttttfLLLLffffff\nttfLfffffffttffffffffffttfttfLLfffLfttt1i;;i1i;iiii:;tftttt1tfftt11111tfttfffttt1tttttttttfLLftftttt\nttffffffffftttffffffffftfffttffftffttttti;;iii111i1iitft11tttttttt1111tt11ffttffttfffffLLfttftfffffL\nttffffffffftttffffffffttttttttttfffttttti;;;ii1111ii1t111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111tfffftttt1i;;;iiiiii11111ttfffft11111111tfftt1tttt11tfffffLfftttfLLLLf\nttttttttfffttfffttttt1ttfft1111ttffttt111i;;ii;;;itt11ttttfffft1111111tttt111tttt11tttfffffftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tfft1t1t1i;;;ii;;it111ttttffftt11t1111ttt111t1tfftt11111ttfftfLffftt\ntfttffffftt11ttfffftttffffttfft1ttft11ii1;;;;i;:;i1;;i11tttft111tt1111tt111tt1tffffftttttt11ttttfftt\nttttfffffftttffftfft11tfffttftttt1i;:,,:1i;;;;i;;;1;.,,,;;i11111111111tt111ttt1tffftttttfftt1ttffLLf\n1tttffffftt1ttfffft111tffttft1ii:,.....,11iiiiiii1t:,,,.....,:;i111111111t11tt1tffft1tfffffft1fLffLf\ntftttffttttt11tttt1ttt11t11i;:,........,i1tt1ii11tt:,,,,........:t11111111111t1tfftttttfffftt1tfffLf\ntfftttttttfftt1111ttfftt11i,............::;;iiiii1;,,............it1111111ttt111ttffftttfft1tttttfft\nttttttttttttttt11ttttttt11;...............:;;;;:;;...............:111111tttttttttffLffftttttfftttttt\ntfffftttffttttt11ttttttt11:...............,;;;;;;:,..............,111111ttttfftttffffffttttttttffttf\ntfffttttfffffft11ttttttt11,...............,:;;;;:,...............,1111111ttffttttfffLfLfttfffffffttf\ntfffttttftffff111ttttttt11:...... ........:;;;;:,...............,11111111ttt1tttfffLfLfttfffffffttf\ntffft1tttfffft111ttttttt11:.......:;;;:....,;;::::.......,::,....,1tt11tt1111tt1tfffLLLfttfffftffttf\ntttttttttttttt111ttttttt11:.....:;;;;;:.....:;:::,.......,:iii;,.,1t1t11tt11tft1tffffffftttfftfffttt\ntttttttttttttt111ttttttt1i,.....:;:;;;:.....,::::,........;;iii;..;t1111t1111tt11tttttftt1tttttffttt\nttttt1tttttttt11tttttttt1i,.....:::;;;,......::::,.......,;;ii;:..,;1t11111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttttttti....,,,,:;;,.......,:::,,.......,;;;;,....,it11tttt1111ttttttt111ttttffttt\n11tt11tttttttt111ttttttt1:,,.,,,..,,,.........::::,........,:;,..... ,1tttttt11111ttttt1111ttttttt1t\n1111111tttttt11111111111i,,..,,,.... .........::::,..................itttt111111111111111111111tt111\n1111111111111111111111111,...,,...............,::,,,...........,,...;tttttt1111111111111111111111111\n11111111111111111111111111,..... .............,::,,,......... . .:1tttttt1111111111111111111111111\n1111111111111111111111111ti,,,.,,..............::,,..........,,,::i1tttttttttt1111111111111111111111\n11111111111111111111111111111i11;..............:,............,1tttttttttttttt11111111111111111111111\n1111111111111111111111111111111i...............:;:::::,.......;tttttttttttttt11t1ttt111111ttttt11111\n1111111111111111111111111111111:...............:iiii;;::,......ittttttttttttttttttttt1111tttttt11111\n1111111111111111111111111111111,...............:iiiii;;:,......,1tttttttttttttttttttttttttttttt11111\n","tttttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLftfffffffffttt1tt111111111tfffffftttt1111111111111111ttftttftttttttt11111tttt\nttttttttttttttttfffffftttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1tffffftttffftt11t111tt111ttfffLLffttfft1tt111tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttfLLffftfftttttftttttttffttttffffffffftt111tftttttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftffttttttiii;::::i1ttttffffffffftt1111t11ttttttttttttttffffffffffttt\ntttffttffLLLLLLLLLftffftfLfttfffLLLfttt11:,,,,,,,:::itttttfffffft11111tft1ttt1tffttt11tfffffLLfLfttt\ntffLffffffLLLLLLLfftfLLftttfLfffLLLLfttt1i::::,,::,,,itt11tfffft111111ffft1tt11tt1tt1ttffLLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttttiiiiii1i;:,,:ttt111ttt11tt111tffttfftt1ttfftttffLLLLLLLLffL\nttttftttttffLftttttttttttttfLLLffLLftttti;iiii111i;:,iftftt11ttt11111tffftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttfttfLLfffLfttt1;;;ii;iiii;::1ffttt1tffft11111ffttfffttt11ttttttttfLfftftttt\nttffffffffftttffffffffftfffttffftfftttt1;;i1i;;iii;:itft11tttttfttt111tt1tffttffttfffffLLftfftfffffL\nttffffffffftttffffffffttttttttttffftttt1;;iiii111iii1t111tfft1tttt111111t1ttttfftttfffffLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111ttffftttti;;iiiiiiiii1111ttfffft11111111tffttttttt11tfffffLfftttfLLLLL\nttttttttfffttfffttttt1ttfft1111ttfftttt1;;;iiii;;itt11tffffffft1111111tttt111tftt11tttfffffftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tfftttt1i;;;;ii;;it1111tftfffft11t1111ttt111t1tfftt11111ttfftfLffftt\ntfttfffffttt1ttfffftttffftttfft11tft111i;;;;;ii;;i111111tttft111tt1111ttt11tt1tffffftttttt11ttttffft\nttttfffffftttffftfft11tfffttfttt11i;;:ii;;;;iiiii1;11tt111t11111tt1111tt111tft1tffffttfffftt11tffLLf\n1tttffffft11ttfffft1111tfttftii;:,....;1i;;;;ii111,,:;i1tt11tt11111111111t11tt1tffft1tfffffft1fLffLf\ntftttffttttt11ttt11ttt1111i;:,.......,i1tiiii;;11i,,,..,:;i1t1t111t1111111111t1tfftttttfffftt1tfffLf\ntfftttttttffttt111ttttt1i:...........,ii111iii11i:.,,......,:;1t111111111tttt111ttfLftttfftttttttfft\nttttttttttttttt11tttt11t;..............,::;;i1ti:,............,1t1111111tttffttttffLfffttttffffttttt\ntfffttttfftfttt11tttttt1,...............:;:;;;;;:..............;tt111111tttffftttffffffftttttttffttf\ntfffttttfffffft11tttttt1................,;;;;;;;:..............:t11111111ttffttttffLLfLfttfffffffttf\ntfffttttfttftt111tttttti............... .:;;;;;:,..............:1111111111tttttttffLLfLfttfffffffttf\ntffft1ttttttft111tttttt;............. .:;;;;;;:::..............:111tt11tt111ttt1tfffLLLfttfffftffttf\ntttttttttttttt111ttttt1,..............:;i;;i;::::..............:1ttt1111tt11tff1tffffffftttfftfffttt\nttttttttttt1tt111ttttt;..............:;;;;;i:::::..............;1111111111111tt11tttttftt1tttttffttt\nttttt1tttttttt11tttttt:..............:;;;::;:::::..............;t1111111111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttt1,........... .,,:,...,:::::..............,11i;;i111tttt1111ttttttt111ttttffttt\n11tt11ttttttt1111tttt;............,..... ...,::::...............:i;:;;i1ttttt11111tttttt111ttttttt1t\n11111111t1tt111111111,............,.........,::::,..............,:::;ii1tt111111111111111111111tt111\n111111111111111111111,............ .........,,,::,..............::::;i11tt11111111111111111111111111\n1111111111111111111111:....... .............,,:,,..............,::::i111t11111111111111111111111111\n11111111111111111111111:....,,,,.............,:::,,..................,1t1111111111111111111111111111\n111111111111111111111111iiii11t; .............,:,..,........ ..:1tttttt11111111111111111111111\n111111111111111111111111111111t:...............:,,,:,,......,,,,,:;;1tttttttt1t111tt1111111tttt11111\n111111111111111111111111111111t: .............::;ii;::,.....,i111ttttttttttttttt11ttt111111tttt11111\n111111111111111111111111111111t:..............:;;iiii;:,.....,i1ttttttttttttttttttttttttttttttt11111\n","tttttfttttttttffffffffffffftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLftfffffffffttt1tt111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\nttttttttttttttttffffLftttfffffffLLLfttttttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffffttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLffftfftttttfftffffffftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftfftttttt1iii::;i1ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\nttttfttfLLLLLLLLLLfftfftfLfttfffLLLfttt11:,::,,,,,:;1tttttfffffftt1111tft1ttt1tffttt11tfffffLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLLffLLLffttt1;:,,,,,,,,,;ttt11tfffft111111ffft1tt11ttttt1ttffLLLLLLLLfff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiiiiii;:,,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\nttttftttttffLftttttttttttttfLLLffLLfttt1i;iii1111i:,:1ftfft11ttt111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttfLfffLfttt1;;;i;iii1i:,;tffttt1tffft11111tfttfffttt11ttttttttfLLftfttft\nttffffffffftttffffffffftffftttfffffttt11;;;ii;;iii::1fft11tttttfttt111tt1tffttffttfffffLLffffffffffL\nttffffffffftttffffffffttttttttttfffttt1i;;iiiii11i;itt111tfft1tttt111111t1ttttfftttffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111ttfffttt1i;;iiiiiiiii1111ttfffft11t11111tffttttttt11ttffffLfftttfLLLLL\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;;1t11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tfftt111;;iiiii;;;1111ttftfffft11t1111tttt1tt1tffttt1111ttfftfLffftt\ntfttfffffttt1ttftfftttffftttfft11tft1i1i;;;;iii;;;111111tttft111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffftttt11tfftttfttt11i;;;1;;;;;iiii;i1t11t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\n1t1tffffft11ttffttt1111tftttti;:,,...:1i;;;;iiii1i:;i1ttt111tt11111111111t11tt1tffft1tffffffttfLffLf\ntftttfftt11t11ttt11ttt111i;:,,.......:11ii;;ii;11i,.,,:;11tt11tt11t1111111111t1tffttttffffftt1tfffLf\ntffttttttttftt1111ttttt1:............:1111iiii1ti;,,....,,;i1tttt11111111tttt111ttfLffttfftttttttfft\nttttttttttttttt111ttt1t;...............,:;;i1tt1;,..........,itttt111111tttttttttffLfffttttffffttttf\ntfffttttfftfttt11ttttt1,................:::::;i;:,...........,1ttt111111ttttfftttffffffftttttttffttf\ntffft1ttffffff111ttttti.................,;;;;;;;:,...........,1t111111111ttffttttffLLfLfttfffffffttf\ntffft1ttfttttt111ttttti................,,;;;;;;::,............it1111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttt;.............:;iii;;:;;:::,............it1111111tt111tttttfffLLLfttfffftffttf\nttttt1tttttttt111tttti,............,;;iiii::;::::,...........,1ttttt111ttt11tft1tfffffLftttfftfffttt\nttttt1tttt11tt111ttt1:.............:;;;iii;::::::............,1tttt1111111111tt1tttfttftt1tttttffttt\nttttt1tttttttt11tttti..............,;;;;:,,:::,,:............:tt11t11111111111t11ttttttt11tttttffttt\n1tttt1tttttttt11tttt:............. ,::,. .::,,,:........... :t1111111t111ttt1111ttttttt111ttttffttt\n11tt11tttttt111111ti.......................,:::::.............it111t11111tttt1111tttttt1111ttttttt1t\n1111111111111111111,.............,.........,:::::.............:1t11ii;:;11111111111111111111111tt111\n1111111111111111111:........................,,:::..............;ii;:;:;ii111111111111111111111111111\n11111111111111111111:....... ..............,,,:,...............,:::::;i1111111111111111111111111111\n111111111111111111111:......,,..............,,,:,...............:::;::;i11t1111111111111111111111111\n1111111111111111111111iiiiii1;...............,,,,.,..............,::::;11111111111111111111111111111\n11111111111111111111111111111;................,,:,,,...... .it1111111111111111111111111111\n1111111111111111111111111111t;...............;i;;;::,.....,,.....,,,;i1ttttttttt11tt111111ttttt11111\n1111111111111111111111111111t;...............:i;;i;::,....:i111111tttttttttttttttttttttttttttttt1111\n","tttttfttttttttffffftfffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLftfffffffftttt1t1111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\nttttttttttttttttffffLftttfffffffLLfftt1tttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\nttttttttttttffffttfffttffffffffftttftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfffttttt1tfffft1ttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLftttttttfffffftttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLffftffttttt111i;iitfftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftfftttt1;:,::,,,:;ittttffffffffftt1111t11ttttttttttttttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttfffLLLftt1i:,,,,,,,,,,:1tttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLLffLLLftt1i;;;;;;;i;:,:tftt11tfffft11111tffft1tt11ttttt1ttfffLLLLLLLfff\ntfffffttttfLLLffttttfffffttLLLLfLLLft1;iiiii11111i::tffft11tttt11t111tfffttfftt1ttfftttffLLLLLLLLffL\ntttfftttttffLftttttttttttttfLLLffLLftt11;;;iiiiiii:;tffffft11tt1111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttLLfffLft11i;;;;i;;iii;tffffttt1tffft11111tfttfffttt1tttttttttfLLftffttt\nttffffffffftttffffffffftffffttfftfttt11i;;;i1iii1iitffft11tttttfft1111tt1tffttffttfffffLLfffftfLffLL\nttffffffffftttffffffffttttttttttffftt11i;;;iii111ii1tt111tfft1ttft111111t1ttttfftttffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111ttffftttti;;;;iiiiii11111ttfffft11t11111tfftttttttt1tfffffLLftttfLLLLf\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;itt11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\ntftttttttttttt1tttt11tfffft1tt11tfft111;;;;;iii;;it111ttfffffft11t1111tttt1tt1tffftt1111ttfftfLffftt\ntfttffffftt11ttftfftttffftttfft11tti;;1;;;:;iii::i111111ttfft111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffftttt11tfftttft1i;:,..,1i;;;;iii;i;:;;1t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\n1tttffffft11ttffftt1111tt1ii:,,......,i1i;;;ii;11;...,:;i111tt11111111111t11tf1tfffttfffffffttfLffLf\ntfttttftt11t11ttt11ttt11;,,..........,11t1iiii1t1:,,.....,:i111111t1111111111t1tffttttffffttt1tfffLf\ntffttttttttfttt111ttttti,.............:;;iii11t1i,,.........,ittt11111111tttt11tttfLffttffttttttffft\nttttttttttttttt111tttt1:................:;;;;;i;:,...........:ttt1111111tttffttttffLLffttttffftttttf\ntfffttttftttttt11ttttti.................,;;;ii;;:............,1ttt11111ttttffftttffffffttttttttffttf\ntffft1ttfffftf111ttttti..................:;;;i;;:,...........,1tt11111111ttffttttffLLfLfttfffffffttf\ntffft1ttfttttt111ttttt;..................,;;;;;::,...........,1t1111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttt;...........,,.....,;;:;:::............,111111111tt111tttttfffLLLfttfffftffttf\nttttt1tttttttt111tttti,........,;ii:......:;:::::............,ittttt111ttt11tft1tfffffLftttfftfffttt\nttttt1tttt111t111tttt;........:;;;;:,.....,;:::::.............ittttt1111t1111tt1ttfttttttttttttffttt\nttttt1tttttttt11tttt1,.......,:::;;;,......::::::.............;tt1t1111111ttt1tttfttttttt1tttttffttt\n1tttt1tttttttt11tttti.........,:::;:.......,:::::..........,,:;1t11111111ttff1111ttttttt111ttttffttt\n111111tttttt111111t1,..........,:::........,:::::..........,:;;i1111t111ttttt11111ttttt1111ttttttt1t\n1111111111111111111;............,,.........,::::,.........,:;;;i1111111111111111111111111111111tt111\n11111111111111111111:.......................,:::,.. ......,:;;ii111111111111111111111111111111111111\n111111111111111111111:.......,..............,:::,..........,::i11t1111111111111111111111111111111111\n1111111111111111111111:,,..,, ..............,,,::,............,1111111111111111111111111111111111111\n1111111111111111111111111i11:...............,..,:,,..... ..:1t11111111111111111111111111111111111\n111111111111111111111111111;................,::::,,.....::::;i11tttt111111t1111111111111111111111111\n111111111111111111111111111,.................ii;;::,....:1tttt1ttttttttttttttttt11tt111111ttttt11111\n1111111111111111111111111ti..................;i;;;:,.....;t1ttttttttttttttttttttt1ttttttttttttt11111\n","ttffftfffttttttttftttfffttftttttttttt111tttt111111tttttttt111tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLLftfffffffftttt1t111t111t11tfffffftttt111111111111111tttftttfttttttttt1111tttt\nttttttttttttttttffffLftttfffffffLLffttttttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111tttt1\nttttttttttttttftfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttffffttfffttffffffffftttfttttt1111tt1ttffffffttttt1111tt11111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttffftttt11tttffttttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLftt11ii;i;;ii1tttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLffftfftt1:,,,,,,,,:iftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftff1i;;:,,,,,,,,:;ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttfffLLLt;,,:;;;;;iiii:ittttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLLffLLLfi,:iiii111111;1ffftt11tfffft11111tffftt1t1tttttt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfffffi:;;;;;iiiiiiitffffft11tttt11t111tfffttffft1ttfftttffLLLLLLLLffL\ntttfftttttfffftttttttttttttfLLLffLLti;;;;;i;;iiii1ftffffftt11tt1111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttfLfffLtii;;;ii;;i1111tfffffttt1tffft11111tfttffftttttttttttttfLLfffffft\nttffffffffftttffffffffftffffttfftftt1ii;;;;;;iii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\nttffffffffftttffffffffttttttttttffftt11i;;;;;i111111tt111tfft1ttft11111tt1ttttfftttffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt1111tfffttti;;;;;;iiiii11111ttfffft11t11111tfftttttttt1ttfffLLLftttfLLLLf\nttttttttfffttfffttttt1ttfft11111tfft11i;;;:;;ii;;itt11ttfffffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntftttttttttttt1tttt11ttffft1tt11ttti::i;;;:;iii;;;i;i1ttftfffft1tt1111tttt1tt1tffftt1111tffftfLffftt\ntfttffffftt11ttftfft1tffftttff1i;:,...;1;;;;;i;:;i,..,:;i1tft111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffftttt11tfft11i;:,......,11;iii;;iii,,,....,:;i1111t1111tt111tft1fffffttfffftt11tffLLf\n1tttffffft11ttffftt1111t1;;,..........,i1t11ii11i:.,........,111111111111t11tt1tfffttfffffffttfLffLf\ntfttttftt11t11ttt11ttt11:..............;iiiiiii11,,,......,,,itt11t1111111111t1tffttttffffftt1tfffLf\ntffttttttttfttt111ttttt;................,;;;i;;ii,...........;ttt11111111ttt111tttfLffttfft1ttttffft\nttttttttttttttt111ttt11:.................:;;;i;::............;ttt1111111tttftttttffLLffttttffffttttf\ntfffttttftttttt11ttttt1,.................,;;;;;;:............:ttttt11111tttffftttffffffftttttttffttf\ntffft1ttfffftf111ttttt1,..................:;;;:::............:1tt11111111ttffttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttti...................,;;::::............,111111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttt:...................,::::::,:::,.......,1t1t11111tt111tttttfffLLLfttfffftffttf\nttttt1tttttttt111tttt1,....................,::::::;;;ii:......ittt11111ttt1ttff1tfffffLftttfftfffttt\nttttt1ttttt11t111tttti.....................,:::::,;;;ii;,.....itttt1111tt111tttttttttttttttttttffttt\nttttt1tttttttt11ttttt;........ .............:::::,;;;ii;,.....:1t1t1111111tttttttfttttttt1tttttffttt\n1tttt1tttttttt11ttttt:.... :i;:.............:::::..,;;i:.......it11111111ttff1111tfttttt11tttttffttt\n11tt11tttttt1111111t1,...,;iiii;, ..........::::,. .,:,......;111111111ttttt1111ttttttt111ttttttt1t\n11111111111111111111i..,.,;;;iii;...........:::::.......,....itt1111111111111111111111111111111tt111\n11t111111111111111111;....::;;ii;...........::::,..........,;111111111111111111111111111111111111111\n1111111111111111111111, ...,:;;;,............,,:,.....,,:;11tt11111111111111111111111111111111111111\n1111111111111111111111i:,....... ............,,:,.....:1tttttt11111111111111111111111111111111111111\n1111111111111111111111111;.,. ..............;;;:,,....,it11ttt11111111111t11111111111111111111111111\n111111111111111111111111i,..................;ii;:,.....,1t1ttttt1111111111t1111111111111111111111111\n111111111111111111111111:...................;ii;;:......;ttttttttttt11tttt1t111111tt11111111ttt11111\n111111111111111111111111:...................:i;:;;,.....:t1tttttttttttttttttttttt1tttttttttttttt1111\n","ttffftfffttttttttttttfffttftt111ttttt111tttt111111ttttttttt11tttt111111ttttttttttttttttttttt111111tt\nttfftttttttttttttttffLLftfffffffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\nttttttttttttttttffffLftttfffffffLLfft111ttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\nttttttttttttfffftttffttffffffffftttftt1t1iii11111tfffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttffft11i:,,,::::;1tfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfft1;:,,,,,,,,,:tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffLfftt1::,,,,,:::::;itfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\ntttttttfLLLLLLLLLLfttttffftffffttf1,,,,:;iii1111itftttfffffffffftt1111t11ttffttttttttttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttffffft:,,,:;iii111ii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLfffLft:,,:;;;;iiiiii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttfLLfffft;:::;;;iii;iii1tffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\ntttfftttttfffftttttttttttttfLLLffffti;;;i;;iii;iitfffffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttfLftfft1i;;;;;iiiii11ffffftttt1tffft11111tfttffftttttttttttttfLLffffftt\nttffffffffftttfffffffftttfftttftttttt1;;;;;iiiii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\nttffffffffftttffffffffttttttttttfftt11i;;;;;;ii1111ttt111tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\ntttffffffffttfffffffft11ttt1111ttff1;i;;;;;;;ii;iiii111ttfffft11t11111tfftttttttt1tffffLLLftttfLLLLf\nttttttttfffttffftt1tt1tttft1111tt1;,.:i;;;;;iii::;;,,:;i1tfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntfttttttttttttttttt11ttffft1tti;:,...,ii;;;;ii;::;;.....,:itftt1tt1111tttt1tt1tffftt1111tffftfLffftt\ntfttffffftt11ttftfft1tttft1i;:,.......:11iiii;;;:;:,,,,,,..;t111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffttttt11tti;:,..........,1tt1ii11i;;,,.,.,,,,,1111t11111tt111tft1tffffttfffftt11tffLLf\n1tttffffft11ttttttt1111;...............:11iiii;;1;.,.,,.,..,1t11111111111t11tf1tfffttfffffffttfLffLf\ntfttttftt11t11ttt111tt1,................,;;;ii;i1:.........,111t1111111111111t1tffttttffffftt1tfffLf\ntffttttttttftt11111ttt;..................:;;;;:;i:..........itttt11111111ttt111tttfLffttfft1tttttfft\ntttttttttttttt1111ttt1:..................,;;;;:::,..,.......;tttt1111111tttffttttffLLffttttffftttttf\ntfffttttftttttt11tttt;....................:;;::::,,.........:ttttt111111ttttfftttffffffftttttttffttf\ntffft1ttfftttt111tttt:....................,;:::,:;;;;:,.....:1ttt11111111ttffttttffLLfLfttfffffffttf\ntffft1ttfttttt111ttt1,.....................:::,,::;iii;,.....itt1111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttt;......................,::,,::;;;i;,.....:111111111tt111tttttfffLLLfttfffftffttf\nttttt11ttttttt111tt1:......................,:,..:,:;;i;.......:tttt1111ttt1ttffttffffffftttfftfffttt\nttttt1ttttt111111tt1:......................,:,..:. .:;:......,itttt1111tt111ttttttfttffft1tftttffttt\nttttt1tttttttt111tt1:........... .........,,,.,:...........,1tt11tt111111ttt1ttttffftttt1tftttffttt\nttttt1tttttttt11ttti,......... .,..........,,,.,:..........,it11111111111ttft1111ttttttt11tttttffttt\n11tt11ttttt111111tt:..........,::;,........,,,.,:......,:i11t11111111111ttttt1111ttttttt111ttttttt1t\n11111111111111111111:........:;;ii;.........,,.,,.....i1ttt11t11t111111111111111111111111111111tt111\n1111111111111111111ti........,:;;i;,...........,,.....;t11111111111111111111111111111111111111111111\n11111111111111111111ti;,......,:;;;. ......,:,.,:.....,1t1t11111111111111111111111111111111111111111\n11111111111111111111111;........,,,........:;::,,......;t1tttt11111111111111111111111111111111111111\n1111111111111111111111i......... ........:;;::,......,1ttttt11111111111t11111111111111111111111111\n1111111111111111111111:........ ...........:;;;::.......it1ttttt1111111111t1111111111111111111111111\n111111111111111111111i,........,......... ,ii;;::,......:ttttttttttt11ttt1tt11t111tt111111t1tttt1111\n11111111111111111111t;.........,..........:iiii;::,.....,1ttttttttttttttt1ttt1ttt1tttttttttttttt1111\n","ttttftfffttttttttttttfffttttt111ttttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLLftffftfffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\nttttttttttttttttfffffftttfffffffLLLft111tttttt11tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\nttttttttttttttttfffffttfffffffffffft11111;:::;;i1tffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\nttttttttttttfffftttffttffffffffftttft1;::,,,,,,,,ifffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttff1;:,,,,,,,,,,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffttt1:,,,,:::;;i;;1tttftttffffffftt1111tftt111tttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffLfftt;,,,,,:;ii11t11tfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\ntttttttfLLLLLLLLLLfttttffffffffttt;,,,,:;;;iii1111ttttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttttfft:,,,,:;;;iiiiii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfffftttfLftfLfi;;;;;;;iii1iii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttfLLftfffi;;;i;;;;iiiii1fffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\ntttfftttttffffttttttttttttttffftffft;;;;;;;;iiii1tttfffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\nttffffffffftttfffffffffttftttffftfft1;;;;;;;;iii1ttfffffttt1tffft11111tfttfLftttttttttttttfLLftffftt\nttffffffffftttfffffffftttfftttftttt1i;;;;;;;;ii111tffftt11tttttfftt111tt1tffttffttfffffLLffffffLffLL\nttffffffffttttfffffffft1tt1111ttt1::i;;;;;;;i1i;i111ttt11tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\ntttffffffffttffffffftt111tt111i;:,..;i;;i;iii11;;;;,::;1tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\nttttttttfffttffttttt111ttt1;:,......,ii;;iii;11;:;;,...,:1fffft1111111ttftt1ttfft11ttffffffftfLLLLLf\ntftttttttttttt11tt111tt1;:,..........;11iii;1t1;:;;,,,,,.:tfttt1tt1111tttt1tt1tffftt1111ttfftfLffftt\ntfttffffftt11tttttt111:..............:1tt1ii11i::;:,,,,,,,if1111tt1111ttt11tf1tfffffttttttttttttffft\n111tfffffft1tfftttt11;................:ii;;i;:,,;;,.,,.,..it1111111111tt111tft1tffffttfffftt1ttffLLf\n1tttffffft111tttttt1i,............,....:;;;;;;:,1i,..,,,..;ttt11111111111t11tt1tfffttfffffffttfLfLLL\ntfttttftt1t111ttt111;..................,;;;;;:,:1i,.......it111t11t1111111111t1tffttttffffftt1tffLLf\ntffttttttttft1111111,...................:;;;::,,;;,.......it1tttt11111111ttt111tttfLffttfft1tttttfft\ntttttttttttttt1111t;....................,;;:::,.:,..,.....:tttttt1111111tttffttttffLLffttttffffttttf\ntfffttttfttttt111t1,.....................;;:::..:,........,1tttttt111111ttttfftttffffffftttttttffttf\ntffft1ttfftttt111ti......................::::,..:,.....,:::i1ttt111111111ttffttttffLLfLfttfffffffttf\nttfft1tttttttt111t:......................,:::,..:,....,:;iiiitt11111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt1111;.......................,:,...:,....:;;iiii1111111111tt111tftttfffLLLfttfffftffttf\nttttt11ttttttt111t;...................,,,,,,,...,......,;;ii1111ttt1111ttt1tfffttffffffftttfftfffttt\nttttt11tt11111111i,.................,::::::,....:........,,:i1111tt1111tt111ttttttfffffft1tftttffttt\nttttt11ttttttt11t;.................,:;;;;;;,....:.... .. .,1t11ttt1111111ttt1ttttffffttt1tftttffttt\nttttt11ttttttt1111:................,::::;i:.....:.,..,,,:;i11tttt111111111tft1111ttttttt11tttttffttt\n111tt11ttt1111111t1:. ............::::;:.....,:....it11111tt1tt1111111ttttt1111ttttttt111ttttttt1t\n11111111111111111111i:,..............,,,,......,:....:1tt111111t1111111111111111111111111111111tt111\n11111111111111111111t11:........,.... . ..,....:.....it1t111t11111111111111111111111111111111111111\n11111111111111111111111:,..................:....:.....:1ttt11t11t11111111111111111111111111111111111\n1111111111111111111111i,...................:....:......it1ttttt1tt11111111111t1111111111111111111111\n1111111111111111111111;....................,,..,:,.....:tttttttt111111111111111111111111111111111111\n1111111111111111111111:.................. .::..,:......,1t1ttttt11t1t11111t1111111111111111111111111\n11111111111111111111ti,.................. ,;::,,:.......itttttttttttt111t1tt11t111tt111tttt1tttt1111\n11111111111111111111t;....................,;;;:,:.......:tttttttttttttttt1ttt1ttt1tttttttttttttt1111\n","tttttttttttttttttttttffftttt1111111tt1111tt1111111ttttttttt11tttt1111111ttttttttttttttttttt1111111tt\nttfttttttttttttttttffLfttffttfffttttt1111111111111tffffftttt111111111111111tttffttftttttttt11111tttt\nttttttttttttttttffffLftttfffffffffftt11111iii1i11ffffffffttttttt111111tttttffffftfLLfttttttt111ttttt\nttttttttttttttttffffftttffffffffffttt11;::,,,,,:;1ffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffttttt1;:,,,,,,,,,,:tffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLfttttttft;,,,,,,,,:::,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffttt;,,,,,,:;ii1111tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffffft1:,,,,,:;iii11111fttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLLLLLLLLLffttttffftfffftt1:,,,,,:;;;iiiii1ftttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\ntttffttfLLLLLLLLLLfttfttffftttttft::;;::;;iiiiiii1ttttttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\nttffffffffLLLLLLffftfffttttffftfLfi:;i;;;;;iiiiii1tffftt11tfffft111111ffftt1tt1tt1tttttfffLLLLLLffff\ntffftfttttfLLLfftttttffffttfLLftfff;:;;;;;;;iiiii1tffffftt1tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\ntttttttttttfffttttttttttttttffffffft;;;;;;;;iiii1ttffffffft1ttt1111111tfftfffftttttttttttfLLLLffffff\nttffffffffftttfffffffffttft1tfffttt1i;;;;;;;;iii1ttfffftttt1tffft11111tfttffftttttttttttttfLLfffffft\nttffffffffftttfffffffftttffttttti::i;;;i;;;;ii1111tttttt11tttttfftt111tt1tffttffttfffffLLffffffLLfLL\nttffffffffttttfffffffft1ttt11i;:,.,ii;;iiiii11:i1111tt111tfft1ttft11111tt1ttttffttttfffLLLfttfLLLLLL\ntttffffffffttffffffftt111i;:,......:11;;iiiii1::;;;::;i1ttffft11t11111tfftttttttt1ttffffLfftttLLLLLf\nttttttttfffttfttt1111ii;:,.........,it1iii;;1ti::;;,..,:1tfffft1111111ttttt11tfft11ttffffffftfLLLLLf\ntfttttttttt1tt111111;,..............;1111ii1ti:;:;;,,,,.:tffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\ntfttfffftt1111ttttti,................:;;;i;;;,,:;;:,,,,,,itt1111tt1111ttt11tf1tffffftttttt1tttttffft\n111tfffffft1ttttttt:..........,,......:;;;;;;,.,i;,,,,,,.;t111111111111t111tft1tffffttfffftt1ttffLLf\n111ttfffft111ttttt1,............,.....,;;;;;:,.:1i,......;11t111111111111t11tt1tfffttfffffffttfLfLLL\ntttt1tftt11111tt11;....................:;;;;:,.:1i,......:tt11111111111111111t1tffttttffffftt1tffLLf\nttft11ttttttt1111i,....................,:;:;:.,,;:,......:111tttt11111111tttt11tttfLffttfft1tttttfft\ntttttt1ttttttt111;......................,;:;:..,:,.......:11tttttt111111tttffttttffLLffttttffffttttf\ntffft11ttttttt11i,.......................:::,..,:,.......,1tttttttt11111ttttfftttffffffftttftttffttf\ntffft11ttttttt11;........................,:::,..:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt11;......................,:;;;;;;,:,........,111tt1111111111tttttttffLLfLfttfffffffttf\ntfttt11ttttttt11i.....................:::;;;;;:.:,....... ,1t11111111111t111tftttfffLLLfttfffftffttf\ntttt111ttttttt11:....................,:::;;;;;.,:,..........,:;iii11111ttt11tffttffffffftttfftfffttt\nttttt11tt1111111,....................,:::;;;;,.,:.......... .::;;;;ii11111ttftttftfffft1tftttffttt\nttttt11ttttttt11i................. ....,,,,.....:.... ........,:::;;;;ii111tt1tttfffffttt1tftttffttt\nttttt11ttttttt11ti,. .........,... .. ....,..:,.. ....,:::;;;iii1ttt1111ttttttt11tttttffttt\n11111111ttt111111t1ii;;;,.......................:..,.:1;:,,.. ..,;i1i1t1ttt1111ttttttt111ttttttt1t\n1111111111111111111ttttt:,......................:.. ,tttt111i;;;;i1tt1111111111111111111111111tt111\n111111111111111111111111:,..................,...:.....it1t1ttttttttt11111111111111111111111111111111\n111111111111111111111111;,..................,...:.... ;tttt11t11t11111111111111111111111111111111111\n111111111111111111111111:...................,..,:.....:ttttttttttt1111111111111111111111111111111111\n11111111111111111111111i,...................:,.,:.....,1ttttttttt11111111111111111111111111111111111\n11111111111111111111111;...................,::..:.....,1ttttttttt1t11t1111t1111111111111111111111111\n11111111111111111111111:.................. :;:,,:......itttttttttttttt111ttt11t1111t111t1ttttttt1111\n111111111111111111111t1:.................. :;;:::......;ttttttttttttttttt1ttt1ttt11ttttttttttttt1111\n","tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\ntttttttttttttttttffffftttffffffffffft111tt111111ttffffffttttttttt11111tttttffffftfLLftttttt11111ttt1\nttttttttttttttttffffftttffffffLffftt111i;;:::::;1tffffffffttttttt11111tfffffffLfftfffffftttt111ttttt\nttttttttttttfffftttffttffffffffttttt1i;,,,,,,,,,,;fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLftttttttti:,,,,,,,,,,,,;tfffftttfffft11t111tt111tttffLLfttfftt1tt111tttttt\nttttttttffLLLLLLLffttfLLffttfffttti,,,,,,:;;;ii;itttttttffffffftt1111tftt1tttttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffffft1:,,,,::;i111tt1tfttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLfLLLLLLLLfttttffftfffftti,,,,,,:;;iiii1i1ftttfffffffffft11111t11ttftttttttttttfffffLLfLfttt\ntttffttfLLLLLLLLLLfttfttffftttttf1,,::,:;iiiiiiii1ttttttttfffffftt1111tft1ttt1ttfttt11tffffLLLLLfttt\nttfffftfffLLLLLfffftfffttttffftfLf;:ii;;;;iii11ii1tfffft11tfffft111111ffft11t1ttt1tt1tffffLLLLLLLfff\ntffftfttttfLLLfttttttffffttfLLftff1:;ii;;;;iiiiii1ffffftt11tttt1ttt111fffttfffttttfft1tffLLLLLLLLffL\ntttttttttttfffttttttttttttttfffffff1;;;;;;;iiiii1tffffffftt1ttt1111111tfftfffftttttttttttfLLLLffffff\nttffffffffftttffffffffftttt1tffftft1i;;;;;;;iiii1ttfffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\nttffffffffttttfffffffft1tftt1tft1;ii;;;;;;;;ii1111ttftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\nttffffffffttttfffffffft1tttt1ii;,.:i;;;i;iii111t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffftfttt111ii;:,....,i1;;iiiii1i:;;;i11111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\ntttttttttffttfttt1111ii;:,.........;11iiii;;11;::;;,:;1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntft1ttttttt1t1111111:,.............:1tt1iii1t1;;:;:,,.,:1tffftt11t1111ttt11tt1tffftt1111ttfftfLLfftt\ntttttffttt1111ttttt;................:iiiiii11,:;:;:,,,,.:tttt111tt1111ttt11tf1tffffftttttt1ttttttfft\n1tttfffffft1tftttt1,.................,;;;;:;:.,:i:,,,,,,,it11111111111tt111tft1tffffttfffftt11tffLLf\n111ttfffft111ttttti...................:;;;;;:,,:1;.......;t1tt11111111111t11tf1tfffttfffffffttfLfLLf\ntttt1tftt11111ttt1:...................,;:;;;:..;1;.......:tt111t11t1111111111t1tffttttffffftt11ffLLf\nttft1111ttttt1111;.....................:;:;;,..,;:.......,111tttt11111111tttt11tttfLffttfft1tt1tffft\n1tttt11ttttttt111,.....................,::;;,..,:,.......,1ttttttt111111tttffttttffLLffttttffffttttf\ntfftt11ttttttt11;.......................:::;,..,:,........itttttttt1111tttttfftttffffffftttftttffttf\nttfft11ttttttt11,.......................,;;;;:,,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt1i,.....................,::;i;;;,,:.........:111tt1111111111tttttttffLLfLfttfffffffttf\nttttt11ttttttt1i.....................,:::;i;i:.,:,........,1t1111t111111t111ttfttffLLLLfttfffttffttf\ntttt111ttt11t11;.....................,:::;;;;,.,:..........1tt111tt11111ttt1tffttffffffftttffftffttt\nttttt11t1111111:......................:::::,...,:..........:i1tttt1tt111t1111tttttfttffft1tttttffttt\nttttt11tttt11t1i.......................... ....,,.......... .,,:i11iii11111tt1t1ttffffttt1ttttttfttt\nttttt11tttttt111;... ......................,:............ .,:::;iiii1111111tfttttt11ttttttfttt\n11111111t1111111t1i;;::::......................,:..,:.. .......,::;;;;;;iii11111tttttt111ttttttt1t\n11111111111111111ttttttt1,.....................,:......:,.. ..,:;;;:;;;iiii11111111111111111tt111\n111111111111111111111111i,.................,::..,.... ,tt1ii;,,.. ..,:i;;iii111111111111111111111111\n111111111111111111111111i,.................,;:,,,......1tttttt11i;;::itt11t1111111111111111111111111\n111111111111111111111111i,................ ,;:::,......it1t1tttttttttt11tt11t111111111111111111t1111\n111111111111111111111111;................. ,;;::,......it1tttttttt1111111t11111111111111111111111111\n111111111111111111111111:................. .;;:::......;t1ttttttt1ttttt111t1111111111111111111111111\n111111111111111111111111,...................;i;::,.....;tt1ttttttttttt11tttttttt111t111111tttttt1111\n111111111111111111111111:...................:i;:::.....ittttttttttttttttttttt1ttt111tttttttttttt1111\n","tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\ntttttttttttttttttffffftttffffffffffft1111tttt111ttffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttffffftttffffffLffftt11111i;iiii1tfffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffttttt11;::,,,,,,::1fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLftttttttf1;:,,,,,,,,,,,itfffftttfffft11t111tt111tttffLLfttfftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLffttfffttt1,,,,,,,::::::itttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffLfft1:,,,,,:;ii11111ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLfLLLLLLLLfttttffftfffftt1:,,,,:;;iii1111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfLLLLLLLLLLfttfttffftttttf1,,,,,:;iiii;iii1ttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\nttfffftfffLLLLLfffftfffttttffftfLt:;;;:;;iiiiiii11tfffft11tfffft111111ffft1tt1ttt1tt1tfffLLLLLLLffff\ntffftfttttfLLLfttttttffftttfLLftff1;;;i;;;iii1iiitfffffft11tttt1ttt111fffttfffttttfftttffLLLLLLLLffL\ntttttttttttfffttttttttttttttffftfffi;;;;;;iiiiii1tffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttffffffffftttt1tffftffti;;;;;;iiiii1tttffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\nttffffffffftttfffffffftttftt1tftt111i;;;;;;;;ii111tfftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\ntttfffffffttttfffffffft1tt111111i::i;;;i;;;;i11t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffftfftt111111i;:,..,ii;;iiiii11:;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\ntttttttttffttfttt1111111i;:,.......:11;iiii;11;::;;,:i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntfttttttttt1t1111111i;:,...........:1t1iii;itt;;;;:.,,,:itffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\ntttttffftt1111ttttt1:..............,i111ii1tti:;;;:,,,,.,1tft111tt1111ttt11tf1tffffftttttt1ttttttftt\n111tfffffft1tfttttt;.................:;;;;;;;,.:i:.,,,,,.;t11111111111tt111tft1tffffttfffftt11tfffLf\n111ttfffft111ttttt1,..................:;;;;;:,.:1;.....,.:11tt11111111111t11tf1tfffttfffffffttfLfLLf\ntttt1tftt111111tt11,..................,;;;;;:,.;1;.......,1t111t11t1111111111tttffttttffffftt11fffLf\ntttt111tttttt11111;....................::;;;,..,;:.......,i11tttt11111111tttt11tttfLffttfft1tt1tffft\n1tttt11ttttttt111i.....................,::;;,..,:.........ittttttt111111tttffttttffLLffttttffffttttf\ntfftt11ttttttt111,......................::::,..,:,........itttttttt11111ttttfftttffffffftttttttffttf\nttfft11ttttttt11;.......................,:::,..,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt11:........................,:,,..,:,........,111tt1111111111tftttttffLLfLfttfffffffttf\nttttt11ttttttt11,.......................,,::,..,:..........it11111t11111t111tttttffLLLLfttffftfffttf\ntttt111tttt1t11i......................::;;;;;:.,:..........;t11tttt11111tt11tffttffffffftttffftffttt\nttttt11tt111111:....................,:::;i;;i,.,:..........;ttttttt1111111111tttttfttffft1tttttffttt\nttttt11ttttttt1;....................,:::;i;;:..,,...........:;iii1111111111tt1t1ttfffttt11ttttttfttt\nttttt11tttttt111:...................,:::;;;;...,,........... .,:;;;:;i1111ttt1111ttttttt11ttttttfttt\n11111111t11t11111;,.. ...............,,,....,:.... .......,:::::;;11tt11111111tt1tt1111ttttttt1t\n11111111111111111t11i;;;:.......,..... ......,,....,,. ...,::;::;i1111111111111111111111111tt111\n11111111111111111111tttti,...................,.,,... :1i:,. .,,;;i1111111111111111111111111111111\n111111111111111111111111i,...................:,,,.....ittt1i:,.. ,1tttt111111111111111111111111t1111\n111111111111111111111111;,...................,,::.... .111tttt1ii1ttt11111111t11111111111111111t1111\n111111111111111111111111;....................,:::......it1t11ttttt1111111111111111111111111111111111\n111111111111111111111111;....................,::,......;t1tttttt11tt1tt111t1111111111111111111111111\n11111111111111111111111t:....................::::......:1111ttttttttttt1tt11ttt11111111111tttttt1111\n11111111111111111111111t:....................:;::,.....,1tttttttttttttttttttttttt111tttttttttttt1111\n","tttftttttttttttttttttffftttttt11ttttt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfftfffttffttttt111111111t11ttffffftttt1111111111111111ttffttfttttttttt1111tttt\ntttttttttttttttttffffftttffffffffffft1111tttt111tfffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttffffftttffffffLfffttt1111ttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttftttffffffffttttft1i;:;;;;;i11tfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLfttttttfft1;:,,,,,,,,:1ttfffftttfffft11t111tt111tttffLLfttffft1ttt11tttttt\nttttttttfffLLLLLLffttfLLffttfffttti::,,,,,,,,,,;ttttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfffffti,,,,::;;;iiiii1ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLLLLLLLLLLftttttfftfffftt1:,,,;iii1111111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfttffftttttff:,,:;;;iiii1ii1tttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\nttfffftfffLLLLLfffttfffttttffftfLt;:,:;;;;iiiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffftfttttfLLffttttttffftttfLLftff1;;;;;iiiii;i11ttfffftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttfffLtfffii;;;;;ii;;iittffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttft1tffftffti;;;;;iiiii1ttttffffttt1tffft11111tfttfffttt1tttttttttfLLfffffft\nttffffffffftttfffffffftttfttttfttttti;;;;;iiii1111tfftft11ttttffff1111tt1tffttffttfffffLLffffffLffLL\nttffffffffttttfffffffft1tt11111tft11i;;;;;;;iit11111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffftttfffftfftt1111111111i:,;i;;;;;;ii1i;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\nttttt1tttffttfttt11t111tttt1i;:,...:1i;ii;ii;1i:;;i;;i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntfttttttttt1tt1111111ttt1;:,,.......;ti;iii;it1;;;;,..,:i1fffft11t1111ttt11tt1tffftt1111ttfftfLffftt\nttttfffftt1111ttttt111;:,...........;tt11iii1t1::;;,,,,,.,1ft111tt1111ttt11tf1tffffftttttt1ttttttftt\n111tfffffft1ttttttt11,..............:i11iii111:,;;,,,,,,,.;t1111t11111tt111tft1tffffttfffftt11tfffLf\n111ttfffft111ttttttt;.................:;;;;;;:.,ii,....,,.:1tt11111111111t11tf1tfffttfffffffttfLfLLf\ntttt1tftt11111ttt111:.................,;;i;;;,.,1i,.......:t111111t1111111111tttffttttffffftt11fffLf\ntttt11ttttttt1111111,..................:;;;;;,,,;;,.......:11tttt11111111tttt11tttfLffttfft1tt1tffft\n1tttt11ttttttt11111i...................,;;;;:,..:,........:1tttttt111111tttffttttfLLLLfttttffffttttf\ntfftt11ttttttt11111:....................:i;;:,.,:,........,1ttttttt1111ttttffftttffffffftttttttffttf\nttfft11ttftttt111ti,.....................;;::,..:,........,i1tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt111t;......................,::,...:,.........;11t11111111111ttt1tttffLLLLfttfffffffttf\nttttt11ttttttt111t:......................,::,...:,...,,....it11111111111t111tttttfffLLLfttfffftffttf\ntttt11tttt11tt1111,.......................,,,...:,...,:;;;;itt11ttt1111ttt1ttftttffffffftttffftffttt\nttttt11t111111111i.........................,,...:,...,:;iiii11111t111111t111tttttttttffft1tftttffttt\nttttt11ttttttt111,.........................,,...:....,:;;iii11111111111111ttttt1ttfffttt11ttttttfttt\nttttt11ttttttt111;...................,,,,..,....,......,:;ii1ttt1111111111ttt1111tfttttt11ttttttfttt\n11111111t11t11111t;...............,:::::::..,...:.........,,it11tt1111111tttt1111ttt1tt1111ttttttt1t\n1111111111111111111,.............:::::;;i:......:..... :1ttttt111111111111111111111111111111t111\n11111111111111111111;,.. ........,::::;;:.......,... ,i;;;i1tttt111111111111111111111111111111111111\n11111111111111111111t11i,.........,:::;;. ..,:,.:.....itttttttt1111111t111111111111111111111111t1111\n11111111111111111111111t;...........,,,.... ,:,,:......it1111ttt1111111111111111111111111111111t1111\n111111111111111111111111;.......... .... .:,,:,. ...:tttt11tt111111111111111111111111111111111111\n111111111111111111111111;....................::::..,,..,1tttttttt1tttt1111t1111111111111111111111111\n11111111111111111111111t;....................::::..,,...;t1tttttttttttt1t11ttttt111t111111tttttt1111\n11111111111111111111111ti....................:;::,......:11tttttttttttttttttttttt11t11t1111ttttt1111\n","tttftftttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfttfffttffttttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\nttttttttttttttttfffffftttffffffffffftt11ttttt111tffffffftttttttt11111ttttttffffftfLLfttttttt1111ttt1\nttttttttttttttttffffftttffffffLfffttttt11tttt11tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffftttft1tttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLftttttttfft11iiiiiittt1ttfffffttfffft11t111tt111tttffLLfttffft1ttt11tttttt\nttttttttfffLLLLLLffttfLLffttfffttfft;::,,,,,,:itttttffttffffffftt1111tftt11t11tfLLftttt1tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffffft11i:,,,,,,,,:,;fffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttfffttffftt1;:::::;;;iii;:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfttfLfttttfft;:;iii111111i;1ttttttttffffffftt1111ttt1ttt1ttftt11ttfffffLLLLfttt\nttfffftfffLLLLLLffftfffttttfffffLf;:;;;;ii1iiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffffftttffLLffftttttffffttfLLffffi:i;;;;;ii;ii11ttffffft11tttt1ttt11tfffttffft1ttfftttffLLLLLLLLffL\ntttttttttttffftttttttttttttfLfftffi;ii;ii;i11111tfffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttftttfLftf1;;;;;;;;i1111tttffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\nttffffffffftttfffffffftttfftttftttt1i;;;;;iiii1111ttftft11ttttffff1111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffft1ttt1111tfftt1i;;;;iii1tt111ttt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttffffttftt111t11111ttfft1;;;;;;ii1ti;;i11111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\nttttt1tttffttfttt111111tttt11111tti:i;;;;;;iii1;:;i1i1ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntfttttttttt1tt11t1111ttfftt1tt1i;:..;i;;;;;iii1i:;;:,,:;i1ffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\ntfttfffftt1111tttttt1tttttt1i;,.....:11;ii;;;iti:;;,,,...,:1t111tt1111ttt11tf1tffffftttttt1tttttfftt\n1t1tfffffft1tttttttt111tti:,....,...,i11iii;i1ti;i,,,,,,,,.,i111t11111tt111tft1tffffttfffftt11tffLLf\n1t1ttfffft111tttttt1111:,...........,i1t1iii11i,;1,....,,...;t11111111111t11tf1tfffttfffffffttfLLLLf\ntftt1tftt1tt11ttt111tt;..............,:;i;;;;;,.i1,.........:11111t1111111111tttffttttffffftt1tffLLf\ntfftttttttttt111111ttt:................,;;i;;:,,:;,.........:tttt11111111tttt11tttfLffttfft1tt1tffft\ntttttt1ttttttt1111ttti,................,:;;;;:,.,:..........,ttttt111111tttffttttfLLLLfttttffffttttf\ntffft11ttttttt1111ttt;..................,;;;::,.,,..........,1tttt111111tttffftttffffffftttttttffttf\ntffft11ttftttt111tttt:...................:;;::..::,,.........ittt11111111ttffttttffLLfLfttfffffffttf\ntffft11ttttttt111ttt1:...................,;::,,::;;;i;,......;t11111111111ttt1tttffLLLLfttfffffffttf\ntttft11ttttttt111ttt1,....................,::,,::;;iii;. ...,it11tt11111t111tttttfffLLLfttfffftffttf\nttttt1tttttttt111t1ti.....................,:,,,,::;iii;.....,it11tt1111ttt1ttftttffffffftttffftffttt\nttttt11tt11111111t1ti......................,:,. ,,,:;i:.......;11tt11111t111tttttttttffft1tttttffttt\nttttt11tttt11t11tttt;......................,,,..,, .,,.......,;11111111111ttttt1ttfffttt11ttttttfttt\nttttt1tttttttt111ttt:.......................,,..,,.....,....:1ttt111111111ttt1111tfttttt11ttttttfttt\n1111111ttt1t11111tt1,.......................,,..:,.........:1t11111111111tttt1111ttt1ttt111ttttttt1t\n11111111111111111111;....... ............,,..:,.....,;ii1t1t111111111111111111111111111111111t111\n111111111111111111111,.... .,::,................:....,11ttt11tt11t1111111111111111111111111111111111\n111111111111111111111;.....;i;;;,...............:,....it1111ttt1tt1111t111111111111111111111111t1111\n1111111111111111111111i:.,iii;;i:.......... ,::,:......itttttttt1111111111111111111111111111111t1111\n111111111111111111111111i,:;;;ii;,......... ,;;::,.....:1ttttttt11111111111t111111111111111111111111\n111111111111111111111111i,.,::;;:.......... ,;;;::......itttttttt1tttt11t1tt111111111111111111111111\n111111111111111111111111i..,.................;;;::,.,,..:1tt1tttttttttttt11ttttt11111111tttttttt1111\n111111111111111111111111i..... .............;i;:::,.....itttttttttttttt1tttttttt11t11t1111ttttt1111\n","tttfttfttttttttttttttfffttttt1111tttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLfftfftttffftttt111111111111tfffffftttt111111111111111tttffttfttttttttt11111ttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tffffffffttttttt111111ttttffffLfffLLfttttttt1111t1t1\nttttttttttttttttffffftttffffffLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffftttftttttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLfft111111tttt\nttttttttttffLLLLftttttfLLLftttttttfftttttttfffft1tffffftttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftffft11i;ii1ttffttttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffLfLftti;:;:,,,:;;itffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffffftt1;,,,,,,,,::,:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfftfLftttffff1;::::;;iii;,:1ttttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\nttfffftfffLLLLLfffftfffftttfLfffLfi;iiii11111i;:i1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffffftttffLLfffttttfffffttfLLffLf;;;;iiiiiiii;:1tfffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttffLLffLt;;:;;ii;;iii;ttffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttftttfLftf11i;;;i1ii11ii1tfffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\nttffffffffftttfffffffftttfftttfttt11i;;;;i1111i111ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffftttttt111tfft11;;;;iiiii1t1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffffffft111tt1111ttfft1i;;;iiiii1;;;111111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\nttttt1tttffttfftttttt11ttttt111tttft1i;;;;iiiii;;;1t11ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tffftt1tt11tff1ii;;;;;iiii:;;i;;i1tttffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\nttttffffttt11tttttft1tttttt1ttt11i;,:i;;;;;iii;;;;:...,,,:;i1111tt1111ttt11tt1tffffftttttt1ttttttftt\n111tfffffft1ttfftttt11tttt1tfti;,...,i1i;;ii;;i1i;,.........,i11111111tt111tft1tffffttfffftt11tffLLf\n1t1ttfffft111tftttt1111ttt11;:,......;11iii;;1t11;......,.,,.,i1111111111t11tt1tfffttfffffffttfLLLLf\ntftt1tftt1tt11ttt11ttt11i;:,.........:1tt1i;i1111;............;t11t1111111111tttffttttffffftt1tffLLf\ntfftttttttttt111111tttt1,.............:;;;;;;;;:;:............:tt11111111tttt11tttffftttfft1tt1tffft\n1ttttt1ttttttt1111tt11ti................:;;;;;:,:,............,1tt111111tttffttttfLLLLfttttffffttttf\ntffftttttttttt111tttt1ti................,;;;;::,:,.............ittt11111tttffftttffffffftttttttffttf\ntfffttttfftttt111tttttt;.................:;;:::,:,.............:tt1111111ttffttttffLLfLfttfffffffttf\ntffftttttttttt111tttttt;.................,:;:::,:.,:,,.........,it11111111ttt1tttffLLLLfttfffffffttf\ntttft11ttttttt111tttttt:..................,::::,:,,;;;;;:,......itt11111t111tttttffLLLLfttfffftffttf\nttttt1tttttttt1111t1ttt;...................,::,,:,:;;;iii;.....,1tt1111ttt11tftttffffffftttffftffttt\nttttt11tt1111t111tt1ttt:...................,::,,:::;;iiii;,.....:i1t1111t111tttttttttffft1tftttffttt\nttttt11ttttttt11ttttttt:....................::,,:..,,:;ii:...... .1t111111ttttt1ttffffft11ttttttfttt\nttttt1tttttttt111tttttt:....................,::,:. ..::,......,1t1111111ttt1111tfttttt11ttttttfttt\n1111111tttttt1111ttt1tt:.... ...............,:,,:..............,1t1111111tttt1111ttt1ttt111ttttttt1t\n11111111111111111111111;;;;:,...............,:,,:....... ...,,:1ttt11111111111111111111111111111t111\n11111111111111111111111iiiiii:...............,,,:........,:i11tt1tt111111111111111111111111111111111\n11111111111111111111111iiiiiii...............,,,:.......,1tttt11tt1111t111111111111111111111111t1111\n1111111111111111111111i;iiiiii,..............,.,:........ittt11t111111111111111111111111111111111111\n111111111111111111111111iiii;,...............::::,,......:1ttttt11t111111111111111111111111111111111\n1111111111111111111111111i:,. ...............:i;:::,......itttttt1ttt111t1tt111111111111111111111111\n11111111111111111111111111:................. :i;;;::,.....;ttttttttttttttt1ttttt111111111ttttttt1111\n11111111111111111111111111:................. :i;;;;::,....:tttttttttttttttttttttt11t11t1111ttttt1111\n","tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLLftffftfffftttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttfffffffLLfttttttt111tttt1\nttttttttttttttttfffffttfffffffLffffttttttttttt1tffffffffffttttttt1111ttffffffLLfttffffffttt1111tttt1\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1tffffftttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLffttfffftfffttttttfffffftfttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffffffttft111i;ii1ttfffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftft1i:::,,,,::;;1fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfftfLffftfffLf1;,,,,,,,::,,:1tttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\nttfLfftfffLLLLLfffftfLfftttfffffLLf1;;;;;iiiii:,:1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffffftttffLLfffttttfffffttfLLLffLfiiiii111111i::1tffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttftttttttffftttttttttttttfffLffLfii;;;iiiiiii;:1ftffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttfttffLfffLti;:;;ii;ii1;;ttffffftttttffft11111tfttffftttttttttttttfLLfffftft\nttffffffffftttfffffffftttfftttftttt1i;;;ii11111ii1ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffftttttt111tfff1ii;;;iiiiiii1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\n1tfffffffffttfffffffftt1ttt1111tffft1i;;;iiiiii;;i111111tfffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\ntttttttttffttfftttttt1ttfft1111tttftt1;;;iiiiii;:;tt11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tfffft1tt11ttft11;;;;;iiii;;;1t11ttttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\nttttffffttt11tttttft1ttfffttfft11tftiii;;;;iiii;;;;:;ii1tttft111tt1111ttt11tt1tffffftttttttttttttftt\n111tfffffft1ttfttttt11tfftttfttt11i:,ii;;;;;iii;i:.....,,::;i111t11111tt111tft1fffffttfffftt11tffLLf\n1t1ttfffft111tffttt1111tft1ft1i;:,...;1i;;;;;;i11:...........,;1111111111t11tt1tfffttfffffffttfLLLLf\ntftt1tftt1tt11tft11ttt111111;:,......,111ii;;i1t1:........,,...;11t1111111111tttffttttffffftt1tffLLf\ntffttttttttttt1111ttttt11;:,.........,i111i;i1t1;,.............,1t1111111tttt11t1tfLftttfft1tt1tffft\n1ttttttttttttt1111ttt11ti,............,::::;;;i;:,..............it111111tttffttttfLLLffttttffffttttf\ntfffttttffttttt11ttttttti...............,;;;;;;;:...............:t111111tttffftttffffffftttttttffttf\ntfffttttfffttft11ttttttt;...............,:;;;;:::...............,1t111111ttffttttffLLfLfttfffffffttf\ntffft1ttttttttt11ttttttt:................,;;;;:::................it1111111ttt1tttffLLLLfttfffffffttf\ntffft1tttttttt111ttttttt:................,:;;::::................:t1111tt111tttttffLLLLfttfffftffttf\nttttt1tttttttt111111tt1t;.................,::::::................,1t111ttt11tftttfffffffttfffftffttt\nttttt1tttt11tt111ttttttt:.,:;:............,::::::................,itt111t111ttt1tttttfft11tftttffttt\nttttt1tttttttt11tttttttt;:;iii:............,:::::...........,:,....:1t11111tttt11tfffttt11ttttttfttt\nttttt1tttttttt111ttttttt;;iiiii:. ..........:::::...........,;;;;:..it1111tft1111ttttttt11ttttttfttt\n1111111tttttt1111ttttttt:;iiiii;............,::::,........,::;;iii;it111ttttt11111tt1ttt111ttttttt1t\n111111111111111111111111:;;iiii;,...........,:,::,.........,;;iiii;it111111111111111111111111111tt11\n111111111111111111111111;:;:;;;,............,::::,...........:;;ii;it1111111111111111111111111111111\n111111111111111111111111;::.... .............,:::,,......... .,,:i1t1111111111111111111111111111111\n111111111111111111111111i;,..................,,,:,,....... .;,..,;11111111111111111111111111111t1111\n1111111111111111111111111i;:;i;,..............,,:,,,........1tii11t111111111111111111111111111111111\n111111111111111111111111111111:..............,:::;;:,.......;ttttttttt11t1tt111111111111111111111111\n11111111111111111111111111111;,..............:i;;ii;;:,.....,1ttt1tttttttt1ttttt1111111111tttttt1111\n1111111111111111111111111111i,...............,i;;iiii;:......ittttttttttttttttttt11t11t1111ttttt1111\n","tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111tttt1\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt1111ttfffffffLftttfffffttt1111tttt1\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1ttfffffttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftffftttttfffffffffttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffLffftfftttttfftffffffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftfftt11iii;:;;i1tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfLLLLLLLLLLfttfftfLffttfffLLft1;:::,,,,::;;1ttttttffffffftt1111ttt1ttt1ttfttt1ttffffLLLLLfttt\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLfti;,,,,:::::,,;fffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntfffffttttfLLfffttttfffffttLLLLffLLf1ii;;iiii11i:,;tfffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttfffLffLLf1iiiiiii1111;:;tffffftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttfttffLfffLf111;;;ii;;i1i:itfffftttttffft11111tfttffftttttttttttttfLLfffftft\nttffffffffftttffffffffttffftttftttttt1i;;;iii;iii;ifftft11tttttffft111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffftttttt111tffft11i;;;ii11111111tt111tffftttft11111tt1ttttfft1tffffLLLfttfLLLLLL\n1tfffffffffttfffffffftt1ttt1111fffft111i;;;iiiiiii11111ttfffft11111111tfft1tttttt1tfffffLfftttfLLLLL\ntttttttttffttfftttttt1ttftt1111ttffttt1i;;;iiii;;;1t11ttttfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt1ttfffftttt11ttft1t1i;;iiiii;:;1t111tttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\nttttfffftttt1ttttfft1tffffttfft11tft111i;;;;;ii;:;i11111ttttt1111t1111ttt11tt1tfffffttttttttttttffft\n111tfffffftttffftttt11tfftttfttt1ttt1i1i;;;;iiiiii::;i111tt11111t11111tt111tft1fffffttfffftt1ttfLLLf\n1t1ttfffft111tffttt1111tfttft11tti;::,i1;;;;;iii11:...,,::;i1tt1111111111t11tt1tfffttfffffffttfLLLLf\ntttt1tftt1tt11ttt11ttt1111tt11i;,,....;1i;;;;;;i11:.,.......,,:i11t1111111111tttffttttffffftt1tffLLf\ntffttttttttttt1111ttttt111i;:,........;1t1ii;;i1ii,.............;t1111111tttt11t1tfLftttfft1tt1tffft\n1ttttttttttttt1111tttttt11:...........:iiiiii1tti,..............,1t11111tttttttttfLLLffttttffffttttf\ntfffttttffttttt11ttttttt1i,.............,:::;;ii;,...............;t11111ttttfftttffffffftttttttffttf\ntfffttttfffffft11ttttttt1;..............,:;;;;;;:,...............,1111111ttffttttffLLfLfttfffffffttf\ntffftttttttttt111ttttttt1:.......... ....:;;;;;;:,................it111111tttttttffLLLLfttfffffffttf\ntffft1tttttttt111ttttttt1,........,,:;:,.,;;;;;:;,................;t1111t111tttttffffLLfttfffffffttf\nttttt1tttttttt1111t1tttt1,.......;;;;;:,..:;;::::,................,1t11ttt11tftttfffffffttfffftffttt\nttttt1tttt11tt111ttttttt1:......;;;;;;;:,.:;;::::,................,it111t1111tt11ttttfft11tftttffttt\nttttt1tttttttt11tttttttti,......:;:;;;:...,:;::::,.................:1t11111tt1t11tfffttt11ttttttfttt\nttttt1tttttttt11tttttttti,......:;:;;:.....,:::::,..................:11111ttt1111ttttttt11ttttttfttt\n1t1t111tttttt111111ttttt;...,,,.,:::. ......:::::,...................,111tttt11111ttttt1111ttttttt1t\n111111111111111111111111,,,,,,,.............,:::::,..................,1t111111111111111111111111tt11\n11111111111111111111111i,,..:,..............,,::::,,.................,11tt11111111111111111111111111\n111111111111111111111111;...................,:,,::,,.................,;ii11t111111111111111111111111\n111111111111111111111111i,..................,:::::,,................:::;;;i111t111111111111111111111\n1111111111111111111111111i;;;;i1:............::,:,,,,........... ..::;;;;i1111111111111111111111111\n111111111111111111111111111111t1,............,.,:,,,:,,........:,,..,:;;;i11t11111111111111111111111\n1111111111111111111111111111111i.............,,::;;;i;:,...... :111i;::;;;1ttttt11t1111111tttttt1111\n111111111111111111111111111111ti.............:1;;1iiii;:,.......i1tttt11111tt1tt111111t1111ttttt1111\n","tttttttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111ttt1\nttttttttttttfffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLff111111ttttt\nttttttttttffLLLLftttttfLLLfttttttffffttttttfffft1tffffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftfffttttttfffffftfttfftffffffffttt111tftt11t11tfLLLftt11tffft1tttttt\ntttttttfLfLLLLLLLLffttfttttffLLfftffttttffffffffffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLLftffttttttt11i;ii1tftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfLLLLLLLLLLfttfftfffffffffLLfttt1i;::,,,,:;;1tttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLLttt1;,,,,,,,::,:iftt11tfffft11111tffft1tt11tt1ttttfffLLLLLLLLfff\ntfffffttttfLLfffttttfffffttLLLLfLLLftt1i;;;;;;iiii:,;fftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttffLLffLLftt1;iiiii11111i::tfffft1ttt111111tffftfffftttttttt1ttfLLLLffffff\nttfLffffffftttfffffffffttfttffLfffLftt1;i;;;iiiiiii;;tfftttttffft11111tfttffftttttttttttttfLLftfffft\nttffffffffftttffffffffftffftttfttftttttii;;;;ii;;ii;iftt11tttttfft1111tt1tffttffttfffffLLfffffffffLL\nttffffffffttttfffffffftttttt11ttfffttt11ii;;ii1111ii11111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\n1ttffffffffttfffffffftt1ttt111tffffttt1i1i;;;iiiiii1111ttfffft11t11111tfft1tttttt1ttffffLfftttfLLLLf\ntttttttttffttfftttttt1ttfff1111ttffttttt1i;;;;i;:;it11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tfffftttt11tfftt11tt1;;;ii;;;1t111tttffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\ntfttfffftttt1ttttfft1tffffttfftt1tft1111t1;;;;i;:;i11111tttft111tt1111ttt11tt1tfffffttttttttttttffft\n1tttfffffftttffftfft11tfffttfttttttt11111i;;:;iiii1i;i1t1tt11111t11111tt111tft1fffffttfffftt1ttffLLf\n1t1tffffft111tffttt1111tfttft11tt1t1i;;;1i;;;;ii1ii1,.,:;ii1tt11111111111t11tt1tfffttfffffffttfLfLLf\ntfttttftt1tt11ttt11ttt11t1t11tt11i:,...,11;;;;;it111,,.....,:;i11tt1111111111tttffttttffffftt1tffLLf\ntffttttttttttt1111ttftt111111i;:,......:1t1i;;;;i1t1,..........,:i1111111tttt11t1tfLftttfft1tt1tffft\n1ttttttttttttt1111ttttt111tt;..........:1111iii1;11:.............,it1111tttttt1ttfLLLffttttffffttttf\ntfffttttffttttt11ttttttt11t1,...........,,:::;;i;;:...............:t1111ttttfft1tffffffftttttttffttf\ntfffttttfffffft11ttttttt111i..............:;:::;;::...............,1t1111ttffttttffLLfLfttfffffffttf\ntfffttttttttttt11ttttttt111:..............,;;;;;;:,................;t11111ttt1t1tffLLLLfttfffffffttf\ntffft1tttttttt111ttttttt11i,..........,::::;;;;;;:,................,1t11t111tttttffffLLfttfffffffttf\nttttt1tttttttt111tt1tttt11i.........:;;;;:,;;::::::.................;t1ttt11tftttffffffftttffftffttt\nttttt1tttt11tt111ttttttt111,.......;;;;;;:,:;::::::,................:tttt1111tt11ttfttft11tftttffttt\nttttt1tttttttt11tttttttt11;,......,;;;;;;:::;::::::,................,itt111t11t11ttftttt11ttttttfttt\nttttt1tttttttt11tttttttt11;,......:;;;;i;...,:::::,,.................:tt1tttt1111ttttttt11ttttttfttt\n1t1t111tttttt111tttttttt1;,.,.....,:;:......,:::::,,..................it1tttt11111tttt11111ttttttt1t\n1111111111111111111111111:,,,......,,. .....,,::::,,..................,1t11111111111111111111111tt11\n1111111111111111111111111,,....,,...........,,,:::::,..................itt11111111111111111111111111\n1111111111111111111111111;,.................,:::::::,,................:1tt11111111111111111111111111\n11111111111111111111111111:.... ............,:::,:,,.................,1tt11111111111111111111111111\n11111111111111111111111111ii;;;;;i, .........,,::,,,,,................,:;;1tt11111111111111111111111\n11111111111111111111111111111111t1,..........,,,:,,:,:,,. ...........,:::;;i11tt11111111111111111111\n11111111111111111111111111111111t;.............,:::;;;;:,........ .,:::;;:;i1t111111111ttttttt11111\n111111111111111111111111111111111:...........,;;;i1iiii;:,.......::,,::::;;i1ttt111t11t1111ttttt1111\n","tttftttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt11111111t\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\nttftttttttttttttffffLffttfffffffLfffttttttttt111tfffffffftttttttt11111ttttttfffftfLLfttttttt111tttt1\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tfffffffffttffffffttt11111ttt1\ntttttttttttffffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLfft11111ttttt\nttttttttttffLLLLftttttfLLLfttttttffLftttttttffft1ttfffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffffftftttfffffffttt111tftt11t11tfLLfftt11tffft11ttttt\ntttttttfffLLLLLLLLffttfttttfLLLfftffttttffftt1iii11tttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLffffftttttfti;;::,,,:;i1tffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttfffffLLLLLLLLLLfttfftfLfffffffLLfttttt1;,,,,,,,::,:ittffffffftt1111ttt1ttt1tftttt1ttffffLLLLLfttt\nttfLLffffLLLLLLLLfftfLfftttfLfffLLLLfttt1i;:::;;iiii;,;t11tfffft11111tffft1tt1ttt1ttttfffLLLLLLLLfff\ntffffftttffLLLffttttfffffttLLLLfLLLffttf1;;iiii11111i::1t11tttt1ttt11tfffttfftttttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttfffLffLLftttti:;;;;iiiiiii;;tftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\nttfLffffffftttfffffffffttfttffLfffLfttttti;;;;;iii;i1iiftttttffft11111tfttffftttttttttttttfLLftfffft\nttffffffffftttffffffffftfffftffffftttttft11i;;;iiii1iiit11tttttfft1111tt11ffttffttfffffLLfffffffffLL\nttffffffffttttfffffffftttttt1tttffftttttti1i;;;ii11iii111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\n1ttffffffffttfffffffftt1ttt1111tfffftttt111i;;iiiiii111ttfffft11t11111tfftttttttt1ttffffLfftttfLLLLf\ntttttttttffttfftttttt1ttfftttt1ttfftttttt111i;i;:;ii11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tfffftttt11tfftt1ttt111;;i;;;iii1ttttffftt11t1111ttt11tt1tffttt1111ttfftfLffftt\ntfttffffttt11tttttft1tffffttffttttft111ttt11;;;;:;i1i1;;11tft111tt1111tt111tt1tfffffttttt11tttttffft\n1tttfffffftttffftfft11tfftttffttttft1111iii1;;;i;iiii1i,,,:;;i11tt1111tt111tft1fffffttfffftt11tffLLf\n111ttfffftt1ttffttt1111tfttft11tt1t1i;:,,,;1i;;i1ii;iti,,.....,:;i1t11111t11tt1tfffttffffffft1fffLLf\ntfttttftt1tt11tft11ttt11tttt1tt11i;:,.....;11i;i1i;1tt;,,.........,:i11111111t1tffttttffffftt1tfffLf\ntffttttttttftt1111ttttt11111tft;,.........;11111i1ttti,.............,1111tttt1111tffftttfft1tt1tffft\n1ttttttttttttt1111tttttt11tfff1,...........,:;;;;;11i:...............itttttttt1ttfffLffttttffffttttf\ntfffttttffttttt11ttttttt11tfffi............ ,:;;;;;;;,...............;t1ttttfft1tffffffftttttttffttf\ntfffttttfffffft11tttttttttt1tf;..............:;;;;;;;,...............:111ttttttttfffLfLfttfffffffttf\ntfffttttftftft111ttttttt11t111:..............:;;;;;::,...............,1t11ttt1t1tffLLLLfttfffffffttf\ntfffttttfttttt111ttttttt11ttt1:..............,;;;::;::................itt111tttttffffLLfttfffffffttf\ntttttttttttttt111ttttttt1ttfft:..............,;;;;::::................:1tt11tft1tffffffftttffttffttt\nttttt1tttt11tt11tttttttt1tttt1;.,::,..........:;:::;::,...............,1t1111tt11tttttft11tfttttfttt\nttttt1tttttttt11ttttttttt1ttt1;,:;;:..........,::::::,,................it11111111ttftttt11ttttttfttt\nttttt1tttttttt11tttttttttttttiiiiii;,.........,:::::::,................:ttttt1111ttttttt11ttttttfttt\n1t1111tttttttt11tttttttt1ttt1;;;;ii;,.........,:::::::,.................ittttt1111tttt11111ttttttt1t\n11111111111111111111111111tt1;;;;ii;...........::::::::................ :1t111111111111111111111t111\n11111111111111111111111111tt1;::;;i:...........,:::::::,...............,itttt11111111111111111111111\n11111111111111111111111tttttt;,,,::............,::::::,,...............ittttt11111111111111111111111\n1111111111111111111111111tttt1:,,..............,:::::,,,,.......,:;::,:1t1111111111111111111111t1111\n11111111111111111111111111111111i;;i:..........,:,,,.,,.,.......::;;i;it1ttt111111111111111111111111\n1111111111111111111111111111111111ti...........,,.,:,:;::,......,:;;ii1ttttt11111111111111111t111111\n1111111111111111111111111111111111t;...........,;iiiiiii;:,......:;;;i1ttttt111t1111111111tttttt1111\n11111111111111111111111111111111111:...........,;i11iiii;:,.......,:i1tttttt1ttttt1t11t1111ttttt1111\n"];const l=new i.a;function c(){const[t,e]=Object(a.useState)(function(){const t=new Date;return 3===t.getMonth()&&1===t.getDate()}()),[n,i]=Object(a.useState)(0);return Object(a.useEffect)(()=>{const t=setInterval(()=>i(t=>(t+1)%s.length),100);return()=>clearInterval(t)},[]),Object(a.useEffect)(()=>l.subscribe(()=>{e(!0)}),[]),t?r.a.createElement(o.a,{open:t,onClose:()=>e(!1)},r.a.createElement("pre",{style:{color:"#0f0"}},s[n]),r.a.createElement("div",{style:{display:"none"}},r.a.createElement("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/a3Z7zEc7AXQ?autoplay=1",title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"}))):r.a.createElement(r.a.Fragment,null)}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(17),o=n(3),s=n(21),l=n(122),c=n(148);const f=Object(l.a)(t=>Object(c.a)({travel:{color:t.colors.white,lineHeight:"1em",whiteSpace:"pre",cursor:"pointer"}}));function u(t){const e=f();return t.city!==t.currentCity?r.a.createElement(s.a,{title:r.a.createElement(o.a,null,t.city)},r.a.createElement("span",{onClick:()=>t.onTravel(t.city),className:e.travel},t.city[0])):r.a.createElement("span",null,t.city[0])}function m(t){return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ,_ . ._. _. ."),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / ,/'-/~ '\\ ,' _ , '",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Volhaven}),",'|~ ._/-, /~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},".-~ '| '',\\~|\\ _\\~ ,_ , ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Chongqing})," /,"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," '\\ ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Sector12})," /'~ |_/~\\\\,-,~ \\ \" ,_,/ |"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | / ._-~'\\_ _~| \\ ) ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.NewTokyo})),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ __-\\ '/ ~ |\\ \\_ / ~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ~-_' _; '\\ '-, \\,' /\\/ |"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," '\\_,~'\\_ \\_ _, /' ' |, /|'"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / \\_ ~ | / \\ ~'; -,_."),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ~\\ | | , '-_, ,; ~ ~\\"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\, ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Aevum})," / \\ / /| ,-, , -,"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ,/ | |' |/ ,- ~ \\ '."),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ,| ,/ \\ ,/ \\ ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Ishima})," |"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / | ~ -~~-, / _"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ,-' ~ /"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / ,' ~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ',| ~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ~'"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(28),o=n(1187),s=n(1188),l=n(1);function c(t){const e=t.action.getEstSuccessChance(t.bladeburner,l.a);let n=r.a.createElement(r.a.Fragment,null);return n=e[0]===e[1]?r.a.createElement(r.a.Fragment,null,Object(i.d)(100*e[0],1),"%"):r.a.createElement(r.a.Fragment,null,Object(i.d)(100*e[0],1),"% ~ ",Object(i.d)(100*e[1],1),"%"),r.a.createElement(r.a.Fragment,null,"Estimated success chance: ",n," ",t.action.isStealth?r.a.createElement(o.a,null):r.a.createElement(r.a.Fragment,null),t.action.isKill?r.a.createElement(s.a,null):r.a.createElement(r.a.Fragment,null))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(39);function o(t){return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},t.children)}},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(15),r=n(103);const i=t=>null!==t&&t.type===r.b.RECOVERY;class o extends r.a{constructor(){super(r.b.RECOVERY)}process(t,e,n){return e.shock=Math.min(100,e.shock+2e-4*n),e.shock>=100&&e.stopWork(t),0}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveRecoveryWork",this)}static fromJSON(t){return Object(a.a)(o,t.data)}}a.c.constructors.SleeveRecoveryWork=o},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(15),r=n(103);const i=t=>null!==t&&t.type===r.b.SYNCHRO;class o extends r.a{constructor(){super(r.b.SYNCHRO)}process(t,e,n){return e.sync=Math.min(100,e.sync+2e-4*t.getIntelligenceBonus(.5)*n),e.sync>=100&&e.stopWork(t),0}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveSynchroWork",this)}static fromJSON(t){return Object(a.a)(o,t.data)}}a.c.constructors.SleeveSynchroWork=o},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(6),r=n(83),i=n(15),o=n(359);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l{constructor(t=null,e=[]){s(this,"args",[]),s(this,"dataMap",{}),s(this,"filename",""),s(this,"logs",[]),s(this,"logUpd",!1),s(this,"offlineExpGained",0),s(this,"offlineMoneyMade",0),s(this,"offlineRunningTime",.01),s(this,"onlineExpGained",0),s(this,"onlineMoneyMade",0),s(this,"onlineRunningTime",.01),s(this,"pid",-1),s(this,"ramUsage",0),s(this,"server",""),s(this,"threads",1),s(this,"dependencies",[]),null!=t&&(this.filename=t.filename,this.args=e,this.server=t.server,this.ramUsage=t.ramUsage,this.dependencies=t.dependencies)}log(t){this.logs.length>a.a.MaxLogCapacity&&this.logs.shift();let e=t;a.a.TimestampsFormat&&(e="["+Object(o.a)(a.a.TimestampsFormat)+"] "+e),this.logs.push(e),this.logUpd=!0}displayLog(){for(let t=0;t${e.title}

${e.txt}`;Object(r.a)(n)}},,,,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(261),o=n(1),s=n(83),l=n(89),c=n(7),f=n(23),u=n(311);function m(){const t=o.a.getCurrentServer();null!==t&&l.a.DarkWeb==t.hostname&&s.a.print("You are now connected to the dark web. From the dark web you can purchase illegal items. Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name]' to purchase an item. Use 'buy -a' to purchase all unowned items.")}function h(){for(const t of Object.keys(i.a)){const e=i.a[t],n=o.a.getHomeComputer().programs.includes(e.program)?r.a.createElement("span",{style:{color:"green"}},"[OWNED]"):r.a.createElement(f.a,{money:e.price});s.a.printRaw(r.a.createElement(r.a.Fragment,null,r.a.createElement("span",null,e.program)," - ",r.a.createElement("span",null,n)," - ",r.a.createElement("span",null,e.description)))}}function d(t){t=t.toLowerCase();let e=null;for(const n of Object.keys(i.a)){const a=i.a[n];a.program.toLowerCase()==t&&(e=a)}null!==e?o.a.hasProgram(e.program)?s.a.print("You already have the "+e.program+" program"):o.a.moneyo.a.money)s.a.error("Not enough money to purchase remaining programs, "+c.a.formatMoney(e)+" required");else for(const e of t)d(e.program);else s.a.print("All available programs have been purchased already.")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var a=n(186);function r(t,e,n){const a=n-Math.pow(e,.9)/250-t.skills.intelligence/1600;return a<0?0:a>3?3:a}function i(t,e){return r(t,t.skills.strength+t.skills.defense+t.skills.dexterity+t.skills.agility+t.skills.charisma,e)}function o(t,e){return r(t,Object(a.b)(9e3*t.mults.strength_exp,t.mults.strength)+Object(a.b)(9e3*t.mults.defense_exp,t.mults.defense)+Object(a.b)(9e3*t.mults.agility_exp,t.mults.agility)+Object(a.b)(9e3*t.mults.dexterity_exp,t.mults.dexterity)+Object(a.b)(9e3*t.mults.charisma_exp,t.mults.charisma),e)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(30),r=n(164);function i(t){const e=Number(t);return isNaN(e)?"true"===t||"false"===t?"true"===t:t:e}function o(t){const e=(t=(t=t.trim()).replace(/\s\s+/g," ")).match(/(?:'[^']*'|"[^"]*"|[^;"])*/g);if(!e)return[];const n=e.map(r.h).map(t=>t.match(/(?:'[^']*'|"[^"]*"|[^;"])*/g)).flat(),a=[];for(const t of n)null!==t&&(t.match(/^\s*$/)||a.push(t.trim()));return a}function s(t){let e=0;const n=[];let r="",o="";for(;er.a.createElement(o.a,{key:e},t)),t.lines.length>e&&r.a.createElement(i.a,{key:e,text:t.lines[e],onDone:function(){const a=e+1;n(a),a>=t.lines.length&&(t.onDone&&t.auto&&t.onDone(),c(!0))}}),!t.auto&&t.onDone&&l&&r.a.createElement(s.a,{onClick:t.onDone},"Continue ..."))}},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}));const a=5,r=1e13},,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(314),r=n(259),i=n(441),o=n(233),s=n(77);function l(t,e,n){try{let m={};const h=new Set,d=[];function l(t,e){const n=function(t,e){const n=Object(r.a)(t,{sourceType:"module",ecmaVersion:"latest"}),i=e+".__GLOBAL__",o={};o[i]=new Set;const s={},l=[];function c(t,n){const a=o[t]||(o[t]=new Set),r=s[n];void 0!==r&&a.add(r),a.add(e+"."+n),a.add(n)}const f=Object.getOwnPropertyNames(Object.prototype);function u(){return{Identifier:(t,e)=>{f.includes(t.name)||c(e.key,t.name)},WhileStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceWhile"),t.test&&n(t.test,e),t.body&&n(t.body,e)},DoWhileStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceWhile"),t.test&&n(t.test,e),t.body&&n(t.body,e)},ForStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceFor"),t.init&&n(t.init,e),t.test&&n(t.test,e),t.update&&n(t.update,e),t.body&&n(t.body,e)},IfStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceIf"),t.test&&n(t.test,e),t.consequent&&n(t.consequent,e),t.alternate&&n(t.alternate,e)},MemberExpression:(t,e,n)=>{t.object&&n(t.object,e),t.property&&n(t.property,e)}}}return a.a(n,{key:i},Object.assign({ImportDeclaration:(t,e)=>{const n=t.source.value;l.push(n);const a=o[e.key];if(void 0===a)throw new Error("set should not be undefined");a.add(n+".__GLOBAL__");for(let a=0;a{const n=e+"."+(null===t.id?"__SPECIAL_DEFAULT_EXPORT__":t.id.name);a.a(t,{key:n},u())}},u())),{dependencyMap:o,additionalModules:l}}(t,e);h.add(e);for(let t=0;t0;){const t=d.shift();if(void 0===t)throw new Error("nextModule should not be undefined");if(t.startsWith("https://")||t.startsWith("http://"))continue;let n=null;const a=t.startsWith("./")?t.slice(2):t;for(const t of e)if(Object(s.b)(t.filename,a)){n=t;break}if(null==n)return{cost:i.a.ImportError};l(n.code,t)}let g=o.a.ScriptBaseRamCost;const y=[{type:"misc",name:"baseCost",cost:o.a.ScriptBaseRamCost}],b=Object.keys(m).filter(t=>t.startsWith(p)),E=new Set,v={};for(;b.length>0;){const e=b.shift();if(void 0===e)throw new Error("ref should not be undefined");if("hacknet"!==e||E.has("hacknet")||(g+=o.a.ScriptHacknetNodesRamCost,y.push({type:"ns",name:"hacknet",cost:o.a.ScriptHacknetNodesRamCost})),"document"!==e||E.has("document")||(g+=o.a.ScriptDomRamCost,y.push({type:"dom",name:"document",cost:o.a.ScriptDomRamCost})),"window"!==e||E.has("window")||(g+=o.a.ScriptDomRamCost,y.push({type:"dom",name:"window",cost:o.a.ScriptDomRamCost})),"corporation"!==e||E.has("corporation")||(g+=o.a.ScriptCorporationRamCost,y.push({type:"ns",name:"corporation",cost:o.a.ScriptCorporationRamCost})),E.add(e),e.endsWith(".*")){const t=e.slice(0,e.length-2);for(const e of Object.keys(m).filter(e=>e.startsWith(t)))for(const t of m[e]||[])E.has(t)||b.push(t)}else for(const t of m[e]||[])E.has(t)||b.push(t);try{var c,f;if(v[e])continue;v[e]=!0;const n=(t,e,a)=>{if(!e)return;const r=Object.entries(e).find(([t])=>t===a);if(void 0!==r&&("function"==typeof r[1]||"number"==typeof r[1]))return{func:r[1],refDetail:`${t}${a}`};for(const[t,r]of Object.entries(e)){const e=n(t+".",r,a);if(e)return e}},a=n("",o.b,e),r="number"==typeof(u=null!==(c=null==a?void 0:a.func)&&void 0!==c?c:0)?u:"function"==typeof u?u(t):0;g+=r,y.push({type:"fn",name:null!==(f=null==a?void 0:a.refDetail)&&void 0!==f?f:"",cost:r})}catch(t){console.log(t);continue}}return{cost:g,entries:y.filter(t=>t.cost>0)}}catch(t){return{cost:i.a.SyntaxError}}var u}function c(t){const e=Object(r.a)(t,{sourceType:"module",ecmaVersion:"latest"});let n=-1;return a.a(e,{},{WhileStatement:(e,r,i)=>{!function(t){return"Literal"===t.type&&"true"===t.raw}(e.test)||function(t){let e=!1;return a.a(t,{},{AwaitExpression:()=>{e=!0}}),e}(e)?e.body&&i(e.body,r):n=(t.slice(0,e.start).match(/\n/g)||[]).length+1}}),n}function f(t,e,n){try{return l(t,n,e)}catch(t){return console.error("Failed to parse script for RAM calculations:"),console.error(t),{cost:i.a.SyntaxError}}}},function(t,e,n){"use strict";function a(t){return+(Math.round(parseFloat(t+"e+2"))+"e-2")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var a=n(204);let r=1;function i(){let t=r,e=!1;for(let n=0;n<1e6;){if(!a.a.has(t+n)){e=!0,t+=n;break}n===Number.MAX_SAFE_INTEGER-1?n=1:++n}return e?(r=t+1,r>=Number.MAX_SAFE_INTEGER&&(r=1),t):-1}function o(){r=1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(201),r=n(29),i=n(16),o=n(15),s=n(277),l=n(34),c=n(191),f=n(13),u=n(247),m=n(81),h=n(620),d=n(1067);class p{constructor(t="",e=!1){this.facName=t,this.members=[],this.wanted=1,this.respect=1,this.isHackingGang=e,this.respectGainRate=0,this.wantedGainRate=0,this.moneyGainRate=0,this.storedCycles=0,this.storedTerritoryAndPowerCycles=0,this.territoryClashChance=0,this.territoryWarfareEngaged=!1,this.notifyMemberDeath=!0}getPower(){return m.a[this.facName].power}getTerritory(){return m.a[this.facName].territory}process(t=1,e){const n=1e3/f.a._idleSpeed;if(isNaN(t)&&console.error("NaN passed into Gang.process(): "+t),this.storedCycles+=t,this.storedCycles<2*n)return;const a=Math.min(this.storedCycles,5*n);try{this.processGains(a,e),this.processExperienceGains(a),this.processTerritoryAndPowerGains(a),this.storedCycles-=a}catch(t){console.error("Exception caught when processing Gang: "+t)}}processGains(t=1,e){let n=0,o=0,s=0,l=0;for(let t=0;te&&(n=1),this.wanted=n,this.wanted<1&&(this.wanted=1)}e.gainMoney(n*t,"gang")}processTerritoryAndPowerGains(t=1){if(this.storedTerritoryAndPowerCycles+=t,this.storedTerritoryAndPowerCycles0&&(this.territoryClashChance=Math.max(0,this.territoryClashChance-.01));const n=c.a.Names.filter(t=>m.a[t].territory>0||t===e);if(n.length>1)for(let t=0;te!==n[t]),i=Object(l.a)(0,r.length-1),o=n[t],s=r[i];if(!(o!==e&&s!==e||Math.random()t.territory).reduce((t,e)=>t+e,0);Object.values(m.a).forEach(t=>t.territory/=u)}}processExperienceGains(t=1){for(let e=0;e=0;--t){const n=this.members[t];if("Territory Warfare"!==n.task)continue;const a=e/Math.pow(n.def,.6);Math.random()=c.a.MaximumGangMembers)&&this.respect>=this.getRespectNeededToRecruitMember()}getRespectNeededToRecruitMember(){if(this.members.length<3)return 0;const t=this.members.length-2;return Math.pow(5,t)}recruitMember(t){if(""===(t=String(t))||!this.canRecruitMember())return!1;if(this.members.filter(e=>e.name===t).length>=1)return!1;const e=new h.a(t);return this.members.push(e),!0}getWantedPenalty(){return this.respect/(this.respect+this.wanted)}calculatePower(){let t=0;for(let e=0;e"Ascended Gang member "+t.name),n}catch(t){throw null==e&&Object(s.a)(t),t}}getDiscount(){const t=this.getPower(),e=this.respect,n=Math.pow(e,.01)+e/5e6+Math.pow(t,.01)+t/1e6-1;return Math.max(1,n)}getAllTaskNames(){return Object.keys(u.a).filter(t=>{const e=u.a[t];return null!=e&&("Unassigned"!==e.name&&(this.isHackingGang===e.isHacking||!this.isHackingGang===e.isCombat))})}getUpgradeCost(t){return null==t?1/0:t.cost/this.getDiscount()}toJSON(){return Object(o.b)("Gang",this)}static fromJSON(t){return Object(o.a)(p,t.data)}}o.c.constructors.Gang=p},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(13);function r(t,e){return t/a.a.DonateMoneyToRepDivisor*e.mults.faction_rep}},,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(6),r=n(1322);let i;function o(){i&&i.stopConnection(),0!==a.a.RemoteFileApiPort&&(i=new r.a("localhost",a.a.RemoteFileApiPort),i.startConnection())}function s(){return i&&null!=i.connection&&1==i.connection.readyState}},function(t,e,n){"use strict";function a(t,e,n=!1){let a="";const r=t.jobStatReqOffset,i=e.requiredHacking>0?e.requiredHacking+r:0,o=e.requiredStrength>0?e.requiredStrength+r:0,s=e.requiredDefense>0?e.requiredDefense+r:0,l=e.requiredDexterity>0?e.requiredDexterity+r:0,c=e.requiredDexterity>0?e.requiredDexterity+r:0,f=e.requiredCharisma>0?e.requiredCharisma+r:0,u=e.requiredReputation;return n?(a="Requires:
",a+=i.toString()+" hacking
",a+=o.toString()+" strength
",a+=s.toString()+" defense
",a+=l.toString()+" dexterity
",a+=c.toString()+" agility
",a+=f.toString()+" charisma
",a+=u.toString()+" reputation"):(a="(Requires ",i>0&&(a+=i+" hacking, "),o>0&&(a+=o+" strength, "),s>0&&(a+=s+" defense, "),l>0&&(a+=l+" dexterity, "),c>0&&(a+=c+" agility, "),f>0&&(a+=f+" charisma, "),u>1&&(a+=u+" reputation, "),a=a.substring(0,a.length-2),a+=")"),a}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return i}));const a=["Type 'help name' to learn more about the command "," ",' alias [-g] [name="value"] Create or display Terminal aliases'," analyze Get information about the current machine "," backdoor Install a backdoor on the current machine "," buy [-l/-a/program] Purchase a program through the Dark Web"," cat [file] Display a .msg, .lit, or .txt file"," cd [dir] Change to a new directory"," check [script] [args...] Print a script's logs to Terminal"," clear Clear all text on the terminal "," cls See 'clear' command "," connect [hostname] Connects to a remote server"," cp [src] [dst] Copy a file"," download [script/text file] Downloads scripts or text files to your computer"," expr [math expression] Evaluate a mathematical expression"," free Check the machine's memory (RAM) usage"," grow Spoof money in a servers bank account, increasing the amount available."," hack Hack the current machine"," help [command] Display this help text, or the help text for a command"," history [-c] Display the terminal history"," home Connect to home computer"," hostname Displays the hostname of the machine"," kill [script/pid] [args...] Stops the specified script on the current server "," killall Stops all running scripts on the current machine"," ls [dir] [--grep pattern] Displays all files on the machine"," lscpu Displays the number of CPU cores on the machine"," mem [script] [-t n] Displays the amount of RAM required to run the script"," mv [src] [dest] Move/rename a text or script file"," nano [file ...] Text editor - Open up and edit one or more scripts or text files"," ps Display all scripts that are currently running"," rm [file] Delete a file from the server"," run [name] [-t n] [--tail] [args...] Execute a program or script"," scan Prints all immediately-available network connections"," scan-analyze [d] [-a] Prints info for all servers up to d nodes away"," scp [file ...] [server] Copies a file to a destination server"," sudov Shows whether you have root access on this computer"," tail [script] [args...] Displays dynamic logs for the specified script"," top Displays all running scripts and their RAM usage"," unalias [alias name] Deletes the specified alias"," vim [file ...] Text editor - Open up and edit one or more scripts or text files in vim mode"," weaken Reduce the security of the current machine"," wget [url] [target file] Retrieves code/text from a web server"," "],r=t=>[`Usage: ${t} [file ...] | [glob]`," ","Opens up the specified file(s) in the Script Editor. Only scripts (.js, or .script) or text files (.txt) ","can be edited using the Script Editor. If a file does not exist a new one will be created"," ",`If provided a glob as the only argument, ${t} can spider directories and open all matching `,`files at once. ${t} cannot create files using globs, so your scripts must already exist.`," ","Examples:"," ",` ${t} test.js`,` ${t} test.js test2.js`," ",` ${t} test.*`,` ${t} /my-dir/*.js`," "],i={alias:['Usage: alias [-g] [name="value"] '," ","Create or display aliases. An alias enables a replacement of a word with another string. ","It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME ","of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, ","you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: "," ",' alias nuke="run NUKE.exe"'," ","Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. ","It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For ","example, if the following alias was set: "," ",' alias worm="HTTPWorm.exe"'," ","and then you tried to run the following terminal command: "," "," run worm"," ","This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted ","anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: "," ",' alias -g worm="HTTPWorm.exe"'," ","Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. "," ","Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form ","'alias NAME=VALUE' on the Terminal. "," ","The 'unalias' command can be used to remove aliases."," "],analyze:["Usage: analyze"," ","Prints details and statistics about the current server. The information that is printed includes basic ","server details such as the hostname, whether the player has root access, what ports are opened/closed, and also ","hacking-related information such as an estimated chance to successfully hack, an estimate of how much money is ","available on the server, etc."," "],backdoor:["Usage: backdoor"," ","Install a backdoor on the current machine, grants a secret bonus depending on the machine."," ","Requires root access to run."," "],buy:["Usage: buy [-l / -a / program]"," ","Purchase a program through the Dark Web. Requires a TOR router to use."," ","If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the ","dark web to the Terminal, as well as their costs."," ","If this command is ran with the '-a' flag, it will attempt to purchase all unowned programs."," ","Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive."," "],cat:["Usage: cat [file]"," ","Display message (.msg), literature (.lit), or text (.txt) files. Examples:"," "," cat j1.msg"," "," cat foo.lit"," "," cat servers.txt"," "],cd:["Usage: cd [dir]"," ","Change to the specified directory. Note that this works even for directories that don't exist. If you ","change to a directory that does not exist, it will not be 'created'. Examples:"," "," cd scripts/hacking"," "," cd /logs"," "," cd ../"," "],check:["Usage: check [script name] [args...]"," ","Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by ","a space. Remember that a running script is uniquely ","identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: "," "," run foo.script 1 2 foodnstuff"," ","Then to run the 'check' command on this script you would have to pass the same arguments in: "," "," check foo.script 1 2 foodnstuff"," "],clear:["Usage: clear"," ","Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up ","and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'cls' command"," "],cls:["Usage: cls"," ","Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up ","and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'clear' command"," "],connect:["Usage: connect [hostname]"," ","Connect to a remote server. The hostname of the remote server must be given as the argument ","to this command. Note that only servers that are immediately adjacent to the current server in the network and the ones that have","a backdoor installed can be connected to. To see which servers can be connected to, use the 'scan' command."," "],cp:["Usage: cp [src] [dst]"," ","Copy a file on this server. To copy a file to another server use scp."," "],download:["Usage: download [script/text file]"," ","Downloads a script or text file to your computer (like your real life computer)."," ","You can also download all of your scripts/text files as a zip file using the following Terminal commands:"," ","Download all scripts and text files: download *"," ","Download all scripts: download *.script"," ","Download all text files: download *.txt"," "],expr:["Usage: expr [mathematical expression]"," ","Evaluate a simple mathematical expression. Supports native JavaScript operators:"," ","+, -, /, *, **, %"," ","Example:"," "," expr 25 * 2 ** 10"," ","Note that letters (non-digits) are not allowed and will be removed from the input."," "],free:["Usage: free"," ","Displays the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as ","how much of it is being used."," "],grow:["Usage: grow"," ","Spoof transactions in the current server. Increasing the money available by hacking. Requires root access.","See the wiki page for hacking mechanics."," "],hack:["Usage: hack"," ","Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics"," "],help:["Usage: help [command]"," ","Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief ","description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print ","more detailed information about the Terminal command. Examples: "," "," help alias"," "," help scan-analyze"," "],history:["Usage: history [-c]"," ","Without arguments, displays the terminal command history. To clear the history, pass in the '-c' argument."," "],home:["Usage: home"," ","Connect to your home computer. This will work no matter what server you are currently connected to."," "],hostname:["Usage: hostname"," ","Prints the hostname of the current server"," "],kill:["Usage: kill [script name] [args...] or kill [pid"," ","Kill the script specified by the script name and arguments OR by its PID."," ","If you are killing the script using its filename and arguments, then each ","argument must be separated by a space. Remember that a running script is ","uniquely identified by both its name and the arguments that are used to start ","it. So, if a script was ran with the following arguments:"," "," run foo.script 1 sigma-cosmetics"," ","Then to kill this script the same arguments would have to be used:"," "," kill foo.script 1 sigma-cosmetics"," ","If you are killing the script using its PID, then the PID argument must be numeric"," "],killall:["Usage: killall"," ","Kills all scripts on the current server. ","Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. ","This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. ","The script will not be stopped/killed until after that time has elapsed."," "],ls:["Usage: ls [dir] [-l] [--grep pattern]"," ","The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. ","The files will be displayed in alphabetical order. "," ","The 'dir' optional parameter can be used to display files/directories in another directory."," ","The '-l' optional parameter allows you to force each item onto a single line."," ","The '--grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern."," ","Examples:"," ","List all files with the '.script' extension in the current directory:"," "," ls -l --grep .script"," ","List all files with the '.js' extension in the root directory:"," "," ls / -l --grep .js"," ","List all files with the word 'purchase' in the filename, in the 'scripts' directory:"," "," ls scripts -l --grep purchase"," "],lscpu:["Usage: lscpu"," ","Prints the number of CPU Cores the current server has"," "],mem:["Usage: mem [script name] [-t num_threads]"," ","Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print ","the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then ","an argument for the number of threads must be passed in afterwards. Examples:"," "," mem foo.script"," "," mem foo.script -t 50"," ","The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example ","above will print the amount of RAM needed to run 'foo.script' with 50 threads."," "],mv:["Usage: mv [src] [dest]"," ","Move the source file to the specified destination. This can also be used to rename files. ","This command only works for scripts and text files (.txt). This command CANNOT be used to ","convert to different file types"," ","Note that, unlike the Linux 'mv' command, the destination argument must be the ","full filepath. ","Examples: "," "," mv hacking-controller.script scripts/hacking-controller.script"," "," mv myScript.js myOldScript.js"," "],nano:r("nano"),ps:["Usage: ps"," ","Prints all scripts that are running on the current server"," "],rm:["Usage: rm [file]"," ","Removes the specified file from the current server. A file can be a script, a program, or a message file. "," ","WARNING: This is permanent and cannot be undone"," "],run:["Usage: run [file name] [-t] [num threads] [args...]"," ","Execute a program, script or coding contract."," ","The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used ","to indicate that the script should be run with the specified number of threads. If the flag is omitted, ","then the script will be run with a single thread by default. ","If the '-t' flag is used, then it MUST come immediately ","after the script name, and the [num threads] argument MUST come immediately afterwards. "," ","[args...] represents a variable number of arguments that will be passed into the script. See the documentation ","about script arguments. Each specified argument must be separated by a space. "," "],scan:["Usage: scan"," ","Prints all immediately-available network connection. This will print a list of all servers that you can currently connect ","to using the 'connect' Terminal command."," "],"scan-analyze":["Usage: scan-analyze [depth] [-a]"," ","Prints detailed information about all servers up to [depth] nodes away on the network. Calling ","'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal ","command. This command also shows the relative paths to reach each server."," ","By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have ","the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to ","5 and 10, respectively."," ","The information 'scan-analyze' displays about each server includes whether or not you have root access to it, ","its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM ","it has."," ","By default, this command will not display servers that you have purchased. However, you can pass in the ","-a flag at the end of the command if you would like to enable that."," "],scp:["Usage: scp [filename ...] [target server]"," ","Copies the specified file(s) from the current server to the target server. ","This command only works for script files (.script or .js extension), literature files (.lit extension), ","and text files (.txt extension). ","The second argument passed in must be the hostname or IP of the target server. Examples:"," "," scp foo.script n00dles"," "," scp foo.script bar.script n00dles"," "],sudov:["Usage: sudov"," ","Prints whether or not you have root access to the current machine"," "],tail:["Usage: tail [script name] [args...]"," ","Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated ","by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used ","to run it. So, if a script was ran with the following arguments: "," "," run foo.script 10 50000"," ","Then in order to check its logs with 'tail' the same arguments must be used: "," "," tail foo.script 10 50000"," "],top:["Usage: top"," ","Prints a list of all scripts running on the current server as well as their thread count and how much ","RAM they are using in total."," "],unalias:["Usage: unalias [alias name]"," ","Deletes the specified alias. Note that the double quotation marks are required. "," ","As an example, if an alias was declared using:"," ",' alias r="run"'," ","Then it could be removed using:"," "," unalias r"," ","It is not necessary to differentiate between global and non-global aliases when using 'unalias'"," "],vim:r("vim"),weaken:["Usage: weaken"," ","Reduces the security level of the current server. Decreasing the time it takes for all operations on this server.","Requires root access. See the wiki page for hacking mechanics."," "],wget:["Usage: wget [url] [target file]"," ","Retrieves data from a URL and downloads it to a file on the current server. The data can only ","be downloaded to a script (.script or .js) or a text file (.txt). If the file already exists, ","it will be overwritten by this command."," ","Note that it will not be possible to download data from many websites because they do not allow ","cross-origin resource sharing (CORS). Example:"," "," wget https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md game_readme.txt"," "]}},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a,r,i=n(27),o=n(256),s=n(13);!function(t){t[t.Production=0]="Production",t[t.Development=1]="Development"}(a||(a={})),function(t){t[t.Browser=0]="Browser",t[t.Steam=1]="Steam"}(r||(r={}));const l="https://github.com/danielyxie/bitburner/issues/new";function c(t,e,n){var c,f,u,m;const h=function(t,e,n){const i=navigator.userAgent.toLowerCase().indexOf(" electron/")>-1,l=a.Production,c={version:s.a.VersionString,hash:Object(o.a)(),toDisplay:()=>`v${s.a.VersionString} (${Object(o.a)()})`},f={userAgent:navigator.userAgent,language:navigator.language,cookiesEnabled:navigator.cookieEnabled,doNotTrack:navigator.doNotTrack,indexedDb:!!window.indexedDB};return{platform:i?r.Steam:r.Browser,environment:l,version:c,features:f,error:t,errorInfo:e,page:n}}(t,e,n),d=h.error.fileName,p=`lang=${h.features.language} cookiesEnabled=${h.features.cookiesEnabled.toString()} doNotTrack=${null!==(c=h.features.doNotTrack)&&void 0!==c?c:"null"} indexedDb=${h.features.indexedDb.toString()}`,g=`${h.error.name}: ${h.error.message}${h.page&&` (at "${i.a[h.page]}")`}`,y=`\n## ${g}\n\n### How did this happen?\n\nPlease fill this information with details if relevant.\n\n- [ ] Save file\n- [ ] Minimal scripts to reproduce the issue\n- [ ] Steps to reproduce\n\n### Environment\n\n* Error: ${null!==(f=null===(u=h.error)||void 0===u?void 0:u.toString())&&void 0!==f?f:"n/a"}\n* Page: ${h.page?i.a[h.page]:"n/a"}\n* Version: ${h.version.toDisplay()}\n* Environment: ${a[h.environment]}\n* Platform: ${r[h.platform]}\n* UserAgent: ${navigator.userAgent}\n* Features: ${p}\n* Source: ${null!=d?d:"n/a"}\n\n${h.environment===a.Development?`\n### Stack Trace\n\`\`\`\n${null===(m=h.errorInfo)||void 0===m?void 0:m.componentStack.toString().trim()}\n\`\`\`\n`:""}\n### Save\n\`\`\`\nCopy your save here if possible\n\`\`\`\n`.trim();return{metadata:h,fileName:d,features:p,title:g,body:y,issueUrl:`${l}?title=${encodeURIComponent(g)}&body=${encodeURIComponent(y)}`}}},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(34);function r(t){const e=Math.max(Math.min(t,255),0);return Object(a.a)(0,e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(34);const r={Tracking:()=>Object(a.a)(5,75)/10,"Bounty Hunter":()=>Object(a.a)(5,75)/10,Retirement:()=>Object(a.a)(5,75)/10,Investigation:()=>Object(a.a)(10,40)/10,"Undercover Operation":()=>Object(a.a)(10,40)/10,"Sting Operation":()=>Object(a.a)(3,40)/10,Raid:()=>Object(a.a)(2,40)/10,"Stealth Retirement Operation":()=>Object(a.a)(1,20)/10,Assassination:()=>Object(a.a)(1,20)/10}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(155);function r(t){const e={},n=Object.keys(a.a);for(let a=0;a=this.cards.length)throw new Error("Tried to remove invalid card from Hand by index: "+t);return new a([...this.cards.slice().splice(t,1)])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n(3),i=n(21),o=n(9);function s(t){return a.createElement(i.a,{title:null!=t.tooltip?a.createElement(r.a,null,t.tooltip):""},a.createElement(o.a,{onClick:t.onClick},t.text))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(20),r=n(161),i=n(0),o=n(1425),s=n(678),l=n(104);function c(t){const e=new o.a(t.width,t.height,t.fragments),n=Object(l.d)(t.width,t.height);return i.createElement(a.a,null,i.createElement(r.a,{sx:{width:t.width,height:t.height}},i.createElement(s.a,{width:t.width,height:t.height,ghostGrid:n,gift:e,enter:()=>{},click:()=>{}})))}},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(116),r=n(258),i=n(77),o=n(231),s=n(96),l=n(350),c=n(426);function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class u{constructor(t={hostname:"",ip:Object(l.a)()}){f(this,"contracts",[]),f(this,"cpuCores",1),f(this,"ftpPortOpen",!1),f(this,"hasAdminRights",!1),f(this,"hostname",""),f(this,"httpPortOpen",!1),f(this,"ip",""),f(this,"isConnectedTo",!1),f(this,"maxRam",0),f(this,"messages",[]),f(this,"organizationName",""),f(this,"programs",[]),f(this,"ramUsed",0),f(this,"runningScripts",[]),f(this,"scripts",[]),f(this,"serversOnNetwork",[]),f(this,"smtpPortOpen",!1),f(this,"sqlPortOpen",!1),f(this,"sshPortOpen",!1),f(this,"textFiles",[]),f(this,"purchasedByPlayer",!1),this.ip=t.ip?t.ip:Object(l.a)(),this.hostname=t.hostname,this.organizationName=null!=t.organizationName?t.organizationName:"",this.isConnectedTo=null!=t.isConnectedTo&&t.isConnectedTo,this.hasAdminRights=null!=t.adminRights&&t.adminRights}addContract(t){this.contracts.push(t)}getContract(t){for(const e of this.contracts)if(e.fn===t)return e;return null}getRunningScript(t,e){for(const n of this.runningScripts)if(n.filename===t&&Object(c.a)(n.args,e))return n;return null}getScript(t){for(let e=0;ee.fn!==t.fn):this.contracts=this.contracts.filter(e=>e.fn!==t)}removeFile(t){if(t.endsWith(".exe")||null!=t.match(/^.+\.exe-\d+(?:\.\d*)?%-INC$/)){for(let e=0;ee.startsWith(t));e>-1&&this.programs.splice(e,1),this.programs.push(t)}writeToScriptFile(t,e,n){const a={success:!1,overwritten:!1};if(!Object(i.j)(e)||!Object(s.a)(e))return a;for(let r=0;r{h.subscribe(t=>e(t))}),null===t)return r.a.createElement(r.a.Fragment,null);function d(){null!==t&&(t.onClose(),e(null))}const p=o.d[t.c.type],g=[];for(const[e,n]of p.desc(t.c.data).split("\n").entries())g.push(r.a.createElement("span",{key:e,dangerouslySetInnerHTML:{__html:n+"
"}}));return r.a.createElement(l.a,{open:null!==t,onClose:d},r.a.createElement(s.a,{variant:"h4",value:t.c.type}),r.a.createElement(f.a,null,"You are attempting to solve a Coding Contract. You have ",t.c.getMaxNumTries()-t.c.tries," tries remaining, after which the contract will self-destruct."),r.a.createElement("br",null),r.a.createElement(f.a,null,g),r.a.createElement("br",null),r.a.createElement(u.a,{autoFocus:!0,placeholder:"Enter Solution here",value:n,onChange:function(t){c(t.target.value)},onKeyDown:function(e){if(null===t)return;const a=e.target.value;e.key===i.a.ENTER&&""!==a&&(e.preventDefault(),t.onAttempt(n),c(""),d())},InputProps:{endAdornment:r.a.createElement(m.a,{onClick:()=>{t.onAttempt(n),c(""),d()}},"Solve")}}))}},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return u}));var a=n(0),r=n.n(a),i=n(39),o=n(26),s=n(127),l=n(3),c=n(9);const f=new s.a;function u(){const t=o.b.Router(),[e,n]=Object(a.useState)(!1);return Object(a.useEffect)(()=>f.subscribe(()=>n(!0)),[]),r.a.createElement(i.a,{open:e,onClose:()=>n(!1)},r.a.createElement(l.a,null,"WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.",r.a.createElement("br",null),r.a.createElement("br",null),"Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{onClick:function(){t.toBitVerse(!0,!1),n(!1)}},"Travel to the BitVerse"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(798),r=n(715),i=n(716),o=n(414),s=n(61),l=n(461),c=n(717),f=n(10),u=n(395),m=n(17),h=n(405),d=n(15),p=n(28),g=n(34),y=n(13),b=n(213);class E{constructor(){this.hp={current:10,max:10},this.skills={hacking:1,strength:1,defense:1,dexterity:1,agility:1,charisma:1,intelligence:0},this.exp={hacking:0,strength:0,defense:0,dexterity:0,agility:0,charisma:0,intelligence:0},this.mults=Object(b.a)(),this.money=1e3+y.a.Donations,this.city=m.a.Sector12,this.location=f.a.TravelAgency,this.jobs={},this.currentServer="",this.purchasedServers=[],this.hacknetNodes=[],this.hashManager=new u.a,this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.augmentations=[],this.sourceFiles=[],this.numPeopleKilled=0,this.karma=0,this.hasWseAccount=!1,this.hasTixApiAccess=!1,this.has4SData=!1,this.has4SDataTixApi=!1,this.gang=null,this.corporation=null,this.bladeburner=null,this.sleeves=[],this.sleevesFromCovenant=0,this.bitNodeN=1,this.entropy=0,this.lastUpdate=0,this.lastSave=0,this.totalPlaytime=0,this.playtimeSinceLastAug=0,this.playtimeSinceLastBitnode=0,this.moneySourceA=new h.a,this.moneySourceB=new h.a,this.scriptProdSinceLastAug=0,this.exploits=[],this.achievements=[],this.terminalCommandHistory=[],this.focus=!1,this.currentWork=null,this.identifier=Object(p.c)("I-"+(new Date).getTime()+navigator.userAgent+window.innerWidth+window.innerHeight+Object(g.a)(100,999)),this.init=s.O,this.prestigeAugmentation=s.R,this.prestigeSourceFile=s.S,this.receiveInvite=s.Y,this.calculateSkill=s.o,this.calculateSkillProgress=s.p,this.updateSkillLevels=s.jb,this.resetMultipliers=s.bb,this.hasProgram=s.M,this.setMoney=s.db,this.gainMoney=s.C,this.loseMoney=s.Q,this.canAfford=s.s,this.recordMoneySource=s.Z,this.gainHackingExp=s.A,this.gainStrengthExp=s.E,this.gainDefenseExp=s.y,this.gainDexterityExp=s.z,this.gainAgilityExp=s.v,this.gainCharismaExp=s.w,this.gainIntelligenceExp=s.B,this.gainStats=s.D,this.queryStatFromString=s.T,this.startWork=c.c,this.processWork=c.b,this.finishWork=c.a,this.startFocusing=s.fb,this.stopFocusing=s.gb,this.takeDamage=s.hb,this.regenerateHp=s.ab,this.hospitalize=s.N,this.applyForJob=s.f,this.getNextCompanyPosition=s.H,this.quitJob=s.V,this.hasJob=s.L,this.applyForSoftwareJob=s.m,this.applyForSoftwareConsultantJob=s.l,this.applyForItJob=s.e,this.applyForSecurityEngineerJob=s.j,this.applyForNetworkEngineerJob=s.g,this.applyForBusinessJob=s.c,this.applyForBusinessConsultantJob=s.b,this.applyForSecurityJob=s.k,this.applyForAgentJob=s.a,this.applyForEmployeeJob=s.d,this.applyForPartTimeEmployeeJob=s.h,this.applyForWaiterJob=s.n,this.applyForPartTimeWaiterJob=s.i,this.isQualified=s.P,this.reapplyAllAugmentations=s.W,this.reapplyAllSourceFiles=s.X,this.checkForFactionInvitations=s.t,this.setBitNodeNumber=s.cb,this.queueAugmentation=s.U,this.gainCodingContractReward=s.x,this.travel=s.ib,this.gotoLocation=s.K,this.canAccessGrafting=s.r,this.giveExploit=s.J,this.giveAchievement=s.I,this.getIntelligenceBonus=s.G,this.getCasinoWinnings=s.F,this.hasAugmentation=a.b,this.canAccessBladeburner=r.a,this.inBladeburner=r.b,this.startBladeburner=r.c,this.canAccessCorporation=i.a,this.hasCorporation=i.b,this.startCorporation=i.c,this.canAccessGang=o.a,this.isAwareOfGang=o.f,this.getGangFaction=o.b,this.getGangName=o.c,this.hasGangWith=o.d,this.inGang=o.e,this.startGang=o.g,this.hasTorRouter=l.f,this.getCurrentServer=l.b,this.getHomeComputer=l.c,this.getUpgradeHomeRamCost=l.e,this.getUpgradeHomeCoresCost=l.d,this.createHacknetServer=l.a,this.canAccessCotMG=s.q,this.sourceFileLvl=s.eb,this.applyEntropy=a.a,this.focusPenalty=s.u}whoAmI(){return"Player"}toJSON(){return Object(d.b)("PlayerObject",this)}static fromJSON(t){return Object(d.a)(E,t.data)}}d.c.constructors.PlayerObject=E},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return m}));var a=n(0),r=n.n(a),i=n(105),o=n(39),s=n(26),l=n(127),c=n(3),f=n(9);const u=new l.a;function m(){const[t,e]=Object(a.useState)(null),n=s.b.Player();return Object(a.useEffect)(()=>u.subscribe(t=>e(t)),[]),r.a.createElement(o.a,{open:null!==t,onClose:()=>e(null)},r.a.createElement(c.a,{variant:"h4"},"You have received a faction invitation."),r.a.createElement(c.a,null,"Would you like to join ",(t||{name:""}).name,"? ",r.a.createElement("br",null),r.a.createElement("br",null),"Warning: Joining this faction may prevent you from joining other factions during this run!"),r.a.createElement(f.a,{onClick:function(){if(null===t)return;-1===n.factionInvitations.findIndex(e=>e===t.name)&&console.error("Could not find faction in Player.factionInvitations"),Object(i.d)(t),e(null)}},"Join!"),r.a.createElement(f.a,{onClick:()=>e(null)},"Decide later"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(259),r=function(t,e,n=0){this.sourceCode=t,this.sourceCodeLineOffset=n,"string"==typeof t&&(t=a.a(t,r.PARSE_OPTIONS)),this.ast=t,this.initFunc_=e,this.paused_=!1,this.polyfills_=[],this.functionCounter_=0,this.stepFunctions_=Object.create(null);var i,o,s=/^step([A-Z]\w*)$/;for(var l in this)"function"==typeof this[l]&&(i=l.match(s))&&(this.stepFunctions_[i[1]]=this[l].bind(this));this.global=this.createScope(this.ast,null),this.ast=a.a(this.polyfills_.join("\n"),r.PARSE_OPTIONS),this.polyfills_=void 0,this.stripLocations_(this.ast,void 0,void 0),(o=new r.State(this.ast,this.global)).done=!1,this.stateStack=[o],this.run(),this.value=void 0,this.ast=t,(o=new r.State(this.ast,this.global)).done=!1,this.stateStack.length=0,this.stateStack[0]=o,this.nodeConstructor=o.node.constructor,this.stateStack=this.stateStack}; +!function(t){function e(e){for(var a,o,s=e[0],l=e[1],c=e[2],u=0,m=[];un)throw L(t.workerScript,`Too many threads requested by ${t.function}. Requested: ${e}. Has: ${n}.`);return a},checkEnvFlags:function(t){const e=t.workerScript;if(e.env.stopFlag)throw new i.a(e);if(e.env.runningFn&&"asleep"!==t.function)throw e.errorMessage=L(e,`Concurrent calls to Netscript functions are not allowed!\n Did you forget to await hack(), grow(), or some other\n promise-returning function?\n Currently running: ${e.env.runningFn} tried to run: ${t.function}`),e.delayReject&&e.delayReject(new i.a(e)),new i.a(e)},checkSingularityAccess:function(t){if(4!==r.a.bitNodeN&&0===r.a.sourceFileLvl(4))throw O(t,"This singularity function requires Source-File 4 to run. A power up you obtain later in the game.\n It will be very obvious when and how you can obtain it.")},netscriptDelay:function(t,e){const n=t.workerScript;return new Promise((function(a,r){n.delay=window.setTimeout(()=>{n.delay=null,n.delayReject=void 0,n.env.runningFn="",n.env.stopFlag?r(new i.a(n)):a()},e),n.delayReject=r,n.env.runningFn=t.function}))},updateDynamicRam:function(t,e){const n=t.workerScript,a=t.function;if(n.dynamicLoadedFns[a])return;n.dynamicLoadedFns[a]=!0;let r=n.scriptRef.threads;"number"!=typeof r&&(console.warn(`WorkerScript detected NaN for threadcount for ${n.name} on ${n.hostname}`),r=1);if(n.dynamicRamUsage+=e,n.dynamicRamUsage>1.01*n.ramUsage)throw n.errorMessage=L(n,`Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${a}.\n This is probably because you somehow circumvented the static RAM calculation.\n\n Threads: ${r}\n Dynamic RAM Usage: ${s.a.formatRAM(n.dynamicRamUsage)}\n Static RAM Usage: ${s.a.formatRAM(n.ramUsage)}\n\n One of these could be the reason:\n * Using eval() to get a reference to a ns function\n   const myScan = eval('ns.scan');\n\n * Using map access to do the same\n   const myScan = ns['scan'];\n\n Sorry :(`),new i.a(n)},city:function(t,e,n){if("string"!=typeof n)throw O(t,e+" should be a city name.");const a=n;if(!Object.values(l.a).includes(a))throw O(t,e+" should be a city name.");return a},getServer:M,scriptIdentifier:function(t,e,n,a){const r=t.workerScript;if(void 0===e)return r.pid;if("number"==typeof e)return e;if("string"==typeof e){const r=void 0===n?t.workerScript.hostname:C(t,"hostname",n),i=void 0===a?[]:x(t,a);return{scriptname:e,hostname:r,args:i}}throw new Error("not implemented")},hack:async function(t,e,n,{threads:a,stock:i}={}){const o=t.workerScript,l=S.resolveNetscriptRequestedThreads(t,a),g=M(t,e);if(!(g instanceof c.a))throw O(t,"Cannot be executed on this server.");const y=Object(f.d)(g,r.a),b=Object(u.b)(g,r.a);if(!b.res)throw O(t,b.msg||"");return T(t,()=>`Executing on '${g.hostname}' in ${Object(m.b)(1e3*y,!0)} (t=${s.a.formatThreads(l)})`),S.netscriptDelay(t,1e3*y).then((function(){const e=Object(f.b)(g,r.a),a=Math.random();let c=Object(f.c)(g,r.a)*l;const u=c/4;if(ag.moneyAvailable&&(m=g.moneyAvailable),g.moneyAvailable-=m,g.moneyAvailable<0&&(g.moneyAvailable=0);let y=m*h.a.ScriptHackMoneyGain;return n&&(y=m*h.a.ManualHackMoney),r.a.gainMoney(y,"hacking"),o.scriptRef.onlineMoneyMade+=y,r.a.scriptProdSinceLastAug+=y,o.scriptRef.recordHack(g.hostname,y,l),r.a.gainHackingExp(c),n&&r.a.gainIntelligenceExp(.005),o.scriptRef.onlineExpGained+=c,T(t,()=>`Successfully hacked '${g.hostname}' for ${s.a.formatMoney(y)} and ${s.a.formatExp(c)} exp (t=${s.a.formatThreads(l)})`),g.fortify(d.a.ServerFortifyAmount*Math.min(l,a)),i&&Object(p.c)(g,m),n&&(g.backdoorInstalled=!0),Promise.resolve(y)}return r.a.gainHackingExp(u),o.scriptRef.onlineExpGained+=u,T(t,()=>`Failed to hack '${g.hostname}'. Gained ${s.a.formatExp(u)} exp (t=${s.a.formatThreads(l)})`),Promise.resolve(0)}))},getValidPort:function(t,e){if(isNaN(e))throw O(t,`Invalid argument. Must be a port number between 1 and ${d.a.NumNetscriptPorts}, is ${e}`);if((e=Math.round(e))<1||e>d.a.NumNetscriptPorts)throw O(t,`Trying to use an invalid port: ${e}. Only ports 1-${d.a.NumNetscriptPorts} are valid.`);const n=g.a[e-1];if(null==n||!(n instanceof Object))throw O(t,`Could not find port: ${e}. This is a bug. Report to dev.`);return n},player:function(t,e){if(!A({hp:void 0,mults:void 0,numPeopleKilled:void 0,money:void 0,city:void 0,location:void 0,bitNodeN:void 0,totalPlaytime:void 0,playtimeSinceLastAug:void 0,playtimeSinceLastBitnode:void 0,jobs:void 0,factions:void 0,tor:void 0,inBladeburner:void 0,hasCorporation:void 0,entropy:void 0},e))throw O(t,"player should be a Player.");return e},server:function(t,e){if(!A({cpuCores:void 0,ftpPortOpen:void 0,hasAdminRights:void 0,hostname:void 0,httpPortOpen:void 0,ip:void 0,isConnectedTo:void 0,maxRam:void 0,organizationName:void 0,ramUsed:void 0,smtpPortOpen:void 0,sqlPortOpen:void 0,sshPortOpen:void 0,purchasedByPlayer:void 0,backdoorInstalled:void 0,baseDifficulty:void 0,hackDifficulty:void 0,minDifficulty:void 0,moneyAvailable:void 0,moneyMax:void 0,numOpenPortsRequired:void 0,openPortCount:void 0,requiredHackingSkill:void 0,serverGrowth:void 0},e))throw O(t,"server should be a Server.");return e},gang:function(t,e){if(!A({respect:0,territory:0,wantedLevel:0},e))throw O(t,"gang should be a Gang.");return e},gangMember:function(t,e){if(!A(new y.a,e))throw O(t,"member should be a GangMember.");return e},gangTask:function(t,e){if(!A(new b.a("","",!1,!1,{}),e))throw O(t,"task should be a GangMemberTask.");return e},log:T,getFunctionNames:function t(e,n){const a=[];for(const[r,i]of Object.entries(e))"args"!==r&&("function"==typeof i?a.push(n+r):"object"==typeof i&&a.push(...t(i,r+".")));return a},getRunningScript:function(t,e){return"number"==typeof e?function(t){for(const e of Object(a.c)()){const n=Object(v.b)(t,e);if(n)return n}return null}(e):R(t,e.scriptname,e.hostname,e.args)},getRunningScriptByArgs:R,getCannotFindRunningScriptErrorMessage:function(t){return"number"==typeof t?"Cannot find running script with pid: "+t:`Cannot find running script ${t.scriptname} on server ${t.hostname} with args: ${Object(k.a)(t.args)}`},createPublicRunningScript:function(t){return{args:t.args.slice(),filename:t.filename,logs:t.logs.slice(),offlineExpGained:t.offlineExpGained,offlineMoneyMade:t.offlineMoneyMade,offlineRunningTime:t.offlineRunningTime,onlineExpGained:t.onlineExpGained,onlineMoneyMade:t.onlineMoneyMade,onlineRunningTime:t.onlineRunningTime,pid:t.pid,ramUsage:t.ramUsage,server:t.server,threads:t.threads}},failOnHacknetServer:function(t,e,n=""){return e instanceof w.a&&(t.workerScript.log(n,()=>"Does not work on Hacknet Servers"),!0)}},_=t=>null===t?"Is null.":void 0===t?"Is undefined.":"function"==typeof t?"Is a function.":`Is of type '${typeof t}', value: ${(t=>{const e=t=>t.length>15?t.slice(0,12)+"...":t;if("number"==typeof t)return String(t);if("string"==typeof t)return""===t?"empty string":`'${e(t)}'`;const n=JSON.stringify(t);return n?`'${e(n)}'`:"???"})(t)}`;function C(t,e,n){if("string"==typeof n)return n;if("number"==typeof n)return n+"";throw O(t,`'${e}' should be a string. ${_(n)}`)}function x(t,e){if(!function(t){return Array.isArray(t)&&t.every(t=>"string"==typeof t||"number"==typeof t||"boolean"==typeof t)}(e))throw O(t,"'args' is not an array of script args");return e}function L(t,e){for(const n of t.scriptRef.dependencies)e=e.replace(new RegExp(n.url,"g"),n.filename);return"|DELIMITER|"+t.hostname+"|DELIMITER|"+t.name+"|DELIMITER|"+e}function O(t,e){const n=(new Error).stack;if(void 0===n)throw new Error("how did we not throw an error?");const a=n.split("\n").slice(1),r=t.workerScript,i=t.function,o=r.getServer().scripts,s=[];for(const t of a){let e;for(const n of o){n.filename&&t.includes(n.filename)&&(e=n.filename);for(const a of n.dependencies)t.includes(a.filename)&&(e=a.filename)}if(!e)continue;function l(t){const e=t.match(/.*:(\d+):\d+.*/),n=t.match(/.*at (.+) \(.*/);return e&&n?{line:e[1],func:n[1]}:null}let n={line:"-1",func:"unknown"};const a=l(t);function c(t){const e=t.match(/.*:(\d+):\d+$/),n=t.lastIndexOf("@");return e&&-1!==n?{line:e[1],func:t.slice(0,n)}:null}a&&(n=a);const r=c(t);r&&(n=r),s.push(`${e}:L${n.line}@${n.func}`)}r.log(i,()=>e);let f=`${i}: ${e}`;return 0!==s.length&&(f+="

Stack:
"+s.join("
")),L(r,f)}function M(t,e){const n=Object(a.d)(e);if(null==n){throw O(t,"Invalid hostname: "+(""===e?"'' (empty string)":"'"+e+"'"))}return n}function A(t,e){if("object"!=typeof e||null==e)return!1;const n=Object.keys(t),a=Object.keys(e);for(const t of n)if(!a.includes(t))return!1;return!0}function T(t,e){t.workerScript.log(t.functionPath,e)}function R(t,e,n,a){if(!Array.isArray(a))throw S.makeRuntimeRejectMsg(t.workerScript,`Invalid scriptArgs argument passed into getRunningScript() from ${t.function}(). This is probably a bug. Please report to game developer`);if(null!=e&&"string"==typeof e){null==n&&(n=t.workerScript.hostname);const r=S.getServer(t,n);return Object(v.a)(e,a,r)}return t.workerScript.scriptRef}},,,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.Illuminati="Illuminati",t.Daedalus="Daedalus",t.TheCovenant="The Covenant",t.ECorp="ECorp",t.MegaCorp="MegaCorp",t.BachmanAssociates="Bachman & Associates",t.BladeIndustries="Blade Industries",t.NWO="NWO",t.ClarkeIncorporated="Clarke Incorporated",t.OmniTekIncorporated="OmniTek Incorporated",t.FourSigma="Four Sigma",t.KuaiGongInternational="KuaiGong International",t.FulcrumSecretTechnologies="Fulcrum Secret Technologies",t.BitRunners="BitRunners",t.TheBlackHand="The Black Hand",t.NiteSec="NiteSec",t.Aevum="Aevum",t.Chongqing="Chongqing",t.Ishima="Ishima",t.NewTokyo="New Tokyo",t.Sector12="Sector-12",t.Volhaven="Volhaven",t.SpeakersForTheDead="Speakers for the Dead",t.TheDarkArmy="The Dark Army",t.TheSyndicate="The Syndicate",t.Silhouette="Silhouette",t.Tetrads="Tetrads",t.SlumSnakes="Slum Snakes",t.Netburners="Netburners",t.TianDiHui="Tian Di Hui",t.CyberSec="CyberSec",t.Bladeburners="Bladeburners",t.ChurchOfTheMachineGod="Church of the Machine God",t.ShadowsOfAnarchy="Shadows of Anarchy"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(179),r=n(347),i=n(421),o=n(124);const s={ActiveScriptsServerPageSize:10,ActiveScriptsScriptPageSize:10,AutosaveInterval:60,CodeInstructionRunTime:50,DisableASCIIArt:!1,DisableHotkeys:!1,DisableTextEffects:!1,DisableOverviewProgressBars:!1,EnableBashHotkeys:!1,TimestampsFormat:"",Locale:"en",MaxRecentScriptsCapacity:50,MaxLogCapacity:50,MaxPortCapacity:50,MaxTerminalCapacity:500,RemoteFileApiPort:0,SaveGameOnFileSave:!0,SuppressBuyAugmentationConfirmation:!1,SuppressFactionInvites:!1,SuppressMessages:!1,SuppressTravelConfirmation:!1,SuppressBladeburnerPopup:!1,SuppressTIXPopup:!1,SuppressSavedGameToast:!1,SuppressAutosaveDisabledWarnings:!1,UseIEC60027_2:!1,ExcludeRunningScriptsFromSave:!1,IsSidebarOpened:!0,theme:r.a,styles:i.a,overview:{x:0,y:0,opened:!0},EditorTheme:o.a},l={ActiveScriptsServerPageSize:s.ActiveScriptsServerPageSize,ActiveScriptsScriptPageSize:s.ActiveScriptsScriptPageSize,AutosaveInterval:s.AutosaveInterval,CodeInstructionRunTime:25,DisableASCIIArt:s.DisableASCIIArt,DisableHotkeys:s.DisableHotkeys,DisableTextEffects:s.DisableTextEffects,DisableOverviewProgressBars:s.DisableOverviewProgressBars,EnableBashHotkeys:s.EnableBashHotkeys,TimestampsFormat:s.TimestampsFormat,Locale:"en",MaxRecentScriptsCapacity:s.MaxRecentScriptsCapacity,MaxLogCapacity:s.MaxLogCapacity,MaxPortCapacity:s.MaxPortCapacity,MaxTerminalCapacity:s.MaxTerminalCapacity,OwnedAugmentationsOrder:a.a.AcquirementTime,PurchaseAugmentationsOrder:a.b.Default,RemoteFileApiPort:s.RemoteFileApiPort,SaveGameOnFileSave:s.SaveGameOnFileSave,SuppressBuyAugmentationConfirmation:s.SuppressBuyAugmentationConfirmation,SuppressFactionInvites:s.SuppressFactionInvites,SuppressMessages:s.SuppressMessages,SuppressTravelConfirmation:s.SuppressTravelConfirmation,SuppressBladeburnerPopup:s.SuppressBladeburnerPopup,SuppressTIXPopup:s.SuppressTIXPopup,SuppressSavedGameToast:s.SuppressSavedGameToast,SuppressAutosaveDisabledWarnings:s.SuppressAutosaveDisabledWarnings,UseIEC60027_2:s.UseIEC60027_2,ExcludeRunningScriptsFromSave:s.ExcludeRunningScriptsFromSave,IsSidebarOpened:s.IsSidebarOpened,MonacoTheme:"monokai",MonacoInsertSpaces:!1,MonacoFontSize:20,MonacoVim:!1,MonacoWordWrap:"off",theme:{...r.a},styles:{...i.a},overview:s.overview,EditorTheme:{...o.a},init(){Object.assign(l,s)},load(t){const e=JSON.parse(t);Object.assign(l.theme,e.theme),delete e.theme,Object.assign(l.styles,e.styles),delete e.styles,Object.assign(l.overview,e.overview),delete e.overview,Object.assign(l.EditorTheme,e.EditorTheme),delete e.EditorTheme,Object.assign(l,e)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(189),r=n.n(a),i=(n(1582),n(1583),n(1584),n(1585),n(1586),n(1587),n(1588),n(1589),n(1590),n(1591),n(1592),n(1593),n(1594),n(1595),n(6));const o=[1e15,1e18,1e21,1e24,1e27,1e30],s=["q","Q","s","S","o","n"],l=1e9,c=2**30;const f=new class{constructor(){var t,e,n;n="en",(e="defaultLocale")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,this.defaultLocale="en"}updateLocale(t){return null!=r.a.locale(t)||(console.warn("Invalid locale for numeral: "+t),r.a.locale(this.defaultLocale),!1)}format(t,e){Math.abs(t)<1e-6&&(t=0);const n=r()(t).format(e);return"NaN"===n?""+t:n}formatBigNumber(t){return this.format(t,"0.000a")}formatReallyBigNumber(t,e=3){const n=Math.abs(t);if(t===1/0)return"∞";for(let a=0;aObject(o.a)({unbuyable:{color:t.palette.action.disabled},money:{color:t.colors.money}}));function l(t){const e=s();if(void 0!==t.player){if("number"!=typeof t.money)throw new Error("if player if provided, money should be number, contact dev");if(!t.player.canAfford(t.money))return a.createElement("span",{className:e.unbuyable},r.a.formatMoney(t.money))}return a.createElement("span",{className:e.money},"number"==typeof t.money?r.a.formatMoney(t.money):t.money)}},function(t,e,n){"use strict";n.d(e,"d",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"g",(function(){return p})),n.d(e,"e",(function(){return g})),n.d(e,"a",(function(){return y})),n.d(e,"f",(function(){return b})),n.d(e,"i",(function(){return E})),n.d(e,"h",(function(){return v})),n.d(e,"j",(function(){return k}));var a=n(45),r=n(382),i=n(350),o=n(34),s=n(15),l=n(1051),c=n(89),f=n(22);let u={};function m(t){if(u.hasOwnProperty(t)){const e=u[t];if(e)return e}if(!Object(l.a)(t))return function(t){for(const e of Object.keys(u)){const n=u[e];if(n.hostname==t)return n}return null}(t);const e=function(t){for(const e of Object.keys(u)){const n=u[e];if(n.ip===t)return n}}(t);return void 0!==e?e:null}function h(){const t=[];for(const e of Object.keys(u))t.push(u[e]);return t}function d(t){for(const e of Object.keys(u)){const n=u[e];if(n.ip===t||n.hostname===t){delete u[e];break}}}function p(t){for(const e in u)if(u[e].ip===t)return!0;return!1}function g(){let t;do{t=Object(i.a)()}while(p(t));return t}function y(t){if(m(t.hostname))throw console.warn("Hostname of the server thats being added: "+t.hostname),console.warn("The server that already has this IP is: "+u[t.hostname].hostname),new Error("Error: Trying to add a server with an existing IP");u[t.hostname]=t}function b(t){const e=[];for(let t=0;t<15;t++)e.push([]);const n=t=>"number"==typeof t?t:Object(o.a)(t.min,t.max);for(const t of r.a){const r={hostname:t.hostname,ip:g(),numOpenPortsRequired:t.numOpenPortsRequired,organizationName:t.organizationName};void 0!==t.maxRamExponent&&(r.maxRam=Math.pow(2,n(t.maxRamExponent))),t.hackDifficulty&&(r.hackDifficulty=n(t.hackDifficulty)),t.moneyAvailable&&(r.moneyAvailable=n(t.moneyAvailable)),t.requiredHackingSkill&&(r.requiredHackingSkill=n(t.requiredHackingSkill)),t.serverGrowth&&(r.serverGrowth=n(t.serverGrowth));const i=new a.a(r);for(const e of t.literature||[])i.messages.push(e);i.hostname===c.a.WorldDaemon&&(i.requiredHackingSkill*=f.a.WorldDaemonDifficulty),y(i),void 0!==t.networkLayer&&e[n(t.networkLayer)-1].push(i)}const i=(t,e)=>{for(const r of t)n=r,a=e(),n.serversOnNetwork.push(a.hostname),a.serversOnNetwork.push(n.hostname);var n,a};i(e[0],()=>t);for(let t=1;t{return(n=e[t-1])[Math.floor(Math.random()*n.length)];var n})}function E(){for(const t of Object.keys(u))delete u[t];u={}}function v(t){u=JSON.parse(t,s.c)}function k(t=!1){const e=JSON.parse(JSON.stringify(u),s.c);for(const n of Object.keys(e)){const a=e[n];if(t)a.runningScripts=[];else for(let t=0;tObject(a.useContext)(i.Player),Router:()=>Object(a.useContext)(i.Router)}},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.ActiveScripts=0]="ActiveScripts",t[t.Augmentations=1]="Augmentations",t[t.BitVerse=2]="BitVerse",t[t.Bladeburner=3]="Bladeburner",t[t.City=4]="City",t[t.Corporation=5]="Corporation",t[t.CreateProgram=6]="CreateProgram",t[t.ScriptEditor=7]="ScriptEditor",t[t.DevMenu=8]="DevMenu",t[t.Faction=9]="Faction",t[t.Factions=10]="Factions",t[t.Gang=11]="Gang",t[t.Hacknet=12]="Hacknet",t[t.Infiltration=13]="Infiltration",t[t.Job=14]="Job",t[t.Milestones=15]="Milestones",t[t.Options=16]="Options",t[t.Grafting=17]="Grafting",t[t.Sleeves=18]="Sleeves",t[t.Stats=19]="Stats",t[t.StockMarket=20]="StockMarket",t[t.Terminal=21]="Terminal",t[t.Travel=22]="Travel",t[t.Tutorial=23]="Tutorial",t[t.Work=24]="Work",t[t.BladeburnerCinematic=25]="BladeburnerCinematic",t[t.Location=26]="Location",t[t.Loading=27]="Loading",t[t.StaneksGift=28]="StaneksGift",t[t.Recovery=29]="Recovery",t[t.Achievements=30]="Achievements",t[t.ThemeBrowser=31]="ThemeBrowser",t[t.ImportSave=32]="ImportSave"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"f",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"e",(function(){return l})),n.d(e,"c",(function(){return c}));var a=n(163);function r(t,e=!1){t=Math.floor(t);const n=Math.floor(t/1e3),a=Math.floor(n/86400),r=n%86400,i=Math.floor(r/3600),o=r%3600,s=Math.floor(o/60),l=o%60,c=(()=>{let e=""+t%1e3;for(;e.length<3;)e="0"+e;return e})();let f="";return a>0&&(f+=a+" days "),i>0&&(f+=i+" hours "),s>0&&(f+=s+" minutes "),f+=(e?`${l}.${c}`:""+l)+" seconds",f}function i(t){if(!o(t))return"";if(0===t.length)return"";const e=t.concat().sort(),n=e[0],a=e[e.length-1],r=n.length;let i=0;for(;i>>16,2246822507)^Math.imul(a^a>>>13,3266489909),a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&a)+(n>>>0)).toString(16)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"c",(function(){return c}));var a=n(201),r=n(393),i=n(15);let o={};function s(t){o=JSON.parse(t,i.c);for(const t of Object.keys(o))try{o[t].getInfo()}catch(e){console.error("deleting "+t),delete o[t]}}function l(t){return o.hasOwnProperty(t)}function c(){for(const t of Object.keys(r.a))f(new a.a(t))}function f(t){if(!(t instanceof a.a))throw new Error("Invalid argument 'newFactionObject' passed into resetFaction()");const e=t.name;l(e)&&(t.favor=o[e].favor,delete o[e]),function(t){const e=t.name;o[e]=t}(t)}},function(t,e,n){"use strict";let a,r;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r})),function(t){t.ENTER="Enter",t.ESC="Escape",t.TAB="Tab",t.SPACE=" ",t.BACKSPACE="Backspace",t.UP_ARROW="ArrowUp",t.DOWN_ARROW="ArrowDown",t.LEFT_ARROW="ArrowLeft",t.RIGHT_ARROW="ArrowRight",t.QUOTE="'",t.DOUBLE_QUOTE='"',t.OPEN_BRACKET="[",t.CLOSE_BRACKET="]",t.LESS_THAN="<",t.GREATER_THAN=">",t.OPEN_PARENTHESIS="(",t.CLOSE_PARENTHESIS=")",t.OPEN_BRACE="{",t.CLOSE_BRACE="}",t.EQUAL="=",t.PIPE="|",t.DOT=".",t.FORWARD_SLASH="/",t.HYPHEN="-",t.HASH="#",t.k0="0",t.k1="1",t.k2="2",t.k3="3",t.k4="4",t.k5="5",t.k6="6",t.k7="7",t.k8="8",t.k9="9",t.A="a",t.B="b",t.C="c",t.D="d",t.E="e",t.F="f",t.G="g",t.H="h",t.I="i",t.J="j",t.K="k",t.L="l",t.M="m",t.N="n",t.O="o",t.P="p",t.Q="q",t.R="r",t.S="s",t.T="t",t.U="u",t.V="v",t.W="w",t.X="x",t.Y="y",t.Z="z"}(a||(a={})),function(t){t.ENTER="Enter",t.ESC="Escape",t.TAB="Tab",t.SPACE="Space",t.BACKSPACE="Backspace",t.UP_ARROW="ArrowUp",t.DOWN_ARROW="ArrowDown",t.LEFT_ARROW="ArrowLeft",t.RIGHT_ARROW="ArrowRight",t.BACKWARD_SLASH="Backslash",t.BACKQUOTE="Backquote",t.COMMA="Comma",t.DOT="Period",t.EQUAL="Equal",t.FORWARD_SLASH="Slash",t.HYPHEN="Minus",t.SEMICOLON="Semicolon",t.QUOTE="Quote",t.k0="Digit0",t.k1="Digit1",t.k2="Digit2",t.k3="Digit3",t.k4="Digit4",t.k5="Digit5",t.k6="Digit6",t.k7="Digit7",t.k8="Digit8",t.k9="Digit9",t.A="KeyA",t.B="KeyB",t.C="KeyC",t.D="KeyD",t.E="KeyE",t.F="KeyF",t.G="KeyG",t.H="KeyH",t.I="KeyI",t.J="KeyJ",t.K="KeyK",t.L="KeyL",t.M="KeyM",t.N="KeyN",t.O="KeyO",t.P="KeyP",t.Q="KeyQ",t.R="KeyR",t.S="KeyS",t.T="KeyT",t.U="KeyU",t.V="KeyV",t.W="KeyW",t.X="KeyX",t.Y="KeyY",t.Z="KeyZ"}(r||(r={}))},,function(t,e,n){"use strict";n.d(e,"j",(function(){return a})),n.d(e,"d",(function(){return r})),n.d(e,"i",(function(){return i})),n.d(e,"f",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"h",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"e",(function(){return f})),n.d(e,"k",(function(){return u})),n.d(e,"c",(function(){return m})),n.d(e,"g",(function(){return h}));const a=["Software Engineering Intern","Junior Software Engineer","Senior Software Engineer","Lead Software Developer","Head of Software","Head of Engineering","Vice President of Technology","Chief Technology Officer"],r=["IT Intern","IT Analyst","IT Manager","Systems Administrator"],i=["Security Engineer"],o=["Network Engineer","Network Administrator"],s=["Business Intern","Business Analyst","Business Manager","Operations Manager","Chief Financial Officer","Chief Executive Officer"],l=["Police Officer","Police Chief","Security Guard","Security Officer","Security Supervisor","Head of Security"],c=["Field Agent","Secret Agent","Special Operative"],f=["Waiter","Employee"],u=["Software Consultant","Senior Software Consultant"],m=["Business Consultant","Senior Business Consultant"],h=["Part-time Waiter","Part-time Employee"]},,function(t,e,n){"use strict";function a(t,e){const n=Math.min(t,e),a=Math.max(t,e);return Math.floor(Math.random()*(a-n+1))+n}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(17);const r=["START","PURCHASE","PRODUCTION","SALE","EXPORT"],i={INITIALSHARES:1e9,SHARESPERPRICEUPDATE:1e6,IssueNewSharesCooldown:216e3,SellSharesCooldown:18e3,CyclesPerMarketCycle:50,CyclesPerIndustryStateCycle:50/r.length,SecsPerMarketCycle:10,Cities:[a.a.Aevum,a.a.Chongqing,a.a.Sector12,a.a.NewTokyo,a.a.Ishima,a.a.Volhaven],WarehouseInitialCost:5e9,WarehouseInitialSize:100,WarehouseUpgradeBaseCost:1e9,OfficeInitialCost:4e9,OfficeInitialSize:3,OfficeUpgradeBaseCost:1e9,BribeThreshold:1e14,BribeToRepRatio:1e9,ProductProductionCostRatio:5,DividendMaxRate:1,EmployeeSalaryMultiplier:3,CyclesPerEmployeeRaise:400,EmployeeRaiseAmount:50,BaseMaxProducts:3,AllCorporationStates:r,AllMaterials:["Water","Energy","Food","Plants","Metal","Hardware","Chemicals","Drugs","Robots","AI Cores","Real Estate"],AllIndustryTypes:["Energy","Utilities","Agriculture","Fishing","Mining","Food","Tobacco","Chemical","Pharmaceutical","Hardware","Robotics","Software","Healthcare","RealEstate"],AllUnlocks:["Export","Smart Supply","Market Research - Demand","Market Data - Competition","VeChain","Shady Accounting","Government Partnership","Warehouse API","Office API"],AllUpgrades:["Smart Factories","Smart Storage","DreamSense","Wilson Analytics","Nuoptimal Nootropic Injector Implants","Speech Processor Implants","Neural Accelerators","FocusWires","ABC SalesBots","Project Insight"],AllResearch:["Hi-Tech R&D Laboratory","AutoBrew","AutoPartyManager","Automatic Drug Administration","Bulk Purchasing","CPH4 Injections","Drones","Drones - Assembly","Drones - Transport","Go-Juice","HRBuddy-Recruitment","HRBuddy-Training","JoyWire","Market-TA.I","Market-TA.II","Overclock","Self-Correcting Assemblers","Sti.mu","sudo.Assist","uPgrade: Capacity.I","uPgrade: Capacity.II","uPgrade: Dashboard","uPgrade: Fulcrum"],FundingRoundShares:[.1,.35,.25,.2],FundingRoundMultiplier:[4,3,3,2.5],AvgProfitLength:1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return y}));var a=n(0),r=n(29),i=n(7),o=n(23),s=n(15),l=n(5),c=n(12),f=n(13),u=n(74),m=n(22),h=n(114),d=n(367),p=n(213);function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class y{constructor(t={info:"",moneyCost:0,name:"",repCost:0,factions:[]}){g(this,"baseCost",0),g(this,"baseRepRequirement",0),g(this,"isSpecial",!1),g(this,"name",""),g(this,"prereqs",[]),g(this,"mults",Object(p.a)()),g(this,"factions",[]),this.name=t.name,this.info=t.info,this.prereqs=t.prereqs?t.prereqs:[],this.baseRepRequirement=t.repCost,Object.freeze(this.baseRepRequirement),this.baseCost=t.moneyCost,Object.freeze(this.baseCost),this.factions=t.factions,t.isSpecial&&(this.isSpecial=!0),t.hacking&&(this.mults.hacking=t.hacking),t.strength&&(this.mults.strength=t.strength),t.defense&&(this.mults.defense=t.defense),t.dexterity&&(this.mults.dexterity=t.dexterity),t.agility&&(this.mults.agility=t.agility),t.charisma&&(this.mults.charisma=t.charisma),t.hacking_exp&&(this.mults.hacking_exp=t.hacking_exp),t.strength_exp&&(this.mults.strength_exp=t.strength_exp),t.defense_exp&&(this.mults.defense_exp=t.defense_exp),t.dexterity_exp&&(this.mults.dexterity_exp=t.dexterity_exp),t.agility_exp&&(this.mults.agility_exp=t.agility_exp),t.charisma_exp&&(this.mults.charisma_exp=t.charisma_exp),t.hacking_chance&&(this.mults.hacking_chance=t.hacking_chance),t.hacking_speed&&(this.mults.hacking_speed=t.hacking_speed),t.hacking_money&&(this.mults.hacking_money=t.hacking_money),t.hacking_grow&&(this.mults.hacking_grow=t.hacking_grow),t.company_rep&&(this.mults.company_rep=t.company_rep),t.faction_rep&&(this.mults.faction_rep=t.faction_rep),t.crime_money&&(this.mults.crime_money=t.crime_money),t.crime_success&&(this.mults.crime_success=t.crime_success),t.work_money&&(this.mults.work_money=t.work_money),t.hacknet_node_money&&(this.mults.hacknet_node_money=t.hacknet_node_money),t.hacknet_node_purchase_cost&&(this.mults.hacknet_node_purchase_cost=t.hacknet_node_purchase_cost),t.hacknet_node_ram_cost&&(this.mults.hacknet_node_ram_cost=t.hacknet_node_ram_cost),t.hacknet_node_core_cost&&(this.mults.hacknet_node_core_cost=t.hacknet_node_core_cost),t.hacknet_node_level_cost&&(this.mults.hacknet_node_level_cost=t.hacknet_node_level_cost),t.bladeburner_max_stamina&&(this.mults.bladeburner_max_stamina=t.bladeburner_max_stamina),t.bladeburner_stamina_gain&&(this.mults.bladeburner_stamina_gain=t.bladeburner_stamina_gain),t.bladeburner_analysis&&(this.mults.bladeburner_analysis=t.bladeburner_analysis),t.bladeburner_success_chance&&(this.mults.bladeburner_success_chance=t.bladeburner_success_chance),void 0===t.stats?this.stats=function(t,e,n){const r=(t,e=0)=>t===1.0777-1?"7.77%":t===1.777-1?"77.7%":i.a.formatPercentage(t,e);let s=a.createElement(a.Fragment,null,"Effects:");return 1!==t.hacking&&t.hacking==t.strength&&t.hacking==t.defense&&t.hacking==t.dexterity&&t.hacking==t.agility&&t.hacking==t.charisma?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking-1)," all skills"):(1!==t.hacking&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking-1)," hacking skill")),1!==t.strength&&t.strength==t.defense&&t.strength==t.dexterity&&t.strength==t.agility?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength-1)," combat skills"):(1!==t.strength&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength-1)," strength skill")),1!==t.defense&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense-1)," defense skill")),1!==t.dexterity&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity-1)," dexterity skill")),1!==t.agility&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility-1)," agility skill"))),1!==t.charisma&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma-1)," charisma skill"))),1!==t.hacking_exp&&t.hacking_exp===t.strength_exp&&t.hacking_exp===t.defense_exp&&t.hacking_exp===t.dexterity_exp&&t.hacking_exp===t.agility_exp&&t.hacking_exp===t.charisma_exp?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp-1)," exp for all skills"):(1!==t.hacking_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_exp-1)," hacking exp")),1!==t.strength_exp&&t.strength_exp===t.defense_exp&&t.strength_exp===t.dexterity_exp&&t.strength_exp===t.agility_exp?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp-1)," combat exp"):(1!==t.strength_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.strength_exp-1)," strength exp")),1!==t.defense_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.defense_exp-1)," defense exp")),1!==t.dexterity_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.dexterity_exp-1)," dexterity exp")),1!==t.agility_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.agility_exp-1)," agility exp"))),1!==t.charisma_exp&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.charisma_exp-1)," charisma exp"))),1!==t.hacking_speed&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_speed-1)," faster hack(), grow(), and weaken()")),1!==t.hacking_chance&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_chance-1)," hack() success chance")),1!==t.hacking_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_money-1)," hack() power")),1!==t.hacking_grow&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacking_grow-1)," grow() power")),1!==t.faction_rep&&t.faction_rep===t.company_rep?s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep-1)," reputation from factions and companies"):(1!==t.faction_rep&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.faction_rep-1)," reputation from factions")),1!==t.company_rep&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.company_rep-1)," reputation from companies"))),1!==t.crime_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_money-1)," crime money")),1!==t.crime_success&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.crime_success-1)," crime success rate")),1!==t.work_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.work_money-1)," work money")),1!==t.hacknet_node_money&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.hacknet_node_money-1)," hacknet production")),1!==t.hacknet_node_purchase_cost&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_purchase_cost-1))," hacknet nodes cost")),1!==t.hacknet_node_level_cost&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"-",r(-(t.hacknet_node_level_cost-1))," hacknet nodes upgrade cost")),1!==t.bladeburner_max_stamina&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_max_stamina-1)," Bladeburner Max Stamina")),1!==t.bladeburner_stamina_gain&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_stamina_gain-1)," Bladeburner Stamina gain")),1!==t.bladeburner_analysis&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_analysis-1)," Bladeburner Field Analysis effectiveness")),1!==t.bladeburner_success_chance&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"+",r(t.bladeburner_success_chance-1)," Bladeburner Contracts and Operations success chance")),n&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"Start with ",a.createElement(o.a,{money:n})," after installing Augmentations.")),e&&(s=a.createElement(a.Fragment,null,s,a.createElement("br",null),"Start with ",e.join(" and ")," after installing Augmentations.")),s}(this.mults,t.programs,t.startingMoney):this.stats=t.stats}addToFactions(t){for(let e=0;et.name),i=Math.pow(f.a.SoACostMult,r.filter(e=>t.hasAugmentation(e)).length);n=e.baseCost*i,r.find(t=>t===e.name)&&(a=e.baseRepRequirement*i)}else n=e.baseCost*Object(h.d)()*m.a.AugmentationMoneyCost,a=e.baseRepRequirement*m.a.AugmentationRepCost;return{moneyCost:n,repCost:a}}getLevel(t){if(this.name===c.a.NeuroFluxGovernor){let e=0;for(let n=0;nObject(o.a)({modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{backgroundColor:t.palette.background.default,border:"2px solid "+t.palette.primary.main,boxShadow:`0px 3px 5px -1px ${t.palette.primary.dark},0px 5px 8px 0px ${t.palette.primary.dark},0px 1px 14px 0px ${t.palette.primary.dark}`,padding:2,maxWidth:"80%",maxHeight:"80%",overflow:"auto","&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none"}})),u=t=>{const e=f();return c.a.createElement(i.a,{disableRestoreFocus:!0,disableScrollLock:!0,disableEnforceFocus:!0,disableAutoFocus:!0,open:t.open,onClose:t.onClose,closeAfterTransition:!0,className:e.modal,sx:t.sx},c.a.createElement(r.a,{in:t.open},c.a.createElement("div",{className:e.paper},c.a.createElement(a.a,{sx:{m:2}},t.children))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"c",(function(){return r})),n.d(e,"b",(function(){return i}));const a={MoneyGainPerLevel:1.5,BaseCost:1e3,LevelBaseCost:1,RamBaseCost:3e4,CoreBaseCost:5e5,PurchaseNextMult:1.85,UpgradeLevelMult:1.04,UpgradeRamMult:1.28,UpgradeCoreMult:1.48,MaxLevel:200,MaxRam:64,MaxCores:16},r={x1:1,x5:5,x10:10,MAX:"MAX"},i={HashesPerLevel:.001,BaseCost:5e4,RamBaseCost:2e5,CoreBaseCost:1e6,CacheBaseCost:1e7,PurchaseMult:3.2,UpgradeLevelMult:1.1,UpgradeRamMult:1.4,UpgradeCoreMult:1.55,UpgradeCacheMult:1.85,MaxServers:20,MaxLevel:300,MaxRam:8192,MaxCores:128,MaxCache:15}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Operations:"Operations",Engineer:"Engineer",Business:"Business",Management:"Management",RandD:"Research & Development",Training:"Training",Unassigned:"Unassigned"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Idle:1,Contract:2,Operation:3,BlackOp:4,BlackOperation:4,Training:5,Recruitment:6,FieldAnalysis:7,"Field Analysis":7,Diplomacy:8,"Hyperbolic Regeneration Chamber":9,"Incite Violence":10}},function(t,e,n){"use strict";n.d(e,"f",(function(){return a})),n.d(e,"b",(function(){return u})),n.d(e,"e",(function(){return l})),n.d(e,"c",(function(){return c})),n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return f}));var a,r=n(1),i=n(66),o=n(396);!function(t){t[t.Start=0]="Start",t[t.NSSelection=1]="NSSelection",t[t.GoToCharacterPage=2]="GoToCharacterPage",t[t.CharacterPage=3]="CharacterPage",t[t.CharacterGoToTerminalPage=4]="CharacterGoToTerminalPage",t[t.TerminalIntro=5]="TerminalIntro",t[t.TerminalHelp=6]="TerminalHelp",t[t.TerminalLs=7]="TerminalLs",t[t.TerminalScan=8]="TerminalScan",t[t.TerminalScanAnalyze1=9]="TerminalScanAnalyze1",t[t.TerminalScanAnalyze2=10]="TerminalScanAnalyze2",t[t.TerminalConnect=11]="TerminalConnect",t[t.TerminalAnalyze=12]="TerminalAnalyze",t[t.TerminalNuke=13]="TerminalNuke",t[t.TerminalManualHack=14]="TerminalManualHack",t[t.TerminalHackingMechanics=15]="TerminalHackingMechanics",t[t.TerminalGoHome=16]="TerminalGoHome",t[t.TerminalCreateScript=17]="TerminalCreateScript",t[t.TerminalTypeScript=18]="TerminalTypeScript",t[t.TerminalFree=19]="TerminalFree",t[t.TerminalRunScript=20]="TerminalRunScript",t[t.TerminalGoToActiveScriptsPage=21]="TerminalGoToActiveScriptsPage",t[t.ActiveScriptsPage=22]="ActiveScriptsPage",t[t.ActiveScriptsToTerminal=23]="ActiveScriptsToTerminal",t[t.TerminalTailScript=24]="TerminalTailScript",t[t.GoToHacknetNodesPage=25]="GoToHacknetNodesPage",t[t.HacknetNodesIntroduction=26]="HacknetNodesIntroduction",t[t.HacknetNodesGoToWorldPage=27]="HacknetNodesGoToWorldPage",t[t.WorldDescription=28]="WorldDescription",t[t.TutorialPageInfo=29]="TutorialPageInfo",t[t.End=30]="End"}(a||(a={}));const s={currStep:a.Start,isRunning:!1,stepIsDone:{[a.Start]:!1,[a.NSSelection]:!1,[a.GoToCharacterPage]:!1,[a.CharacterPage]:!1,[a.CharacterGoToTerminalPage]:!1,[a.TerminalIntro]:!1,[a.TerminalHelp]:!1,[a.TerminalLs]:!1,[a.TerminalScan]:!1,[a.TerminalScanAnalyze1]:!1,[a.TerminalScanAnalyze2]:!1,[a.TerminalConnect]:!1,[a.TerminalAnalyze]:!1,[a.TerminalNuke]:!1,[a.TerminalManualHack]:!1,[a.TerminalHackingMechanics]:!1,[a.TerminalGoHome]:!1,[a.TerminalCreateScript]:!1,[a.TerminalTypeScript]:!1,[a.TerminalFree]:!1,[a.TerminalRunScript]:!1,[a.TerminalGoToActiveScriptsPage]:!1,[a.ActiveScriptsPage]:!1,[a.ActiveScriptsToTerminal]:!1,[a.TerminalTailScript]:!1,[a.GoToHacknetNodesPage]:!1,[a.HacknetNodesIntroduction]:!1,[a.HacknetNodesGoToWorldPage]:!1,[a.WorldDescription]:!1,[a.TutorialPageInfo]:!1,[a.End]:!1}};function l(){s.isRunning=!0,s.currStep=a.Start}function c(){s.stepIsDone[s.currStep]=!0,s.currStepa.Start&&(s.currStep-=1),o.a.emit()}function u(){s.isRunning=!1,s.currStep=a.Start,r.a.getHomeComputer().messages.push(i.a.HackersStartingHandbook),o.a.emit()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(598),r=n(22),i=n(1048),o=n(350),s=n(15);function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class c extends a.a{constructor(t={hostname:"",ip:Object(o.a)()}){super(t),l(this,"backdoorInstalled",!1),l(this,"baseDifficulty",1),l(this,"hackDifficulty",1),l(this,"minDifficulty",1),l(this,"moneyAvailable",0),l(this,"moneyMax",0),l(this,"numOpenPortsRequired",5),l(this,"openPortCount",0),l(this,"requiredHackingSkill",1),l(this,"serverGrowth",1),this.hostname.startsWith("hacknet-node-")&&(this.hostname=Object(i.a)(10)),this.purchasedByPlayer=null!=t.purchasedByPlayer&&t.purchasedByPlayer,this.maxRam=null!=t.maxRam?t.maxRam:0,this.requiredHackingSkill=null!=t.requiredHackingSkill?t.requiredHackingSkill:1,this.moneyAvailable=null!=t.moneyAvailable?t.moneyAvailable*r.a.ServerStartingMoney:0,this.moneyMax=25*this.moneyAvailable*r.a.ServerMaxMoney,this.hackDifficulty=null!=t.hackDifficulty?t.hackDifficulty*r.a.ServerStartingSecurity:1,this.baseDifficulty=this.hackDifficulty,this.minDifficulty=Math.max(1,Math.round(this.hackDifficulty/3)),this.serverGrowth=null!=t.serverGrowth?t.serverGrowth:1,this.numOpenPortsRequired=null!=t.numOpenPortsRequired?t.numOpenPortsRequired:5}capDifficulty(){this.hackDifficulty100&&(this.hackDifficulty=100)}changeMinimumSecurity(t,e=!1){e?this.minDifficulty*=t:this.minDifficulty+=t,this.minDifficulty=Math.max(1,this.minDifficulty)}changeMaximumMoney(t){if(this.moneyMax>1e13){const e=this.moneyMax-1e13;t=1+(t-1)/Math.log(e)/Math.log(8)}this.moneyMax*=t}fortify(t){this.hackDifficulty+=t,this.capDifficulty()}weaken(t){this.hackDifficulty-=t*r.a.ServerWeakenRate,this.capDifficulty()}toJSON(){return Object(s.b)("Server",this)}static fromJSON(t){return Object(s.a)(c,t.data)}}s.c.constructors.Server=c},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s}));var a=n(0),r=n.n(a);const i={Corporation:r.a.createContext({}),Division:r.a.createContext({})},o=()=>Object(a.useContext)(i.Corporation),s=()=>Object(a.useContext)(i.Division)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return f})),n.d(e,"e",(function(){return u}));var a=n(0),r=n.n(a),i=n(138),o=n(141);const s={Energy:"Energy",Utilities:"Water Utilities",Agriculture:"Agriculture",Fishing:"Fishing",Mining:"Mining",Food:"Food",Tobacco:"Tobacco",Chemical:"Chemical",Pharmaceutical:"Pharmaceutical",Computer:"Computer Hardware",Robotics:"Robotics",Software:"Software",Healthcare:"Healthcare",RealEstate:"RealEstate"},l={Energy:225e9,Utilities:15e10,Agriculture:4e10,Fishing:8e10,Mining:3e11,Food:1e10,Tobacco:2e10,Chemical:7e10,Pharmaceutical:2e11,Computer:5e11,Robotics:1e12,Software:25e9,Healthcare:75e10,RealEstate:6e11},c={Energy:t=>r.a.createElement(r.a.Fragment,null,"Engage in the production and distribution of energy.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Energy,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Utilities:t=>r.a.createElement(r.a.Fragment,null,"Distribute water and provide wastewater services.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Utilities,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Agriculture:t=>r.a.createElement(r.a.Fragment,null,"Cultivate crops and breed livestock to produce food.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Agriculture,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Fishing:t=>r.a.createElement(r.a.Fragment,null,"Produce food through the breeding and processing of fish and fish products.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Fishing,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Mining:t=>r.a.createElement(r.a.Fragment,null,"Extract and process metals from the earth.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Mining,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Food:t=>r.a.createElement(r.a.Fragment,null,"Create your own restaurants all around the world.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Food,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Tobacco:t=>r.a.createElement(r.a.Fragment,null,"Create and distribute tobacco and tobacco-related products.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Tobacco,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Chemical:t=>r.a.createElement(r.a.Fragment,null,"Produce industrial chemicals.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Chemical,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Pharmaceutical:t=>r.a.createElement(r.a.Fragment,null,"Discover, develop, and create new pharmaceutical drugs.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Pharmaceutical,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Computer:t=>r.a.createElement(r.a.Fragment,null,"Develop and manufacture new computer hardware and networking infrastructures.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Computer,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Robotics:t=>r.a.createElement(r.a.Fragment,null,"Develop and create robots.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Robotics,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),Software:t=>r.a.createElement(r.a.Fragment,null,"Develop computer software and create AI Cores.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Software,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: YES"),Healthcare:t=>r.a.createElement(r.a.Fragment,null,"Create and manage hospitals.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.Healthcare,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO"),RealEstate:t=>r.a.createElement(r.a.Fragment,null,"Develop and manage real estate properties.",r.a.createElement("br",null),r.a.createElement("br",null),"Starting cost: ",r.a.createElement(o.a,{money:l.RealEstate,corp:t}),r.a.createElement("br",null),"Recommended starting Industry: NO")},f={Energy:Object(i.a)(),Utilities:Object(i.a)(),Agriculture:Object(i.a)(),Fishing:Object(i.a)(),Mining:Object(i.a)(),Food:Object(i.b)(),Tobacco:Object(i.b)(),Chemical:Object(i.a)(),Pharmaceutical:Object(i.b)(),Computer:Object(i.b)(),Robotics:Object(i.b)(),Software:Object(i.b)(),Healthcare:Object(i.b)(),RealEstate:Object(i.b)()};function u(){f.Energy=Object(i.a)(),f.Utilities=Object(i.a)(),f.Agriculture=Object(i.a)(),f.Fishing=Object(i.a)(),f.Mining=Object(i.a)(),f.Food=Object(i.b)(),f.Tobacco=Object(i.b)(),f.Chemical=Object(i.a)(),f.Pharmaceutical=Object(i.b)(),f.Computer=Object(i.b)(),f.Robotics=Object(i.b)(),f.Software=Object(i.b)(),f.Healthcare=Object(i.b)(),f.RealEstate=Object(i.b)()}},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.Company=0]="Company",t[t.Gym=1]="Gym",t[t.Hospital=2]="Hospital",t[t.Slums=3]="Slums",t[t.Special=4]="Special",t[t.StockMarket=5]="StockMarket",t[t.TechVendor=6]="TechVendor",t[t.TravelAgency=7]="TravelAgency",t[t.University=8]="University",t[t.Casino=9]="Casino"}(a||(a={}))},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return p})),n.d(e,"c",(function(){return g})),n.d(e,"d",(function(){return y})),n.d(e,"b",(function(){return b}));var a=n(0),r=n.n(a),i=n(15),o=n(13),s=n(10),l=n(7),c=n(16),f=n(23),u=n(28),m=n(257),h=n(153),d=n(90);let p;!function(t){t.StudyComputerScience="STUDYCOMPUTERSCIENCE",t.DataStructures="DATASTRUCTURES",t.Networks="NETWORKS",t.Algorithms="ALGORITHMS",t.Management="MANAGEMENT",t.Leadership="LEADERSHIP",t.GymStrength="GYMSTRENGTH",t.GymDefense="GYMDEFENSE",t.GymDexterity="GYMDEXTERITY",t.GymAgility="GYMAGILITY"}(p||(p={}));const g={[p.StudyComputerScience]:{youAreCurrently:"studying Computer Science",type:p.StudyComputerScience,earnings:Object(d.c)({hackExp:.5,intExp:.01})},[p.DataStructures]:{youAreCurrently:"taking a Data Structures course",type:p.DataStructures,earnings:Object(d.c)({money:-40,hackExp:1,intExp:.01})},[p.Networks]:{youAreCurrently:"taking a Networks course",type:p.Networks,earnings:Object(d.c)({money:-80,hackExp:2,intExp:.01})},[p.Algorithms]:{youAreCurrently:"taking an Algorithms course",type:p.Algorithms,earnings:Object(d.c)({money:-320,hackExp:4,intExp:.01})},[p.Management]:{youAreCurrently:"taking a Management course",type:p.Management,earnings:Object(d.c)({money:-160,chaExp:2,intExp:.01})},[p.Leadership]:{youAreCurrently:"taking a Leadership course",type:p.Leadership,earnings:Object(d.c)({money:-320,chaExp:4,intExp:.01})},[p.GymStrength]:{youAreCurrently:"training your strength at a gym",type:p.GymStrength,earnings:Object(d.c)({money:-120,strExp:1})},[p.GymDefense]:{youAreCurrently:"training your defense at a gym",type:p.GymDefense,earnings:Object(d.c)({money:-120,defExp:1})},[p.GymDexterity]:{youAreCurrently:"training your dexterity at a gym",type:p.GymDexterity,earnings:Object(d.c)({money:-120,dexExp:1})},[p.GymAgility]:{youAreCurrently:"training your agility at a gym",type:p.GymAgility,earnings:Object(d.c)({money:-120,agiExp:1})}},y=t=>null!==t&&t.type===h.b.CLASS;class b extends h.a{constructor(t){var e,n,a,r,i,o;super(h.b.CLASS,null===(e=null==t?void 0:t.singularity)||void 0===e||e),r=this,i="earnings",o=Object(d.c)(),i in r?Object.defineProperty(r,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):r[i]=o,this.classType=null!==(n=null==t?void 0:t.classType)&&void 0!==n?n:p.StudyComputerScience,this.location=null!==(a=null==t?void 0:t.location)&&void 0!==a?a:s.a.Sector12RothmanUniversity}isGym(){return[p.GymAgility,p.GymDefense,p.GymDexterity,p.GymStrength].includes(this.classType)}getClass(){return g[this.classType]}calculateRates(t){return Object(m.a)(t,t,this.classType,this.location)}process(t,e){this.cyclesWorked+=e;const n=this.calculateRates(t),a=Object(d.a)(t,t,n,e,"class");return this.earnings=Object(d.e)(this.earnings,a),!1}finish(){this.singularity||Object(c.a)(r.a.createElement(r.a.Fragment,null,"After ",this.getClass().youAreCurrently," for"," ",Object(u.b)(this.cyclesWorked*o.a._idleSpeed),", ",r.a.createElement("br",null),"you spent a total of ",r.a.createElement(f.a,{money:-this.earnings.money}),". ",r.a.createElement("br",null),r.a.createElement("br",null),"You earned a total of: ",r.a.createElement("br",null),l.a.formatExp(this.earnings.hackExp)," hacking exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.strExp)," strength exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.defExp)," defense exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.dexExp)," dexterity exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.agiExp)," agility exp ",r.a.createElement("br",null),l.a.formatExp(this.earnings.chaExp)," charisma exp",r.a.createElement("br",null)))}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,classType:this.classType,location:this.location}}toJSON(){return Object(i.b)("ClassWork",this)}static fromJSON(t){return Object(i.a)(b,t.data)}}i.c.constructors.ClassWork=b},function(t,e,n){"use strict";n.d(e,"g",(function(){return d})),n.d(e,"l",(function(){return p})),n.d(e,"h",(function(){return g})),n.d(e,"a",(function(){return y})),n.d(e,"b",(function(){return b})),n.d(e,"e",(function(){return E})),n.d(e,"f",(function(){return v})),n.d(e,"d",(function(){return k})),n.d(e,"c",(function(){return w})),n.d(e,"n",(function(){return S})),n.d(e,"o",(function(){return _})),n.d(e,"k",(function(){return C})),n.d(e,"j",(function(){return x})),n.d(e,"i",(function(){return L})),n.d(e,"p",(function(){return M})),n.d(e,"m",(function(){return A}));var a=n(229),r=n(216),i=n(157),o=n(41),s=n(94),l=n(395),c=n(246),f=n(361),u=n(44),m=n(24),h=n(45);function d(t){return 9===t.bitNodeN||t.sourceFileLvl(9)>0}function p(t){if(u.a.isRunning){if(u.a.currStep!==u.f.HacknetNodesIntroduction)return-1;Object(u.c)()}const e=t.hacknetNodes.length;if(d(t)){const n=b(t);if(isNaN(n))throw new Error("Calculated cost of purchasing HacknetServer is NaN");return!t.canAfford(n)||e>=o.b.MaxServers?-1:(t.loseMoney(n,"hacknet_expenses"),t.createHacknetServer(),M(t),e)}{const n=y(t);if(isNaN(n))throw new Error("Calculated cost of purchasing HacknetNode is NaN");if(!t.canAfford(n))return-1;const r="hacknet-node-"+e,i=new a.a(r,t.mults.hacknet_node_money);return t.loseMoney(n,"hacknet_expenses"),t.hacknetNodes.push(i),e}}function g(t){return d(t)&&t.hacknetNodes.length>=o.b.MaxServers}function y(t){return Object(r.d)(t.hacknetNodes.length+1,t.mults.hacknet_node_purchase_cost)}function b(t){return Object(i.f)(t.hacknetNodes.length+1,t.mults.hacknet_node_purchase_cost)}function E(t,e,n){if(null==n)throw new Error("getMaxNumberLevelUpgrades() called without maxLevel arg");if(t.moneye.calculateLevelUpgradeCost(i,t.mults.hacknet_node_level_cost))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!==n&&t.money>e.calculateLevelUpgradeCost(o,t.mults.hacknet_node_level_cost)&&t.moneye.calculateLevelUpgradeCost(o,t.mults.hacknet_node_level_cost)))return Math.min(i,o);a=o+1}}return 0}function v(t,e,n){if(null==n)throw new Error("getMaxNumberRamUpgrades() called without maxLevel arg");if(t.moneye.calculateRamUpgradeCost(a,t.mults.hacknet_node_ram_cost))return a;for(let n=a-1;n>=0;--n)if(t.money>e.calculateRamUpgradeCost(n,t.mults.hacknet_node_ram_cost))return n;return 0}function k(t,e,n){if(null==n)throw new Error("getMaxNumberCoreUpgrades() called without maxLevel arg");if(t.moneye.calculateCoreUpgradeCost(i,t.mults.hacknet_node_core_cost))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!=n&&t.money>e.calculateCoreUpgradeCost(o,t.mults.hacknet_node_core_cost)&&t.moneye.calculateCoreUpgradeCost(o,t.mults.hacknet_node_core_cost)))return Math.min(i,o);a=o+1}}return 0}function w(t,e,n){if(null==n)throw new Error("getMaxNumberCacheUpgrades() called without maxLevel arg");if(!t.canAfford(e.calculateCacheUpgradeCost(1)))return 0;let a=1,r=n-1;const i=n-e.cache;if(t.canAfford(e.calculateCacheUpgradeCost(i)))return i;for(;a<=r;){const o=(a+r)/2|0;if(o!=n&&t.canAfford(e.calculateCacheUpgradeCost(o))&&!t.canAfford(e.calculateCacheUpgradeCost(o+1)))return Math.min(i,o);if(t.canAfford(e.calculateCacheUpgradeCost(o))){if(!t.canAfford(e.calculateCacheUpgradeCost(o)))return Math.min(i,o);a=o+1}else r=o-1}return 0}function S(t,e,n=1){const a=Math.round(n),r=e.calculateLevelUpgradeCost(a,t.mults.hacknet_node_level_cost);if(isNaN(r)||r<=0||a<0)return!1;const i=e instanceof s.a;if(e.level>=(i?o.b.MaxLevel:o.a.MaxLevel))return!1;if(e.level+a>(i?o.b.MaxLevel:o.a.MaxLevel)){return S(t,e,Math.max(0,(i?o.b.MaxLevel:o.a.MaxLevel)-e.level))}return!!t.canAfford(r)&&(t.loseMoney(r,"hacknet_expenses"),e.upgradeLevel(a,t.mults.hacknet_node_money),!0)}function _(t,e,n=1){const r=Math.round(n),i=e.calculateRamUpgradeCost(r,t.mults.hacknet_node_ram_cost);if(isNaN(i)||i<=0||r<0)return!1;if(e instanceof s.a&&e.maxRam>=o.b.MaxRam)return!1;if(e instanceof a.a&&e.ram>=o.a.MaxRam)return!1;if(e instanceof s.a){if(e.maxRam*Math.pow(2,r)>o.b.MaxRam){return _(t,e,Math.max(0,Math.log2(Math.round(o.b.MaxRam/e.maxRam))))}}else if(e instanceof a.a&&e.ram*Math.pow(2,r)>o.a.MaxRam){return _(t,e,Math.max(0,Math.log2(Math.round(o.a.MaxRam/e.ram))))}return!!t.canAfford(i)&&(t.loseMoney(i,"hacknet_expenses"),e.upgradeRam(r,t.mults.hacknet_node_money),!0)}function C(t,e,n=1){const a=Math.round(n),r=e.calculateCoreUpgradeCost(a,t.mults.hacknet_node_core_cost);if(isNaN(r)||r<=0||a<0)return!1;const i=e instanceof s.a;if(e.cores>=(i?o.b.MaxCores:o.a.MaxCores))return!1;if(e.cores+a>(i?o.b.MaxCores:o.a.MaxCores)){return C(t,e,Math.max(0,(i?o.b.MaxCores:o.a.MaxCores)-e.cores))}return!!t.canAfford(r)&&(t.loseMoney(r,"hacknet_expenses"),e.upgradeCore(a,t.mults.hacknet_node_money),!0)}function x(t,e,n=1){const a=Math.round(n),r=e.calculateCacheUpgradeCost(a);if(isNaN(r)||r<=0||a<0)return!1;if(!(e instanceof s.a))return console.warn("purchaseCacheUpgrade() called for a non-HacknetNode"),!1;if(e.cache+a>o.b.MaxCache){return x(t,e,Math.max(0,o.b.MaxCache-e.cache))}return!!t.canAfford(r)&&(t.loseMoney(r,"hacknet_expenses"),e.upgradeCache(a),!0)}function L(t,e){return 0===t.hacknetNodes.length?0:d(t)?function(t,e){if(!(t.hashManager instanceof l.a))throw new Error("Player does not have a HashManager (should be in 'hashManager' prop)");let n=0;for(let r=0;r0){const e=c.a["Sell for Money"];if(null===e)throw new Error("Could not get the hash upgrade");if(!e.cost)throw new Error("Upgrade is not properly configured");const n=r/e.cost;n>0&&t.gainMoney(e.value*n,"hacknet")}return n}(t,e):t.hacknetNodes[0]instanceof a.a?function(t,e){let n=0;for(let a=0;ae==t))throw new Error(`You have already expanded into the ${e} industry!`);for(let e=0;e_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.DividendMaxRate)throw new Error("Invalid value. Must be an number between 0 and "+_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.DividendMaxRate);t.dividendRate=e}function SellMaterial(mat,amt,price){""===price&&(price="0"),""===amt&&(amt="0");let cost=price.replace(/\s+/g,"");cost=cost.replace(/[^-()\d/*+.MPe]/g,"");let temp=cost.replace(/MP/g,mat.bCost+"");try{temp=eval(temp)}catch(t){throw new Error("Invalid value or expression for sell price field: "+t)}if(null==temp||isNaN(parseFloat(temp))||parseFloat(temp)<0)throw new Error("Invalid value or expression for sell price field");if(cost.includes("MP")?mat.sCost=cost:mat.sCost=temp,amt=amt.toUpperCase(),amt.includes("MAX")||amt.includes("PROD")){let q=amt.replace(/\s+/g,"");q=q.replace(/[^-()\d/*+.MAXPROD]/g,"");let tempQty=q.replace(/MAX/g,mat.maxsll.toString());tempQty=tempQty.replace(/PROD/g,mat.prd.toString());try{tempQty=eval(tempQty)}catch(t){throw new Error("Invalid value or expression for sell quantity field: "+t)}if(null==tempQty||isNaN(parseFloat(tempQty))||parseFloat(tempQty)<0)throw new Error("Invalid value or expression for sell quantity field");mat.sllman[0]=!0,mat.sllman[1]=q}else{if(isNaN(parseFloat(amt))||parseFloat(amt)<0)throw new Error("Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'");{let t=parseFloat(amt);isNaN(t)&&(t=0),0===t?(mat.sllman[0]=!1,mat.sllman[1]=0):(mat.sllman[0]=!0,mat.sllman[1]=t)}}}function SellProduct(product,city,amt,price,all){if(price.includes("MP")){price=price.replace(/\s+/g,""),price=price.replace(/[^-()\d/*+.MP]/g,"");let temp=price.replace(/MP/g,"1");try{temp=eval(temp)}catch(t){throw new Error("Invalid value or expression for sell price field: "+t)}if(null==temp||isNaN(parseFloat(temp))||parseFloat(temp)<0)throw new Error("Invalid value or expression for sell price field.");product.sCost=price}else{const t=parseFloat(price);if(isNaN(t))throw new Error("Invalid value for sell price field");product.sCost=t}const cities=Object.keys(_Locations_Cities__WEBPACK_IMPORTED_MODULE_7__.a);if(amt=amt.toUpperCase(),amt.includes("MAX")||amt.includes("PROD")){let qty=amt.replace(/\s+/g,"");qty=qty.replace(/[^-()\d/*+.MAXPROD]/g,"");let temp=qty.replace(/MAX/g,product.maxsll.toString());temp=temp.replace(/PROD/g,product.data[city][1].toString());try{temp=eval(temp)}catch(t){throw new Error("Invalid value or expression for sell quantity field: "+t)}if(null==temp||isNaN(parseFloat(temp))||parseFloat(temp)<0)throw new Error("Invalid value or expression for sell quantity field");if(all)for(let t=0;ti)throw new Error("You do not have enough warehouse size to fit this purchase");const o=a*n.bCost;if(!(t.funds>=o))throw new Error("You cannot afford this purchase.");t.funds=t.funds-o,n.qty+=a}function SellShares(t,e,n){if(isNaN(n))throw new Error("Invalid value for number of shares");if(n<0)throw new Error("Invalid value for number of shares");if(n>t.numShares)throw new Error("You don't have that many shares to sell!");if(!t.public)throw new Error("You haven't gone public!");if(t.shareSaleCooldown)throw new Error("Share sale on cooldown!");const a=t.calculateShareSale(n),r=a[0],i=a[1],o=a[2];return t.numShares-=n,t.issuedShares+=n,t.sharePrice=i,t.shareSalesUntilPriceUpdate=o,t.shareSaleCooldown=_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.SellSharesCooldown,e.gainMoney(r,"corporation"),r}function BuyBackShares(t,e,n){if(isNaN(n))throw new Error("Invalid value for number of shares");if(n<0)throw new Error("Invalid value for number of shares");if(n>t.issuedShares)throw new Error("You don't have that many shares to buy!");if(!t.public)throw new Error("You haven't gone public!");const a=1.1*t.sharePrice;if(e.moneyt.name===e);if(!a)throw new Error(`Could not find employee '${name}'.`);if(!Object.values(_EmployeePositions__WEBPACK_IMPORTED_MODULE_8__.a).includes(n))throw new Error(`'${n}' is not a valid job.`);t.assignSingleJob(a,n)}function AutoAssignJob(t,e,n){if(!Object.values(_EmployeePositions__WEBPACK_IMPORTED_MODULE_8__.a).includes(e))throw new Error(`'${e}' is not a valid job.`);return t.autoAssignJob(e,n)}function UpgradeOfficeSize(t,e,n){const a=Math.round(e.size/_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.OfficeInitialSize);let r=0;for(let t=0;te+_data_Constants__WEBPACK_IMPORTED_MODULE_3__.a.WarehouseUpgradeBaseCost*Math.pow(1.07,t.level+1+n),0)}function UpgradeWarehouse(t,e,n,a=1){const r=UpgradeWarehouseCost(n,a);t.funds=o)throw new Error(`You are already at the max products (${o}) for division: ${e.name}!`);const l=new _Product__WEBPACK_IMPORTED_MODULE_5__.a({name:a.replace(/[<>]/g,"").trim(),createCity:n,designCost:r,advCost:i});if(s[l.name]instanceof _Product__WEBPACK_IMPORTED_MODULE_5__.a)throw new Error("You already have a product with this name!");t.funds=t.funds-(r+i),s[l.name]=l}function Research(t,e){const n=_IndustryData__WEBPACK_IMPORTED_MODULE_1__.c[t.type];if(void 0===n)throw new Error(`No research tree for industry '${t.type}'`);if(!n.getAllNodes().includes(e))throw new Error(`No research named '${e}'`);const a=_ResearchMap__WEBPACK_IMPORTED_MODULE_9__.a[e];if(!t.researched[e]){if(t.sciResearch.qtyt&&(this.sleeves.length=t);for(let e=this.sleeves.length;e=100?this.sleeves[t].synchronize(this):this.sleeves[t].shockRecovery(this));this.lastUpdate=(new Date).getTime(),this.playtimeSinceLastAug=0,this.scriptProdSinceLastAug=0,this.moneySourceA.reset(),this.hacknetNodes.length=0,this.hashManager.prestige(),this.reapplyAllAugmentations(!0),this.hp.current=this.hp.max,this.finishWork(!0)}function V(){this.entropy=0,this.prestigeAugmentation(),this.karma=0;for(let t=0;t0?this.skills.intelligence=Math.floor(this.calculateSkill(this.exp.intelligence)):this.skills.intelligence=0;const t=this.hp.current/this.hp.max;this.hp.max=Math.floor(10+this.skills.defense/10),this.hp.current=Math.round(this.hp.max*t)}function Z(){this.mults=Object(q.a)()}function tt(t){const e=this.getHomeComputer();if(null==e)return!1;for(let n=0;n=t}function it(t,e){this.moneySourceA instanceof F.a||(console.warn("Player.moneySourceA was not properly initialized. Resetting"),this.moneySourceA=new F.a),this.moneySourceB instanceof F.a||(console.warn("Player.moneySourceB was not properly initialized. Resetting"),this.moneySourceB=new F.a),this.moneySourceA.record(t,e),this.moneySourceB.record(t,e)}function ot(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainHackingExp()"):(this.exp.hacking+=t,this.exp.hacking<0&&(this.exp.hacking=0),this.skills.hacking=Object(C.b)(this.exp.hacking,this.mults.hacking*o.a.HackingLevelMultiplier))}function st(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainStrengthExp()"):(this.exp.strength+=t,this.exp.strength<0&&(this.exp.strength=0),this.skills.strength=Object(C.b)(this.exp.strength,this.mults.strength*o.a.StrengthLevelMultiplier))}function lt(t){if(isNaN(t))return void console.error("ERR: NaN passed into player.gainDefenseExp()");this.exp.defense+=t,this.exp.defense<0&&(this.exp.defense=0),this.skills.defense=Object(C.b)(this.exp.defense,this.mults.defense*o.a.DefenseLevelMultiplier);const e=this.hp.current/this.hp.max;this.hp.max=Math.floor(10+this.skills.defense/10),this.hp.current=Math.round(this.hp.max*e)}function ct(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainDexterityExp()"):(this.exp.dexterity+=t,this.exp.dexterity<0&&(this.exp.dexterity=0),this.skills.dexterity=Object(C.b)(this.exp.dexterity,this.mults.dexterity*o.a.DexterityLevelMultiplier))}function ft(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainAgilityExp()"):(this.exp.agility+=t,this.exp.agility<0&&(this.exp.agility=0),this.skills.agility=Object(C.b)(this.exp.agility,this.mults.agility*o.a.AgilityLevelMultiplier))}function ut(t){isNaN(t)?console.error("ERR: NaN passed into Player.gainCharismaExp()"):(this.exp.charisma+=t,this.exp.charisma<0&&(this.exp.charisma=0),this.skills.charisma=Object(C.b)(this.exp.charisma,this.mults.charisma*o.a.CharismaLevelMultiplier))}function mt(t){isNaN(t)?console.error("ERROR: NaN passed into Player.gainIntelligenceExp()"):(H.a.sourceFileLvl(5)>0||this.skills.intelligence>0||5===H.a.bitNodeN)&&(this.exp.intelligence+=t,this.skills.intelligence=Math.floor(this.calculateSkill(this.exp.intelligence,1)))}function ht(t){this.gainHackingExp(t.hack*this.mults.hacking_exp),this.gainStrengthExp(t.str*this.mults.strength_exp),this.gainDefenseExp(t.def*this.mults.defense_exp),this.gainDexterityExp(t.dex*this.mults.dexterity_exp),this.gainAgilityExp(t.agi*this.mults.agility_exp),this.gainCharismaExp(t.cha*this.mults.charisma_exp),this.gainIntelligenceExp(t.int)}function dt(t){const e=t.toLowerCase();return e.includes("hack")?this.skills.hacking:e.includes("str")?this.skills.strength:e.includes("def")?this.skills.defense:e.includes("dex")?this.skills.dexterity:e.includes("agi")?this.skills.agility:e.includes("cha")?this.skills.charisma:e.includes("int")?this.skills.intelligence:0}function pt(){this.focus=!0}function gt(){this.focus=!1}function yt(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp.current-=t,this.hp.current<=0&&(this.hospitalize(),!0))}function bt(t){"number"==typeof t?(this.hp.current+=t,this.hp.current>this.hp.max&&(this.hp.current=this.hp.max)):console.warn("Player.regenerateHp() called without a numeric argument: "+t)}function Et(){const t=Object(P.b)(this);return B.b.emit("You've been Hospitalized for "+D.a.formatMoney(t),B.d.WARNING,2e3),this.loseMoney(t,"hospitalization"),this.hp.current=this.hp.max,t}function vt(t,e=!1){const n=c.a[this.location];if(!(n instanceof l.a))return console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`),!1;let a=t;if(!this.isQualified(n,a))return e||Object(j.a)("Unfortunately, you do not qualify for this position
"+Object(u.a)(n,a)),!1;if(!n.hasPosition(a))return console.error(`Company ${n.name} does not have position ${a}. Player.applyToCompany() failed`),!1;for(;;){const t=Object(f.a)(a);if(null==t)break;if(!n.hasPosition(t)||!this.isQualified(n,t))break;a=t}if(this.jobs[n.name]===a.name){if(!e){const t=Object(f.a)(a);if(null!=t&&n.hasPosition(t)){const e=Object(u.a)(n,t);Object(j.a)("Unfortunately, you do not qualify for a promotion
"+e)}else Object(j.a)("You are already at the highest position for your field! No promotion available")}return!1}return this.jobs[n.name]=a.name,e||Object(j.a)("Congratulations! You were offered a new job at "+n.name+" as a "+a.name+"!"),!0}function kt(t,e){const n=c.a[t.name];if(null==n||n.name!=t.name)return e;const a=this.jobs[t.name];if(!a)return e;const r=m.a[a];return r.isSoftwareJob()&&e.isSoftwareJob()||r.isITJob()&&e.isITJob()||r.isBusinessJob()&&e.isBusinessJob()||r.isSecurityEngineerJob()&&e.isSecurityEngineerJob()||r.isNetworkEngineerJob()&&e.isNetworkEngineerJob()||r.isSecurityJob()&&e.isSecurityJob()||r.isAgentJob()&&e.isAgentJob()||r.isSoftwareConsultantJob()&&e.isSoftwareConsultantJob()||r.isBusinessConsultantJob()&&e.isBusinessConsultantJob()||r.isPartTimeJob()&&e.isPartTimeJob()?Object(f.a)(r):e}function wt(t){Object(U.b)(this.currentWork)&&this.currentWork.companyName===t&&this.finishWork(!0);for(const e of this.sleeves)Object(_.b)(e.currentWork)&&e.currentWork.companyName===t&&(e.stopWork(this),Object(j.a)(`You quit ${t} while one of your sleeves was working there. The sleeve is now idle.`));delete this.jobs[t]}function St(){return Boolean(Object.keys(this.jobs).length)}function _t(t=!1){return this.applyForJob(m.a[h.j[0]],t)}function Ct(t=!1){return this.applyForJob(m.a[h.k[0]],t)}function xt(t=!1){return this.applyForJob(m.a[h.d[0]],t)}function Lt(t=!1){const e=c.a[this.location];return this.isQualified(e,m.a[h.i[0]])?this.applyForJob(m.a[h.i[0]],t):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1)}function Ot(t=!1){const e=c.a[this.location];if(this.isQualified(e,m.a[h.f[0]])){const e=m.a[h.f[0]];return this.applyForJob(e,t)}return t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1}function Mt(t=!1){return this.applyForJob(m.a[h.b[0]],t)}function At(t=!1){return this.applyForJob(m.a[h.c[0]],t)}function Tt(t=!1){return this.applyForJob(m.a[h.h[2]],t)}function Rt(t=!1){const e=c.a[this.location];if(this.isQualified(e,m.a[h.a[0]])){const e=m.a[h.a[0]];return this.applyForJob(e,t)}return t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1}function Nt(t=!1){const e=c.a[this.location],n=h.e[1];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function Pt(t=!1){const e=c.a[this.location],n=h.g[1];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed part-time at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function It(t=!1){const e=c.a[this.location],n=h.e[0];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed as a waiter at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function Dt(t=!1){const e=c.a[this.location],n=h.g[0];return!!e.hasPosition(n)&&(this.isQualified(e,m.a[n])?(this.jobs[e.name]=n,t||Object(j.a)("Congratulations, you are now employed as a part-time waiter at "+this.location),!0):(t||Object(j.a)("Unfortunately, you do not qualify for this position"),!1))}function Ft(t,e){const n=t.jobStatReqOffset,a=e.requiredHacking>0?e.requiredHacking+n:0,r=e.requiredStrength>0?e.requiredStrength+n:0,i=e.requiredDefense>0?e.requiredDefense+n:0,o=e.requiredDexterity>0?e.requiredDexterity+n:0,s=e.requiredDexterity>0?e.requiredDexterity+n:0,l=e.requiredCharisma>0?e.requiredCharisma+n:0;return this.skills.hacking>=a&&this.skills.strength>=r&&this.skills.defense>=i&&this.skills.dexterity>=o&&this.skills.agility>=s&&this.skills.charisma>=l&&t.playerReputation>=e.requiredReputation}function jt(t=!0){t&&this.resetMultipliers();for(let t=0;te.specialName===t),a=Object(L.d)(e?e.hostname:"").backdoorInstalled?-1e5:0;return n.includes(t)&&function(t){const e=c.a[t];return null==e?0:e.playerReputation}(t)>d.a.CorpFactionRepRequirement+a}const i=y.a[W.a.Illuminati];!i.isBanned&&!i.isMember&&!i.alreadyInvited&&e>=30&&this.money>=15e10&&this.skills.hacking>=1500&&this.skills.strength>=1200&&this.skills.defense>=1200&&this.skills.dexterity>=1200&&this.skills.agility>=1200&&t.push(i);const s=y.a[W.a.Daedalus];!s.isBanned&&!s.isMember&&!s.alreadyInvited&&e>=o.a.DaedalusAugsRequirement&&this.money>=1e11&&(this.skills.hacking>=2500||this.skills.strength>=1500&&this.skills.defense>=1500&&this.skills.dexterity>=1500&&this.skills.agility>=1500)&&t.push(s);const l=y.a[W.a.TheCovenant];!l.isBanned&&!l.isMember&&!l.alreadyInvited&&e>=20&&this.money>=75e9&&this.skills.hacking>=850&&this.skills.strength>=850&&this.skills.defense>=850&&this.skills.dexterity>=850&&this.skills.agility>=850&&t.push(l);const f=y.a[W.a.ECorp];f.isBanned||f.isMember||f.alreadyInvited||!r(w.a.AevumECorp)||t.push(f);const u=y.a[W.a.MegaCorp];u.isBanned||u.isMember||u.alreadyInvited||!r(w.a.Sector12MegaCorp)||t.push(u);const m=y.a[W.a.BachmanAssociates];m.isBanned||m.isMember||m.alreadyInvited||!r(w.a.AevumBachmanAndAssociates)||t.push(m);const h=y.a[W.a.BladeIndustries];h.isBanned||h.isMember||h.alreadyInvited||!r(w.a.Sector12BladeIndustries)||t.push(h);const p=y.a[W.a.NWO];p.isBanned||p.isMember||p.alreadyInvited||!r(w.a.VolhavenNWO)||t.push(p);const g=y.a[W.a.ClarkeIncorporated];g.isBanned||g.isMember||g.alreadyInvited||!r(w.a.AevumClarkeIncorporated)||t.push(g);const b=y.a[W.a.OmniTekIncorporated];b.isBanned||b.isMember||b.alreadyInvited||!r(w.a.VolhavenOmniTekIncorporated)||t.push(b);const E=y.a[W.a.FourSigma];E.isBanned||E.isMember||E.alreadyInvited||!r(w.a.Sector12FourSigma)||t.push(E);const v=y.a[W.a.KuaiGongInternational];v.isBanned||v.isMember||v.alreadyInvited||!r(w.a.ChongqingKuaiGongInternational)||t.push(v);const S=y.a[W.a.FulcrumSecretTechnologies],_=Object(L.d)(A.a.FulcrumSecretTechnologies);if(!(_ instanceof O.a))throw new Error(W.a.FulcrumSecretTechnologies+" should be normal server");null==_?console.error(`Could not find ${W.a.FulcrumSecretTechnologies} Server`):S.isBanned||S.isMember||S.alreadyInvited||!_.backdoorInstalled||!r(w.a.AevumFulcrumTechnologies)||t.push(S);const C=y.a[W.a.BitRunners],x=Object(L.d)(A.a.BitRunnersServer);if(!(x instanceof O.a))throw new Error(W.a.BitRunners+" should be normal server");null==x?console.error(`Could not find ${W.a.BitRunners} Server`):C.isBanned||C.isMember||!x.backdoorInstalled||C.alreadyInvited||t.push(C);const M=y.a[W.a.TheBlackHand],T=Object(L.d)(A.a.TheBlackHandServer);if(!(T instanceof O.a))throw new Error(W.a.TheBlackHand+" should be normal server");null==T?console.error(`Could not find ${W.a.TheBlackHand} Server`):M.isBanned||M.isMember||!T.backdoorInstalled||M.alreadyInvited||t.push(M);const R=y.a[W.a.NiteSec],N=Object(L.d)(A.a.NiteSecServer);if(!(N instanceof O.a))throw new Error(W.a.NiteSec+" should be normal server");null==N?console.error(`Could not find ${W.a.NiteSec} Server`):R.isBanned||R.isMember||!N.backdoorInstalled||R.alreadyInvited||t.push(R);const P=y.a[W.a.Chongqing];!P.isBanned&&!P.isMember&&!P.alreadyInvited&&this.money>=2e7&&this.city==k.a.Chongqing&&t.push(P);const D=y.a[W.a.Sector12];!D.isBanned&&!D.isMember&&!D.alreadyInvited&&this.money>=15e6&&this.city==k.a.Sector12&&t.push(D);const F=y.a[W.a.NewTokyo];!F.isBanned&&!F.isMember&&!F.alreadyInvited&&this.money>=2e7&&this.city==k.a.NewTokyo&&t.push(F);const j=y.a[W.a.Aevum];!j.isBanned&&!j.isMember&&!j.alreadyInvited&&this.money>=4e7&&this.city==k.a.Aevum&&t.push(j);const B=y.a[W.a.Ishima];!B.isBanned&&!B.isMember&&!B.alreadyInvited&&this.money>=3e7&&this.city==k.a.Ishima&&t.push(B);const G=y.a[W.a.Volhaven];!G.isBanned&&!G.isMember&&!G.alreadyInvited&&this.money>=5e7&&this.city==k.a.Volhaven&&t.push(G);const H=y.a[W.a.SpeakersForTheDead];!H.isBanned&&!H.isMember&&!H.alreadyInvited&&this.skills.hacking>=100&&this.skills.strength>=300&&this.skills.defense>=300&&this.skills.dexterity>=300&&this.skills.agility>=300&&this.numPeopleKilled>=30&&this.karma<=-45&&!n.includes(w.a.Sector12CIA)&&!n.includes(w.a.Sector12NSA)&&t.push(H);const U=y.a[W.a.TheDarkArmy];!U.isBanned&&!U.isMember&&!U.alreadyInvited&&this.skills.hacking>=300&&this.skills.strength>=300&&this.skills.defense>=300&&this.skills.dexterity>=300&&this.skills.agility>=300&&this.city==k.a.Chongqing&&this.numPeopleKilled>=5&&this.karma<=-45&&!n.includes(w.a.Sector12CIA)&&!n.includes(w.a.Sector12NSA)&&t.push(U);const q=y.a[W.a.TheSyndicate];!q.isBanned&&!q.isMember&&!q.alreadyInvited&&this.skills.hacking>=200&&this.skills.strength>=200&&this.skills.defense>=200&&this.skills.dexterity>=200&&this.skills.agility>=200&&(this.city==k.a.Aevum||this.city==k.a.Sector12)&&this.money>=1e7&&this.karma<=-90&&!n.includes(w.a.Sector12CIA)&&!n.includes(w.a.Sector12NSA)&&t.push(q);const K=y.a[W.a.Silhouette];!K.isBanned&&!K.isMember&&!K.alreadyInvited&&(a.includes("Chief Technology Officer")||a.includes("Chief Financial Officer")||a.includes("Chief Executive Officer"))&&this.money>=15e6&&this.karma<=-22&&t.push(K);const z=y.a[W.a.Tetrads];!z.isBanned&&!z.isMember&&!z.alreadyInvited&&(this.city==k.a.Chongqing||this.city==k.a.NewTokyo||this.city==k.a.Ishima)&&this.skills.strength>=75&&this.skills.defense>=75&&this.skills.dexterity>=75&&this.skills.agility>=75&&this.karma<=-18&&t.push(z);const V=y.a[W.a.SlumSnakes];!V.isBanned&&!V.isMember&&!V.alreadyInvited&&this.skills.strength>=30&&this.skills.defense>=30&&this.skills.dexterity>=30&&this.skills.agility>=30&&this.karma<=-9&&this.money>=1e6&&t.push(V);const Y=y.a[W.a.Netburners];let J=0,X=0,Q=0;for(let t=0;t=80&&J>=8&&X>=4&&Q>=100&&t.push(Y);const Z=y.a[W.a.TianDiHui];!Z.isBanned&&!Z.isMember&&!Z.alreadyInvited&&this.money>=1e6&&this.skills.hacking>=50&&(this.city==k.a.Chongqing||this.city==k.a.NewTokyo||this.city==k.a.Ishima)&&t.push(Z);const tt=y.a[W.a.CyberSec],et=Object(L.d)(A.a.CyberSecServer);if(!(et instanceof O.a))throw new Error(W.a.CyberSec+" should be normal server");return null==et?console.error(`Could not find ${W.a.CyberSec} Server`):tt.isBanned||tt.isMember||!et.backdoorInstalled||tt.alreadyInvited||t.push(tt),t}function Wt(t){this.bitNodeN=t}function Ht(t){for(const e of this.queuedAugmentations)if(e.name==t)return void console.warn(`tried to queue ${t} twice, this may be a bug`);for(const e of this.augmentations)if(e.name==t)return void console.warn(`tried to queue ${t} twice, this may be a bug`);this.queuedAugmentations.push(new r.a(t))}function Ut(t,e=1){if(null==t||null==t.type)return"No reward for this contract";switch(t.type){case s.c.FactionReputation:if(null==t.name||!(y.a[t.name]instanceof g.a))return t.type=s.c.FactionReputationAll,this.gainCodingContractReward(t);const n=d.a.CodingContractBaseFactionRepGain*e;return y.a[t.name].playerReputation+=n,`Gained ${n} faction reputation for ${t.name}`;case s.c.FactionReputationAll:const a=d.a.CodingContractBaseFactionRepGain*e,r=[W.a.Bladeburners],i=this.factions.slice().filter(t=>!r.includes(t));if(0==i.length)return t.type=s.c.Money,this.gainCodingContractReward(t,e);const f=Math.floor(a/i.length);for(const t of i)y.a[t]instanceof g.a&&(y.a[t].playerReputation+=f);return`Gained ${f} reputation for each of the following factions: ${i.toString()}`;case s.c.CompanyReputation:{if(null==t.name||!(c.a[t.name]instanceof l.a))return t.type=s.c.FactionReputationAll,this.gainCodingContractReward(t);const n=d.a.CodingContractBaseCompanyRepGain*e;return c.a[t.name].playerReputation+=n,`Gained ${n} company reputation for ${t.name}`}case s.c.Money:default:{const t=d.a.CodingContractBaseMoneyGain*e*o.a.CodingContractMoney;return this.gainMoney(t,"codingcontract"),"Gained "+D.a.formatMoney(t)}}}function qt(t){return null==E.a[t]?(console.warn("Player.travel() called with invalid city: "+t),!1):(this.city=t,!0)}function $t(t){return null==v.a[t]?(console.warn("Player.gotoLocation() called with invalid location: "+t),!1):(this.location=t,!0)}function Kt(){return 10===this.bitNodeN||this.sourceFileLvl(10)>0}function zt(t){this.exploits.includes(t)||(this.exploits.push(t),B.b.emit("SF -1 acquired!",B.d.SUCCESS,2e3))}function Vt(t){const e=G.a[t];e&&(this.achievements.map(t=>t.ID).includes(t)||(this.achievements.push({ID:t,unlockedOn:(new Date).getTime()}),B.b.emit(`Unlocked Achievement: "${e.Name}"`,B.d.SUCCESS,2e3)))}function Yt(t){return Object(x.a)(this.skills.intelligence,t)}function Jt(){return this.moneySourceA.casino}function Xt(){return 13===this.bitNodeN||this.sourceFileLvl(13)>0}function Qt(t){const e=this.sourceFiles.find(e=>e.n===t);return e?e.lvl:0}function Zt(){let t=1;return this.hasAugmentation(i.a.NeuroreceptorManager)||(t=this.focus?1:d.a.BaseFocusBonus),t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(17);const r={CityNames:[a.a.Aevum,a.a.Chongqing,a.a.Sector12,a.a.NewTokyo,a.a.Ishima,a.a.Volhaven],CyclesPerSecond:5,StaminaGainPerSecond:.0085,BaseStaminaLoss:.285,MaxStaminaToGainFactor:7e4,DifficultyToTimeFactor:10,DiffMultExponentialFactor:.28,DiffMultLinearFactor:650,EffAgiLinearFactor:1e4,EffDexLinearFactor:1e4,EffAgiExponentialFactor:.04,EffDexExponentialFactor:.035,BaseRecruitmentTimeNeeded:300,PopulationThreshold:1e9,PopulationExponent:.7,ChaosThreshold:50,BaseStatGain:1,BaseIntGain:.003,ActionCountGrowthPeriod:480,RankToFactionRepFactor:2,RankNeededForFaction:25,ContractSuccessesPerLevel:3,OperationSuccessesPerLevel:2.5,RanksPerSkillPoint:3,ContractBaseMoneyGain:25e4,HrcHpGain:2,HrcStaminaGain:1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1049),r=n(1050);const i={};for(const t of r.a)i[t.key]=new a.a(t.name,t.create,t.run)},function(t,e,n){"use strict";let a;function r(t){switch(t){case a.HackingChance:return"+x% hack() success chance";case a.HackingSpeed:return"+x% faster hack(), grow(), and weaken()";case a.HackingMoney:return"+x% hack() power";case a.HackingGrow:return"+x% grow() power";case a.Hacking:return"+x% hacking skill";case a.Strength:return"+x% strength skill";case a.Defense:return"+x% defense skill";case a.Dexterity:return"+x% dexterity skill";case a.Agility:return"+x% agility skill";case a.Charisma:return"+x% charisma skill";case a.HacknetMoney:return"+x% hacknet production";case a.HacknetCost:return"-x% cheaper hacknet cost";case a.Rep:return"+x% reputation from factions and companies";case a.WorkMoney:return"+x% work money";case a.Crime:return"+x% crime money";case a.Bladeburner:return"+x% all bladeburner stats"}throw new Error("Calling effect for fragment type that doesn't have an effect "+t)}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),function(t){t[t.None=0]="None",t[t.Delete=1]="Delete",t[t.HackingChance=2]="HackingChance",t[t.HackingSpeed=3]="HackingSpeed",t[t.HackingMoney=4]="HackingMoney",t[t.HackingGrow=5]="HackingGrow",t[t.Hacking=6]="Hacking",t[t.Strength=7]="Strength",t[t.Defense=8]="Defense",t[t.Dexterity=9]="Dexterity",t[t.Agility=10]="Agility",t[t.Charisma=11]="Charisma",t[t.HacknetMoney=12]="HacknetMoney",t[t.HacknetCost=13]="HacknetCost",t[t.Rep=14]="Rep",t[t.WorkMoney=15]="WorkMoney",t[t.Crime=16]="Crime",t[t.Bladeburner=17]="Bladeburner",t[t.Booster=18]="Booster"}(a||(a={}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={HackersStartingHandbook:"hackers-starting-handbook.lit",CorporationManagementHandbook:"corporation-management-handbook.lit",HistoryOfSynthoids:"history-of-synthoids.lit",AGreenTomorrow:"A-Green-Tomorrow.lit",AlphaOmega:"alpha-omega.lit",SimulatedReality:"simulated-reality.lit",BeyondMan:"beyond-man.lit",BrighterThanTheSun:"brighter-than-the-sun.lit",DemocracyIsDead:"democracy-is-dead.lit",Sector12Crime:"sector-12-crime.lit",ManAndMachine:"man-and-machine.lit",SecretSocieties:"secret-societies.lit",TheFailedFrontier:"the-failed-frontier.lit",CodedIntelligence:"coded-intelligence.lit",SyntheticMuscles:"synthetic-muscles.lit",TensionsInTechRace:"tensions-in-tech-race.lit",CostOfImmortality:"cost-of-immortality.lit",TheHiddenWorld:"the-hidden-world.lit",TheNewGod:"the-new-god.lit",NewTriads:"new-triads.lit",TheSecretWar:"the-secret-war.lit"}},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(49),o=n(31),s=n(3),l=n(7),c=n(28),f=n(312);const u=({name:t,color:e,classes:n=Object(f.b)(),children:a,data:u})=>{let m="";return u&&(void 0!==u.content?m=u.content:void 0!==u.level&&void 0!==u.exp?m=`${Object(c.d)(u.level,0)} (${l.a.formatExp(u.exp)} exp)`:void 0!==u.level&&void 0===u.exp&&(m=""+Object(c.d)(u.level,0))),r.a.createElement(i.a,null,r.a.createElement(o.a,{classes:{root:n.cellNone}},r.a.createElement(s.a,{style:{color:e}},t)),r.a.createElement(o.a,{align:"right",classes:{root:n.cellNone}},m?r.a.createElement(s.a,{style:{color:e}},m):r.a.createElement(r.a.Fragment,null),a))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={}},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.Long="L",t.Short="S"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(0),r=n.n(a),i=n(31),o=n(161),s=n(122);function l(){return(l=Object.assign||function(t){for(var e=1;er.a.createElement(i.a,l({},t,{classes:{root:c().root,...t.classes}})),u=t=>r.a.createElement(o.a,l({},t,{classes:{root:c().small,...t.classes}}))},function(t,e,n){"use strict";function a(t){return t.startsWith("/")?t.slice(1):t}function r(t){return t.endsWith("/")?t.slice(0,-1):t}function i(t){return null!=t.match(/^[.&'a-zA-Z0-9_-]+\.[a-zA-Z0-9]+(?:-\d+(?:\.\d*)?%-INC)?$/)}function o(t){return null!=t.match(/^.?[a-zA-Z0-9_-]+$/)}function s(t){let e=t;if(0===e.length)return!1;if(1===e.length)return"/"===e;if(!e.startsWith("/"))return!1;e=e.slice(1),e=r(e);const n=e.split("/");for(const t of n)if("."!==t&&".."!==t&&!o(t))return!1;return!0}function l(t){if(null==t||"string"!=typeof t)return!1;const e=t;if(e.length<3)return!1;if(e.endsWith("/"))return!1;const n=e.lastIndexOf("/");if(-1===n)return i(e);const a=e.slice(n+1);return s(e.slice(0,n+1))&&i(a)}function c(t){let e=t;if(e=a(e),e=r(e),-1===e.lastIndexOf("/"))return"/";const n=e.split("/");return 0===n.length?"/":n[0]+"/"}function f(t){const e=t,n=e.lastIndexOf("/");return-1===n?"":e.slice(0,n+1)}function u(t,e,n){const a=h(t,n);if(null===a)return t;{const t=r(a),n=function(t){const e=t,n=e.lastIndexOf("/");if(-1===n)return e;return e.slice(n+1)}(e);return t+"/"+n}}function m(t){return!!l(t)&&(null!=t&&0!==t.length&&t.lastIndexOf("/")<=0)}function h(t,e){let n=t;if(!n.startsWith("/")&&e&&(n=e+(e.endsWith("/")?"":"/")+n),!s(n))return null;n=a(n),n=r(n);const i=n.split("/"),o=[];for(const t of i)if("."!==t)if(".."===t){if(null==o.pop())return null}else o.push(t);return"/"+o.join("/")}function d(t,e){let n=t;if(n.startsWith("/")||null==e||(n=e+(e.endsWith("/")?"":"/")+n),!l(n))return null;n=a(n);const r=n.split("/"),i=[];for(const t of r)if("."!==t)if(".."===t){if(null==i.pop())return null}else i.push(t);return"/"+i.join("/")}function p(t,e){return t.startsWith("/")||(t="/"+t),e.startsWith("/")||(e="/"+e),t===e}function g(t,e){return t.endsWith(".js")||(t+=".js"),e.endsWith(".js")||(e+=".js"),p(t,e)}n.d(e,"k",(function(){return a})),n.d(e,"l",(function(){return r})),n.d(e,"i",(function(){return s})),n.d(e,"j",(function(){return l})),n.d(e,"g",(function(){return c})),n.d(e,"e",(function(){return f})),n.d(e,"f",(function(){return u})),n.d(e,"h",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return d})),n.d(e,"a",(function(){return p})),n.d(e,"b",(function(){return g}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l}));var a=n(1055),r=n(274),i=n(15);let o={};function s(){const t=o;o={},a.a.forEach(t=>{var e;null!=o[(e=t).name]&&console.warn("Duplicate Company Position being defined: "+e.name),o[e.name]=new r.a(e)});for(const e of Object.keys(o)){const n=o[e];t[e]instanceof r.a?(n.favor=t[e].favor,isNaN(n.favor)&&(n.favor=0)):n.favor=0}}function l(t){o=JSON.parse(t,i.c)}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));var a=n(5),r=n(15);let i={[a.a.SlumSnakes]:{power:1,territory:1/7},[a.a.Tetrads]:{power:1,territory:1/7},[a.a.TheSyndicate]:{power:1,territory:1/7},[a.a.TheDarkArmy]:{power:1,territory:1/7},[a.a.SpeakersForTheDead]:{power:1,territory:1/7},[a.a.NiteSec]:{power:1,territory:1/7},[a.a.TheBlackHand]:{power:1,territory:1/7}};function o(){i={[a.a.SlumSnakes]:{power:1,territory:1/7},[a.a.Tetrads]:{power:1,territory:1/7},[a.a.TheSyndicate]:{power:1,territory:1/7},[a.a.TheDarkArmy]:{power:1,territory:1/7},[a.a.SpeakersForTheDead]:{power:1,territory:1/7},[a.a.NiteSec]:{power:1,territory:1/7},[a.a.TheBlackHand]:{power:1,territory:1/7}}}function s(t){i=JSON.parse(t,r.c)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new(n(979).a)},function(t,e,n){"use strict";n.d(e,"d",(function(){return u})),n.d(e,"c",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(803),o=n(122),s=n(127),l=n(1809),c=n(46),f=n(166);let u;!function(t){t.SUCCESS="success",t.WARNING="warning",t.ERROR="error",t.INFO="info"}(u||(u={}));const m=Object(o.a)(()=>({snackbar:{zIndex:f.g+1e3+" !important","& .MuiAlert-icon":{alignSelf:"center"}}}));function h(t){const e=m();return r.a.createElement(i.a,{dense:!0,maxSnack:9,anchorOrigin:{horizontal:"right",vertical:"bottom"},autoHideDuration:2e3,classes:{containerRoot:e.snackbar}},t.children)}const d=new s.a;function p(){const{enqueueSnackbar:t,closeSnackbar:e}=Object(i.b)();return Object(a.useEffect)(()=>d.subscribe((n,a,i)=>{const o=t(r.a.createElement(l.a,{severity:a},n),{content:(t,e)=>r.a.createElement(c.a,{key:t},e),variant:a,autoHideDuration:i,onClick:()=>e(o)})})),r.a.createElement(r.a.Fragment,null)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(287),r=n(13),i=n(137);const o={Shoplift:new a.a("Shoplift","to shoplift",i.a.SHOPLIFT,2e3,15e3,.05,.1,{dexterity_success_weight:1,agility_success_weight:1,dexterity_exp:2,agility_exp:2}),RobStore:new a.a("Rob Store","to rob a store",i.a.ROB_STORE,6e4,4e5,.2,.5,{hacking_exp:30,dexterity_exp:45,agility_exp:45,hacking_success_weight:.5,dexterity_success_weight:2,agility_success_weight:1,intelligence_exp:7.5*r.a.IntelligenceCrimeBaseExpGain}),Mug:new a.a("Mug","to mug",i.a.MUG,4e3,36e3,.2,.25,{strength_exp:3,defense_exp:3,dexterity_exp:3,agility_exp:3,strength_success_weight:1.5,defense_success_weight:.5,dexterity_success_weight:1.5,agility_success_weight:.5}),Larceny:new a.a("Larceny","larceny",i.a.LARCENY,9e4,8e5,1/3,1.5,{hacking_exp:45,dexterity_exp:60,agility_exp:60,hacking_success_weight:.5,dexterity_success_weight:1,agility_success_weight:1,intelligence_exp:15*r.a.IntelligenceCrimeBaseExpGain}),DealDrugs:new a.a("Deal Drugs","to deal drugs",i.a.DRUGS,1e4,12e4,1,.5,{dexterity_exp:5,agility_exp:5,charisma_exp:10,charisma_success_weight:3,dexterity_success_weight:2,agility_success_weight:1}),BondForgery:new a.a("Bond Forgery","to forge bonds",i.a.BOND_FORGERY,3e5,45e5,.5,.1,{hacking_exp:100,dexterity_exp:150,charisma_exp:15,hacking_success_weight:.05,dexterity_success_weight:1.25,intelligence_exp:60*r.a.IntelligenceCrimeBaseExpGain}),TraffickArms:new a.a("Traffick Arms","to traffic arms",i.a.TRAFFIC_ARMS,4e4,6e5,2,1,{strength_exp:20,defense_exp:20,dexterity_exp:20,agility_exp:20,charisma_exp:40,charisma_success_weight:1,strength_success_weight:1,defense_success_weight:1,dexterity_success_weight:1,agility_success_weight:1}),Homicide:new a.a("Homicide","homicide",i.a.HOMICIDE,3e3,45e3,1,3,{strength_exp:2,defense_exp:2,dexterity_exp:2,agility_exp:2,strength_success_weight:2,defense_success_weight:2,dexterity_success_weight:.5,agility_success_weight:.5,kills:1}),GrandTheftAuto:new a.a("Grand Theft Auto","grand theft auto",i.a.GRAND_THEFT_AUTO,8e4,16e5,8,5,{strength_exp:20,defense_exp:20,dexterity_exp:20,agility_exp:80,charisma_exp:40,hacking_success_weight:1,strength_success_weight:1,dexterity_success_weight:4,agility_success_weight:2,charisma_success_weight:2,intelligence_exp:16*r.a.IntelligenceCrimeBaseExpGain}),Kidnap:new a.a("Kidnap","to kidnap",i.a.KIDNAP,12e4,36e5,5,6,{strength_exp:80,defense_exp:80,dexterity_exp:80,agility_exp:80,charisma_exp:80,charisma_success_weight:1,strength_success_weight:1,dexterity_success_weight:1,agility_success_weight:1,intelligence_exp:26*r.a.IntelligenceCrimeBaseExpGain}),Assassination:new a.a("Assassination","to assassinate",i.a.ASSASSINATION,3e5,12e6,8,10,{strength_exp:300,defense_exp:300,dexterity_exp:300,agility_exp:300,strength_success_weight:1,dexterity_success_weight:2,agility_success_weight:1,intelligence_exp:65*r.a.IntelligenceCrimeBaseExpGain,kills:1}),Heist:new a.a("Heist","a heist",i.a.HEIST,6e5,12e7,18,15,{hacking_exp:450,strength_exp:450,defense_exp:450,dexterity_exp:450,agility_exp:450,charisma_exp:450,hacking_success_weight:1,strength_success_weight:1,defense_success_weight:1,dexterity_success_weight:1,agility_success_weight:1,charisma_success_weight:1,intelligence_exp:130*r.a.IntelligenceCrimeBaseExpGain})}},,function(t,e,n){"use strict";function a(t){return function(e){e.isTrusted&&t()}}n.d(e,"a",(function(){return a}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Home:"home",FulcrumSecretTechnologies:"fulcrumassets",CyberSecServer:"CSEC",NiteSecServer:"avmnite-02h",TheBlackHandServer:"I.I.I.I",BitRunnersServer:"run4theh111z",TheDarkArmyServer:".",DaedalusServer:"The-Cave",WorldDaemon:"w0r1d_d43m0n",DarkWeb:"darkweb"}},function(t,e,n){"use strict";n.d(e,"c",(function(){return a})),n.d(e,"e",(function(){return r})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"b",(function(){return s}));const a=t=>{var e,n,a,r,i,o,s,l,c;return{money:null!==(e=null==t?void 0:t.money)&&void 0!==e?e:0,reputation:null!==(n=null==t?void 0:t.reputation)&&void 0!==n?n:0,hackExp:null!==(a=null==t?void 0:t.hackExp)&&void 0!==a?a:0,strExp:null!==(r=null==t?void 0:t.strExp)&&void 0!==r?r:0,defExp:null!==(i=null==t?void 0:t.defExp)&&void 0!==i?i:0,dexExp:null!==(o=null==t?void 0:t.dexExp)&&void 0!==o?o:0,agiExp:null!==(s=null==t?void 0:t.agiExp)&&void 0!==s?s:0,chaExp:null!==(l=null==t?void 0:t.chaExp)&&void 0!==l?l:0,intExp:null!==(c=null==t?void 0:t.intExp)&&void 0!==c?c:0}},r=(t,e)=>({money:t.money+e.money,reputation:t.reputation+e.reputation,hackExp:t.hackExp+e.hackExp,strExp:t.strExp+e.strExp,defExp:t.defExp+e.defExp,dexExp:t.dexExp+e.dexExp,agiExp:t.agiExp+e.agiExp,chaExp:t.chaExp+e.chaExp,intExp:t.intExp+e.intExp}),i=(t,e,n=!0)=>{const a=n?e:1;return{money:t.money*a,reputation:t.reputation*e,hackExp:t.hackExp*e,strExp:t.strExp*e,defExp:t.defExp*e,dexExp:t.dexExp*e,agiExp:t.agiExp*e,chaExp:t.chaExp*e,intExp:t.intExp*e}},o=(t,e,n,a,r)=>{const i=s(e,n,a),o={money:n.money*a,reputation:0,hackExp:i.hackExp,strExp:i.strExp,defExp:i.defExp,dexExp:i.dexExp,agiExp:i.agiExp,chaExp:i.chaExp,intExp:i.intExp};return t.gainMoney(o.money,r),o},s=(t,e,n)=>{const a={money:0,reputation:0,hackExp:e.hackExp*n,strExp:e.strExp*n,defExp:e.defExp*n,dexExp:e.dexExp*n,agiExp:e.agiExp*n,chaExp:e.chaExp*n,intExp:e.intExp*n};return t.gainHackingExp(a.hackExp),t.gainStrengthExp(a.strExp),t.gainDefenseExp(a.defExp),t.gainDexterityExp(a.dexExp),t.gainAgilityExp(a.agiExp),t.gainCharismaExp(a.chaExp),t.gainIntelligenceExp(a.intExp),a}},function(t,e,n){"use strict";n.d(e,"b",(function(){return xt})),n.d(e,"a",(function(){return Lt}));var a=n(0),r=n.n(a),i=n(114),o=n(106),s=n(362),l=n(10),c=n(44),f=n(1096),u=n(396),m=n(481),h=n(16),d=n(24),p=n(29),g=n(98),y=n(122),b=n(148),E=n(20),v=n(3),k=n(27),w=n(1115),S=n(1119),_=n(1141),C=n(1146),x=n(1175),L=n(1201),O=n(1222),M=n(1260),A=n(648),T=n(1273),R=n(1274),N=n(1324),P=n(1332),I=n(1341),D=n(1365),F=n(433),j=n(668),B=n(1377),G=n(1378),W=n(1383),H=n(1384),U=n(434),q=n(1395),$=n(1406),K=n(667),z=n(1407),V=n(1416),Y=n(1419),J=n(104),X=n(312),Q=n(1426),Z=n(204),tt=n(1427),et=n(84),nt=n(166),at=n(349),rt=n(429),it=n(615),ot=n(271),st=n(437),lt=n(26),ct=n(438),ft=n(1429),ut=n(1432),mt=n(6),ht=n(1433),dt=n(1438),pt=n(1443),gt=n(1444),yt=n.n(gt),bt=n(1445),Et=n.n(bt),vt=n(485),kt=n(226),wt=n(631);const St=location,_t=Object(y.a)(t=>Object(b.a)({root:{"-ms-overflow-style":"none","scrollbar-width":"none",margin:t.spacing(0),flexGrow:1,padding:"8px",minHeight:"100vh",boxSizing:"border-box",width:"1px"}})),Ct=()=>{throw new Error("Router called before initialization")};let xt={isInitialized:!1,page:()=>{throw new Error("Router called before initialization")},allowRouting:Ct,toActiveScripts:Ct,toAugmentations:Ct,toBitVerse:Ct,toBladeburner:Ct,toStats:Ct,toCity:Ct,toCorporation:Ct,toCreateProgram:Ct,toDevMenu:Ct,toFaction:Ct,toFactions:Ct,toGameOptions:Ct,toGang:Ct,toHacknetNodes:Ct,toInfiltration:Ct,toJob:Ct,toMilestones:Ct,toGrafting:Ct,toScriptEditor:Ct,toSleeves:Ct,toStockMarket:Ct,toTerminal:Ct,toTravel:Ct,toTutorial:Ct,toWork:Ct,toBladeburnerCinematic:Ct,toLocation:Ct,toStaneksGift:Ct,toAchievements:Ct,toThemeBrowser:Ct,toImportSave:Ct};function Lt({player:t,engine:e,terminal:n}){const y=_t(),[{files:b,vim:gt},bt]=Object(a.useState)({files:{},vim:!1}),[Ct,Lt]=Object(a.useState)(function(t){return ct.b?k.a.Recovery:null!==t.currentWork?k.a.Work:k.a.Terminal}(t)),Ot=Object(a.useState)(0)[1],[Mt,At]=Object(a.useState)(!1),[Tt,Rt]=Object(a.useState)(Object(kt.b)(t.currentWork)?p.a[t.currentWork.factionName]:void 0);if(void 0===Tt&&Ct===k.a.Faction)throw new Error("Trying to go to a page without the proper setup");const[Nt,Pt]=Object(a.useState)(!1),[It,Dt]=Object(a.useState)(!1),[Ft,jt]=Object(a.useState)(void 0);if(void 0===Ft&&(Ct===k.a.Infiltration||Ct===k.a.Location||Ct===k.a.Job))throw new Error("Trying to go to a page without the proper setup");const[Bt,Gt]=Object(a.useState)(""),[Wt,Ht]=Object(a.useState)(0),[Ut,qt]=Object(a.useState)(mt.a.IsSidebarOpened),[$t,Kt]=Object(a.useState)(void 0),[zt,Vt]=Object(a.useState)(!1);if(void 0===$t&&Ct===k.a.ImportSave)throw new Error("Trying to go to a page without the proper setup");const[Yt,Jt]=Object(a.useState)(!0);function Xt(){Ot(t=>t+1)}function Qt(){for(const t of Object(d.c)())t.runningScripts=[];o.c.saveGame(),setTimeout(()=>St.reload(),2e3)}function Zt(){Object(h.a)("Soft Reset!"),Object(i.f)(!0),Ht(Wt+1),xt.toTerminal()}Object(a.useEffect)(()=>u.a.subscribe(Xt),[]),xt={isInitialized:!0,page:()=>Ct,allowRouting:t=>Jt(t),toActiveScripts:()=>Lt(k.a.ActiveScripts),toAugmentations:()=>Lt(k.a.Augmentations),toBladeburner:()=>Lt(k.a.Bladeburner),toStats:()=>Lt(k.a.Stats),toCorporation:()=>Lt(k.a.Corporation),toCreateProgram:()=>Lt(k.a.CreateProgram),toDevMenu:()=>Lt(k.a.DevMenu),toFaction:(t,e=!1)=>{At(e),Lt(k.a.Faction),t&&Rt(t)},toFactions:()=>Lt(k.a.Factions),toGameOptions:()=>Lt(k.a.Options),toGang:()=>Lt(k.a.Gang),toHacknetNodes:()=>Lt(k.a.Hacknet),toMilestones:()=>Lt(k.a.Milestones),toGrafting:()=>Lt(k.a.Grafting),toScriptEditor:(t,e)=>{bt({files:t,vim:!(null==e||!e.vim)}),Lt(k.a.ScriptEditor)},toSleeves:()=>Lt(k.a.Sleeves),toStockMarket:()=>Lt(k.a.StockMarket),toTerminal:()=>Lt(k.a.Terminal),toTutorial:()=>Lt(k.a.Tutorial),toJob:t=>{jt(t),Lt(k.a.Job)},toCity:()=>{Lt(k.a.City)},toTravel:()=>{t.gotoLocation(l.a.TravelAgency),Lt(k.a.Travel)},toBitVerse:(t,e)=>{Pt(t),Dt(e),Object(ot.b)(),Lt(k.a.BitVerse)},toInfiltration:t=>{jt(t),Lt(k.a.Infiltration)},toWork:()=>Lt(k.a.Work),toBladeburnerCinematic:()=>{Lt(k.a.BladeburnerCinematic),Gt(Bt)},toLocation:t=>{jt(t),Lt(k.a.Location)},toStaneksGift:()=>{Lt(k.a.StaneksGift)},toAchievements:()=>{Lt(k.a.Achievements)},toThemeBrowser:()=>{Lt(k.a.ThemeBrowser)},toImportSave:(t,e=!1)=>{Kt(t),Vt(e),Lt(k.a.ImportSave)}},Object(a.useEffect)(()=>{Et()(xt).filter(t=>t.startsWith("to")).forEach(t=>{xt[t]=yt()(xt[t],(e,...n)=>{if(Yt)return e(...n);console.error(`Routing is currently disabled - Attempted router.${t}()`)})})}),Object(a.useEffect)(()=>{Ct!==k.a.Terminal&&window.scrollTo(0,0)});let te=r.a.createElement(v.a,null,"Cannot load"),ee=!0,ne=!0,ae=!1;switch(Ct){case k.a.Recovery:te=r.a.createElement(ct.c,{router:xt,softReset:Zt}),ee=!1,ne=!1,ae=!0;break;case k.a.BitVerse:te=r.a.createElement(V.a,{flume:Nt,enter:st.a,quick:It}),ee=!1,ne=!1;break;case k.a.Infiltration:te=r.a.createElement(M.a,{location:Ft}),ee=!1,ne=!1;break;case k.a.BladeburnerCinematic:te=r.a.createElement(Q.a,null),ee=!1,ne=!1;break;case k.a.Work:te=r.a.createElement(T.a,null),ee=!1;break;case k.a.Terminal:te=r.a.createElement(G.a,{terminal:n,router:xt,player:t});break;case k.a.Sleeves:te=r.a.createElement(N.a,null);break;case k.a.StaneksGift:te=r.a.createElement(Y.a,{staneksGift:J.c});break;case k.a.Stats:te=r.a.createElement($.a,null);break;case k.a.ScriptEditor:te=r.a.createElement(j.a,{files:b,hostname:t.getCurrentServer().hostname,player:t,router:xt,vim:gt});break;case k.a.ActiveScripts:te=r.a.createElement(H.a,{workerScripts:Z.a});break;case k.a.Hacknet:te=r.a.createElement(P.a,{player:t});break;case k.a.CreateProgram:te=r.a.createElement(F.a,null);break;case k.a.Factions:te=r.a.createElement(U.a,{player:t,router:xt});break;case k.a.Faction:te=r.a.createElement(q.a,{faction:Tt,augPage:Mt});break;case k.a.Milestones:te=r.a.createElement(B.a,{player:t});break;case k.a.Tutorial:te=r.a.createElement(W.a,{reactivateTutorial:()=>{Object(m.a)(),xt.toTerminal(),Object(c.e)()}});break;case k.a.DevMenu:te=r.a.createElement(C.a,{player:t,engine:e,router:xt});break;case k.a.Gang:te=r.a.createElement(L.a,null);break;case k.a.Corporation:te=r.a.createElement(O.a,null);break;case k.a.Bladeburner:te=r.a.createElement(x.a,null);break;case k.a.Grafting:te=r.a.createElement(A.b,null);break;case k.a.Travel:te=r.a.createElement(K.a,{p:t,router:xt});break;case k.a.StockMarket:te=r.a.createElement(z.a,{p:t,stockMarket:g.a});break;case k.a.City:te=r.a.createElement(D.a,null);break;case k.a.Job:case k.a.Location:te=r.a.createElement(I.a,{loc:Ft});break;case k.a.Options:te=r.a.createElement(R.a,{player:t,router:xt,save:()=>o.c.saveGame(),export:()=>{Object(s.c)(t),o.c.exportGame()},forceKill:Qt,softReset:Zt});break;case k.a.Augmentations:te=r.a.createElement(_.a,{exportGameFn:()=>{Object(s.c)(t),o.c.exportGame()},installAugmentationsFn:()=>{Object(i.f)()}});break;case k.a.Achievements:te=r.a.createElement(ft.a,null);break;case k.a.ThemeBrowser:te=r.a.createElement(ht.a,{router:xt});break;case k.a.ImportSave:te=r.a.createElement(dt.a,{importString:$t,automatic:zt,router:xt}),ee=!1,ne=!1,ae=!0}return r.a.createElement(lt.a.Player.Provider,{value:t},r.a.createElement(lt.a.Router.Provider,{value:xt},r.a.createElement(ut.a,{key:Wt,router:xt,softReset:Zt},r.a.createElement(pt.a,{content:ae?te:null},r.a.createElement(et.c,null,r.a.createElement(w.a,{mode:c.a.isRunning?"tutorial":"overview"},c.a.isRunning?r.a.createElement(f.a,null):r.a.createElement(X.a,{save:()=>o.c.saveGame(),killScripts:Qt})),ee?r.a.createElement(E.a,{display:"flex",flexDirection:"row",width:"100%"},r.a.createElement(S.a,{player:t,router:xt,page:Ct,opened:Ut,onToggled:t=>{qt(t),mt.a.IsSidebarOpened=t}}),r.a.createElement(E.a,{className:y.root},te)):r.a.createElement(E.a,{className:y.root},te),r.a.createElement(tt.a,null),ne&&r.a.createElement(r.a.Fragment,null,r.a.createElement(nt.d,null),r.a.createElement(at.b,null),r.a.createElement(rt.b,null),r.a.createElement(it.b,null),r.a.createElement(et.a,null)),r.a.createElement(vt.a,null)))),r.a.createElement(wt.a,null)))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(13),r=n(598),i=n(41),o=n(157),s=n(350),l=n(15);function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f extends r.a{constructor(t={hostname:"",ip:Object(s.a)()}){super(t),c(this,"cache",1),c(this,"cores",1),c(this,"hashCapacity",0),c(this,"hashRate",0),c(this,"level",1),c(this,"onlineTimeSeconds",0),c(this,"totalHashesGenerated",0),c(this,"purchasedByPlayer",!0),this.maxRam=1,this.updateHashCapacity()}calculateCacheUpgradeCost(t){return Object(o.a)(this.cache,t)}calculateCoreUpgradeCost(t,e){return Object(o.b)(this.cores,t,e)}calculateLevelUpgradeCost(t,e){return Object(o.d)(this.level,t,e)}calculateRamUpgradeCost(t,e){return Object(o.e)(this.maxRam,t,e)}process(t=1){const e=t*a.a.MilliPerCycle/1e3;this.onlineTimeSeconds+=e;const n=this.hashRate*e;return this.totalHashesGenerated+=n,n}upgradeCache(t){this.cache=Math.min(i.b.MaxCache,Math.round(this.cache+t)),this.updateHashCapacity()}upgradeCore(t,e){this.cores=Math.min(i.b.MaxCores,Math.round(this.cores+t)),this.updateHashRate(e),this.cpuCores=this.cores}upgradeLevel(t,e){this.level=Math.min(i.b.MaxLevel,Math.round(this.level+t)),this.updateHashRate(e)}upgradeRam(t,e){for(let e=0;et.endsWith(e))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return y})),n.d(e,"i",(function(){return b})),n.d(e,"c",(function(){return E})),n.d(e,"h",(function(){return v})),n.d(e,"d",(function(){return k})),n.d(e,"e",(function(){return w})),n.d(e,"g",(function(){return S})),n.d(e,"j",(function(){return C})),n.d(e,"f",(function(){return x}));var a=n(800),r=n(341),i=n(154),o=n(693),s=n(1064),l=n(117),c=n(75),f=n(100),u=n(13),m=n(7),h=n(16),d=n(15),p=n(2);let g={lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0};const y={};function b(t,e,n,o,s,l){if(!(t instanceof i.a))return l?p.a.log(l,()=>`Invalid stock: '${t}'`):Object(h.a)("ERROR: Invalid stock passed to placeOrder() function"),!1;if("number"!=typeof e||"number"!=typeof n)return l?p.a.log(l,()=>`Invalid arguments: shares='${e}' price='${n}'`):Object(h.a)("ERROR: Invalid numeric value provided for either 'shares' or 'price' argument"),!1;const c=new a.a(t.symbol,e,n,o,s);if(null==g.Orders){const t={};for(const e of Object.keys(g)){const n=g[e];n instanceof i.a&&(t[n.symbol]=[])}g.Orders=t}g.Orders[t.symbol].push(c);const f={stockMarket:g,symbolToStockMap:y};return Object(r.a)(t,c.type,c.pos,f),!0}function E(t,e){if(null==g.Orders)return!1;if(t.order&&t.order instanceof a.a){const e=t.order,n=g.Orders[e.stockSymbol];for(let t=0;t"Successfully cancelled order: "+a),!0}return e&&p.a.log(e,()=>"Failed to cancel order: "+a),!1}return!1}function v(t){g=""===t?{lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0}:JSON.parse(t,d.c)}function k(){g={lastUpdate:0,Orders:{},storedCycles:0,ticksUntilCycle:0}}function w(){for(const t of Object.keys(g))g.hasOwnProperty(t)&&delete g[t];for(const t of s.a){const e=t.name;g[e]=new i.a(t)}const t={};for(const e of Object.keys(g)){const n=g[e];n instanceof i.a&&(t[n.symbol]=[])}g.Orders=t,g.storedCycles=0,g.lastUpdate=0,g.ticksUntilCycle=o.a}function S(){for(const t of Object.keys(f.a))if(f.a.hasOwnProperty(t)){const e=g[t];if(null==e){console.error("Could not find Stock for "+t);continue}const n=f.a[t];y[n]=e}}const _=6e3/u.a.MilliPerCycle;function C(t=1){if((null==g.storedCycles||isNaN(g.storedCycles))&&(g.storedCycles=0),g.storedCycles+=t,g.storedCycles<_)return;const e=(new Date).getTime();if(e-g.lastUpdate<4e3)return;g.lastUpdate=e,g.storedCycles-=_,null!=g.ticksUntilCycle&&"number"==typeof g.ticksUntilCycle||(g.ticksUntilCycle=o.a),--g.ticksUntilCycle,g.ticksUntilCycle<=0&&function(){for(const t of Object.keys(g)){const e=g[t];if(!(e instanceof i.a))continue;Math.random()<.45&&(e.b=!e.b,e.flipForecastForecast()),g.ticksUntilCycle=o.a}}();const n=Math.random();for(const t of Object.keys(g)){const e=g[t];if(!(e instanceof i.a))continue;let a=n*e.mv/100;isNaN(a)&&(a=.02);let o=50;o=e.b?(o+e.otlkMag)/100:(o-e.otlkMag)/100,e.price>=e.cap&&(o=.1,e.b=!1),isNaN(o)&&(o=.5);const s=Math.random(),f={stockMarket:g,symbolToStockMap:y};s1?1:i<0?0:i}function o(t,e){null==t.baseDifficulty&&(t.baseDifficulty=t.hackDifficulty);let n=3;return n+=.3*t.baseDifficulty,n*e.mults.hacking_exp*a.a.HackExpGain}function s(t,e){const n=(100-t.hackDifficulty)/100*((e.skills.hacking-(t.requiredHackingSkill-1))/e.skills.hacking)*e.mults.hacking_money*a.a.ScriptHackMoney/240;return n<0?0:n>1?1:n}function l(t,e){let n=2.5*(t.requiredHackingSkill*t.hackDifficulty)+500;n/=e.skills.hacking+50;return 5*n/(e.mults.hacking_speed*Object(r.a)(e.skills.intelligence,1))}function c(t,e){return 3.2*l(t,e)}function f(t,e){return 4*l(t,e)}},,function(t,e,n){"use strict";n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var a=n(90);const r=(t,e,n,r=1)=>{const i=Object(a.d)(n,e.shockBonus(),n.money>0);Object(a.b)(e,i,r);const o=Object(a.d)(i,e.syncBonus(),n.money>0);Object(a.a)(t,t,o,r,"sleeves"),t.sleeves.filter(t=>t!=e).forEach(t=>Object(a.b)(t,o,r))};class i{constructor(t){this.type=t}finish(t){}}let o;!function(t){t.COMPANY="COMPANY",t.FACTION="FACTION",t.CRIME="CRIME",t.CLASS="CLASS",t.RECOVERY="RECOVERY",t.SYNCHRO="SYNCHRO",t.BLADEBURNER="BLADEBURNER",t.INFILTRATE="INFILTRATE",t.SUPPORT="SUPPORT"}(o||(o={}))},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(15),r=n(801);let i=new r.a;function o(t){i=t?JSON.parse(t,a.c):new r.a}function s(t,e){const n=[];for(let a=0;at);c.a.factions.sort((t,n)=>e.indexOf(t)-e.indexOf(n));const n=t.getInfo();for(const t of n.enemies)l.a[t]instanceof s.a&&(l.a[t].isBanned=!0);for(let e=0;ec.a.hasAugmentation(t))}function v(t,e,n=!1){const a=E(t),o=t.getCost(c.a);if(a)if(0!==o.moneyCost&&c.a.money=o.moneyCost){const e=new r.a(t.name);if(t.name==i.a.NeuroFluxGovernor&&(e.level=t.getLevel(c.a)),c.a.queuedAugmentations.push(e),c.a.loseMoney(o.moneyCost,"augmentations"),n)return"You purchased "+t.name;f.a.SuppressBuyAugmentationConfirmation||Object(m.a)("You purchased "+t.name+". Its enhancements will not take effect until they are installed. To install your augmentations, go to the 'Augmentations' tab on the left-hand navigation menu. Purchasing additional augmentations will now be more expensive.")}else Object(m.a)("Hmm, something went wrong when trying to purchase an Augmentation. Please report this to the game developer with an explanation of how to reproduce this.");else{const e=`You must first purchase or install ${t.prereqs.filter(t=>!c.a.hasAugmentation(t)).join(",")} before you can purchase this one.`;if(n)return e;Object(m.a)(e)}return""}function k(t){for(const e of Object.keys(l.a)){if(Object(g.b)(c.a.currentWork)&&e===c.a.currentWork.factionName)continue;if(!l.a.hasOwnProperty(e))continue;const n=l.a[e];if(!n.isMember)continue;if(!n.getInfo().offersWork())continue;if(c.a.getGangName()===e)continue;const a=Math.min(.1,n.favor/1e3+.01),r=Object(u.c)(c.a,n.favor),i=Object(u.b)(c.a,n.favor),s=Object(u.a)(c.a,n.favor),f=Math.max(r*a,i*a,s*a,1/120);n.playerReputation+=f*t*c.a.mults.faction_rep*o.a.FactionPassiveRepGain}}const w=(t,e)=>{if(t.hasGangWith(e.name)){let n=Object.values(a.a);n=n.filter(t=>!t.isSpecial&&t.name!==i.a.CongruityImplant),2===t.bitNodeN&&n.push(a.a[i.a.TheRedPill]);const r=Object(p.b)(`BN${t.bitNodeN}.${t.sourceFileLvl(t.bitNodeN)}`),s=t=>t.factions.length>1||(!!e.augmentations.includes(t.name)||r()>=1-o.a.GangUniqueAugs);return n=n.filter(s),n.map(t=>t.name)}return e.augmentations.slice()}},function(t,e,n){"use strict";n.d(e,"c",(function(){return D})),n.d(e,"b",(function(){return R})),n.d(e,"a",(function(){return I}));var a=n(164),r=n(78),i=n(13),o=n(29),s=n(81),l=n(1),c=n(24),f=n(6),u=n(98),m=n(104),h=n(84),d=n(362),p=n(16),g=n(15),y=n(353),b=n(696),E=n(12),v=n(325),k=n(10),w=n(614),S=n(309),_=n(124),C=n(5),x=n(201),L=n(140),O=n(89),M=n(1095);function A(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class T{constructor(){A(this,"PlayerSave",""),A(this,"AllServersSave",""),A(this,"CompaniesSave",""),A(this,"FactionsSave",""),A(this,"AliasesSave",""),A(this,"GlobalAliasesSave",""),A(this,"StockMarketSave",""),A(this,"SettingsSave",""),A(this,"VersionSave",""),A(this,"AllGangsSave",""),A(this,"LastExportBonus",""),A(this,"StaneksGiftSave","")}getSaveString(t=!1){this.PlayerSave=JSON.stringify(l.a),this.AllServersSave=Object(c.j)(t),this.CompaniesSave=JSON.stringify(r.a),this.FactionsSave=JSON.stringify(o.a),this.AliasesSave=JSON.stringify(a.a),this.GlobalAliasesSave=JSON.stringify(a.b),this.StockMarketSave=JSON.stringify(u.a),this.SettingsSave=JSON.stringify(f.a),this.VersionSave=JSON.stringify(i.a.VersionNumber),this.LastExportBonus=JSON.stringify(d.a),this.StaneksGiftSave=JSON.stringify(m.c),l.a.inGang()&&(this.AllGangsSave=JSON.stringify(s.a));return btoa(unescape(encodeURIComponent(JSON.stringify(this))))}saveGame(t=!0){const e=(new Date).getTime();l.a.lastSave=e;const n=this.getSaveString(f.a.ExcludeRunningScriptsFromSave);return new Promise((a,r)=>{Object(y.c)(n).then(()=>{const r={playerIdentifier:l.a.identifier,fileName:this.getSaveFileName(),save:n,savedOn:e};return Object(S.d)(r),t&&h.b.emit("Game Saved!",h.d.INFO,2e3),a()}).catch(t=>(console.error(t),r()))})}getSaveFileName(t=!1){const e=Math.round(Date.now()/1e3),n=l.a.bitNodeN;let a=`bitburnerSave_${e}_BN${n}x${l.a.sourceFileLvl(n)+1}.json`;return t&&(a="RECOVERY"+a),a}exportGame(){const t=this.getSaveString(f.a.ExcludeRunningScriptsFromSave);I(this.getSaveFileName(),t)}importGame(t,e=!0){if(!t||""===t)throw new Error("Invalid import string");return Object(y.c)(t).then(()=>(e&&setTimeout(()=>location.reload(),1e3),Promise.resolve()))}getImportStringFromFile(t){if(null===t)return Promise.reject(new Error("No file selected"));const e=t[0];if(!e)return Promise.reject(new Error("Invalid file selected"));const n=new FileReader,a=new Promise((t,e)=>{n.onload=function(n){const a=n.target;if(null===a)return e(new Error("Error importing file"));const r=a.result;if("string"!=typeof r)return e(new Error("FileReader event was not type string"));t(r)}});return n.readAsText(e),a}async getImportDataFromString(t){var e,n,a,r,i,o,s,c;if(!t||""===t)throw new Error("Invalid import string");let f,u;try{f=window.atob(t),f=f.trim()}catch(t){console.error(t)}if(!f||""===f)return Promise.reject(new Error("Save game had not content or was not base64 encoded"));try{u=JSON.parse(f)}catch(t){console.error(t)}if(!u||"BitburnerSaveObject"!==u.ctor||!u.data)return Promise.reject(new Error("Save game did not seem valid"));const m={base64:t},h=w.a.fromJSON(JSON.parse(u.data.PlayerSave)),d={identifier:h.identifier,lastSave:h.lastSave,totalPlaytime:h.totalPlaytime,money:h.money,hacking:h.skills.hacking,augmentations:null!==(e=null===(n=h.augmentations)||void 0===n?void 0:n.reduce((t,e)=>t+e.level,0))&&void 0!==e?e:0,factions:null!==(a=null===(r=h.factions)||void 0===r?void 0:r.length)&&void 0!==a?a:0,achievements:null!==(i=null===(o=h.achievements)||void 0===o?void 0:o.length)&&void 0!==i?i:0,bitNode:h.bitNodeN,bitNodeLevel:h.sourceFileLvl(l.a.bitNodeN)+1,sourceFiles:null!==(s=null===(c=h.sourceFiles)||void 0===c?void 0:c.reduce((t,e)=>t+e.lvl,0))&&void 0!==s?s:0};return m.playerData=d,Promise.resolve(m)}toJSON(){return Object(g.b)("BitburnerSaveObject",this)}static fromJSON(t){return Object(g.a)(T,t.data)}}function R(t){if(-1!==navigator.userAgent.indexOf("wv")&&-1!==navigator.userAgent.indexOf("Chrome/")&&setInterval(()=>{Object(p.a)("SCAM ALERT. This app is not official and you should uninstall it.")},1e3),!t)return!1;t=decodeURIComponent(escape(atob(t)));const e=JSON.parse(t,g.c);if(Object(l.b)(e.PlayerSave),Object(c.h)(e.AllServersSave),Object(r.c)(e.CompaniesSave),Object(o.d)(e.FactionsSave),e.hasOwnProperty("StaneksGiftSave")?Object(m.b)(e.StaneksGiftSave):(console.warn("Could not load Staneks Gift from save"),Object(m.b)("")),e.hasOwnProperty("AliasesSave"))try{Object(a.c)(e.AliasesSave)}catch(t){console.warn("Could not load Aliases from save"),Object(a.c)("")}else console.warn("Save file did not contain an Aliases property"),Object(a.c)("");if(e.hasOwnProperty("GlobalAliasesSave"))try{Object(a.d)(e.GlobalAliasesSave)}catch(t){console.warn("Could not load GlobalAliases from save"),Object(a.d)("")}else console.warn("Save file did not contain a GlobalAliases property"),Object(a.d)("");if(e.hasOwnProperty("StockMarketSave"))try{Object(u.h)(e.StockMarketSave)}catch(t){Object(u.h)("")}else Object(u.h)("");if(e.hasOwnProperty("SettingsSave"))try{f.a.load(e.SettingsSave)}catch(t){console.error("ERROR: Failed to parse Settings. Re-initing default values"),f.a.init()}else f.a.init();if(e.hasOwnProperty("LastExportBonus"))try{d.d(JSON.parse(e.LastExportBonus))}catch(t){d.d((new Date).getTime()),console.error("ERROR: Failed to parse last export bonus Settings "+t)}if(l.a.inGang()&&e.hasOwnProperty("AllGangsSave"))try{Object(s.b)(e.AllGangsSave)}catch(t){console.error("ERROR: Failed to parse AllGangsSave: "+t)}if(e.hasOwnProperty("VersionSave"))try{const t=JSON.parse(e.VersionSave,g.c);!function(t){const e=l.a;if("string"==typeof t){if(t<="0.41.2"){null!=e.companyPosition&&"string"!=typeof e.companyPosition&&(e.companyPosition=e.companyPosition.data.positionName,null==e.companyPosition&&(e.companyPosition=""));for(const t of Object.keys(r.a)){const e=r.a[t];if(0==e.name&&null!=e.companyName&&(e.name=e.companyName),e.companyPositions instanceof Array){const t={};for(let n=0;n0)for(const t of e.sleeves)if(t.augmentations&&0!==t.augmentations.length)for(const e of t.augmentations)"Graphene BranchiBlades Upgrade"===e.name&&(e.name="Graphene BrachiBlades Upgrade");if(t<12&&void 0!==e.resleeves&&delete e.resleeves,t<15&&(f.a.EditorTheme={..._.a}),t<16){o.a[C.a.ShadowsOfAnarchy]=new x.a(C.a.ShadowsOfAnarchy);for(const t of Object(c.c)())for(const e of t.contracts)"HammingCodes: Integer to encoded Binary"==e.type&&(e.type="HammingCodes: Integer to Encoded Binary")}const n=()=>{e.hp={current:1,max:1};for(const t of e.sleeves)t.hp={current:1,max:1};e.exp.hacking=e.hacking_exp,e.exp.strength=e.strength_exp,e.exp.defense=e.defense_exp,e.exp.dexterity=e.dexterity_exp,e.exp.agility=e.agility_exp,e.exp.charisma=e.charisma_exp,e.exp.intelligence=e.intelligence_exp};if(t<17){let t=[...l.a.augmentations];t=t.filter(t=>t.name===E.a.NeuroFluxGovernor);const e=new v.a(E.a.NeuroFluxGovernor);e.level=0;for(const n of t)e.level+=n.level;l.a.augmentations=[...l.a.augmentations.filter(t=>t.name!==E.a.NeuroFluxGovernor),e],n(),l.a.reapplyAllAugmentations(!0),l.a.reapplyAllSourceFiles()}if(t<20){if(!Object(c.d)(O.a.DarkWeb)){const t=Object(L.g)({ip:Object(c.e)(),hostname:O.a.DarkWeb,organizationName:"",isConnectedTo:!1,adminRights:!1,purchasedByPlayer:!1,maxRam:1});Object(c.a)(t)}}if(t<21){Object(b.a)(10);const t=e.createProgramName;t&&l.a.getHomeComputer().pushProgram(t);const n=e.graftAugmentationName;n&&l.a.augmentations.push({name:n,level:1})}if(t<22&&(n(),Object(M.a)()),t<23&&(e.currentWork=null),t<24&&l.a.getHomeComputer().scripts.forEach(t=>t.filename.endsWith(".ns")&&(t.filename+=".js")),t<25){const t=["hacking_chance_mult","hacking_speed_mult","hacking_money_mult","hacking_grow_mult","hacking_mult","strength_mult","defense_mult","dexterity_mult","agility_mult","charisma_mult","hacking_exp_mult","strength_exp_mult","defense_exp_mult","dexterity_exp_mult","agility_exp_mult","charisma_exp_mult","company_rep_mult","faction_rep_mult","crime_money_mult","crime_success_mult","work_money_mult","hacknet_node_money_mult","hacknet_node_purchase_cost_mult","hacknet_node_ram_cost_mult","hacknet_node_core_cost_mult","hacknet_node_level_cost_mult","bladeburner_max_stamina_mult","bladeburner_stamina_gain_mult","bladeburner_analysis_mult","bladeburner_success_chance_mult","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","intelligence_exp","companyName","isWorking","workType","workCostMult","workExpMult","currentWorkFactionName","currentWorkFactionDescription","workHackExpGainRate","workStrExpGainRate","workDefExpGainRate","workDexExpGainRate","workAgiExpGainRate","workChaExpGainRate","workRepGainRate","workMoneyGainRate","workMoneyLossRate","workHackExpGained","workStrExpGained","workDefExpGained","workDexExpGained","workAgiExpGained","workChaExpGained","workRepGained","workMoneyGained","createProgramName","createProgramReqLvl","graftAugmentationName","timeWorkedGraftAugmentation","className","crimeType","timeWorked","timeWorkedCreateProgram","timeNeededToCompleteWork","factionWorkType","committingCrimeThruSingFn","singFnCrimeWorkerScript","hacking","max_hp","strength","defense","dexterity","agility","charisma","intelligence"],n=["gymStatType","bbAction","bbContract","hacking","strength","defense","dexterity","agility","charisma","intelligence","max_hp","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","intelligence_exp","hacking_mult","strength_mult","defense_mult","dexterity_mult","agility_mult","charisma_mult","hacking_exp_mult","strength_exp_mult","defense_exp_mult","dexterity_exp_mult","agility_exp_mult","charisma_exp_mult","hacking_chance_mult","hacking_speed_mult","hacking_money_mult","hacking_grow_mult","company_rep_mult","faction_rep_mult","crime_money_mult","crime_success_mult","work_money_mult","hacknet_node_money_mult","hacknet_node_purchase_cost_mult","hacknet_node_ram_cost_mult","hacknet_node_core_cost_mult","hacknet_node_level_cost_mult","bladeburner_max_stamina_mult","bladeburner_stamina_gain_mult","bladeburner_analysis_mult","bladeburner_success_chance_mult","className","crimeType","currentTask","currentTaskLocation","currentTaskMaxTime","currentTaskTime","earningsForSleeves","earningsForPlayer","earningsForTask","factionWorkType","gainRatesForTask","logs"];let a=Number(e.intelligence_exp);isNaN(a)&&(a=0),e.exp.intelligence+=a;for(const n of t)delete e[n];for(const t of e.sleeves){const e=t;let a=Number(e.intelligence_exp);isNaN(a)&&(a=0),e.exp.intelligence+=a;for(const e of n)delete t[e]}}}}(t),window.location.href.toLowerCase().includes("bitburner-beta")?Object(p.a)("You are playing on the beta environment! This branch of the game features the latest developments in the game. This version may be unstable.
Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) or the Bitburner subreddit (reddit.com/r/bitburner).

"+i.a.LatestUpdate,N):t!==i.a.VersionNumber&&P()}catch(t){P()}else P();return!0}const N={"& h1, & h2, & h3, & h4, & p, & a, & ul":{margin:0,color:f.a.theme.primary,whiteSpace:"initial"},"& ul":{paddingLeft:"1.5em",lineHeight:1.5}};function P(){setTimeout(()=>Object(p.a)("New update!
Please report any bugs/issues through the GitHub repository or the Bitburner subreddit (reddit.com/r/bitburner).

"+i.a.LatestUpdate,N),1e3)}function I(t,e){const n=new Blob([e],{type:"text/plain"}),a=document.createElement("a"),r=URL.createObjectURL(n);a.href=r,a.download=t,document.body.appendChild(a),a.click(),setTimeout((function(){document.body.removeChild(a),window.URL.revokeObjectURL(r)}),0)}g.c.constructors.BitburnerSaveObject=T;const D=new T},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1069),r=n(384);const i={};a.a.forEach(t=>{var e;null!=i[(e=t).name]&&console.warn("Duplicate Company Position being defined: "+e.name),i[e.name]=new r.a(e)})},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.HACKING="HACKING",t.FIELD="FIELD",t.SECURITY="SECURITY"}(a||(a={}))},,,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),function(t){t.Bypass="Bypass",t.PrototypeTampering="PrototypeTampering",t.Unclickable="Unclickable",t.UndocumentedFunctionCall="UndocumentedFunctionCall",t.TimeCompression="TimeCompression",t.RealityAlteration="RealityAlteration",t.N00dles="N00dles",t.YoureNotMeantToAccessThis="YoureNotMeantToAccessThis",t.TrueRecursion="TrueRecursion",t.INeedARainbow="INeedARainbow",t.EditSaveFile="EditSaveFile"}(a||(a={}));const r={Bypass:"by circumventing the ram cost of document.",EditSaveFile:"by editing your save file.",PrototypeTampering:"by tampering with Numbers prototype.",TimeCompression:"by compressing time.",Unclickable:"by clicking the unclickable.",UndocumentedFunctionCall:"by looking beyond the documentation.",RealityAlteration:"by altering reality to suit your whims.",N00dles:"by harnessing the power of the n00dles.",YoureNotMeantToAccessThis:"by accessing the dev menu.",TrueRecursion:"by truly recursing.",INeedARainbow:"by using the power of the rainbow."};function i(t){return r[t]}function o(t){return t=t.filter(t=>Object.keys(a).includes(t)),[...new Set(t)]}},,,function(t,e,n){"use strict";n.d(e,"c",(function(){return b})),n.d(e,"d",(function(){return E})),n.d(e,"g",(function(){return _})),n.d(e,"f",(function(){return w})),n.d(e,"e",(function(){return y})),n.d(e,"a",(function(){return k})),n.d(e,"b",(function(){return S}));var a=n(36),r=n(74),i=n(325),o=n(12),s=n(13),l=n(29),c=n(1),f=n(481),u=n(16),m=n(1449),h=n(5),d=n(367),p=n(91),g=n(213);function y(){!function(){for(const t of Object.keys(l.a))l.a.hasOwnProperty(t)&&(l.a[t].augmentations=[])}(),Object(m.a)(r.a),[Object(d.d)(),Object(d.f)(),...Object(d.c)(),...Object(d.e)(),...Object(l.b)(h.a.Bladeburners)?Object(d.a)():[],...Object(l.b)(h.a.ChurchOfTheMachineGod)?Object(d.b)():[]].map(v),c.a.reapplyAllAugmentations()}function b(){return s.a.MultipleAugMultiplier*[1,.96,.94,.93][c.a.sourceFileLvl(11)]}function E(){return Math.pow(b(),c.a.queuedAugmentations.length)}function v(t){t.addToFactions(t.factions);const e=t.name;S(e)&&delete r.a[e],function(t){const e=t.name;r.a[e]=t}(t)}function k(t,e=!1){const n=r.a[t.name];c.a.mults=Object(g.b)(c.a.mults,n.mults),t.name!==o.a.CongruityImplant||e||(c.a.entropy=0,c.a.applyEntropy(c.a.entropy));const a=c.a.augmentations.find(t=>t.name===o.a.NeuroFluxGovernor);if(t.name!==o.a.NeuroFluxGovernor||e||!a){if(!e){const e=new i.a(t.name);c.a.augmentations.push(e)}}else a.level=t.level}function w(t){if(0==c.a.queuedAugmentations.length&&!t)return Object(u.a)("You have not purchased any Augmentations to install!"),!1;let e="",n=-1;for(let t=c.a.queuedAugmentations.length-1;t>=0;t--)if(c.a.queuedAugmentations[t].name===o.a.NeuroFluxGovernor){n=t;break}for(let t=0;t"}return c.a.queuedAugmentations=[],t||Object(u.a)("You slowly drift to sleep as scientists put you under in order to install the following Augmentations:
"+e+"
You wake up in your home...you feel different..."),Object(f.a)(),p.b.toTerminal(),!0}function S(t){return r.a.hasOwnProperty(t)}function _(t){return(t instanceof a.a?t.name:t)===o.a.NeuroFluxGovernor}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(7),o=n(23);function s({money:t}){return r.a.createElement(o.a,{money:i.a.formatMoney(t)+" / sec"})}},function(t,e,n){"use strict";n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(999),r=n(15),i=n(599);class o{constructor(t,e,n,a,r,i){this.name=t,this.desc=e,this.generate=n,this.solver=a,this.difficulty=r,this.numTries=i}}const s={};for(const t of a.a)s[t.name]=new o(t.name,t.desc,t.gen,t.solver,t.difficulty,t.numTries);let l,c;!function(t){t[t.FactionReputation=0]="FactionReputation",t[t.FactionReputationAll=1]="FactionReputationAll",t[t.CompanyReputation=2]="CompanyReputation",t[t.Money=3]="Money"}(l||(l={})),function(t){t[t.Success=0]="Success",t[t.Failure=1]="Failure",t[t.Cancelled=2]="Cancelled"}(c||(c={}));class f{constructor(t="",e="Find Largest Prime Factor",n=null){var a,r,i;if(i=0,(r="tries")in(a=this)?Object.defineProperty(a,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[r]=i,this.fn=t,this.fn.endsWith(".cct")||(this.fn+=".cct"),null==s[e])throw new Error(`Error: invalid contract type: ${e} please contact developer`);this.type=e,this.data=s[e].generate(),this.reward=n}getData(){return this.data}getDescription(){return s[this.type].desc(this.data)}getDifficulty(){return s[this.type].difficulty}getMaxNumTries(){return s[this.type].numTries}getType(){return s[this.type].name}isSolution(t){return s[this.type].solver(this.data,t)}async prompt(){return new Promise(t=>{const e={c:this,onClose:()=>{t(c.Cancelled)},onAttempt:e=>{this.isSolution(e)?t(c.Success):t(c.Failure)}};i.a.emit(e)})}toJSON(){return Object(r.b)("CodingContract",this)}static fromJSON(t){return Object(r.a)(f,t.data)}}r.c.constructors.CodingContract=f},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.LimitBuy="Limit Buy Order",t.LimitSell="Limit Sell Order",t.StopBuy="Stop Buy Order",t.StopSell="Stop Sell Order"}(a||(a={}))},,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return s})),n.d(e,"d",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(64),r=n(219);const i=[];class o{constructor(t,e,n,a,r){this.id=t,this.shape=e,this.type=n,this.power=a,this.limit=r}fullAt(t,e,n){if(e<0)return!1;if(e>=this.height(n))return!1;if(t<0)return!1;if(t>=this.width(n))return!1;let[a,r,i,o]=[0,0,1,1];1===n?[a,r,i,o]=[this.width(n)-1,0,-1,1]:2===n?[a,r,i,o]=[this.width(n)-1,this.height(n)-1,-1,-1]:3===n&&([a,r,i,o]=[0,this.height(n)-1,1,-1]);let[s,l]=[a+i*t,r+o*e];return n%2==1&&([s,l]=[l,s]),this.shape[l][s]}width(t){return t%2==0?this.shape[0].length:this.shape.length}height(t){return t%2==0?this.shape.length:this.shape[0].length}neighboors(t){const e=[],n=(n,a)=>{this.fullAt(n,a,t)||e.some(t=>t[0]===n&&t[1]===a)||e.push([n,a])};for(let e=0;ee[0]===t[0]&&e[1]===t[1])||a.push(t);return a}copy(){return Object.assign({},this)}}function s(t){for(const e of i)if(e.id===t)return e;return null}!function(){const t=!1,e=!0;i.push(new o(0,r.a.S,a.b.Hacking,1,1)),i.push(new o(1,r.a.Z,a.b.Hacking,1,1)),i.push(new o(5,r.a.T,a.b.HackingSpeed,1.3,1)),i.push(new o(6,r.a.I,a.b.HackingMoney,2,1)),i.push(new o(7,r.a.J,a.b.HackingGrow,.5,1)),i.push(new o(10,r.a.T,a.b.Strength,2,1)),i.push(new o(12,r.a.L,a.b.Defense,2,1)),i.push(new o(14,r.a.L,a.b.Dexterity,2,1)),i.push(new o(16,r.a.S,a.b.Agility,2,1)),i.push(new o(18,r.a.S,a.b.Charisma,3,1)),i.push(new o(20,r.a.I,a.b.HacknetMoney,1,1)),i.push(new o(21,r.a.O,a.b.HacknetCost,2,1)),i.push(new o(25,r.a.J,a.b.Rep,.5,1)),i.push(new o(27,r.a.J,a.b.WorkMoney,10,1)),i.push(new o(28,r.a.L,a.b.Crime,2,1)),i.push(new o(30,r.a.S,a.b.Bladeburner,.4,1)),i.push(new o(100,[[t,e,e],[e,e,t],[t,e,t]],a.b.Booster,1.1,99)),i.push(new o(101,[[e,e,e,e],[e,t,t,t]],a.b.Booster,1.1,99)),i.push(new o(102,[[t,e,e,e],[e,e,t,t]],a.b.Booster,1.1,99)),i.push(new o(103,[[e,e,e,t],[t,t,e,e]],a.b.Booster,1.1,99)),i.push(new o(104,[[t,e,e],[t,e,t],[e,e,t]],a.b.Booster,1.1,99)),i.push(new o(105,[[t,t,e],[t,e,e],[e,e,t]],a.b.Booster,1.1,99)),i.push(new o(106,[[e,t,t],[e,e,e],[e,t,t]],a.b.Booster,1.1,99)),i.push(new o(107,[[t,e,t],[e,e,e],[t,e,t]],a.b.Booster,1.1,99))}();const l=new o(-2,[],a.b.None,0,1/0),c=new o(-2,[],a.b.Delete,0,1/0)},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"d",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"b",(function(){return s}));const a={base:"vs-dark",inherit:!0,common:{accent:"B5CEA8",bg:"1E1E1E",fg:"D4D4D4"},syntax:{tag:"569CD6",entity:"569CD6",string:"CE9178",regexp:"646695",markup:"569CD6",keyword:"569CD6",comment:"6A9955",constant:"569CD6",error:"F44747"},ui:{line:"1E1E1E",panel:{bg:"252526",selected:"252526",border:"1E1E1E"},selection:{bg:"ADD6FF26"}}},r=/^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/,i=t=>{for(const[e,n]of Object.entries(t)){switch(e){case"base":["vs-dark","vs"].includes(t.base)||(t.base="vs-dark");continue;case"inherit":"boolean"!=typeof t.inherit&&(t.inherit=!0);continue}const a=t=>{for(const[e,n]of Object.entries(t))"object"==typeof n?a(n):n.match(r)||(t[e]="FF0000")};a(n)}};function o(t){const e=[{token:"",background:t.ui.line,foreground:t.common.fg},{token:"identifier",foreground:t.common.accent},{token:"keyword",foreground:t.syntax.keyword},{token:"string",foreground:t.syntax.string},{token:"string.escape",foreground:t.syntax.regexp},{token:"comment",foreground:t.syntax.comment},{token:"constant",foreground:t.syntax.constant},{token:"entity",foreground:t.syntax.entity},{token:"type",foreground:t.syntax.tag},{token:"tag",foreground:t.syntax.tag},{token:"regexp",foreground:t.syntax.regexp},{token:"attribute",foreground:t.syntax.tag},{token:"constructor",foreground:t.syntax.markup},{token:"invalid",foreground:t.syntax.error},{token:"number",foreground:t.common.accent},{token:"delimiter",foreground:t.common.fg},{token:"ns",foreground:t.syntax.tag},{token:"netscriptfunction",foreground:t.syntax.markup},{token:"otherkeywords",foreground:t.syntax.keyword},{token:"otherkeyvars",foreground:t.common.accent},{token:"this",foreground:t.syntax.tag}],n=Object.fromEntries([["editor.background",t.common.bg],["editor.foreground",t.common.fg],["editor.lineHighlightBackground",t.ui.line],["editor.selectionBackground",t.ui.selection.bg],["editorSuggestWidget.background",t.ui.panel.bg],["editorSuggestWidget.border",t.ui.panel.border],["editorSuggestWidget.selectedBackground",t.ui.panel.selected],["editorHoverWidget.background",t.ui.panel.bg],["editorHoverWidget.border",t.ui.panel.border],["editorWidget.background",t.ui.panel.bg],["editorWidget.border",t.ui.panel.border],["input.background",t.ui.panel.bg],["input.border",t.ui.panel.border]].map(([t,e])=>[t,"#"+e]));return{base:t.base,inherit:t.inherit,rules:e,colors:n}}async function s(t){t.editor.defineTheme("monokai",{base:"vs-dark",inherit:!0,rules:[{background:"272822",token:""},{foreground:"75715e",token:"comment"},{foreground:"e6db74",token:"string"},{token:"number",foreground:"ae81ff"},{token:"otherkeyvars",foreground:"ae81ff"},{foreground:"ae81ff",token:"function"},{foreground:"f92672",token:"keyword"},{token:"storage.type.function.js",foreground:"ae81ff"},{token:"ns",foreground:"97d92b"},{token:"netscriptfunction",foreground:"53d3e4"},{token:"otherkeywords",foreground:"53d3e4"},{token:"this",foreground:"fd971f"}],colors:{"editor.foreground":"#F8F8F2","editor.background":"#272822","editor.selectionBackground":"#49483E","editor.lineHighlightBackground":"#3E3D32","editorCursor.foreground":"#F8F8F0","editorWhitespace.foreground":"#3B3A32","editorIndentGuide.activeBackground":"#9D550FB0","editor.selectionHighlightBorder":"#222218"}}),t.editor.defineTheme("solarized-dark",{base:"vs-dark",inherit:!0,rules:[{background:"002b36",token:""},{foreground:"586e75",token:"comment"},{foreground:"00afaf",token:"string"},{token:"number",foreground:"00afaf"},{token:"otherkeyvars",foreground:"268bd2"},{foreground:"268bd2",token:"function"},{foreground:"859900",token:"keyword"},{token:"storage.type.function.js",foreground:"cb4b16"},{token:"ns",foreground:"cb4b16"},{token:"netscriptfunction",foreground:"268bd2"},{token:"otherkeywords",foreground:"268bd2"},{token:"type.identifier.js",foreground:"b58900"},{token:"delimiter.square.js",foreground:"0087ff"},{token:"delimiter.bracket.js",foreground:"0087ff"},{token:"this",foreground:"cb4b16"}],colors:{"editor.foreground":"#839496","editor.background":"#002b36","editor.selectionBackground":"#073642","editor.lineHighlightBackground":"#073642","editorCursor.foreground":"#819090","editorWhitespace.foreground":"#073642","editorIndentGuide.activeBackground":"#9D550FB0","editor.selectionHighlightBorder":"#222218"}}),t.editor.defineTheme("solarized-light",{base:"vs",inherit:!0,rules:[{foreground:"657b83",background:"fdf6e3",token:""},{foreground:"586e75",token:"comment"},{foreground:"2aa198",token:"string"},{token:"number",foreground:"2aa198"},{token:"otherkeyvars",foreground:"268bd2"},{foreground:"268bd2",token:"function"},{foreground:"859900",token:"keyword"},{token:"storage.type.function.js",foreground:"bc4b16"},{token:"ns",foreground:"cb4b16"},{token:"netscriptfunction",foreground:"268bd2"},{token:"otherkeywords",foreground:"268bd2"},{token:"type.identifier.js",foreground:"b58900"},{token:"delimiter.square.js",foreground:"0087ff"},{token:"delimiter.bracket.js",foreground:"0087ff"},{token:"this",foreground:"cb4b16"}],colors:{"editor.foreground":"#657b83","editor.background":"#fdf6e3","editor.selectionBackground":"#eee8d5","editor.lineHighlightBackground":"#eee8d5","editorCursor.foreground":"#657b83","editorWhitespace.foreground":"#eee8d5","editorIndentGuide.activeBackground":"#eee8d5","editor.selectionHighlightBorder":"#073642"}}),t.editor.defineTheme("dracula",{base:"vs-dark",inherit:!0,rules:[{background:"282A36",foreground:"F8F8F2",token:""},{foreground:"6272A4",token:"comment"},{foreground:"F1FA8C",token:"string"},{token:"number",foreground:"BD93F9"},{token:"otherkeyvars",foreground:"BD93F9"},{foreground:"FF79C6",token:"function"},{foreground:"FF79C6",token:"keyword"},{token:"storage.type.function.js",foreground:"FF79C6"},{token:"ns",foreground:"FFB86C",fontStyle:"italic"},{token:"netscriptfunction",foreground:"FF79C6"},{token:"otherkeywords",foreground:"FF68A7"},{token:"type.identifier.js",foreground:"7EE9FD",fontStyle:"italic"},{token:"delimiter.square.js",foreground:"FFD709"},{token:"delimiter.parenthesis.js",foreground:"FFD709"},{token:"delimiter.bracket.js",foreground:"FFD709"},{token:"this",foreground:"BD93F9",fontStyle:"italic"}],colors:{"editor.foreground":"#F8F8F2","editor.background":"#282A36","editorLineNumber.foreground":"#6272A4","editor.selectionBackground":"#44475A","editor.selectionHighlightBackground":"#424450","editor.foldBackground":"#21222C","editor.wordHighlightBackground":"#8BE9FD50","editor.wordHighlightStrongBackground":"#50FA7B50","editor.findMatchBackground":"#FFB86C80","editor.findMatchHighlightBackground":"#FFFFFF40","editor.findRangeHighlightBackground":"#44475A75","editor.hoverHighlightBackground":"#8BE9FD50","editor.lineHighlightBorder":"#44475A","editor.rangeHighlightBackground":"#BD93F915","editor.snippetTabstopHighlightBackground":"#282A36","editor.snippetTabstopHighlightBorder":"#6272A4","editor.snippetFinalTabstopHighlightBackground":"#282A36","editor.snippetFinalTabstopHighlightBorder":"#50FA7B"}}),t.editor.defineTheme("one-dark",{base:"vs-dark",inherit:!0,rules:[{token:"",background:"333842",foreground:"ABB2BF"},{token:"comment",foreground:"5C6370"},{token:"string",foreground:"98C379"},{token:"number",foreground:"D19A66"},{token:"function",foreground:"C678DD"},{token:"keyword",foreground:"C678DD"},{token:"otherkeyvars",foreground:"D19A66"},{token:"otherkeywords",foreground:"C678DD"},{token:"ns",foreground:"E06C75"},{token:"netscriptfunction",foreground:"61AFEF"},{token:"type.identifier",foreground:"E5C07B"},{token:"delimiter",foreground:"ABB2BF"},{token:"this",foreground:"E06C75"}],colors:{"editor.background":"#282C34","editor.foreground":"#ABB2BF","editor.lineHighlightBackground":"#99BBFF0A","editor.selectionBackground":"#3E4451","editor.findMatchHighlightBackground":"#528BFF3D","editorCursor.foreground":"#528BFF","editorHoverWidget.background":"#21252B","editorHoverWidget.border":"#181A1F","editorIndentGuide.background":"#ABB2BF26","editorIndentGuide.activeBackground":"#626772","editorLineNumber.foreground":"#636D83","editorLineNumber.activeForeground":"#ABB2BF","editorSuggestWidget.background":"#21252B","editorSuggestWidget.border":"#181A1F","editorSuggestWidget.selectedBackground":"#2C313A","editorWhitespace.foreground":"#ABB2BF26","editorWidget.background":"#21252B","editorWidget.border":"#3A3F4B","input.background":"#1B1D23","input.border":"#181A1F","peekView.border":"#528BFF","peekViewResult.background":"#21252B","peekViewResult.selectionBackground":"#2C313A","peekViewTitle.background":"#1B1D23","peekViewEditor.background":"#1B1D23","scrollbarSlider.background":"#4E566680","scrollbarSlider.activeBackground":"#747D9180","scrollbarSlider.hoverBackground":"#5A637580"}})}},,,function(t,e,n){"use strict";function a(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){const e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)}))}n.d(e,"a",(function(){return r}));class r{constructor(){var t,e,n;n={},(e="subscribers")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}subscribe(t){let e=a();for(;void 0!==this.subscribers[e];)e=a();return this.subscribers[e]=t,()=>{delete this.subscribers[e]}}emit(...t){for(const e in this.subscribers){const n=this.subscribers[e];void 0!==n&&n(...t)}}}},,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(639),o=n.n(i),s=n(1150),l=n.n(s),c=n(112),f=n(1151),u=n.n(f),m=n(636),h=n.n(m),d=n(88),p=n(21);function g(t){const[e,n]=Object(a.useState)("");const{label:i,placeholder:s,add:f,subtract:m,reset:g,tons:y}=t;return r.a.createElement(r.a.Fragment,null,r.a.createElement(d.a,{label:i,value:e,onChange:function(t){""===t.target.value?n(""):n(parseFloat(t.target.value))},placeholder:s,type:"number",InputProps:{startAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{title:"Add a lot"},r.a.createElement(c.a,{onClick:y,size:"large"},r.a.createElement(h.a,{style:{transform:"rotate(-90deg)"}}))),r.a.createElement(p.a,{title:"Add"},r.a.createElement(c.a,{onClick:()=>f("string"!=typeof e?e:0),size:"large"},r.a.createElement(o.a,null)))),endAdornment:r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,{title:"Remove"},r.a.createElement(c.a,{onClick:()=>m("string"!=typeof e?e:0),size:"large"},r.a.createElement(l.a,null))),r.a.createElement(p.a,{title:"Reset"},r.a.createElement(c.a,{onClick:g,size:"large"},r.a.createElement(u.a,null))))}}))}},function(t,e,n){"use strict";n.d(e,"e",(function(){return r})),n.d(e,"g",(function(){return i})),n.d(e,"a",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"f",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"c",(function(){return f}));var a=n(30);function r(t,e){return Math.random()*(e-t)+t}const i="↑",o="↓",s="←",l="→";function c(t){switch(t.key){case a.a.UP_ARROW:case a.a.W:return i;case a.a.LEFT_ARROW:case a.a.A:return s;case a.a.DOWN_ARROW:case a.a.S:return o;case a.a.RIGHT_ARROW:case a.a.D:return l}return""}function f(t){switch(t.key){case a.a.DOWN_ARROW:case a.a.S:return i;case a.a.RIGHT_ARROW:case a.a.D:return s;case a.a.UP_ARROW:case a.a.W:return o;case a.a.LEFT_ARROW:case a.a.A:return l}return""}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(366),r=n(15);class i extends a.a{constructor(t=null){super(t),this.count=1}getActionTimePenalty(){return 1.5}getChaosCompetencePenalty(){return 1}getChaosDifficultyBonus(){return 1}toJSON(){return Object(r.b)("BlackOperation",this)}static fromJSON(t){return Object(r.a)(i,t.data)}}r.c.constructors.BlackOperation=i},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t.None="",t.SHOPLIFT="SHOPLIFT",t.ROB_STORE="ROBSTORE",t.MUG="MUG",t.LARCENY="LARCENY",t.DRUGS="DRUGS",t.BOND_FORGERY="BONDFORGERY",t.TRAFFIC_ARMS="TRAFFICKARMS",t.HOMICIDE="HOMICIDE",t.GRAND_THEFT_AUTO="GRANDTHEFTAUTO",t.KIDNAP="KIDNAP",t.ASSASSINATION="ASSASSINATION",t.HEIST="HEIST"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return l}));var a=n(306),r=n(690);function i(t){const e=a.a[t];if(null==e)throw new Error("Invalid research name: "+t);return new r.a({text:e.name,cost:e.cost})}function o(){const t=i("Hi-Tech R&D Laboratory"),e=i("AutoBrew"),n=i("AutoPartyManager"),a=i("Automatic Drug Administration"),r=i("Bulk Purchasing"),o=i("CPH4 Injections"),s=i("Drones"),l=i("Drones - Assembly"),c=i("Drones - Transport"),f=i("Go-Juice"),u=i("HRBuddy-Recruitment"),m=i("HRBuddy-Training"),h=i("JoyWire"),d=i("Market-TA.I"),p=i("Market-TA.II"),g=i("Overclock"),y=i("Self-Correcting Assemblers"),b=i("Sti.mu");return a.addChild(f),a.addChild(o),s.addChild(l),s.addChild(c),u.addChild(m),d.addChild(p),g.addChild(b),t.addChild(e),t.addChild(n),t.addChild(a),t.addChild(r),t.addChild(s),t.addChild(u),t.addChild(h),t.addChild(d),t.addChild(g),t.addChild(y),t}function s(){const t=new r.b;return t.setRoot(o()),t}function l(){const t=new r.b,e=o(),n=i("uPgrade: Fulcrum"),a=i("uPgrade: Capacity.I"),s=i("uPgrade: Capacity.II"),l=i("uPgrade: Dashboard");return a.addChild(s),n.addChild(a),n.addChild(l),e.addChild(n),t.setRoot(e),t}},,function(t,e,n){"use strict";n.d(e,"g",(function(){return u})),n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"f",(function(){return d})),n.d(e,"e",(function(){return p})),n.d(e,"a",(function(){return g})),n.d(e,"b",(function(){return y}));var a=n(24),r=n(45),i=n(619),o=n(22),s=n(13),l=n(63),c=n(66),f=n(799);function u(t){let e=t.hostname.replace(/ /g,"-");if(null!=t.ip&&Object(a.g)(t.ip)&&(t.ip=Object(a.e)()),null!=Object(a.d)(e)){e+="-0";for(let t=0;t<200&&(e=e.replace(/-[0-9]+$/,"-"+t),null!=Object(a.d)(e));++t);}return t.hostname=e,new r.a(t)}function m(t,e,n,a=1){let r=1+(s.a.ServerBaseGrowthRate-1)/t.hackDifficulty;r>s.a.ServerMaxGrowthRate&&(r=s.a.ServerMaxGrowthRate);const i=t.serverGrowth/100,l=1+(a-1)/16;return Math.log(e)/(Math.log(r)*n.mults.hacking_grow*i*o.a.ServerGrowthRate*l)}function h(t,e,n,a,r=1){if(n<0&&(n=0),e>t.moneyMax&&(e=t.moneyMax),e<=n)return 0;const i=1+(s.a.ServerBaseGrowthRate-1)/t.hackDifficulty,l=Math.min(i,s.a.ServerMaxGrowthRate),c=1+(r-1)/16,f=t.serverGrowth/100*a.mults.hacking_grow*c*o.a.ServerGrowthRate,u=f*Math.log(l),m=n*u+Math.log(e*u);let h;if(m0&&(h-=Math.log(m));let d=h/u-n;const p=l**f;let g=1/0;do{const t=p**d,a=n+d;g=(a*t-e)/(a*u+1)/t,d-=g}while(Math.abs(g)>=1);const y=Math.floor(d);if(e<=(n+y)*Math.pow(l,y*f))return y;const b=Math.ceil(d);return e<=(n+b)*Math.pow(l,b*f)?b:b+1}function d(t,e,n,a=1){let r=Object(i.a)(t,e,n,a);r<1&&(console.warn("serverGrowth calculated to be less than 1"),r=1);const o=t.moneyAvailable;if(t.moneyAvailable+=1*e,t.moneyAvailable*=r,Object(f.a)(t.moneyMax)&&isNaN(t.moneyAvailable)&&(t.moneyAvailable=t.moneyMax),Object(f.a)(t.moneyMax)&&t.moneyAvailable>t.moneyMax&&(t.moneyAvailable=t.moneyMax),o!==t.moneyAvailable){let r=h(t,t.moneyAvailable,o,n,a);r=Math.min(Math.max(0,Math.ceil(r)),e),t.fortify(2*s.a.ServerFortifyAmount*r)}return t.moneyAvailable/o}function p(t,e){const n=e.programs.includes(l.a.BitFlume.name);e.programs.length=0,e.runningScripts=[],e.serversOnNetwork=[],e.isConnectedTo=!0,e.ramUsed=0,e.programs.push(l.a.NukeProgram.name),n&&e.programs.push(l.a.BitFlume.name),e.scripts.forEach((function(n){n.updateRamUsage(t,e.scripts)})),e.messages.length=0,e.messages.push(c.a.HackersStartingHandbook)}function g(t,e){return e>t.serversOnNetwork.length?(console.error("Tried to get server on network that was out of range"),null):Object(a.d)(t.serversOnNetwork[e])}function y(t){return t instanceof r.a&&t.backdoorInstalled}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({unbuyable:{color:t.palette.action.disabled},money:{color:t.colors.money}}));function l(t){const e=s();return t.corp.funds>t.money?a.createElement("span",{className:e.money},r.a.formatMoney(t.money)):a.createElement("span",{className:e.unbuyable},r.a.formatMoney(t.money))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(343),r=n(289),i=n(21),o=n(3),s=n(0),l=n.n(s);function c({checked:t,onChange:e,text:n,tooltip:c}){const[f,u]=Object(s.useState)(t);return Object(s.useEffect)(()=>e(f),[f]),l.a.createElement(l.a.Fragment,null,l.a.createElement(a.a,{control:l.a.createElement(r.a,{checked:f,onChange:function(t){u(t.target.checked)}}),label:l.a.createElement(i.a,{title:l.a.createElement(o.a,null,c)},l.a.createElement(o.a,null,n))}),l.a.createElement("br",null))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={BladesIntuition:"Blade's Intuition",Cloak:"Cloak",Marksman:"Marksman",WeaponProficiency:"Weapon Proficiency",ShortCircuit:"Short-Circuit",DigitalObserver:"Digital Observer",Tracer:"Tracer",Overclock:"Overclock",Reaper:"Reaper",EvasiveSystem:"Evasive System",Datamancer:"Datamancer",CybersEdge:"Cyber's Edge",HandsOfMidas:"Hands of Midas",Hyperdrive:"Hyperdrive"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({reputation:{color:t.colors.rep}}));function l({reputation:t}){const e=s();return a.createElement("span",{className:e.reputation},"number"==typeof t?r.a.formatReputation(t):t)}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}));var a=n(0);const r={Gang:n.n(a).a.createContext({})},i=()=>Object(a.useContext)(r.Gang)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(168),r=n(443),i=n(204),o=n(307),s=n(24),l=n(16),c=n(352),f=n(1);function u(t){if(t instanceof r.a)return h(t),!0;if("number"==typeof t)return m(t);{const e=m(t.runningScript.pid);if(e)return e;for(const e of i.a.values())if(e.scriptRef===t.runningScript)return h(e),!0;return!1}}function m(t){const e=i.a.get(t);return e instanceof r.a&&(h(e),!0)}function h(t){var e;if((e=t)instanceof r.a&&e.delay&&(clearTimeout(e.delay),e.delayReject&&e.delayReject(new a.a(e))),"function"==typeof t.atExit){try{t.env.stopFlag=!1,t.atExit()}catch(e){let n=e instanceof a.a?e.errorMessage:String(e);n=n.replace(/.*\|DELIMITER\|/,""),Object(l.a)(`Error trying to call atExit for script ${[t.name,...t.args].join(" ")} on ${t.hostname}\n ${n}`),console.error(e)}t.atExit=void 0}t.env.stopFlag=!0,function(t){const e=t.hostname,n=Object(s.d)(e);if(null==n)return void console.error("Could not find server on which this script is running: "+e);for(let e=0;e100?this.otlkMagForecast=100:this.otlkMagForecast<0&&(this.otlkMagForecast=0)}changePrice(t){this.lastPrice=this.price,this.price=t}cycleForecast(t=.1){const e=this.getForecastIncreaseChance();Math.random()5&&(this.otlkMag=Math.max(5,this.otlkMag-t))}influenceForecastForecast(t){this.otlkMagForecast>50?(this.otlkMagForecast-=t,this.otlkMagForecast=Math.max(50,this.otlkMagForecast)):this.otlkMagForecast<50&&(this.otlkMagForecast+=t,this.otlkMagForecast=Math.min(50,this.otlkMagForecast))}toJSON(){return Object(a.b)("Stock",this)}static fromJSON(t){return Object(a.a)(s,t.data)}}a.c.constructors.Stock=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={}},,function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"d",(function(){return o})),n.d(e,"e",(function(){return s})),n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"f",(function(){return f}));var a=n(22),r=n(41);function i(t,e,n,i,o){return r.b.HashesPerLevel*t*Math.pow(1.07,Math.log2(n))*(1+(i-1)/5)*(1-e/n)*o*a.a.HacknetNodeMoney}function o(t,e=1,n=1){const a=Math.round(e);if(isNaN(a)||a<1)return 0;if(t>=r.b.MaxLevel)return 1/0;const i=r.b.UpgradeLevelMult;let o=0,s=t;for(let t=0;t=r.b.MaxRam)return 1/0;let i=0,o=Math.round(Math.log2(t)),s=t;for(let t=0;t=r.b.MaxCores)return 1/0;const i=r.b.UpgradeCoreMult;let o=0,s=t;for(let t=0;t=r.b.MaxCache)return 1/0;const a=r.b.UpgradeCacheMult;let i=0,o=t;for(let t=0;t=r.b.MaxServers?1/0:r.b.BaseCost*Math.pow(r.b.PurchaseMult,t-1)*e}},,,,,,function(t,e,n){"use strict";function a(t){return"string"==typeof t||t instanceof String}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"f",(function(){return l})),n.d(e,"e",(function(){return c})),n.d(e,"g",(function(){return m})),n.d(e,"h",(function(){return h}));var a=n(83);let r={},i={};function o(t){r=""===t?{}:JSON.parse(t)}function s(t){i=""===t?{}:JSON.parse(t)}function l(){for(const t of Object.keys(r))r.hasOwnProperty(t)&&a.a.print("alias "+t+"="+r[t]);for(const t of Object.keys(i))i.hasOwnProperty(t)&&a.a.print("global alias "+t+"="+i[t])}function c(t,e=!1){console.log(t);const n=t.match(/^([\w|!%,@-]+)=(.+)$/);return console.log(n),null!=n&&3==n.length&&(e?function(t,e){t in r&&delete r[t];i[t]=e.trim()}(n[1],n[2]):function(t,e){t in i&&delete i[t];r[t]=e.trim()}(n[1],n[2]),!0)}function f(t){return r.hasOwnProperty(t)?r[t]:null}function u(t){return i.hasOwnProperty(t)?i[t]:null}function m(t){return r.hasOwnProperty(t)?(delete r[t],!0):!!i.hasOwnProperty(t)&&(delete i[t],!0)}function h(t){const e=t.split(" ");if(e.length>0){if("unalias"===e[0]||"alias"===e[0])return e.join(" ");let t=!0,r=0;for(;t&&r<10;){var n;r++,t=!1;const i=null===(n=f(e[0]))||void 0===n?void 0:n.split(" ");null!=i&&(t=!0,e.splice(0,1,...i));for(let n=0;n!t)}return Object(a.useEffect)(()=>x.subscribe(t=>{const n=t.server+"-"+t.filename+t.args.map(t=>""+t).join("-");T.find(t=>t.id===n)||(T.push({id:n,script:t}),e())}),[]),Object(a.useEffect)(()=>L.subscribe(t=>{!function(t){T=T.filter(e=>e.script.pid!=t),e()}(t)}),[]),Object(a.useEffect)(()=>O.subscribe(()=>{T=[],e()})),r.a.createElement(r.a.Fragment,null,T.map(t=>r.a.createElement(I,{key:t.id,script:t.script,id:t.id,onClose:()=>{return n=t.id,T=T.filter(t=>t.id!==n),void e();var n}})))}const N=Object(d.a)(()=>Object(p.a)({logs:{overflowY:"scroll",overflowX:"hidden",scrollbarWidth:"auto",flexDirection:"column-reverse",whiteSpace:"pre-wrap",wordWrap:"break-word"},titleButton:{padding:"1px 0",height:"100%"}})),P=1500;function I(t){const e=Object(a.useRef)(null),n=Object(a.useRef)(null),[i,u]=Object(a.useState)(t.script),d=N(),p=Object(a.useRef)(null),g=Object(a.useState)(!1)[1],[x,L]=Object(a.useState)([500,500]),[O,T]=Object(a.useState)(!1);function R(){g(t=>!t)}const I=({x:t,y:e})=>{const a=null==n?void 0:n.current;if(!a)return;const r=a.state;r.x=t,r.y=e};function D(){Object(o.a)({runningScript:i,hostname:i.server})}function F(){const t=Object(v.d)(i.server);if(null===t)return;const e=Object(k.a)(i.filename,i.args,t);null===e?Object(E.e)(i,t):u(e)}function j(){const t=p.current;null!==t&&(t.style.zIndex=P+C+"",C++,R())}function B(t=!1){const e=`${i.filename} ${i.args.map(t=>""+t).join(" ")}`;return t||e.length<=30?e:e.slice(0,27)+"..."}function G(){T(!O)}Object(a.useEffect)(()=>M.subscribe(e=>{e.pid===t.script.pid&&I(e.data)}),[]),Object(a.useEffect)(()=>A.subscribe(e=>{e.pid===t.script.pid&&L([e.data.w,e.data.h])}),[]),Object(a.useEffect)(()=>I({x:.4*window.innerWidth,y:.3*window.innerHeight}),[]),Object(a.useEffect)(()=>{j();const t=setInterval(R,1e3);return()=>clearInterval(t)},[]),Object(a.useEffect)(()=>(window.addEventListener("resize",W),()=>{window.removeEventListener("resize",W)}),[]);const W=Object(w.debounce)(()=>{const t=null==e?void 0:e.current;t&&(H(t)||I({x:0,y:0}))},100),H=t=>{const e=t.getBoundingClientRect();return!(e.right<0||e.bottom<0||e.left>innerWidth||e.top>outerWidth)},U=[250,33];return r.a.createElement(m.a,{handle:".drag",onDrag:t=>{if(t instanceof MouseEvent&&(t.clientX<0||t.clientY<0||t.clientX>innerWidth||t.clientY>innerHeight))return!1},ref:n,onMouseDown:j},r.a.createElement(l.a,{display:"flex",sx:{flexFlow:"column",position:"fixed",zIndex:1400,minWidth:U[0]+"px",minHeight:U[1]+"px",...O?{border:"none",margin:0,maxHeight:0,padding:0}:{border:"1px solid "+S.a.theme.welllight}},ref:p},r.a.createElement(h.ResizableBox,{width:x[0],height:x[1],onResize:(t,{size:e})=>{L([e.width,e.height])},minConstraints:U,handle:r.a.createElement("span",{style:{position:"absolute",right:"-10px",bottom:"-16px",cursor:"nw-resize",display:O?"none":"inline-block"}},r.a.createElement(y.a,{color:"primary",style:{transform:"rotate(45deg)",fontSize:"1.75rem"}}))},r.a.createElement(r.a.Fragment,null,r.a.createElement(f.a,{className:"drag",sx:{display:"flex",alignItems:"center",cursor:"grab"},ref:e},r.a.createElement(s.a,{variant:"h6",sx:{marginRight:"auto",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"},title:B(!0)},B(!0)),r.a.createElement("span",{style:{minWidth:"fit-content",height:U[1]+"px"}},b.a.has(i.pid)?r.a.createElement(c.a,{className:d.titleButton,onClick:D,onTouchEnd:D},"Kill"):r.a.createElement(c.a,{className:d.titleButton,onClick:F,onTouchEnd:F},"Run"),r.a.createElement(c.a,{className:d.titleButton,onClick:G,onTouchEnd:G},O?"🗖":"🗕"),r.a.createElement(c.a,{className:d.titleButton,onClick:t.onClose,onTouchEnd:t.onClose},"Close"))),r.a.createElement(f.a,{className:d.logs,sx:{height:`calc(100% - ${U[1]}px)`,display:O?"none":"flex"}},r.a.createElement("span",{style:{display:"flex",flexDirection:"column"}},i.logs.map((t,e)=>{return r.a.createElement(_.a,{key:e,text:t,color:(n=t,n.match(/(^\[[^\]]+\] )?ERROR/)||n.match(/(^\[[^\]]+\] )?FAIL/)?"error":n.match(/(^\[[^\]]+\] )?SUCCESS/)?"success":n.match(/(^\[[^\]]+\] )?WARN/)?"warn":n.match(/(^\[[^\]]+\] )?INFO/)?"info":"primary")});var n})))))))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t){var e,n,a;a="",(n="errorMessage")in(e=this)?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,this.pid=t.pid,this.name=t.name,this.hostname=t.hostname,this.errorMessage=t.errorMessage,Object.freeze(this)}}Object.freeze(a),Object.freeze(a.prototype)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n){this.title=t,this.fn=e,this.txt=n}}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(3),o=n(21);function s(t){const[e,n]=Object(a.useState)(!1);return r.a.createElement(o.a,{open:e,title:r.a.createElement(i.a,null,"Copied!")},r.a.createElement(i.a,{variant:t.variant,color:t.color,onClick:function(){const e=document.createElement("textarea");e.value=t.value,document.body.appendChild(e),e.select(),e.setSelectionRange(0,1e10),document.execCommand("copy"),document.body.removeChild(e),n(!0),setTimeout(()=>n(!1),1e3)}},t.value))}},,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return m})),n.d(e,"a",(function(){return h}));var a=n(0),r=n.n(a),i=n(682),o=n(976),s=n(1783),l=n(127),c=n(6);const f=new l.a;let u;function m(){var t,e;u=Object(i.a)({colors:{hp:c.a.theme.hp,money:c.a.theme.money,hack:c.a.theme.hack,combat:c.a.theme.combat,cha:c.a.theme.cha,int:c.a.theme.int,rep:c.a.theme.rep,backgroundprimary:c.a.theme.backgroundprimary,backgroundsecondary:c.a.theme.backgroundsecondary,button:c.a.theme.button,successlight:c.a.theme.successlight,success:c.a.theme.success,successdark:c.a.theme.successdark,white:c.a.theme.white,black:c.a.theme.black},palette:{primary:{light:c.a.theme.primarylight,main:c.a.theme.primary,dark:c.a.theme.primarydark},secondary:{light:c.a.theme.secondarylight,main:c.a.theme.secondary,dark:c.a.theme.secondarydark},error:{light:c.a.theme.errorlight,main:c.a.theme.error,dark:c.a.theme.errordark},info:{light:c.a.theme.infolight,main:c.a.theme.info,dark:c.a.theme.infodark},warning:{light:c.a.theme.warninglight,main:c.a.theme.warning,dark:c.a.theme.warningdark},success:{light:c.a.theme.successlight,main:c.a.theme.success,dark:c.a.theme.successdark},background:{default:c.a.theme.backgroundprimary,paper:c.a.theme.well},action:{disabled:c.a.theme.disabled}},typography:{fontFamily:c.a.styles.fontFamily,button:{textTransform:"none"}},components:{MuiInputBase:{styleOverrides:{root:{backgroundColor:c.a.theme.well,color:c.a.theme.primary},input:{"&::placeholder":{userSelect:"none",color:c.a.theme.primarydark}}}},MuiInput:{styleOverrides:{root:{backgroundColor:c.a.theme.well,borderBottomColor:"#fff"},underline:{"&:hover":{borderBottomColor:c.a.theme.primarydark},"&:before":{borderBottomColor:c.a.theme.primary},"&:after":{borderBottomColor:c.a.theme.primarylight}}}},MuiInputLabel:{styleOverrides:{root:{color:c.a.theme.primarydark,userSelect:"none","&:before":{color:c.a.theme.primarylight}}}},MuiButtonGroup:{styleOverrides:{root:{"& .MuiButton-root:not(:last-of-type)":{marginRight:"1px"}}}},MuiButton:{styleOverrides:{root:{backgroundColor:c.a.theme.button,border:"1px solid "+c.a.theme.well,"&:hover":{backgroundColor:c.a.theme.backgroundsecondary},borderRadius:0}}},MuiSelect:{styleOverrides:{icon:{color:c.a.theme.primary}},defaultProps:{variant:"standard"}},MuiTextField:{defaultProps:{variant:"standard"}},MuiTypography:{defaultProps:{color:"primary"},styleOverrides:{root:{lineHeight:c.a.styles.lineHeight}}},MuiMenu:{styleOverrides:{list:{backgroundColor:c.a.theme.well}}},MuiMenuItem:{styleOverrides:{root:{color:c.a.theme.primary}}},MuiAccordionSummary:{styleOverrides:{root:{backgroundColor:"#111"}}},MuiAccordionDetails:{styleOverrides:{root:{backgroundColor:c.a.theme.backgroundsecondary}}},MuiIconButton:{styleOverrides:{root:{color:c.a.theme.primary}}},MuiTooltip:{styleOverrides:{tooltip:{fontSize:"1em",color:c.a.theme.primary,backgroundColor:c.a.theme.well,borderRadius:0,border:"2px solid white",maxWidth:"100vh"}},defaultProps:{disableInteractive:!0}},MuiSlider:{styleOverrides:{valueLabel:{color:c.a.theme.primary,backgroundColor:c.a.theme.well}}},MuiDrawer:{styleOverrides:{paper:{"&::-webkit-scrollbar":{display:"none"},scrollbarWidth:"none",backgroundColor:c.a.theme.backgroundsecondary},paperAnchorDockedLeft:{borderRight:"1px solid "+c.a.theme.welllight}}},MuiDivider:{styleOverrides:{root:{backgroundColor:c.a.theme.welllight}}},MuiFormControlLabel:{styleOverrides:{root:{color:c.a.theme.primary}}},MuiSwitch:{styleOverrides:{switchBase:{color:c.a.theme.primarydark},track:{backgroundColor:c.a.theme.welllight}}},MuiPaper:{styleOverrides:{root:{borderRadius:0,backgroundColor:c.a.theme.backgroundsecondary,border:"1px solid "+c.a.theme.welllight}}},MuiTablePagination:{styleOverrides:{select:{color:c.a.theme.primary},selectLabel:{color:c.a.theme.primary},displayedRows:{color:c.a.theme.primary}}},MuiTab:{styleOverrides:{textColorPrimary:{color:c.a.theme.secondary,"&.Mui-selected":{color:c.a.theme.primary}},root:{backgroundColor:c.a.theme.backgroundsecondary,border:"1px solid "+c.a.theme.well,margin:"3px","&.Mui-selected":{backgroundColor:c.a.theme.button}}}},MuiTabs:{styleOverrides:{scrollButtons:{backgroundColor:c.a.theme.backgroundsecondary,color:c.a.theme.secondary,margin:"3px",opacity:1,width:"fit-content","&.Mui-disabled":{opacity:.5}}},defaultProps:{TabIndicatorProps:{style:{display:"none"}}}},MuiAlert:{styleOverrides:{root:{backgroundColor:c.a.theme.black,borderRadius:0,border:"1px solid "+c.a.theme.well},standardSuccess:{color:c.a.theme.successlight},standardError:{color:c.a.theme.errorlight},standardWarning:{color:c.a.theme.warninglight},standardInfo:{color:c.a.theme.infolight}}}}}),document.body.style.backgroundColor=null!==(t=null===(e=u.colors.backgroundprimary)||void 0===e?void 0:e.toString())&&void 0!==t?t:"black"}m();const h=({children:t})=>r.a.createElement(o.a,{injectFirst:!0},r.a.createElement(s.a,{theme:u},t))},,function(t,e,n){"use strict";let a,r;n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),function(t){t[t.Cost=0]="Cost",t[t.Default=1]="Default",t[t.Reputation=2]="Reputation",t[t.Purchasable=3]="Purchasable"}(a||(a={})),function(t){t[t.Alphabetically=0]="Alphabetically",t[t.AcquirementTime=1]="AcquirementTime"}(r||(r={}))},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={Water:.05,Energy:.01,Food:.03,Plants:.05,Metal:.1,Hardware:.06,Chemicals:.05,Drugs:.02,Robots:.5,AICores:.1,RealEstate:.005,"Real Estate":.005,"AI Cores":.1}},function(t,e,n){"use strict";function a(t,e=1){return Math.max(Math.floor(e*(32*Math.log(t+534.5)-200)),1)}function r(t,e=1){return Math.exp((t/e+200)/32)-534.6}function i(t,e=1){const n=a(t,e),i=n+1;let o=r(n,e);o<0&&(o=0);let s=r(i,e);s<0&&(s=0);let l=s-o!=0?100*(t-o)/(s-o):99.99;l<0&&(l=0),l>100&&(l=100);let c=t-o,f=s-t;return c<0&&(c=0),f<0&&(f=0),{currentSkill:n,nextSkill:i,baseExperience:o,experience:t,nextExperience:s,currentExperience:c,remainingExperience:f,progress:l}}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i}))},,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r})),function(t){t.Weapon="w",t.Armor="a",t.Vehicle="v",t.Rootkit="r",t.Augmentation="g"}(a||(a={}));const r=[{cost:1e6,mults:{str:1.04,def:1.04},name:"Baseball Bat",upgType:a.Weapon},{cost:12e6,mults:{str:1.08,def:1.08,dex:1.08},name:"Katana",upgType:a.Weapon},{cost:25e6,mults:{str:1.1,def:1.1,dex:1.1,agi:1.1},name:"Glock 18C",upgType:a.Weapon},{cost:5e7,mults:{str:1.12,def:1.1,agi:1.1},name:"P90C",upgType:a.Weapon},{cost:6e7,mults:{str:1.2,def:1.15},name:"Steyr AUG",upgType:a.Weapon},{cost:1e8,mults:{str:1.25,def:1.2},name:"AK-47",upgType:a.Weapon},{cost:15e7,mults:{str:1.3,def:1.25},name:"M15A10 Assault Rifle",upgType:a.Weapon},{cost:225e6,mults:{str:1.3,dex:1.25,agi:1.3},name:"AWM Sniper Rifle",upgType:a.Weapon},{cost:2e6,mults:{def:1.04},name:"Bulletproof Vest",upgType:a.Armor},{cost:5e6,mults:{def:1.08},name:"Full Body Armor",upgType:a.Armor},{cost:25e6,mults:{def:1.15,agi:1.15},name:"Liquid Body Armor",upgType:a.Armor},{cost:4e7,mults:{def:1.2},name:"Graphene Plating Armor",upgType:a.Armor},{cost:3e6,mults:{agi:1.04,cha:1.04},name:"Ford Flex V20",upgType:a.Vehicle},{cost:9e6,mults:{agi:1.08,cha:1.08},name:"ATX1070 Superbike",upgType:a.Vehicle},{cost:18e6,mults:{agi:1.12,cha:1.12},name:"Mercedes-Benz S9001",upgType:a.Vehicle},{cost:3e7,mults:{agi:1.16,cha:1.16},name:"White Ferrari",upgType:a.Vehicle},{cost:5e6,mults:{hack:1.05},name:"NUKE Rootkit",upgType:a.Rootkit},{cost:25e6,mults:{hack:1.1},name:"Soulstealer Rootkit",upgType:a.Rootkit},{cost:75e6,mults:{hack:1.15},name:"Demon Rootkit",upgType:a.Rootkit},{cost:4e7,mults:{hack:1.12},name:"Hmap Node",upgType:a.Rootkit},{cost:75e6,mults:{hack:1.15},name:"Jack the Ripper",upgType:a.Rootkit},{cost:1e10,mults:{str:1.3,dex:1.3},name:"Bionic Arms",upgType:a.Augmentation},{cost:1e10,mults:{agi:1.6},name:"Bionic Legs",upgType:a.Augmentation},{cost:15e9,mults:{str:1.15,def:1.15,dex:1.15,agi:1.15},name:"Bionic Spine",upgType:a.Augmentation},{cost:2e10,mults:{str:1.4,def:1.4},name:"BrachiBlades",upgType:a.Augmentation},{cost:12e9,mults:{str:1.2,def:1.2},name:"Nanofiber Weave",upgType:a.Augmentation},{cost:25e9,mults:{str:1.5,agi:1.5},name:"Synthetic Heart",upgType:a.Augmentation},{cost:15e9,mults:{str:1.3,def:1.3},name:"Synfibril Muscle",upgType:a.Augmentation},{cost:5e9,mults:{hack:1.05},name:"BitWire",upgType:a.Augmentation},{cost:1e10,mults:{hack:1.15},name:"Neuralstimulator",upgType:a.Augmentation},{cost:75e8,mults:{hack:1.1},name:"DataJack",upgType:a.Augmentation},{cost:5e10,mults:{str:1.7,def:1.7},name:"Graphene Bone Lacings",upgType:a.Augmentation}]},,function(t,e,n){"use strict";n.d(e,"a",(function(){return A})),n.d(e,"c",(function(){return T})),n.d(e,"e",(function(){return N})),n.d(e,"f",(function(){return I})),n.d(e,"b",(function(){return D})),n.d(e,"d",(function(){return F}));var a=n(147),r=n(168),i=n(443),o=n(204),s=n(307),l=n(549),c=n(13),f=n(616),u=n(617),m=n(673),h=n(1448),d=n(498),p=n(680),g=n(269),y=n(24),b=n(6),E=n(714),v=n(16),k=n(275),w=n(548),S=n(163),_=n(259),C=n(314),x=n(77),L=n(1),O=n(83),M=n(2);const A=[];for(let t=0;t{i=!0;let e=t.source.value;e.startsWith("./")&&(e=e.slice(2));const n=function(t){for(let e=0;e{n.push(t.id.name),a.push(t)}}),r+=`var ${e};\n(function (namespace) {\n`,a.forEach(t=>{r+=Object(E.generate)(t),r+="\n"}),n.forEach(t=>{r+="namespace."+t+" = "+t,r+="\n"}),r+=`})(${e} || (" + namespace + " = {}));\n`}else{const e=[];t.specifiers.forEach(t=>{e.push(t.local.name)});const n=[];Object(C.b)(o,{FunctionDeclaration:t=>{e.includes(t.id.name)&&n.push(t)}}),n.forEach(t=>{r+=Object(E.generate)(t),r+="\n"})}}}),!i)return{code:t,lineOffset:0};let o=0;if("Program"!==n.type||null==n.body)throw new Error("Code could not be properly parsed");for(let t=n.body.length-1;t>=0;--t)"ImportDeclaration"===n.body[t].type&&(n.body.splice(t,1),++o);const s=(r.match(/\n/g)||[]).length-o;t=Object(E.generate)(n);return{code:t=r+t,lineOffset:s}}(e,t);n=a.code,i=a.lineOffset}catch(e){return Object(v.a)("Error processing Imports in "+t.name+":
"+String(e)),t.env.stopFlag=!0,Object(a.a)(t),Promise.resolve()}try{o=new f.a(n,(function e(n,r,i=[]){const o=i.reduce((t,e)=>t[e],t.env.vars);for(const[s,l]of Object.entries(o))if("function"==typeof l){const e=async(...e)=>{try{const t=e.pop(),a=await l(...e.map(n.pseudoToNative));return t(n.nativeToPseudo(a))}catch(e){if("string"==typeof e){console.error(e);const n=e.split("|DELIMITER|"),r=n[1],i=n[2],o=n[3];let s=`${i}@${r}
`;return s+="
",s+=o,Object(v.a)(s),t.env.stopFlag=!0,void Object(a.a)(t)}}};n.setProperty(r,s,n.createAsyncFunction(e))}else Array.isArray(l)||"object"!=typeof l?n.setProperty(r,s,n.nativeToPseudo(l)):(n.setProperty(r,s,n.nativeToPseudo({})),e(n,r.properties[s],[...i,s]))}),i)}catch(e){return Object(v.a)("Syntax ERROR in "+t.name+":
"+String(e)),t.env.stopFlag=!0,Object(a.a)(t),Promise.resolve()}return new Promise((function(e,n){try{!function a(){try{if(t.env.stopFlag)return n(new r.a(t));let i=!0,s=0;for(;s<3&&i;)i=i&&o.step(),s++;i?setTimeout(a,b.a.CodeInstructionRunTime):e()}catch(e){let a=String(e);return M.a.isScriptErrorMessage(a)||(a=M.a.makeRuntimeRejectMsg(t,a)),t.errorMessage=a,n(new r.a(t))}}()}catch(e){return Object(S.a)(e)?(t.errorMessage=e,n(new r.a(t))):e instanceof r.a?n(e):(console.error(e),n(new r.a(t)))}}))}function N(t,e,n){return P(t,e,n)?(e.runScript(t),t.pid):0}function P(t,e,n){let c=1;t.threads&&!isNaN(t.threads)?c=t.threads:t.threads=1;const f=Object(p.a)(t),h=Object(w.a)(f*c);if(h>e.maxRam-e.ramUsed+.001)return Object(v.a)(`Not enough RAM to run script ${t.filename} with args `+Object(k.a)(t.args)+". This likely occurred because you re-loaded the game and the script's RAM usage increased (either because of an update to the game or your changes to the script.)"),!1;e.updateRamUsed(Object(w.a)(e.ramUsed+h),L.a);const d=Object(l.a)();if(-1===d)throw new Error("Failed to start script because could not find available PID. This is most because you have too many scripts running.");const g=new i.a(t,d,u.a);g.ramUsage=f,o.a.set(d,g),s.a.emit();let y=null;if(g.name.endsWith(".js"))y=function(t){return new Promise((e,n)=>{Object(m.b)(L.a,t.getServer().scripts,t).then(()=>{e()}).catch(t=>n(t))}).catch(e=>{if(e instanceof Error)throw e instanceof SyntaxError?t.errorMessage=M.a.makeRuntimeRejectMsg(t,e.message+" (sorry we can't be more helpful)"):t.errorMessage=M.a.makeRuntimeRejectMsg(t,e.message+(e.stack&&"\nstack:\n"+e.stack.toString()||"")),new r.a(t);if(M.a.isScriptErrorMessage(e))throw t.errorMessage=e,new r.a(t);if(e instanceof r.a)throw e;throw t.errorMessage=M.a.makeRuntimeRejectMsg(t,""+e),new r.a(t)})}(g);else if(y=R(g),!(y instanceof Promise))return!1;return y.then((function(){g.env.stopFlag=!0,void 0===n||n.env.stopFlag||(n.scriptRef.onlineExpGained+=t.onlineExpGained,n.scriptRef.onlineMoneyMade+=t.onlineMoneyMade),Object(a.a)(g),g.log("",()=>"Script finished running")})).catch((function(t){if(t instanceof Error)return Object(v.a)("Script runtime unknown error. This is a bug please contact game developer"),void console.error("Evaluating workerscript returns an Error. THIS SHOULDN'T HAPPEN: "+t.toString());if(t instanceof r.a){if(!M.a.isScriptErrorMessage(g.errorMessage))return void g.log("",()=>"Script killed");{const t=g.errorMessage.split("|DELIMITER|");if(4!=t.length)return console.error("ERROR: Something wrong with Error text in evaluator..."),void console.error("Error text: "+g.errorMessage);const e=t[1],n=t[2],a=t[3];let r=`RUNTIME ERROR
${n}@${e} (PID - ${g.pid})
`;g.args.length>0&&(r+=`Args: ${Object(k.a)(g.args)}
`),r+="
",r+=a,Object(v.a)(r),g.log("",()=>"Script crashed with runtime error")}}else{if(M.a.isScriptErrorMessage(t))return Object(v.a)("Script runtime unknown error. This is a bug please contact game developer"),void console.error("ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: "+t.toString());Object(v.a)("An unknown script died for an unknown reason. This is a bug please contact game dev"),console.error(t)}Object(a.a)(g)})),!0}function I(t=1){const e=t*c.a._idleSpeed/1e3;for(const t of o.a.values())t.scriptRef.onlineRunningTime+=e}function D(){const t=-1!==window.location.href.toLowerCase().indexOf("?noscripts");t&&(O.a.warn("Skipped loading player scripts during startup"),console.info("Skipping the load of any scripts during startup"));for(const e of Object(y.c)()){e.ramUsed=0;for(let t=0;t`Invalid arguments: scriptname='${n} args='${a}'`),console.error("runScriptFromScript() failed due to invalid arguments"),0;a.forEach((t,e)=>{if("string"!=typeof t&&"number"!=typeof t&&"boolean"!=typeof t)throw new Error(`Only strings, numbers, and booleans can be passed as arguments to other scripts.\n${n} argument index ${e} is of type ${typeof t} and value ${JSON.stringify(t)}`)});if(null!=e.getRunningScript(n,a))return r.log(t,()=>`'${n}' is already running on '${e.hostname}'`),0;for(let e=0;e"Cannot execute a script with null/undefined as an argument"),0;for(let i=0;i`You do not have root access on '${e.hostname}'`),0;if(l>c+.001)return r.log(t,()=>`Cannot run script '${n}' (t=${o}) on '${e.hostname}' because there is not enough available RAM!`),0;r.log(t,()=>`'${n}' on '${e.hostname}' with ${o} threads and args: ${Object(k.a)(a)}.`);const f=new d.a(s,a);return f.threads=o,f.server=e.hostname,N(f,e,r)}return r.log(t,()=>`Could not find script '${n}' on '${e.hostname}'`),0}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(5);const r={GangRespectToReputationRatio:75,MaximumGangMembers:12,CyclesPerTerritoryAndPowerUpdate:100,AscensionMultiplierRatio:.15,Names:[a.a.SlumSnakes,a.a.Tetrads,a.a.TheSyndicate,a.a.TheDarkArmy,a.a.SpeakersForTheDead,a.a.NiteSec,a.a.TheBlackHand],GangKarmaRequirement:-54e3}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"d",(function(){return d})),n.d(e,"b",(function(){return p}));var a=n(235),r=n(75),i=n(13),o=n(1),s=n(7),l=n(23),c=n(16),f=n(0),u=n(2);function m(t,e,n=null,m={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==m.suppressDialog&&Object(c.a)("Failed to buy stock. This may be a bug, contact developer"),!1;const h=Object(a.b)(t,e,r.a.Long);if(null==h)return!1;if(o.a.money`You do not have enough money to purchase this position. You need ${s.a.formatMoney(h)}.`):!0!==m.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"You do not have enough money to purchase this. You need ",f.createElement(l.a,{money:h}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?u.a.log(n,()=>`Purchasing '${e+t.playerShares+t.playerShortShares}' shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares`):!0!==m.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${s.a.formatShares(t.maxShares)} shares.`),!1;const d=t.playerShares*t.playerAvgPx;o.a.loseMoney(h,"stock");const p=d+h-i.a.StockMarketCommission;if(t.playerShares=Math.round(t.playerShares+e),t.playerAvgPx=p/t.playerShares,Object(a.d)(t,e),null!=m.rerenderFn&&"function"==typeof m.rerenderFn&&m.rerenderFn(),n){const a=`Bought ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(h)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;u.a.log(n,()=>a)}else!0!==m.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"Bought ",s.a.formatShares(e)," shares of ",t.symbol," for ",f.createElement(l.a,{money:h}),". Paid"," ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function h(t,e,n=null,i={}){if(null==t||e<0||isNaN(e))return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==i.suppressDialog&&Object(c.a)("Failed to sell stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, contact developer"),!1;if((e=Math.round(e))>t.playerShares&&(e=t.playerShares),0===e)return!1;const m=Object(a.c)(t,e,r.a.Long);if(null==m)return!1;let h=m-t.playerAvgPx*e;if(isNaN(h)&&(h=0),o.a.gainMoney(m,"stock"),n&&(n.workerScript.scriptRef.onlineMoneyMade+=h,o.a.scriptProdSinceLastAug+=h),t.playerShares=Math.round(t.playerShares-e),0===t.playerShares&&(t.playerAvgPx=0),Object(a.d)(t,e),null!=i.rerenderFn&&"function"==typeof i.rerenderFn&&i.rerenderFn(),n){const a=`Sold ${s.a.formatShares(e)} shares of ${t.symbol}. After commissions, you gained a total of ${s.a.formatMoney(m)}.`;u.a.log(n,()=>a)}else!0!==i.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"Sold ",s.a.formatShares(e)," shares of ",t.symbol,". After commissions, you gained a total of"," ",f.createElement(l.a,{money:m}),"."));return!0}function d(t,e,n=null,m={}){if((e=Math.round(e))<=0)return!1;if(null==t||isNaN(e))return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):!0!==m.suppressDialog&&Object(c.a)("Failed to initiate a short position in a stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, so contact developer"),!1;const h=Object(a.b)(t,e,r.a.Short);if(null==h)return!1;if(o.a.money"You do not have enough money to purchase this short position. You need "+s.a.formatMoney(h)):!0!==m.suppressDialog&&Object(c.a)(f.createElement(f.Fragment,null,"You do not have enough money to purchase this short position. You need ",f.createElement(l.a,{money:h}))),!1;if(e+t.playerShares+t.playerShortShares>t.maxShares)return n?u.a.log(n,()=>`This '${e+t.playerShares+t.playerShortShares}' short shares would exceed ${t.symbol}'s maximum (${t.maxShares}) number of shares.`):!0!==m.suppressDialog&&Object(c.a)(`You cannot purchase this many shares. ${t.symbol} has a maximum of ${t.maxShares} shares.`),!1;const d=t.playerShortShares*t.playerAvgShortPx;o.a.loseMoney(h,"stock");const p=d+h-i.a.StockMarketCommission;if(t.playerShortShares=Math.round(t.playerShortShares+e),t.playerAvgShortPx=p/t.playerShortShares,Object(a.d)(t,e),null!=m.rerenderFn&&"function"==typeof m.rerenderFn&&m.rerenderFn(),n){const a=`Bought a short position of ${s.a.formatShares(e)} shares of ${t.symbol} for ${s.a.formatMoney(h)}. Paid ${s.a.formatMoney(i.a.StockMarketCommission)} in commission fees.`;u.a.log(n,()=>a)}else m.suppressDialog||Object(c.a)(f.createElement(f.Fragment,null,"Bought a short position of ",s.a.formatShares(e)," shares of ",t.symbol," for"," ",f.createElement(l.a,{money:h}),". Paid ",f.createElement(l.a,{money:i.a.StockMarketCommission})," in commission fees."));return!0}function p(t,e,n=null,i={}){if(null==t||isNaN(e)||e<0)return n?u.a.log(n,()=>`Invalid arguments: stock='${t}' shares='${e}'`):i.suppressDialog||Object(c.a)("Failed to sell a short position in a stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, so contact developer"),!1;if((e=Math.round(e))>t.playerShortShares&&(e=t.playerShortShares),0===e)return!1;const m=e*t.playerAvgShortPx,h=Object(a.c)(t,e,r.a.Short);if(null==h||isNaN(h)||null==m)return n?u.a.log(n,()=>"Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug"):i.suppressDialog||Object(c.a)("Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug"),!1;let d=h-m;if(isNaN(d)&&(d=0),o.a.gainMoney(h,"stock"),n&&(n.workerScript.scriptRef.onlineMoneyMade+=d,o.a.scriptProdSinceLastAug+=d),t.playerShortShares=Math.round(t.playerShortShares-e),0===t.playerShortShares&&(t.playerAvgShortPx=0),Object(a.d)(t,e),null!=i.rerenderFn&&"function"==typeof i.rerenderFn&&i.rerenderFn(),n){const a=`Sold your short position of ${s.a.formatShares(e)} shares of ${t.symbol}. After commissions, you gained a total of `+s.a.formatMoney(h);u.a.log(n,()=>a)}else i.suppressDialog||Object(c.a)(f.createElement(f.Fragment,null,"Sold your short position of ",s.a.formatShares(e)," shares of ",t.symbol,". After commissions, you gained a total of ",f.createElement(l.a,{money:h})));return!0}},,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(393),r=n(360),i=n(15);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class s{constructor(t=""){o(this,"alreadyInvited",!1),o(this,"augmentations",[]),o(this,"favor",0),o(this,"isBanned",!1),o(this,"isMember",!1),o(this,"name",""),o(this,"playerReputation",0),this.name=t}getInfo(){const t=a.a[this.name];if(null==t)throw new Error(`Missing faction from FactionInfos: ${this.name} this probably means the faction got corrupted somehow`);return t}gainFavor(){null==this.favor&&(this.favor=0),this.favor+=this.getFavorGain()}getFavorGain(){null==this.favor&&(this.favor=0);const t=Math.max(0,Object(r.a)(this.favor))+this.playerReputation;return Object(r.b)(t)-this.favor}toJSON(){return Object(i.b)("Faction",this)}static fromJSON(t){return Object(i.a)(s,t.data)}}i.c.constructors.Faction=s},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new Map},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(15);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t={}){r(this,"name","InitName"),r(this,"qty",0),r(this,"qlt",0),r(this,"dmd",0),r(this,"dmdR",[0,0]),r(this,"cmp",0),r(this,"cmpR",[0,0]),r(this,"mv",0),r(this,"mku",0),r(this,"buy",0),r(this,"sll",0),r(this,"prd",0),r(this,"imp",0),r(this,"exp",[]),r(this,"totalExp",0),r(this,"bCost",0),r(this,"sCost",0),r(this,"prdman",[!1,0]),r(this,"sllman",[!1,0]),r(this,"marketTa1",!1),r(this,"marketTa2",!1),r(this,"marketTa2Price",0),r(this,"maxsll",0),t.name&&(this.name=t.name),this.init()}getMarkupLimit(){return this.qlt/this.mku}init(){switch(this.name){case"Water":this.dmd=75,this.dmdR=[65,85],this.cmp=50,this.cmpR=[40,60],this.bCost=1500,this.mv=.2,this.mku=6;break;case"Energy":this.dmd=90,this.dmdR=[80,99],this.cmp=80,this.cmpR=[65,95],this.bCost=2e3,this.mv=.2,this.mku=6;break;case"Food":this.dmd=80,this.dmdR=[70,90],this.cmp=60,this.cmpR=[35,85],this.bCost=5e3,this.mv=1,this.mku=3;break;case"Plants":this.dmd=70,this.dmdR=[20,90],this.cmp=50,this.cmpR=[30,70],this.bCost=3e3,this.mv=.6,this.mku=3.75;break;case"Metal":this.dmd=80,this.dmdR=[75,85],this.cmp=70,this.cmpR=[60,80],this.bCost=2650,this.mv=1,this.mku=6;break;case"Hardware":this.dmd=85,this.dmdR=[80,90],this.cmp=80,this.cmpR=[65,95],this.bCost=8e3,this.mv=.5,this.mku=1;break;case"Chemicals":this.dmd=55,this.dmdR=[40,70],this.cmp=60,this.cmpR=[40,80],this.bCost=9e3,this.mv=1.2,this.mku=2;break;case"Real Estate":this.dmd=50,this.dmdR=[5,99],this.cmp=50,this.cmpR=[25,75],this.bCost=8e4,this.mv=1.5,this.mku=1.5;break;case"Drugs":this.dmd=60,this.dmdR=[45,75],this.cmp=70,this.cmpR=[40,99],this.bCost=4e4,this.mv=1.6,this.mku=1;break;case"Robots":this.dmd=90,this.dmdR=[80,99],this.cmp=90,this.cmpR=[80,99],this.bCost=75e3,this.mv=.5,this.mku=1;break;case"AI Cores":this.dmd=90,this.dmdR=[80,99],this.cmp=90,this.cmpR=[80,99],this.bCost=15e3,this.mv=.8,this.mku=.5;break;case"Scientific Research":case"InitName":break;default:console.error("Invalid material type in init(): "+this.name)}}processMarket(){const t=1+Math.random()*this.mv/300,e=1+Math.random()*this.mv/100;Math.random()<.5?(this.cmp*=e,this.cmp>this.cmpR[1]&&(this.cmp=this.cmpR[1]),this.bCost*=1/t):(this.cmp*=1/e,this.cmpthis.dmdR[1]&&(this.dmd=this.dmdR[1]),this.bCost*=t):(this.dmd*=1/n,this.dmd{const e=setInterval(()=>{c(e=>(e<=0&&t.onExpire(),e-200/f*100))},200);return()=>{clearInterval(e)}},[]),t.noPaper?i.a.createElement(l.a,{variant:"determinate",value:n,color:"primary"}):i.a.createElement(a.a,{sx:{p:1,mb:1}},i.a.createElement(l.a,{variant:"determinate",value:n,color:"primary"}))}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r}));const a=()=>({hacking_chance:1,hacking_speed:1,hacking_money:1,hacking_grow:1,hacking:1,hacking_exp:1,strength:1,strength_exp:1,defense:1,defense_exp:1,dexterity:1,dexterity_exp:1,agility:1,agility_exp:1,charisma:1,charisma_exp:1,hacknet_node_money:1,hacknet_node_purchase_cost:1,hacknet_node_ram_cost:1,hacknet_node_core_cost:1,hacknet_node_level_cost:1,company_rep:1,faction_rep:1,work_money:1,crime_success:1,crime_money:1,bladeburner_max_stamina:1,bladeburner_stamina_gain:1,bladeburner_analysis:1,bladeburner_success_chance:1}),r=(t,e)=>{var n,a,r,i,o,s,l,c,f,u,m,h,d,p,g,y,b,E,v,k,w,S,_,C,x,L,O,M,A,T;return{hacking_chance:t.hacking_chance*(null!==(n=e.hacking_chance)&&void 0!==n?n:1),hacking_speed:t.hacking_speed*(null!==(a=e.hacking_speed)&&void 0!==a?a:1),hacking_money:t.hacking_money*(null!==(r=e.hacking_money)&&void 0!==r?r:1),hacking_grow:t.hacking_grow*(null!==(i=e.hacking_grow)&&void 0!==i?i:1),hacking:t.hacking*(null!==(o=e.hacking)&&void 0!==o?o:1),hacking_exp:t.hacking_exp*(null!==(s=e.hacking_exp)&&void 0!==s?s:1),strength:t.strength*(null!==(l=e.strength)&&void 0!==l?l:1),strength_exp:t.strength_exp*(null!==(c=e.strength_exp)&&void 0!==c?c:1),defense:t.defense*(null!==(f=e.defense)&&void 0!==f?f:1),defense_exp:t.defense_exp*(null!==(u=e.defense_exp)&&void 0!==u?u:1),dexterity:t.dexterity*(null!==(m=e.dexterity)&&void 0!==m?m:1),dexterity_exp:t.dexterity_exp*(null!==(h=e.dexterity_exp)&&void 0!==h?h:1),agility:t.agility*(null!==(d=e.agility)&&void 0!==d?d:1),agility_exp:t.agility_exp*(null!==(p=e.agility_exp)&&void 0!==p?p:1),charisma:t.charisma*(null!==(g=e.charisma)&&void 0!==g?g:1),charisma_exp:t.charisma_exp*(null!==(y=e.charisma_exp)&&void 0!==y?y:1),hacknet_node_money:t.hacknet_node_money*(null!==(b=e.hacknet_node_money)&&void 0!==b?b:1),hacknet_node_purchase_cost:t.hacknet_node_purchase_cost*(null!==(E=e.hacknet_node_purchase_cost)&&void 0!==E?E:1),hacknet_node_ram_cost:t.hacknet_node_ram_cost*(null!==(v=e.hacknet_node_ram_cost)&&void 0!==v?v:1),hacknet_node_core_cost:t.hacknet_node_core_cost*(null!==(k=e.hacknet_node_core_cost)&&void 0!==k?k:1),hacknet_node_level_cost:t.hacknet_node_level_cost*(null!==(w=e.hacknet_node_level_cost)&&void 0!==w?w:1),company_rep:t.company_rep*(null!==(S=e.company_rep)&&void 0!==S?S:1),faction_rep:t.faction_rep*(null!==(_=e.faction_rep)&&void 0!==_?_:1),work_money:t.work_money*(null!==(C=e.work_money)&&void 0!==C?C:1),crime_success:t.crime_success*(null!==(x=e.crime_success)&&void 0!==x?x:1),crime_money:t.crime_money*(null!==(L=e.crime_money)&&void 0!==L?L:1),bladeburner_max_stamina:t.bladeburner_max_stamina*(null!==(O=e.bladeburner_max_stamina)&&void 0!==O?O:1),bladeburner_stamina_gain:t.bladeburner_stamina_gain*(null!==(M=e.bladeburner_stamina_gain)&&void 0!==M?M:1),bladeburner_analysis:t.bladeburner_analysis*(null!==(A=e.bladeburner_analysis)&&void 0!==A?A:1),bladeburner_success_chance:t.bladeburner_success_chance*(null!==(T=e.bladeburner_success_chance)&&void 0!==T?T:1)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return F}));var a=n(15),r=n(264),i=n(43),o=n(566),s=n(281),l=n(136),c=n(366),f=n(688),u=n(262),m=n(28),h=n(234),d=n(250),p=n(454),g=n(1052),y=n(689),b=n(277),E=n(34),v=n(62),k=n(7),w=n(22),S=n(315),_=n(201),C=n(29),x=n(427),L=n(16),O=n(6),M=n(12),A=n(1053),T=n(105),R=n(5),N=n(30),P=n(383),I=n(351);function D(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class F{constructor(t){D(this,"numHosp",0),D(this,"moneyLost",0),D(this,"rank",0),D(this,"maxRank",0),D(this,"skillPoints",0),D(this,"totalSkillPoints",0),D(this,"teamSize",0),D(this,"sleeveSize",0),D(this,"teamLost",0),D(this,"hpLost",0),D(this,"storedCycles",0),D(this,"randomEventCounter",Object(E.a)(240,600)),D(this,"actionTimeToComplete",0),D(this,"actionTimeCurrent",0),D(this,"actionTimeOverflow",0),D(this,"action",new r.a({type:i.a.Idle})),D(this,"cities",{}),D(this,"city",v.a.CityNames[2]),D(this,"skills",{}),D(this,"skillMultipliers",{}),D(this,"staminaBonus",0),D(this,"maxStamina",0),D(this,"stamina",0),D(this,"contracts",{}),D(this,"operations",{}),D(this,"blackops",{}),D(this,"logging",{general:!0,contracts:!0,ops:!0,blackops:!0,events:!0}),D(this,"automateEnabled",!1),D(this,"automateActionHigh",new r.a({type:i.a.Idle})),D(this,"automateThreshHigh",0),D(this,"automateActionLow",new r.a({type:i.a.Idle})),D(this,"automateThreshLow",0),D(this,"consoleHistory",[]),D(this,"consoleLogs",["Bladeburner Console","Type 'help' to see console commands"]);for(let t=0;tthis.rank)return{error:"Tried to start a Black Operation without the rank requirement"};const n=[];for(const t of Object.keys(s.a))s.a.hasOwnProperty(t)&&n.push(t);n.sort((function(t,e){return s.a[t].reqdRank-s.a[e].reqdRank}));const a=n.indexOf(t.name);return-1===a?{error:`Invalid Black Op: '${name}'`}:a>0&&null==this.blackops[n[a-1]]?{error:`Preceding Black Op must be completed before starting '${t.name}'.`}:{isAvailable:!0,action:e}}startAction(t,e){if(null!=e)switch(this.action=e,this.actionTimeCurrent=0,e.type){case i.a.Idle:this.actionTimeToComplete=0;break;case i.a.Contract:try{const n=this.getActionObject(e);if(null==n)throw new Error("Failed to get Contract Object for: "+e.name);if(n.count<1)return this.resetAction();this.actionTimeToComplete=n.getActionTime(this,t)}catch(t){Object(b.a)(t)}break;case i.a.Operation:try{const n=this.getActionObject(e);if(null==n)throw new Error("Failed to get Operation Object for: "+e.name);if(n.count<1)return this.resetAction();if("Raid"===e.name&&0===this.getCurrentCity().comms)return this.resetAction();this.actionTimeToComplete=n.getActionTime(this,t)}catch(t){Object(b.a)(t)}break;case i.a.BlackOp:case i.a.BlackOperation:try{const n=this.canAttemptBlackOp(e);if(!n.isAvailable){this.resetAction(),this.log("Error: "+n.error);break}if(void 0===n.action)throw new Error("action should not be null");this.actionTimeToComplete=n.action.getActionTime(this,t)}catch(t){Object(b.a)(t)}break;case i.a.Recruitment:this.actionTimeToComplete=this.getRecruitmentTime(t);break;case i.a.Training:case i.a.FieldAnalysis:case i.a["Field Analysis"]:this.actionTimeToComplete=30;break;case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:this.actionTimeToComplete=60;break;default:throw new Error("Invalid Action Type in startAction(Bladeburner,player, ): "+e.type)}}upgradeSkill(t,e=1){const n=t.name;if(this.skills[n]?this.skills[n]+=e:this.skills[n]=e,isNaN(this.skills[n])||this.skills[n]<0)throw new Error("Level of Skill "+n+" is invalid: "+this.skills[n]);this.updateSkillMultipliers()}executeConsoleCommands(t,e){try{this.consoleHistory[this.consoleHistory.length-1]!=e&&(this.consoleHistory.push(e),this.consoleHistory.length>50&&this.consoleHistory.splice(0,1));const n=e.split(";");for(let e=0;e100&&this.consoleLogs.shift())}log(t){this.postToConsole(`[${Object(A.a)()}] ${t}`)}resetAction(){this.action=new r.a({type:i.a.Idle}),this.actionTimeCurrent=0,this.actionTimeToComplete=0}clearConsole(){this.consoleLogs.length=0}prestige(){this.resetAction();const t=C.a[R.a.Bladeburners];this.rank>=v.a.RankNeededForFaction&&Object(T.d)(t)}storeCycles(t=0){this.storedCycles+=t}getActionIdFromTypeAndName(t="",e=""){if(""===t||""===e)return null;const n=new r.a,a=t.toLowerCase().trim(),o=e.toLowerCase().trim();switch(a){case"contract":case"contracts":case"contr":return n.type=i.a.Contract,this.contracts.hasOwnProperty(e)?(n.name=e,n):null;case"operation":case"operations":case"op":case"ops":return n.type=i.a.Operation,this.operations.hasOwnProperty(e)?(n.name=e,n):null;case"blackoperation":case"black operation":case"black operations":case"black op":case"black ops":case"blackop":case"blackops":return n.type=i.a.BlackOp,s.a.hasOwnProperty(e)?(n.name=e,n):null;case"general":case"general action":case"gen":break;default:return null}if(a.startsWith("gen")){switch(o){case"training":n.type=i.a.Training,n.name="Training";break;case"recruitment":case"recruit":n.type=i.a.Recruitment,n.name="Recruitment";break;case"field analysis":case"fieldanalysis":n.type=i.a["Field Analysis"],n.name="Field Analysis";break;case"diplomacy":n.type=i.a.Diplomacy,n.name="Diplomacy";break;case"hyperbolic regeneration chamber":n.type=i.a["Hyperbolic Regeneration Chamber"],n.name="Hyperbolic Regeneration Chamber";break;case"incite violence":n.type=i.a["Incite Violence"],n.name="Incite Violence";break;default:return null}return n}return null}executeStartConsoleCommand(t,e){if(3!==e.length)return this.postToConsole("Invalid usage of 'start' console command: start [type] [name]"),void this.postToConsole("Use 'help start' for more info");const n=e[2];switch(e[1].toLowerCase()){case"general":case"gen":null!=u.a[n]?(this.action.type=i.a[n],this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid action name specified: "+e[2]);break;case"contract":case"contracts":null!=this.contracts[n]?(this.action.type=i.a.Contract,this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid contract name specified: "+e[2]);break;case"ops":case"op":case"operations":case"operation":null!=this.operations[n]?(this.action.type=i.a.Operation,this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid Operation name specified: "+e[2]);break;case"blackops":case"blackop":case"black operations":case"black operation":null!=s.a[n]?(this.action.type=i.a.BlackOperation,this.action.name=n,this.startAction(t,this.action)):this.postToConsole("Invalid BlackOp name specified: "+e[2]);break;default:this.postToConsole("Invalid action/event type specified: "+e[1]),this.postToConsole("Examples of valid action/event identifiers are: [general, contract, op, blackop]")}}executeSkillConsoleCommand(t){switch(t.length){case 1:this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info");break;case 2:if("list"===t[1].toLowerCase()){this.postToConsole("Skills: ");const t=Object.keys(h.a);for(let e=0;e=n.maxLvl?this.postToConsole(`This skill ${n.name} is already at max level (${t}/${n.maxLvl}).`):this.skillPoints>=a?(this.skillPoints-=a,this.upgradeSkill(n),this.log(n.name+" upgraded to Level "+this.skills[e])):this.postToConsole("You do not have enough Skill Points to upgrade this. You need "+Object(m.d)(a,0))}else this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info");break}default:this.postToConsole("Invalid usage of 'skill' console command: skill [action] [name]"),this.postToConsole("Use 'help skill' for more info")}}executeLogConsoleCommand(t){if(t.length<3)return this.postToConsole("Invalid usage of log command: log [enable/disable] [action/event]"),void this.postToConsole("Use 'help log' for more details and examples");let e=!0;switch(t[1].toLowerCase().includes("d")&&(e=!1),t[2].toLowerCase()){case"general":case"gen":this.logging.general=e,this.log("Logging "+(e?"enabled":"disabled")+" for general actions");break;case"contract":case"contracts":this.logging.contracts=e,this.log("Logging "+(e?"enabled":"disabled")+" for Contracts");break;case"ops":case"op":case"operations":case"operation":this.logging.ops=e,this.log("Logging "+(e?"enabled":"disabled")+" for Operations");break;case"blackops":case"blackop":case"black operations":case"black operation":this.logging.blackops=e,this.log("Logging "+(e?"enabled":"disabled")+" for BlackOps");break;case"event":case"events":this.logging.events=e,this.log("Logging "+(e?"enabled":"disabled")+" for events");break;case"all":this.logging.general=e,this.logging.contracts=e,this.logging.ops=e,this.logging.blackops=e,this.logging.events=e,this.log("Logging "+(e?"enabled":"disabled")+" for everything");break;default:this.postToConsole("Invalid action/event type specified: "+t[2]),this.postToConsole("Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]")}}executeHelpConsoleCommand(t){if(1===t.length)for(const t of y.a.helpList)this.postToConsole(t);else for(let e=1;e0&&(i*=Object(E.a)(2,4),--a.comms,++n.comms);const o=Math.round(a.pop*i);a.pop-=o,n.pop+=o}triggerPotentialMigration(t,e){(null==e||isNaN(e))&&console.error("Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()"),e>1&&(e/=100),Math.random()=1){let r;r=t?Math.ceil(a/2):Math.floor(a);const i=Object(E.a)(0,r);if(this.teamSize-=i,this.teamSizeObject(I.b)(t.currentWork));for(let e=0;e>this.teamSize-this.sleeveSize;e--){const e=Math.floor(Math.random()*t.length);t[e].takeDamage(t[e].hp.max),t.splice(e,1)}this.teamSize+=this.sleeveSize}this.teamLost+=i,this.logging.ops&&i>0&&this.log("Lost "+Object(m.d)(i,0)+" team members during this "+n.name)}const r=this.getCurrentCity();switch(n.name){case"Investigation":t?r.improvePopulationEstimateByPercentage(.4*this.skillMultipliers.successChanceEstimate):this.triggerPotentialMigration(this.city,.1);break;case"Undercover Operation":t?r.improvePopulationEstimateByPercentage(.8*this.skillMultipliers.successChanceEstimate):this.triggerPotentialMigration(this.city,.15);break;case"Sting Operation":t&&r.changePopulationByPercentage(-.1,{changeEstEqually:!0,nonZero:!0}),r.changeChaosByCount(.1);break;case"Raid":if(t)r.changePopulationByPercentage(-1,{changeEstEqually:!0,nonZero:!0}),--r.comms;else{const t=Object(E.a)(-10,-5)/10;r.changePopulationByPercentage(t,{nonZero:!0,changeEstEqually:!1})}r.changeChaosByPercentage(Object(E.a)(1,5));break;case"Stealth Retirement Operation":t&&r.changePopulationByPercentage(-.5,{changeEstEqually:!0,nonZero:!0}),r.changeChaosByPercentage(Object(E.a)(-3,-1));break;case"Assassination":t&&r.changePopulationByCount(-1,{estChange:-1,estOffset:0}),r.changeChaosByPercentage(Object(E.a)(-5,5));break;default:throw new Error("Invalid Action name in completeOperation: "+this.action.name)}}getActionObject(t){switch(t.type){case i.a.Contract:return this.contracts[t.name];case i.a.Operation:return this.operations[t.name];case i.a.BlackOp:case i.a.BlackOperation:return s.a[t.name];case i.a.Training:return u.a.Training;case i.a["Field Analysis"]:return u.a["Field Analysis"];case i.a.Recruitment:return u.a.Recruitment;case i.a.Diplomacy:return u.a.Diplomacy;case i.a["Hyperbolic Regeneration Chamber"]:return u.a["Hyperbolic Regeneration Chamber"];case i.a["Incite Violence"]:return u.a["Incite Violence"];default:return null}}completeContract(t,e){if(e.type!==i.a.Contract)throw new Error("completeContract() called even though current action is not a Contract");const n=this.getCurrentCity();if(t)switch(e.name){case"Tracking":n.improvePopulationEstimateByCount(Object(E.a)(100,1e3));break;case"Bounty Hunter":n.changePopulationByCount(-1,{estChange:-1,estOffset:0}),n.changeChaosByCount(.02);break;case"Retirement":n.changePopulationByCount(-1,{estChange:-1,estOffset:0}),n.changeChaosByCount(.04);break;default:throw new Error("Invalid Action name in completeContract: "+e.name)}}completeAction(t,e,n,a=!0){let r=Object(g.a)();switch(n.type){case i.a.Contract:case i.a.Operation:try{const o=n.type===i.a.Operation,s=this.getActionObject(n);if(null==s)throw new Error("Failed to get Contract/Operation Object for: "+n.name);const l=s.getDifficulty(),c=Math.pow(l,v.a.DiffMultExponentialFactor)+l/v.a.DiffMultLinearFactor,f=Math.pow(s.rewardFac,s.level-1);if(a&&(this.stamina-=v.a.BaseStaminaLoss*c,this.stamina<0&&(this.stamina=0)),s.attempt(this,e)){r=this.getActionStats(s,e,!0),++s.successes,--s.count;let a=0;if(o||(a=v.a.ContractBaseMoneyGain*f*this.skillMultipliers.money,r.money=a),o?s.setMaxLevel(v.a.OperationSuccessesPerLevel):s.setMaxLevel(v.a.ContractSuccessesPerLevel),s.rankGain){const t=Object(S.a)(s.rankGain*f*w.a.BladeburnerRank,10);this.changeRank(e,t),o&&this.logging.ops?this.log(e.whoAmI()+": "+s.name+" successfully completed! Gained "+Object(m.d)(t,3)+" rank"):!o&&this.logging.contracts&&this.log(e.whoAmI()+": "+s.name+" contract successfully completed! Gained "+Object(m.d)(t,3)+" rank and "+k.a.formatMoney(a))}o?this.completeOperation(!0,t):this.completeContract(!0,n)}else{r=this.getActionStats(s,e,!1),++s.failures;let a=0,i=0;if(s.rankLoss&&(a=Object(S.a)(s.rankLoss*f,10),this.changeRank(e,-1*a)),s.hpLoss){i=s.hpLoss*c,i=Math.ceil(Object(S.a)(i,10)),this.hpLost+=i;const n=Object(x.a)(t,i);e.takeDamage(i)&&(++this.numHosp,this.moneyLost+=n)}let l="";a>0&&(l+="Lost "+Object(m.d)(a,3)+" rank. "),i>0&&(l+="Took "+Object(m.d)(i,0)+" damage."),o&&this.logging.ops?this.log(e.whoAmI()+": "+s.name+" failed! "+l):!o&&this.logging.contracts&&this.log(e.whoAmI()+": "+s.name+" contract failed! "+l),o?this.completeOperation(!1,t):this.completeContract(!1,n)}s.autoLevel&&(s.level=s.maxLevel)}catch(t){Object(b.a)(t)}break;case i.a.BlackOp:case i.a.BlackOperation:try{const a=this.getActionObject(n);if(null==a||!(a instanceof l.a))throw new Error("Failed to get BlackOperation Object for: "+n.name);const i=a.getDifficulty(),o=Math.pow(i,v.a.DiffMultExponentialFactor)+i/v.a.DiffMultLinearFactor;this.stamina-=v.a.BaseStaminaLoss*o,this.stamina<0&&(this.stamina=0);const s=a.teamCount;let c;if(a.attempt(this,e)){r=this.getActionStats(a,e,!0),a.count=0,this.blackops[a.name]=!0;let t=0;a.rankGain&&(t=Object(S.a)(a.rankGain*w.a.BladeburnerRank,10),this.changeRank(e,t)),c=Math.ceil(s/2),this.logging.blackops&&this.log(e.whoAmI()+": "+a.name+" successful! Gained "+Object(m.d)(t,1)+" rank")}else{r=this.getActionStats(a,e,!1);let n=0,i=0;if(a.rankLoss&&(n=Object(S.a)(a.rankLoss,10),this.changeRank(e,-1*n)),a.hpLoss){i=a.hpLoss*o,i=Math.ceil(Object(S.a)(i,10));const n=Object(x.a)(t,i);e.takeDamage(i)&&(++this.numHosp,this.moneyLost+=n)}c=Math.floor(s),this.logging.blackops&&this.log(e.whoAmI()+": "+a.name+" failed! Lost "+Object(m.d)(n,1)+" rank and took "+Object(m.d)(i,0)+" damage")}if(this.resetAction(),s>=1){const n=Object(E.a)(1,c);if(this.teamSize-=n,this.teamSizeObject(I.b)(t.currentWork));for(let t=0;t>this.teamSize-this.sleeveSize;t--){const t=Math.floor(Math.random()*e.length);e[t].takeDamage(e[t].hp.max),e.splice(t,1)}this.teamSize+=this.sleeveSize}this.teamLost+=n,this.logging.blackops&&this.log(`${e.whoAmI()}: You lost ${Object(m.d)(n,0)} team members during ${a.name}`)}}catch(t){Object(b.a)(String(t))}break;case i.a.Training:{this.stamina-=.5*v.a.BaseStaminaLoss;const t=30*e.mults.strength_exp,n=30*e.mults.defense_exp,a=30*e.mults.dexterity_exp,i=30*e.mults.agility_exp,o=.04*this.skillMultipliers.stamina;r.str=t,r.def=n,r.dex=a,r.agi=i,this.staminaBonus+=o,this.logging.general&&this.log(e.whoAmI()+": Training completed. Gained: "+Object(m.d)(t,1)+" str exp, "+Object(m.d)(n,1)+" def exp, "+Object(m.d)(a,1)+" dex exp, "+Object(m.d)(i,1)+" agi exp, "+Object(m.d)(o,3)+" max stamina");break}case i.a.FieldAnalysis:case i.a["Field Analysis"]:{let t=.04*Math.pow(e.skills.hacking,.3)+.04*Math.pow(e.skills.intelligence,.9)+.02*Math.pow(e.skills.charisma,.3);if(t*=e.mults.bladeburner_analysis,isNaN(t)||t<0)throw new Error("Field Analysis Effectiveness calculated to be NaN or negative");const n=20*e.mults.hacking_exp,a=20*e.mults.charisma_exp,i=.1*w.a.BladeburnerRank;r.hack=n,r.cha=a,r.int=v.a.BaseIntGain,this.changeRank(e,i),this.getCurrentCity().improvePopulationEstimateByPercentage(t*this.skillMultipliers.successChanceEstimate),this.logging.general&&this.log(e.whoAmI()+": "+`Field analysis completed. Gained ${Object(m.d)(i,2)} rank, `+Object(m.d)(n,1)+" hacking exp, and "+Object(m.d)(a,1)+" charisma exp");break}case i.a.Recruitment:{const t=this.getRecruitmentSuccessChance(e),n=1e3*this.getRecruitmentTime(e);if(Math.random()Object(P.b)(t.currentWork)).length,n=Math.pow(e,-.5)/2;for(const t of Object.keys(this.contracts))this.contracts[t].count+=n;for(const t of Object.keys(this.operations))this.operations[t].count+=n;this.logging.general&&this.log("Sleeve: Infiltrate the synthoid communities.")}changeRank(t,e){if(isNaN(e))throw new Error("NaN passed into Bladeburner.changeRank()");this.rank+=e,this.rank<0&&(this.rank=0),this.maxRank=Math.max(this.rank,this.maxRank);const n=R.a.Bladeburners;if(Object(C.b)(n)){const a=C.a[n];if(!(a instanceof _.a))throw new Error(`Could not properly get ${R.a.Bladeburners} Faction object in ${R.a.Bladeburners} UI Overview Faction button`);if(a.isMember){const n=1+a.favor/100;a.playerReputation+=v.a.RankToFactionRepFactor*e*t.mults.faction_rep*n}}const a=(this.totalSkillPoints+1)*v.a.RanksPerSkillPoint;if(this.maxRank>=a){const t=Math.floor((this.maxRank-a)/v.a.RanksPerSkillPoint+1);this.skillPoints+=t,this.totalSkillPoints+=t}}processAction(t,e,n){if(this.action.type!==i.a.Idle){if(this.actionTimeToComplete<=0)throw new Error(`Invalid actionTimeToComplete value: ${this.actionTimeToComplete}, type; ${this.action.type}`);if(!(this.action instanceof r.a))throw new Error("Bladeburner.action is not an ActionIdentifier Object");if(this.actionTimeCurrent+=n+this.actionTimeOverflow,this.actionTimeOverflow=0,this.actionTimeCurrent>=this.actionTimeToComplete){this.actionTimeOverflow=this.actionTimeCurrent-this.actionTimeToComplete;const t=this.getActionObject(this.action),n=this.completeAction(e,e,this.action);if(e.gainMoney(n.money,"bladeburner"),e.gainStats(n),null==t)throw new Error("Failed to get BlackOperation Object for: "+this.action.name);this.action.type!=i.a.BlackOperation&&this.action.type!=i.a.BlackOp&&this.startAction(e,this.action)}}}calculateStaminaGainPerSecond(t){const e=t.skills.agility*this.skillMultipliers.effAgi,n=this.maxStamina/v.a.MaxStaminaToGainFactor;return(v.a.StaminaGainPerSecond+n)*Math.pow(e,.17)*(this.skillMultipliers.stamina*t.mults.bladeburner_stamina_gain)}calculateMaxStamina(t){const e=t.skills.agility*this.skillMultipliers.effAgi,n=(Math.pow(e,.8)+this.staminaBonus)*this.skillMultipliers.stamina*t.mults.bladeburner_max_stamina;if(this.maxStamina!==n){const t=this.maxStamina;this.maxStamina=n,this.stamina=this.maxStamina*this.stamina/t}if(isNaN(n))throw new Error("Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()")}create(){this.contracts.Tracking=new f.a({name:"Tracking",baseDifficulty:125,difficultyFac:1.02,rewardFac:1.041,rankGain:.3,hpLoss:.5,count:Object(E.a)(25,150),weights:{hack:0,str:.05,def:.05,dex:.35,agi:.35,cha:.1,int:.05},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.9,int:1},isStealth:!0}),this.contracts["Bounty Hunter"]=new f.a({name:"Bounty Hunter",baseDifficulty:250,difficultyFac:1.04,rewardFac:1.085,rankGain:.9,hpLoss:1,count:Object(E.a)(5,150),weights:{hack:0,str:.15,def:.15,dex:.25,agi:.25,cha:.1,int:.1},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.8,int:.9},isKill:!0}),this.contracts.Retirement=new f.a({name:"Retirement",baseDifficulty:200,difficultyFac:1.03,rewardFac:1.065,rankGain:.6,hpLoss:1,count:Object(E.a)(5,150),weights:{hack:0,str:.2,def:.2,dex:.2,agi:.2,cha:.1,int:.1},decays:{hack:0,str:.91,def:.91,dex:.91,agi:.91,cha:.8,int:.9},isKill:!0}),this.operations.Investigation=new c.a({name:"Investigation",baseDifficulty:400,difficultyFac:1.03,rewardFac:1.07,reqdRank:25,rankGain:2.2,rankLoss:.2,count:Object(E.a)(1,100),weights:{hack:.25,str:.05,def:.05,dex:.2,agi:.1,cha:.25,int:.1},decays:{hack:.85,str:.9,def:.9,dex:.9,agi:.9,cha:.7,int:.9},isStealth:!0}),this.operations["Undercover Operation"]=new c.a({name:"Undercover Operation",baseDifficulty:500,difficultyFac:1.04,rewardFac:1.09,reqdRank:100,rankGain:4.4,rankLoss:.4,hpLoss:2,count:Object(E.a)(1,100),weights:{hack:.2,str:.05,def:.05,dex:.2,agi:.2,cha:.2,int:.1},decays:{hack:.8,str:.9,def:.9,dex:.9,agi:.9,cha:.7,int:.9},isStealth:!0}),this.operations["Sting Operation"]=new c.a({name:"Sting Operation",baseDifficulty:650,difficultyFac:1.04,rewardFac:1.095,reqdRank:500,rankGain:5.5,rankLoss:.5,hpLoss:2.5,count:Object(E.a)(1,150),weights:{hack:.25,str:.05,def:.05,dex:.25,agi:.1,cha:.2,int:.1},decays:{hack:.8,str:.85,def:.85,dex:.85,agi:.85,cha:.7,int:.9},isStealth:!0}),this.operations.Raid=new c.a({name:"Raid",baseDifficulty:800,difficultyFac:1.045,rewardFac:1.1,reqdRank:3e3,rankGain:55,rankLoss:2.5,hpLoss:50,count:Object(E.a)(1,150),weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.7,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.9},isKill:!0}),this.operations["Stealth Retirement Operation"]=new c.a({name:"Stealth Retirement Operation",baseDifficulty:1e3,difficultyFac:1.05,rewardFac:1.11,reqdRank:2e4,rankGain:22,rankLoss:2,hpLoss:10,count:Object(E.a)(1,150),weights:{hack:.1,str:.1,def:.1,dex:.3,agi:.3,cha:0,int:.1},decays:{hack:.7,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.9},isStealth:!0,isKill:!0}),this.operations.Assassination=new c.a({name:"Assassination",baseDifficulty:1500,difficultyFac:1.06,rewardFac:1.14,reqdRank:5e4,rankGain:44,rankLoss:4,hpLoss:5,count:Object(E.a)(1,150),weights:{hack:.1,str:.1,def:.1,dex:.3,agi:.3,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.8},isStealth:!0,isKill:!0})}process(t,e){if(t.isInitialized){if(!e.hasAugmentation(M.a.BladesSimulacrum,!0)&&e.currentWork){if(this.action.type!==i.a.Idle){let t="Your Bladeburner action was cancelled because you started doing something else.";this.automateEnabled&&(t+="

Your automation was disabled as well. You will have to re-enable it through the Bladeburner console",this.automateEnabled=!1),O.a.SuppressBladeburnerPopup||Object(L.a)(t)}this.resetAction()}if(this.stamina<=0&&(this.log("Your Bladeburner action was cancelled because your stamina hit 0"),this.resetAction()),this.storedCycles>=v.a.CyclesPerSecond){let n=Math.floor(this.storedCycles/v.a.CyclesPerSecond);n=Math.min(n,5),this.storedCycles-=n*v.a.CyclesPerSecond,this.calculateMaxStamina(e),this.stamina+=this.calculateStaminaGainPerSecond(e)*n,this.stamina=Math.min(this.maxStamina,this.stamina);for(const t of Object.values(this.contracts)){const e=o.a[t.name];if(void 0===e)throw new Error(`growth formula for action '${t.name}' is undefined`);t.count+=n*e()/v.a.ActionCountGrowthPeriod}for(const t of Object.values(this.operations)){const e=o.a[t.name];if(void 0===e)throw new Error(`growth formula for action '${t.name}' is undefined`);void 0!==e&&(t.count+=n*e()/v.a.ActionCountGrowthPeriod)}for(const t of v.a.CityNames){const e=this.cities[t];if(!(e instanceof p.a))throw new Error("Invalid City object when processing passive chaos reduction in Bladeburner.process");e.chaos-=1e-4*n,e.chaos=Math.max(0,e.chaos)}this.randomEventCounter-=n,this.randomEventCounter<=0&&(this.randomEvent(),this.randomEventCounter+=Object(E.a)(240,600)),this.processAction(t,e,n),this.automateEnabled&&(this.stamina<=this.automateThreshLow?this.action.name===this.automateActionLow.name&&this.action.type===this.automateActionLow.type||(this.action=new r.a({type:this.automateActionLow.type,name:this.automateActionLow.name}),this.startAction(e,this.action)):this.stamina>=this.automateThreshHigh&&(this.action.name===this.automateActionHigh.name&&this.action.type===this.automateActionHigh.type||(this.action=new r.a({type:this.automateActionHigh.type,name:this.automateActionHigh.name}),this.startAction(e,this.action))))}}}getTypeAndNameFromActionId(t){const e={type:"",name:""},n=Object.keys(i.a);for(let a=0;ar),!1;if(o.type===i.a.BlackOp){const t=this.canAttemptBlackOp(o);if(!t.isAvailable)return a.log("bladeburner.startAction",()=>t.error+""),!1}try{return this.startAction(t,o),a.log("bladeburner.startAction",()=>`Starting bladeburner action with type '${e}' and name '${n}'`),!0}catch(t){return console.error(t),this.resetAction(),a.log("bladeburner.startAction",()=>r),!1}}getActionTimeNetscriptFn(t,e,n){const a=this.getActionIdFromTypeAndName(e,n);if(null==a)return"bladeburner.getActionTime";const r=this.getActionObject(a);if(null==r)return"bladeburner.getActionTime";switch(a.type){case i.a.Contract:case i.a.Operation:case i.a.BlackOp:case i.a.BlackOperation:return 1e3*r.getActionTime(this,t);case i.a.Training:case i.a["Field Analysis"]:case i.a.FieldAnalysis:return 3e4;case i.a.Recruitment:return 1e3*this.getRecruitmentTime(t);case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:return 6e4;default:return"bladeburner.getActionTime"}}getActionEstimatedSuccessChanceNetscriptFn(t,e,n){const a=this.getActionIdFromTypeAndName(e,n);if(null==a)return"bladeburner.getActionEstimatedSuccessChance";const r=this.getActionObject(a);if(null==r)return"bladeburner.getActionEstimatedSuccessChance";switch(a.type){case i.a.Contract:case i.a.Operation:case i.a.BlackOp:case i.a.BlackOperation:return r.getEstSuccessChance(this,t);case i.a.Training:case i.a["Field Analysis"]:case i.a.FieldAnalysis:case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:return[1,1];case i.a.Recruitment:{const e=this.getRecruitmentSuccessChance(t);return[e,e]}default:return"bladeburner.getActionEstimatedSuccessChance"}}getActionCountRemainingNetscriptFn(t,e,n){const a=`Invalid action: type='${t}' name='${e}'`,r=this.getActionIdFromTypeAndName(t,e);if(null==r)return n.log("bladeburner.getActionCountRemaining",()=>a),-1;const o=this.getActionObject(r);if(null==o)return n.log("bladeburner.getActionCountRemaining",()=>a),-1;switch(r.type){case i.a.Contract:case i.a.Operation:return Math.floor(o.count);case i.a.BlackOp:case i.a.BlackOperation:return null!=this.blackops[e]?0:1;case i.a.Training:case i.a.Recruitment:case i.a["Field Analysis"]:case i.a.FieldAnalysis:case i.a.Diplomacy:case i.a["Hyperbolic Regeneration Chamber"]:case i.a["Incite Violence"]:return 1/0;default:return n.log("bladeburner.getActionCountRemaining",()=>a),-1}}getSkillLevelNetscriptFn(t,e){return""!==t&&h.a.hasOwnProperty(t)?null==this.skills[t]?0:this.skills[t]:(e.log("bladeburner.getSkillLevel",()=>`Invalid skill: '${t}'`),-1)}getSkillUpgradeCostNetscriptFn(t,e,n){if(""===t||!h.a.hasOwnProperty(t))return n.log("bladeburner.getSkillUpgradeCost",()=>`Invalid skill: '${t}'`),-1;const a=h.a[t];return null==this.skills[t]?a.calculateCost(0,e):a.calculateCost(this.skills[t],e)}upgradeSkillNetscriptFn(t,e,n){const a=`Invalid skill: '${t}'`;if(!h.a.hasOwnProperty(t))return n.log("bladeburner.upgradeSkill",()=>a),!1;const r=h.a[t];let i=0;this.skills[t]&&!isNaN(this.skills[t])&&(i=this.skills[t]);const o=r.calculateCost(i,e);return r.maxLvl&&i+e>r.maxLvl?(n.log("bladeburner.upgradeSkill",()=>`Skill '${t}' cannot be upgraded ${e} time(s).`),!1):this.skillPoints`You do not have enough skill points to upgrade ${t} ${e} time(s). (You have ${this.skillPoints}, you need ${o})`),!1):(this.skillPoints-=o,this.upgradeSkill(r,e),n.log("bladeburner.upgradeSkill",()=>`'${t}' upgraded to level ${this.skills[t]}`),!0)}getTeamSizeNetscriptFn(t,e,n){if(""===t&&""===e)return this.teamSize;const a=`Invalid action: type='${t}' name='${e}'`,r=this.getActionIdFromTypeAndName(t,e);if(null==r)return n.log("bladeburner.getTeamSize",()=>a),-1;const o=this.getActionObject(r);return null==o?(n.log("bladeburner.getTeamSize",()=>a),-1):r.type===i.a.Operation||r.type===i.a.BlackOp||r.type===i.a.BlackOperation?o.teamCount:0}setTeamSizeNetscriptFn(t,e,n,a){const r=`Invalid action: type='${t}' name='${e}'`,o=this.getActionIdFromTypeAndName(t,e);if(null==o)return a.log("bladeburner.setTeamSize",()=>r),-1;if(o.type!==i.a.Operation&&o.type!==i.a.BlackOp&&o.type!==i.a.BlackOperation)return a.log("bladeburner.setTeamSize",()=>"Only valid for 'Operations' and 'BlackOps'"),-1;const s=this.getActionObject(o);if(null==s)return a.log("bladeburner.setTeamSize",()=>r),-1;let l=Math.round(n);return isNaN(l)||l<0?(a.log("bladeburner.setTeamSize",()=>"Invalid size: "+n),-1):(this.teamSize`Team size for '${e}' set to ${l}.`),l)}joinBladeburnerFactionNetscriptFn(t){const e=C.a[R.a.Bladeburners];return!!e.isMember||(this.rank>=v.a.RankNeededForFaction?(Object(T.d)(e),t.log("bladeburner.joinBladeburnerFaction",()=>`Joined ${R.a.Bladeburners} faction.`),!0):(t.log("bladeburner.joinBladeburnerFaction",()=>`You do not have the required rank (${this.rank}/${v.a.RankNeededForFaction}).`),!1))}toJSON(){return Object(a.b)("Bladeburner",this)}static fromJSON(t){return Object(a.a)(F,t.data)}}a.c.constructors.Bladeburner=F},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"e",(function(){return s})),n.d(e,"a",(function(){return l})),n.d(e,"d",(function(){return c}));var a=n(22),r=n(41);function i(t,e,n,i){return t*r.a.MoneyGainPerLevel*Math.pow(1.035,e-1)*((n+5)/6)*i*a.a.HacknetNodeMoney}function o(t,e=1,n=1){const a=Math.round(e);if(isNaN(a)||a<1)return 0;if(t>=r.a.MaxLevel)return 1/0;const i=r.a.UpgradeLevelMult;let o=0,s=t;for(let t=0;t=r.a.MaxRam)return 1/0;let i=0,o=Math.round(Math.log2(t)),s=t;for(let t=0;t=r.a.MaxCores)return 1/0;const i=r.a.CoreBaseCost,o=r.a.UpgradeCoreMult;let s=0,l=t;for(let t=0;t1e10;return e&&Object(r.a)(a.createElement(a.Fragment,null,"Alright cheater get out of here. You're not allowed here anymore.")),e}class s extends a.Component{win(t,e){t.gainMoney(e,"casino")}reachedLimit(t){const e=t.getCasinoWinnings()>1e10;return e&&Object(r.a)(a.createElement(a.Fragment,null,"Alright cheater get out of here. You're not allowed here anymore.")),e}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));const a=!1,r=!0,i={O:[[r,r],[r,r]],I:[[r,r,r,r]],L:[[a,a,r],[r,r,r]],J:[[r,a,a],[r,r,r]],S:[[a,r,r],[r,r,a]],Z:[[r,r,a],[a,r,r]],T:[[r,r,r],[a,r,a]]}},,,,,function(t,e,n){"use strict";function a(t,e,n){function a(t,e,a){function r(t,e,n){return(1-n)*t+n*e}for(const i of Object.keys(t))n[i]=r(t[i],e[i],a);return t}return e<0?a(t.Trivial,t.Trivial,0):e>=0&&e<1?a(t.Trivial,t.Normal,e):e>=1&&e<2?a(t.Normal,t.Hard,e-1):e>=2&&e<3?a(t.Hard,t.Impossible,e-2):a(t.Impossible,t.Impossible,0)}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(0),r=n.n(a);function i(t){return Object(a.useEffect)(()=>{function e(e){if(!e.isTrusted)return;t.onKeyDown.bind(this)(e)}return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)}),r.a.createElement(r.a.Fragment,null)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(153),o=n(15),s=n(5),l=n(29),c=n(90),f=n(16),u=n(144),m=n(13),h=n(12),d=n(394),p=n(108);const g=t=>null!==t&&t.type===i.b.FACTION;class y extends i.a{constructor(t){var e,n,a;super(i.b.FACTION,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.factionWorkType=null!==(n=null==t?void 0:t.factionWorkType)&&void 0!==n?n:p.a.HACKING,this.factionName=null!==(a=null==t?void 0:t.faction)&&void 0!==a?a:s.a.Sector12}getFaction(){const t=l.a[this.factionName];if(!t)throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);return t}getReputationRate(t){let e=1;return t.hasAugmentation(h.a.NeuroreceptorManager)||(e=t.focus?1:m.a.BaseFocusBonus),Object(d.b)(t,this.factionWorkType,this.getFaction().favor)*e}getExpRates(t){let e=1;t.hasAugmentation(h.a.NeuroreceptorManager)||(e=t.focus?1:m.a.BaseFocusBonus);const n=Object(d.a)(t,this.factionWorkType);return Object(c.d)(n,e,!1)}process(t,e){this.cyclesWorked+=e,this.getFaction().playerReputation+=this.getReputationRate(t)*e;const n=this.getExpRates(t);return Object(c.a)(t,t,n,e,"class"),!1}finish(){this.singularity||Object(f.a)(r.a.createElement(r.a.Fragment,null,"You worked for ",this.getFaction().name,".",r.a.createElement("br",null),"They now have a total of ",r.a.createElement(u.a,{reputation:this.getFaction().playerReputation})," reputation."))}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,factionWorkType:this.factionWorkType,factionName:this.factionName}}toJSON(){return Object(o.b)("FactionWork",this)}static fromJSON(t){return Object(o.a)(y,t.data)}}o.c.constructors.FactionWork=y},,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({money:{color:t.colors.money}}));function l({hashes:t}){const e=s();return a.createElement("span",{className:e.money},"number"==typeof t?r.a.formatHashes(t):t)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(13),r=n(216),i=n(41),o=n(16),s=n(15),l=n(403);function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f{constructor(t="",e=1){c(this,"cores",1),c(this,"level",1),c(this,"moneyGainRatePerSecond",0),c(this,"onlineTimeSeconds",0),c(this,"ram",1),c(this,"totalMoneyGenerated",0),this.name=t,this.updateMoneyGainRate(e)}calculateCoreUpgradeCost(t=1,e){return Object(r.a)(this.cores,t,e)}calculateLevelUpgradeCost(t=1,e){return Object(r.b)(this.level,t,e)}calculateRamUpgradeCost(t=1,e){return Object(r.e)(this.ram,t,e)}process(t=1){const e=t*a.a.MilliPerCycle/1e3;let n=this.moneyGainRatePerSecond*e;return isNaN(n)&&(console.error(`Hacknet Node ${this.name} calculated earnings of NaN`),n=0),this.totalMoneyGenerated+=n,this.onlineTimeSeconds+=e,n}upgradeCore(t=1,e){this.cores=Math.min(i.a.MaxCores,Math.round(this.cores+t)),this.updateMoneyGainRate(e)}upgradeLevel(t=1,e){this.level=Math.min(i.a.MaxLevel,Math.round(this.level+t)),this.updateMoneyGainRate(e)}upgradeRam(t=1,e){for(let e=0;eu())return 1/0;const n=Math.max(0,Math.log(e)/Math.log(2)-6);return e*o.a.BaseCostFor1GBOfRamServer*i.a.PurchasedServerCost*Math.pow(i.a.PurchasedServerSoftcap,n)}function f(){return Math.round(o.a.PurchasedServerLimit*i.a.PurchasedServerLimit)}function u(){const t=Math.round(o.a.PurchasedServerMaxRam*i.a.PurchasedServerMaxRam);return 1<<31-Math.clz32(t)}function m(t,e,n,i){if(!i.canAfford(n))return void Object(s.a)("You don't have enough money to purchase this server!");if(i.purchasedServers.length>=f())return void Object(s.a)("You have reached the maximum limit of "+f()+" servers. You cannot purchase any more. You can delete some of your purchased servers using the deleteServer() Netscript function in a script");if(""==t)return void Object(s.a)("You must enter a hostname for your new server!");const o=Object(r.g)({adminRights:!0,hostname:t,ip:Object(a.e)(),isConnectedTo:!1,maxRam:e,organizationName:"",purchasedByPlayer:!0});Object(a.a)(o),i.purchasedServers.push(o.hostname);const l=i.getHomeComputer();l.serversOnNetwork.push(o.hostname),o.serversOnNetwork.push(l.hostname),i.loseMoney(n,"servers"),Object(s.a)("Server successfully purchased with hostname "+o.hostname)}function h(t){const e=t.getUpgradeHomeRamCost();if(!t.canAfford(e))return void Object(s.a)("You do not have enough money to purchase additional RAM for your home computer");const n=t.getHomeComputer();n.maxRam>=o.a.HomeComputerMaxRam?Object(s.a)("You cannot upgrade your home computer RAM because it is at its maximum possible value"):(n.maxRam*=2,t.loseMoney(e,"servers"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"b",(function(){return l}));var a=n(16),r=n(15),i=n(77);class o{get filename(){return this.fn}set filename(t){this.fn=t}constructor(t="",e=""){this.fn=(t.endsWith(".txt")?t:t+".txt").replace(/\s+/g,""),this.text=e}append(t){this.text+=t}download(){const t=new Blob([this.text],{type:"text/plain"}),e=document.createElement("a"),n=URL.createObjectURL(t);e.href=n,e.download=this.fn,document.body.appendChild(e),e.click(),setTimeout(()=>{document.body.removeChild(e),window.URL.revokeObjectURL(n)},0)}read(){return this.text}show(){Object(a.a)(`${this.fn}

${this.text}`)}toJSON(){return Object(r.b)("TextFile",this)}write(t){this.text=t}static fromJSON(t){return Object(r.a)(o,t.data)}}function s(t,e){let n=t.endsWith(".txt")?t:t+".txt";Object(i.h)(n)&&(n=Object(i.k)(n));for(const t of e.textFiles)if(t.fn===n)return t;return null}function l(t,e,n){if(null!==s(t,n))return void console.error(`A file named "${t}" already exists on server ${n.hostname}.`);const a=new o(t,e);return n.textFiles.push(a),a}r.c.constructors.TextFile=o},function(t,e,n){"use strict";n.d(e,"c",(function(){return l})),n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(13),r=n(22),i=n(442),o=n(273);function s(t){let e=1+t/100;return isNaN(e)&&(e=1),e*r.a.FactionWorkRepGain}function l(t,e){return(t.skills.hacking+t.skills.intelligence/3)/a.a.MaxSkillLevel*t.mults.faction_rep*Object(o.a)(t.skills.intelligence,1)*s(e)*Object(i.a)()}function c(t,e){return.9*(t.skills.strength+t.skills.defense+t.skills.dexterity+t.skills.agility+(t.skills.hacking+t.skills.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/4.5*t.mults.faction_rep*s(e)*Object(o.a)(t.skills.intelligence,1)}function f(t,e){return.9*(t.skills.strength+t.skills.defense+t.skills.dexterity+t.skills.agility+t.skills.charisma+(t.skills.hacking+t.skills.intelligence)*Object(i.a)())/a.a.MaxSkillLevel/5.5*t.mults.faction_rep*s(e)*Object(o.a)(t.skills.intelligence,1)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return d})),n.d(e,"c",(function(){return p}));const a={ScriptBaseRamCost:1.6,ScriptDomRamCost:25,ScriptCorporationRamCost:1022.4,ScriptHackRamCost:.1,ScriptHackAnalyzeRamCost:1,ScriptGrowRamCost:.15,ScriptGrowthAnalyzeRamCost:1,ScriptWeakenRamCost:.15,ScriptWeakenAnalyzeRamCost:1,ScriptScanRamCost:.2,ScriptRecentScriptsRamCost:.2,ScriptPortProgramRamCost:.05,ScriptRunRamCost:1,ScriptExecRamCost:1.3,ScriptSpawnRamCost:2,ScriptScpRamCost:.6,ScriptKillRamCost:.5,ScriptHasRootAccessRamCost:.05,ScriptGetHostnameRamCost:.05,ScriptGetHackingLevelRamCost:.05,ScriptGetMultipliersRamCost:4,ScriptGetServerRamCost:.1,ScriptGetServerMaxRam:.05,ScriptGetServerUsedRam:.05,ScriptFileExistsRamCost:.1,ScriptIsRunningRamCost:.1,ScriptHacknetNodesRamCost:4,ScriptHNUpgLevelRamCost:.4,ScriptHNUpgRamRamCost:.6,ScriptHNUpgCoreRamCost:.8,ScriptGetStockRamCost:2,ScriptBuySellStockRamCost:2.5,ScriptGetPurchaseServerRamCost:.25,ScriptPurchaseServerRamCost:2.25,ScriptGetPurchasedServerLimit:.05,ScriptGetPurchasedServerMaxRam:.05,ScriptRoundRamCost:.05,ScriptReadWriteRamCost:1,ScriptArbScriptRamCost:1,ScriptGetScriptRamCost:.1,ScriptGetRunningScriptRamCost:.3,ScriptGetHackTimeRamCost:.05,ScriptGetFavorToDonate:.1,ScriptCodingContractBaseRamCost:10,ScriptSleeveBaseRamCost:4,ScriptClearTerminalCost:.2,ScriptSingularityFn1RamCost:2,ScriptSingularityFn2RamCost:3,ScriptSingularityFn3RamCost:5,ScriptGangApiBaseRamCost:4,ScriptBladeburnerApiBaseRamCost:4,ScriptStanekWidth:.4,ScriptStanekHeight:.4,ScriptStanekCharge:.4,ScriptStanekFragmentDefinitions:0,ScriptStanekPlacedFragments:5,ScriptStanekClear:0,ScriptStanekCanPlace:.5,ScriptStanekPlace:5,ScriptStanekFragmentAt:2,ScriptStanekDeleteAt:.15,ScriptInfiltrationCalculateDifficulty:2.5,ScriptInfiltrationCalculateRewards:2.5,ScriptInfiltrationGetLocations:5,ScriptInfiltrationGetInfiltrations:15,ScriptStanekAcceptGift:2};function r(t){return e=>{if(4===e.bitNodeN)return t;const n=e.sourceFileLvl(4);return n<=1?16*t:2===n?4*t:t}}const i={hasWSEAccount:.05,hasTIXAPIAccess:.05,has4SData:.05,has4SDataTIXAPI:.05,getSymbols:a.ScriptGetStockRamCost,getPrice:a.ScriptGetStockRamCost,getAskPrice:a.ScriptGetStockRamCost,getBidPrice:a.ScriptGetStockRamCost,getPosition:a.ScriptGetStockRamCost,getMaxShares:a.ScriptGetStockRamCost,getPurchaseCost:a.ScriptGetStockRamCost,getSaleGain:a.ScriptGetStockRamCost,buyStock:a.ScriptBuySellStockRamCost,sellStock:a.ScriptBuySellStockRamCost,buyShort:a.ScriptBuySellStockRamCost,sellShort:a.ScriptBuySellStockRamCost,placeOrder:a.ScriptBuySellStockRamCost,cancelOrder:a.ScriptBuySellStockRamCost,getOrders:a.ScriptBuySellStockRamCost,getVolatility:a.ScriptBuySellStockRamCost,getForecast:a.ScriptBuySellStockRamCost,purchase4SMarketData:a.ScriptBuySellStockRamCost,purchase4SMarketDataTixApi:a.ScriptBuySellStockRamCost,purchaseWseAccount:a.ScriptBuySellStockRamCost,purchaseTixApi:a.ScriptBuySellStockRamCost},o={universityCourse:r(a.ScriptSingularityFn1RamCost),gymWorkout:r(a.ScriptSingularityFn1RamCost),travelToCity:r(a.ScriptSingularityFn1RamCost),goToLocation:r(a.ScriptSingularityFn3RamCost),purchaseTor:r(a.ScriptSingularityFn1RamCost),purchaseProgram:r(a.ScriptSingularityFn1RamCost),getCurrentServer:r(a.ScriptSingularityFn1RamCost),connect:r(a.ScriptSingularityFn1RamCost),manualHack:r(a.ScriptSingularityFn1RamCost),installBackdoor:r(a.ScriptSingularityFn1RamCost),getDarkwebProgramCost:r(a.ScriptSingularityFn1RamCost/4),getDarkwebPrograms:r(a.ScriptSingularityFn1RamCost/4),hospitalize:r(a.ScriptSingularityFn1RamCost/4),isBusy:r(a.ScriptSingularityFn1RamCost/4),stopAction:r(a.ScriptSingularityFn1RamCost/2),upgradeHomeRam:r(a.ScriptSingularityFn2RamCost),upgradeHomeCores:r(a.ScriptSingularityFn2RamCost),getUpgradeHomeRamCost:r(a.ScriptSingularityFn2RamCost/2),getUpgradeHomeCoresCost:r(a.ScriptSingularityFn2RamCost/2),workForCompany:r(a.ScriptSingularityFn2RamCost),applyToCompany:r(a.ScriptSingularityFn2RamCost),quitJob:r(a.ScriptSingularityFn2RamCost),getCompanyRep:r(a.ScriptSingularityFn2RamCost/3),getCompanyFavor:r(a.ScriptSingularityFn2RamCost/3),getCompanyFavorGain:r(a.ScriptSingularityFn2RamCost/4),checkFactionInvitations:r(a.ScriptSingularityFn2RamCost),joinFaction:r(a.ScriptSingularityFn2RamCost),workForFaction:r(a.ScriptSingularityFn2RamCost),getFactionRep:r(a.ScriptSingularityFn2RamCost/3),getFactionFavor:r(a.ScriptSingularityFn2RamCost/3),getFactionFavorGain:r(a.ScriptSingularityFn2RamCost/4),donateToFaction:r(a.ScriptSingularityFn3RamCost),createProgram:r(a.ScriptSingularityFn3RamCost),commitCrime:r(a.ScriptSingularityFn3RamCost),getCrimeChance:r(a.ScriptSingularityFn3RamCost),getCrimeStats:r(a.ScriptSingularityFn3RamCost),getOwnedAugmentations:r(a.ScriptSingularityFn3RamCost),getOwnedSourceFiles:r(a.ScriptSingularityFn3RamCost),getAugmentationsFromFaction:r(a.ScriptSingularityFn3RamCost),getAugmentationCost:r(a.ScriptSingularityFn3RamCost),getAugmentationPrereq:r(a.ScriptSingularityFn3RamCost),getAugmentationPrice:r(a.ScriptSingularityFn3RamCost/2),getAugmentationBasePrice:r(a.ScriptSingularityFn3RamCost/2),getAugmentationRepReq:r(a.ScriptSingularityFn3RamCost/2),getAugmentationStats:r(a.ScriptSingularityFn3RamCost),purchaseAugmentation:r(a.ScriptSingularityFn3RamCost),softReset:r(a.ScriptSingularityFn3RamCost),installAugmentations:r(a.ScriptSingularityFn3RamCost),isFocused:r(.1),setFocus:r(.1),b1tflum3:r(16),destroyW0r1dD43m0n:r(32),getCurrentWork:r(.5)},s={createGang:a.ScriptGangApiBaseRamCost/4,inGang:a.ScriptGangApiBaseRamCost/4,getMemberNames:a.ScriptGangApiBaseRamCost/4,getGangInformation:a.ScriptGangApiBaseRamCost/2,getOtherGangInformation:a.ScriptGangApiBaseRamCost/2,getMemberInformation:a.ScriptGangApiBaseRamCost/2,canRecruitMember:a.ScriptGangApiBaseRamCost/4,recruitMember:a.ScriptGangApiBaseRamCost/2,getTaskNames:a.ScriptGangApiBaseRamCost/4,getTaskStats:a.ScriptGangApiBaseRamCost/4,setMemberTask:a.ScriptGangApiBaseRamCost/2,getEquipmentNames:a.ScriptGangApiBaseRamCost/4,getEquipmentCost:a.ScriptGangApiBaseRamCost/2,getEquipmentType:a.ScriptGangApiBaseRamCost/2,getEquipmentStats:a.ScriptGangApiBaseRamCost/2,purchaseEquipment:a.ScriptGangApiBaseRamCost,ascendMember:a.ScriptGangApiBaseRamCost,getAscensionResult:a.ScriptGangApiBaseRamCost/2,setTerritoryWarfare:a.ScriptGangApiBaseRamCost/2,getChanceToWinClash:a.ScriptGangApiBaseRamCost,getBonusTime:0},l={getContractNames:a.ScriptBladeburnerApiBaseRamCost/10,getOperationNames:a.ScriptBladeburnerApiBaseRamCost/10,getBlackOpNames:a.ScriptBladeburnerApiBaseRamCost/10,getBlackOpRank:a.ScriptBladeburnerApiBaseRamCost/2,getGeneralActionNames:a.ScriptBladeburnerApiBaseRamCost/10,getSkillNames:a.ScriptBladeburnerApiBaseRamCost/10,startAction:a.ScriptBladeburnerApiBaseRamCost,stopBladeburnerAction:a.ScriptBladeburnerApiBaseRamCost/2,getCurrentAction:a.ScriptBladeburnerApiBaseRamCost/4,getActionTime:a.ScriptBladeburnerApiBaseRamCost,getActionCurrentTime:a.ScriptBladeburnerApiBaseRamCost,getActionEstimatedSuccessChance:a.ScriptBladeburnerApiBaseRamCost,getActionRepGain:a.ScriptBladeburnerApiBaseRamCost,getActionCountRemaining:a.ScriptBladeburnerApiBaseRamCost,getActionMaxLevel:a.ScriptBladeburnerApiBaseRamCost,getActionCurrentLevel:a.ScriptBladeburnerApiBaseRamCost,getActionAutolevel:a.ScriptBladeburnerApiBaseRamCost,setActionAutolevel:a.ScriptBladeburnerApiBaseRamCost,setActionLevel:a.ScriptBladeburnerApiBaseRamCost,getRank:a.ScriptBladeburnerApiBaseRamCost,getSkillPoints:a.ScriptBladeburnerApiBaseRamCost,getSkillLevel:a.ScriptBladeburnerApiBaseRamCost,getSkillUpgradeCost:a.ScriptBladeburnerApiBaseRamCost,upgradeSkill:a.ScriptBladeburnerApiBaseRamCost,getTeamSize:a.ScriptBladeburnerApiBaseRamCost,setTeamSize:a.ScriptBladeburnerApiBaseRamCost,getCityEstimatedPopulation:a.ScriptBladeburnerApiBaseRamCost,getCityCommunities:a.ScriptBladeburnerApiBaseRamCost,getCityChaos:a.ScriptBladeburnerApiBaseRamCost,getCity:a.ScriptBladeburnerApiBaseRamCost,switchCity:a.ScriptBladeburnerApiBaseRamCost,getStamina:a.ScriptBladeburnerApiBaseRamCost,joinBladeburnerFaction:a.ScriptBladeburnerApiBaseRamCost,joinBladeburnerDivision:a.ScriptBladeburnerApiBaseRamCost,getBonusTime:0},c={getPossibleLocations:a.ScriptInfiltrationGetLocations,getInfiltration:a.ScriptInfiltrationGetInfiltrations},f={attempt:a.ScriptCodingContractBaseRamCost,getContractType:a.ScriptCodingContractBaseRamCost/2,getData:a.ScriptCodingContractBaseRamCost/2,getDescription:a.ScriptCodingContractBaseRamCost/2,getNumTriesRemaining:a.ScriptCodingContractBaseRamCost/5},u={getNumSleeves:a.ScriptSleeveBaseRamCost,setToShockRecovery:a.ScriptSleeveBaseRamCost,setToSynchronize:a.ScriptSleeveBaseRamCost,setToCommitCrime:a.ScriptSleeveBaseRamCost,setToUniversityCourse:a.ScriptSleeveBaseRamCost,travel:a.ScriptSleeveBaseRamCost,setToCompanyWork:a.ScriptSleeveBaseRamCost,setToFactionWork:a.ScriptSleeveBaseRamCost,setToGymWorkout:a.ScriptSleeveBaseRamCost,getSleeveStats:a.ScriptSleeveBaseRamCost,getTask:a.ScriptSleeveBaseRamCost,getInformation:a.ScriptSleeveBaseRamCost,getSleeveAugmentations:a.ScriptSleeveBaseRamCost,getSleevePurchasableAugs:a.ScriptSleeveBaseRamCost,purchaseSleeveAug:a.ScriptSleeveBaseRamCost,setToBladeburnerAction:a.ScriptSleeveBaseRamCost,getSleeveAugmentationPrice:a.ScriptSleeveBaseRamCost,getSleeveAugmentationRepReq:a.ScriptSleeveBaseRamCost},m={giftWidth:a.ScriptStanekWidth,giftHeight:a.ScriptStanekHeight,chargeFragment:a.ScriptStanekCharge,fragmentDefinitions:a.ScriptStanekFragmentDefinitions,activeFragments:a.ScriptStanekPlacedFragments,clearGift:a.ScriptStanekClear,canPlaceFragment:a.ScriptStanekCanPlace,placeFragment:a.ScriptStanekPlace,getFragment:a.ScriptStanekFragmentAt,removeFragment:a.ScriptStanekDeleteAt,acceptGift:a.ScriptStanekAcceptGift},h={args:void 0,enums:void 0,corporation:{getMaterialNames:0,getIndustryTypes:0,getUnlockables:0,getUpgradeNames:0,getResearchNames:0,createCorporation:0,hasUnlockUpgrade:0,getUnlockUpgradeCost:0,getUpgradeLevel:0,getUpgradeLevelCost:0,getExpandIndustryCost:0,getExpandCityCost:0,getInvestmentOffer:0,acceptInvestmentOffer:0,goPublic:0,bribe:0,getCorporation:0,getDivision:0,expandIndustry:0,expandCity:0,unlockUpgrade:0,levelUpgrade:0,issueDividends:0,buyBackShares:0,sellShares:0,getBonusTime:0,sellMaterial:0,sellProduct:0,discontinueProduct:0,setSmartSupply:0,setSmartSupplyUseLeftovers:0,buyMaterial:0,bulkPurchase:0,getWarehouse:0,getProduct:0,getMaterial:0,setMaterialMarketTA1:0,setMaterialMarketTA2:0,setProductMarketTA1:0,setProductMarketTA2:0,exportMaterial:0,cancelExportMaterial:0,purchaseWarehouse:0,upgradeWarehouse:0,makeProduct:0,limitMaterialProduction:0,limitProductProduction:0,getPurchaseWarehouseCost:0,getUpgradeWarehouseCost:0,hasWarehouse:0,assignJob:0,hireEmployee:0,upgradeOfficeSize:0,throwParty:0,buyCoffee:0,hireAdVert:0,research:0,getOffice:0,getEmployee:0,getHireAdVertCost:0,getHireAdVertCount:0,getResearchCost:0,hasResearched:0,setAutoJobAssignment:0,getOfficeSizeUpgradeCost:0},hacknet:{numNodes:0,purchaseNode:0,getPurchaseNodeCost:0,getNodeStats:0,upgradeLevel:0,upgradeRam:0,upgradeCore:0,upgradeCache:0,getLevelUpgradeCost:0,getRamUpgradeCost:0,getCoreUpgradeCost:0,getCacheUpgradeCost:0,numHashes:0,hashCost:0,spendHashes:0,maxNumNodes:0,hashCapacity:0,getHashUpgrades:0,getHashUpgradeLevel:0,getStudyMult:0,getTrainingMult:0},stock:i,singularity:o,...o,gang:s,bladeburner:l,infiltration:c,codingcontract:f,sleeve:u,stanek:m,ui:{getTheme:0,setTheme:0,resetTheme:0,getStyles:0,setStyles:0,resetStyles:0,getGameInfo:0,clearTerminal:0,windowSize:0},grafting:{getAugmentationGraftPrice:3.75,getAugmentationGraftTime:3.75,getGraftableAugmentations:5,graftAugmentation:7.5},sprintf:0,vsprintf:0,scan:a.ScriptScanRamCost,hack:a.ScriptHackRamCost,hackAnalyzeThreads:a.ScriptHackAnalyzeRamCost,hackAnalyze:a.ScriptHackAnalyzeRamCost,hackAnalyzeSecurity:a.ScriptHackAnalyzeRamCost,hackAnalyzeChance:a.ScriptHackAnalyzeRamCost,sleep:0,asleep:0,share:2.4,getSharePower:.2,grow:a.ScriptGrowRamCost,growthAnalyze:a.ScriptGrowthAnalyzeRamCost,growthAnalyzeSecurity:a.ScriptGrowthAnalyzeRamCost,weaken:a.ScriptWeakenRamCost,weakenAnalyze:a.ScriptWeakenAnalyzeRamCost,print:0,printf:0,tprint:0,tprintf:0,clearLog:0,disableLog:0,enableLog:0,isLogEnabled:0,getScriptLogs:0,nuke:a.ScriptPortProgramRamCost,brutessh:a.ScriptPortProgramRamCost,ftpcrack:a.ScriptPortProgramRamCost,relaysmtp:a.ScriptPortProgramRamCost,httpworm:a.ScriptPortProgramRamCost,sqlinject:a.ScriptPortProgramRamCost,run:a.ScriptRunRamCost,exec:a.ScriptExecRamCost,spawn:a.ScriptSpawnRamCost,kill:a.ScriptKillRamCost,killall:a.ScriptKillRamCost,exit:0,atExit:0,scp:a.ScriptScpRamCost,ls:a.ScriptScanRamCost,ps:a.ScriptScanRamCost,getRecentScripts:a.ScriptRecentScriptsRamCost,hasRootAccess:a.ScriptHasRootAccessRamCost,getHostname:a.ScriptGetHostnameRamCost,getHackingLevel:a.ScriptGetHackingLevelRamCost,getHackingMultipliers:a.ScriptGetMultipliersRamCost,getHacknetMultipliers:a.ScriptGetMultipliersRamCost,getBitNodeMultipliers:a.ScriptGetMultipliersRamCost,getServer:a.ScriptGetMultipliersRamCost/2,getServerMoneyAvailable:a.ScriptGetServerRamCost,getServerSecurityLevel:a.ScriptGetServerRamCost,getServerBaseSecurityLevel:a.ScriptGetServerRamCost,getServerMinSecurityLevel:a.ScriptGetServerRamCost,getServerRequiredHackingLevel:a.ScriptGetServerRamCost,getServerMaxMoney:a.ScriptGetServerRamCost,getServerGrowth:a.ScriptGetServerRamCost,getServerNumPortsRequired:a.ScriptGetServerRamCost,getServerRam:a.ScriptGetServerRamCost,getServerMaxRam:a.ScriptGetServerMaxRam,getServerUsedRam:a.ScriptGetServerUsedRam,serverExists:a.ScriptGetServerRamCost,fileExists:a.ScriptFileExistsRamCost,isRunning:a.ScriptIsRunningRamCost,getPurchasedServerLimit:a.ScriptGetPurchasedServerLimit,getPurchasedServerMaxRam:a.ScriptGetPurchasedServerMaxRam,getPurchasedServerCost:a.ScriptGetPurchaseServerRamCost,purchaseServer:a.ScriptPurchaseServerRamCost,deleteServer:a.ScriptPurchaseServerRamCost,getPurchasedServers:a.ScriptPurchaseServerRamCost,write:0,tryWritePort:0,read:0,peek:0,clear:0,writePort:0,readPort:0,getPortHandle:0,rm:a.ScriptReadWriteRamCost,scriptRunning:a.ScriptArbScriptRamCost,scriptKill:a.ScriptArbScriptRamCost,getScriptName:0,getScriptRam:a.ScriptGetScriptRamCost,getHackTime:a.ScriptGetHackTimeRamCost,getGrowTime:a.ScriptGetHackTimeRamCost,getWeakenTime:a.ScriptGetHackTimeRamCost,getTotalScriptIncome:a.ScriptGetScriptRamCost,getScriptIncome:a.ScriptGetScriptRamCost,getTotalScriptExpGain:a.ScriptGetScriptRamCost,getScriptExpGain:a.ScriptGetScriptRamCost,getRunningScript:a.ScriptGetRunningScriptRamCost,nFormat:0,tFormat:0,getTimeSinceLastAug:a.ScriptGetHackTimeRamCost,prompt:0,wget:0,getFavorToDonate:a.ScriptGetFavorToDonate,getPlayer:a.ScriptSingularityFn1RamCost/4,mv:0,tail:0,toast:0,moveTail:0,resizeTail:0,closeTail:0,clearPort:0,openDevMenu:0,alert:0,flags:0,exploit:0,bypass:0,alterReality:0,rainbow:0,heart:{break:0},formulas:{mockServer:0,mockPlayer:0,reputation:{calculateFavorToRep:0,calculateRepToFavor:0,repFromDonation:0},skills:{calculateSkill:0,calculateExp:0},hacking:{hackChance:0,hackExp:0,hackPercent:0,growPercent:0,hackTime:0,growTime:0,weakenTime:0},hacknetNodes:{moneyGainRate:0,levelUpgradeCost:0,ramUpgradeCost:0,coreUpgradeCost:0,hacknetNodeCost:0,constants:0},hacknetServers:{hashGainRate:0,levelUpgradeCost:0,ramUpgradeCost:0,coreUpgradeCost:0,cacheUpgradeCost:0,hashUpgradeCost:0,hacknetServerCost:0,constants:0},gang:{wantedPenalty:0,respectGain:0,wantedLevelGain:0,moneyGain:0,ascensionPointsGain:0,ascensionMultiplier:0},work:{crimeGains:0,classGains:0,factionGains:0}}},d=h;function p(t,...e){if(0===e.length)return console.warn("No arguments passed to getRamCost()"),0;let n=d[e[0]];for(let t=1;t{i[t.name]=new r.a(t.name,t.cost,t.upgType,t.mults)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return s})),n.d(e,"c",(function(){return l}));var a=n(22),r=n(13);function i(){return r.a.MarketData4SCost*a.a.FourSigmaMarketDataCost}function o(){return r.a.MarketDataTixApi4SCost*a.a.FourSigmaMarketDataApiCost}function s(){return r.a.WSEAccountCost}function l(){return r.a.TIXAPICost}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(88),r=n(0),i=n.n(r),o=n(7);function s(t){const e={...t,onChange:e=>{const n=o.a.parseMoney(e.target.value);""===e.target.value||isNaN(n)?t.onChange(NaN):t.onChange(n)}};return i.a.createElement(a.a,e)}},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1058),r=n(1059);const i={};for(const t of r.a)i[(o=t).name]=new a.a(o);var o},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1062),r=n(483);const i={};a.a.forEach(t=>{i[t.name]=new r.a(t.name,t.desc,t.isHacking,t.isCombat,t.params)})},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(205),r=n(185),i=n(15),o=n(277);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l{constructor(t={}){var e;s(this,"level",1),s(this,"sizeUsed",0),s(this,"smartSupplyEnabled",!1),s(this,"smartSupplyUseLeftovers",{}),s(this,"smartSupplyStore",0),this.loc=t.loc?t.loc:"",this.size=t.size?t.size:0,this.materials={Water:new a.a({name:"Water"}),Energy:new a.a({name:"Energy"}),Food:new a.a({name:"Food"}),Plants:new a.a({name:"Plants"}),Metal:new a.a({name:"Metal"}),Hardware:new a.a({name:"Hardware"}),Chemicals:new a.a({name:"Chemicals"}),Drugs:new a.a({name:"Drugs"}),Robots:new a.a({name:"Robots"}),AICores:new a.a({name:"AI Cores"}),RealEstate:new a.a({name:"Real Estate"})},this.smartSupplyUseLeftovers={Water:!0,Energy:!0,Food:!0,Plants:!0,Metal:!0,Hardware:!0,Chemicals:!0,Drugs:!0,Robots:!0,AICores:!0,RealEstate:!0},t.corp&&t.industry&&this.updateSize(t.corp,t.industry),null!==(e=t.corp)&&void 0!==e&&e.unlockUpgrades[1]&&(this.smartSupplyEnabled=!0)}updateMaterialSizeUsed(){this.sizeUsed=0;for(const t of Object.keys(this.materials)){const e=this.materials[t];r.a.hasOwnProperty(t)&&(this.sizeUsed+=e.qty*r.a[t])}this.sizeUsed>this.size&&console.warn("Warehouse size used greater than capacity, something went wrong")}updateSize(t,e){try{this.size=100*this.level*t.getStorageMultiplier()*e.getStorageMultiplier()}catch(t){Object(o.a)(t)}}toJSON(){return Object(i.b)("Warehouse",this)}static fromJSON(t){return Object(i.a)(l,t.data)}}i.c.constructors.Warehouse=l},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"c",(function(){return l})),n.d(e,"a",(function(){return c})),n.d(e,"d",(function(){return f}));var a=n(0),r=n.n(a),i=n(6),o=n(359);class s{constructor(t,e){i.a.TimestampsFormat&&(t="["+Object(o.a)(i.a.TimestampsFormat)+"] "+t),this.text=t,this.color=e}}class l{constructor(t){i.a.TimestampsFormat&&(t=r.a.createElement(r.a.Fragment,null,"[",Object(o.a)(i.a.TimestampsFormat),"] ",t)),this.raw=t}}class c{constructor(t,e){i.a.TimestampsFormat&&(t="["+Object(o.a)(i.a.TimestampsFormat)+"] "+t),this.hostname=e,this.dashes=t}}class f{constructor(t,e,n){this.time=t,this.timeLeft=t,this.action=e,this.server=n}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(22);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t={name:"foo",desc:"foo"}){if(r(this,"baseCost",1),r(this,"costInc",1),r(this,"maxLvl",0),r(this,"successChanceAll",0),r(this,"successChanceStealth",0),r(this,"successChanceKill",0),r(this,"successChanceContract",0),r(this,"successChanceOperation",0),r(this,"successChanceEstimate",0),r(this,"actionTime",0),r(this,"effHack",0),r(this,"effStr",0),r(this,"effDef",0),r(this,"effDex",0),r(this,"effAgi",0),r(this,"effCha",0),r(this,"stamina",0),r(this,"money",0),r(this,"expGain",0),!t.name)throw new Error("Failed to initialize Bladeburner Skill. No name was specified in ctor");if(!t.desc)throw new Error("Failed to initialize Bladeburner Skills. No desc was specified in ctor");this.name=t.name,this.desc=t.desc,this.baseCost=t.baseCost?t.baseCost:1,this.costInc=t.costInc?t.costInc:1,t.maxLvl&&(this.maxLvl=t.maxLvl),t.successChanceAll&&(this.successChanceAll=t.successChanceAll),t.successChanceStealth&&(this.successChanceStealth=t.successChanceStealth),t.successChanceKill&&(this.successChanceKill=t.successChanceKill),t.successChanceContract&&(this.successChanceContract=t.successChanceContract),t.successChanceOperation&&(this.successChanceOperation=t.successChanceOperation),t.successChanceEstimate&&(this.successChanceEstimate=t.successChanceEstimate),t.actionTime&&(this.actionTime=t.actionTime),t.effHack&&(this.effHack=t.effHack),t.effStr&&(this.effStr=t.effStr),t.effDef&&(this.effDef=t.effDef),t.effDex&&(this.effDex=t.effDex),t.effAgi&&(this.effAgi=t.effAgi),t.effCha&&(this.effCha=t.effCha),t.stamina&&(this.stamina=t.stamina),t.money&&(this.money=t.money),t.expGain&&(this.expGain=t.expGain)}calculateCost(t,e=1){const n=(t,e)=>{if(e<=1)return Math.floor((this.baseCost+t*this.costInc)*a.a.BladeburnerSkillCost);{const n=Math.floor((this.baseCost+t*this.costInc)*a.a.BladeburnerSkillCost);return this.calculateCost(t+1,e-1)+n}};if(e<0||e%1!=0)throw new Error(e+" is an invalid number of upgrades");if(e<=100)return n(t,e);{const n=e*(2*this.baseCost+this.costInc*(2*t+e+1))/2*a.a.BladeburnerSkillCost-e/2;return Math.floor(n)}}getMultiplier(t){return"successChanceAll"===t?this.successChanceAll:"successChanceStealth"===t?this.successChanceStealth:"successChanceKill"===t?this.successChanceKill:"successChanceContract"===t?this.successChanceContract:"successChanceOperation"===t?this.successChanceOperation:"successChanceEstimate"===t?this.successChanceEstimate:"actionTime"===t?this.actionTime:"effHack"===t?this.effHack:"effStr"===t?this.effStr:"effDef"===t?this.effDef:"effDex"===t?this.effDex:"effAgi"===t?this.effAgi:"effCha"===t?this.effCha:"stamina"===t?this.stamina:"money"===t?this.money:"expGain"===t?this.expGain:0}}},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n.n(a),i=n(39),o=n(9),s=n(3);function l(t){return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,null,t.confirmationText),r.a.createElement(o.a,{onClick:()=>{t.onConfirm()}},"Confirm"),t.additionalButton&&r.a.createElement(r.a.Fragment,null,t.additionalButton)))}},function(t,e,n){"use strict";function a(t){const e=Object.assign({},{progress:0,totalTicks:20},t);e.progress=Math.max(Math.min(e.progress,1),0);const n=Math.max(Math.floor(e.progress/(1/e.totalTicks)),1),a=Math.max(e.totalTicks-n,0);return`[${"|".repeat(n)}${"-".repeat(a)}]`}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";function a(){try{return"87054f61"}catch(t){}return"DEV"}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(165),r=n(22),i=n(13),o=n(55),s=n(24),l=n(382);const c=1e3/i.a._idleSpeed;function f(t,e){const n=l.a.find(t=>t.specialName===e.name),a=Object(s.d)(n?n.hostname:"").backdoorInstalled?.9:1;return t.earnings.money*e.costMult*a}function u(t,e,n,i){const s=t.hashManager,l=o.c[n],u=a.a[i],m=[o.a.GymAgility,o.a.GymDefense,o.a.GymStrength,o.a.GymDexterity].includes(n)?s.getTrainingMult():s.getStudyMult(),h=f(l,u)/c,d=l.earnings.hackExp*u.expMult/c*m,p=l.earnings.strExp*u.expMult/c*m,g=l.earnings.defExp*u.expMult/c*m,y=l.earnings.dexExp*u.expMult/c*m,b=l.earnings.agiExp*u.expMult/c*m,E=l.earnings.chaExp*u.expMult/c*m;return{money:h,reputation:0,hackExp:d*e.mults.hacking_exp*r.a.ClassGymExpGain,strExp:p*e.mults.strength_exp*r.a.ClassGymExpGain,defExp:g*e.mults.defense_exp*r.a.ClassGymExpGain,dexExp:y*e.mults.dexterity_exp*r.a.ClassGymExpGain,agiExp:b*e.mults.agility_exp*r.a.ClassGymExpGain,chaExp:E*e.mults.charisma_exp*r.a.ClassGymExpGain,intExp:0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(547),r=n(15),i=n(548);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}let s=0;class l{constructor(t=null,e="",n="",a="",r=[]){o(this,"code",""),o(this,"filename",""),o(this,"url",""),o(this,"module",null),o(this,"dependencies",[]),o(this,"dependents",[]),o(this,"ramUsage",0),o(this,"queueCompile",!1),o(this,"server",""),this.filename=e,this.code=n,this.server=a,this.moduleSequenceNumber=++s,""!==this.code&&null!==t&&this.updateRamUsage(t,r)}download(){const t=this.filename,e=new Blob([this.code],{type:"text/plain"}),n=document.createElement("a"),a=URL.createObjectURL(e);n.href=a,n.download=t,document.body.appendChild(n),n.click(),setTimeout((function(){document.body.removeChild(n),window.URL.revokeObjectURL(a)}),0)}markUpdated(){this.module=null,this.moduleSequenceNumber=++s}saveScript(t,e,n,a,r){this.code=l.formatCode(n),this.filename=e,this.server=a,this.updateRamUsage(t,r),this.markUpdated();for(const t of this.dependents){const[e]=r.filter(e=>e.filename===t.filename&&e.server==t.server);null==e||e.markUpdated()}}updateRamUsage(t,e){const n=Object(a.a)(t,this.code,e);n.cost>0&&(this.ramUsage=Object(i.a)(n.cost),this.ramUsageEntries=n.entries),this.markUpdated()}imports(){return[]}toJSON(){return Object(r.b)("Script",this)}static fromJSON(t){const e=Object(r.a)(l,t.data);return e.url="",e.dependents=[],e}static formatCode(t){return t.replace(/^\s+|\s+$/g,"")}}r.c.constructors.Script=l},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(76),o=n(162),s=n(161),l=n(49),c=n(3);function f({rows:t,title:e,wide:n}){const a=n?s.a:i.a;return r.a.createElement(r.a.Fragment,null,e&&r.a.createElement(c.a,null,e),r.a.createElement(a,{size:"small",padding:"none"},r.a.createElement(o.a,null,t.map((t,e)=>r.a.createElement(l.a,{key:e},t.map((t,e)=>r.a.createElement(i.b,{key:e,align:0!==e?"right":"left"},r.a.createElement(c.a,{noWrap:!0},t))))))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(317),r=n(63);const i={BruteSSHProgram:new a.a(r.a.BruteSSHProgram.name,5e5,"Opens up SSH Ports."),FTPCrackProgram:new a.a(r.a.FTPCrackProgram.name,15e5,"Opens up FTP Ports."),RelaySMTPProgram:new a.a(r.a.RelaySMTPProgram.name,5e6,"Opens up SMTP Ports."),HTTPWormProgram:new a.a(r.a.HTTPWormProgram.name,3e7,"Opens up HTTP Ports."),SQLInjectProgram:new a.a(r.a.SQLInjectProgram.name,25e7,"Opens up SQL Ports."),ServerProfiler:new a.a(r.a.ServerProfiler.name,5e5,"Displays detailed information about a server."),DeepscanV1:new a.a(r.a.DeepscanV1.name,5e5,"Enables 'scan-analyze' with a depth up to 5."),DeepscanV2:new a.a(r.a.DeepscanV2.name,25e6,"Enables 'scan-analyze' with a depth up to 10."),AutolinkProgram:new a.a(r.a.AutoLink.name,1e6,"Enables direct connect via 'scan-analyze'."),FormulasProgram:new a.a(r.a.Formulas.name,5e9,"Unlock access to the formulas API.")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(482);const r={},i=["Training","Field Analysis","Recruitment","Diplomacy","Hyperbolic Regeneration Chamber","Incite Violence"];for(const t of i)r[t]=new a.a({name:t})},function(t,e,n){"use strict";let a;n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r})),function(t){t.Clubs="clubs",t.Diamonds="diamonds",t.Hearts="hearts",t.Spades="spades"}(a||(a={}));class r{constructor(t,e){if(this.value=t,this.suit=e,t<1||t>13)throw new Error("Card instantiated with improper value: "+t)}formatValue(){switch(this.value){case 1:return"A";case 11:return"J";case 12:return"Q";case 13:return"K";default:return""+this.value}}isRedSuit(){return this.suit===a.Hearts||this.suit===a.Diamonds}getStringRepresentation(){return`${this.formatValue()} of ${this.suit}`}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(15);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t={}){r(this,"name",""),r(this,"type",-1),t.name&&(this.name=t.name),t.type&&(this.type=t.type)}toJSON(){return Object(a.b)("ActionIdentifier",this)}static fromJSON(t){return Object(a.a)(i,t.data)}}a.c.constructors.ActionIdentifier=i},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(152);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(t,e){r(this,"lvl",1),r(this,"owned",!1);const n="BitNode"+t,i=a.a[n];if(null==i)throw new Error("Invalid Bit Node for this Source File");this.n=t,this.name=`Source-File ${t}: ${i.name}`,this.info=e}}},,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return f})),n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return m}));var a=n(13),r=n(1),i=n(45),o=n(140),s=n(24),l=n(7),c=n(426);function f(t){const e=((new Date).getTime()-r.a.lastUpdate)/1e3;let n=t.onlineRunningTime/14400;n>=1&&(n=1);for(const n of Object.keys(t.dataMap))if(t.dataMap.hasOwnProperty(n)){if(0==t.dataMap[n][2]||null==t.dataMap[n][2])continue;const a=Object(s.d)(n);if(null==a)continue;const c=Math.round(.5*t.dataMap[n][2]/t.onlineRunningTime*e);t.log(`Called on ${a.hostname} ${c} times while offline`);const f=Object(s.d)(t.server);if(null===f)throw new Error("getServer of null key?");if(!(a instanceof i.a))throw new Error("trying to grow a non-normal server");const u=Object(o.f)(a,c,r.a,f.cpuCores);t.log(`'${a.hostname}' grown by ${l.a.format(100*u-100,"0.000000%")} while offline`)}const c=n*(t.onlineExpGained/t.onlineRunningTime)*e;r.a.gainHackingExp(c),t.offlineRunningTime+=e,t.offlineExpGained+=c;for(const n of Object.keys(t.dataMap))if(t.dataMap.hasOwnProperty(n)){if(0==t.dataMap[n][3]||null==t.dataMap[n][3])continue;const r=Object(s.d)(n);if(null==r)continue;if(!(r instanceof i.a))throw new Error("trying to weaken a non-normal server");const o=Object(s.d)(t.server);if(null===o)throw new Error("getServer of null key?");const l=Math.round(.5*t.dataMap[n][3]/t.onlineRunningTime*e);t.log(`Called weaken() on ${r.hostname} ${l} times while offline`);const c=1+(o.cpuCores-1)/16;r.weaken(a.a.ServerWeakenAmount*l*c)}}function u(t,e,n){for(let a=0;anull!==t&&t.type===r.b.COMPANY;class f extends r.a{constructor(t){var e;super(r.b.COMPANY),this.companyName=null!==(e=null==t?void 0:t.companyName)&&void 0!==e?e:i.a.NewTokyoNoodleBar}getCompany(){const t=o.a[this.companyName];if(!t)throw new Error(`Company not found: '${this.companyName}'`);return t}getGainRates(t,e){return Object(s.a)(t,e,this.getCompany())}process(t,e,n){const a=this.getCompany(),i=this.getGainRates(t,e);return Object(r.c)(t,e,i,n),a.playerReputation+=i.reputation*n,Object(l.a)(a,i.reputation,n),0}APICopy(){return{type:this.type,companyName:this.companyName}}toJSON(){return Object(a.b)("SleeveCompanyWork",this)}static fromJSON(t){return Object(a.a)(f,t.data)}}a.c.constructors.SleeveCompanyWork=f},function(t,e,n){"use strict";n.d(e,"a",(function(){return N})),n.d(e,"b",(function(){return P}));var a=n(12),r=n(143),i=n(234),o=n(13),s=n(51),l=n(111),c=n(29),f=n(81),u=n(191),m=n(41),h=n(56),d=n(229),p=n(94),g=n(17),y=n(1),b=n(63),E=n(24),v=n(89),k=n(45),w=n(91),S=n(27),_=n(1171),C=n(5),x=n(59),L=n(55),O=n(22);const M=_.a;function A(){const t=Object(E.d)(v.a.WorldDaemon);return t instanceof k.a&&(!!t.backdoorInstalled||null!==y.a.bladeburner&&y.a.bladeburner.blackops.hasOwnProperty(x.a.OperationDaedalus))}function T(t,e){return t.bitNodeN===e||t.sourceFiles.some(t=>t.n===e)}function R(t){return t.sourceFiles.some(t=>1===t.n)}const N={[C.a.CyberSec.toUpperCase()]:{...M[C.a.CyberSec.toUpperCase()],Icon:"CSEC",Condition:()=>y.a.factions.includes(C.a.CyberSec)},[C.a.NiteSec.toUpperCase()]:{...M[C.a.NiteSec.toUpperCase()],Icon:C.a.NiteSec,Condition:()=>y.a.factions.includes(C.a.NiteSec)},THE_BLACK_HAND:{...M.THE_BLACK_HAND,Icon:"TBH",Condition:()=>y.a.factions.includes(C.a.TheBlackHand)},[C.a.BitRunners.toUpperCase()]:{...M[C.a.BitRunners.toUpperCase()],Icon:C.a.BitRunners.toLowerCase(),Condition:()=>y.a.factions.includes(C.a.BitRunners)},[C.a.Daedalus.toUpperCase()]:{...M[C.a.Daedalus.toUpperCase()],Icon:C.a.Daedalus.toLowerCase(),Condition:()=>y.a.factions.includes(C.a.Daedalus)},THE_COVENANT:{...M.THE_COVENANT,Icon:C.a.TheCovenant.toLowerCase().replace(/ /g,""),Condition:()=>y.a.factions.includes(C.a.TheCovenant)},[C.a.Illuminati.toUpperCase()]:{...M[C.a.Illuminati.toUpperCase()],Icon:C.a.Illuminati.toLowerCase(),Condition:()=>y.a.factions.includes(C.a.Illuminati)},"BRUTESSH.EXE":{...M["BRUTESSH.EXE"],Icon:"p0",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.BruteSSHProgram.name)},"FTPCRACK.EXE":{...M["FTPCRACK.EXE"],Icon:"p1",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.FTPCrackProgram.name)},"RELAYSMTP.EXE":{...M["RELAYSMTP.EXE"],Icon:"p2",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.RelaySMTPProgram.name)},"HTTPWORM.EXE":{...M["HTTPWORM.EXE"],Icon:"p3",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.HTTPWormProgram.name)},"SQLINJECT.EXE":{...M["SQLINJECT.EXE"],Icon:"p4",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.SQLInjectProgram.name)},"FORMULAS.EXE":{...M["FORMULAS.EXE"],Icon:"formulas",Condition:()=>y.a.getHomeComputer().programs.includes(b.a.Formulas.name)},"SF1.1":{...M["SF1.1"],Icon:"SF1.1",Visible:()=>T(y.a,1),Condition:()=>y.a.sourceFileLvl(1)>=1},"SF2.1":{...M["SF2.1"],Icon:"SF2.1",Visible:()=>T(y.a,2),Condition:()=>y.a.sourceFileLvl(2)>=1},"SF3.1":{...M["SF3.1"],Icon:"SF3.1",Visible:()=>T(y.a,3),Condition:()=>y.a.sourceFileLvl(3)>=1},"SF4.1":{...M["SF4.1"],Icon:"SF4.1",Visible:()=>T(y.a,4),Condition:()=>y.a.sourceFileLvl(4)>=1},"SF5.1":{...M["SF5.1"],Icon:"SF5.1",Visible:()=>T(y.a,5),Condition:()=>y.a.sourceFileLvl(5)>=1},"SF6.1":{...M["SF6.1"],Icon:"SF6.1",Visible:()=>T(y.a,6),Condition:()=>y.a.sourceFileLvl(6)>=1},"SF7.1":{...M["SF7.1"],Icon:"SF7.1",Visible:()=>T(y.a,7),Condition:()=>y.a.sourceFileLvl(7)>=1},"SF8.1":{...M["SF8.1"],Icon:"SF8.1",Visible:()=>T(y.a,8),Condition:()=>y.a.sourceFileLvl(8)>=1},"SF9.1":{...M["SF9.1"],Icon:"SF9.1",Visible:()=>T(y.a,9),Condition:()=>y.a.sourceFileLvl(9)>=1},"SF10.1":{...M["SF10.1"],Icon:"SF10.1",Visible:()=>T(y.a,10),Condition:()=>y.a.sourceFileLvl(10)>=1},"SF11.1":{...M["SF11.1"],Icon:"SF11.1",Visible:()=>T(y.a,11),Condition:()=>y.a.sourceFileLvl(11)>=1},"SF12.1":{...M["SF12.1"],Icon:"SF12.1",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=1},MONEY_1Q:{...M.MONEY_1Q,Icon:"$1Q",Condition:()=>y.a.money>=1e18},MONEY_M1B:{...M.MONEY_M1B,Icon:"-1b",Secret:!0,Condition:()=>y.a.money<=-1e9},INSTALL_1:{...M.INSTALL_1,Icon:"install",Condition:()=>y.a.augmentations.length>=1},INSTALL_100:{...M.INSTALL_100,Icon:"install_100",Condition:()=>y.a.augmentations.length>=100},QUEUE_40:{...M.QUEUE_40,Icon:"queue40",Condition:()=>y.a.queuedAugmentations.length>=40},HACKING_100000:{...M.HACKING_100000,Icon:"hack100000",Condition:()=>y.a.skills.hacking>=1e5},COMBAT_3000:{...M.COMBAT_3000,Icon:"combat3000",Condition:()=>y.a.skills.strength>=3e3&&y.a.skills.defense>=3e3&&y.a.skills.dexterity>=3e3&&y.a.skills.agility>=3e3},NEUROFLUX_255:{...M.NEUROFLUX_255,Icon:"nf255",Condition:()=>y.a.augmentations.some(t=>t.name===a.a.NeuroFluxGovernor&&t.level>=255)},NS2:{...M.NS2,Icon:"ns2",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.filename.endsWith(".js"))},FROZE:{...M.FROZE,Icon:"forze",Condition:()=>location.href.includes("noScripts")},RUNNING_SCRIPTS_1000:{...M.RUNNING_SCRIPTS_1000,Icon:"run1000",Condition:()=>{let t=0;for(const e of Object(E.c)())t+=e.runningScripts.length;return t>=1e3}},DRAIN_SERVER:{...M.DRAIN_SERVER,Icon:"drain",Condition:()=>{for(const t of Object(E.c)())if(t instanceof k.a&&t.moneyMax>0&&0===t.moneyAvailable)return!0;return!1}},MAX_RAM:{...M.MAX_RAM,Icon:"maxram",Condition:()=>y.a.getHomeComputer().maxRam===o.a.HomeComputerMaxRam},MAX_CORES:{...M.MAX_CORES,Icon:"maxcores",Condition:()=>8===y.a.getHomeComputer().cpuCores},SCRIPTS_30:{...M.SCRIPTS_30,Icon:"folders",Condition:()=>y.a.getHomeComputer().scripts.length>=30},KARMA_1000000:{...M.KARMA_1000000,Icon:"karma",Secret:!0,Condition:()=>y.a.karma<=-1e6},STOCK_1q:{...M.STOCK_1q,Icon:"$1Q",Condition:()=>y.a.moneySourceB.stock>=1e15},DISCOUNT:{...M.DISCOUNT,Icon:"discount",Condition:()=>{const t=Object(E.d)("powerhouse-fitness");return t instanceof k.a&&t.backdoorInstalled}},SCRIPT_32GB:{...M.SCRIPT_32GB,Icon:"bigcost",Condition:()=>y.a.getHomeComputer().scripts.some(t=>t.ramUsage>=32)},FIRST_HACKNET_NODE:{...M.FIRST_HACKNET_NODE,Icon:"node",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>0},"30_HACKNET_NODE":{...M["30_HACKNET_NODE"],Icon:"hacknet-all",Condition:()=>!Object(h.g)(y.a)&&y.a.hacknetNodes.length>=30},MAX_HACKNET_NODE:{...M.MAX_HACKNET_NODE,Icon:"hacknet-max",Condition:()=>{if(Object(h.g)(y.a))return!1;for(const t of y.a.hacknetNodes){if(!(t instanceof d.a))return!1;if(t.ram===m.a.MaxRam&&t.cores===m.a.MaxCores&&t.level===m.a.MaxLevel)return!0}return!1}},HACKNET_NODE_10M:{...M.HACKNET_NODE_10M,Icon:"hacknet-10m",Condition:()=>!Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e7},REPUTATION_10M:{...M.REPUTATION_10M,Icon:"reputation",Condition:()=>Object.values(c.a).some(t=>t.playerReputation>=1e7)},DONATION:{...M.DONATION,Icon:"donation",Condition:()=>Object.values(c.a).some(t=>t.favor>=Math.floor(o.a.BaseFavorToDonate*O.a.RepToDonateToFaction))},TRAVEL:{...M.TRAVEL,Icon:"TRAVEL",Condition:()=>y.a.city!==g.a.Sector12},WORKOUT:{...M.WORKOUT,Icon:"WORKOUT",Condition:()=>Object(L.d)(y.a.currentWork)},TOR:{...M.TOR,Icon:"TOR",Condition:()=>y.a.hasTorRouter()},HOSPITALIZED:{...M.HOSPITALIZED,Icon:"OUCH",Condition:()=>0!==y.a.moneySourceB.hospitalization},GANG:{...M.GANG,Icon:"GANG",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang},FULL_GANG:{...M.FULL_GANG,Icon:"GANGMAX",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&y.a.gang.members.length===u.a.MaximumGangMembers},GANG_TERRITORY:{...M.GANG_TERRITORY,Icon:"GANG100%",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&f.a[y.a.gang.facName].territory>=.999},GANG_MEMBER_POWER:{...M.GANG_MEMBER_POWER,Icon:"GANG10000",Visible:()=>T(y.a,2),Condition:()=>null!==y.a.gang&&y.a.gang.members.some(t=>t.hack>=1e4||t.str>=1e4||t.def>=1e4||t.dex>=1e4||t.agi>=1e4||t.cha>=1e4)},CORPORATION:{...M.CORPORATION,Icon:"CORP",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation},CORPORATION_BRIBE:{...M.CORPORATION_BRIBE,Icon:"CORPLOBBY",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&1===y.a.corporation.unlockUpgrades[6]},CORPORATION_PROD_1000:{...M.CORPORATION_PROD_1000,Icon:"CORP1000",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&y.a.corporation.divisions.some(t=>t.prodMult>=1e3)},CORPORATION_EMPLOYEE_3000:{...M.CORPORATION_EMPLOYEE_3000,Icon:"CORPCITY",Visible:()=>T(y.a,3),Condition:()=>{if(null===y.a.corporation)return!1;for(const t of y.a.corporation.divisions)for(const e of Object.values(t.offices))if(0!==e&&e.employees.length>=3e3)return!0;return!1}},CORPORATION_REAL_ESTATE:{...M.CORPORATION_REAL_ESTATE,Icon:"CORPRE",Name:"Own the land",Description:"Expand to the Real Estate division.",Visible:()=>T(y.a,3),Condition:()=>null!==y.a.corporation&&y.a.corporation.divisions.some(t=>t.type===s.a.RealEstate)},INTELLIGENCE_255:{...M.INTELLIGENCE_255,Icon:"INT255",Visible:()=>T(y.a,5),Condition:()=>y.a.skills.intelligence>=255},BLADEBURNER_DIVISION:{...M.BLADEBURNER_DIVISION,Icon:"BLADE",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner},BLADEBURNER_OVERCLOCK:{...M.BLADEBURNER_OVERCLOCK,Icon:"BLADEOVERCLOCK",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner&&y.a.bladeburner.skills[r.a.Overclock]===i.a[r.a.Overclock].maxLvl},BLADEBURNER_UNSPENT_100000:{...M.BLADEBURNER_UNSPENT_100000,Icon:"BLADE100K",Visible:()=>T(y.a,6),Condition:()=>null!==y.a.bladeburner&&y.a.bladeburner.skillPoints>=1e5},"4S":{...M["4S"],Icon:"4S",Condition:()=>y.a.has4SData},FIRST_HACKNET_SERVER:{...M.FIRST_HACKNET_SERVER,Icon:"HASHNET",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length>0,AdditionalUnlock:[M.FIRST_HACKNET_NODE.ID]},ALL_HACKNET_SERVER:{...M.ALL_HACKNET_SERVER,Icon:"HASHNETALL",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hacknetNodes.length===m.b.MaxServers,AdditionalUnlock:[M["30_HACKNET_NODE"].ID]},MAX_HACKNET_SERVER:{...M.MAX_HACKNET_SERVER,Icon:"HASHNETALL",Visible:()=>T(y.a,9),Condition:()=>{if(!Object(h.g)(y.a))return!1;for(const t of y.a.hacknetNodes){if("string"!=typeof t)return!1;const e=Object(E.d)(t);if(!(e instanceof p.a))return!1;if(e.maxRam===m.b.MaxRam&&e.cores===m.b.MaxCores&&e.level===m.b.MaxLevel&&e.cache===m.b.MaxCache)return!0}return!1},AdditionalUnlock:[M.MAX_HACKNET_NODE.ID]},HACKNET_SERVER_1B:{...M.HACKNET_SERVER_1B,Icon:"HASHNETMONEY",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.moneySourceB.hacknet>=1e9,AdditionalUnlock:[M.HACKNET_NODE_10M.ID]},MAX_CACHE:{...M.MAX_CACHE,Icon:"HASHNETCAP",Visible:()=>T(y.a,9),Condition:()=>Object(h.g)(y.a)&&y.a.hashManager.hashes===y.a.hashManager.capacity&&y.a.hashManager.capacity>0},SLEEVE_8:{...M.SLEEVE_8,Icon:"SLEEVE8",Visible:()=>T(y.a,10),Condition:()=>8===y.a.sleeves.length&&3===y.a.sourceFileLvl(10)},INDECISIVE:{...M.INDECISIVE,Icon:"1H",Visible:()=>R(y.a),Condition:function(){let t=0;return setInterval(()=>{w.b.page()===S.a.BitVerse?t++:t=0},6e4),()=>t>60}()},FAST_BN:{...M.FAST_BN,Icon:"2DAYS",Visible:()=>R(y.a),Condition:()=>A()&&y.a.playtimeSinceLastBitnode<1728e5},CHALLENGE_BN1:{...M.CHALLENGE_BN1,Icon:"BN1+",Visible:()=>R(y.a),Condition:()=>1===y.a.bitNodeN&&A()&&y.a.getHomeComputer().maxRam<=128&&1===y.a.getHomeComputer().cpuCores},CHALLENGE_BN2:{...M.CHALLENGE_BN2,Icon:"BN2+",Visible:()=>T(y.a,2),Condition:()=>2===y.a.bitNodeN&&A()&&null===y.a.gang},CHALLENGE_BN3:{...M.CHALLENGE_BN3,Icon:"BN3+",Visible:()=>T(y.a,3),Condition:()=>3===y.a.bitNodeN&&A()&&null===y.a.corporation},CHALLENGE_BN6:{...M.CHALLENGE_BN6,Icon:"BN6+",Visible:()=>T(y.a,6),Condition:()=>6===y.a.bitNodeN&&A()&&null===y.a.bladeburner},CHALLENGE_BN7:{...M.CHALLENGE_BN7,Icon:"BN7+",Visible:()=>T(y.a,7),Condition:()=>7===y.a.bitNodeN&&A()&&null===y.a.bladeburner},CHALLENGE_BN8:{...M.CHALLENGE_BN8,Icon:"BN8+",Visible:()=>T(y.a,8),Condition:()=>8===y.a.bitNodeN&&A()&&!y.a.has4SData&&!y.a.has4SDataTixApi},CHALLENGE_BN9:{...M.CHALLENGE_BN9,Icon:"BN9+",Visible:()=>T(y.a,9),Condition:()=>9===y.a.bitNodeN&&A()&&0===y.a.moneySourceB.hacknet&&0===y.a.moneySourceB.hacknet_expenses},CHALLENGE_BN10:{...M.CHALLENGE_BN10,Icon:"BN10+",Visible:()=>T(y.a,10),Condition:()=>10===y.a.bitNodeN&&A()&&!y.a.sleeves.some(t=>t.augmentations.length>0||t.exp.hacking>0||t.exp.strength>0||t.exp.defense>0||t.exp.agility>0||t.exp.dexterity>0||t.exp.charisma>0)},CHALLENGE_BN12:{...M.CHALLENGE_BN12,Icon:"BN12+",Visible:()=>T(y.a,12),Condition:()=>y.a.sourceFileLvl(12)>=50},BYPASS:{...M.BYPASS,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Bypass)},PROTOTYPETAMPERING:{...M.PROTOTYPETAMPERING,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.PrototypeTampering)},UNCLICKABLE:{...M.UNCLICKABLE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.Unclickable)},UNDOCUMENTEDFUNCTIONCALL:{...M.UNDOCUMENTEDFUNCTIONCALL,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.UndocumentedFunctionCall)},TIMECOMPRESSION:{...M.TIMECOMPRESSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TimeCompression)},REALITYALTERATION:{...M.REALITYALTERATION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.RealityAlteration)},N00DLES:{...M.N00DLES,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.N00dles)},EDITSAVEFILE:{...M.EDITSAVEFILE,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.EditSaveFile)},UNACHIEVABLE:{...M.UNACHIEVABLE,Icon:"SF-1",Secret:!0,Condition:()=>!1},CHALLENGE_BN13:{...M.CHALLENGE_BN13,Icon:"BN13+",Visible:()=>T(y.a,13),Condition:()=>13===y.a.bitNodeN&&A()&&!y.a.augmentations.some(t=>t.name===a.a.StaneksGift1)},DEVMENU:{...M.DEVMENU,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.YoureNotMeantToAccessThis)},RAINBOW:{...M.RAINBOW,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.INeedARainbow)},TRUE_RECURSION:{...M.TRUE_RECURSION,Icon:"SF-1",Secret:!0,Condition:()=>y.a.exploits.includes(l.a.TrueRecursion)}};function P(){const t=y.a.achievements.map(t=>t.ID),e=Object.values(N).filter(e=>!t.includes(e.ID)&&e.Condition()).flatMap(t=>[t.ID,...t.AdditionalUnlock||[]]);for(const t of e)y.a.giveAchievement(t);document.achievements=[...y.a.achievements.map(t=>t.ID)]}},,function(t,e,n){"use strict";function a(t,e=1){return 1+e*Math.pow(t,.8)/600}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(384),r=n(32),i=n(360),o=n(15);const s={name:"",info:"",companyPositions:{},expMultiplier:1,salaryMultiplier:1,jobStatReqOffset:0};class l{constructor(t=s){this.name=t.name,this.info=t.info,this.companyPositions=t.companyPositions,this.expMultiplier=t.expMultiplier,this.salaryMultiplier=t.salaryMultiplier,this.jobStatReqOffset=t.jobStatReqOffset,this.isPlayerEmployed=!1,this.playerReputation=1,this.favor=0,this.isMegacorp=!1,t.isMegacorp&&(this.isMegacorp=!0)}hasPosition(t){return t instanceof a.a?null!=this.companyPositions[t.name]:null!=this.companyPositions[t]}hasAgentPositions(){return null!=this.companyPositions[r.a[0]]}hasBusinessConsultantPositions(){return null!=this.companyPositions[r.c[0]]}hasBusinessPositions(){return null!=this.companyPositions[r.b[0]]}hasEmployeePositions(){return null!=this.companyPositions[r.e[1]]}hasITPositions(){return null!=this.companyPositions[r.d[0]]}hasSecurityPositions(){return null!=this.companyPositions[r.h[2]]}hasSoftwareConsultantPositions(){return null!=this.companyPositions[r.k[0]]}hasSoftwarePositions(){return null!=this.companyPositions[r.j[0]]}hasWaiterPositions(){return null!=this.companyPositions[r.e[0]]}gainFavor(){null==this.favor&&(this.favor=0),this.favor+=this.getFavorGain()}getFavorGain(){null==this.favor&&(this.favor=0);const t=Math.max(0,Object(i.a)(this.favor))+this.playerReputation;return Object(i.b)(t)-this.favor}toJSON(){return Object(o.b)("Company",this)}static fromJSON(t){return Object(o.a)(l,t.data)}}o.c.constructors.Company=l},function(t,e,n){"use strict";function a(t){const e=[];for(let n=0;n
Filename: "+n+"

Line Number: "+r+"

This is a bug, please report to game developer with this message as well as details about how to reproduce the bug.

If you want to be safe, I suggest refreshing the game WITHOUT saving so that your save doesn't get corrupted")}},function(t,e,n){"use strict";n.d(e,"b",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(15),r=n(103),i=n(13),o=n(626);const s=t=>null!==t&&t.type===r.b.BLADEBURNER;class l extends r.a{constructor(t){var e,n,a,i,o;super(r.b.BLADEBURNER),o=0,(i="cyclesWorked")in(a=this)?Object.defineProperty(a,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):a[i]=o,this.actionType=null!==(e=null==t?void 0:t.type)&&void 0!==e?e:"General",this.actionName=null!==(n=null==t?void 0:t.name)&&void 0!==n?n:"Field analysis"}cyclesNeeded(t,e){var n;const a=null===(n=t.bladeburner)||void 0===n?void 0:n.getActionTimeNetscriptFn(e,this.actionType,this.actionName);if(!a||"string"==typeof a)throw new Error(`Error querying ${this.actionName} time`);return a/i.a._idleSpeed}process(t,e,n){if(!t.bladeburner)throw new Error("sleeve doing blade work without being a member");this.cyclesWorked+=n;const a=t.bladeburner.getActionIdFromTypeAndName(this.actionType,this.actionName);if(!a)throw new Error(`Error getting ${this.actionName} action`);if("Contracts"===this.actionType){const n=t.bladeburner.getActionObject(a);if(!n)throw new Error(`Error getting ${this.actionName} action object`);if(n.count<=0)return e.stopWork(t),0}for(;this.cyclesWorked>this.cyclesNeeded(t,e);){if("Contracts"===this.actionType){const n=t.bladeburner.getActionObject(a);if(!n)throw new Error(`Error getting ${this.actionName} action object`);if(n.count<=0)return e.stopWork(t),0}const n=t.bladeburner.completeAction(t,e,a,!1);let s;if("General"===this.actionType){var i;if(s=null===(i=o.a[this.actionName])||void 0===i?void 0:i.exp,!s)throw new Error(`Somehow there was no exp for action ${this.actionType} ${this.actionName}`);Object(r.c)(t,e,s,1)}t.gainMoney(n.money,"sleeves"),t.gainStats(n),this.cyclesWorked-=this.cyclesNeeded(t,e)}return 0}APICopy(){return{actionType:this.actionType,actionName:this.actionName}}toJSON(){return Object(a.b)("SleeveBladeburnerWork",this)}static fromJSON(t){return Object(a.a)(l,t.data)}}a.c.constructors.SleeveBladeburnerWork=l},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),n.d(e,"b",(function(){return r})),function(t){t[t.Export=0]="Export",t[t.SmartSupply=1]="SmartSupply",t[t.MarketResearchDemand=2]="MarketResearchDemand",t[t.MarketDataCompetition=3]="MarketDataCompetition",t[t.VeChain=4]="VeChain",t[t.ShadyAccounting=5]="ShadyAccounting",t[t.GovernmentPartnership=6]="GovernmentPartnership",t[t.WarehouseAPI=7]="WarehouseAPI",t[t.OfficeAPI=8]="OfficeAPI"}(a||(a={}));const r={[a.Export]:{index:0,price:2e10,name:"Export",desc:"Develop infrastructure to export your materials to your other facilities. This allows you to move materials around between different divisions and cities."},[a.SmartSupply]:{index:1,price:25e9,name:"Smart Supply",desc:"Use advanced AI to anticipate your supply needs. This allows you to purchase exactly however many materials you need for production."},[a.MarketResearchDemand]:{index:2,price:5e9,name:"Market Research - Demand",desc:"Mine and analyze market data to determine the demand of all resources. The demand attribute, which affects sales, will be displayed for every material and product."},[a.MarketDataCompetition]:{index:3,price:5e9,name:"Market Data - Competition",desc:"Mine and analyze market data to determine how much competition there is on the market for all resources. The competition attribute, which affects sales, will be displayed for every material and product."},[a.VeChain]:{index:4,price:1e10,name:"VeChain",desc:"Use AI and blockchain technology to identify where you can improve your supply chain systems. This upgrade will allow you to view a wide array of useful statistics about your Corporation."},[a.ShadyAccounting]:{index:5,price:5e14,name:"Shady Accounting",desc:"Utilize unscrupulous accounting practices and pay off government officials to save money on taxes. This reduces the dividend tax rate by 5%."},[a.GovernmentPartnership]:{index:6,price:2e15,name:"Government Partnership",desc:"Help national governments further their agendas in exchange for lowered taxes. This reduces the dividend tax rate by 10%"},[a.WarehouseAPI]:{index:7,price:5e10,name:"Warehouse API",desc:"Enables the warehouse API."},[a.OfficeAPI]:{index:8,price:5e10,name:"Office API",desc:"Enables the office API."}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(74);const r=t=>{const e=[];for(const[t,n]of Object.entries(a.a))n.isSpecial||e.push(t);return e.filter(e=>!t.hasAugmentation(e))},i=t=>1+(t.getIntelligenceBonus(3)-1)/3,o=(t,e)=>e.time/i(t)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(136),r=n(59);const i={};i[r.a.OperationTyphoon]=new a.a({name:r.a.OperationTyphoon,baseDifficulty:2e3,reqdRank:2500,rankGain:50,rankLoss:10,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationZero]=new a.a({name:r.a.OperationZero,baseDifficulty:2500,reqdRank:5e3,rankGain:60,rankLoss:15,hpLoss:50,weights:{hack:.2,str:.15,def:.15,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),i[r.a.OperationX]=new a.a({name:r.a.OperationX,baseDifficulty:3e3,reqdRank:7500,rankGain:75,rankLoss:15,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationTitan]=new a.a({name:r.a.OperationTitan,baseDifficulty:4e3,reqdRank:1e4,rankGain:100,rankLoss:20,hpLoss:100,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationAres]=new a.a({name:r.a.OperationAres,baseDifficulty:5e3,reqdRank:12500,rankGain:125,rankLoss:20,hpLoss:200,weights:{hack:0,str:.25,def:.25,dex:.25,agi:.25,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationArchangel]=new a.a({name:r.a.OperationArchangel,baseDifficulty:7500,reqdRank:15e3,rankGain:200,rankLoss:20,hpLoss:25,weights:{hack:0,str:.2,def:.2,dex:.3,agi:.3,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationJuggernaut]=new a.a({name:r.a.OperationJuggernaut,baseDifficulty:1e4,reqdRank:2e4,rankGain:300,rankLoss:40,hpLoss:300,weights:{hack:0,str:.25,def:.25,dex:.25,agi:.25,cha:0,int:0},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationRedDragon]=new a.a({name:r.a.OperationRedDragon,baseDifficulty:12500,reqdRank:25e3,rankGain:500,rankLoss:50,hpLoss:500,weights:{hack:.05,str:.2,def:.2,dex:.25,agi:.25,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationK]=new a.a({name:r.a.OperationK,baseDifficulty:15e3,reqdRank:3e4,rankGain:750,rankLoss:60,hpLoss:1e3,weights:{hack:.05,str:.2,def:.2,dex:.25,agi:.25,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationDeckard]=new a.a({name:r.a.OperationDeckard,baseDifficulty:2e4,reqdRank:4e4,rankGain:1e3,rankLoss:75,hpLoss:200,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:0,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationTyrell]=new a.a({name:r.a.OperationTyrell,baseDifficulty:25e3,reqdRank:5e4,rankGain:1500,rankLoss:100,hpLoss:500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationWallace]=new a.a({name:r.a.OperationWallace,baseDifficulty:3e4,reqdRank:75e3,rankGain:2e3,rankLoss:150,hpLoss:1500,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationShoulderOfOrion]=new a.a({name:r.a.OperationShoulderOfOrion,baseDifficulty:35e3,reqdRank:1e5,rankGain:2500,rankLoss:500,hpLoss:1500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),i[r.a.OperationHyron]=new a.a({name:r.a.OperationHyron,baseDifficulty:4e4,reqdRank:125e3,rankGain:3e3,rankLoss:1e3,hpLoss:500,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationMorpheus]=new a.a({name:r.a.OperationMorpheus,baseDifficulty:45e3,reqdRank:15e4,rankGain:4e3,rankLoss:1e3,hpLoss:100,weights:{hack:.05,str:.15,def:.15,dex:.3,agi:.3,cha:0,int:.05},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isStealth:!0}),i[r.a.OperationIonStorm]=new a.a({name:r.a.OperationIonStorm,baseDifficulty:5e4,reqdRank:175e3,rankGain:5e3,rankLoss:1e3,hpLoss:5e3,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationAnnihilus]=new a.a({name:r.a.OperationAnnihilus,baseDifficulty:55e3,reqdRank:2e5,rankGain:7500,rankLoss:1e3,hpLoss:1e4,weights:{hack:0,str:.24,def:.24,dex:.24,agi:.24,cha:0,int:.04},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationUltron]=new a.a({name:r.a.OperationUltron,baseDifficulty:6e4,reqdRank:25e4,rankGain:1e4,rankLoss:2e3,hpLoss:1e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75},isKill:!0}),i[r.a.OperationCenturion]=new a.a({name:r.a.OperationCenturion,baseDifficulty:7e4,reqdRank:3e5,rankGain:15e3,rankLoss:5e3,hpLoss:1e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}}),i[r.a.OperationVindictus]=new a.a({name:r.a.OperationVindictus,baseDifficulty:75e3,reqdRank:35e4,rankGain:2e4,rankLoss:2e4,hpLoss:2e4,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}}),i[r.a.OperationDaedalus]=new a.a({name:r.a.OperationDaedalus,baseDifficulty:8e4,reqdRank:4e5,rankGain:4e4,rankLoss:1e4,hpLoss:1e5,weights:{hack:.1,str:.2,def:.2,dex:.2,agi:.2,cha:0,int:.1},decays:{hack:.6,str:.8,def:.8,dex:.8,agi:.8,cha:0,int:.75}})},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(121),r=n(15);class i{constructor(t){t?(this.id=t.fragment.id,this.x=t.x,this.y=t.y,this.highestCharge=0,this.numCharge=0,this.rotation=t.rotation):(this.id=-1,this.x=-1,this.y=-1,this.highestCharge=0,this.numCharge=0,this.rotation=0)}collide(t){const e=this.fragment(),n=t.fragment(),a=t.x-this.x,r=t.y-this.y,i=Math.max(e.shape.length,e.shape[0].length);for(let o=0;o[this.x+t[0],this.y+t[1]])}copy(){return Object.assign({},this)}toJSON(){return Object(r.b)("ActiveFragment",this)}static fromJSON(t){return Object(r.a)(i,t.data)}}r.c.constructors.ActiveFragment=i},,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.SYSTEM=0]="SYSTEM",t[t.INTERFACE=1]="INTERFACE",t[t.GAMEPLAY=2]="GAMEPLAY",t[t.MISC=3]="MISC",t[t.REMOTE_API=4]="REMOTE_API"}(a||(a={}))},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(13),r=n(484);function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class o{constructor(t="",e="",n,a=0,r=0,o=0,s=0,l={}){i(this,"difficulty",0),i(this,"karma",0),i(this,"kills",0),i(this,"money",0),i(this,"name",""),i(this,"workName",""),i(this,"time",0),i(this,"hacking_success_weight",0),i(this,"strength_success_weight",0),i(this,"defense_success_weight",0),i(this,"dexterity_success_weight",0),i(this,"agility_success_weight",0),i(this,"charisma_success_weight",0),i(this,"hacking_exp",0),i(this,"strength_exp",0),i(this,"defense_exp",0),i(this,"dexterity_exp",0),i(this,"agility_exp",0),i(this,"charisma_exp",0),i(this,"intelligence_exp",0),this.name=t,this.workName=e,this.type=n,this.time=a,this.money=r,this.difficulty=o,this.karma=s,this.hacking_success_weight=l.hacking_success_weight?l.hacking_success_weight:0,this.strength_success_weight=l.strength_success_weight?l.strength_success_weight:0,this.defense_success_weight=l.defense_success_weight?l.defense_success_weight:0,this.dexterity_success_weight=l.dexterity_success_weight?l.dexterity_success_weight:0,this.agility_success_weight=l.agility_success_weight?l.agility_success_weight:0,this.charisma_success_weight=l.charisma_success_weight?l.charisma_success_weight:0,this.hacking_exp=l.hacking_exp?l.hacking_exp:0,this.strength_exp=l.strength_exp?l.strength_exp:0,this.defense_exp=l.defense_exp?l.defense_exp:0,this.dexterity_exp=l.dexterity_exp?l.dexterity_exp:0,this.agility_exp=l.agility_exp?l.agility_exp:0,this.charisma_exp=l.charisma_exp?l.charisma_exp:0,this.intelligence_exp=l.intelligence_exp?l.intelligence_exp:0,this.kills=l.kills?l.kills:0}commit(t,e=1,n=null){return e<=0&&(e=1),t.startWork(new r.a({crimeType:this.type,singularity:null!==n})),this.time}successRate(t){let e=this.hacking_success_weight*t.skills.hacking+this.strength_success_weight*t.skills.strength+this.defense_success_weight*t.skills.defense+this.dexterity_success_weight*t.skills.dexterity+this.agility_success_weight*t.skills.agility+this.charisma_success_weight*t.skills.charisma+a.a.IntelligenceCrimeWeight*t.skills.intelligence;return e/=a.a.MaxSkillLevel,e/=this.difficulty,e*=t.mults.crime_success,e*=t.getIntelligenceBonus(1),Math.min(e,1)}}},,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(7),o=n(228);function s({hashes:t}){return r.a.createElement(o.a,{hashes:i.a.formatHashes(t)+" h / s"})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e){this.filename=t,this.msg=e}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(558),i=n(26),o=n(9),s=n(21);function l(t){const e=i.b.Player();return a.createElement(a.Fragment,null,a.createElement(s.a,{title:a.createElement("span",{dangerouslySetInnerHTML:{__html:function(){const n=e.getNextCompanyPosition(t.company,t.entryPosType);return null==n?"":t.company.hasPosition(n)?Object(r.a)(t.company,n,!0):""}()}})},a.createElement(o.a,{onClick:t.onClick},t.text)))}},,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1056),r=n(1057);const i={};for(const t of r.a)null!=i[(o=t).name]&&console.warn("Duplicate Research being defined: "+o.name),i[o.name]=new a.a(o);var o},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a=new(n(127).a)},function(t,e,n){"use strict";n.d(e,"b",(function(){return m})),n.d(e,"a",(function(){return h}));var a=n(15),r=n(103),i=n(108),o=n(5),s=n(29),l=n(394),c=n(232),f=n(90),u=n(22);const m=t=>null!==t&&t.type===r.b.FACTION;class h extends r.a{constructor(t){var e,n;super(r.b.FACTION),this.factionWorkType=null!==(e=null==t?void 0:t.factionWorkType)&&void 0!==e?e:i.a.HACKING,this.factionName=null!==(n=null==t?void 0:t.factionName)&&void 0!==n?n:o.a.Sector12}getExpRates(t){return Object(f.d)(Object(l.a)(t,this.factionWorkType),t.shockBonus())}getReputationRate(t){const e=this.getFaction();return{[i.a.HACKING]:c.c,[i.a.FIELD]:c.a,[i.a.SECURITY]:c.b}[this.factionWorkType](t,e.favor)*t.shockBonus()*u.a.FactionWorkRepGain}getFaction(){const t=s.a[this.factionName];if(!t)throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);return t}process(t,e,n){if(t.gang&&this.factionName===t.gang.facName)return e.stopWork(t),0;const a=this.getExpRates(e);Object(r.c)(t,e,a,n);const i=this.getReputationRate(e);return this.getFaction().playerReputation+=i,0}APICopy(){return{type:this.type,factionWorkType:this.factionWorkType,factionName:this.factionName}}toJSON(){return Object(a.b)("SleeveFactionWork",this)}static fromJSON(t){return Object(a.a)(h,t.data)}}a.c.constructors.SleeveFactionWork=h},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return d})),n.d(e,"d",(function(){return p})),n.d(e,"c",(function(){return g})),n.d(e,"e",(function(){return y})),n.d(e,"b",(function(){return b}));var a=n(1),r=n(91),i=n(77),o=n(83),s=n(84),l=n(24),c=n(106),f=n(6),u=n(630),m=n(13),h=n(256);function d(){navigator.userAgent.toLowerCase().indexOf(" electron/")>-1&&(document.achievements=[],function(){function e(t){return t=t.replace(/\/\/+/g,"/"),(t=Object(i.k)(t)).includes("/")&&(t="/"+Object(i.k)(t)),t}document.getFiles=function(){const t=Object(l.d)("home");return null===t?{res:!1,msg:"Home server does not exist."}:{res:!0,data:{files:t.scripts.map(t=>({filename:t.filename,code:t.code,ramUsage:t.ramUsage}))}}},document.deleteFile=function(t){t=e(t);const n=Object(l.d)("home");return null===n?{res:!1,msg:"Home server does not exist."}:n.removeFile(t)},document.saveFile=function(n,r){var i;n=e(n),r=t.from(r,"base64").toString();const o=Object(l.d)("home");if(null===o)return{res:!1,msg:"Home server does not exist."};const{success:s,overwritten:c}=o.writeToScriptFile(a.a,n,r);let f;return s&&(f=o.getScript(n)),{res:s,data:{overwritten:c,ramUsage:null===(i=f)||void 0===i?void 0:i.ramUsage}}}}(),function(){const t={terminal:(t,e)=>{const n={info:o.a.info,warn:o.a.warn,error:o.a.error,success:o.a.success};let a;e&&(a=n[e]),a||(a=o.a.print),a.bind(o.a)(t)},toast:(t,e,n=2e3)=>s.b.emit(t,e,n)};window.appNotifier=t}(),function(){const t={triggerSave:()=>c.c.saveGame(!0),triggerGameExport:()=>{try{c.c.exportGame()}catch(t){console.error(t),s.b.emit("Could not export game.",s.d.ERROR,2e3)}},triggerScriptsExport:()=>Object(u.b)("*",a.a.getHomeComputer()),getSaveData:()=>({save:c.c.getSaveString(f.a.ExcludeRunningScriptsFromSave),fileName:c.c.getSaveFileName()}),getSaveInfo:async t=>{try{return(await c.c.getImportDataFromString(t)).playerData}catch(t){return void console.error(t)}},pushSaveData:(t,e=!1)=>r.b.toImportSave(t,e)};window.appSaveFns=t}(),function(){const t=window.electronBridge;if(!t)return;t.receive("get-save-data-request",()=>{const e=window.appSaveFns.getSaveData();t.send("get-save-data-response",e)}),t.receive("get-save-info-request",async e=>{if("string"!=typeof e)throw new Error("Error while trying to get save info");const n=await window.appSaveFns.getSaveInfo(e);t.send("get-save-info-response",n)}),t.receive("push-save-request",t=>{if("object"!=typeof t)throw new Error("Error trying to push save request");const{save:e,automatic:n=!1}=t;window.appSaveFns.pushSaveData(e,n)}),t.receive("trigger-save",()=>window.appSaveFns.triggerSave().then(()=>{t.send("save-completed")}).catch(t=>{console.error(t),s.b.emit("Could not save game.",s.d.ERROR,2e3)})),t.receive("trigger-game-export",()=>{try{window.appSaveFns.triggerGameExport()}catch(t){console.error(t),s.b.emit("Could not export game.",s.d.ERROR,2e3)}}),t.receive("trigger-scripts-export",()=>{try{window.appSaveFns.triggerScriptsExport()}catch(t){console.error(t),s.b.emit("Could not export scripts.",s.d.ERROR,2e3)}})}())}function p(t){const e=window.electronBridge;e&&e.send("push-game-saved",t)}function g(){const t=window.electronBridge;t&&t.send("push-game-ready",{player:{identifier:a.a.identifier,playtime:a.a.totalPlaytime,lastSave:a.a.lastSave},game:{version:m.a.VersionString,hash:Object(h.a)()}})}function y(t){const e=window.electronBridge;e&&(e.send("push-import-result",{wasImported:t}),b())}function b(){const t=window.electronBridge;t&&t.send("push-disable-restore",{duration:6e4})}}).call(this,n(171).Buffer)},,function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(16),r=n(15),i=n(12),o=n(13),s=n(63),l=n(153);const c=t=>null!==t&&t.type===l.b.CREATE_PROGRAM;class f extends l.a{constructor(t){var e,n;if(super(l.b.CREATE_PROGRAM,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.unitCompleted=0,this.programName=null!==(n=null==t?void 0:t.programName)&&void 0!==n?n:"",null!=t&&t.player){const e=t.player;for(let t=0;t=100)break;this.unitCompleted=r/100*this.unitNeeded(),e.getHomeComputer().programs.splice(t,1)}}}}unitNeeded(){var t,e;return null!==(t=null===(e=this.getProgram().create)||void 0===e?void 0:e.time)&&void 0!==t?t:0}getProgram(){const t=Object.values(s.a).find(t=>t.name.toLowerCase()===this.programName.toLowerCase());if(!t)throw new Error("Create program work started with invalid program "+this.programName);return t}process(t,e){var n,a;let r=1;t.hasAugmentation(i.a.NeuroreceptorManager)||(r=t.focus?1:o.a.BaseFocusBonus);const s=null!==(n=null===(a=this.getProgram().create)||void 0===a?void 0:a.level)&&void 0!==n?n:0;let l=t.skills.hacking/s*t.getIntelligenceBonus(3);return l=1+(l-1)/5,l*=r,this.cyclesWorked+=e,this.unitCompleted+=o.a._idleSpeed*e*l,this.unitCompleted>=this.unitNeeded()}finish(t,e){const n=this.programName;if(e){if(!t.getHomeComputer().programs.includes(n)){const e=n+"-"+(100*this.unitCompleted/this.unitNeeded()).toFixed(2)+"%-INC";t.getHomeComputer().programs.push(e)}}else{if(t.gainIntelligenceExp(o.a.IntelligenceProgramBaseExpGain*this.cyclesWorked*o.a._idleSpeed/1e3),!this.singularity){const t=[`You've finished creating ${n}!`,"The new program can be found on your home computer."];Object(a.a)(t.join("
"))}t.getHomeComputer().programs.includes(n)||t.getHomeComputer().programs.push(n)}}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,programName:this.programName}}toJSON(){return Object(r.b)("CreateProgramWork",this)}static fromJSON(t){return Object(r.a)(f,t.data)}}r.c.constructors.CreateProgramWork=f},function(t,e,n){"use strict";n.d(e,"b",(function(){return W})),n.d(e,"a",(function(){return H}));var a=n(0),r=n.n(a),i=n(126),o=n(122),s=n(148),l=n(7),c=n(144),f=n(1209),u=n(28),m=n(161),h=n(162),d=n(31),p=n(49),g=n(3),y=n(9),b=n(112),E=n(490),v=n.n(E),k=n(1213),w=n.n(k),S=n(6),_=n(26),C=n(413),x=n(22),L=n(21),O=n(20),M=n(55),A=n(13),T=n(311),R=n(391),N=n(226),P=n(364),I=n(327),D=n(484);function F(){const t=Object(i.a)(),e=_.b.Player(),n=W();if(0===e.skills.intelligence)return r.a.createElement(r.a.Fragment,null);const a=e.calculateSkillProgress(e.exp.intelligence);return r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:n.cell}},r.a.createElement(g.a,{classes:{root:n.int}},"Int ")),r.a.createElement(d.a,{align:"right",classes:{root:n.cell}},r.a.createElement(g.a,{classes:{root:n.int}},l.a.formatSkill(e.skills.intelligence))),r.a.createElement(d.a,{align:"right",classes:{root:n.cell}},r.a.createElement(g.a,{id:"overview-int-hook",classes:{root:n.int}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:a,color:t.colors.int})))}function j(){const t=_.b.Player(),e=W(),n=t.bladeburner;if(null===n)return r.a.createElement(r.a.Fragment,null);const a=n.getTypeAndNameFromActionId(n.action);return"Idle"===a.type?r.a.createElement(r.a.Fragment,null):r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:e.cellNone}},r.a.createElement(g.a,null,"Bladeburner:"))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:e.cellNone}},r.a.createElement(g.a,null,a.type,": ",a.name))))}function B({tooltip:t,children:e,onClickFocus:n,header:a}){const i=W();return r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:i.workCell}},r.a.createElement(L.a,{title:r.a.createElement(r.a.Fragment,null,t)},r.a.createElement(g.a,{className:i.workHeader,sx:{pt:1,pb:.5}},a)))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",colSpan:2,classes:{root:i.workCell}},r.a.createElement(g.a,{className:i.workSubtitles},e))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",align:"center",colSpan:2,classes:{root:i.cellNone}},r.a.createElement(y.a,{sx:{mt:1},onClick:n},"Focus"))))}function G(){const t=_.b.Player(),e=_.b.Router();if(null===t.currentWork||t.focus)return r.a.createElement(r.a.Fragment,null);let n=r.a.createElement(r.a.Fragment,null),a=r.a.createElement(r.a.Fragment,null),i=r.a.createElement(r.a.Fragment,null);if(Object(D.b)(t.currentWork)){const e=t.currentWork.getCrime(),o=t.currentWork.unitCompleted/e.time*100;n=r.a.createElement(r.a.Fragment,null,t.currentWork.crimeType),a=r.a.createElement(r.a.Fragment,null,"You are attempting to ",t.currentWork.crimeType),i=r.a.createElement(r.a.Fragment,null,o.toFixed(2),"%")}if(Object(M.d)(t.currentWork)&&(n=r.a.createElement(r.a.Fragment,null,t.currentWork.getClass().youAreCurrently),a=r.a.createElement(r.a.Fragment,null,"You are ",t.currentWork.getClass().youAreCurrently),i=r.a.createElement(r.a.Fragment,null,Object(u.b)(t.currentWork.cyclesWorked*A.a._idleSpeed))),Object(T.b)(t.currentWork)){const e=t.currentWork;n=r.a.createElement(r.a.Fragment,null,"Coding ",e.programName),a=r.a.createElement(r.a.Fragment,null,"Creating a program"),i=r.a.createElement(r.a.Fragment,null,e.programName," ",(e.unitCompleted/e.unitNeeded()*100).toFixed(2),"%")}if(Object(R.b)(t.currentWork)){const e=t.currentWork;n=r.a.createElement(r.a.Fragment,null,"Grafting ",e.augmentation),a=r.a.createElement(r.a.Fragment,null,"Grafting an Augmentation"),i=r.a.createElement(r.a.Fragment,null,r.a.createElement("strong",null,(e.unitCompleted/e.unitNeeded()*100).toFixed(2),"%")," done")}if(Object(N.b)(t.currentWork)){const e=t.currentWork;a=r.a.createElement(r.a.Fragment,null,"Working for ",r.a.createElement("strong",null,e.factionName)),i=r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{reputation:e.getFaction().playerReputation})," rep",r.a.createElement("br",null),"(",r.a.createElement(P.a,{reputation:e.getReputationRate(t)*(1e3/A.a._idleSpeed)}),")")}if(Object(I.b)(t.currentWork)){const e=t.currentWork;n=r.a.createElement(r.a.Fragment,null,t.jobs[e.companyName]," at ",r.a.createElement("strong",null,e.companyName)),a=r.a.createElement(r.a.Fragment,null,"Working at ",r.a.createElement("strong",null,e.companyName)),i=r.a.createElement(r.a.Fragment,null,r.a.createElement(c.a,{reputation:e.getCompany().playerReputation})," rep",r.a.createElement("br",null),"(",r.a.createElement(P.a,{reputation:e.getGainRates(t).reputation*(1e3/A.a._idleSpeed)}),")")}return r.a.createElement(B,{tooltip:n,header:a,onClickFocus:()=>{t.startFocusing(),e.toWork()}},i)}const W=Object(o.a)(t=>Object(s.a)({workCell:{textAlign:"center",maxWidth:"200px",borderBottom:"none",padding:0,margin:0},workHeader:{fontSize:"0.9rem"},workSubtitles:{fontSize:"0.8rem"},cellNone:{borderBottom:"none",padding:0,margin:0},cell:{padding:0,margin:0},hp:{color:t.colors.hp},money:{color:t.colors.money},hack:{color:t.colors.hack},combat:{color:t.colors.combat},cha:{color:t.colors.cha},int:{color:t.colors.int}}));function H({save:t,killScripts:e}){const[n,o]=Object(a.useState)(!1),s=_.b.Player(),c=Object(a.useState)(!1)[1];Object(a.useEffect)(()=>{const t=setInterval(()=>c(t=>!t),600);return()=>clearInterval(t)},[]);const u=W(),y=Object(i.a)(),E=s.calculateSkillProgress(s.exp.hacking,s.mults.hacking*x.a.HackingLevelMultiplier),k=s.calculateSkillProgress(s.exp.strength,s.mults.strength*x.a.StrengthLevelMultiplier),M=s.calculateSkillProgress(s.exp.defense,s.mults.defense*x.a.DefenseLevelMultiplier),A=s.calculateSkillProgress(s.exp.dexterity,s.mults.dexterity*x.a.DexterityLevelMultiplier),T=s.calculateSkillProgress(s.exp.agility,s.mults.agility*x.a.AgilityLevelMultiplier),R=s.calculateSkillProgress(s.exp.charisma,s.mults.charisma*x.a.CharismaLevelMultiplier);return r.a.createElement(r.a.Fragment,null,r.a.createElement(m.a,{sx:{display:"block",m:1}},r.a.createElement(h.a,null,r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hp}},"HP ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hp}},l.a.formatHp(s.hp.current)," / ",l.a.formatHp(s.hp.max))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-hp-hook",classes:{root:u.hp}}))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.money}},"Money ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.money}},l.a.formatMoney(s.money))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-money-hook",classes:{root:u.money}}))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hack}},"Hack ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.hack}},l.a.formatSkill(s.skills.hacking)))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:E,color:y.colors.hack})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cell}},r.a.createElement(g.a,{classes:{root:u.hack}})),r.a.createElement(d.a,{align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-hack-hook",classes:{root:u.hack}}))),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},"Str ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.strength))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-str-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:k,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},"Def ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.defense))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-def-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:M,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},"Dex ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.dexterity))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-dex-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:A,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cell}},r.a.createElement(g.a,{classes:{root:u.combat}},"Agi ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{classes:{root:u.combat}},l.a.formatSkill(s.skills.agility))),r.a.createElement(d.a,{align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-agi-hook",classes:{root:u.combat}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:T,color:y.colors.combat})),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.cha}},"Cha ")),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{classes:{root:u.cha}},l.a.formatSkill(s.skills.charisma))),r.a.createElement(d.a,{align:"right",classes:{root:u.cellNone}},r.a.createElement(g.a,{id:"overview-cha-hook",classes:{root:u.cha}}))),r.a.createElement(p.a,null,!S.a.DisableOverviewProgressBars&&r.a.createElement(C.a,{progress:R,color:y.colors.cha})),r.a.createElement(F,null),r.a.createElement(p.a,null,r.a.createElement(d.a,{component:"th",scope:"row",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-extra-hook-0",classes:{root:u.hack}})),r.a.createElement(d.a,{component:"th",scope:"row",align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-extra-hook-1",classes:{root:u.hack}})),r.a.createElement(d.a,{component:"th",scope:"row",align:"right",classes:{root:u.cell}},r.a.createElement(g.a,{id:"overview-extra-hook-2",classes:{root:u.hack}}))),r.a.createElement(G,null),r.a.createElement(j,null))),r.a.createElement(O.a,{sx:{display:"flex",borderTop:"1px solid "+S.a.theme.welllight}},r.a.createElement(O.a,{sx:{display:"flex",flex:1,justifyContent:"flex-start",alignItems:"center"}},r.a.createElement(b.a,{"aria-label":"save game",onClick:t},r.a.createElement(L.a,{title:0!==S.a.AutosaveInterval?"Save game":"Save game (auto-saves are disabled!)"},r.a.createElement(v.a,{color:0!==S.a.AutosaveInterval?"primary":"error"})))),r.a.createElement(O.a,{sx:{display:"flex",flex:1,justifyContent:"flex-end",alignItems:"center"}},r.a.createElement(b.a,{"aria-label":"kill all scripts",onClick:()=>o(!0)},r.a.createElement(L.a,{title:"Kill all running scripts"},r.a.createElement(w.a,{color:"error"}))))),r.a.createElement(f.a,{open:n,onClose:()=>o(!1),killScripts:e}))}},,,function(t,e,n){"use strict";function a(t,e){if(e<0||e>100)return t;const n=t*(e/100);return t+(Math.random()*(2*n)-n)}n.d(e,"a",(function(){return a}))},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n){this.program=t,this.price=e,this.description=n}}},,,,,,,,function(t,e,n){"use strict";function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r}));class r{constructor(t=""){a(this,"level",1),a(this,"name",""),this.name=t}}},function(t,e,n){"use strict";function a(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o}));const r=new class{constructor(){a(this,"m",1024),a(this,"a",341),a(this,"c",1),this.x=0,this.reset()}step(){this.x=(this.a*this.x+this.c)%this.m}random(){return this.step(),this.x/this.m}reset(){this.x=(new Date).getTime()%this.m}};class i{constructor(t){a(this,"s1",0),a(this,"s2",0),a(this,"s3",0);const e=t/1e3%3e4;this.s1=e,this.s2=e,this.s3=e}step(){this.s1=171*this.s1%30269,this.s2=172*this.s2%30307,this.s3=170*this.s3%30323}random(){return this.step(),(this.s1/30269+this.s2/30307+this.s3/30323)%1}}function o(t){let e=1779033703^t.length;for(let n=0;n>>19;const n=()=>(e=Math.imul(e^e>>>16,2246822507),e=Math.imul(e^e>>>13,3266489909),(e^=e>>>16)>>>0);let a=n(),r=n(),i=n(),o=n();return()=>{a>>>=0,r>>>=0,i>>>=0,o>>>=0;let t=a+r|0;return a=r^r>>>9,r=i+(i<<3)|0,i=i<<21|i>>>11,o=o+1|0,t=t+o|0,i=i+t|0,(t>>>0)/4294967296}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return g})),n.d(e,"a",(function(){return y}));var a=n(0),r=n.n(a),i=n(15),o=n(153),s=n(385),l=n(10),c=n(627),f=n(78),u=n(90),m=n(16),h=n(144),d=n(12),p=n(13);const g=t=>null!==t&&t.type===o.b.COMPANY;class y extends o.a{constructor(t){var e,n;super(o.b.COMPANY,null!==(e=null==t?void 0:t.singularity)&&void 0!==e&&e),this.companyName=null!==(n=null==t?void 0:t.companyName)&&void 0!==n?n:l.a.NewTokyoNoodleBar}getCompany(){const t=f.a[this.companyName];if(!t)throw new Error(`Company not found: '${this.companyName}'`);return t}getGainRates(t){let e=1;return t.hasAugmentation(d.a.NeuroreceptorManager)||(e=t.focus?1:p.a.BaseFocusBonus),Object(u.d)(Object(c.a)(t,t,this.getCompany()),e)}process(t,e){this.cyclesWorked+=e;const n=this.getCompany(),a=this.getGainRates(t);return Object(u.a)(t,t,a,e,"work"),n.playerReputation+=a.reputation*e,Object(s.a)(n,a.reputation,e),!1}finish(){this.singularity||Object(m.a)(r.a.createElement(r.a.Fragment,null,"You finished working for ",this.companyName,r.a.createElement("br",null),"You have ",r.a.createElement(h.a,{reputation:this.getCompany().playerReputation})," reputation with them."))}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,companyName:this.companyName}}toJSON(){return Object(i.b)("CompanyWork",this)}static fromJSON(t){return Object(i.a)(y,t.data)}}i.c.constructors.CompanyWork=y},,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(46),r=n(3),i=n(0),o=n.n(i);const s=t=>o.a.createElement(a.a,{sx:{height:"fit-content",p:1}},o.a.createElement(r.a,{variant:"h6"},t.title),t.children)},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(7),i=n(122),o=n(148);const s=Object(i.a)(t=>Object(o.a)({favor:{color:t.colors.rep}}));function l({favor:t}){const e=s();return a.createElement("span",{className:e.favor},"number"==typeof t?r.a.formatFavor(t):t)}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(127);const r=new a.a,i=new a.a},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(193),r=n(154),i=n(117),o=n(75),s=n(7),l=n(23),c=n(16),f=n(6),u=n(0);function m(t,e,n,a){const s=a.stockMarket.Orders;if(null==s){const t={};for(const e of Object.keys(a.stockMarket)){const n=a.stockMarket[e];n instanceof r.a&&(t[n.symbol]=[])}return void(a.stockMarket.Orders=t)}let l=s[t.symbol];if(null==l||l.constructor!==Array)return console.error(`Invalid Order book for ${t.symbol} in processOrders(): ${l}`),void(l=[]);for(const r of l)if(r.type===e&&r.pos===n)switch(r.type){case i.a.LimitBuy:(r.pos===o.a.Long&&t.price<=r.price||r.pos===o.a.Short&&t.price>=r.price)&&h(r,a);break;case i.a.LimitSell:case i.a.StopBuy:(r.pos===o.a.Long&&t.price>=r.price||r.pos===o.a.Short&&t.price<=r.price)&&h(r,a);break;case i.a.StopSell:(r.pos===o.a.Long&&t.price<=r.price||r.pos===o.a.Short&&t.price>=r.price)&&h(r,a);break;default:return void console.warn("Invalid order type: "+r.type)}}function h(t,e){const n=e.symbolToStockMap[t.stockSymbol];if(!(n instanceof r.a))return void console.error("Could not find stock for this order: "+t.stockSymbol);const m=e.stockMarket.Orders[n.symbol],h={suppressDialog:!0};let d=!0,p=!1;switch(t.type){case i.a.LimitBuy:case i.a.StopBuy:p=!0,t.pos===o.a.Long?d=Object(a.a)(n,t.shares,null,h)&&d:t.pos===o.a.Short&&(d=Object(a.d)(n,t.shares,null,h)&&d);break;case i.a.LimitSell:case i.a.StopSell:t.pos===o.a.Long?d=Object(a.c)(n,t.shares,null,h)&&d:t.pos===o.a.Short&&(d=Object(a.b)(n,t.shares,null,h)&&d);break;default:return void console.warn("Invalid order type: "+t.type)}const g=t.pos===o.a.Long?"Long":"Short";if(d){for(let e=0;e({...a})},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return m}));var a=n(0),r=n.n(a),i=n(127),o=n(39),s=n(3),l=n(20),c=n(797);const f=new i.a;let u=0;function m(){const[t,e]=Object(a.useState)([]);return Object(a.useEffect)(()=>f.subscribe(t=>{const n=u+"";u++,e(e=>{const a=function(t){return"string"==typeof t?Object(c.sha256)(t):Object(c.sha256)(JSON.stringify(t.props))}(t);return e.some(t=>t.hash===a)?e:[...e,{id:n,text:t,hash:a}]})}),[]),Object(a.useEffect)(()=>{function t(t){"Escape"===t.code&&e([])}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)},[]),r.a.createElement(r.a.Fragment,null,t.length>0&&r.a.createElement(o.a,{open:!0,onClose:function(){e(t=>t.slice(1,1e99))}},r.a.createElement(l.a,{overflow:"scroll",sx:{overflowWrap:"break-word",whiteSpace:"pre-line"}},r.a.createElement(s.a,{component:"span"},t[0].text))))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(565);const r=()=>`${Object(a.a)(99)}.${Object(a.a)(9)}.${Object(a.a)(9)}.${Object(a.a)(9)}`},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(15),r=n(103);const i=t=>null!==t&&t.type===r.b.SUPPORT;class o extends r.a{constructor(t){var e;super(r.b.SUPPORT),t&&(null===(e=t.bladeburner)||void 0===e||e.sleeveSupport(!0))}process(){return 0}finish(t){var e;null===(e=t.bladeburner)||void 0===e||e.sleeveSupport(!1)}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveSupportWork",this)}static fromJSON(t){return Object(a.a)(o,t.data)}}a.c.constructors.SleeveSupportWork=o},function(t,e,n){"use strict";n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i}));var a=n(6);const r=[];function i(t){if(r.find(e=>e.runningScript.pid===t.pid))return;const e=new Date;for(r.unshift({timeOfDeath:e,runningScript:t.scriptRef});r.length>a.a.MaxRecentScriptsCapacity;)r.pop()}},function(t,e,n){"use strict";function a(){return new Promise((t,e)=>{window.indexedDB||e("Indexed DB does not exists");const n=window.indexedDB.open("bitburnerSave",1);n.onupgradeneeded=function(){this.result.createObjectStore("savestring")},n.onerror=function(t){e("Failed to get IDB "+t)},n.onsuccess=function(){const n=this.result;n?t(n.transaction(["savestring"],"readwrite").objectStore("savestring")):e("database loading result was undefined")}})}function r(){return new Promise((t,e)=>{a().then(e=>new Promise((t,n)=>{const a=e.get("save");a.onerror=function(t){n("Error in Database request to get savestring: "+t)},a.onsuccess=function(){t(this.result)}}).then(e=>t(e))).catch(t=>e(t))})}function i(t){return a().then(e=>new Promise((n,a)=>{const r=e.put(t,"save");r.onerror=function(t){a("Error saving game to IndexedDB: "+t)},r.onsuccess=()=>n()}))}function o(){return a().then(t=>{t.delete("save")})}n.d(e,"b",(function(){return r})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return E})),n.d(e,"b",(function(){return b})),n.d(e,"c",(function(){return g}));var a=n(299),r=n(12),i=n(91),o=n(63),s=n(1),l=n(27),c=n(24),f=n(89),u=n(6),m=n(16),h=n(5),d=n(45);function p(t,e=!1){!e&&u.a.SuppressMessages||g(t.filename),function(t){if(y(t))return;const e=Object(c.d)("home");if(null==e)throw new Error("The home server doesn't exist. You done goofed.");e.messages.push(t.filename)}(t)}function g(t){const e=v[t];if(!(e instanceof a.a))throw new Error("trying to display unexistent message");const n="Message received from unknown sender:

"+e.msg+"

This message was saved as "+e.filename+" onto your home computer.";Object(m.a)(n)}function y(t){const e=Object(c.d)("home");if(null==e)throw new Error("The home server doesn't exist. You done goofed.");return e.messages.includes(t.filename)}function b(){if(i.b.page()===l.a.BitVerse)return;const t=v[E.Jumper0],e=v[E.Jumper1],n=v[E.Jumper2],a=v[E.Jumper3],u=v[E.Jumper4],m=v[E.CyberSecTest],h=v[E.NiteSecTest],g=v[E.BitRunnersTest],b=v[E.TruthGazer],k=v[E.RedPill];if(s.a.hasAugmentation(r.a.TheRedPill)){const t=Object(c.d)(f.a.WorldDaemon);if(!(t instanceof d.a))throw new Error("The world daemon is not a server???? Please un-break reality");s.a.skills.hacking>=t.requiredHackingSkill?p(k,0===s.a.sourceFiles.length):y(b)||p(b)}else if(!y(t)&&s.a.skills.hacking>=25){p(t);const e=o.a.Flight.name,n=s.a.getHomeComputer();n.programs.includes(e)||n.programs.push(e)}else!y(e)&&s.a.skills.hacking>=40?p(e):!y(m)&&s.a.skills.hacking>=50?p(m):!y(n)&&s.a.skills.hacking>=175?p(n):!y(h)&&s.a.skills.hacking>=200?p(h):!y(a)&&s.a.skills.hacking>=350?p(a):!y(u)&&s.a.skills.hacking>=490?p(u):!y(g)&&s.a.skills.hacking>=500&&p(g)}let E;!function(t){t.Jumper0="j0.msg",t.Jumper1="j1.msg",t.Jumper2="j2.msg",t.Jumper3="j3.msg",t.Jumper4="j4.msg",t.CyberSecTest="csec-test.msg",t.NiteSecTest="nitesec-test.msg",t.BitRunnersTest="19dfj3l1nd.msg",t.TruthGazer="truthgazer.msg",t.RedPill="icarus.msg"}(E||(E={}));const v={[E.Jumper0]:new a.a(E.Jumper0,"I know you can sense it. I know you're searching for it. It's why you spend night after night at your computer.

It's real, I've seen it. And I can help you find it. But not right now. You're not ready yet.

Use this program to track your progress

The fl1ght.exe program was added to your home computer

-jump3R"),[E.Jumper1]:new a.a(E.Jumper1,`Soon you will be contacted by a hacking group known as ${h.a.NiteSec}. They can help you with your search.

You should join them, garner their favor, and exploit them for their Augmentations. But do not trust them. They are not what they seem. No one is.

-jump3R`),[E.Jumper2]:new a.a(E.Jumper2,`Do not try to save the world. There is no world to save. If you want to find the truth, worry only about yourself. Ethics and morals will get you killed.

Watch out for a hacking group known as ${h.a.NiteSec}.

-jump3R`),[E.Jumper3]:new a.a(E.Jumper3,`You must learn to walk before you can run. And you must run before you can fly. Look for ${h.a.TheBlackHand}.

I.I.I.I

-jump3R`),[E.Jumper4]:new a.a(E.Jumper4,"To find what you are searching for, you must understand the bits. The bits are all around us. The runners will help you.

-jump3R"),[E.CyberSecTest]:new a.a(E.CyberSecTest,"We've been watching you. Your skills are very impressive. But you're wasting your talents. If you join us, you can put your skills to good use and change the world for the better. If you join us, we can unlock your full potential.

But first, you must pass our test. Find and install the backdoor on our server.

-"+h.a.CyberSec),[E.NiteSecTest]:new a.a(E.NiteSecTest,"People say that the corrupted governments and corporations rule the world. Yes, maybe they do. But do you know who everyone really fears? People like us. Because they can't hide from us. Because they can't fight shadows and ideas with bullets.

Join us, and people will fear you, too.

Find and install the backdoor on our server, avmnite-02h. Then, we will contact you again.

-"+h.a.NiteSec),[E.BitRunnersTest]:new a.a(E.BitRunnersTest,"We know what you are doing. We know what drives you. We know what you are looking for.

We can help you find the answers.

run4theh111z"),[E.TruthGazer]:new a.a(E.TruthGazer,"@&*($#@&__TH3__#@A&#@*)__TRU1H__(*)&*)($#@&()E&R)W&
%@*$^$()@&$)$*@__CAN__()(@^#)@&@)#__N0__(#@&#)@&@&(
*(__LON6ER__^#)@)(()*#@)@__ESCAP3__)#(@(#@*@()@(#*$
()@)#$*%)$#()$#__Y0UR__(*)$#()%(&(%)*!)($__GAZ3__#("),[E.RedPill]:new a.a(E.RedPill,"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%
)@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)
@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB
DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)")}},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(15),r=n(103),i=n(55),o=n(10),s=n(257),l=n(90);const c=t=>null!==t&&t.type===r.b.CLASS;class f extends r.a{constructor(t){var e,n;super(r.b.CLASS),this.classType=null!==(e=null==t?void 0:t.classType)&&void 0!==e?e:i.a.StudyComputerScience,this.location=null!==(n=null==t?void 0:t.location)&&void 0!==n?n:o.a.Sector12RothmanUniversity}calculateRates(t,e){return Object(l.d)(Object(s.a)(t,e,this.classType,this.location),e.shockBonus(),!1)}isGym(){return[i.a.GymAgility,i.a.GymDefense,i.a.GymDexterity,i.a.GymStrength].includes(this.classType)}process(t,e,n){const a=this.calculateRates(t,e);return Object(r.c)(t,e,a,n),0}APICopy(){return{type:this.type,classType:this.classType,location:this.location}}toJSON(){return Object(a.b)("SleeveClassWork",this)}static fromJSON(t){return Object(a.a)(f,t.data)}}a.c.constructors.SleeveClassWork=f},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(15),r=n(103),i=n(137),o=n(85),s=n(90),l=n(13),c=n(22);const f=t=>null!==t&&t.type===r.b.CRIME;class u extends r.a{constructor(t){var e,n,a;super(r.b.CRIME),a=0,(n="cyclesWorked")in(e=this)?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,this.crimeType=null!=t?t:i.a.SHOPLIFT}getCrime(){const t=Object.values(o.a).find(t=>t.type===this.crimeType);if(!t)throw new Error("crime should not be undefined");return t}getExp(){const t=this.getCrime();return Object(s.c)({money:t.money*c.a.CrimeMoney,hackExp:t.hacking_exp*c.a.CrimeExpGain,strExp:t.strength_exp*c.a.CrimeExpGain,defExp:t.defense_exp*c.a.CrimeExpGain,dexExp:t.dexterity_exp*c.a.CrimeExpGain,agiExp:t.agility_exp*c.a.CrimeExpGain,chaExp:t.charisma_exp*c.a.CrimeExpGain,intExp:t.intelligence_exp*c.a.CrimeExpGain})}cyclesNeeded(){return this.getCrime().time/l.a._idleSpeed}process(t,e,n){this.cyclesWorked+=n;const a=this.getCrime();let i=this.getExp();return this.cyclesWorked>=this.cyclesNeeded()&&(Math.random(){try{return r.a[t].getInfo().offerHackingWork}catch(t){return console.error("Error when trying to filter Hacking Factions for Coding Contract Generation: "+t),!1}});return e===a.c.FactionReputation&&0===n.length&&(e=a.c.CompanyReputation),e===a.c.FactionReputationAll&&0===n.length&&(e=a.c.CompanyReputation),e===a.c.CompanyReputation&&0===Object.keys(i.a.jobs).length&&(e=a.c.Money),e}(t.type);const e=i.a.factions.filter(t=>r.a[t].getInfo().offerHackingWork);switch(t.type){case a.c.FactionReputation:{const n=e.length,a=e[Object(c.a)(0,n-1)];t.name=a;break}case a.c.CompanyReputation:{const e=Object.keys(i.a.jobs);e.length>0?t.name=e[Object(c.a)(0,e.length-1)]:t.type=a.c.Money;break}}return t}function p(){const t=Object(o.c)().filter(t=>0!==t.serversOnNetwork.length);let e=Object(c.a)(0,t.length-1),n=t[e];for(let a=0;a<200&&(!(n instanceof l.a)||n.purchasedByPlayer||n.hostname===s.a.WorldDaemon);++a)e=Object(c.a)(0,t.length-1),n=t[e];return n}function g(t,e){let n="contract-"+Object(c.a)(0,1e6);for(let e=0;e<1e3&&!(t.contracts.filter(t=>t.fn===n).length<=0);++e)n="contract-"+Object(c.a)(0,1e6);return e.name&&(n+="-"+e.name.replace(/\s/g,"")),n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return o})),n.d(e,"d",(function(){return s}));var a=n(29);let r=0;function i(){return(new Date).getTime()-r>864e5}function o(t){if(i()){for(const e of t.factions)a.a[e].favor++;r=(new Date).getTime()}}function s(t){r=t}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n.n(a),i=n(7),o=n(144);function s({reputation:t}){return r.a.createElement(o.a,{reputation:i.a.formatReputation(t)+" / sec"})}},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(0),r=n(3),i=n(9),o=n(46),s=n(20);function l(t){return a.createElement(s.a,null,a.createElement(o.a,{sx:{my:1,p:1}},a.createElement(i.a,{onClick:t.onClick},t.buttonText),a.createElement(r.a,null,t.infoText)))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(62),r=n(482),i=n(15);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class s extends r.a{constructor(t=null){super(t),o(this,"reqdRank",100),o(this,"teamCount",0),t&&t.reqdRank&&(this.reqdRank=t.reqdRank),t&&t.teamCount&&(this.teamCount=t.teamCount)}getTeamSuccessBonus(t){if(this.teamCount&&this.teamCount>0){this.teamCount=Math.min(this.teamCount,t.teamSize);return Math.pow(this.teamCount,.05)}return 1}getActionTypeSkillSuccessBonus(t){return t.skillMultipliers.successChanceOperation}getChaosDifficultyBonus(t){const e=t.getCurrentCity();if(e.chaos>a.a.ChaosThreshold){const t=e.chaos-a.a.ChaosThreshold+1;return Math.pow(t,.5)}return 1}toJSON(){return Object(i.b)("Operation",this)}static fromJSON(t){return Object(i.a)(s,t.data)}}i.c.constructors.Operation=s},function(t,e,n){"use strict";n.d(e,"e",(function(){return m})),n.d(e,"c",(function(){return h})),n.d(e,"a",(function(){return d})),n.d(e,"b",(function(){return p})),n.d(e,"d",(function(){return g})),n.d(e,"f",(function(){return y}));var a=n(36),r=n(12),i=n(1),o=n(63),s=n(326),l=n(0),c=n.n(l),f=n(5),u=n(13);const m=()=>[new a.a({name:r.a.WKSharmonizer,repCost:1e4,moneyCost:1e6,info:`A copy of the WKS harmonizer from the MIA leader of the ${f.a.ShadowsOfAnarchy} injects *Γ-based cells that provides general enhancement to the body.`,stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes many aspects of infiltration easier and more productive. Such as increased timer, rewards, reduced damage taken, etc."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.MightOfAres,repCost:1e4,moneyCost:1e6,info:"Extra-occular neurons taken from old martial art master. Injecting them gives the user the ability to predict the enemy's attack before they even know it themself.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Slash minigame easier by showing you via an indicator when the slash in coming."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.WisdomOfAthena,repCost:1e4,moneyCost:1e6,info:"A connective brain implant to SASHA that focuses on pattern recognition and predictive templating.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Bracket minigame easier by removing all '[' ']'."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.ChaosOfDionysus,repCost:1e4,moneyCost:1e6,info:"Opto-occipito implant to process visual signals before brain interpretation.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Backwards minigame easier by flipping the words."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.BeautyOfAphrodite,repCost:1e4,moneyCost:1e6,info:"Pheromone extruder injected in the thoracodorsal nerve. Emits pleasing scent guaranteed to make conversational partners more agreeable.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Bribe minigame easier by indicating the incorrect paths."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.TrickeryOfHermes,repCost:1e4,moneyCost:1e6,info:"Penta-dynamo-neurovascular-valve inserted in the carpal ligament, enhances dexterity.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Cheat Code minigame easier by allowing the opposite character."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.FloodOfPoseidon,repCost:1e4,moneyCost:1e6,info:"Transtinatium VVD reticulator used in optico-sterbing recognition.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Symbol matching minigame easier by indicating the correct choice."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.HuntOfArtemis,repCost:1e4,moneyCost:1e6,info:"magneto-turboencabulator based on technology by Micha Eike Siemon, increases the user's electro-magnetic sensitivity.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Minesweeper minigame easier by showing the location of all mines and keeping their position."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]}),new a.a({name:r.a.KnowledgeOfApollo,repCost:1e4,moneyCost:1e6,info:"Neodynic retention fjengeln spoofer using -φ karmions, net positive effect on implantee's delta wave.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation makes the Wire Cutting minigame easier by indicating the incorrect wires."),isSpecial:!0,factions:[f.a.ShadowsOfAnarchy]})],h=()=>[new a.a({name:r.a.HemoRecirculator,moneyCost:45e6,repCost:1e4,info:"A heart implant that greatly increases the body's ability to effectively use and pump blood.",strength:1.08,defense:1.08,agility:1.08,dexterity:1.08,factions:[f.a.Tetrads,f.a.TheDarkArmy,f.a.TheSyndicate]}),new a.a({name:r.a.Targeting1,moneyCost:15e6,repCost:5e3,info:"A cranial implant that is embedded within the inner ear structures and optic nerves. It regulates and enhances balance and hand-eye coordination.",dexterity:1.1,factions:[f.a.SlumSnakes,f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Sector12,f.a.Ishima,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.Targeting2,moneyCost:425e5,repCost:8750,info:"This upgraded version of the 'Augmented Targeting' implant is capable of augmenting reality by digitally displaying weaknesses and vital signs of threats.",prereqs:[r.a.Targeting1],dexterity:1.2,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Sector12,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.Targeting3,moneyCost:115e6,repCost:27500,info:"The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.",prereqs:[r.a.Targeting2,r.a.Targeting1],dexterity:1.3,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries,f.a.TheCovenant]}),new a.a({name:r.a.SyntheticHeart,moneyCost:2875e6,repCost:75e4,info:"This advanced artificial heart, created from plasteel and graphene, is capable of pumping blood more efficiently than an organic heart.",agility:1.5,strength:1.5,factions:[f.a.KuaiGongInternational,f.a.FulcrumSecretTechnologies,f.a.SpeakersForTheDead,f.a.NWO,f.a.TheCovenant,f.a.Daedalus,f.a.Illuminati]}),new a.a({name:r.a.SynfibrilMuscle,repCost:437500,moneyCost:1125e6,info:"The myofibrils in human muscles are injected with special chemicals that react with the proteins inside the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. Scientists have named these artificially enhanced units 'synfibrils'.",strength:1.3,defense:1.3,factions:[f.a.KuaiGongInternational,f.a.FulcrumSecretTechnologies,f.a.SpeakersForTheDead,f.a.NWO,f.a.TheCovenant,f.a.Daedalus,f.a.Illuminati,f.a.BladeIndustries]}),new a.a({name:r.a.CombatRib1,repCost:7500,moneyCost:2375e4,info:"The rib cage is augmented to continuously release boosters into the bloodstream which increase the oxygen-carrying capacity of blood.",strength:1.1,defense:1.1,factions:[f.a.SlumSnakes,f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Volhaven,f.a.Ishima,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.CombatRib2,repCost:18750,moneyCost:65e6,info:"An upgraded version of the 'Combat Rib' augmentation that adds potent stimulants which improve focus and endurance while decreasing reaction time and fatigue.",prereqs:[r.a.CombatRib1],strength:1.14,defense:1.14,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.Volhaven,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries]}),new a.a({name:r.a.CombatRib3,repCost:35e3,moneyCost:12e7,info:"The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that improve muscle mass and physical performance while being safe and free of side effects.",prereqs:[r.a.CombatRib2,r.a.CombatRib1],strength:1.18,defense:1.18,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.OmniTekIncorporated,f.a.KuaiGongInternational,f.a.BladeIndustries,f.a.TheCovenant]}),new a.a({name:r.a.NanofiberWeave,repCost:37500,moneyCost:125e6,info:"Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning, which improves its regenerative and extracellular homeostasis abilities.",strength:1.2,defense:1.2,factions:[f.a.TheDarkArmy,f.a.TheSyndicate,f.a.OmniTekIncorporated,f.a.BladeIndustries,f.a.TianDiHui,f.a.SpeakersForTheDead,f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.SubdermalArmor,repCost:875e3,moneyCost:325e7,info:"The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. The material is implanted underneath the skin, and is the most advanced form of defensive enhancement that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to mitigate damage from any fire or electrical traumas.",defense:2.2,factions:[f.a.TheSyndicate,f.a.FulcrumSecretTechnologies,f.a.Illuminati,f.a.Daedalus,f.a.TheCovenant]}),new a.a({name:r.a.WiredReflexes,repCost:1250,moneyCost:25e5,info:"Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, supercharging the spread of neural signals and increasing reflex speed.",agility:1.05,dexterity:1.05,factions:[f.a.TianDiHui,f.a.SlumSnakes,f.a.Sector12,f.a.Volhaven,f.a.Aevum,f.a.Ishima,f.a.TheSyndicate,f.a.TheDarkArmy,f.a.SpeakersForTheDead]}),new a.a({name:r.a.GrapheneBoneLacings,repCost:1125e3,moneyCost:425e7,info:"Graphene is grafted and fused into the skeletal structure, enhancing bone density and tensile strength.",strength:1.7,defense:1.7,factions:[f.a.FulcrumSecretTechnologies,f.a.TheCovenant]}),new a.a({name:r.a.BionicSpine,repCost:45e3,moneyCost:125e6,info:"The spine is reconstructed using plasteel and carbon fibers. It is now capable of stimulating and regulating neural signals passing through the spinal cord, improving senses and reaction speed. The 'Bionic Spine' also interfaces with all other 'Bionic' implants.",strength:1.15,defense:1.15,agility:1.15,dexterity:1.15,factions:[f.a.SpeakersForTheDead,f.a.TheSyndicate,f.a.KuaiGongInternational,f.a.OmniTekIncorporated,f.a.BladeIndustries]}),new a.a({name:r.a.GrapheneBionicSpine,repCost:1625e3,moneyCost:6e9,info:"An upgrade to the 'Bionic Spine' augmentation. The spine is fused with graphene which enhances durability and supercharges all body functions.",prereqs:[r.a.BionicSpine],strength:1.6,defense:1.6,agility:1.6,dexterity:1.6,factions:[f.a.FulcrumSecretTechnologies,f.a.ECorp]}),new a.a({name:r.a.BionicLegs,repCost:15e4,moneyCost:375e6,info:"Cybernetic legs, created from plasteel and carbon fibers, enhance running speed.",agility:1.6,factions:[f.a.SpeakersForTheDead,f.a.TheSyndicate,f.a.KuaiGongInternational,f.a.OmniTekIncorporated,f.a.BladeIndustries]}),new a.a({name:r.a.GrapheneBionicLegs,repCost:75e4,moneyCost:45e8,info:"An upgrade to the 'Bionic Legs' augmentation. The legs are fused with graphene, greatly enhancing jumping ability.",prereqs:[r.a.BionicLegs],agility:2.5,factions:[f.a.MegaCorp,f.a.ECorp,f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.SpeechProcessor,repCost:7500,moneyCost:5e7,info:"A cochlear implant with an embedded computer that analyzes incoming speech. The embedded computer processes characteristics of incoming speech, such as tone and inflection, to pick up on subtle cues and aid in social interactions.",charisma:1.2,factions:[f.a.TianDiHui,f.a.Chongqing,f.a.Sector12,f.a.NewTokyo,f.a.Aevum,f.a.Ishima,f.a.Volhaven,f.a.Silhouette]}),new a.a({name:r.a.TITN41Injection,repCost:25e3,moneyCost:19e7,info:"TITN is a series of viruses that targets and alters the sequences of human DNA in genes that control personality. The TITN-41 strain alters these genes so that the subject becomes more outgoing and sociable.",charisma:1.15,charisma_exp:1.15,factions:[f.a.Silhouette]}),new a.a({name:r.a.EnhancedSocialInteractionImplant,repCost:375e3,moneyCost:1375e6,info:"A cranial implant that greatly assists in the user's ability to analyze social situations and interactions. The system uses a wide variety of factors such as facial expression, body language, voice tone, and inflection to determine the best course of action during social situations. The implant also uses deep learning software to continuously learn new behavior patterns and how to best respond.",charisma:1.6,charisma_exp:1.6,factions:[f.a.BachmanAssociates,f.a.NWO,f.a.ClarkeIncorporated,f.a.OmniTekIncorporated,f.a.FourSigma]}),new a.a({name:r.a.BitWire,repCost:3750,moneyCost:1e7,info:"A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing capabilities.",hacking:1.05,factions:[f.a.CyberSec,f.a.NiteSec]}),new a.a({name:r.a.ArtificialBioNeuralNetwork,repCost:275e3,moneyCost:3e9,info:"A network consisting of millions of nanoprocessors is embedded into the brain. The network is meant to mimic the way a biological brain solves a problem, with each nanoprocessor acting similar to the way a neuron would in a neural network. However, these nanoprocessors are programmed to perform computations much faster than organic neurons, allowing the user to solve much more complex problems at a much faster rate.",hacking_speed:1.03,hacking_money:1.15,hacking:1.12,factions:[f.a.BitRunners,f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.ArtificialSynapticPotentiation,repCost:6250,moneyCost:8e7,info:"The body is injected with a chemical that artificially induces synaptic potentiation, otherwise known as the strengthening of synapses. This results in enhanced cognitive abilities.",hacking_speed:1.02,hacking_chance:1.05,hacking_exp:1.05,factions:[f.a.TheBlackHand,f.a.NiteSec]}),new a.a({name:r.a.EnhancedMyelinSheathing,repCost:1e5,moneyCost:1375e6,info:"Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. This process results in the proliferation of new, synthetic myelin sheaths in the nervous system. These myelin sheaths can propogate neuro-signals much faster than their organic counterparts, leading to greater processing speeds and better brain function.",hacking_speed:1.03,hacking_exp:1.1,hacking:1.08,factions:[f.a.FulcrumSecretTechnologies,f.a.BitRunners,f.a.TheBlackHand]}),new a.a({name:r.a.SynapticEnhancement,repCost:2e3,moneyCost:75e5,info:"A small cranial implant that continuously uses weak electrical signals to stimulate the brain and induce stronger synaptic activity. This improves the user's cognitive abilities.",hacking_speed:1.03,factions:[f.a.CyberSec,f.a.Aevum]}),new a.a({name:r.a.NeuralRetentionEnhancement,repCost:2e4,moneyCost:25e7,info:"Chemical injections are used to permanently alter and strengthen the brain's neuronal circuits, strengthening the ability to retain information.",hacking_exp:1.25,factions:[f.a.NiteSec]}),new a.a({name:r.a.DataJack,repCost:112500,moneyCost:45e7,info:"A brain implant that provides an interface for direct, wireless communication between a computer's main memory and the mind. This implant allows the user to not only access a computer's memory, but also alter and delete it.",hacking_money:1.25,factions:[f.a.BitRunners,f.a.TheBlackHand,f.a.NiteSec,f.a.Chongqing,f.a.NewTokyo]}),new a.a({name:r.a.ENM,repCost:15e3,moneyCost:25e7,info:"A thin device embedded inside the arm containing a wireless module capable of connecting to nearby networks. Once connected, the Netburner Module is capable of capturing and processing all of the traffic on that network. By itself, the Embedded Netburner Module does not do much, but a variety of very powerful upgrades can be installed that allow you to fully control the traffic on a network.",hacking:1.08,factions:[f.a.BitRunners,f.a.TheBlackHand,f.a.NiteSec,f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.BladeIndustries]}),new a.a({name:r.a.ENMCore,repCost:175e3,moneyCost:25e8,info:"The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgrade allows the Embedded Netburner Module to generate its own data on a network.",prereqs:[r.a.ENM],hacking_speed:1.03,hacking_money:1.1,hacking_chance:1.03,hacking_exp:1.07,hacking:1.07,factions:[f.a.BitRunners,f.a.TheBlackHand,f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.BladeIndustries]}),new a.a({name:r.a.ENMCoreV2,repCost:1e6,moneyCost:45e8,info:"The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgraded firmware allows the Embedded Netburner Module to control information on a network by re-routing traffic, spoofing IP addresses, and altering the data inside network packets.",prereqs:[r.a.ENMCore,r.a.ENM],hacking_speed:1.05,hacking_money:1.3,hacking_chance:1.05,hacking_exp:1.15,hacking:1.08,factions:[f.a.BitRunners,f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.BladeIndustries,f.a.OmniTekIncorporated,f.a.KuaiGongInternational]}),new a.a({name:r.a.ENMCoreV3,repCost:175e4,moneyCost:75e8,info:"The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into any device on a network.",prereqs:[r.a.ENMCoreV2,r.a.ENMCore,r.a.ENM],hacking_speed:1.05,hacking_money:1.4,hacking_chance:1.1,hacking_exp:1.25,hacking:1.1,factions:[f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.Daedalus,f.a.TheCovenant,f.a.Illuminati]}),new a.a({name:r.a.ENMAnalyzeEngine,repCost:625e3,moneyCost:6e9,info:"Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster that vastly outperforms the Netburner Module's native single-core processor.",prereqs:[r.a.ENM],hacking_speed:1.1,factions:[f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.Daedalus,f.a.TheCovenant,f.a.Illuminati]}),new a.a({name:r.a.ENMDMA,repCost:1e6,moneyCost:7e9,info:"This implant installs a Direct Memory Access (DMA) controller into the Embedded Netburner Module. This allows the Module to send and receive data directly to and from the main memory of devices on a network.",prereqs:[r.a.ENM],hacking_money:1.4,hacking_chance:1.2,factions:[f.a.ECorp,f.a.MegaCorp,f.a.FulcrumSecretTechnologies,f.a.NWO,f.a.Daedalus,f.a.TheCovenant,f.a.Illuminati]}),new a.a({name:r.a.Neuralstimulator,repCost:5e4,moneyCost:3e9,info:"A cranial implant that intelligently stimulates certain areas of the brain in order to improve cognitive functions.",hacking_speed:1.02,hacking_chance:1.1,hacking_exp:1.12,factions:[f.a.TheBlackHand,f.a.Chongqing,f.a.Sector12,f.a.NewTokyo,f.a.Aevum,f.a.Ishima,f.a.Volhaven,f.a.BachmanAssociates,f.a.ClarkeIncorporated,f.a.FourSigma]}),new a.a({name:r.a.NeuralAccelerator,repCost:2e5,moneyCost:175e7,info:"A microprocessor that accelerates the processing speed of biological neural networks. This is a cranial implant that is embedded inside the brain.",hacking:1.1,hacking_exp:1.15,hacking_money:1.2,factions:[f.a.BitRunners]}),new a.a({name:r.a.CranialSignalProcessorsG1,repCost:1e4,moneyCost:7e7,info:"The first generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",hacking_speed:1.01,hacking:1.05,factions:[f.a.CyberSec,f.a.NiteSec]}),new a.a({name:r.a.CranialSignalProcessorsG2,repCost:18750,moneyCost:125e6,info:"The second generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG1],hacking_speed:1.02,hacking_chance:1.05,hacking:1.07,factions:[f.a.CyberSec,f.a.NiteSec]}),new a.a({name:r.a.CranialSignalProcessorsG3,repCost:5e4,moneyCost:55e7,info:"The third generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG2,r.a.CranialSignalProcessorsG1],hacking_speed:1.02,hacking_money:1.15,hacking:1.09,factions:[f.a.NiteSec,f.a.TheBlackHand,f.a.BitRunners]}),new a.a({name:r.a.CranialSignalProcessorsG4,repCost:125e3,moneyCost:11e8,info:"The fourth generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG3,r.a.CranialSignalProcessorsG2,r.a.CranialSignalProcessorsG1],hacking_speed:1.02,hacking_money:1.2,hacking_grow:1.25,factions:[f.a.TheBlackHand,f.a.BitRunners]}),new a.a({name:r.a.CranialSignalProcessorsG5,repCost:25e4,moneyCost:225e7,info:"The fifth generation of Cranial Signal Processors. Cranial Signal Processors are a set of specialized microprocessors that are attached to neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations so that the brain doesn't have to.",prereqs:[r.a.CranialSignalProcessorsG4,r.a.CranialSignalProcessorsG3,r.a.CranialSignalProcessorsG2,r.a.CranialSignalProcessorsG1],hacking:1.3,hacking_money:1.25,hacking_grow:1.75,factions:[f.a.BitRunners]}),new a.a({name:r.a.NeuronalDensification,repCost:187500,moneyCost:1375e6,info:"The brain is surgically re-engineered to have increased neuronal density by decreasing the neuron gap junction. Then, the body is genetically modified to enhance the production and capabilities of its neural stem cells.",hacking:1.15,hacking_exp:1.1,hacking_speed:1.03,factions:[f.a.ClarkeIncorporated]}),new a.a({name:r.a.NuoptimalInjectorImplant,repCost:5e3,moneyCost:2e7,info:"This torso implant automatically injects nootropic supplements into the bloodstream to improve memory, increase focus, and provide other cognitive enhancements.",company_rep:1.2,factions:[f.a.TianDiHui,f.a.Volhaven,f.a.NewTokyo,f.a.Chongqing,f.a.ClarkeIncorporated,f.a.FourSigma,f.a.BachmanAssociates]}),new a.a({name:r.a.SpeechEnhancement,repCost:2500,moneyCost:125e5,info:"An advanced neural implant that improves your speaking abilities, making you more convincing and likable in conversations and overall improving your social interactions.",company_rep:1.1,charisma:1.1,factions:[f.a.TianDiHui,f.a.SpeakersForTheDead,f.a.FourSigma,f.a.KuaiGongInternational,f.a.ClarkeIncorporated,f.a.BachmanAssociates]}),new a.a({name:r.a.FocusWire,repCost:75e3,moneyCost:9e8,info:"A cranial implant that stops procrastination by blocking specific neural pathways in the brain.",hacking_exp:1.05,strength_exp:1.05,defense_exp:1.05,dexterity_exp:1.05,agility_exp:1.05,charisma_exp:1.05,company_rep:1.1,work_money:1.2,factions:[f.a.BachmanAssociates,f.a.ClarkeIncorporated,f.a.FourSigma,f.a.KuaiGongInternational]}),new a.a({name:r.a.PCDNI,repCost:375e3,moneyCost:375e7,info:"Installs a Direct-Neural Interface jack into your arm that is compatible with most computers. Connecting to a computer through this jack allows you to interface with it using the brain's electrochemical signals.",company_rep:1.3,hacking:1.08,factions:[f.a.FourSigma,f.a.OmniTekIncorporated,f.a.ECorp,f.a.BladeIndustries]}),new a.a({name:r.a.PCDNIOptimizer,repCost:5e5,moneyCost:45e8,info:"This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It improves the performance of the interface and gives the user more control options to a connected computer.",prereqs:[r.a.PCDNI],company_rep:1.75,hacking:1.1,factions:[f.a.FulcrumSecretTechnologies,f.a.ECorp,f.a.BladeIndustries]}),new a.a({name:r.a.PCDNINeuralNetwork,repCost:15e5,moneyCost:75e8,info:"This is an additional installation that upgrades the functionality of the PC Direct-Neural Interface augmentation. When connected to a computer, the Neural Network upgrade allows the user to use their own brain's processing power to aid the computer in computational tasks.",prereqs:[r.a.PCDNI],company_rep:2,hacking:1.1,hacking_speed:1.05,factions:[f.a.FulcrumSecretTechnologies]}),new a.a({name:r.a.ADRPheromone1,repCost:3750,moneyCost:175e5,info:"The body is genetically re-engineered so that it produces the ADR-V1 pheromone, an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, triggers feelings of admiration and approval in other people.",company_rep:1.1,faction_rep:1.1,factions:[f.a.TianDiHui,f.a.TheSyndicate,f.a.NWO,f.a.MegaCorp,f.a.FourSigma]}),new a.a({name:r.a.ADRPheromone2,repCost:62500,moneyCost:55e7,info:"The body is genetically re-engineered so that it produces the ADR-V2 pheromone, which is similar to but more potent than ADR-V1. This pheromone, when excreted, triggers feelings of admiration, approval, and respect in others.",company_rep:1.2,faction_rep:1.2,factions:[f.a.Silhouette,f.a.FourSigma,f.a.BachmanAssociates,f.a.ClarkeIncorporated]}),new a.a({name:r.a.ShadowsSimulacrum,repCost:37500,moneyCost:4e8,info:"A crude but functional matter phase-shifter module that is embedded in the brainstem and cerebellum. This augmentation was developed by criminal organizations and allows the user to project and control holographic simulacrums within a large radius. These simulacrums are commonly used for espionage and surveillance work.",company_rep:1.15,faction_rep:1.15,factions:[f.a.TheSyndicate,f.a.TheDarkArmy,f.a.SpeakersForTheDead]}),new a.a({name:r.a.HacknetNodeCPUUpload,repCost:3750,moneyCost:11e6,info:"Uploads the architecture and design details of a Hacknet Node's CPU into the brain. This allows the user to engineer custom hardware and software for the Hacknet Node that provides better performance.",hacknet_node_money:1.15,hacknet_node_purchase_cost:.85,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeCacheUpload,repCost:2500,moneyCost:55e5,info:"Uploads the architecture and design details of a Hacknet Node's main-memory cache into the brain. This allows the user to engineer custom cache hardware for the Hacknet Node that offers better performance.",hacknet_node_money:1.1,hacknet_node_level_cost:.85,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeNICUpload,repCost:1875,moneyCost:45e5,info:"Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that offers better performance.",hacknet_node_money:1.1,hacknet_node_purchase_cost:.9,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeKernelDNI,repCost:7500,moneyCost:4e7,info:"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a Hacknet Node. This lets the user access and manipulate the Node's kernel using electrochemical signals.",hacknet_node_money:1.25,factions:[f.a.Netburners]}),new a.a({name:r.a.HacknetNodeCoreDNI,repCost:12500,moneyCost:6e7,info:"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using electrochemical signals.",hacknet_node_money:1.45,factions:[f.a.Netburners]}),new a.a({name:r.a.Neurotrainer1,repCost:1e3,moneyCost:4e6,info:"A decentralized cranial implant that improves the brain's ability to learn. It is installed by releasing millions of nanobots into the human brain, each of which attaches to a different neural pathway to enhance the brain's ability to retain and retrieve information.",hacking_exp:1.1,strength_exp:1.1,defense_exp:1.1,dexterity_exp:1.1,agility_exp:1.1,charisma_exp:1.1,factions:[f.a.CyberSec,f.a.Aevum]}),new a.a({name:r.a.Neurotrainer2,repCost:1e4,moneyCost:45e6,info:"A decentralized cranial implant that improves the brain's ability to learn. This is a more powerful version of the Neurotrainer I augmentation, but it does not require Neurotrainer I to be installed as a prerequisite.",hacking_exp:1.15,strength_exp:1.15,defense_exp:1.15,dexterity_exp:1.15,agility_exp:1.15,charisma_exp:1.15,factions:[f.a.BitRunners,f.a.NiteSec]}),new a.a({name:r.a.Neurotrainer3,repCost:25e3,moneyCost:13e7,info:"A decentralized cranial implant that improves the brain's ability to learn. This is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, but it does not require either of them to be installed as a prerequisite.",hacking_exp:1.2,strength_exp:1.2,defense_exp:1.2,dexterity_exp:1.2,agility_exp:1.2,charisma_exp:1.2,factions:[f.a.NWO,f.a.FourSigma]}),new a.a({name:r.a.Hypersight,repCost:15e4,moneyCost:275e7,info:"A bionic eye implant that grants sight capabilities far beyond those of a natural human. Embedded circuitry within the implant provides the ability to detect heat and movement through solid objects such as walls, thus providing 'x-ray vision'-like capabilities.",dexterity:1.4,hacking_speed:1.03,hacking_money:1.1,factions:[f.a.BladeIndustries,f.a.KuaiGongInternational]}),new a.a({name:r.a.LuminCloaking1,repCost:1500,moneyCost:5e6,info:"A skin implant that reinforces the skin with highly-advanced synthetic cells. These cells, when powered, have a negative refractive index. As a result, they bend light around the skin, making the user much harder to see with the naked eye.",agility:1.05,crime_money:1.1,factions:[f.a.SlumSnakes,f.a.Tetrads]}),new a.a({name:r.a.LuminCloaking2,repCost:5e3,moneyCost:3e7,info:"This is a more advanced version of the LuminCloaking-V1 augmentation. This skin implant reinforces the skin with highly-advanced synthetic cells. These cells, when powered, are capable of not only bending light but also of bending heat, making the user more resilient as well as stealthy.",prereqs:[r.a.LuminCloaking1],agility:1.1,defense:1.1,crime_money:1.25,factions:[f.a.SlumSnakes,f.a.Tetrads]}),new a.a({name:r.a.SmartSonar,repCost:22500,moneyCost:75e6,info:"A cochlear implant that helps the player detect and locate enemies using sound propagation.",dexterity:1.1,dexterity_exp:1.15,crime_money:1.25,factions:[f.a.SlumSnakes]}),new a.a({name:r.a.PowerRecirculator,repCost:25e3,moneyCost:18e7,info:"The body's nerves are attached with polypyrrole nanocircuits that are capable of capturing wasted energy, in the form of heat, and converting it back into usable power.",hacking:1.05,strength:1.05,defense:1.05,dexterity:1.05,agility:1.05,charisma:1.05,hacking_exp:1.1,strength_exp:1.1,defense_exp:1.1,dexterity_exp:1.1,agility_exp:1.1,charisma_exp:1.1,factions:[f.a.Tetrads,f.a.TheDarkArmy,f.a.TheSyndicate,f.a.NWO]}),new a.a({name:r.a.QLink,repCost:1875e3,moneyCost:25e12,info:`A brain implant that wirelessly connects you to the ${f.a.Illuminati}'s quantum supercomputer, allowing you to access and use its incredible computing power.`,hacking:1.75,hacking_speed:2,hacking_chance:2.5,hacking_money:4,factions:[f.a.Illuminati]}),new a.a({name:r.a.SPTN97,repCost:125e4,moneyCost:4875e6,info:"The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an artificially-synthesized gene that was developed by DARPA to create super-soldiers through genetic modification. The gene was outlawed in 2056.",strength:1.75,defense:1.75,dexterity:1.75,agility:1.75,hacking:1.15,factions:[f.a.TheCovenant]}),new a.a({name:r.a.HiveMind,repCost:15e5,moneyCost:55e8,info:`A brain implant developed by ${f.a.ECorp}. They do not reveal what exactly the implant does, but they promise that it will greatly enhance your abilities.`,hacking_grow:3,stats:null,factions:[f.a.ECorp]}),new a.a({name:r.a.TheRedPill,repCost:25e5,moneyCost:0,info:"It's time to leave the cave.",stats:null,isSpecial:!0,factions:[f.a.Daedalus]}),new a.a({name:r.a.CordiARCReactor,repCost:1125e3,moneyCost:5e9,info:"The thoracic cavity is equipped with a small chamber designed to hold and sustain hydrogen plasma. The plasma is used to generate fusion power through nuclear fusion, providing limitless amounts of clean energy for the body.",strength:1.35,defense:1.35,dexterity:1.35,agility:1.35,strength_exp:1.35,defense_exp:1.35,dexterity_exp:1.35,agility_exp:1.35,factions:[f.a.MegaCorp]}),new a.a({name:r.a.SmartJaw,repCost:375e3,moneyCost:275e7,info:"A bionic jaw that contains advanced hardware and software capable of psychoanalyzing and profiling the personality of others using optical imaging software.",charisma:1.5,charisma_exp:1.5,company_rep:1.25,faction_rep:1.25,factions:[f.a.BachmanAssociates]}),new a.a({name:r.a.Neotra,repCost:562500,moneyCost:2875e6,info:"A highly-advanced techno-organic drug that is injected into the skeletal and integumentary system. The drug permanently modifies the DNA of the body's skin and bone cells, granting them the ability to repair and restructure themselves.",strength:1.55,defense:1.55,factions:[f.a.BladeIndustries]}),new a.a({name:r.a.Xanipher,repCost:875e3,moneyCost:425e7,info:"A concoction of advanced nanobots that is orally ingested into the body. These nanobots induce physiological changes and significantly improve the body's functioning in all aspects.",hacking:1.2,strength:1.2,defense:1.2,dexterity:1.2,agility:1.2,charisma:1.2,hacking_exp:1.15,strength_exp:1.15,defense_exp:1.15,dexterity_exp:1.15,agility_exp:1.15,charisma_exp:1.15,factions:[f.a.NWO]}),new a.a({name:r.a.HydroflameLeftArm,repCost:125e4,moneyCost:25e11,info:"The left arm of a legendary BitRunner who ascended beyond this world. It projects a light blue energy shield that protects the exposed inner parts. Even though it contains no weapons, the advanced tungsten titanium alloy increases the user's strength to unbelievable levels. The augmentation gets more powerful over time for seemingly no reason.",strength:2.7,factions:[f.a.NWO]}),new a.a({name:r.a.nextSENS,repCost:437500,moneyCost:1925e6,info:"The body is genetically re-engineered to maintain a state of negligible senescence, preventing the body from deteriorating with age.",hacking:1.2,strength:1.2,defense:1.2,dexterity:1.2,agility:1.2,charisma:1.2,factions:[f.a.ClarkeIncorporated]}),new a.a({name:r.a.OmniTekInfoLoad,repCost:625e3,moneyCost:2875e6,info:"OmniTek's data and information repository is uploaded into your brain, enhancing your programming and hacking abilities.",hacking:1.2,hacking_exp:1.25,factions:[f.a.OmniTekIncorporated]}),new a.a({name:r.a.PhotosyntheticCells,repCost:562500,moneyCost:275e7,info:"Chloroplasts are added to epidermal stem cells and are applied to the body using a skin graft. The result is photosynthetic skin cells, allowing users to generate their own energy and nutrition using solar power.",strength:1.4,defense:1.4,agility:1.4,factions:[f.a.KuaiGongInternational]}),new a.a({name:r.a.Neurolink,repCost:875e3,moneyCost:4375e6,info:`A brain implant that provides a high-bandwidth, direct neural link between your mind and the ${f.a.BitRunners}' data servers, which reportedly contain the largest database of hacking tools and information in the world.`,hacking:1.15,hacking_exp:1.2,hacking_chance:1.1,hacking_speed:1.05,programs:[o.a.FTPCrackProgram.name,o.a.RelaySMTPProgram.name],factions:[f.a.BitRunners]}),new a.a({name:r.a.TheBlackHand,repCost:1e5,moneyCost:55e7,info:"A highly advanced bionic hand. This prosthetic not only enhances strength and dexterity but it is also embedded with hardware and firmware that lets the user connect to, access, and hack devices and machines by just touching them.",strength:1.15,dexterity:1.15,hacking:1.1,hacking_speed:1.02,hacking_money:1.1,factions:[f.a.TheBlackHand]}),new a.a({name:r.a.CRTX42AA,repCost:45e3,moneyCost:225e6,info:"The CRTX42-AA gene is injected into the genome. The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal cortex and improves cognitive abilities.",hacking:1.08,hacking_exp:1.15,factions:[f.a.NiteSec]}),new a.a({name:r.a.Neuregen,repCost:37500,moneyCost:375e6,info:"A drug that genetically modifies the neurons in the brain resulting in neurons that never die, continuously regenerate, and strengthen themselves.",hacking_exp:1.4,factions:[f.a.Chongqing]}),new a.a({name:r.a.CashRoot,repCost:12500,moneyCost:125e6,info:c.a.createElement(c.a.Fragment,null,"A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the chip allows you to connect it to a computer and upload the assets."),startingMoney:1e6,programs:[o.a.BruteSSHProgram.name],factions:[f.a.Sector12]}),new a.a({name:r.a.NutriGen,repCost:6250,moneyCost:25e5,info:"A thermo-powered artificial nutrition generator. Endogenously synthesizes glucose, amino acids, and vitamins and redistributes them across the body. The device is powered by the body's naturally wasted energy in the form of heat.",strength_exp:1.2,defense_exp:1.2,dexterity_exp:1.2,agility_exp:1.2,factions:[f.a.NewTokyo]}),new a.a({name:r.a.PCMatrix,repCost:1e5,moneyCost:2e9,info:"A 'Probability Computation Matrix' is installed in the frontal cortex. This implant uses advanced mathematical algorithims to rapidly identify and compute statistical outcomes of nearly every situation.",charisma:1.0777,charisma_exp:1.0777,work_money:1.777,faction_rep:1.0777,company_rep:1.0777,crime_success:1.0777,crime_money:1.0777,programs:[o.a.DeepscanV1.name,o.a.AutoLink.name],factions:[f.a.Aevum]}),new a.a({name:r.a.INFRARet,repCost:7500,moneyCost:3e7,info:"A tiny chip that sits behind the retinae. This implant lets the user visually detect infrared radiation.",crime_success:1.25,crime_money:1.1,dexterity:1.1,factions:[f.a.Ishima]}),new a.a({name:r.a.DermaForce,repCost:15e3,moneyCost:5e7,info:"Synthetic skin that is grafted onto the body. This skin consists of millions of nanobots capable of projecting high-density muon beams, creating an energy barrier around the user.",defense:1.4,factions:[f.a.Volhaven]}),new a.a({name:r.a.GrapheneBrachiBlades,repCost:225e3,moneyCost:25e8,info:"An upgrade to the BrachiBlades augmentation. It infuses the retractable blades with an advanced graphene material making them stronger and lighter.",prereqs:[r.a.BrachiBlades],strength:1.4,defense:1.4,crime_success:1.1,crime_money:1.3,factions:[f.a.SpeakersForTheDead]}),new a.a({name:r.a.GrapheneBionicArms,repCost:5e5,moneyCost:375e7,info:"An upgrade to the Bionic Arms augmentation. It infuses the prosthetic arms with an advanced graphene material to make them stronger and lighter.",prereqs:[r.a.BionicArms],strength:1.85,dexterity:1.85,factions:[f.a.TheDarkArmy]}),new a.a({name:r.a.BrachiBlades,repCost:12500,moneyCost:9e7,info:"A set of retractable plasteel blades that are implanted in the arm, underneath the skin.",strength:1.15,defense:1.15,crime_success:1.1,crime_money:1.15,factions:[f.a.TheSyndicate]}),new a.a({name:r.a.BionicArms,repCost:62500,moneyCost:275e6,info:"Cybernetic arms created from plasteel and carbon fibers that completely replace the user's organic arms.",strength:1.3,dexterity:1.3,factions:[f.a.Tetrads]}),new a.a({name:r.a.SNA,repCost:6250,moneyCost:3e7,info:"A cranial implant that affects the user's personality, making them better at negotiation in social situations.",work_money:1.1,company_rep:1.15,faction_rep:1.15,factions:[f.a.TianDiHui]}),new a.a({name:r.a.NeuroreceptorManager,repCost:75e3,moneyCost:55e7,info:"A brain implant carefully assembled around the synapses, which micromanages the activity and levels of various neuroreceptor chemicals and modulates electrical activity to optimize concentration, allowing the user to multitask much more effectively.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation removes the penalty for not focusing on actions such as working in a job or working for a faction."),factions:[f.a.TianDiHui]}),new a.a({name:r.a.CongruityImplant,repCost:1/0,moneyCost:5e13,info:c.a.createElement(c.a.Fragment,null,"Developed by a pioneer in Grafting research, this implant generates pulses of stability which seem to have a nullifying effect versus the Entropy virus.",c.a.createElement("br",null),c.a.createElement("br",null),c.a.createElement("b",null,"Note:")," For unknown reasons, the lowercase ",c.a.createElement("code",null,"n")," appears to be an integral component to its functionality."),stats:c.a.createElement(c.a.Fragment,null,"This Augmentation removes the Entropy virus, and prevents it from affecting you again."),factions:[]})],d=()=>[new a.a({name:r.a.EsperEyewear,repCost:1250,moneyCost:165e6,info:"Ballistic-grade protective and retractable eyewear that was designed specifically for Bladeburner units. This is implanted by installing a mechanical frame in the skull's orbit. This frame interfaces with the brain and allows the user to automatically extrude and extract the eyewear. The eyewear protects against debris, shrapnel, lasers, blinding flashes, and gas. It is also embedded with a data processing chip that can be programmed to display an AR HUD to assist the user in field missions.",bladeburner_success_chance:1.03,dexterity:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.EMS4Recombination,repCost:2500,moneyCost:275e6,info:"A DNA recombination of the EMS-4 Gene. This genetic engineering technique was originally used on Bladeburners during the Synthoid uprising to induce wakefulness and concentration, suppress fear, reduce empathy, improve reflexes, and improve memory among other things.",bladeburner_success_chance:1.03,bladeburner_analysis:1.05,bladeburner_stamina_gain:1.02,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.OrionShoulder,repCost:6250,moneyCost:55e7,info:"A bionic shoulder augmentation for the right shoulder. Using cybernetics, the ORION-MKIV shoulder enhances the strength and dexterity of the user's right arm. It also provides protection due to its crystallized graphene plating.",defense:1.05,strength:1.05,dexterity:1.05,bladeburner_success_chance:1.04,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.HyperionV1,repCost:12500,moneyCost:275e7,info:"A pair of mini plasma cannons embedded into the hands. The Hyperion is capable of rapidly firing bolts of high-density plasma. The weapon is meant to be used against augmented enemies as the ionized nature of the plasma disrupts the electrical systems of Augmentations. However, it can also be effective against non-augmented enemies due to its high temperature and concussive force.",bladeburner_success_chance:1.06,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.HyperionV2,repCost:25e3,moneyCost:55e8,info:"A pair of mini plasma cannons embedded into the hands. This augmentation is more advanced and powerful than the original V1 model. This V2 model is more power-efficient, more accurate, and can fire plasma bolts at a much higher velocity than the V1 model.",prereqs:[r.a.HyperionV1],bladeburner_success_chance:1.08,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.GolemSerum,repCost:31250,moneyCost:11e9,info:"A serum that permanently enhances many aspects of human capabilities, including strength, speed, immune system enhancements, and mitochondrial efficiency. The serum was originally developed by the Chinese military in an attempt to create super soldiers.",strength:1.07,defense:1.07,dexterity:1.07,agility:1.07,bladeburner_stamina_gain:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.VangelisVirus,repCost:18750,moneyCost:275e7,info:"A synthetic symbiotic virus that is injected into human brain tissue. The Vangelis virus heightens the senses and focus of its host, and also enhances its intuition.",dexterity_exp:1.1,bladeburner_analysis:1.1,bladeburner_success_chance:1.04,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.VangelisVirus3,repCost:37500,moneyCost:11e9,info:"An improved version of Vangelis, a synthetic symbiotic virus that is injected into human brain tissue. On top of the benefits of the original virus, this also grants accelerated healing and enhanced reflexes.",prereqs:[r.a.VangelisVirus],defense_exp:1.1,dexterity_exp:1.1,bladeburner_analysis:1.15,bladeburner_success_chance:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.INTERLINKED,repCost:25e3,moneyCost:55e8,info:"The DNA is genetically modified to enhance the human's body extracellular matrix (ECM). This improves the ECM's ability to structurally support the body and grants heightened strength and durability.",strength_exp:1.05,defense_exp:1.05,dexterity_exp:1.05,agility_exp:1.05,bladeburner_max_stamina:1.1,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeRunner,repCost:2e4,moneyCost:825e7,info:`A cybernetic foot augmentation that was specifically created for ${f.a.Bladeburners} during the Synthoid Uprising. The organic musculature of the human foot is enhanced with flexible carbon nanotube matrices that are controlled by intelligent servo-motors.`,agility:1.05,bladeburner_max_stamina:1.05,bladeburner_stamina_gain:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmor,repCost:12500,moneyCost:1375e6,info:`A powered exoskeleton suit designed as armor for ${f.a.Bladeburners} units. This exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, concussive, thermal, chemical, and electric trauma. It also enhances the user's physical abilities.`,strength:1.04,defense:1.04,dexterity:1.04,agility:1.04,bladeburner_stamina_gain:1.02,bladeburner_success_chance:1.03,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorPowerCells,repCost:18750,moneyCost:275e7,info:"Upgrades the BLADE-51b Tesla Armor with Ion Power Cells, which are capable of more efficiently storing and using power.",prereqs:[r.a.BladeArmor],bladeburner_success_chance:1.05,bladeburner_stamina_gain:1.02,bladeburner_max_stamina:1.05,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorEnergyShielding,repCost:21250,moneyCost:55e8,info:"Upgrades the BLADE-51b Tesla Armor with a plasma energy propulsion system that is capable of projecting an energy shielding force field.",prereqs:[r.a.BladeArmor],defense:1.05,bladeburner_success_chance:1.06,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorUnibeam,repCost:31250,moneyCost:165e8,info:"Upgrades the BLADE-51b Tesla Armor with a concentrated deuterium-fluoride laser weapon. It's precision and accuracy makes it useful for quickly neutralizing threats while keeping casualties to a minimum.",prereqs:[r.a.BladeArmor],bladeburner_success_chance:1.08,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorOmnibeam,repCost:62500,moneyCost:275e8,info:"Upgrades the BLADE-51b Tesla Armor Unibeam augmentation to use a multiple-fiber system. This upgraded weapon uses multiple fiber laser modules that combine together to form a single, more powerful beam of up to 2000MW.",prereqs:[r.a.BladeArmorUnibeam],bladeburner_success_chance:1.1,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladeArmorIPU,repCost:15e3,moneyCost:11e8,info:"Upgrades the BLADE-51b Tesla Armor with an AI Information Processing Unit that was specially designed to analyze Synthoid related data and information.",prereqs:[r.a.BladeArmor],bladeburner_analysis:1.15,bladeburner_success_chance:1.02,isSpecial:!0,factions:[f.a.Bladeburners]}),new a.a({name:r.a.BladesSimulacrum,repCost:1250,moneyCost:15e10,info:"A highly-advanced matter phase-shifter module that is embedded in the brainstem and cerebellum. This augmentation allows the user to project and control a holographic simulacrum within an extremely large radius. These specially-modified holograms were specifically weaponized by Bladeburner units to be used against Synthoids.",stats:c.a.createElement(c.a.Fragment,null,"This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting crimes, etc.) at the same time."),isSpecial:!0,factions:[f.a.Bladeburners]})],p=()=>[new a.a({name:r.a.StaneksGift1,repCost:0,moneyCost:0,info:'Allison "Mother" Stanek imparts you with her gift. An experimental Augmentation implanted at the base of the neck. It allows you to overclock your entire system by carefully changing the configuration.',isSpecial:!0,hacking_chance:.9,hacking_speed:.9,hacking_money:.9,hacking_grow:.9,hacking:.9,strength:.9,defense:.9,dexterity:.9,agility:.9,charisma:.9,hacking_exp:.9,strength_exp:.9,defense_exp:.9,dexterity_exp:.9,agility_exp:.9,charisma_exp:.9,company_rep:.9,faction_rep:.9,crime_money:.9,crime_success:.9,hacknet_node_money:.9,hacknet_node_purchase_cost:1.1,hacknet_node_ram_cost:1.1,hacknet_node_core_cost:1.1,hacknet_node_level_cost:1.1,work_money:.9,stats:c.a.createElement(c.a.Fragment,null,"Its unstable nature decreases all your stats by 10%"),factions:[f.a.ChurchOfTheMachineGod]}),new a.a({name:r.a.StaneksGift2,repCost:1e6,moneyCost:0,info:"The next evolution is near, a coming together of man and machine. A synthesis greater than the birth of the human organism. Time spent with the gift has allowed for acclimatization of the invasive augment and the toll it takes upon your frame granting a 5% reduced penalty to all stats.",prereqs:[r.a.StaneksGift1],isSpecial:!0,hacking_chance:.95/.9,hacking_speed:.95/.9,hacking_money:.95/.9,hacking_grow:.95/.9,hacking:.95/.9,strength:.95/.9,defense:.95/.9,dexterity:.95/.9,agility:.95/.9,charisma:.95/.9,hacking_exp:.95/.9,strength_exp:.95/.9,defense_exp:.95/.9,dexterity_exp:.95/.9,agility_exp:.95/.9,charisma_exp:.95/.9,company_rep:.95/.9,faction_rep:.95/.9,crime_money:.95/.9,crime_success:.95/.9,hacknet_node_money:.95/.9,hacknet_node_purchase_cost:1.05/1.1,hacknet_node_ram_cost:1.05/1.1,hacknet_node_core_cost:1.05/1.1,hacknet_node_level_cost:1.05/1.1,work_money:.95/.9,stats:c.a.createElement(c.a.Fragment,null,"The penalty for the gift is reduced to 5%"),factions:[f.a.ChurchOfTheMachineGod]}),new a.a({name:r.a.StaneksGift3,repCost:1e8,moneyCost:0,info:"The synthesis of human and machine is nothing to fear. It is our destiny. You will become greater than the sum of our parts. As One. Embrace your gift fully and wholly free of it's accursed toll. Serenity brings tranquility in the form of no longer suffering a stat penalty. ",prereqs:[r.a.StaneksGift2,r.a.StaneksGift1],isSpecial:!0,hacking_chance:1/.95,hacking_speed:1/.95,hacking_money:1/.95,hacking_grow:1/.95,hacking:1/.95,strength:1/.95,defense:1/.95,dexterity:1/.95,agility:1/.95,charisma:1/.95,hacking_exp:1/.95,strength_exp:1/.95,defense_exp:1/.95,dexterity_exp:1/.95,agility_exp:1/.95,charisma_exp:1/.95,company_rep:1/.95,faction_rep:1/.95,crime_money:1/.95,crime_success:1/.95,hacknet_node_money:1/.95,hacknet_node_purchase_cost:1/1.05,hacknet_node_ram_cost:1/1.05,hacknet_node_core_cost:1/1.05,hacknet_node_level_cost:1/1.05,work_money:1/.95,stats:c.a.createElement(c.a.Fragment,null,"Stanek's Gift has no penalty."),factions:[f.a.ChurchOfTheMachineGod]})];function g(){const t=u.a.Donations/1e6/100;return new a.a({name:r.a.NeuroFluxGovernor,repCost:500,moneyCost:75e4,info:"A device that is embedded in the back of the neck. The NeuroFlux Governor monitors and regulates nervous impulses coming to and from the spinal column, essentially 'governing' the body. By doing so, it improves the functionality of the body's nervous system.",stats:c.a.createElement(c.a.Fragment,null,"This special augmentation can be leveled up infinitely. Each level of this augmentation increases MOST multipliers by 1% (+",(100*t).toFixed(6),"% boosted by real life blood donations), stacking multiplicatively."),isSpecial:!0,hacking_chance:1.01+t,hacking_speed:1.01+t,hacking_money:1.01+t,hacking_grow:1.01+t,hacking:1.01+t,strength:1.01+t,defense:1.01+t,dexterity:1.01+t,agility:1.01+t,charisma:1.01+t,hacking_exp:1.01+t,strength_exp:1.01+t,defense_exp:1.01+t,dexterity_exp:1.01+t,agility_exp:1.01+t,charisma_exp:1.01+t,company_rep:1.01+t,faction_rep:1.01+t,crime_money:1.01+t,crime_success:1.01+t,hacknet_node_money:1.01+t,hacknet_node_purchase_cost:1/(1.01+t),hacknet_node_ram_cost:1/(1.01+t),hacknet_node_core_cost:1/(1.01+t),hacknet_node_level_cost:1/(1.01+t),work_money:1.01+t,factions:Object.values(f.a).filter(t=>![f.a.ShadowsOfAnarchy,f.a.Bladeburners,f.a.ChurchOfTheMachineGod].includes(t))})}function y(){const t=function(){const t=[{bonuses:{hacking_chance:1.25,hacking_speed:1.1,hacking_money:1.25,hacking_grow:1.1},description:"Increases the player's hacking chance by 25%.
Increases the player's hacking speed by 10%.
Increases the amount of money the player's gains from hacking by 25%.
Improves grow() by 10%."},{bonuses:{hacking:1.15,hacking_exp:2},description:"Increases the player's hacking skill by 15%.
Increases the player's hacking experience gain rate by 100%."},{bonuses:{strength:1.25,strength_exp:2,defense:1.25,defense_exp:2,dexterity:1.25,dexterity_exp:2,agility:1.25,agility_exp:2},description:"Increases all of the player's combat stats by 25%.
Increases all of the player's combat stat experience gain rate by 100%."},{bonuses:{charisma:1.5,charisma_exp:2},description:"This augmentation increases the player's charisma by 50%.
Increases the player's charisma experience gain rate by 100%."},{bonuses:{hacknet_node_money:1.2,hacknet_node_purchase_cost:.85,hacknet_node_ram_cost:.85,hacknet_node_core_cost:.85,hacknet_node_level_cost:.85},description:"Increases the amount of money produced by Hacknet Nodes by 20%.
Decreases all costs related to Hacknet Node by 15%."},{bonuses:{company_rep:1.25,faction_rep:1.15,work_money:1.7},description:"Increases the amount of money the player gains from working by 70%.
Increases the amount of reputation the player gains when working for a company by 25%.
Increases the amount of reputation the player gains for a faction by 15%."},{bonuses:{crime_success:2,crime_money:2},description:"Increases the player's crime success rate by 100%.
Increases the amount of money the player gains from crimes by 100%."}],e=new s.c(Math.floor(i.a.lastUpdate/36e5));for(let t=0;t<5;t++)e.step();return t[Math.floor(t.length*e.random())]}(),e={name:r.a.UnstableCircadianModulator,moneyCost:5e9,repCost:362500,info:"An experimental nanobot injection. Its unstable nature leads to unpredictable results based on your circadian rhythm.",factions:[f.a.SpeakersForTheDead]};return Object.keys(t.bonuses).forEach(n=>e[n]=t.bonuses[n]),new a.a(e)}},,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(5),r=n(10),i=n(66),o=n(89);const s=[{hackDifficulty:99,hostname:r.a.AevumECorp.toLowerCase(),moneyAvailable:{max:7e10,min:3e10},networkLayer:15,numOpenPortsRequired:5,organizationName:r.a.AevumECorp,requiredHackingSkill:{max:1400,min:1050},serverGrowth:99,specialName:r.a.AevumECorp},{hackDifficulty:99,hostname:r.a.Sector12MegaCorp.toLowerCase(),moneyAvailable:{max:6e10,min:4e10},networkLayer:15,numOpenPortsRequired:5,organizationName:r.a.Sector12MegaCorp,requiredHackingSkill:{max:1350,min:1100},serverGrowth:99,specialName:r.a.Sector12MegaCorp},{hackDifficulty:{max:88,min:72},hostname:"b-and-a",moneyAvailable:{max:3e10,min:15e9},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.AevumBachmanAndAssociates,requiredHackingSkill:{max:1150,min:900},serverGrowth:{max:80,min:60},specialName:r.a.AevumBachmanAndAssociates},{hackDifficulty:{max:97,min:88},hostname:"blade",literature:[i.a.BeyondMan],maxRamExponent:{max:9,min:5},moneyAvailable:{max:4e10,min:1e10},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.Sector12BladeIndustries,requiredHackingSkill:{max:1200,min:900},serverGrowth:{max:85,min:55},specialName:r.a.Sector12BladeIndustries},{hackDifficulty:99,hostname:r.a.VolhavenNWO.toLowerCase(),literature:[i.a.TheHiddenWorld],moneyAvailable:{max:4e10,min:2e10},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.VolhavenNWO,requiredHackingSkill:{max:1300,min:950},serverGrowth:{max:95,min:65},specialName:r.a.VolhavenNWO},{hackDifficulty:{max:65,min:45},hostname:"clarkinc",literature:[i.a.BeyondMan,i.a.CostOfImmortality],moneyAvailable:{max:25e9,min:15e9},networkLayer:14,numOpenPortsRequired:5,organizationName:r.a.AevumClarkeIncorporated,requiredHackingSkill:{max:1250,min:950},serverGrowth:{max:75,min:45},specialName:r.a.AevumClarkeIncorporated},{hackDifficulty:{max:99,min:90},hostname:"omnitek",literature:[i.a.CodedIntelligence,i.a.HistoryOfSynthoids],maxRamExponent:{max:9,min:7},moneyAvailable:{max:22e9,min:13e9},networkLayer:13,numOpenPortsRequired:5,organizationName:r.a.VolhavenOmniTekIncorporated,requiredHackingSkill:{max:1100,min:900},serverGrowth:{max:99,min:95},specialName:r.a.VolhavenOmniTekIncorporated},{hackDifficulty:{max:75,min:55},hostname:"4sigma",moneyAvailable:{max:25e9,min:15e9},networkLayer:13,numOpenPortsRequired:5,organizationName:r.a.Sector12FourSigma,requiredHackingSkill:{max:1250,min:900},serverGrowth:{max:99,min:75},specialName:r.a.Sector12FourSigma},{hackDifficulty:{max:99,min:95},hostname:"kuai-gong",moneyAvailable:{max:3e10,min:2e10},networkLayer:13,numOpenPortsRequired:5,organizationName:r.a.ChongqingKuaiGongInternational,requiredHackingSkill:{max:1300,min:950},serverGrowth:{max:99,min:90},specialName:r.a.ChongqingKuaiGongInternational},{hackDifficulty:{max:97,min:83},hostname:"fulcrumtech",literature:[i.a.SimulatedReality],maxRamExponent:{max:11,min:7},moneyAvailable:{max:18e8,min:14e8},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.AevumFulcrumTechnologies,requiredHackingSkill:{max:1250,min:950},serverGrowth:{max:99,min:80},specialName:r.a.AevumFulcrumTechnologies},{hackDifficulty:99,hostname:"fulcrumassets",moneyAvailable:1e6,networkLayer:15,numOpenPortsRequired:5,organizationName:r.a.AevumFulcrumTechnologies,requiredHackingSkill:{max:1600,min:1100},serverGrowth:1,specialName:o.a.FulcrumSecretTechnologies},{hackDifficulty:{max:92,min:78},hostname:"stormtech",moneyAvailable:{max:12e8,min:1e9},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.IshimaStormTechnologies,requiredHackingSkill:{max:1075,min:875},serverGrowth:{max:92,min:68},specialName:r.a.IshimaStormTechnologies},{hackDifficulty:{max:96,min:84},hostname:"defcomm",moneyAvailable:{max:95e7,min:8e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.a.NewTokyoDefComm,requiredHackingSkill:{max:1050,min:850},serverGrowth:{max:73,min:47},specialName:r.a.NewTokyoDefComm},{hackDifficulty:{max:90,min:70},hostname:"infocomm",moneyAvailable:{max:9e8,min:6e8},networkLayer:10,numOpenPortsRequired:5,organizationName:"InfoComm",requiredHackingSkill:{max:950,min:875},serverGrowth:{max:75,min:35}},{hackDifficulty:{max:95,min:85},hostname:"helios",literature:[i.a.BeyondMan],maxRamExponent:{max:8,min:5},moneyAvailable:{max:75e7,min:55e7},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.VolhavenHeliosLabs,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:80,min:70},specialName:r.a.VolhavenHeliosLabs},{hackDifficulty:{max:90,min:80},hostname:r.a.NewTokyoVitaLife.toLowerCase(),literature:[i.a.AGreenTomorrow],maxRamExponent:{max:7,min:4},moneyAvailable:{max:8e8,min:7e8},networkLayer:12,numOpenPortsRequired:5,organizationName:r.a.NewTokyoVitaLife,requiredHackingSkill:{max:900,min:775},serverGrowth:{max:80,min:60},specialName:r.a.NewTokyoVitaLife},{hackDifficulty:{max:95,min:85},hostname:"icarus",moneyAvailable:{max:1e9,min:9e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.a.Sector12IcarusMicrosystems,requiredHackingSkill:{max:925,min:850},serverGrowth:{max:95,min:85},specialName:r.a.Sector12IcarusMicrosystems},{hackDifficulty:{max:90,min:80},hostname:"univ-energy",maxRamExponent:{max:7,min:4},moneyAvailable:{max:12e8,min:11e8},networkLayer:9,numOpenPortsRequired:4,organizationName:r.a.Sector12UniversalEnergy,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:90,min:80},specialName:r.a.Sector12UniversalEnergy},{hackDifficulty:{max:80,min:70},hostname:"titan-labs",literature:[i.a.CodedIntelligence],maxRamExponent:{max:7,min:4},moneyAvailable:{max:9e8,min:75e7},networkLayer:11,numOpenPortsRequired:5,organizationName:"Titan Laboratories",requiredHackingSkill:{max:875,min:800},serverGrowth:{max:80,min:60}},{hackDifficulty:{max:75,min:65},hostname:"microdyne",literature:[i.a.SyntheticMuscles],maxRamExponent:{max:6,min:4},moneyAvailable:{max:7e8,min:5e8},networkLayer:11,numOpenPortsRequired:5,organizationName:"Microdyne Technologies",requiredHackingSkill:{max:875,min:800},serverGrowth:{max:90,min:70}},{hackDifficulty:{max:80,min:70},hostname:"taiyang-digital",literature:[i.a.AGreenTomorrow,i.a.BrighterThanTheSun],moneyAvailable:{max:9e8,min:8e8},networkLayer:10,numOpenPortsRequired:5,organizationName:"Taiyang Digital",requiredHackingSkill:{max:950,min:850},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:65,min:55},hostname:"galactic-cyber",moneyAvailable:{max:85e7,min:75e7},networkLayer:7,numOpenPortsRequired:5,organizationName:r.a.AevumGalacticCybersystems,requiredHackingSkill:{max:875,min:825},serverGrowth:{max:90,min:70},specialName:r.a.AevumGalacticCybersystems},{hackDifficulty:{max:90,min:80},hostname:r.a.AevumAeroCorp.toLowerCase(),literature:[i.a.ManAndMachine],moneyAvailable:{max:12e8,min:1e9},networkLayer:7,numOpenPortsRequired:5,organizationName:r.a.AevumAeroCorp,requiredHackingSkill:{max:925,min:850},serverGrowth:{max:65,min:55},specialName:r.a.AevumAeroCorp},{hackDifficulty:{max:95,min:85},hostname:"omnia",literature:[i.a.HistoryOfSynthoids],maxRamExponent:{max:6,min:4},moneyAvailable:{max:1e9,min:9e8},networkLayer:8,numOpenPortsRequired:5,organizationName:r.a.VolhavenOmniaCybersystems,requiredHackingSkill:{max:950,min:850},serverGrowth:{max:70,min:60},specialName:r.a.VolhavenOmniaCybersystems},{hackDifficulty:{max:65,min:55},hostname:"zb-def",literature:[i.a.SyntheticMuscles],moneyAvailable:{max:11e8,min:9e8},networkLayer:10,numOpenPortsRequired:4,organizationName:"ZB Defense Industries",requiredHackingSkill:{max:825,min:775},serverGrowth:{max:75,min:65}},{hackDifficulty:{max:80,min:60},hostname:"applied-energetics",moneyAvailable:{max:1e9,min:7e8},networkLayer:11,numOpenPortsRequired:4,organizationName:"Applied Energetics",requiredHackingSkill:{max:850,min:775},serverGrowth:{max:75,min:70}},{hackDifficulty:{max:80,min:70},hostname:"solaris",literature:[i.a.AGreenTomorrow,i.a.TheFailedFrontier],maxRamExponent:{max:7,min:4},moneyAvailable:{max:9e8,min:7e8},networkLayer:9,numOpenPortsRequired:5,organizationName:r.a.ChongqingSolarisSpaceSystems,requiredHackingSkill:{max:850,min:750},serverGrowth:{max:80,min:70},specialName:r.a.ChongqingSolarisSpaceSystems},{hackDifficulty:{max:85,min:75},hostname:r.a.Sector12DeltaOne.toLowerCase(),moneyAvailable:{max:17e8,min:13e8},networkLayer:8,numOpenPortsRequired:5,organizationName:r.a.Sector12DeltaOne,requiredHackingSkill:{max:900,min:800},serverGrowth:{max:70,min:50},specialName:r.a.Sector12DeltaOne},{hackDifficulty:{max:85,min:75},hostname:"global-pharm",literature:[i.a.AGreenTomorrow],maxRamExponent:{max:6,min:3},moneyAvailable:{max:175e7,min:15e8},networkLayer:7,numOpenPortsRequired:4,organizationName:r.a.NewTokyoGlobalPharmaceuticals,requiredHackingSkill:{max:850,min:750},serverGrowth:{max:90,min:80},specialName:r.a.NewTokyoGlobalPharmaceuticals},{hackDifficulty:{max:80,min:60},hostname:"nova-med",moneyAvailable:{max:125e7,min:11e8},networkLayer:10,numOpenPortsRequired:4,organizationName:r.a.IshimaNovaMedical,requiredHackingSkill:{max:850,min:775},serverGrowth:{max:85,min:65},specialName:r.a.IshimaNovaMedical},{hackDifficulty:{max:90,min:70},hostname:"zeus-med",moneyAvailable:{max:15e8,min:13e8},networkLayer:9,numOpenPortsRequired:5,organizationName:"Zeus Medical",requiredHackingSkill:{max:850,min:800},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:80,min:70},hostname:"unitalife",maxRamExponent:{max:6,min:4},moneyAvailable:{max:11e8,min:1e9},networkLayer:8,numOpenPortsRequired:4,organizationName:"UnitaLife Group",requiredHackingSkill:{max:825,min:775},serverGrowth:{max:80,min:70}},{hackDifficulty:{max:80,min:60},hostname:"lexo-corp",maxRamExponent:{max:7,min:4},moneyAvailable:{max:8e8,min:7e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.a.VolhavenLexoCorp,requiredHackingSkill:{max:750,min:650},serverGrowth:{max:65,min:55},specialName:r.a.VolhavenLexoCorp},{hackDifficulty:{max:60,min:40},hostname:"rho-construction",maxRamExponent:{max:6,min:4},moneyAvailable:{max:7e8,min:5e8},networkLayer:6,numOpenPortsRequired:3,organizationName:r.a.AevumRhoConstruction,requiredHackingSkill:{max:525,min:475},serverGrowth:{max:60,min:40},specialName:r.a.AevumRhoConstruction},{hackDifficulty:{max:70,min:50},hostname:"alpha-ent",literature:[i.a.Sector12Crime],maxRamExponent:{max:7,min:4},moneyAvailable:{max:75e7,min:6e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.a.Sector12AlphaEnterprises,requiredHackingSkill:{max:600,min:500},serverGrowth:{max:60,min:50},specialName:r.a.Sector12AlphaEnterprises},{hackDifficulty:{max:80,min:70},hostname:"aevum-police",maxRamExponent:{max:6,min:4},moneyAvailable:{max:4e8,min:2e8},networkLayer:6,numOpenPortsRequired:4,organizationName:r.a.AevumPolice,requiredHackingSkill:{max:450,min:400},serverGrowth:{max:50,min:30},specialName:r.a.AevumPolice},{hackDifficulty:{max:55,min:45},hostname:"rothman-uni",literature:[i.a.SecretSocieties,i.a.TheFailedFrontier,i.a.TensionsInTechRace],maxRamExponent:{max:7,min:4},moneyAvailable:{max:25e7,min:175e6},networkLayer:5,numOpenPortsRequired:3,organizationName:r.a.Sector12RothmanUniversity,requiredHackingSkill:{max:430,min:370},serverGrowth:{max:45,min:35},specialName:r.a.Sector12RothmanUniversity},{hackDifficulty:{max:85,min:65},hostname:"zb-institute",maxRamExponent:{max:7,min:4},moneyAvailable:{max:11e8,min:8e8},networkLayer:5,numOpenPortsRequired:5,organizationName:r.a.VolhavenZBInstituteOfTechnology,requiredHackingSkill:{max:775,min:725},serverGrowth:{max:85,min:75},specialName:r.a.VolhavenZBInstituteOfTechnology},{hackDifficulty:{max:65,min:45},hostname:"summit-uni",literature:[i.a.SecretSocieties,i.a.TheFailedFrontier,i.a.SyntheticMuscles],maxRamExponent:{max:6,min:4},moneyAvailable:{max:35e7,min:2e8},networkLayer:5,numOpenPortsRequired:3,organizationName:r.a.AevumSummitUniversity,requiredHackingSkill:{max:475,min:425},serverGrowth:{max:60,min:40},specialName:r.a.AevumSummitUniversity},{hackDifficulty:{max:80,min:60},hostname:"syscore",moneyAvailable:{max:6e8,min:4e8},networkLayer:5,numOpenPortsRequired:4,organizationName:r.a.VolhavenSysCoreSecurities,requiredHackingSkill:{max:650,min:550},serverGrowth:{max:70,min:60},specialName:r.a.VolhavenSysCoreSecurities},{hackDifficulty:{max:70,min:60},hostname:"catalyst",literature:[i.a.TensionsInTechRace],maxRamExponent:{max:7,min:4},moneyAvailable:{max:55e7,min:3e8},networkLayer:5,numOpenPortsRequired:3,organizationName:"Catalyst Ventures",requiredHackingSkill:{max:450,min:400},serverGrowth:{max:55,min:25}},{hackDifficulty:{max:45,min:35},hostname:"the-hub",maxRamExponent:{max:6,min:3},moneyAvailable:{max:2e8,min:15e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"The Hub",requiredHackingSkill:{max:325,min:275},serverGrowth:{max:55,min:45}},{hackDifficulty:{max:65,min:55},hostname:r.a.VolhavenCompuTek.toLowerCase(),literature:[i.a.ManAndMachine],moneyAvailable:{max:25e7,min:22e7},networkLayer:4,numOpenPortsRequired:3,organizationName:r.a.VolhavenCompuTek,requiredHackingSkill:{max:400,min:300},serverGrowth:{max:65,min:45},specialName:r.a.VolhavenCompuTek},{hackDifficulty:{max:80,min:60},hostname:"netlink",literature:[i.a.SimulatedReality],maxRamExponent:{max:7,min:4},moneyAvailable:275e6,networkLayer:4,numOpenPortsRequired:3,organizationName:r.a.AevumNetLinkTechnologies,requiredHackingSkill:{max:425,min:375},serverGrowth:{max:75,min:45},specialName:r.a.AevumNetLinkTechnologies},{hackDifficulty:{max:65,min:35},hostname:"johnson-ortho",moneyAvailable:{max:85e6,min:7e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"Johnson Orthopedics",requiredHackingSkill:{max:300,min:250},serverGrowth:{max:65,min:35}},{hackDifficulty:1,hostname:"n00dles",literature:[],maxRamExponent:2,moneyAvailable:7e4,networkLayer:1,numOpenPortsRequired:0,organizationName:r.a.NewTokyoNoodleBar,requiredHackingSkill:1,serverGrowth:3e3,specialName:r.a.NewTokyoNoodleBar},{hackDifficulty:10,hostname:r.a.Sector12FoodNStuff.toLowerCase(),literature:[i.a.Sector12Crime],maxRamExponent:4,moneyAvailable:2e6,networkLayer:1,numOpenPortsRequired:0,organizationName:r.a.Sector12FoodNStuff,requiredHackingSkill:1,serverGrowth:5,specialName:r.a.Sector12FoodNStuff},{hackDifficulty:10,hostname:"sigma-cosmetics",maxRamExponent:4,moneyAvailable:23e5,networkLayer:1,numOpenPortsRequired:0,organizationName:"Sigma Cosmetics",requiredHackingSkill:5,serverGrowth:10},{hackDifficulty:15,hostname:"joesguns",maxRamExponent:4,moneyAvailable:25e5,networkLayer:1,numOpenPortsRequired:0,organizationName:r.a.Sector12JoesGuns,requiredHackingSkill:10,serverGrowth:20,specialName:r.a.Sector12JoesGuns},{hackDifficulty:25,hostname:"zer0",maxRamExponent:5,moneyAvailable:75e5,networkLayer:2,numOpenPortsRequired:1,organizationName:"ZER0 Nightclub",requiredHackingSkill:75,serverGrowth:40},{hackDifficulty:20,hostname:"nectar-net",maxRamExponent:4,moneyAvailable:275e4,networkLayer:2,numOpenPortsRequired:0,organizationName:"Nectar Nightclub Network",requiredHackingSkill:20,serverGrowth:25},{hackDifficulty:25,hostname:"neo-net",literature:[i.a.TheHiddenWorld],maxRamExponent:5,moneyAvailable:5e6,networkLayer:3,numOpenPortsRequired:1,organizationName:"Neo Nightclub Network",requiredHackingSkill:50,serverGrowth:25},{hackDifficulty:30,hostname:"silver-helix",literature:[i.a.NewTriads],maxRamExponent:6,moneyAvailable:45e6,networkLayer:3,numOpenPortsRequired:2,organizationName:"Silver Helix",requiredHackingSkill:150,serverGrowth:30},{hackDifficulty:15,hostname:"hong-fang-tea",literature:[i.a.BrighterThanTheSun],maxRamExponent:4,moneyAvailable:3e6,networkLayer:1,numOpenPortsRequired:0,organizationName:"HongFang Teahouse",requiredHackingSkill:30,serverGrowth:20},{hackDifficulty:15,hostname:"harakiri-sushi",maxRamExponent:4,moneyAvailable:4e6,networkLayer:1,numOpenPortsRequired:0,organizationName:"HaraKiri Sushi Bar Network",requiredHackingSkill:40,serverGrowth:40},{hackDifficulty:20,hostname:"phantasy",maxRamExponent:5,moneyAvailable:24e6,networkLayer:3,numOpenPortsRequired:2,organizationName:"Phantasy Club",requiredHackingSkill:100,serverGrowth:35},{hackDifficulty:15,hostname:"max-hardware",maxRamExponent:5,moneyAvailable:1e7,networkLayer:2,numOpenPortsRequired:1,organizationName:"Max Hardware Store",requiredHackingSkill:80,serverGrowth:30},{hackDifficulty:{max:35,min:25},hostname:"omega-net",literature:[i.a.TheNewGod],maxRamExponent:5,moneyAvailable:{max:7e7,min:6e7},networkLayer:3,numOpenPortsRequired:2,organizationName:r.a.IshimaOmegaSoftware,requiredHackingSkill:{max:220,min:180},serverGrowth:{max:40,min:30},specialName:r.a.IshimaOmegaSoftware},{hackDifficulty:{max:45,min:35},hostname:"crush-fitness",moneyAvailable:{max:6e7,min:4e7},networkLayer:4,numOpenPortsRequired:2,organizationName:"Crush Fitness",requiredHackingSkill:{max:275,min:225},serverGrowth:{max:33,min:27},specialName:r.a.AevumCrushFitnessGym},{hackDifficulty:30,hostname:"iron-gym",maxRamExponent:5,moneyAvailable:2e7,networkLayer:1,numOpenPortsRequired:1,organizationName:r.a.Sector12IronGym+" Network",requiredHackingSkill:100,serverGrowth:20,specialName:r.a.Sector12IronGym},{hackDifficulty:{max:55,min:45},hostname:"millenium-fitness",maxRamExponent:{max:8,min:4},moneyAvailable:25e7,networkLayer:6,numOpenPortsRequired:3,organizationName:"Millenium Fitness Network",requiredHackingSkill:{max:525,min:475},serverGrowth:{max:45,min:25},specialName:r.a.VolhavenMilleniumFitnessGym},{hackDifficulty:{max:65,min:55},hostname:"powerhouse-fitness",maxRamExponent:{max:6,min:4},moneyAvailable:9e8,networkLayer:14,numOpenPortsRequired:5,organizationName:"Powerhouse Fitness",requiredHackingSkill:{max:1100,min:950},serverGrowth:{max:60,min:50},specialName:r.a.Sector12PowerhouseGym},{hackDifficulty:{max:60,min:40},hostname:"snap-fitness",moneyAvailable:45e7,networkLayer:7,numOpenPortsRequired:4,organizationName:"Snap Fitness",requiredHackingSkill:{max:800,min:675},serverGrowth:{max:60,min:40},specialName:r.a.AevumSnapFitnessGym},{hackDifficulty:0,hostname:"run4theh111z",literature:[i.a.SimulatedReality,i.a.TheNewGod],maxRamExponent:{max:9,min:5},moneyAvailable:0,networkLayer:11,numOpenPortsRequired:4,organizationName:"The Runners",requiredHackingSkill:{max:550,min:505},serverGrowth:0,specialName:o.a.BitRunnersServer},{hackDifficulty:0,hostname:"I.I.I.I",literature:[i.a.DemocracyIsDead],maxRamExponent:{max:8,min:4},moneyAvailable:0,networkLayer:5,numOpenPortsRequired:3,organizationName:"I.I.I.I",requiredHackingSkill:{max:365,min:340},serverGrowth:0,specialName:o.a.TheBlackHandServer},{hackDifficulty:0,hostname:"avmnite-02h",literature:[i.a.DemocracyIsDead],maxRamExponent:{max:7,min:4},moneyAvailable:0,networkLayer:4,numOpenPortsRequired:2,organizationName:a.a.NiteSec,requiredHackingSkill:{max:220,min:202},serverGrowth:0,specialName:o.a.NiteSecServer},{hackDifficulty:0,hostname:".",maxRamExponent:4,moneyAvailable:0,networkLayer:13,numOpenPortsRequired:4,organizationName:".",requiredHackingSkill:{max:550,min:505},serverGrowth:0,specialName:o.a.TheDarkArmyServer},{hackDifficulty:0,hostname:"CSEC",literature:[i.a.DemocracyIsDead],maxRamExponent:3,moneyAvailable:0,networkLayer:2,numOpenPortsRequired:1,organizationName:a.a.CyberSec,requiredHackingSkill:{max:60,min:51},serverGrowth:0,specialName:o.a.CyberSecServer},{hackDifficulty:0,hostname:"The-Cave",literature:[i.a.AlphaOmega],moneyAvailable:0,networkLayer:15,numOpenPortsRequired:5,organizationName:"Helios",requiredHackingSkill:925,serverGrowth:0,specialName:o.a.DaedalusServer},{hackDifficulty:0,hostname:"w0r1d_d43m0n",moneyAvailable:0,numOpenPortsRequired:5,organizationName:"w0r1d_d43m0n",requiredHackingSkill:3e3,serverGrowth:0,specialName:o.a.WorldDaemon},{hostname:o.a.DarkWeb,moneyAvailable:0,numOpenPortsRequired:5,organizationName:o.a.DarkWeb,requiredHackingSkill:1,specialName:o.a.DarkWeb}]},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(15),r=n(103);const i=6e4/n(13).a._idleSpeed,o=t=>null!==t&&t.type===r.b.INFILTRATE;class s extends r.a{constructor(){var t,e,n;super(r.b.INFILTRATE),n=0,(e="cyclesWorked")in(t=this)?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n}cyclesNeeded(){return i}process(t,e,n){if(!t.bladeburner)throw new Error("sleeve doing blade work without being a member");return this.cyclesWorked+=n,this.cyclesWorked>this.cyclesNeeded()&&(this.cyclesWorked-=this.cyclesNeeded(),t.bladeburner.infiltrateSynthoidCommunities(t)),0}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveInfiltrateWork",this)}static fromJSON(t){return Object(a.a)(s,t.data)}}a.c.constructors.SleeveInfiltrateWork=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(13),r=n(32);class i{constructor(t){this.name=t.name,this.nextPosition=t.nextPosition,this.baseSalary=t.baseSalary,this.repMultiplier=t.repMultiplier,this.requiredHacking=null!=t.reqdHacking?t.reqdHacking:0,this.requiredStrength=null!=t.reqdStrength?t.reqdStrength:0,this.requiredDefense=null!=t.reqdDefense?t.reqdDefense:0,this.requiredDexterity=null!=t.reqdDexterity?t.reqdDexterity:0,this.requiredAgility=null!=t.reqdAgility?t.reqdAgility:0,this.requiredCharisma=null!=t.reqdCharisma?t.reqdCharisma:0,this.requiredReputation=null!=t.reqdReputation?t.reqdReputation:0,this.hackingEffectiveness=null!=t.hackingEffectiveness?t.hackingEffectiveness:0,this.strengthEffectiveness=null!=t.strengthEffectiveness?t.strengthEffectiveness:0,this.defenseEffectiveness=null!=t.defenseEffectiveness?t.defenseEffectiveness:0,this.dexterityEffectiveness=null!=t.dexterityEffectiveness?t.dexterityEffectiveness:0,this.agilityEffectiveness=null!=t.agilityEffectiveness?t.agilityEffectiveness:0,this.charismaEffectiveness=null!=t.charismaEffectiveness?t.charismaEffectiveness:0,100!==Math.round(this.hackingEffectiveness+this.strengthEffectiveness+this.defenseEffectiveness+this.dexterityEffectiveness+this.agilityEffectiveness+this.charismaEffectiveness)&&console.error(`CompanyPosition ${this.name} parameters do not sum to 100`),this.hackingExpGain=null!=t.hackingExpGain?t.hackingExpGain:0,this.strengthExpGain=null!=t.strengthExpGain?t.strengthExpGain:0,this.defenseExpGain=null!=t.defenseExpGain?t.defenseExpGain:0,this.dexterityExpGain=null!=t.dexterityExpGain?t.dexterityExpGain:0,this.agilityExpGain=null!=t.agilityExpGain?t.agilityExpGain:0,this.charismaExpGain=null!=t.charismaExpGain?t.charismaExpGain:0}calculateJobPerformance(t,e,n,r,i,o){const s=this.hackingEffectiveness*t/a.a.MaxSkillLevel,l=this.strengthEffectiveness*e/a.a.MaxSkillLevel,c=this.defenseEffectiveness*n/a.a.MaxSkillLevel,f=this.dexterityEffectiveness*r/a.a.MaxSkillLevel,u=this.agilityEffectiveness*i/a.a.MaxSkillLevel,m=this.charismaEffectiveness*o/a.a.MaxSkillLevel;let h=this.repMultiplier*(s+l+c+f+u+m)/100;return isNaN(h)&&(console.error("Company reputation gain calculated to be NaN"),h=0),h}isSoftwareJob(){return r.j.includes(this.name)}isITJob(){return r.d.includes(this.name)}isSecurityEngineerJob(){return r.i.includes(this.name)}isNetworkEngineerJob(){return r.f.includes(this.name)}isBusinessJob(){return r.b.includes(this.name)}isSecurityJob(){return r.h.includes(this.name)}isAgentJob(){return r.a.includes(this.name)}isSoftwareConsultantJob(){return r.k.includes(this.name)}isBusinessConsultantJob(){return r.c.includes(this.name)}isPartTimeJob(){return r.g.includes(this.name)}}},function(t,e,n){"use strict";n.d(e,"c",(function(){return i})),n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(154),r=n(98);function i(t,e){const n=t.organizationName;let i=null;if("string"==typeof n&&""!==n&&(i=r.a[n]),!(i instanceof a.a))return;const o=e/t.moneyMax;Math.random(){let t=5;const a=[],r=setInterval(()=>{if(t--,t>0)return;t=5*Math.random();const r=Math.random()*e.length,o=e.charAt(r);n(t=>i(t,r,function(t){const e=t=>t[Math.floor(Math.random()*t.length)],n=["abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ","1234567890"," _","()[]{}<>"];for(const a of n)if(a.includes(t))return e(a);return e("!@#$%^&*()_+|\\';\"/.,?`~")}(o))),a.push(window.setTimeout(()=>{n(t=>i(t,r,o))},500))},20);return()=>{clearInterval(r),a.forEach(t=>clearTimeout(t))}},[]),r.a.createElement("span",null,e)}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return p})),n.d(e,"a",(function(){return g}));var a=n(0),r=n.n(a),i=n(13),o=n(12),s=n(648),l=n(153),c=n(280),f=n(114),u=n(16),m=n(15),h=n(400),d=n(74);const p=t=>null!==t&&t.type===l.b.GRAFTING;class g extends l.a{constructor(t){var e,n;super(l.b.GRAFTING,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.unitCompleted=0,this.augmentation=null!==(n=null==t?void 0:t.augmentation)&&void 0!==n?n:o.a.Targeting1;const a=Object(s.a)();null!=t&&t.player&&t.player.loseMoney(a[this.augmentation].cost,"augmentations")}unitNeeded(){return new h.a(d.a[this.augmentation]).time}process(t,e){let n=1;return t.hasAugmentation(o.a.NeuroreceptorManager)||(n=t.focus?1:i.a.BaseFocusBonus),this.cyclesWorked+=e,this.unitCompleted+=i.a._idleSpeed*e*Object(c.c)(t)*n,this.unitCompleted>=this.unitNeeded()}finish(t,e){const n=this.augmentation;e?e&&!this.singularity&&Object(u.a)(r.a.createElement(r.a.Fragment,null,"You cancelled the grafting of ",n,".",r.a.createElement("br",null),"Your money was not returned to you.")):(Object(f.a)({name:n,level:1}),t.hasAugmentation(o.a.CongruityImplant)||(t.entropy+=1,t.applyEntropy(t.entropy)),this.singularity||Object(u.a)(r.a.createElement(r.a.Fragment,null,"You've finished grafting ",n,".",r.a.createElement("br",null),"The augmentation has been applied to your body"," ",t.hasAugmentation(o.a.CongruityImplant)?".":", but you feel a bit off."))),e||t.gainIntelligenceExp(i.a.IntelligenceGraftBaseExpGain*this.cyclesWorked*i.a._idleSpeed/1e4)}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,augmentation:this.augmentation}}toJSON(){return Object(m.b)("GraftingWork",this)}static fromJSON(t){return Object(m.a)(g,t.data)}}m.c.constructors.GraftingWork=g},,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(5),o=n(26),s=n(365),l=n(3);class c{constructor(t){var e,n,a,i,o,s,l;this.infoText=null!==(e=t.infoText)&&void 0!==e?e:r.a.createElement(r.a.Fragment,null),this.enemies=null!==(n=t.enemies)&&void 0!==n?n:[],this.offerHackingWork=null!==(a=t.offerHackingWork)&&void 0!==a&&a,this.offerFieldWork=null!==(i=t.offerFieldWork)&&void 0!==i&&i,this.offerSecurityWork=null!==(o=t.offerSecurityWork)&&void 0!==o&&o,this.keep=null!==(s=t.keepOnInstall)&&void 0!==s&&s,this.special=null!==(l=t.special)&&void 0!==l&&l,this.assignment=t.assignment}offersWork(){return this.offerFieldWork||this.offerHackingWork||this.offerSecurityWork}}const f={[i.a.Illuminati]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And from this chaos, we are the invisible hand that guides them to order."," "),offerHackingWork:!0,offerFieldWork:!0}),[i.a.Daedalus]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.TheCovenant]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Surrender yourself. Give up your empty individuality to become part of something great, something eternal. Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.",r.a.createElement("br",null),r.a.createElement("br",null),"Only then can you discover immortality."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.ECorp]:new c({infoText:r.a.createElement(r.a.Fragment,null,i.a.ECorp,"'s mission is simple: to connect the world of today with the technology of tomorrow. With our wide range of Internet-related software and commercial hardware, ",i.a.ECorp," makes the world's information universally accessible."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.MegaCorp]:new c({infoText:r.a.createElement(r.a.Fragment,null,i.a.MegaCorp," does what no other dares to do. We imagine. We create. We invent. We create what others have never even dreamed of. Our work fills the world's needs for food, water, power, and transportation on an unprecedented scale, in ways that no other company can.",r.a.createElement("br",null),r.a.createElement("br",null),"In our labs and factories and on the ground with customers, ",i.a.MegaCorp," is ushering in a new era for the world."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.BachmanAssociates]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Where Law and Business meet - that's where we are.",r.a.createElement("br",null),r.a.createElement("br",null),"Legal Insight - Business Instinct - Innovative Experience."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.BladeIndustries]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Augmentation is Salvation."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.NWO]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given purpose and direction in life. That is why they created God. And that is why they created civilization - not because of willingness, but because of a need to be incorporated into higher orders of structure and meaning."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.ClarkeIncorporated]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The Power of the Genome - Unlocked."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.OmniTekIncorporated]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Simply put, our mission is to design and build robots that make a difference."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.FourSigma]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by deep learning and innovative ideas. And improved by iteration. That's ",i.a.FourSigma,"."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.KuaiGongInternational]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Dream big. Work hard. Make history."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.FulcrumSecretTechnologies]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it would be necessary to create them. And now we can."),offerHackingWork:!0,offerSecurityWork:!0,keepOnInstall:!0}),[i.a.BitRunners]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be reconstructed. Transformed. Used.",r.a.createElement("br",null),r.a.createElement("br",null),"Those who run the bits, run the world."),offerHackingWork:!0}),[i.a.TheBlackHand]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power. Technological power. And those at the top rule with an invisible hand. They built a society where the rich get richer, and everyone else suffers.",r.a.createElement("br",null),r.a.createElement("br",null),"So much pain. So many lives. Their darkness must end."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.NiteSec]:new c({infoText:r.a.createElement(r.a.Fragment,null," __..__ ",r.a.createElement("br",null)," _.nITESECNIt. ",r.a.createElement("br",null)," .-'NITESECNITESEc. ",r.a.createElement("br",null)," .' NITESECNITESECn ",r.a.createElement("br",null)," / NITESECNITESEC; ",r.a.createElement("br",null)," : :NITESECNITESEC; ",r.a.createElement("br",null)," ; $ NITESECNITESECN ",r.a.createElement("br",null)," : _, ,N'ITESECNITESEC ",r.a.createElement("br",null)," : .+^^`, : `NITESECNIT ",r.a.createElement("br",null)," ) /), `-,-=,NITESECNI ",r.a.createElement("br",null)," / ^ ,-;|NITESECN; ",r.a.createElement("br",null)," / _.' '-';NITESECN ",r.a.createElement("br",null)," ( , ,-''`^NITE' ",r.a.createElement("br",null)," )` :`. .' ",r.a.createElement("br",null)," )-- ; `- / ",r.a.createElement("br",null)," ' _.-' : ",r.a.createElement("br",null)," ( _.-' . ",r.a.createElement("br",null)," ------. ",r.a.createElement("br",null)," . ",r.a.createElement("br",null)," _.nIt ",r.a.createElement("br",null)," _.nITESECNi ",r.a.createElement("br",null)," nITESECNIT^' ",r.a.createElement("br",null)," NITE^' ___ ",r.a.createElement("br",null)," / .gP''''Tp. ",r.a.createElement("br",null)," : d' . `b ",r.a.createElement("br",null)," ; d' o `b ; ",r.a.createElement("br",null)," / d; `b| ",r.a.createElement("br",null)," /, $; @ `: ",r.a.createElement("br",null)," /' $/ ; ",r.a.createElement("br",null)," .' $/b o | ",r.a.createElement("br",null)," .' d$/$; : ",r.a.createElement("br",null)," / .d/$/$; , ; ",r.a.createElement("br",null)," d .dNITESEC $ | ",r.a.createElement("br",null)," :bp.__.gNITESEC/$ :$ ; ",r.a.createElement("br",null)," NITESECNITESECNIT /$b : ",r.a.createElement("br",null)),offerHackingWork:!0,offerFieldWork:!1,offerSecurityWork:!1,special:!1,keepOnInstall:!1}),[i.a.Aevum]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The Silicon City."),enemies:[i.a.Chongqing,i.a.NewTokyo,i.a.Ishima,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Chongqing]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Serve the People."),enemies:[i.a.Sector12,i.a.Aevum,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Ishima]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The East Asian Order of the Future."),enemies:[i.a.Sector12,i.a.Aevum,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.NewTokyo]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Asia's World City."),enemies:[i.a.Sector12,i.a.Aevum,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Sector12]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The City of the Future."),enemies:[i.a.Chongqing,i.a.NewTokyo,i.a.Ishima,i.a.Volhaven],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Volhaven]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Benefit, Honor, and Glory."),enemies:[i.a.Chongqing,i.a.Sector12,i.a.NewTokyo,i.a.Aevum,i.a.Ishima],offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.SpeakersForTheDead]:new c({infoText:r.a.createElement(r.a.Fragment,null,"It is better to reign in Hell than to serve in Heaven."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.TheDarkArmy]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The World doesn't care about right or wrong. It only cares about power."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.TheSyndicate]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Honor holds you back."),offerHackingWork:!0,offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Silhouette]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Corporations have filled the void of power left behind by the collapse of Western government. The issue is they've become so big that you don't know who they're working for. And if you're employed at one of these corporations, you don't even know who you're working for.",r.a.createElement("br",null),r.a.createElement("br",null),"That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system."),offerHackingWork:!0,offerFieldWork:!0}),[i.a.Tetrads]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Following the mandate of Heaven and carrying out the way."),offerFieldWork:!0,offerSecurityWork:!0}),[i.a.SlumSnakes]:new c({infoText:r.a.createElement(r.a.Fragment,null,i.a.SlumSnakes," rule!"),offerFieldWork:!0,offerSecurityWork:!0}),[i.a.Netburners]:new c({infoText:r.a.createElement(r.a.Fragment,null,"~~//*>H4CK||3T 8URN3R5**>?>\\~~"),offerHackingWork:!0}),[i.a.TianDiHui]:new c({infoText:r.a.createElement(r.a.Fragment,null,"Obey Heaven and work righteously."),offerHackingWork:!0,offerSecurityWork:!0}),[i.a.CyberSec]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy that we have ever had. And as the world becomes increasingly dominated by it, society approaches the brink of total chaos. We serve only to protect society, to protect humanity, to protect the world from imminent collapse."),offerHackingWork:!0}),[i.a.Bladeburners]:new c({infoText:r.a.createElement(r.a.Fragment,null,"It's too bad they won't live. But then again, who does?",r.a.createElement("br",null),r.a.createElement("br",null),"Note that for this faction, reputation can only be gained through ",i.a.Bladeburners," actions."," ","Completing ",i.a.Bladeburners," contracts/operations will increase your reputation."),special:!0,assignment:()=>{const t=o.b.Router();return r.a.createElement(s.a,{buttonText:"Open Bladeburner headquarters",infoText:"You can gain reputation with bladeburner by completing contracts and operations.",onClick:()=>t.toBladeburner()})}}),[i.a.ChurchOfTheMachineGod]:new c({infoText:r.a.createElement(r.a.Fragment,null," `` ",r.a.createElement("br",null)," -odmmNmds: ",r.a.createElement("br",null)," `hNmo:..-omNh. ",r.a.createElement("br",null)," yMd` `hNh ",r.a.createElement("br",null)," mMd oNm ",r.a.createElement("br",null)," oMNo .mM/ ",r.a.createElement("br",null)," `dMN+ -mM+ ",r.a.createElement("br",null)," -mMNo -mN+ ",r.a.createElement("br",null)," .+- :mMNo/mN/ ",r.a.createElement("br",null),":yNMd. :NMNNN/ ",r.a.createElement("br",null),"-mMMMh. /NMMh` ",r.a.createElement("br",null)," .dMMMd. /NMMMy` ",r.a.createElement("br",null)," `yMMMd. /NNyNMMh` ",r.a.createElement("br",null)," `sMMMd. +Nm: +NMMh. ",r.a.createElement("br",null)," oMMMm- oNm: /NMMd. ",r.a.createElement("br",null)," +NMMmsMm- :mMMd. ",r.a.createElement("br",null)," /NMMMm- -mMMd. ",r.a.createElement("br",null)," /MMMm- -mMMd. ",r.a.createElement("br",null)," `sMNMMm- .mMmo ",r.a.createElement("br",null)," `sMd:hMMm. ./. ",r.a.createElement("br",null)," `yMy` `yNMd` ",r.a.createElement("br",null)," `hMs` oMMy ",r.a.createElement("br",null)," `hMh sMN- ",r.a.createElement("br",null)," /MM- .NMo ",r.a.createElement("br",null)," +MM: :MM+ ",r.a.createElement("br",null)," sNNo-.`.-omNy` ",r.a.createElement("br",null)," -smNNNNmdo- ",r.a.createElement("br",null)," `..` ",r.a.createElement("br",null),r.a.createElement("br",null),"Many cultures predict an end to humanity in the near future, a final Armageddon that will end the world; but we disagree."),offerHackingWork:!1,offerFieldWork:!1,offerSecurityWork:!1,special:!0,keepOnInstall:!0,assignment:()=>{const t=o.b.Router();return r.a.createElement(s.a,{buttonText:"Open Staneks Gift",infoText:"Stanek's Gift is a powerful augmentation that powers up the stat you chose to boost.Gaining reputation with the Church of the Machine God can only be done by charging the gift.",onClick:()=>t.toStaneksGift()})}}),[i.a.ShadowsOfAnarchy]:new c({infoText:r.a.createElement(r.a.Fragment,null,"The government is ruled by the corporations that we have allowed to consume it. To release the world from its shackles, the gods grant us their strength."),special:!0,keepOnInstall:!0,assignment:()=>r.a.createElement(l.a,null,i.a.ShadowsOfAnarchy," can only gain reputation by infiltrating.")})}},function(t,e,n){"use strict";n.d(e,"b",(function(){return f})),n.d(e,"a",(function(){return u}));var a=n(22),r=n(13),i=n(108),o=n(90),s=n(232);const l=1e3/r.a._idleSpeed,c={[i.a.HACKING]:Object(o.c)({hackExp:15}),[i.a.FIELD]:Object(o.c)({hackExp:10,strExp:10,defExp:10,dexExp:10,agiExp:10,chaExp:10}),[i.a.SECURITY]:Object(o.c)({hackExp:5,strExp:15,defExp:15,dexExp:15,agiExp:15})},f=(t,e,n)=>({[i.a.HACKING]:s.c,[i.a.FIELD]:s.a,[i.a.SECURITY]:s.b}[e](t,n));function u(t,e){const n=c[e];return{money:0,reputation:0,hackExp:n.hackExp*t.mults.hacking_exp*a.a.FactionWorkExpGain/l,strExp:n.strExp*t.mults.strength_exp*a.a.FactionWorkExpGain/l,defExp:n.defExp*t.mults.defense_exp*a.a.FactionWorkExpGain/l,dexExp:n.dexExp*t.mults.dexterity_exp*a.a.FactionWorkExpGain/l,agiExp:n.agiExp*t.mults.agility_exp*a.a.FactionWorkExpGain/l,chaExp:n.chaExp*t.mults.charisma_exp*a.a.FactionWorkExpGain/l,intExp:0}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(246),r=n(15);function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class o{constructor(){i(this,"capacity",0),i(this,"hashes",0),i(this,"upgrades",{});for(const t of Object.keys(a.a))this.upgrades[t]=0}getMult(t){const e=a.a[t],n=this.upgrades[t];return null==e||null==n?(console.error("Could not find Hash Study upgrade"),1):1+e.value*n/100}getStudyMult(){return this.getMult("Improve Studying")}getTrainingMult(){return this.getMult("Improve Gym Training")}getUpgrade(t){const e=a.a[t];return e||(console.error("Invalid Upgrade Name given to HashManager.getUpgrade(): "+t),null)}getUpgradeCost(t,e=1){const n=this.getUpgrade(t),a=this.upgrades[t];return null==n||null==a?(console.error("Invalid Upgrade Name given to HashManager.getUpgradeCost(): "+t),1/0):n.getCost(a,e)}prestige(){for(const t of Object.keys(a.a))this.upgrades[t]=0;this.hashes=0,this.updateCapacity(0)}refundUpgrade(t,e=1){const n=a.a[t];this.upgrades[t]-=e;const r=this.upgrades[t];if(null==n||null==r||r<0)return void console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t);const i=n.getCost(r,e);this.hashes+=i}storeHashes(t){this.hashes+=t;let e=this.hashes;return this.hashes=Math.min(this.hashes,this.capacity),e-=this.hashes,e}updateCapacity(t){t<0&&(this.capacity=0),this.capacity=Math.max(t,0)}upgrade(t,e=1){if(null==a.a[t])return console.error("Invalid Upgrade Name given to HashManager.upgrade(): "+t),!1;const n=this.getUpgradeCost(t,e);return!(this.hashes=this.size}process(t=1,e,n){if(n.hasResearch("HRBuddy-Recruitment")&&!this.atCapacity()){const t=this.hireRandomEmployee();n.hasResearch("HRBuddy-Training")&&void 0!==t&&(t.pos=a.a.Training)}for(const t of this.employees)t.pos=t.nextPos;this.calculateTotalEmployees(),this.calculateNextEmployees(),this.maxEne=100,this.maxHap=100,this.maxMor=100,n.hasResearch("Go-Juice")&&(this.maxEne+=10),n.hasResearch("JoyWire")&&(this.maxHap+=10),n.hasResearch("Sti.mu")&&(this.maxMor+=10),n.hasResearch("AutoBrew")&&(this.autoCoffee=!0),n.hasResearch("AutoPartyManager")&&(this.autoParty=!0);let r=1;e.funds<0&&n.lastCycleRevenue<0?r=Math.pow(.99,t):e.funds>0&&n.lastCycleRevenue>0&&(r=Math.pow(1.01,t));let i=0;for(const e of this.employees){if(i+=e.process(t),this.autoCoffee)e.ene=this.maxEne;else if(this.coffeeMult>1){const t=1+(this.coffeeMult-1)*this.employees.length/this.coffeeEmployees;e.ene*=t}else e.ene*=r;if(this.autoParty)e.mor=this.maxMor,e.hap=this.maxHap;else if(this.partyMult>1){const t=1+(this.partyMult-1)*this.employees.length/this.partyEmployees;e.mor*=t,e.hap*=t}else e.mor*=r,e.hap*=r;e.ene=Math.max(Math.min(e.ene,this.maxEne),this.minEne),e.mor=Math.max(Math.min(e.mor,this.maxMor),this.minMor),e.hap=Math.max(Math.min(e.hap,this.maxHap),this.minHap)}return this.coffeeMult=0,this.partyMult=0,this.coffeeEmployees=0,this.partyEmployees=0,this.calculateEmployeeProductivity(e,n),i}calculateNextEmployees(){for(const t of Object.keys(this.employeeNextJobs))this.employeeNextJobs[t]=0;for(let t=0;t=e&&(r.nextPos=a.a.Unassigned,n--)}return this.calculateNextEmployees(),n===e}getCoffeeCost(){return 5e5*this.employees.length}setCoffee(t=1.05){return t>1&&0===this.coffeeMult&&!this.autoCoffee&&this.employees.length>0&&(this.coffeeMult=t,this.coffeeEmployees=this.employees.length,!0)}setParty(t){return t>1&&0===this.partyMult&&!this.autoParty&&this.employees.length>0&&(this.partyMult=t,this.partyEmployees=this.employees.length,!0)}toJSON(){return Object(s.b)("OfficeSpace",this)}static fromJSON(t){return Object(s.a)(f,t.data)}}s.c.constructors.OfficeSpace=f},function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return r})),function(t){t[t.SmartFactories=0]="SmartFactories",t[t.SmartStorage=1]="SmartStorage",t[t.DreamSense=2]="DreamSense",t[t.WilsonAnalytics=3]="WilsonAnalytics",t[t.NuoptimalNootropicInjectorImplants=4]="NuoptimalNootropicInjectorImplants",t[t.SpeechProcessorImplants=5]="SpeechProcessorImplants",t[t.NeuralAccelerators=6]="NeuralAccelerators",t[t.FocusWires=7]="FocusWires",t[t.ABCSalesBots=8]="ABCSalesBots",t[t.ProjectInsight=9]="ProjectInsight"}(a||(a={}));const r={[a.SmartFactories]:{index:a.SmartFactories,basePrice:2e9,priceMult:1.06,benefit:.03,name:"Smart Factories",desc:"Advanced AI automatically optimizes the operation and productivity of factories. Each level of this upgrade increases your global production by 3% (additive)."},[a.SmartStorage]:{index:a.SmartStorage,basePrice:2e9,priceMult:1.06,benefit:.1,name:"Smart Storage",desc:"Advanced AI automatically optimizes your warehouse storage methods. Each level of this upgrade increases your global warehouse storage size by 10% (additive)."},[a.DreamSense]:{index:a.DreamSense,basePrice:4e9,priceMult:1.1,benefit:.001,name:"DreamSense",desc:"Use DreamSense LCC Technologies to advertise your corporation to consumers through their dreams. Each level of this upgrade provides a passive increase in awareness of all of your companies (divisions) by 0.004 / market cycle,and in popularity by 0.001 / market cycle. A market cycle is approximately 15 seconds."},[a.WilsonAnalytics]:{index:a.WilsonAnalytics,basePrice:4e9,priceMult:1.5,benefit:.005,name:"Wilson Analytics",desc:"Purchase data and analysis from Wilson, a marketing research firm. Each level of this upgrade increases the effectiveness of your advertising by 0.5% (additive)."},[a.NuoptimalNootropicInjectorImplants]:{index:a.NuoptimalNootropicInjectorImplants,basePrice:1e9,priceMult:1.06,benefit:.1,name:"Nuoptimal Nootropic Injector Implants",desc:"Purchase the Nuoptimal Nootropic Injector augmentation for your employees. Each level of this upgrade globally increases the creativity of your employees by 10% (additive)."},[a.SpeechProcessorImplants]:{index:a.SpeechProcessorImplants,basePrice:1e9,priceMult:1.06,benefit:.1,name:"Speech Processor Implants",desc:"Purchase the Speech Processor augmentation for your employees. Each level of this upgrade globally increases the charisma of your employees by 10% (additive)."},[a.NeuralAccelerators]:{index:a.NeuralAccelerators,basePrice:1e9,priceMult:1.06,benefit:.1,name:"Neural Accelerators",desc:"Purchase the Neural Accelerator augmentation for your employees. Each level of this upgrade globally increases the intelligence of your employees by 10% (additive)."},[a.FocusWires]:{index:a.FocusWires,basePrice:1e9,priceMult:1.06,benefit:.1,name:"FocusWires",desc:"Purchase the FocusWire augmentation for your employees. Each level of this upgrade globally increases the efficiency of your employees by 10% (additive)."},[a.ABCSalesBots]:{index:a.ABCSalesBots,basePrice:1e9,priceMult:1.07,benefit:.01,name:"ABC SalesBots",desc:"Always Be Closing. Purchase these robotic salesmen to increase the amount of materials and products you sell. Each level of this upgrade globally increases your sales by 1% (additive)."},[a.ProjectInsight]:{index:a.ProjectInsight,basePrice:5e9,priceMult:1.07,benefit:.05,name:"Project Insight",desc:"Purchase 'Project Insight', a R&D service provided by the secretive Fulcrum Technologies. Each level of this upgrade globally increases the amount of Scientific Research you produce by 5% (additive)."}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(132),r=n(13);class i{constructor(t){this.augmentation=t}get cost(){return this.augmentation.baseCost*r.a.AugmentationGraftingCostMult}get time(){const t=Math.max(Object(a.sum)(Object.values(this.augmentation.mults).filter(t=>1!==t)),1),e=Math.log2(t);return(r.a.AugmentationGraftingTimeBase*e+r.a.MillisecondsPerHalfHour)/2}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(1516),r=n(1827);const i=Object(r.a)(t=>({root:{backgroundColor:t.palette.background.paper},bar:{transition:"none",backgroundColor:t.palette.primary.main}}))(a.a)},,function(t,e,n){"use strict";function a(t,e){for(const n of Object.keys(e)){const a=e[n];void 0!==a&&("function"==typeof a?a(t,n):void 0!==a.func?a.func(t,e,n):(typeof t[n]!=typeof a.default&&(t[n]=a.default),"number"==typeof t[n]&&void 0!==a.min&&t[n]a.max&&(t[n]=a.max)))}}function r(t,e,n){return(a,r)=>{"number"==typeof a[r]?(a[r]n&&(a[r]=n)):a[r]=t}}n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return s})),n.d(e,"a",(function(){return l}));var a=n(22),r=n(629),i=n(12);function o(t,e,n,r){const o=n*Math.pow(1.01,n);return Math.pow(e+1,2)*Math.pow(r,3)*3e3*o*(t.hasAugmentation(i.a.WKSharmonizer,!0)?1.5:1)*a.a.InfiltrationMoney}function s(t,e,n,r){const o=n*Math.pow(1.01,n);return Math.pow(e+1,1.1)*Math.pow(r,1.2)*30*o*(t.hasAugmentation(i.a.WKSharmonizer,!0)?1.5:1)*a.a.InfiltrationRep}function l(t,e,n){return n/r.a.reduce((t,e)=>{var n;const a=(null===(n=e.infiltrationData)||void 0===n?void 0:n.startingSecurityLevel)||0;return t>a?t:a},0)*5e3*(t.hasAugmentation(i.a.WKSharmonizer,!0)?2:1)*(1+e.favor/100)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var a=n(15);function r(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class i{constructor(){r(this,"bladeburner",0),r(this,"casino",0),r(this,"class",0),r(this,"codingcontract",0),r(this,"corporation",0),r(this,"crime",0),r(this,"gang",0),r(this,"hacking",0),r(this,"hacknet",0),r(this,"hacknet_expenses",0),r(this,"hospitalization",0),r(this,"infiltration",0),r(this,"sleeves",0),r(this,"stock",0),r(this,"total",0),r(this,"work",0),r(this,"servers",0),r(this,"other",0),r(this,"augmentations",0)}record(t,e){const n=e.toLowerCase();"number"==typeof this[n]?(this[n]+=t,this.total+=t):console.warn("MoneySourceTracker.record() called with invalid source: "+e)}reset(){for(const t in this)"number"==typeof this[t]&&(this[t]=0)}toJSON(){return Object(a.b)("MoneySourceTracker",this)}static fromJSON(t){return Object(a.a)(i,t.data)}}a.c.constructors.MoneySourceTracker=i},,function(t,e,n){"use strict";function a(){const t=Math.random();return t<.4?"ABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(26*Math.random())]:t<.8?"abcdefghijklmnopqrstuvwxyz"[Math.floor(26*Math.random())]:"01234567689"[Math.floor(10*Math.random())]}function r(){const t=50+Math.floor(25*(Math.random()+Math.random()));let e="";for(;e.lengthe.length)continue;for(let a=0;aArray(10).fill(null)),a=Array.from(Array(10),()=>Array(10));function r(t,e,n,a){const r=t[e][n];(null==r||a.length9||n+1+a>t.length)return null;if(e+=t.substring(n+1,n+1+a),n+=1+a,n>=t.length)break;const r=t.charCodeAt(n)-48;if(r<0||r>9)return null;if(0===r)++n;else{if(n+1>=t.length)return null;const a=t.charCodeAt(n+1)-48;if(r>0&&(a<1||a>9)||a>e.length)return null;for(let t=0;t=1}function l(){const t=this.gang;if(null===t)throw new Error("Cannot get gang faction because player is not in a gang.");const e=a.a[t.facName];if(null==e)throw new Error("Gang has invalid faction name: "+t.facName);return e}function c(){if(!this.inGang())return"";const t=this.gang;if(null===t)throw new Error("Cannot get gang faction because player is not in a gang.");return t.facName}function f(t){if(!this.inGang())return!1;const e=this.gang;if(null===e)throw new Error("Cannot get gang faction because player is not in a gang.");return e.facName===t}function u(){return null!=this.gang&&null!=this.gang&&this.gang instanceof r.a}function m(t,e){this.gang=new r.a(t,e);const n=a.a[t];if(null==n)throw new Error("Invalid faction name when creating gang: "+t);n.playerReputation=0}},,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));const a={lineHeight:1.5,fontFamily:"Lucida Console, Lucida Sans Unicode, Fira Mono, Consolas, Courier New, Courier, monospace, Times New Roman"}},,,,,function(t,e,n){"use strict";function a(t,e){if(t.length!==e.length)return!1;for(let n=0;ne.skills.hacking?{res:!1,msg:`Cannot hack ${t.hostname} server because your hacking skill is not high enough`}:{res:!0}}function i(t){return a(t,"grow")}function o(t){return a(t,"weaken")}n.d(e,"b",(function(){return r})),n.d(e,"a",(function(){return i})),n.d(e,"c",(function(){return o}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return h})),n.d(e,"b",(function(){return d}));var a=n(0),r=n.n(a),i=n(127),o=n(39),s=n(3),l=n(9),c=n(130),f=n(88),u=n(73),m=n(30);const h=new i.a;function d(){var t,e,n;const[i,l]=Object(a.useState)(null);if(Object(a.useEffect)(()=>h.subscribe(t=>{l(t)}),[]),null===i)return r.a.createElement(r.a.Fragment,null);const c={text:g,select:y};let f=p;null!=i&&null!==(t=i.options)&&void 0!==t&&t.type&&["text","select"].includes(null==i||null===(e=i.options)||void 0===e?void 0:e.type)&&(f=c[null==i||null===(n=i.options)||void 0===n?void 0:n.type]);return r.a.createElement(o.a,{open:!0,onClose:function(){var t,e;null!==i&&(["text","select"].includes(null!==(t=null==i||null===(e=i.options)||void 0===e?void 0:e.type)&&void 0!==t?t:"")?i.resolve(""):i.resolve(!1),l(null))}},r.a.createElement("pre",null,r.a.createElement(s.a,null,i.txt)),r.a.createElement(f,{prompt:i,resolve:t=>{i.resolve(t),l(null)}}))}function p({resolve:t}){return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"center",paddingTop:"10px"}},r.a.createElement(l.a,{style:{marginRight:"auto"},onClick:()=>t(!0)},"Yes"),r.a.createElement(l.a,{onClick:()=>t(!1)},"No")))}function g({resolve:t}){const[e,n]=Object(a.useState)(""),i=()=>t(e);return r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",alignItems:"center",paddingTop:"10px"}},r.a.createElement(f.a,{autoFocus:!0,value:e,onInput:t=>{n(t.target.value)},onKeyDown:t=>{t.stopPropagation(),t.key===m.a.ENTER&&(t.preventDefault(),i())},style:{flex:"1 0 auto"},InputProps:{endAdornment:r.a.createElement(l.a,{onClick:i},"Confirm")}})))}function y({prompt:t,resolve:e}){var n,i;const[o,f]=Object(a.useState)("");return Array.isArray(null==t||null===(n=t.options)||void 0===n?void 0:n.choices)?r.a.createElement(r.a.Fragment,null,r.a.createElement("div",{style:{display:"flex",alignItems:"center",paddingTop:"10px"}},r.a.createElement(c.a,{onChange:t=>{f(t.target.value)},value:o,style:{flex:"1 0 auto"}},(t=>{const e=[];for(const n of t)e.push(r.a.createElement(u.a,{key:n,value:n},n));return e})((null==t||null===(i=t.options)||void 0===i?void 0:i.choices)||[])),r.a.createElement(l.a,{onClick:()=>e(o),disabled:""===o},"Confirm"))):r.a.createElement(s.a,null,"Error: Please provide an array of string choices")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(42),r=n(185),i=n(1083),o=n(568),s=n(15),l=n(34);function c(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class f{constructor(t={}){c(this,"name",""),c(this,"dmd",0),c(this,"cmp",0),c(this,"mku",0),c(this,"pCost",0),c(this,"sCost",0),c(this,"fin",!1),c(this,"prog",0),c(this,"createCity",""),c(this,"designCost",0),c(this,"advCost",0),c(this,"creationProd",{[a.a.Operations]:0,[a.a.Engineer]:0,[a.a.Business]:0,[a.a.Management]:0,[a.a.RandD]:0,total:0}),c(this,"rat",0),c(this,"qlt",0),c(this,"per",0),c(this,"dur",0),c(this,"rel",0),c(this,"aes",0),c(this,"fea",0),c(this,"data",Object(o.a)([0,0,0])),c(this,"loc",""),c(this,"siz",0),c(this,"reqMats",{}),c(this,"prdman",Object(o.a)([!1,0])),c(this,"sllman",Object(o.a)([!1,0])),c(this,"marketTa1",!1),c(this,"marketTa2",!1),c(this,"marketTa2Price",Object(o.a)(0)),c(this,"maxsll",0),this.name=t.name?t.name:"",this.dmd=t.demand?t.demand:0,this.cmp=t.competition?t.competition:0,this.mku=t.markup?t.markup:0,this.createCity=t.createCity?t.createCity:"",this.designCost=t.designCost?t.designCost:0,this.advCost=t.advCost?t.advCost:0,this.qlt=t.quality?t.quality:0,this.per=t.performance?t.performance:0,this.dur=t.durability?t.durability:0,this.rel=t.reliability?t.reliability:0,this.aes=t.aesthetics?t.aesthetics:0,this.fea=t.features?t.features:0,this.loc=t.loc?t.loc:"",this.siz=t.size?t.size:0,this.reqMats=t.req?t.req:{}}createProduct(t,e){if(this.fin)return;const n=e[a.a.Operations],r=e[a.a.Engineer],i=e[a.a.Management],o=n+r+i;if(o<=0)return;const s=1+i/(1.2*o),l=(Math.pow(r,.34)+Math.pow(n,.2))*s,c=Math.min(.01*t*l,100-this.prog);if(!(c<=0)){this.prog+=c;for(const t of Object.keys(e))this.creationProd[t]+=e[t]*c/100}}finishProduct(t){this.fin=!0;const e=this.creationProd.total,n=this.creationProd[a.a.Engineer]/e,i=this.creationProd[a.a.Management]/e,o=this.creationProd[a.a.RandD]/e,s=this.creationProd[a.a.Operations]/e,c=this.creationProd[a.a.Business]/e,f=(1.2*n+.9*i+1.3*o+1.5*s+c)*(1+Math.pow(this.designCost,.1)/100)*(1+Math.pow(t.sciResearch.qty,t.sciFac)/800);this.qlt=f*(.1*this.creationProd[a.a.Engineer]+.05*this.creationProd[a.a.Management]+.05*this.creationProd[a.a.RandD]+.02*this.creationProd[a.a.Operations]+.02*this.creationProd[a.a.Business]),this.per=f*(.15*this.creationProd[a.a.Engineer]+.02*this.creationProd[a.a.Management]+.02*this.creationProd[a.a.RandD]+.02*this.creationProd[a.a.Operations]+.02*this.creationProd[a.a.Business]),this.dur=f*(.05*this.creationProd[a.a.Engineer]+.02*this.creationProd[a.a.Management]+.08*this.creationProd[a.a.RandD]+.05*this.creationProd[a.a.Operations]+.05*this.creationProd[a.a.Business]),this.rel=f*(.02*this.creationProd[a.a.Engineer]+.08*this.creationProd[a.a.Management]+.02*this.creationProd[a.a.RandD]+.05*this.creationProd[a.a.Operations]+.08*this.creationProd[a.a.Business]),this.aes=f*(0*this.creationProd[a.a.Engineer]+.08*this.creationProd[a.a.Management]+.05*this.creationProd[a.a.RandD]+.02*this.creationProd[a.a.Operations]+.1*this.creationProd[a.a.Business]),this.fea=f*(.08*this.creationProd[a.a.Engineer]+.05*this.creationProd[a.a.Management]+.02*this.creationProd[a.a.RandD]+.05*this.creationProd[a.a.Operations]+.05*this.creationProd[a.a.Business]),this.calculateRating(t);const u=1+Math.pow(this.advCost,.1)/100,m=Math.max(c+i,1/e);this.mku=100/(u*Math.pow(this.qlt+.001,.65)*m),0!==this.mku&&isFinite(this.mku)||(this.mku=1),this.dmd=0===t.awareness?20:Math.min(100,u*(t.popularity/t.awareness*100)),this.cmp=Object(l.a)(0,70);for(const e of Object.keys(t.reqMats))if(t.reqMats.hasOwnProperty(e)){const n=t.reqMats[e];if(void 0===n)continue;this.reqMats[e]=n}this.siz=0;for(const e of Object.keys(t.reqMats)){const n=t.reqMats[e];void 0!==n&&(this.siz+=r.a[e]*n)}}calculateRating(t){const e=i.a[t.type];null!=e?(this.rat=0,this.rat+=e.Quality?this.qlt*e.Quality:0,this.rat+=e.Performance?this.per*e.Performance:0,this.rat+=e.Durability?this.dur*e.Durability:0,this.rat+=e.Reliability?this.rel*e.Reliability:0,this.rat+=e.Aesthetics?this.aes*e.Aesthetics:0,this.rat+=e.Features?this.fea*e.Features:0):console.error("Could not find product rating weights for: "+t)}toJSON(){return Object(s.b)("Product",this)}static fromJSON(t){return Object(s.a)(f,t.data)}}s.c.constructors.Product=f},function(t,e,n){"use strict";function a(t,e){return!!Object.keys(e.reqMats).includes(t)||(!!e.prodMats.includes(t)||!!["Hardware","Robots","AICores","RealEstate","AI Cores","Real Estate"].includes(t))}n.d(e,"a",(function(){return a}))},,function(t,e,n){"use strict";n.d(e,"b",(function(){return b})),n.d(e,"a",(function(){return E}));var a=n(0),r=n.n(a),i=n(132),o=n(251),s=n(3),l=n(20),c=n(46),f=n(9),u=n(1812),m=n(1813),h=n(1814),d=n(26),p=n(6),g=n(63),y=n(311);const b=[];function E(){const t=d.b.Player(),e=d.b.Router(),n=Object(a.useState)(!1)[1];function E(){n(t=>!t)}const v=[...Object.values(g.a)].filter(e=>{const n=e.create;return null!==n&&("b1t_flum3.exe"!==e.name||n.req(t))}).sort((e,n)=>{var a,r,i,o;return t.hasProgram(e.name)?1:t.hasProgram(n.name)?-1:(null!==(a=null===(r=e.create)||void 0===r?void 0:r.level)&&void 0!==a?a:0)-(null!==(i=null===(o=n.create)||void 0===o?void 0:o.level)&&void 0!==i?i:0)});Object(a.useEffect)(()=>{v.forEach(t=>{b.includes(t.name)||b.push(t.name)})},[]),Object(a.useEffect)(()=>{const t=setInterval(E,200);return()=>clearInterval(t)},[]);const k=e=>Math.ceil(Math.max(e-(t.skills.hacking+t.skills.intelligence/2),0));return r.a.createElement(o.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0,mb:10}},r.a.createElement(s.a,{variant:"h4"},"Create program"),r.a.createElement(s.a,null,"This page displays any programs that you are able to create. Writing the code for a program takes time, which can vary based on how complex the program is. If you are working on creating a program you can cancel at any time. Your progress will be saved and you can continue later."),r.a.createElement(l.a,{sx:{display:"grid",gridTemplateColumns:"repeat(3, 1fr)",my:1}},v.map(n=>{const a=n.create;if(null===a)return r.a.createElement(r.a.Fragment,null);const o=(e=>{const n=Object(i.find)(t.getHomeComputer().programs,t=>t.startsWith(e)&&t.endsWith("%-INC"));if(!n)return-1;const a=n.split("-");if(3!=a.length)return-1;const r=Number(a[1].slice(0,-1));return isNaN(r)||r<0||r>=100?-1:r})(n.name);return r.a.createElement(l.a,{component:c.a,sx:{p:1,opacity:t.hasProgram(n.name)?.75:1},key:n.name},r.a.createElement(r.a.Fragment,null,r.a.createElement(s.a,{variant:"h6",sx:{display:"flex",alignItems:"center",flexWrap:"wrap"}},t.hasProgram(n.name)&&r.a.createElement(u.a,{sx:{mr:1}})||a.req(t)&&r.a.createElement(m.a,{sx:{mr:1}})||r.a.createElement(h.a,{sx:{mr:1}}),n.name),!t.hasProgram(n.name)&&a.req(t)&&r.a.createElement(f.a,{sx:{my:1,width:"100%"},onClick:a=>{a.isTrusted&&(t.startWork(new y.a({player:t,singularity:!1,programName:n.name})),t.startFocusing(),e.toWork())}},"Create program"),t.hasProgram(n.name)||0===k(a.level)||r.a.createElement(s.a,{color:p.a.theme.hack},r.a.createElement("b",null,"Unlocks in:")," ",k(a.level)," hacking levels"),-1!==o&&r.a.createElement(s.a,{color:p.a.theme.infolight},r.a.createElement("b",null,"Current completion:")," ",o,"%"),r.a.createElement(s.a,null,a.tooltip)))})))}},function(t,e,n){"use strict";n.d(e,"b",(function(){return _})),n.d(e,"a",(function(){return L}));var a=n(1815),r=n(1816),i=n(1817),o=n(1818),s=n(1512),l=n(722),c=n(723),f=n(21),u=n(46),m=n(20),h=n(9),d=n(3),p=n(126),g=n(251),y=n(0),b=n.n(y),E=n(6),v=n(7),k=n(5),w=n(105),S=n(29);const _=[],C=t=>{const e=t.faction.getInfo();return b.a.createElement(b.a.Fragment,null,e.offerFieldWork&&b.a.createElement(f.a,{title:"This Faction offers field work"},b.a.createElement(a.a,{sx:{color:E.a.theme.info,mr:.5},fontSize:"small"})),e.offerHackingWork&&b.a.createElement(f.a,{title:"This Faction offers hacking work"},b.a.createElement(r.a,{sx:{color:E.a.theme.hack,mr:.5},fontSize:"small"})),e.offerSecurityWork&&b.a.createElement(f.a,{title:"This Faction offers security work"},b.a.createElement(i.a,{sx:{color:E.a.theme.combat,mr:.5},fontSize:"small"})))},x=t=>{const e=t.faction.getInfo();return b.a.createElement(u.a,{sx:{display:"grid",p:1,alignItems:"center",gridTemplateColumns:"minmax(0, 4fr)"+(t.joined?" 1fr":"")}},b.a.createElement(m.a,{display:"flex",sx:{alignItems:"center"}},t.joined?b.a.createElement(m.a,{display:"grid",sx:{mr:1,gridTemplateColumns:"1fr 1fr",minWidth:"fit-content",gap:.5,"& .MuiButton-root":{height:"48px"}}},b.a.createElement(h.a,{onClick:()=>{return e=t.faction,void t.router.toFaction(e);var e}},"Details"),b.a.createElement(h.a,{onClick:()=>{return e=t.faction,void t.router.toFaction(e,!0);var e}},"Augments")):b.a.createElement(h.a,{sx:{height:"48px",mr:1},onClick:e=>{return n=e,a=t.faction.name,void(n.isTrusted&&(Object(w.d)(S.a[a]),t.rerender()));var n,a}},"Join!"),b.a.createElement("span",{style:{maxWidth:t.joined?"70%":"95%"}},b.a.createElement(d.a,{variant:"h6",sx:{mr:1,display:"grid",gridTemplateColumns:"fit-content(100vw) max-content",alignItems:"center"}},b.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"},title:t.faction.name},t.faction.name),b.a.createElement("span",{style:{display:"flex",alignItems:"center"}},t.player.hasGangWith(t.faction.name)&&b.a.createElement(f.a,{title:"You have a gang with this Faction"},b.a.createElement(o.a,{sx:{color:E.a.theme.hp,ml:1}})),e.special&&b.a.createElement(f.a,{title:"This is a special Faction"},b.a.createElement(s.a,{sx:{ml:1,color:E.a.theme.money,transform:"rotate(180deg)"}})),!t.joined&&e.enemies.length>0&&b.a.createElement(f.a,{title:b.a.createElement(d.a,null,"This Faction is enemies with:",b.a.createElement("ul",null,e.enemies.map(t=>b.a.createElement("li",{key:t},t))),"Joining this Faction will prevent you from joining its enemies")},b.a.createElement(l.a,{sx:{ml:1,color:E.a.theme.error}})))),b.a.createElement("span",{style:{display:"flex",alignItems:"center"}},!t.player.hasGangWith(t.faction.name)&&b.a.createElement(C,{faction:t.faction}),t.joined&&b.a.createElement(d.a,{variant:"body2",sx:{display:"flex"}},(n=t.faction,a=t.player,Object(w.a)(a,n).filter(t=>!a.hasAugmentation(t)).length)," Augmentations left")))),t.joined&&b.a.createElement(m.a,{display:"grid",sx:{alignItems:"center",justifyItems:"left",gridAutoFlow:"row"}},b.a.createElement(d.a,{sx:{color:E.a.theme.rep}},v.a.formatFavor(Math.floor(t.faction.favor))," favor"),b.a.createElement(d.a,{sx:{color:E.a.theme.rep}},v.a.formatReputation(t.faction.playerReputation)," rep")));var n,a};function L(t){const e=Object(p.a)(),n=Object(y.useState)(!1)[1];function a(){n(t=>!t)}Object(y.useEffect)(()=>{const t=setInterval(a,200);return()=>clearInterval(t)},[]),Object(y.useEffect)(()=>{t.player.factionInvitations.forEach(t=>{_.includes(t)||_.push(t)})},[]);const r=Object.values(k.a).map(t=>t),i=[...t.player.factions];i.sort((t,e)=>r.indexOf(t)-r.indexOf(e));const o=t.player.factionInvitations;return b.a.createElement(g.a,{disableGutters:!0,maxWidth:"lg",sx:{mx:0,mb:10}},b.a.createElement(d.a,{variant:"h4"},"Factions",b.a.createElement(f.a,{title:b.a.createElement(d.a,null,"Throughout the game you may receive invitations from factions. There are many different factions, and each faction has different criteria for determining its potential members. Joining a faction and furthering its cause is crucial to progressing in the game and unlocking endgame content.")},b.a.createElement(c.a,{sx:{ml:1,mb:0},color:"info"}))),b.a.createElement(m.a,{display:"grid",sx:{gap:1,gridTemplateColumns:(o.length>0?"1fr ":"")+"2fr",[e.breakpoints.down("lg")]:{gridTemplateColumns:"1fr","& > span:nth-of-type(1)":{order:1}},gridTemplateRows:"minmax(0, 1fr)","& > span > .MuiBox-root":{display:"grid",gridAutoRows:"70px",gap:1}}},o.length>0&&b.a.createElement("span",null,b.a.createElement(d.a,{variant:"h5",color:"primary"},"Faction Invitations"),b.a.createElement(m.a,null,o.map(e=>S.a.hasOwnProperty(e)?b.a.createElement(x,{key:e,faction:S.a[e],player:t.player,router:t.router,joined:!1,rerender:a}):null))),b.a.createElement("span",null,b.a.createElement(d.a,{variant:"h5",color:"primary"},"Your Factions"),b.a.createElement(m.a,null,i.length>0?i.map(e=>S.a.hasOwnProperty(e)?b.a.createElement(x,{key:e,faction:S.a[e],player:t.player,router:t.router,joined:!0,rerender:a}):null):b.a.createElement(d.a,null,"You have not yet joined any Factions.")))))}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var a=n(0),r=n.n(a),i=n(1),o=n(481),s=n(640),l=n(387),c=n(16);function f(t,e,n,a){e?0===i.a.sourceFileLvl(5)&&5!==a&&(i.a.skills.intelligence=0,i.a.exp.intelligence=0):function(t){const e="SourceFile"+t.toString(),n=l.a[e];if(null==n)return void console.error("Could not find source file for Bit node: "+t);let a=!1,o=null;for(let e=0;e=3&&12!==o.n?Object(c.a)(`The Source-File for the BitNode you just destroyed, ${n.name}, is already at max level!`):(++o.lvl,Object(c.a)(n.name+" was upgraded to level "+o.lvl+" for destroying its corresponding BitNode!"));else{const e=new s.a(t,1);i.a.sourceFiles.push(e),5===t&&0===i.a.skills.intelligence&&(i.a.skills.intelligence=1),Object(c.a)(r.a.createElement(r.a.Fragment,null,"You received a Source-File for destroying a BitNode!",r.a.createElement("br",null),r.a.createElement("br",null),n.name,r.a.createElement("br",null),r.a.createElement("br",null),n.info))}}(n),5===a&&0===i.a.skills.intelligence&&(i.a.skills.intelligence=1),i.a.bitNodeN=a,6===a?t.toBladeburnerCinematic():t.toTerminal(),Object(o.b)(e)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return S})),n.d(e,"a",(function(){return _})),n.d(e,"c",(function(){return C}));var a=n(0),r=n.n(a),i=n(20),o=n(3),s=n(150),l=n(371),c=n(21),f=n(9),u=n(46),m=n(88),h=n(6),d=n(353),p=n(106),g=n(560),y=n(662),b=n(664),E=n(679),v=n.n(E),k=n(1428),w=n.n(k);let S=!1;function _(){S=!0}function C({router:t,softReset:e,errorData:n,resetError:E}){var k,_;return h.a.AutosaveInterval=0,Object(a.useEffect)(()=>{Object(d.b)().then(t=>{const e=`RECOVERY_BITBURNER_${Math.round(Date.now()/1e3)}.json`;Object(p.a)(e,t)}).catch(t=>console.error(t))},[]),r.a.createElement(i.a,{sx:{padding:"8px 16px",minHeight:"100vh",maxWidth:"1200px",boxSizing:"border-box"}},r.a.createElement(o.a,{variant:"h3"},"RECOVERY MODE ACTIVATED"),r.a.createElement(o.a,null,"There was an error with your save file and the game went into recovery mode. In this mode saving is disabled and the game will automatically export your save file (to prevent corruption)."),r.a.createElement(o.a,null,"At this point it is recommended to alert a developer."),r.a.createElement(o.a,null,r.a.createElement(s.a,{href:null!==(k=null==n?void 0:n.issueUrl)&&void 0!==k?k:g.b,target:"_blank"},"File an issue on github")),r.a.createElement(o.a,null,r.a.createElement(s.a,{href:"https://www.reddit.com/r/Bitburner/",target:"_blank"},"Make a reddit post")),r.a.createElement(o.a,null,r.a.createElement(s.a,{href:"https://discord.gg/TFc3hKD",target:"_blank"},"Post in the #bug-report channel on Discord.")),r.a.createElement(o.a,null,"Please include your save file."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(o.a,null,"You can disable recovery mode now. But chances are the game will not work correctly."),r.a.createElement(l.a,{sx:{my:2}},r.a.createElement(c.a,{title:"Disables the recovery mode & attempt to head back to the terminal page. This may or may not work. Ensure you have saved the recovery file."},r.a.createElement(f.a,{onClick:function(){E&&E(),S=!1,t.toTerminal()},startIcon:r.a.createElement(v.a,null)},"Disable Recovery Mode")),r.a.createElement(b.a,{color:"warning",onTriggered:e}),r.a.createElement(y.a,{color:"error"})),n&&r.a.createElement(u.a,{sx:{px:2,pt:1,pb:2,mt:2}},r.a.createElement(o.a,{variant:"h5"},n.title),r.a.createElement(i.a,{sx:{my:2}},r.a.createElement(m.a,{label:"Bug Report Text",value:n.body,variant:"outlined",color:"secondary",multiline:!0,fullWidth:!0,rows:12,sx:{"& .MuiOutlinedInput-root":{color:h.a.theme.secondary}}})),r.a.createElement(c.a,{title:"Submitting an issue to GitHub really help us improve the game!"},r.a.createElement(f.a,{component:s.a,startIcon:r.a.createElement(w.a,null),color:"info",sx:{px:2},href:null!==(_=n.issueUrl)&&void 0!==_?_:g.b,target:"_blank"},"Submit Issue to GitHub"))))}},,,function(t,e,n){"use strict";let a;n.d(e,"a",(function(){return a})),function(t){t[t.SyntaxError=-1]="SyntaxError",t[t.ImportError=-2]="ImportError"}(a||(a={}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(1054);let r=1;function i(t){return r+=t,()=>r-=t}function o(){return Object(a.a)(r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(1060),r=n(233),i=n(24);function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class s{constructor(t,e,n){o(this,"code",""),o(this,"delay",null),o(this,"disableLogs",{}),o(this,"dynamicLoadedFns",{}),o(this,"dynamicRamUsage",r.a.ScriptBaseRamCost),o(this,"errorMessage",""),o(this,"loadedFns",{}),o(this,"output",""),o(this,"ramUsage",0),this.name=t.filename,this.hostname=t.server;const s=Math.round(e);if("number"!=typeof s||isNaN(s))throw new Error("Invalid PID when constructing WorkerScript: "+e);this.pid=s,t.pid=s;const l=Object(i.d)(this.hostname);if(null==l)throw new Error("WorkerScript constructed with invalid server ip: "+this.hostname);let c=!1;for(let t=0;tt.name===e);return!!n&&(this.startWork(t,new C.a(n.type)),!0)}getMemoryUpgradeCost(t){const e=Math.round(t);if(e<0)return 0;if(this.memory+e>100)return this.getMemoryUpgradeCost(100-this.memory);let n=0,a=this.memory-1;for(let e=0;et.name===e.name)&&(t.loseMoney(e.baseCost,"sleeves"),this.installAugmentation(e),!0))}upgradeMemory(t){t<0?console.warn("Sleeve.upgradeMemory() called with negative value: "+t):this.memory=Math.min(100,Math.round(this.memory+t))}workForCompany(t,e){if(!(i.a[e]instanceof o.a)||null==t.jobs[e])return!1;const n=i.a[e],a=s.a[t.jobs[e]];return null!=n&&(null!=a&&(this.startWork(t,new k.a({companyName:e})),!0))}workForFaction(t,e,n){const a=f.a[e];if(!(""!==e&&a&&a instanceof c.a&&t.factions.includes(e)))return!1;const r=a.getInfo(),i=n.toLowerCase();let o;if(i.includes("hack")){if(!r.offerHackingWork)return!1;o=p.a.HACKING}else if(i.includes("field")){if(!r.offerFieldWork)return!1;o=p.a.FIELD}else{if(!i.includes("security"))return!1;if(!r.offerSecurityWork)return!1;o=p.a.SECURITY}return this.startWork(t,new v.a({factionWorkType:o,factionName:a.name})),!0}workoutAtGym(t,e,n){let a;switch(e.toLowerCase()){case m.a.AevumCrushFitnessGym.toLowerCase():if(this.city!=u.a.Aevum)return!1;a=m.a.AevumCrushFitnessGym;break;case m.a.AevumSnapFitnessGym.toLowerCase():if(this.city!=u.a.Aevum)return!1;a=m.a.AevumSnapFitnessGym;break;case m.a.Sector12IronGym.toLowerCase():if(this.city!=u.a.Sector12)return!1;a=m.a.Sector12IronGym;break;case m.a.Sector12PowerhouseGym.toLowerCase():if(this.city!=u.a.Sector12)return!1;a=m.a.Sector12PowerhouseGym;break;case m.a.VolhavenMilleniumFitnessGym.toLowerCase():if(this.city!=u.a.Volhaven)return!1;a=m.a.VolhavenMilleniumFitnessGym}if(!a)return!1;const r=n.toLowerCase();let i;return r.includes("str")&&(i=y.a.GymStrength),r.includes("def")&&(i=y.a.GymDefense),r.includes("dex")&&(i=y.a.GymDexterity),r.includes("agi")&&(i=y.a.GymAgility),!!i&&(this.startWork(t,new g.a({classType:i,location:a})),!0)}bladeburner(t,e,n){switch(e){case"Field analysis":return this.startWork(t,new _.a({type:"General",name:"Field Analysis"})),!0;case"Recruitment":return this.startWork(t,new _.a({type:"General",name:"Recruitment"})),!0;case"Diplomacy":return this.startWork(t,new _.a({type:"General",name:"Diplomacy"})),!0;case"Infiltrate synthoids":return this.startWork(t,new w.a),!0;case"Support main sleeve":return this.startWork(t,new S.a(t)),!0;case"Take on contracts":return this.startWork(t,new _.a({type:"Contracts",name:n})),!0}return!0}recruitmentSuccessChance(t){var e,n;return Math.max(0,Math.min(1,null!==(e=null===(n=t.bladeburner)||void 0===n?void 0:n.getRecruitmentSuccessChance(this))&&void 0!==e?e:0))}contractSuccessChance(t,e,n){const a=t.bladeburner;if(null===a){const t="bladeburner is null";return console.error(`Function: sleeves.contractSuccessChance; Message: '${t}'`),"0%"}const r=a.getActionEstimatedSuccessChanceNetscriptFn(this,e,n);return"string"==typeof r?(console.error(`Function: sleeves.contractSuccessChance; Message: '${r}'`),"0%"):r[0]>=1?"100%":`${d.a.formatPercentage(r[0])} - ${d.a.formatPercentage(r[1])}`}takeDamage(t){return"number"!=typeof t?(console.warn("Player.takeDamage() called without a numeric argument: "+t),!1):(this.hp.current-=t,this.hp.current<=0&&(this.shock=Math.max(0,this.shock-.5),this.hp.current=this.hp.max,!0))}whoAmI(){return"Sleeve"}toJSON(){return Object(h.b)("Sleeve",this)}static fromJSON(t){return Object(h.a)(L,t.data)}}h.c.constructors.Sleeve=L},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(1451),r=n(279),i=n(399),o=n(248),s=n(35),l=n(22),c=n(499),f=n(66),u=n(16),m=n(15),h=n(163);function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class p{constructor(t={}){d(this,"name","The Corporation"),d(this,"divisions",[]),d(this,"funds",15e10),d(this,"revenue",0),d(this,"expenses",0),d(this,"fundingRound",0),d(this,"public",!1),d(this,"totalShares",s.a.INITIALSHARES),d(this,"numShares",s.a.INITIALSHARES),d(this,"shareSalesUntilPriceUpdate",s.a.SHARESPERPRICEUPDATE),d(this,"shareSaleCooldown",0),d(this,"issueNewSharesCooldown",0),d(this,"dividendRate",0),d(this,"dividendTax",1-l.a.CorporationSoftcap+.15),d(this,"issuedShares",0),d(this,"sharePrice",0),d(this,"storedCycles",0),d(this,"avgProfit",0),d(this,"state",new a.a),this.name=t.name?t.name:"The Corporation";const e=Object.keys(r.b).length,n=Object.keys(i.a).length;this.unlockUpgrades=Array(e).fill(0),this.upgrades=Array(n).fill(0),this.upgradeMultipliers=Array(n).fill(1)}addFunds(t){isFinite(t)?this.funds=this.funds+t:console.error("Trying to add invalid amount of funds. Report to a developper.")}getState(){return this.state.getState()}storeCycles(t=1){this.storedCycles+=t}process(t){if(this.storedCycles>=s.a.CyclesPerIndustryStateCycle){const e=this.getState(),n=1,a=n*s.a.CyclesPerIndustryStateCycle;if(this.storedCycles-=a,this.divisions.forEach(t=>{t.process(n,e,this)}),this.shareSaleCooldown>0&&(this.shareSaleCooldown-=a),this.issueNewSharesCooldown>0&&(this.issueNewSharesCooldown-=a),"START"===e){this.revenue=0,this.expenses=0,this.divisions.forEach(t=>{t.lastCycleRevenue!==-1/0&&t.lastCycleRevenue!==1/0&&t.lastCycleExpenses!==-1/0&&t.lastCycleExpenses!==1/0&&(this.revenue=this.revenue+t.lastCycleRevenue,this.expenses=this.expenses+t.lastCycleExpenses)});const e=this.revenue-this.expenses;this.avgProfit=(this.avgProfit*(s.a.AvgProfitLength-1)+e)/s.a.AvgProfitLength;const a=e*(n*s.a.SecsPerMarketCycle);if((isNaN(this.funds)||this.funds===1/0||this.funds===-1/0)&&(Object(u.a)("There was an error calculating your Corporations funds and they got reset to 0. This is a bug. Please report to game developer.

(Your funds have been set to $150b for the inconvenience)"),this.funds=15e10),this.updateDividendTax(),this.dividendRate>0&&a>0)if(isNaN(this.dividendRate)||this.dividendRate<0||this.dividendRate>s.a.DividendMaxRate)console.error("Invalid Corporation dividend rate: "+this.dividendRate);else{const e=a-this.dividendRate*a;t.gainMoney(this.getCycleDividends(),"corporation"),this.addFunds(e)}else this.addFunds(a);this.updateSharePrice()}this.state.nextState()}}updateDividendTax(){this.dividendTax=1-l.a.CorporationSoftcap+.15,1===this.unlockUpgrades[5]&&(this.dividendTax-=.05),1===this.unlockUpgrades[6]&&(this.dividendTax-=.1)}getCycleDividends(){const t=(this.revenue-this.expenses)*s.a.SecsPerMarketCycle,e=this.dividendRate*t/this.totalShares,n=this.numShares*e;return Math.pow(n,1-this.dividendTax)}determineValuation(){let t,e=this.avgProfit;return this.public?(this.dividendRate>0&&(e*=1-this.dividendRate),t=this.funds+85e3*e,t*=Math.pow(1.1,this.divisions.length),t=Math.max(t,0)):(t=1e10+Math.max(this.funds,0)/3,e>0?(t+=315e3*e,t*=Math.pow(1.1,this.divisions.length)):t=1e10*Math.pow(1.1,this.divisions.length),t-=t%1e6),t*l.a.CorporationValuation}getTargetSharePrice(){return this.determineValuation()/(2*(this.totalShares-this.numShares)+1)}updateSharePrice(){const t=this.getTargetSharePrice();this.sharePrice<=t?this.sharePrice*=1+.01*Math.random():this.sharePrice*=1-.01*Math.random(),this.sharePrice<=.01&&(this.sharePrice=.01)}immediatelyUpdateSharePrice(){this.sharePrice=this.getTargetSharePrice()}calculateShareSale(t){let e=t,n=this.shareSalesUntilPriceUpdate,a=this.sharePrice,r=0,i=0;const o=Math.ceil(t/s.a.SHARESPERPRICEUPDATE);if(isNaN(o)||o>1e7)return console.error("Something went wrong or unexpected when calculating share sale. Maxiterations calculated to be "+o),[0,0,0];for(let t=0;t3600?Math.floor(e/3600)+" hour(s)":e>60?Math.floor(e/60)+" minute(s)":Math.floor(e)+" second(s)"}unlock(t){const e=t.index,n=t.price;for(;this.unlockUpgrades.length<=e;)this.unlockUpgrades.push(0);this.fundsthis.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst-=t,this.popEstthis.pop&&(this.popEst=this.pop)):this.popEst>this.pop&&(this.popEst*=1-t/100,this.popEst0?1:-1),this.pop+=n,e.changeEstEqually&&(this.popEst+=n,this.popEst<0&&(this.popEst=0)),n}changeChaosByCount(t){if(isNaN(t))throw new Error("NaN passed into City.changeChaosByCount()");0!==t&&(this.chaos+=t,this.chaos<0&&(this.chaos=0))}toJSON(){return Object(i.b)("City",this)}static fromJSON(t){return Object(i.a)(l,t.data)}}i.c.constructors.City=l},,function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e=[],n=""){this.name=t,this.locations=e,this.asciiArt=n}addLocation(t){this.locations.push(t)}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(20),r=n(21),i=n(3),o=n(1867),s=n(0),l=n.n(s);const c=t=>{const[e,n]=Object(s.useState)(t.initialValue);return l.a.createElement(a.a,null,l.a.createElement(r.a,{title:l.a.createElement(i.a,null,t.tooltip)},l.a.createElement(i.a,null,t.label)),l.a.createElement(o.a,{value:e,onChange:(t,e)=>{"number"==typeof e&&n(e)},onChangeCommitted:t.callback,step:t.step,min:t.min,max:t.max,valueLabelDisplay:"auto",sx:{"& .MuiSlider-thumb":{height:"12px",width:"12px"}},marks:t.marks}))}},,function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return f}));var a=n(0),r=n(3),i=n(21),o=n(9),s=n(88);let l;function c(t){let e="",n="";return t.tickerDisplayMode===l.Portfolio?(e="Switch to 'All Stocks' Mode",n="Displays all stocks on the WSE"):(e="Switch to 'Portfolio' Mode",n="Displays only the stocks for which you have shares or orders"),a.createElement(i.a,{title:a.createElement(r.a,null,n)},a.createElement(o.a,{onClick:t.changeDisplayMode},e))}function f(t){return a.createElement(a.Fragment,null,a.createElement(c,t),a.createElement("br",null),a.createElement(s.a,{sx:{width:"100%"},onChange:t.changeWatchlistFilter,placeholder:"Filter Stocks by symbol (comma-separated list)",type:"text"}))}!function(t){t[t.AllStocks=0]="AllStocks",t[t.Portfolio=1]="Portfolio"}(l||(l={}))},function(t,e,n){"use strict";n.d(e,"f",(function(){return c})),n.d(e,"b",(function(){return f})),n.d(e,"c",(function(){return u})),n.d(e,"e",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"a",(function(){return d}));var a=n(13),r=n(22),i=n(45),o=n(94),s=n(24),l=n(89);function c(){return this.getHomeComputer().serversOnNetwork.includes(l.a.DarkWeb)}function f(){const t=Object(s.d)(this.currentServer);if(null===t)throw new Error("somehow connected to a server that does not exist. "+this.currentServer);return t}function u(){const t=Object(s.d)("home");if(t instanceof i.a)return t;throw new Error("home computer was not a normal server")}function m(){const t=this.getHomeComputer().maxRam,e=Math.log2(t),n=Math.pow(1.58,e);return t*a.a.BaseCostFor1GBOfRamHome*n*r.a.HomeComputerRamCost}function h(){return 1e9*Math.pow(7.5,this.getHomeComputer().cpuCores)}function d(){const t="hacknet-node-"+this.hacknetNodes.length,e=new o.a({adminRights:!0,hostname:t,ip:Object(s.e)()});this.hacknetNodes.push(e.hostname),Object(s.a)(e);return this.getHomeComputer().serversOnNetwork.push(e.hostname),e.serversOnNetwork.push(l.a.Home),e}},,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return P})),n.d(e,"b",(function(){return I}));var a=n(5),r=n(17),i=n(74),o=n(114),s=n(12),l=n(152),c=n(215),f=n(78),u=n(51),m=n(63),h=n(201),d=n(29),p=n(105),g=n(56),y=n(190),b=n(1),E=n(91),v=n(352),k=n(549),w=n(66),S=n(24),_=n(140),C=n(89),x=n(98),L=n(83),O=n(16),M=n(104),A=n(433),T=n(434),R=n(13),N=n(166);function P(){Object(l.d)(b.a);const t=b.a.factions.concat(b.a.factionInvitations).filter((function(t){return d.a[t].getInfo().keep}));b.a.prestigeAugmentation(),Object(y.c)();const e=b.a.getHomeComputer();Object(S.i)(),Object(S.a)(e),Object(_.e)(b.a,e),Object(o.b)(s.a.Neurolink)&&b.a.hasAugmentation(s.a.Neurolink)&&(e.programs.push(m.a.FTPCrackProgram.name),e.programs.push(m.a.RelaySMTPProgram.name)),Object(o.b)(s.a.CashRoot)&&b.a.hasAugmentation(s.a.CashRoot)&&(b.a.setMoney(1e6),e.programs.push(m.a.BruteSSHProgram.name)),Object(o.b)(s.a.PCMatrix)&&b.a.hasAugmentation(s.a.PCMatrix)&&(e.programs.push(m.a.DeepscanV1.name),e.programs.push(m.a.AutoLink.name)),(b.a.sourceFileLvl(5)>0||5===b.a.bitNodeN)&&e.programs.push(m.a.Formulas.name),Object(S.f)(b.a.getHomeComputer());for(const t of Object.keys(f.a))f.a.hasOwnProperty(t)&&f.a[t].gainFavor();for(const t of Object.keys(d.a))d.a.hasOwnProperty(t)&&d.a[t].gainFavor();null!==L.a.action&&L.a.finishAction(E.b,b.a,!0),L.a.clear(),N.a.emit(),Object(d.c)(),b.a.factionInvitations=b.a.factionInvitations.concat(t),Object(o.e)(),b.a.reapplyAllSourceFiles(),Object(f.b)(),b.a.applyEntropy(b.a.entropy);const n=b.a.gang;if(b.a.inGang()&&null!==n){const t=d.a[n.facName];t instanceof h.a&&Object(p.d)(t);const e=.95;for(const t of n.members)t.hack_asc_points*=e,t.str_asc_points*=e,t.def_asc_points*=e,t.dex_asc_points*=e,t.agi_asc_points*=e,t.cha_asc_points*=e}if(3===b.a.bitNodeN&&e.messages.push(w.a.CorporationManagementHandbook),b.a.bladeburner instanceof c.a&&b.a.bladeburner.prestige(),8===b.a.bitNodeN&&(b.a.money=25e7),(8===b.a.bitNodeN||b.a.sourceFileLvl(8)>0)&&(b.a.hasWseAccount=!0,b.a.hasTixApiAccess=!0),b.a.hasWseAccount&&(Object(x.e)(),Object(x.g)()),Object(o.b)(s.a.TheRedPill)&&b.a.hasAugmentation(s.a.TheRedPill)){const t=Object(S.d)(C.a.WorldDaemon),e=Object(S.d)(C.a.DaedalusServer);t&&e&&(t.serversOnNetwork.push(e.hostname),e.serversOnNetwork.push(t.hostname))}Object(o.b)(s.a.StaneksGift1)&&b.a.hasAugmentation(s.a.StaneksGift1)&&Object(p.d)(d.a[a.a.ChurchOfTheMachineGod]),M.c.prestigeAugmentation(),Object(k.b)(),A.b.splice(0,A.b.length),T.b.splice(0,T.b.length)}function I(t){Object(l.d)(b.a),b.a.prestigeSourceFile(),Object(y.c)();const e=b.a.getHomeComputer();null!==L.a.action&&L.a.finishAction(E.b,b.a,!0),L.a.clear(),N.a.emit(),Object(S.i)(),Object(S.a)(e),Object(_.e)(b.a,e),Object(S.f)(b.a.getHomeComputer()),b.a.sourceFileLvl(9)>=2?e.setMaxRam(128):b.a.sourceFileLvl(1)>0?e.setMaxRam(32):e.setMaxRam(8),e.cpuCores=1;for(const t of Object.keys(f.a))f.a.hasOwnProperty(t)&&(f.a[t].favor=0);for(const t of Object.keys(d.a))d.a.hasOwnProperty(t)&&(d.a[t].favor=0);null!==L.a.action&&L.a.finishAction(E.b,b.a,!0);for(const t of Object.keys(i.a))i.a.hasOwnProperty(t)&&delete i.a[t];if(b.a.sourceFileLvl(12)>0&&b.a.augmentations.push({name:s.a.NeuroFluxGovernor,level:b.a.sourceFileLvl(12)}),Object(d.c)(),Object(o.e)(),b.a.reapplyAllSourceFiles(),Object(f.b)(),(b.a.sourceFileLvl(5)>0||5===b.a.bitNodeN)&&e.programs.push(m.a.Formulas.name),3===b.a.bitNodeN&&(e.messages.push(w.a.CorporationManagementHandbook),Object(O.a)("You received a copy of the Corporation Management Handbook on your home computer. Read it if you need help getting started with Corporations!")),8===b.a.bitNodeN&&(b.a.money=25e7),(8===b.a.bitNodeN||b.a.sourceFileLvl(8)>0)&&(b.a.hasWseAccount=!0,b.a.hasTixApiAccess=!0),10===b.a.bitNodeN&&Object(O.a)("Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!"),13===b.a.bitNodeN&&Object(O.a)("Trouble is brewing in "+r.a.Chongqing),b.a.hasWseAccount?(Object(x.e)(),Object(x.g)()):Object(x.d)(),b.a.gang=null,b.a.corporation=null,Object(u.e)(),b.a.bladeburner=null,b.a.sourceFileLvl(9)>=3){const t=b.a.createHacknetServer();t.level=100,t.cores=10,t.cache=5,t.updateHashRate(b.a.mults.hacknet_node_money),t.updateHashCapacity(),Object(g.p)(b.a)}13===b.a.bitNodeN&&(b.a.money=R.a.TravelCost),M.c.prestigeSourceFile(),0===b.a.sourceFileLvl(5)||t||b.a.gainIntelligenceExp(300),v.b.splice(0,v.b.length),Object(k.b)()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(1),r=n(34),i=n(315),o=n(15),s=n(62);function l(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class c{constructor(t=null){l(this,"name",""),l(this,"level",1),l(this,"maxLevel",1),l(this,"autoLevel",!0),l(this,"baseDifficulty",100),l(this,"difficultyFac",1.01),l(this,"rewardFac",1.02),l(this,"successes",0),l(this,"failures",0),l(this,"rankGain",0),l(this,"rankLoss",0),l(this,"hpLoss",0),l(this,"hpLost",0),l(this,"isStealth",!1),l(this,"isKill",!1),l(this,"count",Object(r.a)(1e3,25e3)),l(this,"weights",{hack:1/7,str:1/7,def:1/7,dex:1/7,agi:1/7,cha:1/7,int:1/7}),l(this,"decays",{hack:.9,str:.9,def:.9,dex:.9,agi:.9,cha:.9,int:.9}),l(this,"teamCount",0),t&&t.name&&(this.name=t.name),t&&t.baseDifficulty&&(this.baseDifficulty=Object(i.a)(t.baseDifficulty,10)),t&&t.difficultyFac&&(this.difficultyFac=t.difficultyFac),t&&t.rewardFac&&(this.rewardFac=t.rewardFac),t&&t.rankGain&&(this.rankGain=t.rankGain),t&&t.rankLoss&&(this.rankLoss=t.rankLoss),t&&t.hpLoss&&(this.hpLoss=t.hpLoss),t&&t.isStealth&&(this.isStealth=t.isStealth),t&&t.isKill&&(this.isKill=t.isKill),t&&t.count&&(this.count=t.count),t&&t.weights&&(this.weights=t.weights),t&&t.decays&&(this.decays=t.decays);let e=0;for(const t of Object.keys(this.weights))this.weights.hasOwnProperty(t)&&(e+=this.weights[t]);if(e-1>=10*Number.EPSILON)throw new Error("Invalid weights when constructing Action "+this.name+". The weights should sum up to 1. They sum up to :1");for(const t of Object.keys(this.decays))if(this.decays.hasOwnProperty(t)&&this.decays[t]>1)throw new Error(`Invalid decays when constructing Action ${this.name}. Decay value cannot be greater than 1`)}getDifficulty(){const t=this.baseDifficulty*Math.pow(this.difficultyFac,this.level-1);if(isNaN(t))throw new Error("Calculated NaN in Action.getDifficulty()");return t}attempt(t,e){return Math.random()s.a.ChaosThreshold){const t=e.chaos-s.a.ChaosThreshold+1;return Math.pow(t,.5)}return 1}getEstSuccessChance(t,e){function n(t){return Math.max(0,Math.min(t,1))}const a=this.getSuccessChance(t,e,{est:!0}),r=this.getSuccessChance(t,e),i=Math.abs(r-a);let o=r-i,s=r+i;const l=t.getCurrentCity(),c=l.pop/l.popEst;return c<1?o*=c:s*=c,[n(o),n(s)]}getSuccessChance(t,e,n={est:!1}){if(null==t)throw new Error("Invalid Bladeburner instance passed into Action.getSuccessChance");let r=this.getDifficulty(),i=0;for(const n of Object.keys(this.weights))if(this.weights.hasOwnProperty(n)){const a=e.queryStatFromString(n),r="eff"+n.charAt(0).toUpperCase()+n.slice(1);let o=t.skillMultipliers[r];null==o&&(console.error("Failed to find Bladeburner Skill multiplier for: "+n),o=1),i+=this.weights[n]*Math.pow(o*a,this.decays[n])}if(i*=a.a.getIntelligenceBonus(.75),i*=t.calculateStaminaPenalty(),i*=this.getTeamSuccessBonus(t),i*=this.getChaosCompetencePenalty(t,n),r*=this.getChaosDifficultyBonus(t),"Raid"==this.name&&t.getCurrentCity().comms<=0)return 0;if(i*=t.skillMultipliers.successChanceAll,i*=this.getActionTypeSkillSuccessBonus(t),this.isStealth&&(i*=t.skillMultipliers.successChanceStealth),this.isKill&&(i*=t.skillMultipliers.successChanceKill),i*=a.a.mults.bladeburner_success_chance,isNaN(i))throw new Error("Competence calculated as NaN in Action.getSuccessChance()");return Math.min(1,i/r)}getSuccessesNeededForNextLevel(t){return Math.ceil(.5*this.maxLevel*(2*t+(this.maxLevel-1)))}setMaxLevel(t){this.successes>=this.getSuccessesNeededForNextLevel(t)&&++this.maxLevel}toJSON(){return Object(o.b)("Action",this)}static fromJSON(t){return Object(o.a)(c,t.data)}}o.c.constructors.Action=c},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));class a{constructor(t,e,n,a,r){this.name=t,this.desc=e,this.isHacking=n,this.isCombat=a,this.baseRespect=r.baseRespect?r.baseRespect:0,this.baseWanted=r.baseWanted?r.baseWanted:0,this.baseMoney=r.baseMoney?r.baseMoney:0,this.hackWeight=r.hackWeight?r.hackWeight:0,this.strWeight=r.strWeight?r.strWeight:0,this.defWeight=r.defWeight?r.defWeight:0,this.dexWeight=r.dexWeight?r.dexWeight:0,this.agiWeight=r.agiWeight?r.agiWeight:0,this.chaWeight=r.chaWeight?r.chaWeight:0,100!=Math.round(this.hackWeight+this.strWeight+this.defWeight+this.dexWeight+this.agiWeight+this.chaWeight)&&console.error(`GangMemberTask ${this.name} weights do not add up to 100`),this.difficulty=r.difficulty?r.difficulty:1,this.territory=r.territory?r.territory:{money:1,respect:1,wanted:1}}}},function(t,e,n){"use strict";n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p}));var a,r=n(15),i=n(13),o=n(397),s=n(85),l=n(16),c=n(137),f=n(153),u=n(90),m=n(625);!function(t){t.SHOPLIFT="SHOPLIFT",t.ROBSTORE="ROBSTORE",t.MUG="MUG",t.LARCENY="LARCENY",t.DRUGS="DRUGS",t.BONDFORGERY="BONDFORGERY",t.TRAFFICKARMS="TRAFFICKARMS",t.HOMICIDE="HOMICIDE",t.GRANDTHEFTAUTO="GRANDTHEFTAUTO",t.KIDNAP="KIDNAP",t.ASSASSINATION="ASSASSINATION",t.HEIST="HEIST"}(a||(a={}));const h=t=>{switch(t){case c.a.SHOPLIFT:return a.SHOPLIFT;case c.a.ROB_STORE:return a.ROBSTORE;case c.a.MUG:return a.MUG;case c.a.LARCENY:return a.LARCENY;case c.a.DRUGS:return a.DRUGS;case c.a.BOND_FORGERY:return a.BONDFORGERY;case c.a.TRAFFIC_ARMS:return a.TRAFFICKARMS;case c.a.HOMICIDE:return a.HOMICIDE;case c.a.GRAND_THEFT_AUTO:return a.GRANDTHEFTAUTO;case c.a.KIDNAP:return a.KIDNAP;case c.a.ASSASSINATION:return a.ASSASSINATION;case c.a.HEIST:return a.HEIST}return a.SHOPLIFT},d=t=>null!==t&&t.type===f.b.CRIME;class p extends f.a{constructor(t){var e,n;super(f.b.CRIME,null===(e=null==t?void 0:t.singularity)||void 0===e||e),this.crimeType=null!==(n=null==t?void 0:t.crimeType)&&void 0!==n?n:c.a.SHOPLIFT,this.unitCompleted=0}getCrime(){const t=Object.values(s.a).find(t=>t.type===this.crimeType);if(!t)throw new Error("CrimeWork object constructed with invalid crime type");return t}process(t,e=1){var n,a;this.cyclesWorked+=e;const r=null!==(n=null===(a=Object.values(s.a).find(t=>t.type===this.crimeType))||void 0===a?void 0:a.time)&&void 0!==n?n:0;for(this.unitCompleted+=i.a._idleSpeed*e;this.unitCompleted>=r;)this.commit(t),this.unitCompleted-=r;return!1}earnings(){return Object(m.a)(this.getCrime())}commit(t){const e=this.getCrime();if(null==e)return void Object(l.a)(`ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`);const n=t.focusPenalty();let a=Object(u.d)(this.earnings(),n,!1),r=e.karma;Object(o.a)(t,e.type)?(t.gainMoney(a.money*t.mults.crime_money,"crime"),t.numPeopleKilled+=e.kills,t.gainIntelligenceExp(a.intExp)):(a=Object(u.d)(a,.25),r/=4),t.gainHackingExp(a.hackExp),t.gainStrengthExp(a.strExp),t.gainDefenseExp(a.defExp),t.gainDexterityExp(a.dexExp),t.gainAgilityExp(a.agiExp),t.gainCharismaExp(a.chaExp),t.karma-=r*n}finish(){}APICopy(){return{type:this.type,cyclesWorked:this.cyclesWorked,crimeType:h(this.crimeType)}}toJSON(){return Object(r.b)("CrimeWork",this)}static fromJSON(t){return Object(r.a)(p,t.data)}}r.c.constructors.CrimeWork=p},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(127),o=n(39);const s=["ttftfffttttttttttfffffffttftt1ttttttt111tttt1111111tttt1tt111tttt111111tttt1ttttttttttttttt111111111\nttfttttttttttttttttfLLLftfffffffffftttt111tt11111ttffffftttt1111111111111111ttttttfttttttttt111111t1\nttttttttttttttttffffLfftffffffffLLffttttttftt111ttfffffftttttttt111111ttttttffffttfffttttttt111111tt\nttttttttttttttttfffLfttffffffLLffffttttttttttt1tfffffffffftttttt111111tffffffffftttfffftttt11111ttt1\nttttttttttttffLfttfffttfffffffffttfftttttt1t1tt11tfffffftttttt111t111111ttffffLLffttfffftt111111tttt\nttttttttttffLLLLfttttffLLLfttttftfLftttttttffffttttffffttttfftt11t111tt111ttfffLffttfftttttt1111tttt\nttttttttffLLLLLLLffttfLLffttfffftfLfttttttffttt11111ttttffffffftt1111tft11111ttffffttt11tfftt11ttttt\ntttttttfffLLLLLLLLfftffttttffLffftfftttttft1i;;::::;iitffffffffftt111tft1tttt1ttffLfttttfffffttttttt\ntttttttfffLLLLLLLLfttttffftffffftfttttttff1:,,,,,,,,::itfffffffft11111111ttttttttttt1tfffffffffffttt\ntttffttffLLLLLLLLLfttfftffffffffLLLftttttt;::,:::;;;;::1tfffftfft11111ttt1ttt1tfttt11ttffffffffLfttt\ntffffffffLLLLLLLffftfLfffttfLLffLLLfttttti;;;iii11111;:i11ttffft111111tfft11t11tt1tttttfffLLLLLLfttf\ntfffffttttfLLLffttttfffffttLLLLfLLLftttfti:;;;iiiiiiii;it111tt111t1111tffttfftt11ttftttfffLLLLLLffff\nttttfttttffffftttttttttttttfLLLffLLfttttt1;;;;;;iiiiii;1tft11tt1111111tfftfffftttttttttttfLLfffttfff\ntfffffffffftttfffffffffttffttLLfffLfttttt11i;;;;iiiiiii1tt11tfftt11111ttt1fffttt1tttttttttfffftttttt\nttffffffffftttfffffffffttffftffttftttttff1ii;;;;iii1iii111tt1ttttt1111t111ffttffttfffffLffttttffffff\nttffffffffttttffffffffttttttttttffftttttft1ii;;;ii1iii111tfft11ttt111111t1tt1tfft1ttffffLLftttLLLLLL\ntttffffffffttfffffffftttttttt11fffftttt1t111iiii;iiiii11ttffft11111111ttttttt1tt11ttffffLfftttfLLLLf\ntttttttffffttfffttttttttffttt11tffttttttt11ttii;;;iiii11i1ffftt1111111tttt111tttt11ttttffffftffLLLff\ntfttttttttttttttttttttfffftttt11tfftttttt111t1i;;;iiii1i,,:;i1111t1111ttt111t1tfftt11111ttfftffffftt\nttttfffftttttttfffftttffffttffttttft111tt11111i;;;iiii1;,,....,:::;i11tt111tt11tffftttttttt1tttttttt\nt11ttffffftttffffffttttfffttffttttft1111111111;;;;;;;it;,...........,:it111ttt1tffftttttfft11ttfffff\ntt1ttfffftt1ttfffft111tffttfttttttt1111t1i;:;11i1i;;1t1:,,............,itt11tt1tfftt1tfffffft1tffLLf\ntfttttfttttt11tttt1ttt11ttttttftt111111i:,..:1111iii11;,...............;tt111t11ttttttttffttt11ffLLf\ntfftttttttfftttttttffftt111ttffftt11i;,.,...,iiii;;;;:,,...............:1ttt1111ttfffttttft1tt1ttfft\nttttttttttttttt11ttttttttttfffffft1:,..........::::::,,,...............,1ttttt11ttfffffttttffftttttt\ntfffttttffffftt11ttttttttttfffffft1:...........:;::;:..................,1tttttt1ttfffffttttttttftttf\ntfffttttfffffft1ttftttfftttttffft11:...........,:::::..................,1tttft11tfffffffttfffffffttf\ntfffttttffffff11tttttttttttttttttt1;...........,::::,...................;t1t1111tfffffLfttfffffffttf\ntfffttttfftttt11tttttttt1tfftttttt1:...........,::::,...... ............,1111tt11fffffLftttffttffttf\ntttttttttttttt11tttttttt1tffftttft1:...........,:::,,....................it1ttt11tfffffftttffttffttt\nttttt1tttttttt11ttttttttttffttttttt:...........,::,,.....................:111tt11tttttttt1tttttttttt\nttttt1tttttttt11tftttttftttttttttt1;,:;:.......,:,,,....................,,1111t11ttttttt11ttttttfttt\n1tttt1ttfffttt11ttffffffttttfffft11ii1i:.......,:,,,.....................,1tt1111ttttttt111tttttfttt\n1ttt11tttttttt11tttttttttttttttttti;;;;:.......,:,,,....... .............,itt1111tttt11t111ttttttt1t\n111111tttttttt11111111ttttttttttt1i;;;;:.......,:,,,......................itt11111111111111111111111\n1111111111111111111111ttttttttttt1;;;;;:...... ,:,,,,.....................itt11t11111111111111111111\n1111111111111111111111tttttttttt1;:,::;,...... ,:...,.....................ittttt11111111111111111111\n111111111111111111111111tttttttt1i,..... .... .:........................,i1tttt11111111111111111111\n1111111111111111111111111t11t11111;,....,,.... ,:::,,,...................,11ttttt11t1111111t11111111\n11111111111111111111111111111111111iiiiii. ... .::::::,..................,11t1ttt111t11111tttttt1111\n1111111111111111111111111111111111111111:.,.....::::::,..................:111tttttt1tttt11tttttt1111\n1111111111111111111111111111111111111111:::,...,::::;::,..,,.............:11tt1ttttttttttttttttt1111\n","ttftfffttttttttttffffffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttftfLLLftfffffffffftt11111tt11111ttffffttttt1111111111111111ttttttfttttttttt111111tt\nttftttttttttttttffffLftttfffffffLLLfttttttftt111ttfffffftttttttt111111tttttffffftfffftttttt1111111tt\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tffffffffffttttttt11111tffffffffftttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttfftttttt1tttt1ttftfffftt1ttt111t111111ttffffLLffttfffft1111111tttt\nttttttttttffLLLLfttttffLLLfttttttfLftttttttfft11i;;:;;i11ttfftt11t111tt111tttffffftttttttttt111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLttttttfff1;,,,,,,,,:;tffffft11111tft11111ttffffttt11tffftt1ttttt\ntttttttfffLLLLLLLLfftffttttffLffftfftttttfft1;:,,,,,::::,;tffftttt111tft1tttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffffftfftttttfffti:;;;iiii11i;:tffffft11111111ttftttttttt1ttffffffffffttt\ntttffttffLLLLLLLLLftffftfLftfftfLLLftttttfft::i;iiiiii11i:1ffftft11111ttt1ttt1ttttt11ttfffffLLfLfttt\nttfLfffffLLLLLLLLfftfLLfffffLfffLLLfttttt1tt;:;;;;;iiiiiii1tffft11111tffft11t11tt1tttttfffLLLLLLffff\ntffftfttttfLLLffttttfffffttLLLLfLLLftttft111i;;;;;;iiiiii111tt111t1111tffttfftt11tfft1tfffLLLLLLLffL\ntttfftttttffLftttttttttttttfLfLffLLfttttttt1iii;;;;;ii11i1t11t11111111tffttfffttttttt11ttfLLLLffftff\nttfLffffffftttfffffffffttfftfLLfffLftttttfft1ii;;;;iii1i1tt1tfftt11111ttt1tffttt1ttt1tttttffffttffft\nttffffffffftttffffffffttfffftffffftttttfffft111;;;;iiii1111t1ttttt1111tt11ffttfftttfffffLfttttfffffL\nttffffffffttttffffffffttttttttttffftttttttt11ttii;iiiiii11tft11ttt111111t11t1tfft1tfffffLLftttLLLLLL\n1ttffffffffttfffffffftttttttt11ffffttttt1111tftiii;;iiii1;,;1111111111tttt11111111ttffffLfftttffLLLf\nttttttttfffttfffttttttttffttt11tffftttttt11ttf1;;;i;iiii1:,,.,,::;ii11tttt111tttt11ttffffffftffLLLff\ntfttttttttttttttttttttfffftttt11tfftttttt111tt1;;;i;;ii1t:,,........,:;1t111t1tfftt11111ttfftffffftt\ntftttffffttttttfftftttffffttffttttftt11tt111i;;;;;;;;;it1,,............,;11tt11tffffttttttt1tttttttt\ntttttffffftttfffffft1ttffftfffttttft111111;:,.;iii;;;i11,.,.............,1tttt1tffftttttfft111tfffff\n1tttffffftt1ttfffftt11tffttfttttttt1111i;,....,1iii;ii;,................,111tt1tfft11tffffftt1tLffLf\ntftttfftt1ttt1tttt1tttt1ttttttttt1111;:,.......i1;;;:::.................,it11t11ttttttttffftt11fffLf\ntfftttttttfftt1111ttfftt11ttfffftt1ti..........:i;::;:,..................ittt111t1tffttttft1tt1tffft\nttttttttttttttt11tttttttt1tffffffftti,.........,::::::,..................itttt11ttffffftttttfftttttt\ntfffttttfffffft11ttttttttttffffffft1i,.........,:,:::,...................,1tttt11tfffffttttttttffttf\ntfffttttfffffft11tftttfftttttffft1111:.........,:,:::,....................;tt111tfffffffttfffffffttf\ntfffttttfffffft1tttttttftttttttttt111;.........,:,::,,....................,111111fffffLfttfffffffttf\ntffftttttttffft11tttttttttffttttfft11i.........,:.:,,......................:1tt11fffffLftttffttffttf\ntttttttttttttt111ttttttt1tffftttfft111:....... ,:.:,,.......................1tt11tfffffftttffftffttt\nttttt1tttttttt11ttttttttttfttttttft111i,...... ,:,,,,......................,itt11ttttttt11ttttttfttt\nttttt1tttttttt11tfttttfftttttffttt1111i,...... ,:.,,,......................:11111ttttttt11ttttttfttt\n1tttt1ttftfttt11tfffffffttttfffft11111,....... ,,.,,....... ...............it1111ttttttt111tttttfttt\n1tttt1tttttttt11ttttttttttttttttt1111;,....... ,,.,,......................:tt11111ttt11t111ttttttt1t\n11t111tttttttt111t1111tttttttttt1iiii:,,...... ,,.........................;t111111111111111111111111\n111111111tt11111111111ttttttttt1;;iiii:....... ,,............ ...........;tttt1111111111111111111111\n1111111111111111111111ttttttttt1;;;iii;... ....,::::,....,:::,,.........;1ttttt111111111111111111111\n111111111111111111111111tttttttt1i;;ii: .,....,:::::... .;;;;;:,.....,;1ttttttttt111111111111111111\n1111111111111111111111111tt1111111i,,.,:;i: ...,:::::.....:;;;;;:.....,1ttttttttt11t1111111t11111111\n11111111111111111111111111111111111:.:1tti,....,:::::.... ,;;;;;;,.....ittttttttt111t11111ttttt11111\n1111111111111111111111111111111111111ttt;,,....,:::::,... .,;;;;:,.,,..:ttttttttttt1tttt11tttttt1111\n11111111111111111111111111111111111111t1,,,....:;;::::,.....:;;;:......,1ttttttttttttttttttttttt1111\n","ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt1tt111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftfffffffffttt11111tt11111ttfffft1ttt1111111111111111tttttffttttttttt111111tt\nttftttttttttttttffffLffttfffffffLLLfttttttfttt11tffffffftttttttt111111tttttffffftfffftttttt1111111tt\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt1iiiii1tttttttt11111tffffffffftttfffffttt1111t1tt1\nttttttttttttffffttffftffffffffffttffttttt11tttt1i::,,,,,,:;111111t111111ttffffLLffttfLfftt11111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfft1i;,,,,,,,,,:;ttt11t111tt111tttffffftttftttttt111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttffffti;::;;;;;iii::1ftt11111tft11111ttffffttt11tffftt1ttttt\ntttttttfffLLLLLLLLLftffttttffLffftffttttffffft;:;iiii11111i:iftttt111ttt1tttt11tffLfttttfffffttttttt\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffft;:;;;;;iiiiii;1fftt11111111ttftttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffffti;;;;;;;ii;iiitffft11111ttt1ttt1tfttt11ttfffffLLfLfttt\nttfLfffffLLLLLLLLffffLLfffffLfffLLLLtttttttff1iii;;i;;iii111tfft111111ffft11t11tt1tttttfffLLLLLLffff\ntffftftttffLLLffttttfffffttLLLLfLLLffttftt11t1iii;;;;;iiiii1tt111t1111tffttfftt11tfft1tfffLLLLLLLfff\nttffftttttffLftttttttttttttfLLLffLLftttttttft111i;;;;iiii1111111111111tffttfffttttttt11ttfLLffffftff\nttfLffffffftttfffffffffttfttfLLfffLftttttfffft11i;;;;iiii1t1ttttt11111ttt1tffttt11ttttttttfffftfttft\nttffffffffftttffffffffttfffftffffftttttfffft11t1i;;;;;iii1ii1ttttt1111t111ffttfft1tfffffLfttttfffffL\nttffffffffttttffffffffttttttttttffftttttttt11tft1i;;;;iii1i,:;i1ttt11111t11t1tfft1ttffffLLfttfLLLLLL\ntttffffffffttfffffffftttttttt11ffffttttt1111tfti;ii;;iiii1;,,...,:;ii1tttt1111tt11ttffffffftttffLLLf\nttttttttfffttfffttttttttffttt11tffftttttt11t1iii;;ii;;;i1t:,.........,:;1t111ttt111ttffffffftffLLLLf\ntfttttttttttttttttttttfffftttt11tfftt11tt1i:,.:;;;i;;;itti,,............,;1111ttttt11111ttfftffffftt\ntfttfffftttttttfffftttffffttffttttft1111i:....,;;;ii;i11;.,,.............:1tt1ttffffttttttt1ttttttft\ntttttffffftttffftffttttffftfffttttft1i:,.......:;;;;;;;:,................:tttt1tffftttttfft11ttfffff\n1t1tffffftt1ttfffftt11tffttftttttttt1,.........,ii;;;;;,.................:11tt1tfft11tfffffft1fLLfLf\ntftttfftt1ttt1tftt1ttt11ttttttttt111i,.........,11;:;;:,.................,1t1t11ttttttttfftt111fffLf\ntfftttttttffttt111ttfftt11ttffffftt11,.........,i;::::,..................,1tt11111ffft1ttt11tt1tffft\nttttttttttttttt11tttttttt1tffffffft11;..........::::::,...................;tt1111tfffftttttffftttttt\ntfffttttfffffft11ttttttttttffffffft11:..........:::::,..,;:,...............ittt1tttttffttttttttffttf\ntfffttttfffffft11tftttffttttfffft1111:..........:::::,..;1i;:,..............1t11tfffffffttfffffffttf\ntfffttttfffffft1tttttttftttttttttt111;..........::,:,...;ii;;;,.............:1111tffffLfttfffffffttf\ntffftttttttfft11ttttttttttfftttttft11i,.........::,,,...;;;;;i:..............;111tffffLfttfffttffttf\ntttttttttttttt111tttttttttffftttfft11i,.........::,,,...;;;;;i:..............:111tfffffftttffttffttt\ntttttttttttttt11ttttttttttfftttttft111:.........:,,,....::;;;;:.............,1t11ttttttt11tttttffttt\nttttt1tttttttt11tfttttfftttttfftttt111:.........:,,,......,::::..,.........,i1111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfffffffttttfffft1111i:,........:,,,..... .......,,...... .it1111ttttttt111tttttft1t\n1tttt1tttttttt11ttttttttttttttttt1iiii;,........:........... ...........:itt11111ttt1t1111ttttttt1t\n111111tttttttt111tt111tttttttttti;;;iii:... ....:,,...................:i1tttt11111111111111111111111\n111111111tt11111111111tttttttttt1;;;;;;;. .,....::::..................:1tttttt1111111111111111111111\n1111111111111111111111ttttttttttt1i;;::..:;1,...::::...................;ttttttt111111111111111111111\n1111111111111111111111111tttttttt111i,.,it1;....::::,..................,1ttttttttt111111111111111111\n1111111111111111111111111tttt11111111ii1t1i:...,::::,........,..........itttttttt11t1111111tt1t11111\n11111111111111111111111111111111111111tt1;:....::::;:.......,...........:1ttttttt111t11111ttttt11111\n111111111111111111111111111111111111111ti,,....:;:;::,..................,ittttttttt1tttt11tttttt1111\n111111111111111111111111111111111111111t:,:.,.:;;;;:::,..................;111t1ttttttttttttttttt1111\n","ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt11t111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftfffffffffttttt1111t11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\nttftttttttttttttffffLffttffffffffLLfttttttfttt11ttt1iiii;i11tttt111111tttttffffftffffttttttt111111tt\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tt1::,,,,,,:;1ttt111111tfftfffffftttfffffttt1111t1tt1\nttttttttttttffffttffftffffffffffttfftttttt1ttt11i;:,,,,,,,,,:1111t1111111tffffLLffttfLfftt11111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;:::;;;;;;;::it11t111tt111tttffffftttfttttt1111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttfffffti:;;ii111111i:itt11111tft11111ttffffttt1ttffftt1ttttt\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffft;:;;;;;iiiiii;ittt1111ttt1tttt11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffffti;;;;;;;ii;iiitttt11111111ttftttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttfffff1iii;;i;;i1i1i1tttt11111ttt1ttt1tfttt111tfffffLLfLfttt\nttfLffffffLLLLLLLffffLLfffffLfffLLLftttttttfft1i;;;;;;;iiiiitfft111111ffft11t11tt1tttttffffLLLLLffft\ntffftfttttfLLLffttttffffftfLLLLfLLLftttftt1111111i;;;;iiii111t111t1111tffttfftt11tfft1tffLLLLLLLLfff\nttffftttttffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111111111111tffttffftttttttt1ttfLLLfffffff\nttfLffffffftttfffffffffttfttfLLfffLftttttffft1111i;;;;;ii111tfttt11111ttt1tffttt11ttttttttfLfftfttft\nttffffffffftttfffffffffttffftffffftttttfffft11t11i;;;;iii1i:;1ttft11111111ffttfftttfffffLfttttfffffL\nttffffffffttttffffffffttttttttttffftttttft111tttiii;;iiii1;,,,:;i1111111111t1tfft1ttffffLLftttfLLLLL\ntttffffffffttffffffffttttttttttfffftttt1111i;:;iiii;;;i;11:,,.....,:;i1tft1111tt111tffffLfftttffLLLf\nttttttttfffttfffttttttttfftt111tfffttt11i;,,..:i;;;i;ii1t1,,..........,:i1111ttt1111tffffffftffLLLLf\ntfttttttttttttttttttttffffttttt1tffti;:,,.....,;;;iiii1ti,,,.............;1111ttttt11111ttfftffffftt\ntttttffffttttttfffftttffffttffttttf1:.........,;:;;;;;;;,.,,,............:1tt1ttffff11ttttt1ttttttft\ntttttffffftttffftfft1ttffftfffttttf1,..........,;;;;;;;:.:ii;;:,.........:tttt1tfffttttffft111tfffff\n1tttffffftt1ttfffftt11tffttfttttt1t1,...........ii;;;::,,;i;;ii:.........:tttt1tfft11tfffffft1fLLfLf\ntftttffttttt11tftt1tttt1ttttttttt11i,..........,1i;;::,.:i;;;;i:.........,1t1t11ttttttttfftt111fffLf\ntfftttttttffttt11tttffttt1tttffft11i,..........,ii;:::,.,:;;iii:..........it111111tfft1ttt11tt1tffft\nttttttttttttttt11tttttttt1tfffffftti,...........:::::,....:;;ii:..........:tt111ttfffftttttffftttttt\ntfffttttfffffft11ttttttttttfffffft1i,...........:::::,.....,:;;:.... ......,1t111ttttffttttttttffttf\ntfffttttfffffft11tftttffttttfffft111:...........:::::,........,..,..........,1111tffffffttfffffffttf\ntfffttttfffffft1tttttttftttttttttt11:...........::,:,........ ...:;,.........:111tffffLfttfffttffttf\ntffftttttttfft11ttttttttttffttttttti,...........:::,,.............,...........,i1tffffLfttfffttffttf\ntttttttttttttt111tttttttttffftttfft;,:;:........:::,.............. ...........:11tfffffftttffttffttt\ntttttttttttttt11ttttttttttfftttttftii1i;:.......:::,.......... ..............:t111tttttt11tttttffttt\nttttt1tttttttt11tfttttfftttttffttt1ii;ii;,......::,,........................:1111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfffffffttttfffft11i;;ii;,......:,,,..........:........ .;t1111ttttttt111tttttft1t\n1tttt1tttttttt11tttttttttttttttttt11;:;i:,,.....:,.................. .;i;;1tt1111tttt1t1111ttttttt1t\n111111tttttttt111t111ttttttttttttt11i:,,:1;....,::....................:1ttttt11111111111111111111111\n111111111tt1111111111tttttttttttttt11i;;1t:....:::::...................;tttttttt11111111111111111111\n1111111111111111111111ttttttttttttt111ttt1,,,.,:::::,..................,1ttttttt11111111111111111111\n111111111111111111111111tttttttttt1111111i,::.,;::;:,...................;ttttttttt111111111111111111\n1111111111111111111111111ttttttt11111111t;.,,.,;;;;;,...................,1ttttttt11t1111111tttt11111\n111111111111111111111111111111111111111t1:..,,:;;;;;:,...................;ttttttt111t11111ttttt11111\n111111111111111111111111111111111111111ti,,,::;;;;;;;:,..................,1tttttttt1tttt11tttttt1111\n111111111111111111111111111111111111111t;,,::,;;;ii;;::,..................it1tttttttttttttttttt11111\n","ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftfffffffffttttt111tt11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\nttftttttttttttttffffLffttfffffffLLLftttttttttt11ttt1iiii;i11tttt111111ttttttfffftffffttttttt111111t1\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt;:,,,,,,,:itttt11111tfftfffffftttfffffttt1111t1ttt\nttttttttttttffffttffftffffffffffttfftttttt1tttt11i:,,,,,,,,,:i111t1111111tffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;::;;;;;;;;;,;t111111tt111tttffffftttftt1tt1111ttttt\nttttttttffLLLLLLLffttfLLffttfffftfLLtttttffffff1,:iiii111111;:tt11111tft11111ttffffttt11tffft11ttttt\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffffi:;;;;;iiiii1;;ttt1111ttt1tttt11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLLftfftttttfffffff1;;;;;;;ii;;ii1ttt11111111ttftttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLffffftfLftffffLLLftttttfffff1iiiiii;;iiii1itttt11111ttt1ttt11tttt11ttfffffLLfLfttt\ntffLLffffLLLLLLLLffffLLftffLLLffLLLftttttttffftiii;;;;;ii1ii1tft111111ffft11t11tt1tttttffffLLLLLffft\ntfffffttftfLLLffttttfffffttLLLLfLLLftttft111tt111i;;;;iiiii1tt111t1111tffttfftt11tfft1tffLLLLLLLLfff\nttttfttfffffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111t11111111tffttffftttttttt1ttfLLLfffffff\nttffffffffftttfffffffffttfftfLLfffLftttttffft11t1i;;;;;iii11ttttt11111ttt1tffttt11ttttttttfLfftftttt\nttffffffffftttfffffffffttffftffftftttttffft111t11i;;;;iii1ii11tttt1111tt11ffttfftttfffffLfttttffffff\nttffffffffttttffffffffttttttttttffftttttttt11111iii;;iiii1;,:;1tttt11111t11t1tfft1ttffffLLftttfLLLLL\ntttffffffffttffffffffttttttttt1tffftttt11i;:,:i;;i;;;;;i11,,..,,:;i111tttt1111tt11ttffffLfftttffLLLf\nttttttttfffttfffttttttttffttt11ttff1ii;:,....,;::;i;;i11ti,,.......,:;ittt111ttt1111ttffffffttfLLLLf\ntfttttttttttttttttttttfffftttt11tff;,,........;;;;iii1tti,,,,:;;::,....,i11111ttttt11111ttfftffffftt\ntfttfffffttttttfffft1tffffttfft1ttt:..........:;;;;;;;i;...,;i;iii:.....,i1tt1ttffff11ttt1t1ttttttft\nttttfffffftttfffffft11tffftffftttti,..........,:;;;;;;;,...,;;iiii,......;tttt1tffftttttftt111tfffff\n1tttffffftt1ttfffftt111ffttft11tt1;,...........;i;;;;;:,.....:;iii,......;tttt1tfft11tffffftt1fLLfLf\ntttttffttttt11tftt1tttt1tttt1tttti,............;1;::;;,......,;iii,......;t11t11ttttttttfftt111fffLf\ntfftttttttffttt111ttfftt111ttfffti.............;i;::::,.......,;;;,......;ttt11111tfft1tttt1tt1tffft\nttttttttttttttt11ttttttt11tffffffi,............,::;:::,..........,.......:ttt1111tfffftt1tttfftttttt\ntfffttttfffffft11tttttttttttffffti,............,:::::,..............,....,ittt11ttttttft1ttttttffttf\ntfffttttfffffft11tffttff11t1tfff1;...... ....,.,:::::,.....................;11111tffffffttfffffffttf\ntfffttttfffffft1tttttttfttttttti:,......:iiii;,,:::,:.......................,;111tffffffttfffttffttf\ntffftttttttfft11ttftttttttfftti,,::,.,:;1i;;;;.,::::,.........................,i1tffffLfttfffttffttf\ntttttttttttttt111ttttttt1ttfft1:::,,,:,:;;;;i:.,:::,,..........................;1tfffffftttffttffttt\nttttt1tttttttt11ttttttttttfttt1;,...,...:;;;:, ,:::,..........................;11ttttttt11ttttttfttt\nttttt1tttttttt11tfttttfftttttfti,..,....,,,....,:::,.........................:111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfffffffttttffft1;::::,,.......,:,:,.................. .:1111ttttttt111tttttfttt\n1tttt1tttttttt11ttttttttttttttttttt11111:......,:,,,..................,::,:1tt1111ttt1t1111ttttttt1t\n111111tttttttt111t1111tttttttttttt111111:......,,.....................,1tttttt1111111111111111111111\n1111111111t11111111111ttttttttttttt11111:......,:,,....................:1t1ttttt11111111111111111111\n1111111111111111111111ttttttttttttt1111t:......,;;::....................:1ttttttt1111111111111111111\n111111111111111111111111ttttttttt1111111:......,::::,...................,itttttt11111111111111111111\n111111111111111111111111111tttt111111111:......,;;::,....................:1ttttttt1tt11111ttttt11111\n1111111111111111111111111111111111111111:......:;;;::,...................,ittttttt11t11111ttttt11111\n11111111111111111111111111111111111111t1:......:;i;;::,...................:11tttttt1tttt11ttttt11111\n1111111111111111111111111111111111111111,......:;;;;;::,..................,1tttttttttttttttttttt1111\n","ttftfffttttttttttfffffLftfftttttttttt111tttt1111111tttt111111ttttt11111tttttttttttttttttttt11111111t\nttfttttttttttttttfffLLLftffffffffftttttt111111111ttfffftt1tt1111111111111111ttttttftttttttt1111111tt\nttftttttttttttttffffLftttfffffffLLLft1tttttft111tfftttfttttttttt111111ttttttfffftffffttttttt11111tt1\nttttttttttttttttfffLfttffffffLLffffttttttttttt1ttti;;;;::;i1tttt111111tffffffffftttfffffttt11111ttt1\ntttttttttttfffffttffftffffffffffttfftttttt1ttt111i,,,,,,,,,;11111t1111111tffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1i::,,,,,,,,,:1t11t111tt1111ttffffftttftt1tt1111ttttt\nttttttttffLLLLLLLffttfLLLfttfLfftfLLtttttfffffti:;;iiiiiiii::1tt11111tftt1111ttffffttt11tffft11ttttt\ntttttttfffLLLLLLLLLftffftttffLffftfftttttffffft::;;iii1i111i:1ttt1111ttt1tttt11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffffft;;;;;;;iiiiii;tttt11111111ttftttttttt11tffffffffffttt\ntttfftfffLLLLLLLLLfttfftfLfffffffLLftttttfffft1ii;;;;;iiiiiitfttt11111ttt1ttt11tttt11ttfffffLLfLfttt\nttfLLfffffLLLLLLLfftfLLftfffLLffLLLftttttttfftiii;;i;;ii111itfft111111tfft11t11tt1tttttfffLLLLLLLfff\ntfffffttftfLLLffttttffffftfLLLLfLLLftttft111tt1iii;;;;iiiii1tt111tt111tffttfftt11tfftttffLLLLLLLLfff\nttttfttffttffftttttttttttttfLLLffLLftttt1tttt11t1i;;;iiii1111t11111111tffttffftttttttt1ttfLLLfffffff\nttfLffffffftttfffffffffttftttfLfffLftttttfffft11i;;;;iiii111tfttt11111ttt1fffttt1ttt1tttttfLLffftttt\nttffffffffftttfffffffffttfftttfttttttttffft11111i;;;;;iii1tt11tttt1111t111ffttffttfffffLLfttttfLffff\nttffffffffttttffffffffttttttttttffftt11ttt1111t1i;;;iii1i1itt11ttt111111t11t1ttft1ttffffLLftttfLLLLL\ntttffffffffttfffffffftttttt1111tffftttt11i;::i1iii;;;iii1i,:;i11t11111tttt1111tt11ttffffLfftttffLLLf\nttttttttfffttfffttttttttffttt11ttft1ii;:,....;i;;;ii;;i1t:,...,:;i1111tttt111ttt1111tttffffftfLLLLLf\ntfttttttttttttttttttttfffftttt11t1:,,........ii:;;iii1tt1,,,......,,;i1tt11111ttttt11111ttfftffffftt\ntfttfffffttttttfffft1tffffttfft11;,..........:;::;ii11t1:,,,...,,:,...,it11tt11tffffttttttt1ttttffft\nttttfffffftttfffffft11tfffttfttt1,....,,......,:;;;;;;i,.......:iii;;,.,1t1ttt1tffftttttfftt11tfffff\n1tttffffftt1ttfffft1111tfttft11ti,.............;i;;;;;:........:iiiii:..it11tt1tfftt1tfffffft1fLffLf\ntttttffttttt11tttt1tttt1tttt1tt;,..............i1;;;;;,........,;iii;,..it111t11ttttttttfftt111fffLf\ntfftttttttfftt1111ttfft11111tft:...............;i;;;;:,.........:;ii:..,ittt111111tfftttttt1tt1tffft\nttttttttttttttt11ttttttt11ttff1,...............,::::::......... ,;ii:...itttt111ttffffft1tttfttttttt\ntfffttttffftttt11ttttttt111tft;,........... ..,:;:::,...........,:;:...;ttttt11ttfffffttttttttffttf\ntfffttttfffffft11ttttttf11111;:,..... .....,:::::::::...............,...:1ttt1111fffffffttfffffffttf\ntfffttttfffffft11ttttttt11ti,,...........,:;i;;;:::::..................,.:tt11111tffffffttfffffffttf\ntffftttttttfff111ttttttt111,.,,,,...,,..,;;;;;i;:,::,....................,;i1t111tffffLfttfffftffttt\ntttttttttttttt111ttttttt11t:.......,....,:;;;;;:::,:,.......................:1t11tfffffftttffttffttt\nttttt11ttttttt11tttttttt11t1,............,,,...,::::.........................:111ttttttt11ttttttfttt\nttttt1tttttttt11ttttttfft1t1:,............ .. ,:::,........................,i111ttttttt11ttttttfttt\n1tttt1ttfttttt11tfftttfftttttt1;::,,::.........,:,,,........................i1111ttttttt111tttttfttt\n1ttt11tttttttt11tttttttttttttttttt111i.........,::,,................. . .;t11111ttt1tt111ttttttt1t\n11t111tttt1tt111111111tttttttttttt111i,........,:,,...................,..,itttt111111111111111111111\n1111111111111111111111tttttttttttt111i,....... ,:....................i111ttttttt11111111111111111111\n1111111111111111111111ttttttttttt1111i,....... ,:,::,................,i1t11tttttt1t11111111111111111\n111111111111111111111111tttttttt11111i,........,::;:,..................;1ttttttt11111111111111111111\n1111111111111111111111111tttt11111111i........ ,,:::,..................,1ttttttttttt1111111tt1t11111\n1111111111111111111111111111111111111i,........,,:::,...................it111ttttt11t11111ttttt11111\n111111111111111111111111111111111111t1,........,,,:::,..................,1t1ttttttt1tttt11ttttt11111\n11111111111111111111111111111111111111,........,,,;;::,..................i111ttttttttttttttttttt1111\n","ttftffftttttttffffffffLfttftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\nttfttttttttttttttftfLLLftffftffffftttttt111111111ttfffftt1tt1111111111111111ttftttftttttttt1111111tt\nttftttttttttttttffffLftttfffffffLLLft11tttfft111tfffffffttt1ttttt11111ttttttfffftffffttttttt11111tt1\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tt111ii11tft1ttttt11111tfftfffffftttfffffttt11111ttt1\nttttttttttttffffttfffttfffffffffttffftttt111ttt1:,,,,,,,:i1111111t111111ttffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttftt1;:,,,,,,,,,;1tt111t1111t111tttffffftttftt1ttt111ttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttffft1i;;;;;;;;;;::1tttt11111ttt11111ttffffttt11tffft11ttttt\ntttttttfffLLLLLLLLLftffftttffLLfftfftttttffffi:;iii111111i:ittttt1111ttt1tttt11tfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffff;:;;;;iiiiiii:ittttt11111111ttttttttttt11tffffffffffttt\ntttffftffLLLLLLLLLfttfftfLftfffffLLftttttffff1i;;;;;ii;iiiittttft11111ttt1ttt1ttttt11ttfffffLLfLfttt\nttfLLfffffLLLLLLLfftfLLftfffLfffLLLftttttttf1i1i;i;;iiii1i1tffft111111tfft11t11tt1tttttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1111iii;;;;ii1i1i11tt111t1111tffttfftt11tfftttfffLLLLLLLfff\ntttffttfftffLftttttttttttttfLLLffLLfttttttttt11i;;;;iiii11t11111111111tffttfffttttttt11ttfLLLfffffff\nttfLffffffftttfffffffffttftttfLfffLftttttffft11i;;;iiiii1t11ttttt11111ttt1fffttt1tttttttttfLLftftttt\nttffffffffftttfffffffffttffttfffttttttttfft1111i;;;;iii1111111tttt1111tt11ffttffttfffffLffttftffffff\nttffffffffttttffffffffttttttttttffftt11tttt11t1ii;;;iii11tfft11ttt111111t11tttfft1ttffffLLfttffLLLLL\ntttffffffffttfffffffftt1ttt1111fffft1tt11iiii1iiii;iiii1i:1tft11111111tttt111ttt11ttffffLfftttffLLLf\nttttttttfffttfffttttt1ttfft11111tft11i;:,..,;ti;;;i;iii1;,,,:;i1111111tttt111ttt1111tffffffftfLLLLLf\ntfttttttttttttttttttttfffftttt11i;::,,......iti::;i;iitt:,,....,:;i111ttt111t1ttttt11111ttfftffffftt\ntfttfffffttttttfffftttffffttft11:...........;ii::;i11tti,,,,.......,:itt111tt1ttffff11ttt111ttttttft\nttttfffffftttffftfft11tfffttftt;,............,:;;;;;11;,..............;1111ttt1tffftttttfftt1ttfffLf\n1t1tffffft11ttfffft1111tfttft11:.............,:ii;;;;;,...............:11t11tt1tfft11tfffffft1ffffLf\ntttttfftt1tt11tttt1ttt11t1111t;,..............:i1;;;;:,...............,111111t11ftttttttfftt11tfffLf\ntfftttttttfftt1111tttft11111t1,...............:ii;;;;,............,,,.,1tttt11111ttfftttttt1tt1tffft\nttttttttttttttt11ttttttt11ttfi................:;::;::,...........,;i;;:1tttttt11ttffffftttttfftttttf\ntfffttttftttttt11ttttttt11ttfi................,;;:::,............,;iiii1tttttft1ttffftfttttttttftttf\ntfffttttfffffft11ttttttt11111;........ .......:;:::,............:iiiii11ttftt11tfffffffttfffffffttf\ntfffttttftffff111ttttttt11ti:,....... ,:::;;:,.,;:::,............:;;ii:i11tt1111tfffffffttfffffffttf\ntffftttttfffft111ttttttt11i,.........,iii;;;,..,:::,.............::;;,.it1111tt11tffffffttfffftffttf\ntttttttttttttt111ttttttt11,.,,,,..,,,:;;;;;;,..,:::,.............,::;..:i111ttt11tfffffftttffttffttt\nttttt1tttttttt111ttttttt11;,,,...... .:;;;;:...,:,,,.....................:111tt11ttttttt11tttttffttt\nttttt1tttttttt11tttttttt111,..........,,,,.....,:,,.......................:111111ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfft11i:,.....,.... .....,::,......................,1t11111ttttttt111tttttft1t\n1tttt1tttttttt11ttttttttttttt1ii;;;:...........,:,,.....................,it111111ttttttt111ttttttt1t\n11t1111tttttt111111111tt1tttttttt11:...........,:,,.............. .;t11111111111111111111111111\n1111111111111111111111ttttttttttt11,.......... ,,................,:,,,:i1tttt1t111111111111111111111\n1111111111111111111111tttttttttt11i,...........,,,,..............:1t11ttttttttttt1111111111111111111\n111111111111111111111111tttttt1111;........... ,,:;,..............:11ttttttttttttt111111111111111111\n11111111111111111111111111tttt1111;........... ,,:;:...............:111tttttttttt11t1111111tttt11111\n1111111111111111111111111111111111;....,,......,,,::................i1ttttttttttttt1t11111ttttt11111\n1111111111111111111111111111111111;............:,,;:,...............;1tttttttttttttttttt11ttttt11111\n1111111111111111111111111111111111:............,,:;;:...............,1t1tttttttttttttttttttttttt1111\n","ttftffftttttttfffffttfLfttftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffft1ttt1111111111111111ttttttftttttttt111111ttt\nttftttttttttttttffffLftttfffffffLLLftt1tttttt111ttfffffftttttttt111111tttttffffftffffttttttt111tttt1\nttttttttttttttttfffLfttffffffLLffffttt1tttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111tttt\nttttttttttttffffttfffttfffffffffttffftttt11111111i;i11ttt11tt1111t111111ttffffLLffttfLfft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttfti:::,,,,:;i1ttfttt11t111tt111tttffffftttftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLftttttft1;,,,,,,,,,,;tffffft11111tft11111ttffLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLfLftffttttfffti;:;;;;iii;::1fffffttt111ttt1tttt1ttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLfftfftttttfffi;;iiiii1111i:iffffftt11111111ttttttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffi:;;;;iiiiiii:1ftttfftt1111ttt1ttt1ttttt111tffffffLfLfttt\ntffLLfffffLLLLLLLfftfLLftftfLfffLLLLttttt1t1i;;;;;ii;iiii1ttffft111111tfft1tt11tt1tt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft11i1i;;;;i111iii111tt111t1111fffttfftt11tfftttfffLLLLLLLffL\ntttffttfftffLftttttttttttttfLLLffLLftttt1tti1i;;;;ii1iii1tt11111111111tffttffftttttttttttfLLLLfffffL\nttfLfffffffttffffffffffttftttfLfffLftttttfftt1;;;;iiii11ttt1ttftt11111tfttffftt111ttttttttfLLftftttt\nttffffffffftttfffffffffttffttfftttttttttfft111i;;;iiii1t111t1ttttt1111tt11ffttffttfffffLLfttffffffff\nttffffffffttttffffffffttttttttttfffttt1tft1111i;;;iiii111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt1111tffft11t111111iiii;;iii111fffft11111111ttft111ttt11tfffffLfftttfLLLLf\ntttttttttffttfffttttt1ttfft1t11ttfftttt1iiii1i;;;iii1i1i,;i1ttt1111111tttt111tttt111tffffffftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tff11i;:,,,:11i;;iii;it;....,:;i111111ttt111t1ttftt11111ttfftffffftt\ntfttfffffttttttfffftttffffttfft1ii;:,,.....:11;:;;;;1tt;,,,.....,,;i11tt111tt1ttfffftttttt11ttttttft\nttttfffffftttffftfft11tfffttft1;,..........:1ii;;ii1tti,,,..........,it1111ttt1tfffttttffftt1ttfffLf\n1tttffffftt1ttfffft1111tfttft1i,............,:;ii;;i1i,..............:111111tt1tfft11tfffffft1ffffLf\ntftttffttttt11tttt1ttt11t1111t;..............,;1i;;;;,...............,1111111t11ftttttttfftt11tfffLf\ntfftttttttfftt1111ttttt11111tt:............. ,;ii;;;:,...............,i111tt11111tffftttttt1tttttfft\nttttttttttttttt11ttttttt11ttft,...............;;;;;:,.................ittttttt11ttffffftttttfffttttt\ntfffftttftttttt11ttttttt11ttf1,...............:;;;::,.......,,,.......;tttttfftttfffftfttttttttffttf\ntfffttttfffffft11ttttttt1111t1,...............:;;;::........,;i;:,....;t1ttfttt1tfffffffttfffffffttf\ntfffttttftffft111ttttttt11t111,...............,::::,........:iiiii:...;t11tt1111tffffLffttfffffffttf\ntffft1tttfffft111ttttttt11ttt1,..... ..........::::,.......,;iiii;,...it11111tt1tfffLfLfttfffftffttf\ntttttttttttttt111ttttttt11tt1:... .,..........,:::.........:;;i;,...,1t1t11tft11tfffffftttffttffttt\nttttt1tttttttt111ttttttt1tt1:,...:;ii:.........,::,.........,:;;:.....,it1111tt11ttttttt11tttttffttt\nttttt1tttttttt11ttttttttt1t;::,;iiii;,.........,:,,...........,,,......,;11111111ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfft1ti:,,;;;:;;,.........,:,,.......... ..........:tttt1111ttttttt111tttttfttt\n11ttt1tttttttt11ttttttttttt1,.,::::;;:.........,:,,...............,....;ttttt1111ttttttt111ttttttt1t\n11tt11tttt1tt111111111111ttti:,,,::;:..........,:,,............ ......;ttttt11111111111111111111t111\n1111111111111111111111tttttttt1:,,,............,:,.............,. .,;11tttttt1111111111111111111111\n1111111111111111111111tttttttttt1:.............,,............ .11ii1ttttttt1111111111111111111111111\n111111111111111111111111tttttt111,.............,::,,...........ittttttttttttt11111111111111111111111\n11111111111111111111111111111111;..............,;;;:,..........:11tttttttttttttt11111111111111t11111\n11111111111111111111111111111111;..............,;;;:,...........:11tttttttttttttttt1111111ttttt11111\n11111111111111111111111111111111:..............,;;;;:...........:1ttttttttttttttttttttttt1ttttt11111\n11111111111111111111111111111111:..............,;i;::,..........,1tttttttttttttttttttttttttttttt1111\n","ttftffftttttttfffffttfffttftttttttttt111tttt1111111ttttt11111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffffttttt111111111111111ttffttftttttttt11111tttt\ntfttttttttttttttffffLffttfffffffLLLft11tttttt111tfffffffttttttttt11111ttttfffffftfLLfttttttt1111ttt1\nttttttttttttttttfffLfttffffffLLffffttt1ttttttt1ttfffffffffttttttt1111ttfftffffLftttfffffttt11111tttt\nttttttttttttffffttfffttffffffffftttfttttt111ttt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttfLLLfftttttffLftttttttt11ii11fffft1ttfftt11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttt1i:;:,,::;i1tttffffftt11111tft11111ttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttffLffftffttttfti:,,,,,,,,,:;tfffffttttt111tftttttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftffttttttti:::::;;;;;,,1ffttffttt11111111ttttttttttt1ttffffffffffttt\ntttfftfffLLLLLLLLLfftfftffftffffLLLfttttti;iiiii11111;:1ttfffffftt1111ttt1ttt1tftttt11tfffffLLfLfttt\nttfLLffffLLLLLLLLfftfLLftttfffffLLLLttttt;;i;;iiiiii1;:i11tfffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1ii;;;ii;;iii;tt11ttt111t1111tffttfftt11tfftttffLLLLLLLLffL\ntttffttfftffLftttttttttttttfLLLffLLftttt11ti;;;iiii1iii1ttt1ttt1111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttftttfLfffLfttttt11i;;;iii1iii1tttt1tfftt11111tfttffftt11tttttttttfLLffftttt\nttffffffffftttfffffffffttfftttfftffttttfft11;;;iiiii11tt111ttttttt1111tt1tffttffttfffffLLfttftfLffff\nttffffffffttttffffffffttttttttttfffttt1tft11i;iii11i11111tfft11ttt11111tt11tttfft1tffffLLLfttfLLLLLL\nttfffffffffttfffffffftt1ttt111tfffftttt11111i;i;iiii111ttfffft11111111tttt11tttt11tffffLLfftttfLLLLf\nttttttttfffttfffttttt1ttfftt111tfffttt111111;;i;;iii11i1ttffft11111111tttt111tttt11ttfffffLftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tffttt1t1ii1;;i;;iiii1;,::i11tt1tt1111ttt11tt1tfftt11111ttfftfLffftt\ntfttfffffttttttfffft1tffffttfft11tft11i::,,1ii;:;ii;it:,,...,,:;i11111tt111tt1ttfffftttttt11tttttfft\nttttfffffftttffftfft11tfffttfttttt1i:,....,it1i;;;;i1t;,,,,.......,;111t111ttt1tfffttttffftt11tffLLf\n1tttffffftt1ttfffft111ttfttft11i;:,........i1tt1ii1tt1:,,...........:1111111tt1tfftt1tfffffft1ffffLf\ntftttffttttt11tttt1ttt11t1111t;,...........,;;;11;;;;:..............,1t111111t1tftttttttfftt11tfffLf\ntfftttttttfftt1111ttttt11111tt:..............:;ii;;:,................it111tt11111tffftttttt1tttttfft\nttttttttttttttt11ttttttt11ttf1,..............,;;;;::,................it1tttttt1ttfffffftttttfffttttt\ntfffttttffttttt11ttttttt11ttfi................;;;:::,,:;:,...........;tttttttftttffffffttttttttffttf\ntfffttttfffffft11ttttttt1111ti................:;:::,.:;iii;,.........:111ttfftt1tfffffffttfffffffttf\ntfffttttftffff111ttttttt11t11;................,;:::,.;iiiii:.........:tt11ttt111tfffLfLfttfffffffttf\ntffft1tttfffft111ttttttt1tttt;................,::::,.:;;ii;,.........;ttt1111tt1tfffLLLfttfffftffttf\ntttttttttttttt111tttt1tt11ttti.................:::,...,;;i;,.........itttt11ttt11ffffffftttfftfffttt\ntttttttttttttt111ttttttt11tt1;.................:::,....,:;:,.........,1tt1111tt11ttttttt11tttttffttt\nttttt1tttttttt11ttttttttt1t11:.................:::,.... ..............:1111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfft11ti;,................,::,.........,......... :ttttt1111ttttttt111tttttfttt\n11tt11tttttttt11tttttttt1tt1iiii:..............::,,...................:1tttt111111tttttt111ttttttt1t\n11t1111tttttt1111111111t111iiiiii:.............,:,,,.................:1ttttt11111111111111111111t111\n11111111111111111111111t11i;;iiii;.............,:,,,........... .,;ttttttttt1111111111111111111111\n1111111111111111111111tt1t1i;;ii;,.............,,........... :i;;i1tttttttt1111111111111111111111111\n1111111111111111111111111ttti:,,...............,,,.......... :ttttttttttttttt1t111111111111111111111\n11111111111111111111111111111;::...............:;;::,........,i11ttttttttttttttt1111111111111tt11111\n111111111111111111111111111111t;...............:ii;;:,........;t1tttttttttttttttt1t1111111ttttt11111\n1111111111111111111111111111111:...............:;i;:::........:tttttttttttttttttttt1ttttt1ttttt11111\n1111111111111111111111111111111:............. ,;ii;;;:,..,,...:ttttttttttttttttttttttttttttttttt1111\n","ttfttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\nttfttttttttttttttttffLLttffffffftttttt1t111111111tfffffftttt1111111111111111ttffttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111ttttt\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLftttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttffttttt1111tt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffttttffffftttffftt11t111tt111ttfffLLftttftt1tt111tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttt11i;;;;i1tftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttffLLfftffttttti:::,,,,::;i1tffffffffttt111tft1tttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffLfftfftttt11;,,,,,,,:,,,;tffffffffttt1111t11ttttttttttt1ttffffffLfffttt\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttt1i;;;;iiiii:,:1tttfffffftt1111ttt1ttt1tfttt111tfffffLLfLfttt\nttfLfffffLLLLLLLLfftfLLftttfLfffLLLLttt1i1iiiii1111i::1111ttffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt11;;;iiiiiii:;ttt111tt111tt111tffttfftt11tfftttffLLLLLLLLffL\ntttffttffttfLftttttttttttttfLLLffLLftttt1i;;;iii;iii;ittfft11tt1111111tfftfffftttttttttttfLLLLffffff\nttffffffffftttfffffffffttfttfLLfffLfttt111;;;i111111iitfttt1tfftt11111tfttfffttt1tttttttttfLLftfttft\nttffffffffftttfffffffffttffttffftfftttttt1i;;iiiii1i1tft11tttttttt1111tt1tffttffttfffffLLfttftffffff\nttffffffffftttffffffffttttttttttfffttt1ttti;;;i111iitt111tfft11ttt111111t1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111tfffftttt111ii;iii;ii11111tfffft11111111tfft11tttt11tffffLLfftttfLLLLL\nttttttttfffttfffttttt1ttfft1111tffftttt1111;;;i;;;i111ttttffftt1111111tttt111tttt11ttfffffLftfLLLLLf\ntfttttttttttttttttt1ttfffftttt11tfft111tt1i;;;i;;i1i1;i11tffftt11t1111ttt11tt1tfftt11111ttfftfLffftt\ntfttffffftt11ttfffftttffffttfft11tft11ii;ii;;;;:;iii1,.,,,:;iii1ttt111tt111tt1ttfffftttttt11ttttfftt\nttttfffffftttffftfft11tfffttftttttt1;:,..:11;;i;;;;11:,,,.....,,:i1111tt111ttt1tffftttttfftt1ttffLLf\ntt1tffffftt1ttfffft1111tfttft1111i:,.....,i11iiiii1tt:.,..........:111111t11tt1tffft1tfffffft1fLffLf\ntftttffttttt11tttt1ttt11t11111;:,.........;i11i1111t;..............;t11111111t1tfttttttfffftt1tfffLf\ntfftttttttfftt1111ttfft111111:.............,::;ii;;:...............:111111ttt111ttffftttfft1tttttfft\nttttttttttttttt11ttttttt11tt1,..............::;;;;;,...............,1111tttttt11tffLffftttttfftttttt\ntfffftttffttttt11ttttttt11tfi,..............,::;;::,,...............i111ttttfftttffffffttttttttffttf\ntfffttttfffffft11ttttttt111ti................::::::,:;;::,..........it111ttffttttfffLfLfttfffffffttf\ntfffttttftffff111ttttttt1tt1;................,;::::.:iiiii,.........;11111ttt11ttfffLfLfttfffffffttf\ntffft1tttfffft111ttttttt11tti,................::::,.:ii;ii:.........;tttt1111ttttfffLLLfttfffftffttf\ntttttttttttttt111ttttttt1ttf1.................,:::,.,:;iii:.. ......:ttttt11tft11tfffffftttfftfffttt\ntttttttttttttt111ttttttt1ttt;::...............,:::,. .:;ii:..........;ttt1111tt11tttttft11tttttffttt\nttttt1tttttttt11ttttttttt1t111i;,..............:::,....,::,...........;1111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttttfftt1iiiiii:.............:::,.... ............. :ttttt1111ttttttt111ttttffttt\nt1ttt1tttttttt111ttttttttt1i;iiii;,............,:,,,................. ,1tttt111111tttttt111ttttttt1t\n11t1111tt1ttt11111111111111i;iii1i,............,::,,.................:1tttt11111111111111111111tt111\n11111111111111111111111111t1;;;;;,.............,:,,,.......... .:1tttttt111111111111111111111111\n1111111111111111111111111t11;,.................,:,,..........,;:::;1ttttttt1111111111111111111111111\n11111111111111111111111111111:..,..............,,............:ttttttttttttttttt111111111111111111111\n111111111111111111111111111111ii;..............,::,...........i111ttttttttttt11111t11111111111111111\n111111111111111111111111111111t;...............,;ii;::,.......:1ttttttttttttt11t1tt1111111ttttt11111\n111111111111111111111111111111i,...............:;ii;;;:,......,1ttttttttttttttttttt111111tttttt11111\n11111111111111111111111111111ti,...............:;ii;;;;:,..:..,1ttttttttttttttttttttttttttttttt11111\n","ttfttfffttttttffffttfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLttffffffffftttttt111111111tfffffftttt1111111111111111ttftttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLftttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttffftttt1111tt1ttffffffttttt1111t111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffftttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttfttttttttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttffLffftffttttt1ii::::;111tttffffffffttt111tft1tttt1ttffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLfftffttttt1:,,,,,,,,:;ittffffffffttt1111t11ttttttttttt1ttffffffffffttt\ntttffttffLLLLLLLLLftffftfLftffffLLLftttti::,::::::,,,;ttttfffffftt1111tft1ttt1tffttt11tfffffLLfLfttt\nttfLffffffLLLLLLLfftfLLftttfLfffLLLfftt11iiiii111i;,,;t111tfffft111111ffft1tt11ttttt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiii1111i:,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\nttttftttttffLftttttttttttttfLLLffLLftttti;;;ii;iiii::1ttttt11tt1111111tfftfffftttttttttttfLLLLffffff\nttfLfffffffttffffffffffttfttfLLfffLfttt1i;;i1i;iiii:;tftttt1tfftt11111tfttfffttt1tttttttttfLLftftttt\nttffffffffftttffffffffftfffttffftffttttti;;iii111i1iitft11tttttttt1111tt11ffttffttfffffLLfttftfffffL\nttffffffffftttffffffffttttttttttfffttttti;;;ii1111ii1t111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111tfffftttt1i;;;iiiiii11111ttfffft11111111tfftt1tttt11tfffffLfftttfLLLLf\nttttttttfffttfffttttt1ttfft1111ttffttt111i;;ii;;;itt11ttttfffft1111111tttt111tttt11tttfffffftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tfft1t1t1i;;;ii;;it111ttttffftt11t1111ttt111t1tfftt11111ttfftfLffftt\ntfttffffftt11ttfffftttffffttfft1ttft11ii1;;;;i;:;i1;;i11tttft111tt1111tt111tt1tffffftttttt11ttttfftt\nttttfffffftttffftfft11tfffttftttt1i;:,,:1i;;;;i;;;1;.,,,;;i11111111111tt111ttt1tffftttttfftt1ttffLLf\n1tttffffftt1ttfffft111tffttft1ii:,.....,11iiiiiii1t:,,,.....,:;i111111111t11tt1tffft1tfffffft1fLffLf\ntftttffttttt11tttt1ttt11t11i;:,........,i1tt1ii11tt:,,,,........:t11111111111t1tfftttttfffftt1tfffLf\ntfftttttttfftt1111ttfftt11i,............::;;iiiii1;,,............it1111111ttt111ttffftttfft1tttttfft\nttttttttttttttt11ttttttt11;...............:;;;;:;;...............:111111tttttttttffLffftttttfftttttt\ntfffftttffttttt11ttttttt11:...............,;;;;;;:,..............,111111ttttfftttffffffttttttttffttf\ntfffttttfffffft11ttttttt11,...............,:;;;;:,...............,1111111ttffttttfffLfLfttfffffffttf\ntfffttttftffff111ttttttt11:...... ........:;;;;:,...............,11111111ttt1tttfffLfLfttfffffffttf\ntffft1tttfffft111ttttttt11:.......:;;;:....,;;::::.......,::,....,1tt11tt1111tt1tfffLLLfttfffftffttf\ntttttttttttttt111ttttttt11:.....:;;;;;:.....:;:::,.......,:iii;,.,1t1t11tt11tft1tffffffftttfftfffttt\ntttttttttttttt111ttttttt1i,.....:;:;;;:.....,::::,........;;iii;..;t1111t1111tt11tttttftt1tttttffttt\nttttt1tttttttt11tttttttt1i,.....:::;;;,......::::,.......,;;ii;:..,;1t11111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttttttti....,,,,:;;,.......,:::,,.......,;;;;,....,it11tttt1111ttttttt111ttttffttt\n11tt11tttttttt111ttttttt1:,,.,,,..,,,.........::::,........,:;,..... ,1tttttt11111ttttt1111ttttttt1t\n1111111tttttt11111111111i,,..,,,.... .........::::,..................itttt111111111111111111111tt111\n1111111111111111111111111,...,,...............,::,,,...........,,...;tttttt1111111111111111111111111\n11111111111111111111111111,..... .............,::,,,......... . .:1tttttt1111111111111111111111111\n1111111111111111111111111ti,,,.,,..............::,,..........,,,::i1tttttttttt1111111111111111111111\n11111111111111111111111111111i11;..............:,............,1tttttttttttttt11111111111111111111111\n1111111111111111111111111111111i...............:;:::::,.......;tttttttttttttt11t1ttt111111ttttt11111\n1111111111111111111111111111111:...............:iiii;;::,......ittttttttttttttttttttt1111tttttt11111\n1111111111111111111111111111111,...............:iiiii;;:,......,1tttttttttttttttttttttttttttttt11111\n","tttttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLftfffffffffttt1tt111111111tfffffftttt1111111111111111ttftttftttttttt11111tttt\nttttttttttttttttfffffftttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1tffffftttffftt11t111tt111ttfffLLffttfft1tt111tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLftffttttfLLffftfftttttftttttttffttttffffffffftt111tftttttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftffttttttiii;::::i1ttttffffffffftt1111t11ttttttttttttttffffffffffttt\ntttffttffLLLLLLLLLftffftfLfttfffLLLfttt11:,,,,,,,:::itttttfffffft11111tft1ttt1tffttt11tfffffLLfLfttt\ntffLffffffLLLLLLLfftfLLftttfLfffLLLLfttt1i::::,,::,,,itt11tfffft111111ffft1tt11tt1tt1ttffLLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttttiiiiii1i;:,,:ttt111ttt11tt111tffttfftt1ttfftttffLLLLLLLLffL\nttttftttttffLftttttttttttttfLLLffLLftttti;iiii111i;:,iftftt11ttt11111tffftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttfttfLLfffLfttt1;;;ii;iiii;::1ffttt1tffft11111ffttfffttt11ttttttttfLfftftttt\nttffffffffftttffffffffftfffttffftfftttt1;;i1i;;iii;:itft11tttttfttt111tt1tffttffttfffffLLftfftfffffL\nttffffffffftttffffffffttttttttttffftttt1;;iiii111iii1t111tfft1tttt111111t1ttttfftttfffffLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111ttffftttti;;iiiiiiiii1111ttfffft11111111tffttttttt11tfffffLfftttfLLLLL\nttttttttfffttfffttttt1ttfft1111ttfftttt1;;;iiii;;itt11tffffffft1111111tttt111tftt11tttfffffftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tfftttt1i;;;;ii;;it1111tftfffft11t1111ttt111t1tfftt11111ttfftfLffftt\ntfttfffffttt1ttfffftttffftttfft11tft111i;;;;;ii;;i111111tttft111tt1111ttt11tt1tffffftttttt11ttttffft\nttttfffffftttffftfft11tfffttfttt11i;;:ii;;;;iiiii1;11tt111t11111tt1111tt111tft1tffffttfffftt11tffLLf\n1tttffffft11ttfffft1111tfttftii;:,....;1i;;;;ii111,,:;i1tt11tt11111111111t11tt1tffft1tfffffft1fLffLf\ntftttffttttt11ttt11ttt1111i;:,.......,i1tiiii;;11i,,,..,:;i1t1t111t1111111111t1tfftttttfffftt1tfffLf\ntfftttttttffttt111ttttt1i:...........,ii111iii11i:.,,......,:;1t111111111tttt111ttfLftttfftttttttfft\nttttttttttttttt11tttt11t;..............,::;;i1ti:,............,1t1111111tttffttttffLfffttttffffttttt\ntfffttttfftfttt11tttttt1,...............:;:;;;;;:..............;tt111111tttffftttffffffftttttttffttf\ntfffttttfffffft11tttttt1................,;;;;;;;:..............:t11111111ttffttttffLLfLfttfffffffttf\ntfffttttfttftt111tttttti............... .:;;;;;:,..............:1111111111tttttttffLLfLfttfffffffttf\ntffft1ttttttft111tttttt;............. .:;;;;;;:::..............:111tt11tt111ttt1tfffLLLfttfffftffttf\ntttttttttttttt111ttttt1,..............:;i;;i;::::..............:1ttt1111tt11tff1tffffffftttfftfffttt\nttttttttttt1tt111ttttt;..............:;;;;;i:::::..............;1111111111111tt11tttttftt1tttttffttt\nttttt1tttttttt11tttttt:..............:;;;::;:::::..............;t1111111111111t11ttttttt11tttttffttt\n1tttt1tttttttt11ttttt1,........... .,,:,...,:::::..............,11i;;i111tttt1111ttttttt111ttttffttt\n11tt11ttttttt1111tttt;............,..... ...,::::...............:i;:;;i1ttttt11111tttttt111ttttttt1t\n11111111t1tt111111111,............,.........,::::,..............,:::;ii1tt111111111111111111111tt111\n111111111111111111111,............ .........,,,::,..............::::;i11tt11111111111111111111111111\n1111111111111111111111:....... .............,,:,,..............,::::i111t11111111111111111111111111\n11111111111111111111111:....,,,,.............,:::,,..................,1t1111111111111111111111111111\n111111111111111111111111iiii11t; .............,:,..,........ ..:1tttttt11111111111111111111111\n111111111111111111111111111111t:...............:,,,:,,......,,,,,:;;1tttttttt1t111tt1111111tttt11111\n111111111111111111111111111111t: .............::;ii;::,.....,i111ttttttttttttttt11ttt111111tttt11111\n111111111111111111111111111111t:..............:;;iiii;:,.....,i1ttttttttttttttttttttttttttttttt11111\n","tttttfttttttttffffffffffffftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLftfffffffffttt1tt111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\nttttttttttttttttffffLftttfffffffLLLfttttttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffffttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLffftfftttttfftffffffftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftfftttttt1iii::;i1ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\nttttfttfLLLLLLLLLLfftfftfLfttfffLLLfttt11:,::,,,,,:;1tttttfffffftt1111tft1ttt1tffttt11tfffffLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLLffLLLffttt1;:,,,,,,,,,;ttt11tfffft111111ffft1tt11ttttt1ttffLLLLLLLLfff\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiiiiii;:,,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\nttttftttttffLftttttttttttttfLLLffLLfttt1i;iii1111i:,:1ftfft11ttt111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttfLfffLfttt1;;;i;iii1i:,;tffttt1tffft11111tfttfffttt11ttttttttfLLftfttft\nttffffffffftttffffffffftffftttfffffttt11;;;ii;;iii::1fft11tttttfttt111tt1tffttffttfffffLLffffffffffL\nttffffffffftttffffffffttttttttttfffttt1i;;iiiii11i;itt111tfft1tttt111111t1ttttfftttffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111ttfffttt1i;;iiiiiiiii1111ttfffft11t11111tffttttttt11ttffffLfftttfLLLLL\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;;1t11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\ntfttttttttttttttttt11tfffftttt11tfftt111;;iiiii;;;1111ttftfffft11t1111tttt1tt1tffttt1111ttfftfLffftt\ntfttfffffttt1ttftfftttffftttfft11tft1i1i;;;;iii;;;111111tttft111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffftttt11tfftttfttt11i;;;1;;;;;iiii;i1t11t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\n1t1tffffft11ttffttt1111tftttti;:,,...:1i;;;;iiii1i:;i1ttt111tt11111111111t11tt1tffft1tffffffttfLffLf\ntftttfftt11t11ttt11ttt111i;:,,.......:11ii;;ii;11i,.,,:;11tt11tt11t1111111111t1tffttttffffftt1tfffLf\ntffttttttttftt1111ttttt1:............:1111iiii1ti;,,....,,;i1tttt11111111tttt111ttfLffttfftttttttfft\nttttttttttttttt111ttt1t;...............,:;;i1tt1;,..........,itttt111111tttttttttffLfffttttffffttttf\ntfffttttfftfttt11ttttt1,................:::::;i;:,...........,1ttt111111ttttfftttffffffftttttttffttf\ntffft1ttffffff111ttttti.................,;;;;;;;:,...........,1t111111111ttffttttffLLfLfttfffffffttf\ntffft1ttfttttt111ttttti................,,;;;;;;::,............it1111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttt;.............:;iii;;:;;:::,............it1111111tt111tttttfffLLLfttfffftffttf\nttttt1tttttttt111tttti,............,;;iiii::;::::,...........,1ttttt111ttt11tft1tfffffLftttfftfffttt\nttttt1tttt11tt111ttt1:.............:;;;iii;::::::............,1tttt1111111111tt1tttfttftt1tttttffttt\nttttt1tttttttt11tttti..............,;;;;:,,:::,,:............:tt11t11111111111t11ttttttt11tttttffttt\n1tttt1tttttttt11tttt:............. ,::,. .::,,,:........... :t1111111t111ttt1111ttttttt111ttttffttt\n11tt11tttttt111111ti.......................,:::::.............it111t11111tttt1111tttttt1111ttttttt1t\n1111111111111111111,.............,.........,:::::.............:1t11ii;:;11111111111111111111111tt111\n1111111111111111111:........................,,:::..............;ii;:;:;ii111111111111111111111111111\n11111111111111111111:....... ..............,,,:,...............,:::::;i1111111111111111111111111111\n111111111111111111111:......,,..............,,,:,...............:::;::;i11t1111111111111111111111111\n1111111111111111111111iiiiii1;...............,,,,.,..............,::::;11111111111111111111111111111\n11111111111111111111111111111;................,,:,,,...... .it1111111111111111111111111111\n1111111111111111111111111111t;...............;i;;;::,.....,,.....,,,;i1ttttttttt11tt111111ttttt11111\n1111111111111111111111111111t;...............:i;;i;::,....:i111111tttttttttttttttttttttttttttttt1111\n","tttttfttttttttffffftfffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\nttfttttttttttttttttffLLftfffffffftttt1t1111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\nttttttttttttttttffffLftttfffffffLLfftt1tttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\nttttttttttttffffttfffttffffffffftttftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttfffttttt1tfffft1ttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLftttttttfffffftttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLffftffttttt111i;iitfftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftfftttt1;:,::,,,:;ittttffffffffftt1111t11ttttttttttttttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttfffLLLftt1i:,,,,,,,,,,:1tttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLLffLLLftt1i;;;;;;;i;:,:tftt11tfffft11111tffft1tt11ttttt1ttfffLLLLLLLfff\ntfffffttttfLLLffttttfffffttLLLLfLLLft1;iiiii11111i::tffft11tttt11t111tfffttfftt1ttfftttffLLLLLLLLffL\ntttfftttttffLftttttttttttttfLLLffLLftt11;;;iiiiiii:;tffffft11tt1111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttLLfffLft11i;;;;i;;iii;tffffttt1tffft11111tfttfffttt1tttttttttfLLftffttt\nttffffffffftttffffffffftffffttfftfttt11i;;;i1iii1iitffft11tttttfft1111tt1tffttffttfffffLLfffftfLffLL\nttffffffffftttffffffffttttttttttffftt11i;;;iii111ii1tt111tfft1ttft111111t1ttttfftttffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt111ttffftttti;;;;iiiiii11111ttfffft11t11111tfftttttttt1tfffffLLftttfLLLLf\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;itt11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\ntftttttttttttt1tttt11tfffft1tt11tfft111;;;;;iii;;it111ttfffffft11t1111tttt1tt1tffftt1111ttfftfLffftt\ntfttffffftt11ttftfftttffftttfft11tti;;1;;;:;iii::i111111ttfft111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffftttt11tfftttft1i;:,..,1i;;;;iii;i;:;;1t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\n1tttffffft11ttffftt1111tt1ii:,,......,i1i;;;ii;11;...,:;i111tt11111111111t11tf1tfffttfffffffttfLffLf\ntfttttftt11t11ttt11ttt11;,,..........,11t1iiii1t1:,,.....,:i111111t1111111111t1tffttttffffttt1tfffLf\ntffttttttttfttt111ttttti,.............:;;iii11t1i,,.........,ittt11111111tttt11tttfLffttffttttttffft\nttttttttttttttt111tttt1:................:;;;;;i;:,...........:ttt1111111tttffttttffLLffttttffftttttf\ntfffttttftttttt11ttttti.................,;;;ii;;:............,1ttt11111ttttffftttffffffttttttttffttf\ntffft1ttfffftf111ttttti..................:;;;i;;:,...........,1tt11111111ttffttttffLLfLfttfffffffttf\ntffft1ttfttttt111ttttt;..................,;;;;;::,...........,1t1111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttt;...........,,.....,;;:;:::............,111111111tt111tttttfffLLLfttfffftffttf\nttttt1tttttttt111tttti,........,;ii:......:;:::::............,ittttt111ttt11tft1tfffffLftttfftfffttt\nttttt1tttt111t111tttt;........:;;;;:,.....,;:::::.............ittttt1111t1111tt1ttfttttttttttttffttt\nttttt1tttttttt11tttt1,.......,:::;;;,......::::::.............;tt1t1111111ttt1tttfttttttt1tttttffttt\n1tttt1tttttttt11tttti.........,:::;:.......,:::::..........,,:;1t11111111ttff1111ttttttt111ttttffttt\n111111tttttt111111t1,..........,:::........,:::::..........,:;;i1111t111ttttt11111ttttt1111ttttttt1t\n1111111111111111111;............,,.........,::::,.........,:;;;i1111111111111111111111111111111tt111\n11111111111111111111:.......................,:::,.. ......,:;;ii111111111111111111111111111111111111\n111111111111111111111:.......,..............,:::,..........,::i11t1111111111111111111111111111111111\n1111111111111111111111:,,..,, ..............,,,::,............,1111111111111111111111111111111111111\n1111111111111111111111111i11:...............,..,:,,..... ..:1t11111111111111111111111111111111111\n111111111111111111111111111;................,::::,,.....::::;i11tttt111111t1111111111111111111111111\n111111111111111111111111111,.................ii;;::,....:1tttt1ttttttttttttttttt11tt111111ttttt11111\n1111111111111111111111111ti..................;i;;;:,.....;t1ttttttttttttttttttttt1ttttttttttttt11111\n","ttffftfffttttttttftttfffttftttttttttt111tttt111111tttttttt111tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLLftfffffffftttt1t111t111t11tfffffftttt111111111111111tttftttfttttttttt1111tttt\nttttttttttttttttffffLftttfffffffLLffttttttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111tttt1\nttttttttttttttftfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttffffttfffttffffffffftttfttttt1111tt1ttffffffttttt1111tt11111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttffftttt11tttffttttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLftt11ii;i;;ii1tttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfLLffftfftt1:,,,,,,,,:iftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftff1i;;:,,,,,,,,:;ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttfffLLLt;,,:;;;;;iiii:ittttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLLffLLLfi,:iiii111111;1ffftt11tfffft11111tffftt1t1tttttt1ttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttLLLLfffffi:;;;;;iiiiiiitffffft11tttt11t111tfffttffft1ttfftttffLLLLLLLLffL\ntttfftttttfffftttttttttttttfLLLffLLti;;;;;i;;iiii1ftffffftt11tt1111111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttfLfffLtii;;;ii;;i1111tfffffttt1tffft11111tfttffftttttttttttttfLLfffffft\nttffffffffftttffffffffftffffttfftftt1ii;;;;;;iii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\nttffffffffftttffffffffttttttttttffftt11i;;;;;i111111tt111tfft1ttft11111tt1ttttfftttffffLLLfttfLLLLLL\ntttffffffffttfffffffftt1ttt1111tfffttti;;;;;;iiiii11111ttfffft11t11111tfftttttttt1ttfffLLLftttfLLLLf\nttttttttfffttfffttttt1ttfft11111tfft11i;;;:;;ii;;itt11ttfffffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntftttttttttttt1tttt11ttffft1tt11ttti::i;;;:;iii;;;i;i1ttftfffft1tt1111tttt1tt1tffftt1111tffftfLffftt\ntfttffffftt11ttftfft1tffftttff1i;:,...;1;;;;;i;:;i,..,:;i1tft111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffftttt11tfft11i;:,......,11;iii;;iii,,,....,:;i1111t1111tt111tft1fffffttfffftt11tffLLf\n1tttffffft11ttffftt1111t1;;,..........,i1t11ii11i:.,........,111111111111t11tt1tfffttfffffffttfLffLf\ntfttttftt11t11ttt11ttt11:..............;iiiiiii11,,,......,,,itt11t1111111111t1tffttttffffftt1tfffLf\ntffttttttttfttt111ttttt;................,;;;i;;ii,...........;ttt11111111ttt111tttfLffttfft1ttttffft\nttttttttttttttt111ttt11:.................:;;;i;::............;ttt1111111tttftttttffLLffttttffffttttf\ntfffttttftttttt11ttttt1,.................,;;;;;;:............:ttttt11111tttffftttffffffftttttttffttf\ntffft1ttfffftf111ttttt1,..................:;;;:::............:1tt11111111ttffttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttti...................,;;::::............,111111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttttt:...................,::::::,:::,.......,1t1t11111tt111tttttfffLLLfttfffftffttf\nttttt1tttttttt111tttt1,....................,::::::;;;ii:......ittt11111ttt1ttff1tfffffLftttfftfffttt\nttttt1ttttt11t111tttti.....................,:::::,;;;ii;,.....itttt1111tt111tttttttttttttttttttffttt\nttttt1tttttttt11ttttt;........ .............:::::,;;;ii;,.....:1t1t1111111tttttttfttttttt1tttttffttt\n1tttt1tttttttt11ttttt:.... :i;:.............:::::..,;;i:.......it11111111ttff1111tfttttt11tttttffttt\n11tt11tttttt1111111t1,...,;iiii;, ..........::::,. .,:,......;111111111ttttt1111ttttttt111ttttttt1t\n11111111111111111111i..,.,;;;iii;...........:::::.......,....itt1111111111111111111111111111111tt111\n11t111111111111111111;....::;;ii;...........::::,..........,;111111111111111111111111111111111111111\n1111111111111111111111, ...,:;;;,............,,:,.....,,:;11tt11111111111111111111111111111111111111\n1111111111111111111111i:,....... ............,,:,.....:1tttttt11111111111111111111111111111111111111\n1111111111111111111111111;.,. ..............;;;:,,....,it11ttt11111111111t11111111111111111111111111\n111111111111111111111111i,..................;ii;:,.....,1t1ttttt1111111111t1111111111111111111111111\n111111111111111111111111:...................;ii;;:......;ttttttttttt11tttt1t111111tt11111111ttt11111\n111111111111111111111111:...................:i;:;;,.....:t1tttttttttttttttttttttt1tttttttttttttt1111\n","ttffftfffttttttttttttfffttftt111ttttt111tttt111111ttttttttt11tttt111111ttttttttttttttttttttt111111tt\nttfftttttttttttttttffLLftfffffffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\nttttttttttttttttffffLftttfffffffLLfft111ttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\nttttttttttttfffftttffttffffffffftttftt1t1iii11111tfffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttffft11i:,,,::::;1tfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffftfft1;:,,,,,,,,,:tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffLfftt1::,,,,,:::::;itfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\ntttttttfLLLLLLLLLLfttttffftffffttf1,,,,:;iii1111itftttfffffffffftt1111t11ttffttttttttttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttffffft:,,,:;iii111ii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfLLftttfLfffLft:,,:;;;;iiiiii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttfLLfffft;:::;;;iii;iii1tffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\ntttfftttttfffftttttttttttttfLLLffffti;;;i;;iii;iitfffffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\nttfLffffffftttfffffffffttffttfLftfft1i;;;;;iiiii11ffffftttt1tffft11111tfttffftttttttttttttfLLffffftt\nttffffffffftttfffffffftttfftttftttttt1;;;;;iiiii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\nttffffffffftttffffffffttttttttttfftt11i;;;;;;ii1111ttt111tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\ntttffffffffttfffffffft11ttt1111ttff1;i;;;;;;;ii;iiii111ttfffft11t11111tfftttttttt1tffffLLLftttfLLLLf\nttttttttfffttffftt1tt1tttft1111tt1;,.:i;;;;;iii::;;,,:;i1tfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntfttttttttttttttttt11ttffft1tti;:,...,ii;;;;ii;::;;.....,:itftt1tt1111tttt1tt1tffftt1111tffftfLffftt\ntfttffffftt11ttftfft1tttft1i;:,.......:11iiii;;;:;:,,,,,,..;t111tt1111ttt11tf1tffffftttttttttttttfft\n111tfffffftttffttttt11tti;:,..........,1tt1ii11i;;,,.,.,,,,,1111t11111tt111tft1tffffttfffftt11tffLLf\n1tttffffft11ttttttt1111;...............:11iiii;;1;.,.,,.,..,1t11111111111t11tf1tfffttfffffffttfLffLf\ntfttttftt11t11ttt111tt1,................,;;;ii;i1:.........,111t1111111111111t1tffttttffffftt1tfffLf\ntffttttttttftt11111ttt;..................:;;;;:;i:..........itttt11111111ttt111tttfLffttfft1tttttfft\ntttttttttttttt1111ttt1:..................,;;;;:::,..,.......;tttt1111111tttffttttffLLffttttffftttttf\ntfffttttftttttt11tttt;....................:;;::::,,.........:ttttt111111ttttfftttffffffftttttttffttf\ntffft1ttfftttt111tttt:....................,;:::,:;;;;:,.....:1ttt11111111ttffttttffLLfLfttfffffffttf\ntffft1ttfttttt111ttt1,.....................:::,,::;iii;,.....itt1111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt111ttt;......................,::,,::;;;i;,.....:111111111tt111tttttfffLLLfttfffftffttf\nttttt11ttttttt111tt1:......................,:,..:,:;;i;.......:tttt1111ttt1ttffttffffffftttfftfffttt\nttttt1ttttt111111tt1:......................,:,..:. .:;:......,itttt1111tt111ttttttfttffft1tftttffttt\nttttt1tttttttt111tt1:........... .........,,,.,:...........,1tt11tt111111ttt1ttttffftttt1tftttffttt\nttttt1tttttttt11ttti,......... .,..........,,,.,:..........,it11111111111ttft1111ttttttt11tttttffttt\n11tt11ttttt111111tt:..........,::;,........,,,.,:......,:i11t11111111111ttttt1111ttttttt111ttttttt1t\n11111111111111111111:........:;;ii;.........,,.,,.....i1ttt11t11t111111111111111111111111111111tt111\n1111111111111111111ti........,:;;i;,...........,,.....;t11111111111111111111111111111111111111111111\n11111111111111111111ti;,......,:;;;. ......,:,.,:.....,1t1t11111111111111111111111111111111111111111\n11111111111111111111111;........,,,........:;::,,......;t1tttt11111111111111111111111111111111111111\n1111111111111111111111i......... ........:;;::,......,1ttttt11111111111t11111111111111111111111111\n1111111111111111111111:........ ...........:;;;::.......it1ttttt1111111111t1111111111111111111111111\n111111111111111111111i,........,......... ,ii;;::,......:ttttttttttt11ttt1tt11t111tt111111t1tttt1111\n11111111111111111111t;.........,..........:iiii;::,.....,1ttttttttttttttt1ttt1ttt1tttttttttttttt1111\n","ttttftfffttttttttttttfffttttt111ttttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLLftffftfffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\nttttttttttttttttfffffftttfffffffLLLft111tttttt11tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\nttttttttttttttttfffffttfffffffffffft11111;:::;;i1tffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\nttttttttttttfffftttffttffffffffftttft1;::,,,,,,,,ifffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLfttttffLLLfftttttff1;:,,,,,,,,,,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLLfttfffttt1:,,,,:::;;i;;1tttftttffffffftt1111tftt111tttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffLfftt;,,,,,:;ii11t11tfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\ntttttttfLLLLLLLLLLfttttffffffffttt;,,,,:;;;iii1111ttttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\ntttffftfLLLLLLLLLLfttfftfffttttfft:,,,,:;;;iiiiii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\nttffffffffLLLLLLLfftfffftttfLftfLfi;;;;;;;iii1iii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\ntfffffttttfLLLffttttfffffttfLLftfffi;;;i;;;;iiiii1fffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\ntttfftttttffffttttttttttttttffftffft;;;;;;;;iiii1tttfffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\nttffffffffftttfffffffffttftttffftfft1;;;;;;;;iii1ttfffffttt1tffft11111tfttfLftttttttttttttfLLftffftt\nttffffffffftttfffffffftttfftttftttt1i;;;;;;;;ii111tffftt11tttttfftt111tt1tffttffttfffffLLffffffLffLL\nttffffffffttttfffffffft1tt1111ttt1::i;;;;;;;i1i;i111ttt11tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\ntttffffffffttffffffftt111tt111i;:,..;i;;i;iii11;;;;,::;1tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\nttttttttfffttffttttt111ttt1;:,......,ii;;iii;11;:;;,...,:1fffft1111111ttftt1ttfft11ttffffffftfLLLLLf\ntftttttttttttt11tt111tt1;:,..........;11iii;1t1;:;;,,,,,.:tfttt1tt1111tttt1tt1tffftt1111ttfftfLffftt\ntfttffffftt11tttttt111:..............:1tt1ii11i::;:,,,,,,,if1111tt1111ttt11tf1tfffffttttttttttttffft\n111tfffffft1tfftttt11;................:ii;;i;:,,;;,.,,.,..it1111111111tt111tft1tffffttfffftt1ttffLLf\n1tttffffft111tttttt1i,............,....:;;;;;;:,1i,..,,,..;ttt11111111111t11tt1tfffttfffffffttfLfLLL\ntfttttftt1t111ttt111;..................,;;;;;:,:1i,.......it111t11t1111111111t1tffttttffffftt1tffLLf\ntffttttttttft1111111,...................:;;;::,,;;,.......it1tttt11111111ttt111tttfLffttfft1tttttfft\ntttttttttttttt1111t;....................,;;:::,.:,..,.....:tttttt1111111tttffttttffLLffttttffffttttf\ntfffttttfttttt111t1,.....................;;:::..:,........,1tttttt111111ttttfftttffffffftttttttffttf\ntffft1ttfftttt111ti......................::::,..:,.....,:::i1ttt111111111ttffttttffLLfLfttfffffffttf\nttfft1tttttttt111t:......................,:::,..:,....,:;iiiitt11111111111tttttttffLLfLfttfffffffttf\ntffft1tttttttt1111;.......................,:,...:,....:;;iiii1111111111tt111tftttfffLLLfttfffftffttf\nttttt11ttttttt111t;...................,,,,,,,...,......,;;ii1111ttt1111ttt1tfffttffffffftttfftfffttt\nttttt11tt11111111i,.................,::::::,....:........,,:i1111tt1111tt111ttttttfffffft1tftttffttt\nttttt11ttttttt11t;.................,:;;;;;;,....:.... .. .,1t11ttt1111111ttt1ttttffffttt1tftttffttt\nttttt11ttttttt1111:................,::::;i:.....:.,..,,,:;i11tttt111111111tft1111ttttttt11tttttffttt\n111tt11ttt1111111t1:. ............::::;:.....,:....it11111tt1tt1111111ttttt1111ttttttt111ttttttt1t\n11111111111111111111i:,..............,,,,......,:....:1tt111111t1111111111111111111111111111111tt111\n11111111111111111111t11:........,.... . ..,....:.....it1t111t11111111111111111111111111111111111111\n11111111111111111111111:,..................:....:.....:1ttt11t11t11111111111111111111111111111111111\n1111111111111111111111i,...................:....:......it1ttttt1tt11111111111t1111111111111111111111\n1111111111111111111111;....................,,..,:,.....:tttttttt111111111111111111111111111111111111\n1111111111111111111111:.................. .::..,:......,1t1ttttt11t1t11111t1111111111111111111111111\n11111111111111111111ti,.................. ,;::,,:.......itttttttttttt111t1tt11t111tt111tttt1tttt1111\n11111111111111111111t;....................,;;;:,:.......:tttttttttttttttt1ttt1ttt1tttttttttttttt1111\n","tttttttttttttttttttttffftttt1111111tt1111tt1111111ttttttttt11tttt1111111ttttttttttttttttttt1111111tt\nttfttttttttttttttttffLfttffttfffttttt1111111111111tffffftttt111111111111111tttffttftttttttt11111tttt\nttttttttttttttttffffLftttfffffffffftt11111iii1i11ffffffffttttttt111111tttttffffftfLLfttttttt111ttttt\nttttttttttttttttffffftttffffffffffttt11;::,,,,,:;1ffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffttttt1;:,,,,,,,,,,:tffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLfttttttft;,,,,,,,,:::,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\nttttttttffLLLLLLLffttfLLLfttfffttt;,,,,,,:;ii1111tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffffft1:,,,,,:;iii11111fttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLLLLLLLLLffttttffftfffftt1:,,,,,:;;;iiiii1ftttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\ntttffttfLLLLLLLLLLfttfttffftttttft::;;::;;iiiiiii1ttttttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\nttffffffffLLLLLLffftfffttttffftfLfi:;i;;;;;iiiiii1tffftt11tfffft111111ffftt1tt1tt1tttttfffLLLLLLffff\ntffftfttttfLLLfftttttffffttfLLftfff;:;;;;;;;iiiii1tffffftt1tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\ntttttttttttfffttttttttttttttffffffft;;;;;;;;iiii1ttffffffft1ttt1111111tfftfffftttttttttttfLLLLffffff\nttffffffffftttfffffffffttft1tfffttt1i;;;;;;;;iii1ttfffftttt1tffft11111tfttffftttttttttttttfLLfffffft\nttffffffffftttfffffffftttffttttti::i;;;i;;;;ii1111tttttt11tttttfftt111tt1tffttffttfffffLLffffffLLfLL\nttffffffffttttfffffffft1ttt11i;:,.,ii;;iiiii11:i1111tt111tfft1ttft11111tt1ttttffttttfffLLLfttfLLLLLL\ntttffffffffttffffffftt111i;:,......:11;;iiiii1::;;;::;i1ttffft11t11111tfftttttttt1ttffffLfftttLLLLLf\nttttttttfffttfttt1111ii;:,.........,it1iii;;1ti::;;,..,:1tfffft1111111ttttt11tfft11ttffffffftfLLLLLf\ntfttttttttt1tt111111;,..............;1111ii1ti:;:;;,,,,.:tffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\ntfttfffftt1111ttttti,................:;;;i;;;,,:;;:,,,,,,itt1111tt1111ttt11tf1tffffftttttt1tttttffft\n111tfffffft1ttttttt:..........,,......:;;;;;;,.,i;,,,,,,.;t111111111111t111tft1tffffttfffftt1ttffLLf\n111ttfffft111ttttt1,............,.....,;;;;;:,.:1i,......;11t111111111111t11tt1tfffttfffffffttfLfLLL\ntttt1tftt11111tt11;....................:;;;;:,.:1i,......:tt11111111111111111t1tffttttffffftt1tffLLf\nttft11ttttttt1111i,....................,:;:;:.,,;:,......:111tttt11111111tttt11tttfLffttfft1tttttfft\ntttttt1ttttttt111;......................,;:;:..,:,.......:11tttttt111111tttffttttffLLffttttffffttttf\ntffft11ttttttt11i,.......................:::,..,:,.......,1tttttttt11111ttttfftttffffffftttftttffttf\ntffft11ttttttt11;........................,:::,..:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt11;......................,:;;;;;;,:,........,111tt1111111111tttttttffLLfLfttfffffffttf\ntfttt11ttttttt11i.....................:::;;;;;:.:,....... ,1t11111111111t111tftttfffLLLfttfffftffttf\ntttt111ttttttt11:....................,:::;;;;;.,:,..........,:;iii11111ttt11tffttffffffftttfftfffttt\nttttt11tt1111111,....................,:::;;;;,.,:.......... .::;;;;ii11111ttftttftfffft1tftttffttt\nttttt11ttttttt11i................. ....,,,,.....:.... ........,:::;;;;ii111tt1tttfffffttt1tftttffttt\nttttt11ttttttt11ti,. .........,... .. ....,..:,.. ....,:::;;;iii1ttt1111ttttttt11tttttffttt\n11111111ttt111111t1ii;;;,.......................:..,.:1;:,,.. ..,;i1i1t1ttt1111ttttttt111ttttttt1t\n1111111111111111111ttttt:,......................:.. ,tttt111i;;;;i1tt1111111111111111111111111tt111\n111111111111111111111111:,..................,...:.....it1t1ttttttttt11111111111111111111111111111111\n111111111111111111111111;,..................,...:.... ;tttt11t11t11111111111111111111111111111111111\n111111111111111111111111:...................,..,:.....:ttttttttttt1111111111111111111111111111111111\n11111111111111111111111i,...................:,.,:.....,1ttttttttt11111111111111111111111111111111111\n11111111111111111111111;...................,::..:.....,1ttttttttt1t11t1111t1111111111111111111111111\n11111111111111111111111:.................. :;:,,:......itttttttttttttt111ttt11t1111t111t1ttttttt1111\n111111111111111111111t1:.................. :;;:::......;ttttttttttttttttt1ttt1ttt11ttttttttttttt1111\n","tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\ntttttttttttttttttffffftttffffffffffft111tt111111ttffffffttttttttt11111tttttffffftfLLftttttt11111ttt1\nttttttttttttttttffffftttffffffLffftt111i;;:::::;1tffffffffttttttt11111tfffffffLfftfffffftttt111ttttt\nttttttttttttfffftttffttffffffffttttt1i;,,,,,,,,,,;fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLftttttttti:,,,,,,,,,,,,;tfffftttfffft11t111tt111tttffLLfttfftt1tt111tttttt\nttttttttffLLLLLLLffttfLLffttfffttti,,,,,,:;;;ii;itttttttffffffftt1111tftt1tttttfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffffft1:,,,,::;i111tt1tfttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLfLLLLLLLLfttttffftfffftti,,,,,,:;;iiii1i1ftttfffffffffft11111t11ttftttttttttttfffffLLfLfttt\ntttffttfLLLLLLLLLLfttfttffftttttf1,,::,:;iiiiiiii1ttttttttfffffftt1111tft1ttt1ttfttt11tffffLLLLLfttt\nttfffftfffLLLLLfffftfffttttffftfLf;:ii;;;;iii11ii1tfffft11tfffft111111ffft11t1ttt1tt1tffffLLLLLLLfff\ntffftfttttfLLLfttttttffffttfLLftff1:;ii;;;;iiiiii1ffffftt11tttt1ttt111fffttfffttttfft1tffLLLLLLLLffL\ntttttttttttfffttttttttttttttfffffff1;;;;;;;iiiii1tffffffftt1ttt1111111tfftfffftttttttttttfLLLLffffff\nttffffffffftttffffffffftttt1tffftft1i;;;;;;;iiii1ttfffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\nttffffffffttttfffffffft1tftt1tft1;ii;;;;;;;;ii1111ttftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\nttffffffffttttfffffffft1tttt1ii;,.:i;;;i;iii111t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffftfttt111ii;:,....,i1;;iiiii1i:;;;i11111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\ntttttttttffttfttt1111ii;:,.........;11iiii;;11;::;;,:;1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntft1ttttttt1t1111111:,.............:1tt1iii1t1;;:;:,,.,:1tffftt11t1111ttt11tt1tffftt1111ttfftfLLfftt\ntttttffttt1111ttttt;................:iiiiii11,:;:;:,,,,.:tttt111tt1111ttt11tf1tffffftttttt1ttttttfft\n1tttfffffft1tftttt1,.................,;;;;:;:.,:i:,,,,,,,it11111111111tt111tft1tffffttfffftt11tffLLf\n111ttfffft111ttttti...................:;;;;;:,,:1;.......;t1tt11111111111t11tf1tfffttfffffffttfLfLLf\ntttt1tftt11111ttt1:...................,;:;;;:..;1;.......:tt111t11t1111111111t1tffttttffffftt11ffLLf\nttft1111ttttt1111;.....................:;:;;,..,;:.......,111tttt11111111tttt11tttfLffttfft1tt1tffft\n1tttt11ttttttt111,.....................,::;;,..,:,.......,1ttttttt111111tttffttttffLLffttttffffttttf\ntfftt11ttttttt11;.......................:::;,..,:,........itttttttt1111tttttfftttffffffftttftttffttf\nttfft11ttttttt11,.......................,;;;;:,,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt1i,.....................,::;i;;;,,:.........:111tt1111111111tttttttffLLfLfttfffffffttf\nttttt11ttttttt1i.....................,:::;i;i:.,:,........,1t1111t111111t111ttfttffLLLLfttfffttffttf\ntttt111ttt11t11;.....................,:::;;;;,.,:..........1tt111tt11111ttt1tffttffffffftttffftffttt\nttttt11t1111111:......................:::::,...,:..........:i1tttt1tt111t1111tttttfttffft1tttttffttt\nttttt11tttt11t1i.......................... ....,,.......... .,,:i11iii11111tt1t1ttffffttt1ttttttfttt\nttttt11tttttt111;... ......................,:............ .,:::;iiii1111111tfttttt11ttttttfttt\n11111111t1111111t1i;;::::......................,:..,:.. .......,::;;;;;;iii11111tttttt111ttttttt1t\n11111111111111111ttttttt1,.....................,:......:,.. ..,:;;;:;;;iiii11111111111111111tt111\n111111111111111111111111i,.................,::..,.... ,tt1ii;,,.. ..,:i;;iii111111111111111111111111\n111111111111111111111111i,.................,;:,,,......1tttttt11i;;::itt11t1111111111111111111111111\n111111111111111111111111i,................ ,;:::,......it1t1tttttttttt11tt11t111111111111111111t1111\n111111111111111111111111;................. ,;;::,......it1tttttttt1111111t11111111111111111111111111\n111111111111111111111111:................. .;;:::......;t1ttttttt1ttttt111t1111111111111111111111111\n111111111111111111111111,...................;i;::,.....;tt1ttttttttttt11tttttttt111t111111tttttt1111\n111111111111111111111111:...................:i;:::.....ittttttttttttttttttttt1ttt111tttttttttttt1111\n","tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\ntttttttttttttttttffffftttffffffffffft1111tttt111ttffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttffffftttffffffLffftt11111i;iiii1tfffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffttttt11;::,,,,,,::1fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLftttttttf1;:,,,,,,,,,,,itfffftttfffft11t111tt111tttffLLfttfftt1ttt11tttttt\nttttttttfffLLLLLLffttfLLffttfffttt1,,,,,,,::::::itttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffLfft1:,,,,,:;ii11111ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLfLLLLLLLLfttttffftfffftt1:,,,,:;;iii1111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfLLLLLLLLLLfttfttffftttttf1,,,,,:;iiii;iii1ttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\nttfffftfffLLLLLfffftfffttttffftfLt:;;;:;;iiiiiii11tfffft11tfffft111111ffft1tt1ttt1tt1tfffLLLLLLLffff\ntffftfttttfLLLfttttttffftttfLLftff1;;;i;;;iii1iiitfffffft11tttt1ttt111fffttfffttttfftttffLLLLLLLLffL\ntttttttttttfffttttttttttttttffftfffi;;;;;;iiiiii1tffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttffffffffftttt1tffftffti;;;;;;iiiii1tttffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\nttffffffffftttfffffffftttftt1tftt111i;;;;;;;;ii111tfftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\ntttfffffffttttfffffffft1tt111111i::i;;;i;;;;i11t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffftfftt111111i;:,..,ii;;iiiii11:;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\ntttttttttffttfttt1111111i;:,.......:11;iiii;11;::;;,:i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntfttttttttt1t1111111i;:,...........:1t1iii;itt;;;;:.,,,:itffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\ntttttffftt1111ttttt1:..............,i111ii1tti:;;;:,,,,.,1tft111tt1111ttt11tf1tffffftttttt1ttttttftt\n111tfffffft1tfttttt;.................:;;;;;;;,.:i:.,,,,,.;t11111111111tt111tft1tffffttfffftt11tfffLf\n111ttfffft111ttttt1,..................:;;;;;:,.:1;.....,.:11tt11111111111t11tf1tfffttfffffffttfLfLLf\ntttt1tftt111111tt11,..................,;;;;;:,.;1;.......,1t111t11t1111111111tttffttttffffftt11fffLf\ntttt111tttttt11111;....................::;;;,..,;:.......,i11tttt11111111tttt11tttfLffttfft1tt1tffft\n1tttt11ttttttt111i.....................,::;;,..,:.........ittttttt111111tttffttttffLLffttttffffttttf\ntfftt11ttttttt111,......................::::,..,:,........itttttttt11111ttttfftttffffffftttttttffttf\nttfft11ttttttt11;.......................,:::,..,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt11:........................,:,,..,:,........,111tt1111111111tftttttffLLfLfttfffffffttf\nttttt11ttttttt11,.......................,,::,..,:..........it11111t11111t111tttttffLLLLfttffftfffttf\ntttt111tttt1t11i......................::;;;;;:.,:..........;t11tttt11111tt11tffttffffffftttffftffttt\nttttt11tt111111:....................,:::;i;;i,.,:..........;ttttttt1111111111tttttfttffft1tttttffttt\nttttt11ttttttt1;....................,:::;i;;:..,,...........:;iii1111111111tt1t1ttfffttt11ttttttfttt\nttttt11tttttt111:...................,:::;;;;...,,........... .,:;;;:;i1111ttt1111ttttttt11ttttttfttt\n11111111t11t11111;,.. ...............,,,....,:.... .......,:::::;;11tt11111111tt1tt1111ttttttt1t\n11111111111111111t11i;;;:.......,..... ......,,....,,. ...,::;::;i1111111111111111111111111tt111\n11111111111111111111tttti,...................,.,,... :1i:,. .,,;;i1111111111111111111111111111111\n111111111111111111111111i,...................:,,,.....ittt1i:,.. ,1tttt111111111111111111111111t1111\n111111111111111111111111;,...................,,::.... .111tttt1ii1ttt11111111t11111111111111111t1111\n111111111111111111111111;....................,:::......it1t11ttttt1111111111111111111111111111111111\n111111111111111111111111;....................,::,......;t1tttttt11tt1tt111t1111111111111111111111111\n11111111111111111111111t:....................::::......:1111ttttttttttt1tt11ttt11111111111tttttt1111\n11111111111111111111111t:....................:;::,.....,1tttttttttttttttttttttttt111tttttttttttt1111\n","tttftttttttttttttttttffftttttt11ttttt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfftfffttffttttt111111111t11ttffffftttt1111111111111111ttffttfttttttttt1111tttt\ntttttttttttttttttffffftttffffffffffft1111tttt111tfffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttffffftttffffffLfffttt1111ttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttftttffffffffttttft1i;:;;;;;i11tfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLfttttttfft1;:,,,,,,,,:1ttfffftttfffft11t111tt111tttffLLfttffft1ttt11tttttt\nttttttttfffLLLLLLffttfLLffttfffttti::,,,,,,,,,,;ttttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\ntttttttfffLLLLLLLLLfttfttttfffffti,,,,::;;;iiiii1ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttfLLLLLLLLLLftttttfftfffftt1:,,,;iii1111111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfttffftttttff:,,:;;;iiii1ii1tttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\nttfffftfffLLLLLfffttfffttttffftfLt;:,:;;;;iiiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffftfttttfLLffttttttffftttfLLftff1;;;;;iiiii;i11ttfffftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttfffLtfffii;;;;;ii;;iittffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttft1tffftffti;;;;;iiiii1ttttffffttt1tffft11111tfttfffttt1tttttttttfLLfffffft\nttffffffffftttfffffffftttfttttfttttti;;;;;iiii1111tfftft11ttttffff1111tt1tffttffttfffffLLffffffLffLL\nttffffffffttttfffffffft1tt11111tft11i;;;;;;;iit11111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffftttfffftfftt1111111111i:,;i;;;;;;ii1i;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\nttttt1tttffttfttt11t111tttt1i;:,...:1i;ii;ii;1i:;;i;;i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntfttttttttt1tt1111111ttt1;:,,.......;ti;iii;it1;;;;,..,:i1fffft11t1111ttt11tt1tffftt1111ttfftfLffftt\nttttfffftt1111ttttt111;:,...........;tt11iii1t1::;;,,,,,.,1ft111tt1111ttt11tf1tffffftttttt1ttttttftt\n111tfffffft1ttttttt11,..............:i11iii111:,;;,,,,,,,.;t1111t11111tt111tft1tffffttfffftt11tfffLf\n111ttfffft111ttttttt;.................:;;;;;;:.,ii,....,,.:1tt11111111111t11tf1tfffttfffffffttfLfLLf\ntttt1tftt11111ttt111:.................,;;i;;;,.,1i,.......:t111111t1111111111tttffttttffffftt11fffLf\ntttt11ttttttt1111111,..................:;;;;;,,,;;,.......:11tttt11111111tttt11tttfLffttfft1tt1tffft\n1tttt11ttttttt11111i...................,;;;;:,..:,........:1tttttt111111tttffttttfLLLLfttttffffttttf\ntfftt11ttttttt11111:....................:i;;:,.,:,........,1ttttttt1111ttttffftttffffffftttttttffttf\nttfft11ttftttt111ti,.....................;;::,..:,........,i1tttt11111111ttffttttffLLfLfttfffffffttf\ntttft11ttttttt111t;......................,::,...:,.........;11t11111111111ttt1tttffLLLLfttfffffffttf\nttttt11ttttttt111t:......................,::,...:,...,,....it11111111111t111tttttfffLLLfttfffftffttf\ntttt11tttt11tt1111,.......................,,,...:,...,:;;;;itt11ttt1111ttt1ttftttffffffftttffftffttt\nttttt11t111111111i.........................,,...:,...,:;iiii11111t111111t111tttttttttffft1tftttffttt\nttttt11ttttttt111,.........................,,...:....,:;;iii11111111111111ttttt1ttfffttt11ttttttfttt\nttttt11ttttttt111;...................,,,,..,....,......,:;ii1ttt1111111111ttt1111tfttttt11ttttttfttt\n11111111t11t11111t;...............,:::::::..,...:.........,,it11tt1111111tttt1111ttt1tt1111ttttttt1t\n1111111111111111111,.............:::::;;i:......:..... :1ttttt111111111111111111111111111111t111\n11111111111111111111;,.. ........,::::;;:.......,... ,i;;;i1tttt111111111111111111111111111111111111\n11111111111111111111t11i,.........,:::;;. ..,:,.:.....itttttttt1111111t111111111111111111111111t1111\n11111111111111111111111t;...........,,,.... ,:,,:......it1111ttt1111111111111111111111111111111t1111\n111111111111111111111111;.......... .... .:,,:,. ...:tttt11tt111111111111111111111111111111111111\n111111111111111111111111;....................::::..,,..,1tttttttt1tttt1111t1111111111111111111111111\n11111111111111111111111t;....................::::..,,...;t1tttttttttttt1t11ttttt111t111111tttttt1111\n11111111111111111111111ti....................:;::,......:11tttttttttttttttttttttt11t11t1111ttttt1111\n","tttftftttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt1111111tt\nttfftttttttttttttttffLfttfffttffttttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\nttttttttttttttttfffffftttffffffffffftt11ttttt111tffffffftttttttt11111ttttttffffftfLLfttttttt1111ttt1\nttttttttttttttttffffftttffffffLfffttttt11tttt11tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffftttft1tttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\nttttttttttffLLLLftttttffLLftttttttfft11iiiiiittt1ttfffffttfffft11t111tt111tttffLLfttffft1ttt11tttttt\nttttttttfffLLLLLLffttfLLffttfffttfft;::,,,,,,:itttttffttffffffftt1111tftt11t11tfLLftttt1tffftttttttt\ntttttttfffLLLLLLLLLfttfttttffffft11i:,,,,,,,,:,;fffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttfffttffftt1;:::::;;;iii;:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfttfLfttttfft;:;iii111111i;1ttttttttffffffftt1111ttt1ttt1ttftt11ttfffffLLLLfttt\nttfffftfffLLLLLLffftfffttttfffffLf;:;;;;ii1iiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffffftttffLLffftttttffffttfLLffffi:i;;;;;ii;ii11ttffffft11tttt1ttt11tfffttffft1ttfftttffLLLLLLLLffL\ntttttttttttffftttttttttttttfLfftffi;ii;ii;i11111tfffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttftttfLftf1;;;;;;;;i1111tttffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\nttffffffffftttfffffffftttfftttftttt1i;;;;;iiii1111ttftft11ttttffff1111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffft1ttt1111tfftt1i;;;;iii1tt111ttt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttffffttftt111t11111ttfft1;;;;;;ii1ti;;i11111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\nttttt1tttffttfttt111111tttt11111tti:i;;;;;;iii1;:;i1i1ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntfttttttttt1tt11t1111ttfftt1tt1i;:..;i;;;;;iii1i:;;:,,:;i1ffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\ntfttfffftt1111tttttt1tttttt1i;,.....:11;ii;;;iti:;;,,,...,:1t111tt1111ttt11tf1tffffftttttt1tttttfftt\n1t1tfffffft1tttttttt111tti:,....,...,i11iii;i1ti;i,,,,,,,,.,i111t11111tt111tft1tffffttfffftt11tffLLf\n1t1ttfffft111tttttt1111:,...........,i1t1iii11i,;1,....,,...;t11111111111t11tf1tfffttfffffffttfLLLLf\ntftt1tftt1tt11ttt111tt;..............,:;i;;;;;,.i1,.........:11111t1111111111tttffttttffffftt1tffLLf\ntfftttttttttt111111ttt:................,;;i;;:,,:;,.........:tttt11111111tttt11tttfLffttfft1tt1tffft\ntttttt1ttttttt1111ttti,................,:;;;;:,.,:..........,ttttt111111tttffttttfLLLLfttttffffttttf\ntffft11ttttttt1111ttt;..................,;;;::,.,,..........,1tttt111111tttffftttffffffftttttttffttf\ntffft11ttftttt111tttt:...................:;;::..::,,.........ittt11111111ttffttttffLLfLfttfffffffttf\ntffft11ttttttt111ttt1:...................,;::,,::;;;i;,......;t11111111111ttt1tttffLLLLfttfffffffttf\ntttft11ttttttt111ttt1,....................,::,,::;;iii;. ...,it11tt11111t111tttttfffLLLfttfffftffttf\nttttt1tttttttt111t1ti.....................,:,,,,::;iii;.....,it11tt1111ttt1ttftttffffffftttffftffttt\nttttt11tt11111111t1ti......................,:,. ,,,:;i:.......;11tt11111t111tttttttttffft1tttttffttt\nttttt11tttt11t11tttt;......................,,,..,, .,,.......,;11111111111ttttt1ttfffttt11ttttttfttt\nttttt1tttttttt111ttt:.......................,,..,,.....,....:1ttt111111111ttt1111tfttttt11ttttttfttt\n1111111ttt1t11111tt1,.......................,,..:,.........:1t11111111111tttt1111ttt1ttt111ttttttt1t\n11111111111111111111;....... ............,,..:,.....,;ii1t1t111111111111111111111111111111111t111\n111111111111111111111,.... .,::,................:....,11ttt11tt11t1111111111111111111111111111111111\n111111111111111111111;.....;i;;;,...............:,....it1111ttt1tt1111t111111111111111111111111t1111\n1111111111111111111111i:.,iii;;i:.......... ,::,:......itttttttt1111111111111111111111111111111t1111\n111111111111111111111111i,:;;;ii;,......... ,;;::,.....:1ttttttt11111111111t111111111111111111111111\n111111111111111111111111i,.,::;;:.......... ,;;;::......itttttttt1tttt11t1tt111111111111111111111111\n111111111111111111111111i..,.................;;;::,.,,..:1tt1tttttttttttt11ttttt11111111tttttttt1111\n111111111111111111111111i..... .............;i;:::,.....itttttttttttttt1tttttttt11t11t1111ttttt1111\n","tttfttfttttttttttttttfffttttt1111tttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLfftfftttffftttt111111111111tfffffftttt111111111111111tttffttfttttttttt11111ttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tffffffffttttttt111111ttttffffLfffLLfttttttt1111t1t1\nttttttttttttttttffffftttffffffLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\nttttttttttttfffftttffttffffffffftttftttttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLfft111111tttt\nttttttttttffLLLLftttttfLLLftttttttfftttttttfffft1tffffftttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftffft11i;ii1ttffttttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffLfLftti;:;:,,,:;;itffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffftffffftt1;,,,,,,,,::,:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfftfLftttffff1;::::;;iii;,:1ttttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\nttfffftfffLLLLLfffftfffftttfLfffLfi;iiii11111i;:i1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffffftttffLLfffttttfffffttfLLffLf;;;;iiiiiiii;:1tfffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttffLLffLt;;:;;ii;;iii;ttffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttftttfLftf11i;;;i1ii11ii1tfffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\nttffffffffftttfffffffftttfftttfttt11i;;;;i1111i111ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffftttttt111tfft11;;;;iiiii1t1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\ntttffffffffttfffffffft111tt1111ttfft1i;;;iiiii1;;;111111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\nttttt1tttffttfftttttt11ttttt111tttft1i;;;;iiiii;;;1t11ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tffftt1tt11tff1ii;;;;;iiii:;;i;;i1tttffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\nttttffffttt11tttttft1tttttt1ttt11i;,:i;;;;;iii;;;;:...,,,:;i1111tt1111ttt11tt1tffffftttttt1ttttttftt\n111tfffffft1ttfftttt11tttt1tfti;,...,i1i;;ii;;i1i;,.........,i11111111tt111tft1tffffttfffftt11tffLLf\n1t1ttfffft111tftttt1111ttt11;:,......;11iii;;1t11;......,.,,.,i1111111111t11tt1tfffttfffffffttfLLLLf\ntftt1tftt1tt11ttt11ttt11i;:,.........:1tt1i;i1111;............;t11t1111111111tttffttttffffftt1tffLLf\ntfftttttttttt111111tttt1,.............:;;;;;;;;:;:............:tt11111111tttt11tttffftttfft1tt1tffft\n1ttttt1ttttttt1111tt11ti................:;;;;;:,:,............,1tt111111tttffttttfLLLLfttttffffttttf\ntffftttttttttt111tttt1ti................,;;;;::,:,.............ittt11111tttffftttffffffftttttttffttf\ntfffttttfftttt111tttttt;.................:;;:::,:,.............:tt1111111ttffttttffLLfLfttfffffffttf\ntffftttttttttt111tttttt;.................,:;:::,:.,:,,.........,it11111111ttt1tttffLLLLfttfffffffttf\ntttft11ttttttt111tttttt:..................,::::,:,,;;;;;:,......itt11111t111tttttffLLLLfttfffftffttf\nttttt1tttttttt1111t1ttt;...................,::,,:,:;;;iii;.....,1tt1111ttt11tftttffffffftttffftffttt\nttttt11tt1111t111tt1ttt:...................,::,,:::;;iiii;,.....:i1t1111t111tttttttttffft1tftttffttt\nttttt11ttttttt11ttttttt:....................::,,:..,,:;ii:...... .1t111111ttttt1ttffffft11ttttttfttt\nttttt1tttttttt111tttttt:....................,::,:. ..::,......,1t1111111ttt1111tfttttt11ttttttfttt\n1111111tttttt1111ttt1tt:.... ...............,:,,:..............,1t1111111tttt1111ttt1ttt111ttttttt1t\n11111111111111111111111;;;;:,...............,:,,:....... ...,,:1ttt11111111111111111111111111111t111\n11111111111111111111111iiiiii:...............,,,:........,:i11tt1tt111111111111111111111111111111111\n11111111111111111111111iiiiiii...............,,,:.......,1tttt11tt1111t111111111111111111111111t1111\n1111111111111111111111i;iiiiii,..............,.,:........ittt11t111111111111111111111111111111111111\n111111111111111111111111iiii;,...............::::,,......:1ttttt11t111111111111111111111111111111111\n1111111111111111111111111i:,. ...............:i;:::,......itttttt1ttt111t1tt111111111111111111111111\n11111111111111111111111111:................. :i;;;::,.....;ttttttttttttttt1ttttt111111111ttttttt1111\n11111111111111111111111111:................. :i;;;;::,....:tttttttttttttttttttttt11t11t1111ttttt1111\n","tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLLftffftfffftttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttfffffffLLfttttttt111tttt1\nttttttttttttttttfffffttfffffffLffffttttttttttt1tffffffffffttttttt1111ttffffffLLfttffffffttt1111tttt1\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1tffffftttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLffttfffftfffttttttfffffftfttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffffffttft111i;ii1ttfffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftft1i:::,,,,::;;1fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfffLLLLLLLLfttfftfLffftfffLf1;,,,,,,,::,,:1tttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\nttfLfftfffLLLLLfffftfLfftttfffffLLf1;;;;;iiiii:,:1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntffffftttffLLfffttttfffffttfLLLffLfiiiii111111i::1tffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttftttttttffftttttttttttttfffLffLfii;;;iiiiiii;:1ftffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttfttffLfffLti;:;;ii;ii1;;ttffffftttttffft11111tfttffftttttttttttttfLLfffftft\nttffffffffftttfffffffftttfftttftttt1i;;;ii11111ii1ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffftttttt111tfff1ii;;;iiiiiii1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\n1tfffffffffttfffffffftt1ttt1111tffft1i;;;iiiiii;;i111111tfffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\ntttttttttffttfftttttt1ttfft1111tttftt1;;;iiiiii;:;tt11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tfffft1tt11ttft11;;;;;iiii;;;1t11ttttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\nttttffffttt11tttttft1ttfffttfft11tftiii;;;;iiii;;;;:;ii1tttft111tt1111ttt11tt1tffffftttttttttttttftt\n111tfffffft1ttfttttt11tfftttfttt11i:,ii;;;;;iii;i:.....,,::;i111t11111tt111tft1fffffttfffftt11tffLLf\n1t1ttfffft111tffttt1111tft1ft1i;:,...;1i;;;;;;i11:...........,;1111111111t11tt1tfffttfffffffttfLLLLf\ntftt1tftt1tt11tft11ttt111111;:,......,111ii;;i1t1:........,,...;11t1111111111tttffttttffffftt1tffLLf\ntffttttttttttt1111ttttt11;:,.........,i111i;i1t1;,.............,1t1111111tttt11t1tfLftttfft1tt1tffft\n1ttttttttttttt1111ttt11ti,............,::::;;;i;:,..............it111111tttffttttfLLLffttttffffttttf\ntfffttttffttttt11ttttttti...............,;;;;;;;:...............:t111111tttffftttffffffftttttttffttf\ntfffttttfffttft11ttttttt;...............,:;;;;:::...............,1t111111ttffttttffLLfLfttfffffffttf\ntffft1ttttttttt11ttttttt:................,;;;;:::................it1111111ttt1tttffLLLLfttfffffffttf\ntffft1tttttttt111ttttttt:................,:;;::::................:t1111tt111tttttffLLLLfttfffftffttf\nttttt1tttttttt111111tt1t;.................,::::::................,1t111ttt11tftttfffffffttfffftffttt\nttttt1tttt11tt111ttttttt:.,:;:............,::::::................,itt111t111ttt1tttttfft11tftttffttt\nttttt1tttttttt11tttttttt;:;iii:............,:::::...........,:,....:1t11111tttt11tfffttt11ttttttfttt\nttttt1tttttttt111ttttttt;;iiiii:. ..........:::::...........,;;;;:..it1111tft1111ttttttt11ttttttfttt\n1111111tttttt1111ttttttt:;iiiii;............,::::,........,::;;iii;it111ttttt11111tt1ttt111ttttttt1t\n111111111111111111111111:;;iiii;,...........,:,::,.........,;;iiii;it111111111111111111111111111tt11\n111111111111111111111111;:;:;;;,............,::::,...........:;;ii;it1111111111111111111111111111111\n111111111111111111111111;::.... .............,:::,,......... .,,:i1t1111111111111111111111111111111\n111111111111111111111111i;,..................,,,:,,....... .;,..,;11111111111111111111111111111t1111\n1111111111111111111111111i;:;i;,..............,,:,,,........1tii11t111111111111111111111111111111111\n111111111111111111111111111111:..............,:::;;:,.......;ttttttttt11t1tt111111111111111111111111\n11111111111111111111111111111;,..............:i;;ii;;:,.....,1ttt1tttttttt1ttttt1111111111tttttt1111\n1111111111111111111111111111i,...............,i;;iiii;:......ittttttttttttttttttt11t11t1111ttttt1111\n","tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111tttt1\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt1111ttfffffffLftttfffffttt1111tttt1\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1ttfffffttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftffftttttfffffffffttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\ntttttttfffLLLLLLLLffttfttttffLffftfftttttfftffffffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffffftfftt11iii;:;;i1tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfLLLLLLLLLLfttfftfLffttfffLLft1;:::,,,,::;;1ttttttffffffftt1111ttt1ttt1ttfttt1ttffffLLLLLfttt\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLfti;,,,,:::::,,;fffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\ntfffffttttfLLfffttttfffffttLLLLffLLf1ii;;iiii11i:,;tfffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttfffLffLLf1iiiiiii1111;:;tffffftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\nttffffffffftttfffffffffttfttffLfffLf111;;;ii;;i1i:itfffftttttffft11111tfttffftttttttttttttfLLfffftft\nttffffffffftttffffffffttffftttftttttt1i;;;iii;iii;ifftft11tttttffft111tt1tffttffttfffffLLfffffffffLL\ntttfffffffttttfffffffftttttt111tffft11i;;;ii11111111tt111tffftttft11111tt1ttttfft1tffffLLLfttfLLLLLL\n1tfffffffffttfffffffftt1ttt1111fffft111i;;;iiiiiii11111ttfffft11111111tfft1tttttt1tfffffLfftttfLLLLL\ntttttttttffttfftttttt1ttftt1111ttffttt1i;;;iiii;;;1t11ttttfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt1ttfffftttt11ttft1t1i;;iiiii;:;1t111tttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\nttttfffftttt1ttttfft1tffffttfft11tft111i;;;;;ii;:;i11111ttttt1111t1111ttt11tt1tfffffttttttttttttffft\n111tfffffftttffftttt11tfftttfttt1ttt1i1i;;;;iiiiii::;i111tt11111t11111tt111tft1fffffttfffftt1ttfLLLf\n1t1ttfffft111tffttt1111tfttft11tti;::,i1;;;;;iii11:...,,::;i1tt1111111111t11tt1tfffttfffffffttfLLLLf\ntttt1tftt1tt11ttt11ttt1111tt11i;,,....;1i;;;;;;i11:.,.......,,:i11t1111111111tttffttttffffftt1tffLLf\ntffttttttttttt1111ttttt111i;:,........;1t1ii;;i1ii,.............;t1111111tttt11t1tfLftttfft1tt1tffft\n1ttttttttttttt1111tttttt11:...........:iiiiii1tti,..............,1t11111tttttttttfLLLffttttffffttttf\ntfffttttffttttt11ttttttt1i,.............,:::;;ii;,...............;t11111ttttfftttffffffftttttttffttf\ntfffttttfffffft11ttttttt1;..............,:;;;;;;:,...............,1111111ttffttttffLLfLfttfffffffttf\ntffftttttttttt111ttttttt1:.......... ....:;;;;;;:,................it111111tttttttffLLLLfttfffffffttf\ntffft1tttttttt111ttttttt1,........,,:;:,.,;;;;;:;,................;t1111t111tttttffffLLfttfffffffttf\nttttt1tttttttt1111t1tttt1,.......;;;;;:,..:;;::::,................,1t11ttt11tftttfffffffttfffftffttt\nttttt1tttt11tt111ttttttt1:......;;;;;;;:,.:;;::::,................,it111t1111tt11ttttfft11tftttffttt\nttttt1tttttttt11tttttttti,......:;:;;;:...,:;::::,.................:1t11111tt1t11tfffttt11ttttttfttt\nttttt1tttttttt11tttttttti,......:;:;;:.....,:::::,..................:11111ttt1111ttttttt11ttttttfttt\n1t1t111tttttt111111ttttt;...,,,.,:::. ......:::::,...................,111tttt11111ttttt1111ttttttt1t\n111111111111111111111111,,,,,,,.............,:::::,..................,1t111111111111111111111111tt11\n11111111111111111111111i,,..:,..............,,::::,,.................,11tt11111111111111111111111111\n111111111111111111111111;...................,:,,::,,.................,;ii11t111111111111111111111111\n111111111111111111111111i,..................,:::::,,................:::;;;i111t111111111111111111111\n1111111111111111111111111i;;;;i1:............::,:,,,,........... ..::;;;;i1111111111111111111111111\n111111111111111111111111111111t1,............,.,:,,,:,,........:,,..,:;;;i11t11111111111111111111111\n1111111111111111111111111111111i.............,,::;;;i;:,...... :111i;::;;;1ttttt11t1111111tttttt1111\n111111111111111111111111111111ti.............:1;;1iiii;:,.......i1tttt11111tt1tt111111t1111ttttt1111\n","tttttttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111ttt1\nttttttttttttfffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLff111111ttttt\nttttttttttffLLLLftttttfLLLfttttttffffttttttfffft1tffffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftfffttttttfffffftfttfftffffffffttt111tftt11t11tfLLLftt11tffft1tttttt\ntttttttfLfLLLLLLLLffttfttttffLLfftffttttffffffffffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLLftffttttttt11i;ii1tftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttffttfLLLLLLLLLLfttfftfffffffffLLfttt1i;::,,,,:;;1tttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLLttt1;,,,,,,,::,:iftt11tfffft11111tffft1tt11tt1ttttfffLLLLLLLLfff\ntfffffttttfLLfffttttfffffttLLLLfLLLftt1i;;;;;;iiii:,;fftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttffLLffLLftt1;iiiii11111i::tfffft1ttt111111tffftfffftttttttt1ttfLLLLffffff\nttfLffffffftttfffffffffttfttffLfffLftt1;i;;;iiiiiii;;tfftttttffft11111tfttffftttttttttttttfLLftfffft\nttffffffffftttffffffffftffftttfttftttttii;;;;ii;;ii;iftt11tttttfft1111tt1tffttffttfffffLLfffffffffLL\nttffffffffttttfffffffftttttt11ttfffttt11ii;;ii1111ii11111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\n1ttffffffffttfffffffftt1ttt111tffffttt1i1i;;;iiiiii1111ttfffft11t11111tfft1tttttt1ttffffLfftttfLLLLf\ntttttttttffttfftttttt1ttfff1111ttffttttt1i;;;;i;:;it11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tfffftttt11tfftt11tt1;;;ii;;;1t111tttffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\ntfttfffftttt1ttttfft1tffffttfftt1tft1111t1;;;;i;:;i11111tttft111tt1111ttt11tt1tfffffttttttttttttffft\n1tttfffffftttffftfft11tfffttfttttttt11111i;;:;iiii1i;i1t1tt11111t11111tt111tft1fffffttfffftt1ttffLLf\n1t1tffffft111tffttt1111tfttft11tt1t1i;;;1i;;;;ii1ii1,.,:;ii1tt11111111111t11tt1tfffttfffffffttfLfLLf\ntfttttftt1tt11ttt11ttt11t1t11tt11i:,...,11;;;;;it111,,.....,:;i11tt1111111111tttffttttffffftt1tffLLf\ntffttttttttttt1111ttftt111111i;:,......:1t1i;;;;i1t1,..........,:i1111111tttt11t1tfLftttfft1tt1tffft\n1ttttttttttttt1111ttttt111tt;..........:1111iii1;11:.............,it1111tttttt1ttfLLLffttttffffttttf\ntfffttttffttttt11ttttttt11t1,...........,,:::;;i;;:...............:t1111ttttfft1tffffffftttttttffttf\ntfffttttfffffft11ttttttt111i..............:;:::;;::...............,1t1111ttffttttffLLfLfttfffffffttf\ntfffttttttttttt11ttttttt111:..............,;;;;;;:,................;t11111ttt1t1tffLLLLfttfffffffttf\ntffft1tttttttt111ttttttt11i,..........,::::;;;;;;:,................,1t11t111tttttffffLLfttfffffffttf\nttttt1tttttttt111tt1tttt11i.........:;;;;:,;;::::::.................;t1ttt11tftttffffffftttffftffttt\nttttt1tttt11tt111ttttttt111,.......;;;;;;:,:;::::::,................:tttt1111tt11ttfttft11tftttffttt\nttttt1tttttttt11tttttttt11;,......,;;;;;;:::;::::::,................,itt111t11t11ttftttt11ttttttfttt\nttttt1tttttttt11tttttttt11;,......:;;;;i;...,:::::,,.................:tt1tttt1111ttttttt11ttttttfttt\n1t1t111tttttt111tttttttt1;,.,.....,:;:......,:::::,,..................it1tttt11111tttt11111ttttttt1t\n1111111111111111111111111:,,,......,,. .....,,::::,,..................,1t11111111111111111111111tt11\n1111111111111111111111111,,....,,...........,,,:::::,..................itt11111111111111111111111111\n1111111111111111111111111;,.................,:::::::,,................:1tt11111111111111111111111111\n11111111111111111111111111:.... ............,:::,:,,.................,1tt11111111111111111111111111\n11111111111111111111111111ii;;;;;i, .........,,::,,,,,................,:;;1tt11111111111111111111111\n11111111111111111111111111111111t1,..........,,,:,,:,:,,. ...........,:::;;i11tt11111111111111111111\n11111111111111111111111111111111t;.............,:::;;;;:,........ .,:::;;:;i1t111111111ttttttt11111\n111111111111111111111111111111111:...........,;;;i1iiii;:,.......::,,::::;;i1ttt111t11t1111ttttt1111\n","tttftttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt11111111t\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\nttftttttttttttttffffLffttfffffffLfffttttttttt111tfffffffftttttttt11111ttttttfffftfLLfttttttt111tttt1\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tfffffffffttffffffttt11111ttt1\ntttttttttttffffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLfft11111ttttt\nttttttttttffLLLLftttttfLLLfttttttffLftttttttffft1ttfffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffffftftttfffffffttt111tftt11t11tfLLfftt11tffft11ttttt\ntttttttfffLLLLLLLLffttfttttfLLLfftffttttffftt1iii11tttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\ntttttttffLLLLLLLLLfttttffffffLffffftttttfti;;::,,,:;i1tffffffffftt1111111ttftttttttttttfffffLLfffttt\ntttfffffLLLLLLLLLLfttfftfLfffffffLLfttttt1;,,,,,,,::,:ittffffffftt1111ttt1ttt1tftttt1ttffffLLLLLfttt\nttfLLffffLLLLLLLLfftfLfftttfLfffLLLLfttt1i;:::;;iiii;,;t11tfffft11111tffft1tt1ttt1ttttfffLLLLLLLLfff\ntffffftttffLLLffttttfffffttLLLLfLLLffttf1;;iiii11111i::1t11tttt1ttt11tfffttfftttttfft1tffLLLLLLLLffL\ntttttttttttffftttttttttttttfffLffLLftttti:;;;;iiiiiii;;tftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\nttfLffffffftttfffffffffttfttffLfffLfttttti;;;;;iii;i1iiftttttffft11111tfttffftttttttttttttfLLftfffft\nttffffffffftttffffffffftfffftffffftttttft11i;;;iiii1iiit11tttttfft1111tt11ffttffttfffffLLfffffffffLL\nttffffffffttttfffffffftttttt1tttffftttttti1i;;;ii11iii111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\n1ttffffffffttfffffffftt1ttt1111tfffftttt111i;;iiiiii111ttfffft11t11111tfftttttttt1ttffffLfftttfLLLLf\ntttttttttffttfftttttt1ttfftttt1ttfftttttt111i;i;:;ii11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\ntft1ttttttttttttttt11tfffftttt11tfftt1ttt111;;i;;;iii1ttttffftt11t1111ttt11tt1tffttt1111ttfftfLffftt\ntfttffffttt11tttttft1tffffttffttttft111ttt11;;;;:;i1i1;;11tft111tt1111tt111tt1tfffffttttt11tttttffft\n1tttfffffftttffftfft11tfftttffttttft1111iii1;;;i;iiii1i,,,:;;i11tt1111tt111tft1fffffttfffftt11tffLLf\n111ttfffftt1ttffttt1111tfttft11tt1t1i;:,,,;1i;;i1ii;iti,,.....,:;i1t11111t11tt1tfffttffffffft1fffLLf\ntfttttftt1tt11tft11ttt11tttt1tt11i;:,.....;11i;i1i;1tt;,,.........,:i11111111t1tffttttffffftt1tfffLf\ntffttttttttftt1111ttttt11111tft;,.........;11111i1ttti,.............,1111tttt1111tffftttfft1tt1tffft\n1ttttttttttttt1111tttttt11tfff1,...........,:;;;;;11i:...............itttttttt1ttfffLffttttffffttttf\ntfffttttffttttt11ttttttt11tfffi............ ,:;;;;;;;,...............;t1ttttfft1tffffffftttttttffttf\ntfffttttfffffft11tttttttttt1tf;..............:;;;;;;;,...............:111ttttttttfffLfLfttfffffffttf\ntfffttttftftft111ttttttt11t111:..............:;;;;;::,...............,1t11ttt1t1tffLLLLfttfffffffttf\ntfffttttfttttt111ttttttt11ttt1:..............,;;;::;::................itt111tttttffffLLfttfffffffttf\ntttttttttttttt111ttttttt1ttfft:..............,;;;;::::................:1tt11tft1tffffffftttffttffttt\nttttt1tttt11tt11tttttttt1tttt1;.,::,..........:;:::;::,...............,1t1111tt11tttttft11tfttttfttt\nttttt1tttttttt11ttttttttt1ttt1;,:;;:..........,::::::,,................it11111111ttftttt11ttttttfttt\nttttt1tttttttt11tttttttttttttiiiiii;,.........,:::::::,................:ttttt1111ttttttt11ttttttfttt\n1t1111tttttttt11tttttttt1ttt1;;;;ii;,.........,:::::::,.................ittttt1111tttt11111ttttttt1t\n11111111111111111111111111tt1;;;;ii;...........::::::::................ :1t111111111111111111111t111\n11111111111111111111111111tt1;::;;i:...........,:::::::,...............,itttt11111111111111111111111\n11111111111111111111111tttttt;,,,::............,::::::,,...............ittttt11111111111111111111111\n1111111111111111111111111tttt1:,,..............,:::::,,,,.......,:;::,:1t1111111111111111111111t1111\n11111111111111111111111111111111i;;i:..........,:,,,.,,.,.......::;;i;it1ttt111111111111111111111111\n1111111111111111111111111111111111ti...........,,.,:,:;::,......,:;;ii1ttttt11111111111111111t111111\n1111111111111111111111111111111111t;...........,;iiiiiii;:,......:;;;i1ttttt111t1111111111tttttt1111\n11111111111111111111111111111111111:...........,;i11iiii;:,.......,:i1tttttt1ttttt1t11t1111ttttt1111\n"];const l=new i.a;function c(){const[t,e]=Object(a.useState)(function(){const t=new Date;return 3===t.getMonth()&&1===t.getDate()}()),[n,i]=Object(a.useState)(0);return Object(a.useEffect)(()=>{const t=setInterval(()=>i(t=>(t+1)%s.length),100);return()=>clearInterval(t)},[]),Object(a.useEffect)(()=>l.subscribe(()=>{e(!0)}),[]),t?r.a.createElement(o.a,{open:t,onClose:()=>e(!1)},r.a.createElement("pre",{style:{color:"#0f0"}},s[n]),r.a.createElement("div",{style:{display:"none"}},r.a.createElement("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/a3Z7zEc7AXQ?autoplay=1",title:"YouTube video player",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"}))):r.a.createElement(r.a.Fragment,null)}},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var a=n(0),r=n.n(a),i=n(17),o=n(3),s=n(21),l=n(122),c=n(148);const f=Object(l.a)(t=>Object(c.a)({travel:{color:t.colors.white,lineHeight:"1em",whiteSpace:"pre",cursor:"pointer"}}));function u(t){const e=f();return t.city!==t.currentCity?r.a.createElement(s.a,{title:r.a.createElement(o.a,null,t.city)},r.a.createElement("span",{onClick:()=>t.onTravel(t.city),className:e.travel},t.city[0])):r.a.createElement("span",null,t.city[0])}function m(t){return r.a.createElement(r.a.Fragment,null,r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ,_ . ._. _. ."),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / ,/'-/~ '\\ ,' _ , '",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Volhaven}),",'|~ ._/-, /~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}},".-~ '| '',\\~|\\ _\\~ ,_ , ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Chongqing})," /,"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," '\\ ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Sector12})," /'~ |_/~\\\\,-,~ \\ \" ,_,/ |"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | / ._-~'\\_ _~| \\ ) ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.NewTokyo})),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\ __-\\ '/ ~ |\\ \\_ / ~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ~-_' _; '\\ '-, \\,' /\\/ |"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," '\\_,~'\\_ \\_ _, /' ' |, /|'"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / \\_ ~ | / \\ ~'; -,_."),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ~\\ | | , '-_, ,; ~ ~\\"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," \\, ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Aevum})," / \\ / /| ,-, , -,"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ,/ | |' |/ ,- ~ \\ '."),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ,| ,/ \\ ,/ \\ ",r.a.createElement(u,{onTravel:t.onTravel,currentCity:t.currentCity,city:i.a.Ishima})," |"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / | ~ -~~-, / _"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," | ,-' ~ /"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," / ,' ~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ',| ~"),r.a.createElement(o.a,{sx:{lineHeight:"1em",whiteSpace:"pre"}}," ~'"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(0),r=n.n(a),i=n(28),o=n(1187),s=n(1188),l=n(1);function c(t){const e=t.action.getEstSuccessChance(t.bladeburner,l.a);let n=r.a.createElement(r.a.Fragment,null);return n=e[0]===e[1]?r.a.createElement(r.a.Fragment,null,Object(i.d)(100*e[0],1),"%"):r.a.createElement(r.a.Fragment,null,Object(i.d)(100*e[0],1),"% ~ ",Object(i.d)(100*e[1],1),"%"),r.a.createElement(r.a.Fragment,null,"Estimated success chance: ",n," ",t.action.isStealth?r.a.createElement(o.a,null):r.a.createElement(r.a.Fragment,null),t.action.isKill?r.a.createElement(s.a,null):r.a.createElement(r.a.Fragment,null))}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var a=n(0),r=n.n(a),i=n(39);function o(t){return r.a.createElement(i.a,{open:t.open,onClose:t.onClose},t.children)}},,,function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(15),r=n(103);const i=t=>null!==t&&t.type===r.b.RECOVERY;class o extends r.a{constructor(){super(r.b.RECOVERY)}process(t,e,n){return e.shock=Math.min(100,e.shock+2e-4*n),e.shock>=100&&e.stopWork(t),0}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveRecoveryWork",this)}static fromJSON(t){return Object(a.a)(o,t.data)}}a.c.constructors.SleeveRecoveryWork=o},function(t,e,n){"use strict";n.d(e,"b",(function(){return i})),n.d(e,"a",(function(){return o}));var a=n(15),r=n(103);const i=t=>null!==t&&t.type===r.b.SYNCHRO;class o extends r.a{constructor(){super(r.b.SYNCHRO)}process(t,e,n){return e.sync=Math.min(100,e.sync+2e-4*t.getIntelligenceBonus(.5)*n),e.sync>=100&&e.stopWork(t),0}APICopy(){return{type:this.type}}toJSON(){return Object(a.b)("SleeveSynchroWork",this)}static fromJSON(t){return Object(a.a)(o,t.data)}}a.c.constructors.SleeveSynchroWork=o},,,function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var a=n(6),r=n(83),i=n(15),o=n(359);function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class l{constructor(t=null,e=[]){s(this,"args",[]),s(this,"dataMap",{}),s(this,"filename",""),s(this,"logs",[]),s(this,"logUpd",!1),s(this,"offlineExpGained",0),s(this,"offlineMoneyMade",0),s(this,"offlineRunningTime",.01),s(this,"onlineExpGained",0),s(this,"onlineMoneyMade",0),s(this,"onlineRunningTime",.01),s(this,"pid",-1),s(this,"ramUsage",0),s(this,"server",""),s(this,"threads",1),s(this,"dependencies",[]),null!=t&&(this.filename=t.filename,this.args=e,this.server=t.server,this.ramUsage=t.ramUsage,this.dependencies=t.dependencies)}log(t){this.logs.length>a.a.MaxLogCapacity&&this.logs.shift();let e=t;a.a.TimestampsFormat&&(e="["+Object(o.a)(a.a.TimestampsFormat)+"] "+e),this.logs.push(e),this.logUpd=!0}displayLog(){for(let t=0;t${e.title}

${e.txt}`;Object(r.a)(n)}},,,,,,function(t,e,n){"use strict";n.d(e,"c",(function(){return m})),n.d(e,"d",(function(){return h})),n.d(e,"b",(function(){return d})),n.d(e,"a",(function(){return p}));var a=n(0),r=n.n(a),i=n(261),o=n(1),s=n(83),l=n(89),c=n(7),f=n(23),u=n(311);function m(){const t=o.a.getCurrentServer();null!==t&&l.a.DarkWeb==t.hostname&&s.a.print("You are now connected to the dark web. From the dark web you can purchase illegal items. Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name]' to purchase an item. Use 'buy -a' to purchase all unowned items.")}function h(){for(const t of Object.keys(i.a)){const e=i.a[t],n=o.a.getHomeComputer().programs.includes(e.program)?r.a.createElement("span",{style:{color:"green"}},"[OWNED]"):r.a.createElement(f.a,{money:e.price});s.a.printRaw(r.a.createElement(r.a.Fragment,null,r.a.createElement("span",null,e.program)," - ",r.a.createElement("span",null,n)," - ",r.a.createElement("span",null,e.description)))}}function d(t){t=t.toLowerCase();let e=null;for(const n of Object.keys(i.a)){const a=i.a[n];a.program.toLowerCase()==t&&(e=a)}null!==e?o.a.hasProgram(e.program)?s.a.print("You already have the "+e.program+" program"):o.a.moneyo.a.money)s.a.error("Not enough money to purchase remaining programs, "+c.a.formatMoney(e)+" required");else for(const e of t)d(e.program);else s.a.print("All available programs have been purchased already.")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var a=n(186);function r(t,e,n){const a=n-Math.pow(e,.9)/250-t.skills.intelligence/1600;return a<0?0:a>3?3:a}function i(t,e){return r(t,t.skills.strength+t.skills.defense+t.skills.dexterity+t.skills.agility+t.skills.charisma,e)}function o(t,e){return r(t,Object(a.b)(9e3*t.mults.strength_exp,t.mults.strength)+Object(a.b)(9e3*t.mults.defense_exp,t.mults.defense)+Object(a.b)(9e3*t.mults.agility_exp,t.mults.agility)+Object(a.b)(9e3*t.mults.dexterity_exp,t.mults.dexterity)+Object(a.b)(9e3*t.mults.charisma_exp,t.mults.charisma),e)}},function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(30),r=n(164);function i(t){const e=Number(t);return isNaN(e)?"true"===t||"false"===t?"true"===t:t:e}function o(t){const e=(t=(t=t.trim()).replace(/\s\s+/g," ")).match(/(?:'[^']*'|"[^"]*"|[^;"])*/g);if(!e)return[];const n=e.map(r.h).map(t=>t.match(/(?:'[^']*'|"[^"]*"|[^;"])*/g)).flat(),a=[];for(const t of n)null!==t&&(t.match(/^\s*$/)||a.push(t.trim()));return a}function s(t){let e=0;const n=[];let r="",o="";for(;er.a.createElement(o.a,{key:e},t)),t.lines.length>e&&r.a.createElement(i.a,{key:e,text:t.lines[e],onDone:function(){const a=e+1;n(a),a>=t.lines.length&&(t.onDone&&t.auto&&t.onDone(),c(!0))}}),!t.auto&&t.onDone&&l&&r.a.createElement(s.a,{onClick:t.onDone},"Continue ..."))}},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return r}));const a=5,r=1e13},,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return c})),n.d(e,"a",(function(){return f}));var a=n(314),r=n(259),i=n(441),o=n(233),s=n(77);function l(t,e,n){try{let m={};const h=new Set,d=[];function l(t,e){const n=function(t,e){const n=Object(r.a)(t,{sourceType:"module",ecmaVersion:"latest"}),i=e+".__GLOBAL__",o={};o[i]=new Set;const s={},l=[];function c(t,n){const a=o[t]||(o[t]=new Set),r=s[n];void 0!==r&&a.add(r),a.add(e+"."+n),a.add(n)}const f=Object.getOwnPropertyNames(Object.prototype);function u(){return{Identifier:(t,e)=>{f.includes(t.name)||c(e.key,t.name)},WhileStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceWhile"),t.test&&n(t.test,e),t.body&&n(t.body,e)},DoWhileStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceWhile"),t.test&&n(t.test,e),t.body&&n(t.body,e)},ForStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceFor"),t.init&&n(t.init,e),t.test&&n(t.test,e),t.update&&n(t.update,e),t.body&&n(t.body,e)},IfStatement:(t,e,n)=>{c(e.key,"__SPECIAL_referenceIf"),t.test&&n(t.test,e),t.consequent&&n(t.consequent,e),t.alternate&&n(t.alternate,e)},MemberExpression:(t,e,n)=>{t.object&&n(t.object,e),t.property&&n(t.property,e)}}}return a.a(n,{key:i},Object.assign({ImportDeclaration:(t,e)=>{const n=t.source.value;l.push(n);const a=o[e.key];if(void 0===a)throw new Error("set should not be undefined");a.add(n+".__GLOBAL__");for(let a=0;a{const n=e+"."+(null===t.id?"__SPECIAL_DEFAULT_EXPORT__":t.id.name);a.a(t,{key:n},u())}},u())),{dependencyMap:o,additionalModules:l}}(t,e);h.add(e);for(let t=0;t0;){const t=d.shift();if(void 0===t)throw new Error("nextModule should not be undefined");if(t.startsWith("https://")||t.startsWith("http://"))continue;let n=null;const a=t.startsWith("./")?t.slice(2):t;for(const t of e)if(Object(s.b)(t.filename,a)){n=t;break}if(null==n)return{cost:i.a.ImportError};l(n.code,t)}let g=o.a.ScriptBaseRamCost;const y=[{type:"misc",name:"baseCost",cost:o.a.ScriptBaseRamCost}],b=Object.keys(m).filter(t=>t.startsWith(p)),E=new Set,v={};for(;b.length>0;){const e=b.shift();if(void 0===e)throw new Error("ref should not be undefined");if("hacknet"!==e||E.has("hacknet")||(g+=o.a.ScriptHacknetNodesRamCost,y.push({type:"ns",name:"hacknet",cost:o.a.ScriptHacknetNodesRamCost})),"document"!==e||E.has("document")||(g+=o.a.ScriptDomRamCost,y.push({type:"dom",name:"document",cost:o.a.ScriptDomRamCost})),"window"!==e||E.has("window")||(g+=o.a.ScriptDomRamCost,y.push({type:"dom",name:"window",cost:o.a.ScriptDomRamCost})),"corporation"!==e||E.has("corporation")||(g+=o.a.ScriptCorporationRamCost,y.push({type:"ns",name:"corporation",cost:o.a.ScriptCorporationRamCost})),E.add(e),e.endsWith(".*")){const t=e.slice(0,e.length-2);for(const e of Object.keys(m).filter(e=>e.startsWith(t)))for(const t of m[e]||[])E.has(t)||b.push(t)}else for(const t of m[e]||[])E.has(t)||b.push(t);try{var c,f;if(v[e])continue;v[e]=!0;const n=(t,e,a)=>{if(!e)return;const r=Object.entries(e).find(([t])=>t===a);if(void 0!==r&&("function"==typeof r[1]||"number"==typeof r[1]))return{func:r[1],refDetail:`${t}${a}`};for(const[t,r]of Object.entries(e)){const e=n(t+".",r,a);if(e)return e}},a=n("",o.b,e),r="number"==typeof(u=null!==(c=null==a?void 0:a.func)&&void 0!==c?c:0)?u:"function"==typeof u?u(t):0;g+=r,y.push({type:"fn",name:null!==(f=null==a?void 0:a.refDetail)&&void 0!==f?f:"",cost:r})}catch(t){console.log(t);continue}}return{cost:g,entries:y.filter(t=>t.cost>0)}}catch(t){return{cost:i.a.SyntaxError}}var u}function c(t){const e=Object(r.a)(t,{sourceType:"module",ecmaVersion:"latest"});let n=-1;return a.a(e,{},{WhileStatement:(e,r,i)=>{!function(t){return"Literal"===t.type&&"true"===t.raw}(e.test)||function(t){let e=!1;return a.a(t,{},{AwaitExpression:()=>{e=!0}}),e}(e)?e.body&&i(e.body,r):n=(t.slice(0,e.start).match(/\n/g)||[]).length+1}}),n}function f(t,e,n){try{return l(t,n,e)}catch(t){return console.error("Failed to parse script for RAM calculations:"),console.error(t),{cost:i.a.SyntaxError}}}},function(t,e,n){"use strict";function a(t){return+(Math.round(parseFloat(t+"e+2"))+"e-2")}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return o}));var a=n(204);let r=1;function i(){let t=r,e=!1;for(let n=0;n<1e6;){if(!a.a.has(t+n)){e=!0,t+=n;break}n===Number.MAX_SAFE_INTEGER-1?n=1:++n}return e?(r=t+1,r>=Number.MAX_SAFE_INTEGER&&(r=1),t):-1}function o(){r=1}},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var a=n(201),r=n(29),i=n(16),o=n(15),s=n(277),l=n(34),c=n(191),f=n(13),u=n(247),m=n(81),h=n(620),d=n(1067);class p{constructor(t="",e=!1){this.facName=t,this.members=[],this.wanted=1,this.respect=1,this.isHackingGang=e,this.respectGainRate=0,this.wantedGainRate=0,this.moneyGainRate=0,this.storedCycles=0,this.storedTerritoryAndPowerCycles=0,this.territoryClashChance=0,this.territoryWarfareEngaged=!1,this.notifyMemberDeath=!0}getPower(){return m.a[this.facName].power}getTerritory(){return m.a[this.facName].territory}process(t=1,e){const n=1e3/f.a._idleSpeed;if(isNaN(t)&&console.error("NaN passed into Gang.process(): "+t),this.storedCycles+=t,this.storedCycles<2*n)return;const a=Math.min(this.storedCycles,5*n);try{this.processGains(a,e),this.processExperienceGains(a),this.processTerritoryAndPowerGains(a),this.storedCycles-=a}catch(t){console.error("Exception caught when processing Gang: "+t)}}processGains(t=1,e){let n=0,o=0,s=0,l=0;for(let t=0;te&&(n=1),this.wanted=n,this.wanted<1&&(this.wanted=1)}e.gainMoney(n*t,"gang")}processTerritoryAndPowerGains(t=1){if(this.storedTerritoryAndPowerCycles+=t,this.storedTerritoryAndPowerCycles0&&(this.territoryClashChance=Math.max(0,this.territoryClashChance-.01));const n=c.a.Names.filter(t=>m.a[t].territory>0||t===e);if(n.length>1)for(let t=0;te!==n[t]),i=Object(l.a)(0,r.length-1),o=n[t],s=r[i];if(!(o!==e&&s!==e||Math.random()t.territory).reduce((t,e)=>t+e,0);Object.values(m.a).forEach(t=>t.territory/=u)}}processExperienceGains(t=1){for(let e=0;e=0;--t){const n=this.members[t];if("Territory Warfare"!==n.task)continue;const a=e/Math.pow(n.def,.6);Math.random()=c.a.MaximumGangMembers)&&this.respect>=this.getRespectNeededToRecruitMember()}getRespectNeededToRecruitMember(){if(this.members.length<3)return 0;const t=this.members.length-2;return Math.pow(5,t)}recruitMember(t){if(""===(t=String(t))||!this.canRecruitMember())return!1;if(this.members.filter(e=>e.name===t).length>=1)return!1;const e=new h.a(t);return this.members.push(e),!0}getWantedPenalty(){return this.respect/(this.respect+this.wanted)}calculatePower(){let t=0;for(let e=0;e"Ascended Gang member "+t.name),n}catch(t){throw null==e&&Object(s.a)(t),t}}getDiscount(){const t=this.getPower(),e=this.respect,n=Math.pow(e,.01)+e/5e6+Math.pow(t,.01)+t/1e6-1;return Math.max(1,n)}getAllTaskNames(){return Object.keys(u.a).filter(t=>{const e=u.a[t];return null!=e&&("Unassigned"!==e.name&&(this.isHackingGang===e.isHacking||!this.isHackingGang===e.isCombat))})}getUpgradeCost(t){return null==t?1/0:t.cost/this.getDiscount()}toJSON(){return Object(o.b)("Gang",this)}static fromJSON(t){return Object(o.a)(p,t.data)}}o.c.constructors.Gang=p},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(13);function r(t,e){return t/a.a.DonateMoneyToRepDivisor*e.mults.faction_rep}},,,,,,function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"a",(function(){return s}));var a=n(6),r=n(1322);let i;function o(){i&&i.stopConnection(),0!==a.a.RemoteFileApiPort&&(i=new r.a("localhost",a.a.RemoteFileApiPort),i.startConnection())}function s(){return i&&null!=i.connection&&1==i.connection.readyState}},function(t,e,n){"use strict";function a(t,e,n=!1){let a="";const r=t.jobStatReqOffset,i=e.requiredHacking>0?e.requiredHacking+r:0,o=e.requiredStrength>0?e.requiredStrength+r:0,s=e.requiredDefense>0?e.requiredDefense+r:0,l=e.requiredDexterity>0?e.requiredDexterity+r:0,c=e.requiredDexterity>0?e.requiredDexterity+r:0,f=e.requiredCharisma>0?e.requiredCharisma+r:0,u=e.requiredReputation;return n?(a="Requires:
",a+=i.toString()+" hacking
",a+=o.toString()+" strength
",a+=s.toString()+" defense
",a+=l.toString()+" dexterity
",a+=c.toString()+" agility
",a+=f.toString()+" charisma
",a+=u.toString()+" reputation"):(a="(Requires ",i>0&&(a+=i+" hacking, "),o>0&&(a+=o+" strength, "),s>0&&(a+=s+" defense, "),l>0&&(a+=l+" dexterity, "),c>0&&(a+=c+" agility, "),f>0&&(a+=f+" charisma, "),u>1&&(a+=u+" reputation, "),a=a.substring(0,a.length-2),a+=")"),a}n.d(e,"a",(function(){return a}))},function(t,e,n){"use strict";n.d(e,"b",(function(){return a})),n.d(e,"a",(function(){return i}));const a=["Type 'help name' to learn more about the command "," ",' alias [-g] [name="value"] Create or display Terminal aliases'," analyze Get information about the current machine "," backdoor Install a backdoor on the current machine "," buy [-l/-a/program] Purchase a program through the Dark Web"," cat [file] Display a .msg, .lit, or .txt file"," cd [dir] Change to a new directory"," check [script] [args...] Print a script's logs to Terminal"," clear Clear all text on the terminal "," cls See 'clear' command "," connect [hostname] Connects to a remote server"," cp [src] [dst] Copy a file"," download [script/text file] Downloads scripts or text files to your computer"," expr [math expression] Evaluate a mathematical expression"," free Check the machine's memory (RAM) usage"," grow Spoof money in a servers bank account, increasing the amount available."," hack Hack the current machine"," help [command] Display this help text, or the help text for a command"," history [-c] Display the terminal history"," home Connect to home computer"," hostname Displays the hostname of the machine"," kill [script/pid] [args...] Stops the specified script on the current server "," killall Stops all running scripts on the current machine"," ls [dir] [--grep pattern] Displays all files on the machine"," lscpu Displays the number of CPU cores on the machine"," mem [script] [-t n] Displays the amount of RAM required to run the script"," mv [src] [dest] Move/rename a text or script file"," nano [file ...] Text editor - Open up and edit one or more scripts or text files"," ps Display all scripts that are currently running"," rm [file] Delete a file from the server"," run [name] [-t n] [--tail] [args...] Execute a program or script"," scan Prints all immediately-available network connections"," scan-analyze [d] [-a] Prints info for all servers up to d nodes away"," scp [file ...] [server] Copies a file to a destination server"," sudov Shows whether you have root access on this computer"," tail [script] [args...] Displays dynamic logs for the specified script"," top Displays all running scripts and their RAM usage"," unalias [alias name] Deletes the specified alias"," vim [file ...] Text editor - Open up and edit one or more scripts or text files in vim mode"," weaken Reduce the security of the current machine"," wget [url] [target file] Retrieves code/text from a web server"," "],r=t=>[`Usage: ${t} [file ...] | [glob]`," ","Opens up the specified file(s) in the Script Editor. Only scripts (.js, or .script) or text files (.txt) ","can be edited using the Script Editor. If a file does not exist a new one will be created"," ",`If provided a glob as the only argument, ${t} can spider directories and open all matching `,`files at once. ${t} cannot create files using globs, so your scripts must already exist.`," ","Examples:"," ",` ${t} test.js`,` ${t} test.js test2.js`," ",` ${t} test.*`,` ${t} /my-dir/*.js`," "],i={alias:['Usage: alias [-g] [name="value"] '," ","Create or display aliases. An alias enables a replacement of a word with another string. ","It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME ","of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, ","you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: "," ",' alias nuke="run NUKE.exe"'," ","Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. ","It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For ","example, if the following alias was set: "," ",' alias worm="HTTPWorm.exe"'," ","and then you tried to run the following terminal command: "," "," run worm"," ","This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted ","anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: "," ",' alias -g worm="HTTPWorm.exe"'," ","Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. "," ","Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form ","'alias NAME=VALUE' on the Terminal. "," ","The 'unalias' command can be used to remove aliases."," "],analyze:["Usage: analyze"," ","Prints details and statistics about the current server. The information that is printed includes basic ","server details such as the hostname, whether the player has root access, what ports are opened/closed, and also ","hacking-related information such as an estimated chance to successfully hack, an estimate of how much money is ","available on the server, etc."," "],backdoor:["Usage: backdoor"," ","Install a backdoor on the current machine, grants a secret bonus depending on the machine."," ","Requires root access to run."," "],buy:["Usage: buy [-l / -a / program]"," ","Purchase a program through the Dark Web. Requires a TOR router to use."," ","If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the ","dark web to the Terminal, as well as their costs."," ","If this command is ran with the '-a' flag, it will attempt to purchase all unowned programs."," ","Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive."," "],cat:["Usage: cat [file]"," ","Display message (.msg), literature (.lit), or text (.txt) files. Examples:"," "," cat j1.msg"," "," cat foo.lit"," "," cat servers.txt"," "],cd:["Usage: cd [dir]"," ","Change to the specified directory. Note that this works even for directories that don't exist. If you ","change to a directory that does not exist, it will not be 'created'. Examples:"," "," cd scripts/hacking"," "," cd /logs"," "," cd ../"," "],check:["Usage: check [script name] [args...]"," ","Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by ","a space. Remember that a running script is uniquely ","identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: "," "," run foo.script 1 2 foodnstuff"," ","Then to run the 'check' command on this script you would have to pass the same arguments in: "," "," check foo.script 1 2 foodnstuff"," "],clear:["Usage: clear"," ","Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up ","and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'cls' command"," "],cls:["Usage: cls"," ","Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up ","and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'clear' command"," "],connect:["Usage: connect [hostname]"," ","Connect to a remote server. The hostname of the remote server must be given as the argument ","to this command. Note that only servers that are immediately adjacent to the current server in the network and the ones that have","a backdoor installed can be connected to. To see which servers can be connected to, use the 'scan' command."," "],cp:["Usage: cp [src] [dst]"," ","Copy a file on this server. To copy a file to another server use scp."," "],download:["Usage: download [script/text file]"," ","Downloads a script or text file to your computer (like your real life computer)."," ","You can also download all of your scripts/text files as a zip file using the following Terminal commands:"," ","Download all scripts and text files: download *"," ","Download all scripts: download *.script"," ","Download all text files: download *.txt"," "],expr:["Usage: expr [mathematical expression]"," ","Evaluate a simple mathematical expression. Supports native JavaScript operators:"," ","+, -, /, *, **, %"," ","Example:"," "," expr 25 * 2 ** 10"," ","Note that letters (non-digits) are not allowed and will be removed from the input."," "],free:["Usage: free"," ","Displays the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as ","how much of it is being used."," "],grow:["Usage: grow"," ","Spoof transactions in the current server. Increasing the money available by hacking. Requires root access.","See the wiki page for hacking mechanics."," "],hack:["Usage: hack"," ","Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics"," "],help:["Usage: help [command]"," ","Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief ","description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print ","more detailed information about the Terminal command. Examples: "," "," help alias"," "," help scan-analyze"," "],history:["Usage: history [-c]"," ","Without arguments, displays the terminal command history. To clear the history, pass in the '-c' argument."," "],home:["Usage: home"," ","Connect to your home computer. This will work no matter what server you are currently connected to."," "],hostname:["Usage: hostname"," ","Prints the hostname of the current server"," "],kill:["Usage: kill [script name] [args...] or kill [pid"," ","Kill the script specified by the script name and arguments OR by its PID."," ","If you are killing the script using its filename and arguments, then each ","argument must be separated by a space. Remember that a running script is ","uniquely identified by both its name and the arguments that are used to start ","it. So, if a script was ran with the following arguments:"," "," run foo.script 1 sigma-cosmetics"," ","Then to kill this script the same arguments would have to be used:"," "," kill foo.script 1 sigma-cosmetics"," ","If you are killing the script using its PID, then the PID argument must be numeric"," "],killall:["Usage: killall"," ","Kills all scripts on the current server. ","Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. ","This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. ","The script will not be stopped/killed until after that time has elapsed."," "],ls:["Usage: ls [dir] [-l] [--grep pattern]"," ","The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. ","The files will be displayed in alphabetical order. "," ","The 'dir' optional parameter can be used to display files/directories in another directory."," ","The '-l' optional parameter allows you to force each item onto a single line."," ","The '--grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern."," ","Examples:"," ","List all files with the '.script' extension in the current directory:"," "," ls -l --grep .script"," ","List all files with the '.js' extension in the root directory:"," "," ls / -l --grep .js"," ","List all files with the word 'purchase' in the filename, in the 'scripts' directory:"," "," ls scripts -l --grep purchase"," "],lscpu:["Usage: lscpu"," ","Prints the number of CPU Cores the current server has"," "],mem:["Usage: mem [script name] [-t num_threads]"," ","Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print ","the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then ","an argument for the number of threads must be passed in afterwards. Examples:"," "," mem foo.script"," "," mem foo.script -t 50"," ","The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example ","above will print the amount of RAM needed to run 'foo.script' with 50 threads."," "],mv:["Usage: mv [src] [dest]"," ","Move the source file to the specified destination. This can also be used to rename files. ","This command only works for scripts and text files (.txt). This command CANNOT be used to ","convert to different file types"," ","Note that, unlike the Linux 'mv' command, the destination argument must be the ","full filepath. ","Examples: "," "," mv hacking-controller.script scripts/hacking-controller.script"," "," mv myScript.js myOldScript.js"," "],nano:r("nano"),ps:["Usage: ps"," ","Prints all scripts that are running on the current server"," "],rm:["Usage: rm [file]"," ","Removes the specified file from the current server. A file can be a script, a program, or a message file. "," ","WARNING: This is permanent and cannot be undone"," "],run:["Usage: run [file name] [-t] [num threads] [args...]"," ","Execute a program, script or coding contract."," ","The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used ","to indicate that the script should be run with the specified number of threads. If the flag is omitted, ","then the script will be run with a single thread by default. ","If the '-t' flag is used, then it MUST come immediately ","after the script name, and the [num threads] argument MUST come immediately afterwards. "," ","[args...] represents a variable number of arguments that will be passed into the script. See the documentation ","about script arguments. Each specified argument must be separated by a space. "," "],scan:["Usage: scan"," ","Prints all immediately-available network connection. This will print a list of all servers that you can currently connect ","to using the 'connect' Terminal command."," "],"scan-analyze":["Usage: scan-analyze [depth] [-a]"," ","Prints detailed information about all servers up to [depth] nodes away on the network. Calling ","'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal ","command. This command also shows the relative paths to reach each server."," ","By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have ","the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to ","5 and 10, respectively."," ","The information 'scan-analyze' displays about each server includes whether or not you have root access to it, ","its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM ","it has."," ","By default, this command will not display servers that you have purchased. However, you can pass in the ","-a flag at the end of the command if you would like to enable that."," "],scp:["Usage: scp [filename ...] [target server]"," ","Copies the specified file(s) from the current server to the target server. ","This command only works for script files (.script or .js extension), literature files (.lit extension), ","and text files (.txt extension). ","The second argument passed in must be the hostname or IP of the target server. Examples:"," "," scp foo.script n00dles"," "," scp foo.script bar.script n00dles"," "],sudov:["Usage: sudov"," ","Prints whether or not you have root access to the current machine"," "],tail:["Usage: tail [script name] [args...]"," ","Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated ","by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used ","to run it. So, if a script was ran with the following arguments: "," "," run foo.script 10 50000"," ","Then in order to check its logs with 'tail' the same arguments must be used: "," "," tail foo.script 10 50000"," "],top:["Usage: top"," ","Prints a list of all scripts running on the current server as well as their thread count and how much ","RAM they are using in total."," "],unalias:["Usage: unalias [alias name]"," ","Deletes the specified alias. Note that the double quotation marks are required. "," ","As an example, if an alias was declared using:"," ",' alias r="run"'," ","Then it could be removed using:"," "," unalias r"," ","It is not necessary to differentiate between global and non-global aliases when using 'unalias'"," "],vim:r("vim"),weaken:["Usage: weaken"," ","Reduces the security level of the current server. Decreasing the time it takes for all operations on this server.","Requires root access. See the wiki page for hacking mechanics."," "],wget:["Usage: wget [url] [target file]"," ","Retrieves data from a URL and downloads it to a file on the current server. The data can only ","be downloaded to a script (.script or .js) or a text file (.txt). If the file already exists, ","it will be overwritten by this command."," ","Note that it will not be possible to download data from many websites because they do not allow ","cross-origin resource sharing (CORS). Example:"," "," wget https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md game_readme.txt"," "]}},function(t,e,n){"use strict";n.d(e,"b",(function(){return l})),n.d(e,"a",(function(){return c}));var a,r,i=n(27),o=n(256),s=n(13);!function(t){t[t.Production=0]="Production",t[t.Development=1]="Development"}(a||(a={})),function(t){t[t.Browser=0]="Browser",t[t.Steam=1]="Steam"}(r||(r={}));const l="https://github.com/danielyxie/bitburner/issues/new";function c(t,e,n){var c,f,u,m;const h=function(t,e,n){const i=navigator.userAgent.toLowerCase().indexOf(" electron/")>-1,l=a.Production,c={version:s.a.VersionString,hash:Object(o.a)(),toDisplay:()=>`v${s.a.VersionString} (${Object(o.a)()})`},f={userAgent:navigator.userAgent,language:navigator.language,cookiesEnabled:navigator.cookieEnabled,doNotTrack:navigator.doNotTrack,indexedDb:!!window.indexedDB};return{platform:i?r.Steam:r.Browser,environment:l,version:c,features:f,error:t,errorInfo:e,page:n}}(t,e,n),d=h.error.fileName,p=`lang=${h.features.language} cookiesEnabled=${h.features.cookiesEnabled.toString()} doNotTrack=${null!==(c=h.features.doNotTrack)&&void 0!==c?c:"null"} indexedDb=${h.features.indexedDb.toString()}`,g=`${h.error.name}: ${h.error.message}${h.page&&` (at "${i.a[h.page]}")`}`,y=`\n## ${g}\n\n### How did this happen?\n\nPlease fill this information with details if relevant.\n\n- [ ] Save file\n- [ ] Minimal scripts to reproduce the issue\n- [ ] Steps to reproduce\n\n### Environment\n\n* Error: ${null!==(f=null===(u=h.error)||void 0===u?void 0:u.toString())&&void 0!==f?f:"n/a"}\n* Page: ${h.page?i.a[h.page]:"n/a"}\n* Version: ${h.version.toDisplay()}\n* Environment: ${a[h.environment]}\n* Platform: ${r[h.platform]}\n* UserAgent: ${navigator.userAgent}\n* Features: ${p}\n* Source: ${null!=d?d:"n/a"}\n\n${h.environment===a.Development?`\n### Stack Trace\n\`\`\`\n${null===(m=h.errorInfo)||void 0===m?void 0:m.componentStack.toString().trim()}\n\`\`\`\n`:""}\n### Save\n\`\`\`\nCopy your save here if possible\n\`\`\`\n`.trim();return{metadata:h,fileName:d,features:p,title:g,body:y,issueUrl:`${l}?title=${encodeURIComponent(g)}&body=${encodeURIComponent(y)}`}}},,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(34);function r(t){const e=Math.max(Math.min(t,255),0);return Object(a.a)(0,e)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(34);const r={Tracking:()=>Object(a.a)(5,75)/10,"Bounty Hunter":()=>Object(a.a)(5,75)/10,Retirement:()=>Object(a.a)(5,75)/10,Investigation:()=>Object(a.a)(10,40)/10,"Undercover Operation":()=>Object(a.a)(10,40)/10,"Sting Operation":()=>Object(a.a)(3,40)/10,Raid:()=>Object(a.a)(2,40)/10,"Stealth Retirement Operation":()=>Object(a.a)(1,20)/10,Assassination:()=>Object(a.a)(1,20)/10}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(155);function r(t){const e={},n=Object.keys(a.a);for(let a=0;a=this.cards.length)throw new Error("Tried to remove invalid card from Hand by index: "+t);return new a([...this.cards.slice().splice(t,1)])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var a=n(0),r=n(3),i=n(21),o=n(9);function s(t){return a.createElement(i.a,{title:null!=t.tooltip?a.createElement(r.a,null,t.tooltip):""},a.createElement(o.a,{onClick:t.onClick},t.text))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var a=n(20),r=n(161),i=n(0),o=n(1425),s=n(678),l=n(104);function c(t){const e=new o.a(t.width,t.height,t.fragments),n=Object(l.d)(t.width,t.height);return i.createElement(a.a,null,i.createElement(r.a,{sx:{width:t.width,height:t.height}},i.createElement(s.a,{width:t.width,height:t.height,ghostGrid:n,gift:e,enter:()=>{},click:()=>{}})))}},,,,,,,,,,,,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var a=n(116),r=n(258),i=n(77),o=n(231),s=n(96),l=n(350),c=n(426);function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}class u{constructor(t={hostname:"",ip:Object(l.a)()}){f(this,"contracts",[]),f(this,"cpuCores",1),f(this,"ftpPortOpen",!1),f(this,"hasAdminRights",!1),f(this,"hostname",""),f(this,"httpPortOpen",!1),f(this,"ip",""),f(this,"isConnectedTo",!1),f(this,"maxRam",0),f(this,"messages",[]),f(this,"organizationName",""),f(this,"programs",[]),f(this,"ramUsed",0),f(this,"runningScripts",[]),f(this,"scripts",[]),f(this,"serversOnNetwork",[]),f(this,"smtpPortOpen",!1),f(this,"sqlPortOpen",!1),f(this,"sshPortOpen",!1),f(this,"textFiles",[]),f(this,"purchasedByPlayer",!1),this.ip=t.ip?t.ip:Object(l.a)(),this.hostname=t.hostname,this.organizationName=null!=t.organizationName?t.organizationName:"",this.isConnectedTo=null!=t.isConnectedTo&&t.isConnectedTo,this.hasAdminRights=null!=t.adminRights&&t.adminRights}addContract(t){this.contracts.push(t)}getContract(t){for(const e of this.contracts)if(e.fn===t)return e;return null}getRunningScript(t,e){for(const n of this.runningScripts)if(n.filename===t&&Object(c.a)(n.args,e))return n;return null}getScript(t){for(let e=0;ee.fn!==t.fn):this.contracts=this.contracts.filter(e=>e.fn!==t)}removeFile(t){if(t.endsWith(".exe")||null!=t.match(/^.+\.exe-\d+(?:\.\d*)?%-INC$/)){for(let e=0;ee.startsWith(t));e>-1&&this.programs.splice(e,1),this.programs.push(t)}writeToScriptFile(t,e,n){const a={success:!1,overwritten:!1};if(!Object(i.j)(e)||!Object(s.a)(e))return a;for(let r=0;r{h.subscribe(t=>e(t))}),null===t)return r.a.createElement(r.a.Fragment,null);function d(){null!==t&&(t.onClose(),e(null))}const p=o.d[t.c.type],g=[];for(const[e,n]of p.desc(t.c.data).split("\n").entries())g.push(r.a.createElement("span",{key:e,dangerouslySetInnerHTML:{__html:n+"
"}}));return r.a.createElement(l.a,{open:null!==t,onClose:d},r.a.createElement(s.a,{variant:"h4",value:t.c.type}),r.a.createElement(f.a,null,"You are attempting to solve a Coding Contract. You have ",t.c.getMaxNumTries()-t.c.tries," tries remaining, after which the contract will self-destruct."),r.a.createElement("br",null),r.a.createElement(f.a,null,g),r.a.createElement("br",null),r.a.createElement(u.a,{autoFocus:!0,placeholder:"Enter Solution here",value:n,onChange:function(t){c(t.target.value)},onKeyDown:function(e){if(null===t)return;const a=e.target.value;e.key===i.a.ENTER&&""!==a&&(e.preventDefault(),t.onAttempt(n),c(""),d())},InputProps:{endAdornment:r.a.createElement(m.a,{onClick:()=>{t.onAttempt(n),c(""),d()}},"Solve")}}))}},,,,,,,,,,,,,,function(t,e,n){"use strict";n.d(e,"a",(function(){return f})),n.d(e,"b",(function(){return u}));var a=n(0),r=n.n(a),i=n(39),o=n(26),s=n(127),l=n(3),c=n(9);const f=new s.a;function u(){const t=o.b.Router(),[e,n]=Object(a.useState)(!1);return Object(a.useEffect)(()=>f.subscribe(()=>n(!0)),[]),r.a.createElement(i.a,{open:e,onClose:()=>n(!1)},r.a.createElement(l.a,null,"WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.",r.a.createElement("br",null),r.a.createElement("br",null),"Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one."),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement(c.a,{onClick:function(){t.toBitVerse(!0,!1),n(!1)}},"Travel to the BitVerse"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return E}));var a=n(798),r=n(715),i=n(716),o=n(414),s=n(61),l=n(461),c=n(717),f=n(10),u=n(395),m=n(17),h=n(405),d=n(15),p=n(28),g=n(34),y=n(13),b=n(213);class E{constructor(){this.hp={current:10,max:10},this.skills={hacking:1,strength:1,defense:1,dexterity:1,agility:1,charisma:1,intelligence:0},this.exp={hacking:0,strength:0,defense:0,dexterity:0,agility:0,charisma:0,intelligence:0},this.mults=Object(b.a)(),this.money=1e3+y.a.Donations,this.city=m.a.Sector12,this.location=f.a.TravelAgency,this.jobs={},this.currentServer="",this.purchasedServers=[],this.hacknetNodes=[],this.hashManager=new u.a,this.factions=[],this.factionInvitations=[],this.queuedAugmentations=[],this.augmentations=[],this.sourceFiles=[],this.numPeopleKilled=0,this.karma=0,this.hasWseAccount=!1,this.hasTixApiAccess=!1,this.has4SData=!1,this.has4SDataTixApi=!1,this.gang=null,this.corporation=null,this.bladeburner=null,this.sleeves=[],this.sleevesFromCovenant=0,this.bitNodeN=1,this.entropy=0,this.lastUpdate=0,this.lastSave=0,this.totalPlaytime=0,this.playtimeSinceLastAug=0,this.playtimeSinceLastBitnode=0,this.moneySourceA=new h.a,this.moneySourceB=new h.a,this.scriptProdSinceLastAug=0,this.exploits=[],this.achievements=[],this.terminalCommandHistory=[],this.focus=!1,this.currentWork=null,this.identifier=Object(p.c)("I-"+(new Date).getTime()+navigator.userAgent+window.innerWidth+window.innerHeight+Object(g.a)(100,999)),this.init=s.O,this.prestigeAugmentation=s.R,this.prestigeSourceFile=s.S,this.receiveInvite=s.Y,this.calculateSkill=s.o,this.calculateSkillProgress=s.p,this.updateSkillLevels=s.jb,this.resetMultipliers=s.bb,this.hasProgram=s.M,this.setMoney=s.db,this.gainMoney=s.C,this.loseMoney=s.Q,this.canAfford=s.s,this.recordMoneySource=s.Z,this.gainHackingExp=s.A,this.gainStrengthExp=s.E,this.gainDefenseExp=s.y,this.gainDexterityExp=s.z,this.gainAgilityExp=s.v,this.gainCharismaExp=s.w,this.gainIntelligenceExp=s.B,this.gainStats=s.D,this.queryStatFromString=s.T,this.startWork=c.c,this.processWork=c.b,this.finishWork=c.a,this.startFocusing=s.fb,this.stopFocusing=s.gb,this.takeDamage=s.hb,this.regenerateHp=s.ab,this.hospitalize=s.N,this.applyForJob=s.f,this.getNextCompanyPosition=s.H,this.quitJob=s.V,this.hasJob=s.L,this.applyForSoftwareJob=s.m,this.applyForSoftwareConsultantJob=s.l,this.applyForItJob=s.e,this.applyForSecurityEngineerJob=s.j,this.applyForNetworkEngineerJob=s.g,this.applyForBusinessJob=s.c,this.applyForBusinessConsultantJob=s.b,this.applyForSecurityJob=s.k,this.applyForAgentJob=s.a,this.applyForEmployeeJob=s.d,this.applyForPartTimeEmployeeJob=s.h,this.applyForWaiterJob=s.n,this.applyForPartTimeWaiterJob=s.i,this.isQualified=s.P,this.reapplyAllAugmentations=s.W,this.reapplyAllSourceFiles=s.X,this.checkForFactionInvitations=s.t,this.setBitNodeNumber=s.cb,this.queueAugmentation=s.U,this.gainCodingContractReward=s.x,this.travel=s.ib,this.gotoLocation=s.K,this.canAccessGrafting=s.r,this.giveExploit=s.J,this.giveAchievement=s.I,this.getIntelligenceBonus=s.G,this.getCasinoWinnings=s.F,this.hasAugmentation=a.b,this.canAccessBladeburner=r.a,this.inBladeburner=r.b,this.startBladeburner=r.c,this.canAccessCorporation=i.a,this.hasCorporation=i.b,this.startCorporation=i.c,this.canAccessGang=o.a,this.isAwareOfGang=o.f,this.getGangFaction=o.b,this.getGangName=o.c,this.hasGangWith=o.d,this.inGang=o.e,this.startGang=o.g,this.hasTorRouter=l.f,this.getCurrentServer=l.b,this.getHomeComputer=l.c,this.getUpgradeHomeRamCost=l.e,this.getUpgradeHomeCoresCost=l.d,this.createHacknetServer=l.a,this.canAccessCotMG=s.q,this.sourceFileLvl=s.eb,this.applyEntropy=a.a,this.focusPenalty=s.u}whoAmI(){return"Player"}toJSON(){return Object(d.b)("PlayerObject",this)}static fromJSON(t){return Object(d.a)(E,t.data)}}d.c.constructors.PlayerObject=E},function(t,e,n){"use strict";n.d(e,"a",(function(){return u})),n.d(e,"b",(function(){return m}));var a=n(0),r=n.n(a),i=n(105),o=n(39),s=n(26),l=n(127),c=n(3),f=n(9);const u=new l.a;function m(){const[t,e]=Object(a.useState)(null),n=s.b.Player();return Object(a.useEffect)(()=>u.subscribe(t=>e(t)),[]),r.a.createElement(o.a,{open:null!==t,onClose:()=>e(null)},r.a.createElement(c.a,{variant:"h4"},"You have received a faction invitation."),r.a.createElement(c.a,null,"Would you like to join ",(t||{name:""}).name,"? ",r.a.createElement("br",null),r.a.createElement("br",null),"Warning: Joining this faction may prevent you from joining other factions during this run!"),r.a.createElement(f.a,{onClick:function(){if(null===t)return;-1===n.factionInvitations.findIndex(e=>e===t.name)&&console.error("Could not find faction in Player.factionInvitations"),Object(i.d)(t),e(null)}},"Join!"),r.a.createElement(f.a,{onClick:()=>e(null)},"Decide later"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var a=n(259),r=function(t,e,n=0){this.sourceCode=t,this.sourceCodeLineOffset=n,"string"==typeof t&&(t=a.a(t,r.PARSE_OPTIONS)),this.ast=t,this.initFunc_=e,this.paused_=!1,this.polyfills_=[],this.functionCounter_=0,this.stepFunctions_=Object.create(null);var i,o,s=/^step([A-Z]\w*)$/;for(var l in this)"function"==typeof this[l]&&(i=l.match(s))&&(this.stepFunctions_[i[1]]=this[l].bind(this));this.global=this.createScope(this.ast,null),this.ast=a.a(this.polyfills_.join("\n"),r.PARSE_OPTIONS),this.polyfills_=void 0,this.stripLocations_(this.ast,void 0,void 0),(o=new r.State(this.ast,this.global)).done=!1,this.stateStack=[o],this.run(),this.value=void 0,this.ast=t,(o=new r.State(this.ast,this.global)).done=!1,this.stateStack.length=0,this.stateStack[0]=o,this.nodeConstructor=o.node.constructor,this.stateStack=this.stateStack}; /** * @license * JavaScript Interpreter diff --git a/dist/main.bundle.js.map b/dist/main.bundle.js.map index fb7b30e18..55897fdf3 100644 --- a/dist/main.bundle.js.map +++ b/dist/main.bundle.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/Player.ts","webpack:///./src/Netscript/NetscriptHelpers.ts","webpack:///./src/Faction/data/FactionNames.ts","webpack:///./src/Settings/Settings.ts","webpack:///./src/ui/numeralFormat.ts","webpack:///./src/Locations/data/LocationNames.ts","webpack:///./src/Augmentation/data/AugmentationNames.ts","webpack:///./src/Constants.ts","webpack:///./src/utils/JSONReviver.ts","webpack:///./src/ui/React/DialogBox.tsx","webpack:///./src/Locations/data/CityNames.ts","webpack:///./src/BitNode/BitNodeMultipliers.ts","webpack:///./src/ui/React/Money.tsx","webpack:///./src/Server/AllServers.ts","webpack:///./src/ui/Context.ts","webpack:///./src/ui/Router.ts","webpack:///./src/utils/StringHelperFunctions.ts","webpack:///./src/Faction/Factions.ts","webpack:///./src/utils/helpers/keyCodes.ts","webpack:///./src/Company/data/companypositionnames.ts","webpack:///./src/utils/helpers/getRandomInt.ts","webpack:///./src/Corporation/data/Constants.ts","webpack:///./src/Augmentation/Augmentation.tsx","webpack:///./src/ui/React/Modal.tsx","webpack:///./src/Hacknet/data/Constants.ts","webpack:///./src/Corporation/EmployeePositions.ts","webpack:///./src/Bladeburner/data/ActionTypes.ts","webpack:///./src/InteractiveTutorial.ts","webpack:///./src/Server/Server.ts","webpack:///./src/Corporation/ui/Context.ts","webpack:///./src/Corporation/IndustryData.tsx","webpack:///./src/Locations/LocationTypeEnum.ts","webpack:///./src/Work/ClassWork.tsx","webpack:///./src/Hacknet/HacknetHelpers.tsx","webpack:///./src/Corporation/Actions.ts","webpack:///./src/Bladeburner/data/BlackOperationNames.ts","webpack:///./src/PersonObjects/Player/PlayerObjectGeneralMethods.ts","webpack:///./src/Bladeburner/data/Constants.ts","webpack:///./src/Programs/Programs.ts","webpack:///./src/CotMG/FragmentType.ts","webpack:///./src/Literature/data/LiteratureNames.ts","webpack:///./src/ui/React/StatsRow.tsx","webpack:///./src/Augmentation/StaticAugmentations.ts","webpack:///./src/StockMarket/data/PositionTypes.ts","webpack:///./src/ui/React/Table.tsx","webpack:///./src/Terminal/DirectoryHelpers.ts","webpack:///./src/Company/Companies.ts","webpack:///./src/Gang/AllGangs.ts","webpack:///./src/Terminal.ts","webpack:///./src/ui/React/Snackbar.tsx","webpack:///./src/Crime/Crimes.ts","webpack:///./src/Casino/utils.ts","webpack:///./src/Server/data/SpecialServers.ts","webpack:///./src/Work/WorkStats.ts","webpack:///./src/ui/GameRoot.tsx","webpack:///./src/Hacknet/HacknetServer.ts","webpack:///./src/Script/isScriptFilename.ts","webpack:///./src/StockMarket/StockMarket.tsx","webpack:///./src/StockMarket/data/StockSymbols.ts","webpack:///./src/Hacking.ts","webpack:///./src/PersonObjects/Sleeve/Work/Work.ts","webpack:///./src/CotMG/Helper.tsx","webpack:///./src/Faction/FactionHelpers.tsx","webpack:///./src/SaveObject.tsx","webpack:///./src/Company/CompanyPositions.ts","webpack:///./src/Work/data/FactionWorkType.ts","webpack:///./src/Exploits/Exploit.ts","webpack:///./src/Augmentation/AugmentationHelpers.tsx","webpack:///./src/ui/React/MoneyRate.tsx","webpack:///./src/CodingContracts.ts","webpack:///./src/StockMarket/data/OrderTypes.ts","webpack:///./src/CotMG/Fragment.ts","webpack:///./src/ScriptEditor/ui/themes.ts","webpack:///./src/utils/EventEmitter.ts","webpack:///./src/DevMenu/ui/Adjuster.tsx","webpack:///./src/Infiltration/utils.ts","webpack:///./src/Bladeburner/BlackOperation.ts","webpack:///./src/utils/WorkType.ts","webpack:///./src/Corporation/data/BaseResearchTree.ts","webpack:///./src/Server/ServerHelpers.ts","webpack:///./src/Corporation/ui/MoneyCost.tsx","webpack:///./src/ui/React/OptionSwitch.tsx","webpack:///./src/Bladeburner/data/SkillNames.ts","webpack:///./src/ui/React/Reputation.tsx","webpack:///./src/Gang/ui/Context.ts","webpack:///./src/Netscript/killWorkerScript.ts","webpack:///./src/BitNode/BitNode.tsx","webpack:///./src/Work/Work.ts","webpack:///./src/StockMarket/Stock.ts","webpack:///./src/Locations/Cities.ts","webpack:///./src/Hacknet/formulas/HacknetServers.ts","webpack:///./src/utils/helpers/isString.ts","webpack:///./src/Alias.ts","webpack:///./src/Locations/Locations.ts","webpack:///./src/ui/React/LogBoxManager.tsx","webpack:///./src/Netscript/ScriptDeath.ts","webpack:///./src/Literature/Literature.ts","webpack:///./src/ui/React/CopyableText.tsx","webpack:///./src/Themes/ui/Theme.tsx","webpack:///./src/Settings/SettingEnums.ts","webpack:///./src/Corporation/MaterialSizes.ts","webpack:///./src/PersonObjects/formulas/skill.ts","webpack:///./src/Gang/data/upgrades.ts","webpack:///./src/NetscriptWorker.ts","webpack:///./src/Gang/data/Constants.ts","webpack:///./src/StockMarket/BuyingAndSelling.tsx","webpack:///./src/Faction/Faction.ts","webpack:///./src/Netscript/WorkerScripts.ts","webpack:///./src/Corporation/Material.ts","webpack:///./src/Gang/formulas/formulas.ts","webpack:///./src/RemoteFileAPI/MessageDefinitions.ts","webpack:///./src/Infiltration/ui/GameTimer.tsx","webpack:///./src/PersonObjects/Multipliers.ts","webpack:///./src/Bladeburner/Bladeburner.tsx","webpack:///./src/Hacknet/formulas/HacknetNodes.ts","webpack:///./src/Casino/Game.tsx","webpack:///./src/CotMG/data/Shapes.ts","webpack:///./src/Infiltration/ui/Difficulty.ts","webpack:///./src/Infiltration/ui/KeyHandler.tsx","webpack:///./src/Work/FactionWork.tsx","webpack:///./src/ui/React/Hashes.tsx","webpack:///./src/Hacknet/HacknetNode.ts","webpack:///./src/Server/ServerPurchases.ts","webpack:///./src/TextFile.ts","webpack:///./src/PersonObjects/formulas/reputation.ts","webpack:///./src/Netscript/RamCostGenerator.ts","webpack:///./src/Bladeburner/Skills.ts","webpack:///./src/StockMarket/StockMarketHelpers.ts","webpack:///./src/Gang/GangMemberUpgrades.ts","webpack:///./src/StockMarket/StockMarketCosts.ts","webpack:///./src/ui/React/NumberInput.tsx","webpack:///./src/Hacknet/HashUpgrades.ts","webpack:///./src/Gang/GangMemberTasks.ts","webpack:///./src/Corporation/Warehouse.ts","webpack:///./src/Terminal/ITerminal.tsx","webpack:///./src/Bladeburner/Skill.ts","webpack:///./src/ui/React/ConfirmationModal.tsx","webpack:///./src/utils/helpers/createProgressBarText.ts","webpack:///./src/hash/hash.ts","webpack:///./src/Work/formulas/Class.ts","webpack:///./src/Script/Script.ts","webpack:///./src/ui/React/StatsTable.tsx","webpack:///./src/DarkWeb/DarkWebItems.ts","webpack:///./src/Bladeburner/GeneralActions.tsx","webpack:///./src/Casino/CardDeck/Card.ts","webpack:///./src/Bladeburner/ActionIdentifier.ts","webpack:///./src/SourceFile/SourceFile.ts","webpack:///./src/Script/ScriptHelpers.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveCompanyWork.ts","webpack:///./src/Achievements/Achievements.ts","webpack:///./src/PersonObjects/formulas/intelligence.ts","webpack:///./src/Company/Company.ts","webpack:///./src/utils/helpers/arrayToString.ts","webpack:///./src/MathJaxWrapper.tsx","webpack:///./src/utils/helpers/exceptionAlert.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveBladeburnerWork.ts","webpack:///./src/Corporation/data/CorporationUnlockUpgrades.ts","webpack:///./src/PersonObjects/Grafting/GraftingHelpers.ts","webpack:///./src/Bladeburner/BlackOperations.tsx","webpack:///./src/CotMG/ActiveFragment.ts","webpack:///./src/GameOptions/GameOptionsTab.ts","webpack:///./src/Crime/Crime.ts","webpack:///./src/ui/React/HashRate.tsx","webpack:///./src/Message/Message.ts","webpack:///./src/Locations/ui/ApplyToJobButton.tsx","webpack:///./src/Corporation/ResearchMap.ts","webpack:///./src/Netscript/WorkerScriptStartStopEventEmitter.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveFactionWork.ts","webpack:///./src/Electron.tsx","webpack:///./src/Work/CreateProgramWork.ts","webpack:///./src/ui/React/CharacterOverview.tsx","webpack:///./src/utils/helpers/addOffset.ts","webpack:///./src/DarkWeb/DarkWebItem.ts","webpack:///./src/Augmentation/PlayerOwnedAugmentation.ts","webpack:///./src/Casino/RNG.ts","webpack:///./src/Work/CompanyWork.tsx","webpack:///./src/GameOptions/ui/GameOptionsPage.tsx","webpack:///./src/ui/React/Favor.tsx","webpack:///./src/Terminal/TerminalEvents.ts","webpack:///./src/StockMarket/OrderProcessing.tsx","webpack:///./src/Themes/Themes.ts","webpack:///./src/ui/React/AlertManager.tsx","webpack:///./src/utils/IPAddress.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveSupportWork.ts","webpack:///./src/Netscript/RecentScripts.ts","webpack:///./src/db.tsx","webpack:///./src/Message/MessageHelpers.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveClassWork.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveCrimeWork.ts","webpack:///./src/utils/helpers/formatTime.ts","webpack:///./src/Faction/formulas/favor.ts","webpack:///./src/CodingContractGenerator.ts","webpack:///./src/ExportBonus.tsx","webpack:///./src/ui/React/ReputationRate.tsx","webpack:///./src/Faction/ui/Option.tsx","webpack:///./src/Bladeburner/Operation.ts","webpack:///./src/Augmentation/data/AugmentationCreator.tsx","webpack:///./src/Server/data/servers.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveInfiltrateWork.ts","webpack:///./src/Company/CompanyPosition.ts","webpack:///./src/StockMarket/PlayerInfluencing.ts","webpack:///./src/utils/helpers/checkEnum.ts","webpack:///./src/SourceFile/SourceFiles.tsx","webpack:///./src/Bladeburner/ui/StartButton.tsx","webpack:///./src/ui/React/CorruptableText.tsx","webpack:///./src/Work/GraftingWork.tsx","webpack:///./src/Faction/FactionInfo.tsx","webpack:///./src/Work/formulas/Faction.ts","webpack:///./src/Hacknet/HashManager.ts","webpack:///./src/ui/InteractiveTutorial/ITutorialEvents.ts","webpack:///./src/Crime/CrimeHelpers.ts","webpack:///./src/Corporation/OfficeSpace.ts","webpack:///./src/Corporation/data/CorporationUpgrades.ts","webpack:///./src/PersonObjects/Grafting/GraftableAugmentation.ts","webpack:///./src/ui/React/Progress.tsx","webpack:///./src/utils/Validator.ts","webpack:///./src/Infiltration/formulas/victory.ts","webpack:///./src/utils/MoneySourceTracker.ts","webpack:///./src/utils/CompressionContracts.ts","webpack:///./src/ui/React/StatsProgressBar.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectGangMethods.ts","webpack:///./src/Themes/Styles.ts","webpack:///./src/utils/helpers/compareArrays.ts","webpack:///./src/Hospital/Hospital.ts","webpack:///./src/Hacking/netscriptCanHack.ts","webpack:///./src/ui/React/PromptManager.tsx","webpack:///./src/Corporation/Product.ts","webpack:///./src/Corporation/ui/Helpers.tsx","webpack:///./src/Programs/ui/ProgramsRoot.tsx","webpack:///./src/Faction/ui/FactionsRoot.tsx","webpack:///./src/RedPill.tsx","webpack:///./src/ui/React/RecoveryRoot.tsx","webpack:///./src/Script/RamCalculationErrorCodes.ts","webpack:///./src/NetworkShare/Share.tsx","webpack:///./src/Netscript/WorkerScript.ts","webpack:///./src/PersonObjects/Sleeve/Sleeve.ts","webpack:///./src/Corporation/Corporation.tsx","webpack:///./src/Bladeburner/City.ts","webpack:///./src/Locations/City.ts","webpack:///./src/GameOptions/ui/OptionsSlider.tsx","webpack:///./src/StockMarket/ui/StockTickersConfig.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectServerMethods.ts","webpack:///./src/Prestige.ts","webpack:///./src/Bladeburner/Action.tsx","webpack:///./src/Gang/GangMemberTask.ts","webpack:///./src/Work/CrimeWork.ts","webpack:///./src/ui/Apr1.tsx","webpack:///./src/ui/React/WorldMap.tsx","webpack:///./src/Bladeburner/ui/SuccessChance.tsx","webpack:///./src/ui/React/StaticModal.tsx","webpack:///./src/PersonObjects/Sleeve/Work/SleeveRecoveryWork.ts","webpack:///./src/PersonObjects/Sleeve/Work/SleeveSynchroWork.ts","webpack:///./src/Script/RunningScript.ts","webpack:///./src/Literature/LiteratureHelpers.ts","webpack:///./src/DarkWeb/DarkWeb.tsx","webpack:///./src/Infiltration/formulas/game.ts","webpack:///./src/Terminal/Parser.ts","webpack:///./src/ui/React/CinematicText.tsx","webpack:///./src/PersonObjects/Sleeve/SleeveCovenantPurchases.tsx","webpack:///./src/Script/RamCalculations.ts","webpack:///./src/utils/helpers/roundToTwo.ts","webpack:///./src/Netscript/Pid.ts","webpack:///./src/Gang/Gang.ts","webpack:///./src/Faction/formulas/donation.ts","webpack:///./src/RemoteFileAPI/RemoteFileAPI.ts","webpack:///./src/Company/GetJobRequirementText.ts","webpack:///./src/Terminal/HelpText.ts","webpack:///./src/utils/ErrorHelper.ts","webpack:///./src/utils/helpers/getRandomByte.ts","webpack:///./src/Bladeburner/data/Growths.ts","webpack:///./src/Locations/createCityMap.ts","webpack:///./src/Casino/CardDeck/Hand.ts","webpack:///./src/StockMarket/ui/StockTickerTxButton.tsx","webpack:///./src/CotMG/ui/DummyGrid.tsx","webpack:///./src/Server/BaseServer.ts","webpack:///./src/ui/React/CodingContractModal.tsx","webpack:///./src/BitNode/ui/BitFlumeModal.tsx","webpack:///./src/PersonObjects/Player/PlayerObject.ts","webpack:///./src/Faction/ui/InvitationModal.tsx","webpack:///./src/ThirdParty/JSInterpreter.js","webpack:///./src/NetscriptFunctions.ts","webpack:///./src/Server/formulas/grow.ts","webpack:///./src/Gang/GangMember.ts","webpack:///./src/NetscriptFunctions/toNative.ts","webpack:///./src/ui/React/ANSIITypography.tsx","webpack:///./src/PersonObjects/Sleeve/SleeveHelpers.ts","webpack:///./src/Work/formulas/Crime.ts","webpack:///./src/Bladeburner/data/GeneralActions.tsx","webpack:///./src/Work/formulas/Company.ts","webpack:///./src/CotMG/StaneksGiftEvents.ts","webpack:///./src/Locations/data/LocationsMetadata.ts","webpack:///./src/Terminal/commands/download.ts","webpack:///./src/utils/V2Modal.tsx","webpack:///./src/SourceFile/PlayerOwnedSourceFile.ts","webpack:///./src/Bladeburner/data/Icons.tsx","webpack:///./src/Bladeburner/ui/ActionLevel.tsx","webpack:///./src/Bladeburner/ui/Autolevel.tsx","webpack:///./src/Bladeburner/ui/TeamSizeButton.tsx","webpack:///./src/PersonObjects/Grafting/ui/GraftingRoot.tsx","webpack:///./src/Infiltration/ui/BlinkingCursor.tsx","webpack:///./src/Themes/ui/StyleEditorButton.tsx","webpack:///./src/Themes/ui/ThemeEditorButton.tsx","webpack:///./src/Themes/ui/ThemeCollaborate.tsx","webpack:///./src/ui/React/DeleteGameButton.tsx","webpack:///./src/ui/React/SoftResetButton.tsx","webpack:///./src/ScriptEditor/NetscriptDefinitions.d.ts","webpack:///./src/Augmentation/ui/PurchasableAugmentations.tsx","webpack:///./src/Locations/ui/TravelAgencyRoot.tsx","webpack:///./src/ScriptEditor/ui/ScriptEditorRoot.tsx","webpack:///./src/Terminal/DirectoryServerHelpers.ts","webpack:///./src/NetscriptJSEvaluator.ts","webpack:///./src/NetscriptFunctions/Flags.ts","webpack:///./src/ui/React/TablePaginationActionsAll.tsx","webpack:///./src/BitNode/ui/BitnodeMultipliersDescription.tsx","webpack:///./src/CotMG/ui/Cell.tsx","webpack:///./src/CotMG/ui/Grid.tsx","webpack:///./src/Script/RunningScriptHelpers.ts","webpack:///./src/Terminal/commands/common/editor.ts","webpack:///./src/utils/HammingCodeTools.ts","webpack:///./src/Bladeburner/Contract.ts","webpack:///./src/Bladeburner/data/Help.ts","webpack:///./src/Corporation/ResearchTree.ts","webpack:///./src/StockMarket/StockMarketConstants.ts","webpack:///./src/CotMG/data/Constants.ts","webpack:///./src/utils/v1APIBreak.ts","webpack:///./src/Company/GetNextCompanyPosition.ts","webpack:///./src/PersonObjects/Player/PlayerObjectBladeburnerMethods.ts","webpack:///./src/PersonObjects/Player/PlayerObjectCorporationMethods.ts","webpack:///./src/PersonObjects/Player/PlayerObjectWorkMethods.ts","webpack:///./src/engine.tsx","webpack:///./src/Themes/data/index.ts","webpack:///./src/ui/LoadingScreen.tsx","webpack:///./src/PersonObjects/Player/PlayerObjectAugmentationMethods.ts","webpack:///./src/utils/helpers/isValidNumber.ts","webpack:///./src/StockMarket/Order.ts","webpack:///./src/CotMG/StaneksGift.ts","webpack:///./src/Locations/Location.ts","webpack:///./src/RemoteFileAPI/MessageHandlers.ts","webpack:///./src/PersonObjects/Sleeve/ui/StatsElement.tsx","webpack:///./src/ui/React/ServerDropdown.tsx","webpack:///./src/Casino/Blackjack.tsx","webpack:///./src/Casino/CardDeck/ReactCard.tsx","webpack:///./src/Milestones/Milestones.ts","webpack:///./src/StockMarket/data/TickerHeaderFormatData.ts","webpack:///./src/Achievements/AchievementEntry.tsx","webpack:///./src/ThirdParty/colorUtils.ts","webpack:///./src/Themes/data/default/index.ts","webpack:///./src/Themes/data/default-lite/index.ts","webpack:///./src/Themes/data/monokai-ish/index.ts","webpack:///./src/Themes/data/warmer/index.ts","webpack:///./src/Themes/data/dark-plus/index.ts","webpack:///./src/Themes/data/mayukai-dark/index.ts","webpack:///./src/Themes/data/purple/index.ts","webpack:///./src/Themes/data/smooth-green/index.ts","webpack:///./src/Themes/data/dracula/index.ts","webpack:///./src/Themes/data/dark-blue/index.ts","webpack:///./src/Themes/data/discord-like/index.ts","webpack:///./src/Themes/data/one-dark/index.ts","webpack:///./src/Themes/data/muted-gold-blue/index.ts","webpack:///./src/Themes/data/light/index.ts","webpack:///./src/Themes/data/default/screenshot.png","webpack:///./src/Themes/data/default-lite/screenshot.png","webpack:///./src/Themes/data/monokai-ish/screenshot.png","webpack:///./src/Themes/data/warmer/screenshot.png","webpack:///./src/Themes/data/dark-plus/screenshot.png","webpack:///./src/Themes/data/mayukai-dark/screenshot.png","webpack:///./src/Themes/data/purple/screenshot.png","webpack:///./src/Themes/data/smooth-green/screenshot.png","webpack:///./src/Themes/data/dracula/screenshot.png","webpack:///./src/Themes/data/dark-blue/screenshot.png","webpack:///./src/Themes/data/discord-like/screenshot.png","webpack:///./src/Themes/data/one-dark/screenshot.png","webpack:///./src/Themes/data/muted-gold-blue/screenshot.png","webpack:///./src/Themes/data/light/screenshot.png","webpack:///./src/Terminal/Terminal.ts","webpack:///./src/data/codingcontracttypes.ts","webpack:///./src/utils/Heap.ts","webpack:///./src/utils/helpers/createRandomString.ts","webpack:///./src/Programs/Program.ts","webpack:///./src/Programs/data/ProgramsMetadata.ts","webpack:///./src/utils/helpers/isValidIPAddress.ts","webpack:///./src/PersonObjects/ITaskTracker.ts","webpack:///./src/utils/helpers/getTimestamp.ts","webpack:///./src/NetworkShare/formulas/share.tsx","webpack:///./src/Company/data/CompaniesMetadata.ts","webpack:///./src/Corporation/Research.ts","webpack:///./src/Corporation/data/ResearchMetadata.ts","webpack:///./src/Hacknet/HashUpgrade.ts","webpack:///./src/Hacknet/data/HashUpgradesMetadata.tsx","webpack:///./src/Netscript/Environment.ts","webpack:///./src/utils/helpers/isPowerOfTwo.ts","webpack:///./src/Gang/data/tasks.ts","webpack:///./src/Gang/GangMemberUpgrade.ts","webpack:///./src/StockMarket/data/InitStockMetadata.ts","webpack:///./src/NetscriptFunctions/Gang.ts","webpack:///./src/Gang/data/power.ts","webpack:///./src/NetscriptFunctions/Sleeve.ts","webpack:///./src/Company/data/CompanyPositionsMetadata.ts","webpack:///./src/NetscriptFunctions/Extra.ts","webpack:///./src/NetscriptFunctions/Hacknet.ts","webpack:///./src/NetscriptFunctions/Stanek.ts","webpack:///./src/CotMG/formulas/effect.ts","webpack:///./src/NetscriptFunctions/Infiltration.ts","webpack:///./src/NetscriptFunctions/UserInterface.ts","webpack:///./src/NetscriptFunctions/Bladeburner.ts","webpack:///./src/NetscriptFunctions/CodingContract.ts","webpack:///./src/NetscriptFunctions/Corporation.ts","webpack:///./src/Corporation/Industry.ts","webpack:///./src/utils/calculateEffectWithFactors.ts","webpack:///./src/Corporation/Employee.ts","webpack:///./src/Corporation/ProductRatingWeights.ts","webpack:///./src/NetscriptFunctions/Formulas.ts","webpack:///./src/NetscriptFunctions/StockMarket.ts","webpack:///./src/NetscriptFunctions/Grafting.ts","webpack:///./src/utils/v2APIBreak.ts","webpack:///./src/ui/InteractiveTutorial/InteractiveTutorialRoot.tsx","webpack:///./src/ui/InteractiveTutorial/NSSelection.tsx","webpack:///./src/ui/React/Overview.tsx","webpack:///./src/Sidebar/ui/SidebarRoot.tsx","webpack:///./src/Programs/ProgramHelpers.ts","webpack:///./src/Augmentation/ui/AugmentationsRoot.tsx","webpack:///./src/Augmentation/ui/InstalledAugmentations.tsx","webpack:///./src/Augmentation/ui/PlayerMultipliers.tsx","webpack:///./src/Augmentation/ui/PurchasedAugmentations.tsx","webpack:///./src/Augmentation/ui/SourceFiles.tsx","webpack:///./src/DevMenu.tsx","webpack:///./src/DevMenu/ui/General.tsx","webpack:///./src/DevMenu/ui/Stats.tsx","webpack:///./src/DevMenu/ui/Factions.tsx","webpack:///./src/DevMenu/ui/Augmentations.tsx","webpack:///./src/DevMenu/ui/SourceFiles.tsx","webpack:///./src/DevMenu/ui/Programs.tsx","webpack:///./src/DevMenu/ui/Servers.tsx","webpack:///./src/DevMenu/ui/Companies.tsx","webpack:///./src/DevMenu/ui/Bladeburner.tsx","webpack:///./src/DevMenu/ui/Gang.tsx","webpack:///./src/DevMenu/ui/Corporation.tsx","webpack:///./src/DevMenu/ui/CodingContracts.tsx","webpack:///./src/DevMenu/ui/StockMarket.tsx","webpack:///./src/DevMenu/ui/Sleeves.tsx","webpack:///./src/DevMenu/ui/Stanek.tsx","webpack:///./src/DevMenu/ui/TimeSkip.tsx","webpack:///./src/DevMenu/ui/SaveFile.tsx","webpack:///./src/DevMenu/ui/Achievements.tsx","webpack:///./src/DevMenu/ui/Entropy.tsx","webpack:///./src/Bladeburner/ui/BladeburnerRoot.tsx","webpack:///./src/Bladeburner/ui/Stats.tsx","webpack:///./src/Bladeburner/ui/TravelModal.tsx","webpack:///./src/Bladeburner/ui/Console.tsx","webpack:///./src/Bladeburner/ui/AllPages.tsx","webpack:///./src/Bladeburner/ui/GeneralActionPage.tsx","webpack:///./src/Bladeburner/ui/GeneralActionList.tsx","webpack:///./src/Bladeburner/ui/GeneralActionElem.tsx","webpack:///./src/Bladeburner/ui/ContractPage.tsx","webpack:///./src/Bladeburner/ui/ContractList.tsx","webpack:///./src/Bladeburner/ui/ContractElem.tsx","webpack:///./src/Bladeburner/data/Contracts.tsx","webpack:///./src/Bladeburner/ui/StealthIcon.tsx","webpack:///./src/Bladeburner/ui/KillIcon.tsx","webpack:///./src/Bladeburner/ui/OperationPage.tsx","webpack:///./src/Bladeburner/ui/OperationList.tsx","webpack:///./src/Bladeburner/ui/OperationElem.tsx","webpack:///./src/Bladeburner/ui/TeamSizeModal.tsx","webpack:///./src/Bladeburner/data/Operations.tsx","webpack:///./src/Bladeburner/ui/BlackOpPage.tsx","webpack:///./src/Bladeburner/ui/BlackOpList.tsx","webpack:///./src/Bladeburner/ui/BlackOpElem.tsx","webpack:///./src/Bladeburner/data/BlackOperations.tsx","webpack:///./src/Bladeburner/ui/SkillPage.tsx","webpack:///./src/Bladeburner/ui/SkillList.tsx","webpack:///./src/Bladeburner/ui/SkillElem.tsx","webpack:///./src/Gang/ui/GangRoot.tsx","webpack:///./src/Gang/ui/ManagementSubpage.tsx","webpack:///./src/Gang/ui/GangStats.tsx","webpack:///./src/Gang/ui/BonusTime.tsx","webpack:///./src/Gang/ui/GangMemberList.tsx","webpack:///./src/Gang/ui/GangMemberCard.tsx","webpack:///./src/Gang/ui/GangMemberCardContent.tsx","webpack:///./src/Gang/ui/GangMemberStats.tsx","webpack:///./src/ui/React/KillScriptsModal.tsx","webpack:///./src/Gang/ui/TaskSelector.tsx","webpack:///./src/Gang/ui/TaskDescription.tsx","webpack:///./src/Gang/ui/AscensionModal.tsx","webpack:///./src/Gang/ui/RecruitButton.tsx","webpack:///./src/Gang/ui/RecruitModal.tsx","webpack:///./src/Gang/ui/TerritorySubpage.tsx","webpack:///./src/Gang/ui/TerritoryInfoModal.tsx","webpack:///./src/Gang/ui/EquipmentsSubpage.tsx","webpack:///./src/Corporation/ui/CorporationRoot.tsx","webpack:///./src/Corporation/ui/MainPanel.tsx","webpack:///./src/Corporation/ui/CityTabs.tsx","webpack:///./src/Corporation/ui/Industry.tsx","webpack:///./src/Corporation/ui/IndustryOffice.tsx","webpack:///./src/Corporation/ui/modals/UpgradeOfficeSizeModal.tsx","webpack:///./src/Corporation/ui/modals/ThrowPartyModal.tsx","webpack:///./src/Corporation/ui/IndustryOverview.tsx","webpack:///./src/Corporation/ui/modals/MakeProductModal.tsx","webpack:///./src/Corporation/ui/modals/ResearchModal.tsx","webpack:///./src/Corporation/ui/IndustryWarehouse.tsx","webpack:///./src/Corporation/ui/modals/SmartSupplyModal.tsx","webpack:///./src/Corporation/ui/ProductElem.tsx","webpack:///./src/Corporation/ui/modals/DiscontinueProductModal.tsx","webpack:///./src/Corporation/ui/modals/LimitProductProductionModal.tsx","webpack:///./src/Corporation/ui/modals/SellProductModal.tsx","webpack:///./src/Corporation/ui/modals/ProductMarketTaModal.tsx","webpack:///./src/Corporation/ui/modals/CancelProductModal.tsx","webpack:///./src/Corporation/ui/MaterialElem.tsx","webpack:///./src/Corporation/ui/modals/ExportModal.tsx","webpack:///./src/Corporation/ui/modals/MaterialMarketTaModal.tsx","webpack:///./src/Corporation/ui/modals/SellMaterialModal.tsx","webpack:///./src/Corporation/ui/modals/PurchaseMaterialModal.tsx","webpack:///./src/Corporation/ui/modals/LimitMaterialProductionModal.tsx","webpack:///./src/Corporation/ui/IndustryProductEquation.tsx","webpack:///./src/Corporation/ui/ExpandNewCity.tsx","webpack:///./src/Corporation/ui/ExpandIndustryTab.tsx","webpack:///./src/Corporation/ui/Overview.tsx","webpack:///./src/Corporation/ui/LevelableUpgrade.tsx","webpack:///./src/Corporation/ui/UnlockUpgrade.tsx","webpack:///./src/Corporation/ui/modals/BribeFactionModal.tsx","webpack:///./src/Corporation/ui/modals/SellSharesModal.tsx","webpack:///./src/Corporation/ui/modals/BuybackSharesModal.tsx","webpack:///./src/Corporation/ui/modals/IssueDividendsModal.tsx","webpack:///./src/Corporation/ui/modals/IssueNewSharesModal.tsx","webpack:///./src/Corporation/ui/modals/FindInvestorsModal.tsx","webpack:///./src/Corporation/ui/modals/GoPublicModal.tsx","webpack:///./src/Infiltration/ui/InfiltrationRoot.tsx","webpack:///./src/Infiltration/ui/Game.tsx","webpack:///./src/Infiltration/ui/BackwardGame.tsx","webpack:///./src/Infiltration/ui/BracketGame.tsx","webpack:///./src/Infiltration/ui/BribeGame.tsx","webpack:///./src/Infiltration/ui/CheatCodeGame.tsx","webpack:///./src/Infiltration/ui/Countdown.tsx","webpack:///./src/Infiltration/ui/Cyberpunk2077Game.tsx","webpack:///./src/Infiltration/ui/MinesweeperGame.tsx","webpack:///./src/Infiltration/ui/SlashGame.tsx","webpack:///./src/Infiltration/ui/Victory.tsx","webpack:///./src/Infiltration/ui/WireCuttingGame.tsx","webpack:///./src/Infiltration/ui/Intro.tsx","webpack:///./src/ui/WorkInProgressRoot.tsx","webpack:///./src/GameOptions/ui/GameOptionsRoot.tsx","webpack:///./src/GameOptions/ui/GameOptionsSidebar.tsx","webpack:///./src/Diagnostic/FileDiagnosticModal.tsx","webpack:///./src/Themes/ui/StyleEditorModal.tsx","webpack:///./src/Themes/ui/ThemeEditorModal.tsx","webpack:///./src/GameOptions/ui/GameplayPage.tsx","webpack:///./src/GameOptions/ui/InterfacePage.tsx","webpack:///./src/GameOptions/ui/MiscPage.tsx","webpack:///./src/GameOptions/ui/RemoteAPIPage.tsx","webpack:///./src/GameOptions/ui/ConnectionBauble.tsx","webpack:///./src/RemoteFileAPI/Remote.ts","webpack:///./src/GameOptions/ui/SystemPage.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveElem.tsx","webpack:///./src/PersonObjects/Sleeve/ui/MoreStatsModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/SleeveAugmentationsModal.tsx","webpack:///./src/Augmentation/ui/PurchaseAugmentationModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TaskSelector.tsx","webpack:///./src/PersonObjects/Sleeve/ui/TravelModal.tsx","webpack:///./src/PersonObjects/Sleeve/ui/FAQModal.tsx","webpack:///./src/Hacknet/ui/HacknetRoot.tsx","webpack:///./src/Hacknet/ui/GeneralInfo.tsx","webpack:///./src/Hacknet/ui/HacknetNodeElem.tsx","webpack:///./src/Hacknet/ui/HacknetServerElem.tsx","webpack:///./src/Hacknet/ui/HashUpgradeModal.tsx","webpack:///./src/Hacknet/ui/HacknetUpgradeElem.tsx","webpack:///./src/Hacknet/ui/MultiplierButtons.tsx","webpack:///./src/Hacknet/ui/PlayerInfo.tsx","webpack:///./src/Hacknet/ui/PurchaseButton.tsx","webpack:///./src/Locations/ui/GenericLocation.tsx","webpack:///./src/Locations/ui/CompanyLocation.tsx","webpack:///./src/Company/ui/QuitJobModal.tsx","webpack:///./src/Locations/ui/GymLocation.tsx","webpack:///./src/Locations/ui/HospitalLocation.tsx","webpack:///./src/Locations/ui/SlumsLocation.tsx","webpack:///./src/Locations/ui/SpecialLocation.tsx","webpack:///./src/Corporation/ui/modals/CreateCorporationModal.tsx","webpack:///./src/utils/helpers/N00dles.ts","webpack:///./src/Arcade/ui/ArcadeRoot.tsx","webpack:///./src/Arcade/ui/BBCabinet.tsx","webpack:///./src/Locations/ui/TechVendorLocation.tsx","webpack:///./src/Locations/ui/RamButton.tsx","webpack:///./src/Locations/ui/TorButton.tsx","webpack:///./src/Locations/LocationsHelpers.tsx","webpack:///./src/Locations/ui/CoresButton.tsx","webpack:///./src/Locations/ui/PurchaseServerModal.tsx","webpack:///./src/Locations/ui/TravelConfirmationModal.tsx","webpack:///./src/Locations/ui/UniversityLocation.tsx","webpack:///./src/Locations/ui/CasinoLocation.tsx","webpack:///./src/Casino/CardDeck/Deck.ts","webpack:///./src/Casino/CoinFlip.tsx","webpack:///./src/Casino/Roulette.tsx","webpack:///./src/Casino/SlotMachine.tsx","webpack:///./src/Locations/ui/City.tsx","webpack:///./src/ScriptEditor/ui/OptionsModal.tsx","webpack:///./src/ScriptEditor/ui/ThemeEditorModal.tsx","webpack:///./src/Milestones/ui/MilestonesRoot.tsx","webpack:///./src/Terminal/ui/TerminalRoot.tsx","webpack:///./src/Terminal/ui/TerminalInput.tsx","webpack:///./src/Terminal/determineAllPossibilitiesForTabCompletion.ts","webpack:///./src/Script/ScriptUrl.ts","webpack:///./src/Terminal/tabCompletion.ts","webpack:///./src/Tutorial/ui/TutorialRoot.tsx","webpack:///./src/ui/ActiveScripts/ActiveScriptsRoot.tsx","webpack:///./src/ui/ActiveScripts/ActiveScriptsPage.tsx","webpack:///./src/ui/ActiveScripts/ScriptProduction.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordions.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordion.tsx","webpack:///./src/ui/ActiveScripts/ServerAccordionContent.tsx","webpack:///./src/ui/ActiveScripts/WorkerScriptAccordion.tsx","webpack:///./src/ui/ActiveScripts/RecentScriptsPage.tsx","webpack:///./src/ui/ActiveScripts/RecentScriptAccordion.tsx","webpack:///./src/Faction/ui/FactionRoot.tsx","webpack:///./src/Faction/ui/AugmentationsPage.tsx","webpack:///./src/Faction/ui/DonateOption.tsx","webpack:///./src/Faction/ui/Info.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantPurchasesRoot.tsx","webpack:///./src/PersonObjects/Sleeve/ui/CovenantSleeveMemoryUpgrade.tsx","webpack:///./src/PersonObjects/Person.ts","webpack:///./src/SourceFile/applySourceFile.ts","webpack:///./src/Exploits/applyExploits.ts","webpack:///./src/Faction/ui/GangButton.tsx","webpack:///./src/Faction/ui/CreateGangModal.tsx","webpack:///./src/ui/CharacterStats.tsx","webpack:///./src/StockMarket/ui/StockMarketRoot.tsx","webpack:///./src/StockMarket/ui/InfoAndPurchases.tsx","webpack:///./src/StockMarket/ui/StockTickers.tsx","webpack:///./src/StockMarket/ui/StockTicker.tsx","webpack:///./src/StockMarket/ui/StockTickerHeaderText.tsx","webpack:///./src/StockMarket/ui/StockTickerOrderList.tsx","webpack:///./src/StockMarket/ui/StockTickerOrder.tsx","webpack:///./src/StockMarket/ui/StockTickerPositionText.tsx","webpack:///./src/StockMarket/ui/PlaceOrderModal.tsx","webpack:///./src/BitNode/ui/BitverseRoot.tsx","webpack:///./src/BitNode/ui/PortalModal.tsx","webpack:///./src/ui/React/CinematicLine.tsx","webpack:///./src/CotMG/ui/StaneksGiftRoot.tsx","webpack:///./src/CotMG/ui/MainBoard.tsx","webpack:///./src/CotMG/ui/FragmentInspector.tsx","webpack:///./src/CotMG/ui/FragmentSelector.tsx","webpack:///./src/CotMG/ui/FragmentPreview.tsx","webpack:///./src/CotMG/ui/ActiveFragmentSummary.tsx","webpack:///./src/CotMG/DummyGift.ts","webpack:///./src/Bladeburner/ui/BladeburnerCinematic.tsx","webpack:///./src/Exploits/Unclickable.tsx","webpack:///./src/Achievements/AchievementsRoot.tsx","webpack:///./src/Achievements/AchievementList.tsx","webpack:///./src/Achievements/AchievementIcon.tsx","webpack:///./src/ui/ErrorBoundary.tsx","webpack:///./src/Themes/ui/ThemeBrowser.tsx","webpack:///./src/Themes/ui/ThemeEntry.tsx","webpack:///./src/ui/React/ImportSaveRoot.tsx","webpack:///./src/ui/React/BypassWrapper.tsx","webpack:///./src/NetscriptFunctions/Singularity.ts","webpack:///./src/Netscript/APIWrapper.ts","webpack:///./src/NetscriptPort.ts","webpack:///./src/utils/helpers/clearObject.ts","webpack:///./src/PersonObjects/Grafting/EntropyAccumulation.ts","webpack:///./src/Corporation/CorporationState.ts","webpack:///./src/Literature/Literatures.ts","webpack:///./src/Terminal/commands/alias.ts","webpack:///./src/Terminal/commands/analyze.ts","webpack:///./src/Terminal/commands/backdoor.ts","webpack:///./src/Terminal/commands/buy.ts","webpack:///./src/Terminal/commands/cat.ts","webpack:///./src/Terminal/commands/cd.ts","webpack:///./src/Terminal/commands/check.ts","webpack:///./src/Terminal/commands/connect.ts","webpack:///./src/Terminal/commands/cp.ts","webpack:///./src/Terminal/commands/expr.ts","webpack:///./src/Terminal/commands/free.ts","webpack:///./src/Terminal/commands/grow.ts","webpack:///./src/Terminal/commands/hack.ts","webpack:///./src/Terminal/commands/help.ts","webpack:///./src/Terminal/commands/history.ts","webpack:///./src/Terminal/commands/home.ts","webpack:///./src/Terminal/commands/hostname.ts","webpack:///./src/Terminal/commands/kill.ts","webpack:///./src/Terminal/commands/killall.ts","webpack:///./src/Terminal/commands/ls.tsx","webpack:///./src/Terminal/commands/lscpu.ts","webpack:///./src/Terminal/commands/mem.ts","webpack:///./src/Terminal/commands/mv.ts","webpack:///./src/Terminal/commands/nano.ts","webpack:///./src/ScriptEditor/CursorPositions.ts","webpack:///./src/Terminal/commands/ps.ts","webpack:///./src/Terminal/commands/rm.ts","webpack:///./src/Terminal/commands/run.ts","webpack:///./src/Terminal/commands/runScript.ts","webpack:///./src/Terminal/commands/runProgram.ts","webpack:///./src/Terminal/commands/scan.ts","webpack:///./src/Terminal/commands/scananalyze.ts","webpack:///./src/Terminal/commands/scp.ts","webpack:///./src/Terminal/commands/sudov.ts","webpack:///./src/Terminal/commands/tail.ts","webpack:///./src/Terminal/commands/top.ts","webpack:///./src/Terminal/commands/unalias.ts","webpack:///./src/Terminal/commands/vim.ts","webpack:///./src/Terminal/commands/weaken.ts","webpack:///./src/Terminal/commands/wget.ts","webpack:///./src/Terminal/commands/apr1.ts","webpack:///./src/Exploits/loops.ts","webpack:///./src/UncaughtPromiseHandler.ts","webpack:///./src/index.tsx"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","0","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice","Player","PlayerObject","loadPlayer","saveString","JSON","parse","Reviver","money","parseFloat","exploits","sanitizeExploits","helpers","string","number","ctx","argName","v","x","isNaN","makeRuntimeErrorMsg","debugType","scriptArgs","argsToString","args","out","arg","undefined","toNative","stringify","isScriptErrorMessage","msg","isString","split","makeRuntimeRejectMsg","resolveNetscriptRequestedThreads","requestedThreads","threads","workerScript","scriptRef","requestedThreadsAsInt","function","checkEnvFlags","ws","env","stopFlag","ScriptDeath","runningFn","errorMessage","delayReject","checkSingularityAccess","bitNodeN","sourceFileLvl","netscriptDelay","time","Promise","resolve","reject","delay","setTimeout","updateDynamicRam","ramCost","fnName","dynamicLoadedFns","console","warn","hostname","dynamicRamUsage","ramUsage","numeralWrapper","formatRAM","city","values","CityName","includes","getServer","scriptIdentifier","scriptID","_hostname","_args","pid","scriptname","Error","hack","async","manual","stock","server","Server","hackingTime","calculateHackingTime","canHack","netscriptCanHack","res","log","convertTimeMsToTimeElapsedString","formatThreads","then","hackChance","calculateHackingChance","rand","Math","random","expGainedOnSuccess","calculateHackingExpGain","expGainedOnFailure","percentHacked","calculatePercentMoneyHacked","maxThreadNeeded","ceil","moneyDrained","floor","moneyAvailable","moneyGained","BitNodeMultipliers","ScriptHackMoneyGain","ManualHackMoney","gainMoney","onlineMoneyMade","scriptProdSinceLastAug","recordHack","gainHackingExp","gainIntelligenceExp","onlineExpGained","formatMoney","formatExp","fortify","CONSTANTS","ServerFortifyAmount","min","influenceStockThroughServerHack","backdoorInstalled","getValidPort","port","NumNetscriptPorts","round","iport","NetscriptPorts","player","roughlyIs","hp","mults","numPeopleKilled","location","totalPlaytime","playtimeSinceLastAug","playtimeSinceLastBitnode","jobs","factions","tor","inBladeburner","hasCorporation","entropy","cpuCores","ftpPortOpen","hasAdminRights","httpPortOpen","ip","isConnectedTo","maxRam","organizationName","ramUsed","smtpPortOpen","sqlPortOpen","sshPortOpen","purchasedByPlayer","baseDifficulty","hackDifficulty","minDifficulty","moneyMax","numOpenPortsRequired","openPortCount","requiredHackingSkill","serverGrowth","gang","g","respect","territory","wantedLevel","gangMember","GangMember","gangTask","GangMemberTask","getFunctionNames","obj","prefix","functionNames","entries","getRunningScript","ident","GetAllServers","runningScript","findRunningScriptByPid","getRunningScriptByPid","getRunningScriptByArgs","getCannotFindRunningScriptErrorMessage","arrayToString","createPublicRunningScript","filename","logs","offlineExpGained","offlineMoneyMade","offlineRunningTime","onlineRunningTime","failOnHacknetServer","callingFn","HacknetServer","clip","String","json","userFriendlyString","Array","isArray","every","isScriptArgs","scriptUrl","dependencies","replace","RegExp","url","errstack","stack","caller","scripts","userstack","stackline","script","dependency","parseChromeStackline","line","lineMatch","match","funcMatch","func","chromeCall","parseFirefoxStackline","lio","lastIndexOf","firefoxCall","rejectMsg","join","GetServer","expect","actual","expects","keys","actuals","message","functionPath","fn","findRunningScript","FactionNames","defaultSettings","ActiveScriptsServerPageSize","ActiveScriptsScriptPageSize","AutosaveInterval","CodeInstructionRunTime","DisableASCIIArt","DisableHotkeys","DisableTextEffects","DisableOverviewProgressBars","EnableBashHotkeys","TimestampsFormat","Locale","MaxRecentScriptsCapacity","MaxLogCapacity","MaxPortCapacity","MaxTerminalCapacity","RemoteFileApiPort","SaveGameOnFileSave","SuppressBuyAugmentationConfirmation","SuppressFactionInvites","SuppressMessages","SuppressTravelConfirmation","SuppressBladeburnerPopup","SuppressTIXPopup","SuppressSavedGameToast","SuppressAutosaveDisabledWarnings","UseIEC60027_2","ExcludeRunningScriptsFromSave","IsSidebarOpened","theme","defaultTheme","styles","defaultStyles","overview","y","opened","EditorTheme","defaultMonacoTheme","Settings","OwnedAugmentationsOrder","OwnedAugmentationsOrderSetting","AcquirementTime","PurchaseAugmentationsOrder","PurchaseAugmentationsOrderSetting","Default","MonacoTheme","MonacoInsertSpaces","MonacoFontSize","MonacoVim","MonacoWordWrap","init","assign","load","save","extraFormats","extraNotations","gigaMultiplier","constructor","this","defaultLocale","updateLocale","numeral","locale","format","abs","answer","formatBigNumber","formatReallyBigNumber","decimalPlaces","nAbs","Infinity","repeat","str","formatHp","formatSkill","formatHashes","formatReputation","formatFavor","formatSecurity","toFixed","formatPercentage","formatter","formatServerSecurity","formatRespect","formatWanted","formatMultiplier","formatSleeveShock","formatSleeveSynchro","formatSleeveMemory","formatPopulation","formatStamina","formatShares","formatInfiltrationSecurity","formatStaneksGiftHeat","formatStaneksGiftCharge","formatStaneksGiftPower","parseCustomLargeNumber","numericRegExp","NaN","notation","notationIndex","indexOf","largestAbsoluteNumber","n1","n2","n3","max","parseMoney","numeralValue","parsed","selfParsed","LocationName","AugmentationNames","VersionString","VersionNumber","_idleSpeed","MaxSkillLevel","MilliPerCycle","CorpFactionRepRequirement","BaseCostFor1GBOfRamHome","BaseCostFor1GBOfRamServer","TravelCost","BaseFavorToDonate","DonateMoneyToRepDivisor","FactionReputationToFavorBase","FactionReputationToFavorMult","CompanyReputationToFavorBase","CompanyReputationToFavorMult","NeuroFluxGovernorLevelMult","HomeComputerMaxRam","ServerBaseGrowthRate","ServerMaxGrowthRate","ServerWeakenAmount","PurchasedServerLimit","PurchasedServerMaxRam","MultipleAugMultiplier","TorRouterCost","WSEAccountCost","TIXAPICost","MarketData4SCost","MarketDataTixApi4SCost","StockMarketCommission","HospitalCostPerHp","IntelligenceCrimeWeight","IntelligenceInfiltrationWeight","IntelligenceCrimeBaseExpGain","IntelligenceProgramBaseExpGain","IntelligenceGraftBaseExpGain","IntelligenceTerminalHackBaseExpGain","IntelligenceSingFnBaseExpGain","IntelligenceClassBaseExpGain","MillisecondsPer20Hours","GameCyclesPer20Hours","MillisecondsPer10Hours","GameCyclesPer10Hours","MillisecondsPer8Hours","GameCyclesPer8Hours","MillisecondsPer4Hours","GameCyclesPer4Hours","MillisecondsPer2Hours","GameCyclesPer2Hours","MillisecondsPerHour","GameCyclesPerHour","MillisecondsPerHalfHour","GameCyclesPerHalfHour","MillisecondsPerQuarterHour","GameCyclesPerQuarterHour","MillisecondsPerFiveMinutes","GameCyclesPerFiveMinutes","BaseFocusBonus","ClassDataStructuresBaseCost","ClassNetworksBaseCost","ClassAlgorithmsBaseCost","ClassManagementBaseCost","ClassLeadershipBaseCost","ClassGymBaseCost","ClassStudyComputerScienceBaseExp","ClassDataStructuresBaseExp","ClassNetworksBaseExp","ClassAlgorithmsBaseExp","ClassManagementBaseExp","ClassLeadershipBaseExp","CodingContractBaseFactionRepGain","CodingContractBaseCompanyRepGain","CodingContractBaseMoneyGain","AugmentationGraftingCostMult","AugmentationGraftingTimeBase","SoACostMult","SoARepMult","EntropyEffect","TotalNumBitNodes","InfiniteLoopLimit","Donations","LatestUpdate","ctor","constructors","fromJSON","validationData","validateObject","Generic_toJSON","ctorName","index","Generic_fromJSON","dialogBoxCreate","txt","AlertEvents","emit","component","sx","dangerouslySetInnerHTML","__html","defaultMultipliers","useStyles","makeStyles","createStyles","unbuyable","color","palette","action","disabled","colors","Money","props","classes","canAfford","className","AllServers","isValidIPAddress","GetServerByHostname","ipserver","GetServerByIP","servers","DeleteServer","serverkey","ipExists","hostName","createUniqueRandomIp","createRandomIp","AddToAllServers","initForeignServers","homeComputer","networkLayers","toNumber","getRandomInt","metadata","serverMetadata","serverParams","maxRamExponent","pow","literature","messages","SpecialServers","WorldDaemon","WorldDaemonDifficulty","networkLayer","linkNetworkLayers","network1","selectServer","server1","server2","serversOnNetwork","getRandomArrayItem","arr","prestigeAllServers","member","loadAllServers","saveAllServers","excludeRunningScripts","TempAllServers","runningScripts","runningScriptObj","Context","React","createContext","Router","use","useContext","Page","showMilli","totalSeconds","days","secondPerHours","secTruncDays","hours","secondPerMinute","secTruncHours","minutes","secTruncMinutes","milliTruncSec","longestCommonStart","strings","containsAllStrings","A","concat","sort","a1","a2","L","a","charAt","b","toUpperCase","substring","formatNumber","num","numFractionDigits","toLocaleString","maximumFractionDigits","minimumFractionDigits","generateRandomString","chars","cyrb53","seed","h1","h2","ch","charCodeAt","imul","toString","Factions","loadFactions","faction","getInfo","err","error","factionExists","initFactions","FactionInfos","resetFaction","Faction","newFactionObject","factionName","favor","AddToFactions","KEY","KEYCODE","SoftwareCompanyPositions","ITCompanyPositions","SecurityEngineerCompanyPositions","NetworkEngineerCompanyPositions","BusinessCompanyPositions","SecurityCompanyPositions","AgentCompanyPositions","MiscCompanyPositions","SoftwareConsultantCompanyPositions","BusinessConsultantCompanyPositions","PartTimeCompanyPositions","lower","upper","AllCorporationStates","CorporationConstants","INITIALSHARES","SHARESPERPRICEUPDATE","IssueNewSharesCooldown","SellSharesCooldown","CyclesPerMarketCycle","CyclesPerIndustryStateCycle","SecsPerMarketCycle","Cities","Aevum","Chongqing","Sector12","NewTokyo","Ishima","Volhaven","WarehouseInitialCost","WarehouseInitialSize","WarehouseUpgradeBaseCost","OfficeInitialCost","OfficeInitialSize","OfficeUpgradeBaseCost","BribeThreshold","BribeToRepRatio","ProductProductionCostRatio","DividendMaxRate","EmployeeSalaryMultiplier","CyclesPerEmployeeRaise","EmployeeRaiseAmount","BaseMaxProducts","AllMaterials","AllIndustryTypes","AllUnlocks","AllUpgrades","AllResearch","FundingRoundShares","FundingRoundMultiplier","AvgProfitLength","Augmentation","params","info","moneyCost","repCost","prereqs","baseRepRequirement","freeze","baseCost","isSpecial","hacking","strength","defense","dexterity","agility","charisma","hacking_exp","strength_exp","defense_exp","dexterity_exp","agility_exp","charisma_exp","hacking_chance","hacking_speed","hacking_money","hacking_grow","company_rep","faction_rep","crime_money","crime_success","work_money","hacknet_node_money","hacknet_node_purchase_cost","hacknet_node_ram_cost","hacknet_node_core_cost","hacknet_node_level_cost","bladeburner_max_stamina","bladeburner_stamina_gain","bladeburner_analysis","bladeburner_success_chance","stats","programs","startingMoney","f","decimals","desc","generateStatsDescription","addToFactions","factionList","augmentations","getCost","augmentationReference","StaticAugmentations","NeuroFluxGovernor","nextLevel","getLevel","multiplier","AugmentationRepCost","AugmentationMoneyCost","queuedAugmentations","getBaseAugmentationPriceMultiplier","ShadowsOfAnarchy","soaAugmentationNames","initSoAAugmentations","map","augmentation","soaMultiplier","filter","augmentationName","hasAugmentation","find","getGenericAugmentationPriceMultiplier","currLevel","level","addToAllFactions","fac","facObj","special","toJSON","modal","display","alignItems","justifyContent","paper","backgroundColor","background","default","border","primary","main","boxShadow","dark","padding","maxWidth","maxHeight","overflow","scrollbarWidth","Modal","disableRestoreFocus","disableScrollLock","disableEnforceFocus","disableAutoFocus","open","onClose","closeAfterTransition","in","children","HacknetNodeConstants","MoneyGainPerLevel","BaseCost","LevelBaseCost","RamBaseCost","CoreBaseCost","PurchaseNextMult","UpgradeLevelMult","UpgradeRamMult","UpgradeCoreMult","MaxLevel","MaxRam","MaxCores","PurchaseMultipliers","x1","x5","x10","MAX","HacknetServerConstants","HashesPerLevel","CacheBaseCost","PurchaseMult","UpgradeCacheMult","MaxServers","MaxCache","EmployeePositions","Operations","Engineer","Business","Management","RandD","Training","Unassigned","ActionTypes","Idle","Contract","Operation","BlackOp","BlackOperation","Recruitment","FieldAnalysis","Diplomacy","iTutorialSteps","ITutorial","currStep","Start","isRunning","stepIsDone","NSSelection","GoToCharacterPage","CharacterPage","CharacterGoToTerminalPage","TerminalIntro","TerminalHelp","TerminalLs","TerminalScan","TerminalScanAnalyze1","TerminalScanAnalyze2","TerminalConnect","TerminalAnalyze","TerminalNuke","TerminalManualHack","TerminalHackingMechanics","TerminalGoHome","TerminalCreateScript","TerminalTypeScript","TerminalFree","TerminalRunScript","TerminalGoToActiveScriptsPage","ActiveScriptsPage","ActiveScriptsToTerminal","TerminalTailScript","GoToHacknetNodesPage","HacknetNodesIntroduction","HacknetNodesGoToWorldPage","WorldDescription","TutorialPageInfo","End","iTutorialStart","iTutorialNextStep","iTutorialEnd","ITutorialEvents","iTutorialPrevStep","getHomeComputer","LiteratureNames","HackersStartingHandbook","BaseServer","super","startsWith","createRandomString","ServerStartingMoney","ServerMaxMoney","ServerStartingSecurity","capDifficulty","changeMinimumSecurity","perc","changeMaximumMoney","aboveCap","amt","weaken","ServerWeakenRate","Corporation","Division","useCorporation","useDivision","Industries","Energy","Utilities","Agriculture","Fishing","Mining","Food","Tobacco","Chemical","Pharmaceutical","Computer","Robotics","Software","Healthcare","RealEstate","IndustryStartingCosts","IndustryDescriptions","corp","IndustryResearchTrees","getBaseResearchTreeCopy","getProductIndustryResearchTreeCopy","resetIndustryResearchTrees","LocationType","ClassType","Classes","StudyComputerScience","youAreCurrently","type","earnings","newWorkStats","hackExp","intExp","DataStructures","Networks","Algorithms","chaExp","Leadership","GymStrength","strExp","GymDefense","defExp","GymDexterity","dexExp","GymAgility","agiExp","isClassWork","w","WorkType","CLASS","ClassWork","Work","singularity","classType","Sector12RothmanUniversity","isGym","getClass","calculateRates","calculateClassEarningsRate","process","cycles","cyclesWorked","rate","applyWorkStats","sumWorkStats","finish","APICopy","hasHacknetServers","purchaseHacknet","numOwned","hacknetNodes","cost","getCostOfNextHacknetServer","loseMoney","createHacknetServer","updateHashManagerCapacity","getCostOfNextHacknetNode","node","HacknetNode","hasMaxNumberHacknetServers","calculateNodeCost","calculateServerCost","getMaxNumberLevelUpgrades","nodeObj","maxLevel","calculateLevelUpgradeCost","levelsToMax","curr","getMaxNumberRamUpgrades","calculateRamUpgradeCost","log2","ram","getMaxNumberCoreUpgrades","calculateCoreUpgradeCost","cores","getMaxNumberCacheUpgrades","calculateCacheUpgradeCost","cache","purchaseLevelUpgrade","levels","sanitizedLevels","isServer","upgradeLevel","purchaseRamUpgrade","upgradeRam","purchaseCoreUpgrade","upgradeCore","purchaseCacheUpgrade","upgradeCache","processHacknetEarnings","numCycles","hashManager","HashManager","hashes","hserver","updateHashRate","h","wastedHashes","storeHashes","upgrade","HashUpgrades","processAllHacknetServerEarnings","total","processSingleHacknetNodeEarnings","processAllHacknetNodeEarnings","totalEarnings","nodes","updateCapacity","hashCapacity","purchaseHashUpgrade","upgName","upgTarget","count","upg","corporation","refundUpgrade","funds","target","e","division","divisions","sciResearch","qty","bladeburner","changeRank","skillPoints","generateRandomContract","NewIndustry","industry","Industry","NewCity","offices","OfficeSpace","loc","size","UnlockUpgrade","price","unlockUpgrades","unlock","LevelUpgrade","basePrice","priceMult","upgrades","IssueDividends","dividendRate","SellMaterial","mat","temp","bCost","eval","sCost","q","tempQty","maxsll","prd","sllman","SellProduct","product","all","cities","tempCity","SetSmartSupply","warehouse","smartSupply","smartSupplyEnabled","SetSmartSupplyUseLeftovers","material","useLeftover","smartSupplyUseLeftovers","BuyMaterial","buy","BulkPurchase","matSize","MaterialSizes","maxAmount","sizeUsed","SellShares","numShares","public","shareSaleCooldown","stockSaleResults","calculateShareSale","profit","newSharePrice","newSharesUntilUpdate","issuedShares","sharePrice","shareSalesUntilPriceUpdate","BuyBackShares","buybackPrice","AssignJob","office","employeeName","job","employee","employees","assignSingleJob","AutoAssignJob","autoAssignJob","UpgradeOfficeSize","initialPriceMult","mult","BuyCoffee","getCoffeeCost","setCoffee","ThrowParty","costPerEmployee","setParty","PurchaseWarehouse","warehouses","Warehouse","UpgradeWarehouseCost","from","reduce","acc","UpgradeWarehouse","sizeUpgradeCost","updateSize","HireAdVert","getAdVertCost","applyAdVert","MakeProduct","productName","designInvest","marketingInvest","makesProducts","maxProducts","hasResearch","products","Product","trim","createCity","designCost","advCost","Research","researchName","researchTree","getAllNodes","research","ResearchMap","researched","ExportMaterial","divisionName","cityName","sanitizedAmt","isRelevantMaterial","exportObj","ind","exp","CancelExportMaterial","LimitProductProduction","prdman","LimitMaterialProduction","SetMaterialMarketTA1","on","marketTa1","SetMaterialMarketTA2","marketTa2","SetProductMarketTA1","SetProductMarketTA2","BlackOperationNames","t_homeComp","safetlyCreateUniqueServer","adminRights","currentServer","Home","Programs","NukeProgram","prestigeAugmentation","skills","TravelAgency","purchasedServers","factionInvitations","numSleeves","sleevesFromCovenant","sleeves","Sleeve","shock","synchronize","shockRecovery","lastUpdate","Date","getTime","moneySourceA","reset","prestige","reapplyAllAugmentations","current","finishWork","prestigeSourceFile","karma","sync","resetGangs","hasWseAccount","hasTixApiAccess","has4SData","has4SDataTixApi","moneySourceB","receiveInvite","calculateSkill","calculateSkillF","calculateSkillProgress","calculateSkillProgressF","updateSkillLevels","HackingLevelMultiplier","StrengthLevelMultiplier","DefenseLevelMultiplier","DexterityLevelMultiplier","AgilityLevelMultiplier","CharismaLevelMultiplier","intelligence","ratio","resetMultipliers","hasProgram","programName","home","toLowerCase","setMoney","source","recordMoneySource","MoneySourceTracker","record","gainStrengthExp","gainDefenseExp","gainDexterityExp","gainAgilityExp","gainCharismaExp","gainStats","retValue","def","dex","agi","cha","int","queryStatFromString","tempStr","startFocusing","focus","stopFocusing","takeDamage","hospitalize","regenerateHp","getHospitalizationCost","SnackbarEvents","ToastVariant","WARNING","applyForJob","entryPosType","sing","company","Companies","Company","pos","isQualified","getJobRequirementText","hasPosition","nextPos","getNextCompanyPositionHelper","reqText","getNextCompanyPosition","currCompany","currentPositionName","currentPosition","CompanyPositions","isSoftwareJob","isITJob","isBusinessJob","isSecurityEngineerJob","isNetworkEngineerJob","isSecurityJob","isAgentJob","isSoftwareConsultantJob","isBusinessConsultantJob","isPartTimeJob","quitJob","isCompanyWork","currentWork","companyName","sleeve","isSleeveCompanyWork","stopWork","hasJob","Boolean","applyForSoftwareJob","posNames","applyForSoftwareConsultantJob","applyForItJob","applyForSecurityEngineerJob","applyForNetworkEngineerJob","applyForBusinessJob","applyForBusinessConsultantJob","applyForSecurityJob","applyForAgentJob","applyForEmployeeJob","position","applyForPartTimeEmployeeJob","applyForWaiterJob","applyForPartTimeWaiterJob","offset","jobStatReqOffset","reqHacking","requiredHacking","reqStrength","requiredStrength","reqDefense","requiredDefense","reqDexterity","requiredDexterity","reqAgility","reqCharisma","requiredCharisma","playerReputation","requiredReputation","playerAug","applyAugmentation","reapplyAllSourceFiles","sourceFiles","srcFileKey","SourceFiles","applySourceFile","applyExploit","checkForFactionInvitations","invitedFactions","numAugmentations","allCompanies","allPositions","checkMegacorpRequirements","serverMeta","specialName","bonus","getCompanyRep","illuminatiFac","Illuminati","isBanned","isMember","alreadyInvited","daedalusFac","Daedalus","DaedalusAugsRequirement","covenantFac","TheCovenant","ecorpFac","ECorp","AevumECorp","megacorpFac","MegaCorp","Sector12MegaCorp","bachmanandassociatesFac","BachmanAssociates","AevumBachmanAndAssociates","bladeindustriesFac","BladeIndustries","Sector12BladeIndustries","nwoFac","NWO","VolhavenNWO","clarkeincorporatedFac","ClarkeIncorporated","AevumClarkeIncorporated","omnitekincorporatedFac","OmniTekIncorporated","VolhavenOmniTekIncorporated","foursigmaFac","FourSigma","Sector12FourSigma","kuaigonginternationalFac","KuaiGongInternational","ChongqingKuaiGongInternational","fulcrumsecrettechonologiesFac","FulcrumSecretTechnologies","fulcrumSecretServer","AevumFulcrumTechnologies","bitrunnersFac","BitRunners","bitrunnersServer","BitRunnersServer","theblackhandFac","TheBlackHand","blackhandServer","TheBlackHandServer","nitesecFac","NiteSec","nitesecServer","NiteSecServer","chongqingFac","sector12Fac","newtokyoFac","aevumFac","ishimaFac","volhavenFac","speakersforthedeadFac","SpeakersForTheDead","Sector12CIA","Sector12NSA","thedarkarmyFac","TheDarkArmy","thesyndicateFac","TheSyndicate","silhouetteFac","Silhouette","tetradsFac","Tetrads","slumsnakesFac","SlumSnakes","netburnersFac","Netburners","totalHacknetRam","totalHacknetCores","totalHacknetLevels","tiandihuiFac","TianDiHui","cybersecFac","CyberSec","cybersecServer","CyberSecServer","setBitNodeNumber","queueAugmentation","aug","PlayerOwnedAugmentation","gainCodingContractReward","reward","difficulty","CodingContractRewardType","FactionReputation","FactionReputationAll","repGain","totalGain","specialFactions","Bladeburners","gainPerFaction","facName","CompanyReputation","moneyGain","CodingContractMoney","travel","to","gotoLocation","Locations","canAccessGrafting","giveExploit","exploit","SUCCESS","giveAchievement","achievementId","achievement","achievements","ID","unlockedOn","Name","getIntelligenceBonus","weight","calculateIntelligenceBonus","getCasinoWinnings","casino","canAccessCotMG","sf","lvl","focusPenalty","BladeburnerConstants","CityNames","CyclesPerSecond","StaminaGainPerSecond","BaseStaminaLoss","MaxStaminaToGainFactor","DifficultyToTimeFactor","DiffMultExponentialFactor","DiffMultLinearFactor","EffAgiLinearFactor","EffDexLinearFactor","EffAgiExponentialFactor","EffDexExponentialFactor","BaseRecruitmentTimeNeeded","PopulationThreshold","PopulationExponent","ChaosThreshold","BaseStatGain","BaseIntGain","ActionCountGrowthPeriod","RankToFactionRepFactor","RankNeededForFaction","ContractSuccessesPerLevel","OperationSuccessesPerLevel","RanksPerSkillPoint","ContractBaseMoneyGain","HrcHpGain","HrcStaminaGain","programsMetadata","Program","run","FragmentType","Effect","tpe","HackingChance","HackingSpeed","HackingMoney","HackingGrow","Hacking","Strength","Defense","Dexterity","Agility","Charisma","HacknetMoney","HacknetCost","Rep","WorkMoney","Crime","Bladeburner","CorporationManagementHandbook","HistoryOfSynthoids","AGreenTomorrow","AlphaOmega","SimulatedReality","BeyondMan","BrighterThanTheSun","DemocracyIsDead","Sector12Crime","ManAndMachine","SecretSocieties","TheFailedFrontier","CodedIntelligence","SyntheticMuscles","TensionsInTechRace","CostOfImmortality","TheHiddenWorld","TheNewGod","NewTriads","TheSecretWar","StatsRow","content","root","cellNone","style","align","PositionTypes","borderBottom","small","width","TableCell","Table","removeLeadingSlash","removeTrailingSlash","endsWith","isValidFilename","isValidDirectoryName","isValidDirectoryPath","path","t_path","dirs","dir","isValidFilePath","fnSeparator","getFirstParentDirectory","getAllParentDirectories","lastSlash","getDestinationFilepath","destination","cwd","dstDir","evaluateDirectoryPath","fileName","getFileName","isInRootDirectory","currPath","reconstructedPath","pop","evaluateFilePath","areFilesEqual","f0","f1","areImportsEquals","initCompanies","oldCompanies","companiesMetadata","forEach","loadCompanies","AllGangs","power","loadAllGangs","Terminal","TTerminal","snackbar","zIndex","logBoxBaseZIndex","alignSelf","SnackbarProvider","dense","maxSnack","anchorOrigin","horizontal","vertical","autoHideDuration","containerRoot","EventEmitter","Snackbar","enqueueSnackbar","closeSnackbar","useSnackbar","useEffect","subscribe","variant","duration","id","severity","k","onClick","Crimes","Shoplift","CrimeType","SHOPLIFT","dexterity_success_weight","agility_success_weight","RobStore","ROB_STORE","hacking_success_weight","intelligence_exp","Mug","MUG","strength_success_weight","defense_success_weight","Larceny","LARCENY","DealDrugs","DRUGS","charisma_success_weight","BondForgery","BOND_FORGERY","TraffickArms","TRAFFIC_ARMS","Homicide","HOMICIDE","kills","GrandTheftAuto","GRAND_THEFT_AUTO","Kidnap","KIDNAP","Assassination","ASSASSINATION","Heist","HEIST","trusted","event","isTrusted","TheDarkArmyServer","DaedalusServer","DarkWeb","reputation","w0","w1","scaleWorkStats","scaleMoney","workStats","expStats","applyWorkStatsExp","gains","htmlLocation","margin","spacing","flexGrow","minHeight","boxSizing","uninitialized","isInitialized","page","allowRouting","toActiveScripts","toAugmentations","toBitVerse","toBladeburner","toStats","toCity","toCorporation","toCreateProgram","toDevMenu","toFaction","toFactions","toGameOptions","toGang","toHacknetNodes","toInfiltration","toJob","toMilestones","toGrafting","toScriptEditor","toSleeves","toStockMarket","toTerminal","toTravel","toTutorial","toWork","toBladeburnerCinematic","toLocation","toStaneksGift","toAchievements","toThemeBrowser","toImportSave","GameRoot","engine","terminal","files","vim","setEditorOptions","useState","setPage","RecoveryMode","Recovery","determineStartPage","setRerender","augPage","setAugPage","setFaction","isFactionWork","flume","setFlume","quick","setQuick","setLocation","Infiltration","Location","Job","cinematicText","setCinematicText","errorBoundaryKey","setErrorBoundaryKey","sidebarOpened","setSideBarOpened","importString","setImportString","importAutomatic","setImportAutomatic","ImportSave","allowRoutingCalls","setAllowRoutingCalls","rerender","old","killAllScripts","saveObject","saveGame","reload","softReset","installAugmentations","ActiveScripts","Augmentations","Stats","CreateProgram","DevMenu","Options","Gang","Hacknet","Milestones","Grafting","options","ScriptEditor","Sleeves","StockMarket","Tutorial","City","Travel","calculateAchievements","BitVerse","BladeburnerCinematic","StaneksGift","Achievements","ThemeBrowser","base64save","automatic","_functions","_wrap","scrollTo","mainPage","withSidebar","withPopups","bypassGame","router","enter","enterBitNode","staneksGift","getCurrentServer","workerScripts","reactivateTutorial","stockMarket","export","onExport","exportGame","forceKill","exportGameFn","installAugmentationsFn","Provider","killScripts","flexDirection","onToggled","isOpened","updateHashCapacity","costMult","seconds","onlineTimeSeconds","hashRate","totalHashesGenerated","prodMult","runScript","updateRamUsed","calculateHashGainRate","validScriptExtensions","isScriptFilename","some","ext","Orders","storedCycles","ticksUntilCycle","SymbolToStockMap","placeOrder","shares","Stock","order","Order","symbol","orders","stk","processOrderRefs","symbolToStockMap","processOrders","cancelOrder","stockOrders","stockSymbol","orderTxt","loadStockMarket","deleteStockMarket","initStockMarket","InitStockMetadata","TicksPerCycle","initSymbolToStockMap","StockSymbols","cyclesPerStockUpdate","processStockPrices","timeNow","flipForecastForecast","stockMarketCycle","av","mv","chc","otlkMag","cap","changePrice","OrderTypes","LimitBuy","Short","LimitSell","Long","StopBuy","StopSell","otlkMagChange","cycleForecast","cycleForecastForecast","shareTxUntilMovement","shareTxForMovement","initStockMarketFn","IshimaStormTechnologies","NewTokyoDefComm","VolhavenHeliosLabs","NewTokyoVitaLife","Sector12IcarusMicrosystems","Sector12UniversalEnergy","AevumAeroCorp","VolhavenOmniaCybersystems","ChongqingSolarisSpaceSystems","NewTokyoGlobalPharmaceuticals","IshimaNovaMedical","AevumWatchdogSecurity","VolhavenLexoCorp","AevumRhoConstruction","Sector12AlphaEnterprises","VolhavenSysCoreSecurities","VolhavenCompuTek","AevumNetLinkTechnologies","IshimaOmegaSoftware","Sector12FoodNStuff","Sector12JoesGuns","difficultyMult","skillMult","chance","expGain","HackExpGain","percentMoneyHacked","ScriptHackMoney","skillFactor","calculateGrowTime","calculateWeakenTime","applySleeveGains","rawStats","shockedStats","shockBonus","syncStats","syncBonus","__player","loadStaneksGift","zeros","height","array","fill","calculateGrid","gift","newgrid","fragmentAt","inviteToFaction","InvitationEvent","joinFaction","allFactions","factionInfo","enemy","enemies","hasAugmentationPrereqs","purchaseAugmentation","hasPrereqs","augCosts","queuedAugmentation","req","processPassiveFactionRepGain","offersWork","getGangName","favorMult","hRep","getHackingWorkRepGain","sRep","getFactionSecurityWorkRepGain","fRep","getFactionFieldWorkRepGain","FactionPassiveRepGain","getFactionAugmentationsFiltered","hasGangWith","augs","CongruityImplant","TheRedPill","rng","SFC32RNG","uniqueFilter","GangUniqueAugs","BitburnerSaveObject","getSaveString","PlayerSave","AllServersSave","CompaniesSave","FactionsSave","AliasesSave","Aliases","GlobalAliasesSave","GlobalAliases","StockMarketSave","SettingsSave","VersionSave","LastExportBonus","ExportBonus","StaneksGiftSave","inGang","AllGangsSave","btoa","unescape","encodeURIComponent","emitToastEvent","savedOn","lastSave","saveData","playerIdentifier","identifier","getSaveFileName","pushGameSaved","INFO","catch","isRecovery","epochTime","now","bn","download","importGame","base64Save","getImportStringFromFile","file","reader","FileReader","promise","onload","readAsText","newSave","parsedSave","atob","base64","importedPlayer","playerData","bitNode","bitNodeLevel","loadGame","navigator","userAgent","setInterval","decodeURIComponent","escape","saveObj","loadAliases","loadGlobalAliases","ver","anyPlayer","companyPosition","positionName","companyPositions","changes","convert","code","change","v1APIBreak","AwardNFG","revenue","expenses","lastCycleRevenue","lastCycleExpenses","thisCycleRevenue","thisCycleExpenses","resleeves","contract","contracts","v22PlayerBreak","ownedNFGs","newNFG","nfg","darkweb","pushProgram","graft","v2APIBreak","removePlayerFields","removeSleeveFields","Number","field","anySleeve","evaluateVersionCompatibility","href","resets","createNewUpdateText","whiteSpace","paddingLeft","lineHeight","Blob","document","createElement","URL","createObjectURL","body","appendChild","click","removeChild","revokeObjectURL","companyPositionMetadata","CompanyPosition","FactionWorkType","Exploit","names","Bypass","EditSaveFile","PrototypeTampering","TimeCompression","Unclickable","UndocumentedFunctionCall","RealityAlteration","N00dles","YoureNotMeantToAccessThis","TrueRecursion","INeedARainbow","ExploitName","Set","initAugmentations","resetFactionAugmentations","clearObject","initNeuroFluxGovernor","initUnstableCircadianModulator","initGeneralAugmentations","initBladeburnerAugmentations","ChurchOfTheMachineGod","initChurchOfTheMachineGodAugmentations","resetAugmentation","augmentationExists","AddToStaticAugmentations","reapply","staticAugmentation","mergeMultipliers","applyEntropy","ownedNfg","pAug","ownedAug","force","augmentationList","nfgIndex","isRepeatableAug","MoneyRate","CodingContractType","gen","solver","diff","numTries","generate","CodingContractTypes","md","codingContractTypesMetadata","CodingContractResult","CodingContract","getData","getDescription","getDifficulty","getMaxNumTries","getType","isSolution","solution","Cancelled","onAttempt","val","Success","Failure","CodingContractEvent","Fragments","Fragment","shape","limit","fullAt","rotation","sy","mx","my","qx","qy","neighboors","candidates","add","coord","cells","candidate","cell","copy","FragmentById","fragment","_","X","Shapes","S","Z","T","I","J","O","Booster","NoneFragment","None","DeleteFragment","Delete","base","inherit","common","accent","bg","fg","syntax","tag","entity","regexp","markup","keyword","comment","constant","ui","panel","selected","selection","colorRegExp","sanitizeTheme","repairBlock","block","makeTheme","themeRules","token","foreground","themeColors","fromEntries","rules","loadThemes","monaco","editor","defineTheme","fontStyle","uuidv4","uuid","subscribers","sub","Adjuster","setValue","label","placeholder","subtract","tons","onChange","InputProps","startAdornment","title","transform","endAdornment","upArrowSymbol","downArrowSymbol","leftArrowSymbol","rightArrowSymbol","getArrow","UP_ARROW","W","LEFT_ARROW","DOWN_ARROW","RIGHT_ARROW","D","getInverseArrow","getActionTimePenalty","getChaosCompetencePenalty","getChaosDifficultyBonus","makeNode","Node","text","createBaseResearchTreeNodes","rootNode","autoBrew","autoParty","autoDrugs","bulkPurchasing","cph4","drones","dronesAssembly","dronesTransport","goJuice","hrRecruitment","hrTraining","joywire","marketta1","marketta2","overclock","scAssemblers","stimu","addChild","baseResearchTree","ResearchTree","setRoot","upgradeFulcrum","upgradeCapacity1","upgradeCapacity2","upgradeDashboard","numCycleForGrowth","growth","ajdGrowthRate","serverGrowthPercentage","coreBonus","ServerGrowthRate","numCycleForGrowthCorrected","targetMoney","startMoney","adjGrowthRate","exponentialBase","coreMultiplier","threadMultiplier","ey","bt","corr","bct","opc","fca","cca","processSingleServerGrowth","calculateServerGrowth","oldMoneyAvailable","isValidNumber","usedCycles","prestigeHomeComputer","homeComp","hasBitflume","BitFlume","updateRamUsage","getServerOnNetwork","isBackdoorInstalled","MoneyCost","OptionSwitch","checked","tooltip","control","SkillNames","BladesIntuition","Cloak","Marksman","WeaponProficiency","ShortCircuit","DigitalObserver","Tracer","Overclock","Reaper","EvasiveSystem","Datamancer","CybersEdge","HandsOfMidas","Hyperdrive","rep","Reputation","useGang","killWorkerScript","WorkerScript","stopAndCleanUpWorkerScript","killWorkerScriptByPid","clearTimeout","atExit","rs","delete","AddRecentScript","WorkerScriptStartStopEventEmitter","removeWorkerScript","BitNode","BitNodes","HomeComputerRamCost","PurchasedServerCost","PurchasedServerSoftcap","CompanyWorkMoney","CrimeMoney","HacknetNodeMoney","ClassGymExpGain","CompanyWorkExpGain","CrimeExpGain","FactionWorkExpGain","FactionWorkRepGain","RepToDonateToFaction","InfiltrationMoney","InfiltrationRep","FourSigmaMarketDataCost","FourSigmaMarketDataApiCost","CorporationValuation","CorporationSoftcap","BladeburnerRank","BladeburnerSkillCost","GangSoftcap","StaneksGiftPowerMultiplier","StaneksGiftExtraSize","getBitNodeMultipliers","inc","dec","initBitNodeMultipliers","defaultConstructorParams","initPrice","marketCap","spreadPerc","range","divisor","lastPrice","playerShares","playerAvgPx","playerShortShares","playerAvgShortPx","otlkMagForecast","getAbsoluteForecast","totalSharesUnrounded","totalShares","maxShares","changeForecastForecast","newff","newPrice","changeAmt","increaseChance","getForecastIncreaseChance","getAskPrice","getBidPrice","influenceForecast","influenceForecastForecast","startingLevel","extraLevels","totalMultiplier","startingRam","totalCost","numUpgrades","currentRam","startingCores","currentCores","startingCache","currentCache","printAliases","print","parseAliasDeclaration","global","matches","addGlobalAlias","addAlias","getAlias","getGlobalAlias","removeAlias","substituteAliases","origCommand","commandArray","somethingSubstituted","depth","alias","constructLocation","asciiArt","LocationsMetadata","addLocation","layerCounter","LogBoxEvents","LogBoxCloserEvents","LogBoxClearEvents","LogBoxPositionEvents","LogBoxSizeEvents","LogBoxManager","closePid","LogWindow","close","overflowY","overflowX","wordWrap","titleButton","draggableRef","useRef","rootRef","setScript","container","setSize","minimized","setMinimized","setPosition","state","kill","startWorkerScript","updateLayer","full","maxLength","minimize","innerWidth","innerHeight","clearInterval","addEventListener","onWindowResize","removeEventListener","debounce","isOnScreen","bounds","getBoundingClientRect","right","bottom","left","top","outerWidth","minConstraints","handle","onDrag","MouseEvent","clientX","clientY","ref","onMouseDown","flexFlow","minWidth","welllight","onResize","cursor","fontSize","marginRight","textOverflow","has","onTouchEnd","Literature","CopyableText","setOpen","copyText","select","setSelectionRange","execCommand","ThemeEvents","refreshTheme","createTheme","combat","backgroundprimary","backgroundsecondary","button","successlight","success","successdark","white","black","light","primarylight","primarydark","secondary","secondarylight","secondarydark","errorlight","errordark","infolight","infodark","warning","warninglight","warningdark","well","typography","fontFamily","textTransform","components","MuiInputBase","styleOverrides","input","userSelect","MuiInput","borderBottomColor","underline","MuiInputLabel","MuiButtonGroup","MuiButton","borderRadius","MuiSelect","icon","defaultProps","MuiTextField","MuiTypography","MuiMenu","list","MuiMenuItem","MuiAccordionSummary","MuiAccordionDetails","MuiIconButton","MuiTooltip","disableInteractive","MuiSlider","valueLabel","MuiDrawer","paperAnchorDockedLeft","borderRight","MuiDivider","MuiFormControlLabel","MuiSwitch","switchBase","track","MuiPaper","MuiTablePagination","selectLabel","displayedRows","MuiTab","textColorPrimary","MuiTabs","scrollButtons","opacity","TabIndicatorProps","MuiAlert","standardSuccess","standardError","standardWarning","standardInfo","TTheme","injectFirst","Water","Plants","Metal","Hardware","Chemicals","Drugs","Robots","AICores","calculateExp","skill","currentSkill","nextSkill","baseExperience","nextExperience","progress","currentExperience","remainingExperience","experience","UpgradeType","gangMemberUpgradesMetadata","upgType","Weapon","Armor","Vehicle","Rootkit","NetscriptPort","prestigeWorkerScripts","clear","startNetscript1Script","codeWithImports","codeLineOffset","interpreter","importProcessingRes","ast","ecmaVersion","allowReserved","sourceType","generatedCode","hasImports","walksimple","ImportDeclaration","scriptName","getScript","scriptAst","specifiers","namespace","local","fnNames","fnDeclarations","FunctionDeclaration","fnsToImport","lineOffset","linesRemoved","processNetscript1Imports","Interpreter","wrapNS1Layer","intLayer","nsLayer","prev","newPath","vars","entry","wrapper","callback","pseudoToNative","nativeToPseudo","errorTextArray","errorMsg","setProperty","createAsyncFunction","properties","runInterpreter","more","step","_e","parent","createAndAddWorkerScript","oneRamUsage","getRamUsageFromRunningScript","roundToTwo","generateNextPid","NetscriptFunctions","set","scriptExecution","executeJSScript","SyntaxError","startNetscript2Script","updateOnlineScriptTimes","loadAllRunningScripts","skipScriptLoad","markUpdated","scriptCalculateOfflineProduction","runScriptFromScript","ramAvailable","RunningScript","GangConstants","GangRespectToReputationRatio","MaximumGangMembers","CyclesPerTerritoryAndPowerUpdate","AscensionMultiplierRatio","Names","GangKarmaRequirement","buyStock","opts","suppressDialog","totalPrice","getBuyTransactionCost","origTotal","newTotal","processTransactionForecastMovement","rerenderFn","resultTxt","sellStock","getSellTransactionGain","netProfit","shortStock","sellShort","origCost","gainFavor","getFavorGain","totalRep","favorToRep","repToFavor","Map","Material","getMarkupLimit","qlt","mku","dmd","dmdR","cmp","cmpR","processMarket","priceChange","compChange","dmdChange","calculateWantedPenalty","calculateRespectGain","task","baseRespect","statWeight","hackWeight","strWeight","defWeight","dexWeight","agiWeight","chaWeight","territoryMult","territoryPenalty","respectMult","calculateWantedLevelGain","baseWanted","wanted","calc","calculateMoneyGain","baseMoney","calculateAscensionPointsGain","calculateAscensionMult","points","RFAMessage","method","isFileData","pf","isFileLocation","isFileServer","GameTimer","setV","totalMillis","WKSharmonizer","millis","intervalId","onExpire","noPaper","mb","m0","m1","ActionIdentifier","general","ops","blackops","events","updateSkillMultipliers","calculateMaxStamina","stamina","maxStamina","getCurrentCity","calculateStaminaPenalty","canAttemptBlackOp","actionId","getActionObject","reqdRank","rank","nm","BlackOperations","isAvailable","startAction","person","actionTimeCurrent","actionTimeToComplete","resetAction","getActionTime","exceptionAlert","comms","testBlackOp","getRecruitmentTime","upgradeSkill","skillName","executeConsoleCommands","commands","consoleHistory","arrayOfCommands","executeConsoleCommand","postToConsole","saveToLogs","consoleLogs","getTimestamp","clearConsole","bladeburnerFac","storeCycles","getActionIdFromTypeAndName","convertedType","convertedName","operations","executeStartConsoleCommand","GeneralActions","executeSkillConsoleCommand","skillNames","Skills","multKeys","skillMultipliers","Skill","currentLevel","pointCost","calculateCost","maxLvl","executeLogConsoleCommand","flag","logging","executeHelpConsoleCommand","ConsoleHelpText","helpList","helpText","executeAutomateConsoleCommand","variable","highLow","automateActionHigh","automateActionLow","automateThreshHigh","automateThreshLow","automateEnabled","parseCommandArguments","command","start","endQuote","SPACE","substr","triggerMigration","sourceCityName","destCityName","destCity","sourceCity","percentage","triggerPotentialMigration","randomEvent","chaos","getActionStats","successMult","unweightedGain","unweightedIntGain","weights","getDiplomacyEffectiveness","getRecruitmentSuccessChance","teamSize","sleeveSize","effCharisma","effCha","charismaFactor","sleeveSupport","joining","resetSkillMultipliers","successChanceAll","successChanceStealth","successChanceKill","successChanceContract","successChanceOperation","successChanceEstimate","actionTime","effHack","effStr","effDef","effDex","effAgi","effInt","multiplierNames","multiplierName","getMultiplier","multiplierValue","completeOperation","teamCount","losses","sup","isSleeveSupportWork","teamLost","improvePopulationEstimateByPercentage","changePopulationByPercentage","changeEstEqually","nonZero","changeChaosByCount","changeChaosByPercentage","changePopulationByCount","estChange","estOffset","completeContract","actionIdent","improvePopulationEstimateByCount","completeAction","isPlayer","createTaskTracker","isOperation","difficultyMultiplier","rewardMultiplier","rewardFac","attempt","successes","setMaxLevel","rankGain","gain","addOffset","whoAmI","failures","loss","damage","rankLoss","hpLoss","hpLost","calculateHospitalizationCost","numHosp","moneyLost","logLossText","autoLevel","teamLossMax","strExpGain","defExpGain","dexExpGain","agiExpGain","staminaGain","staminaBonus","eff","hackingExpGain","charismaExpGain","successChance","recruitTime","growthF","Growths","operation","infiltrateSynthoidCommunities","infilSleeves","isSleeveInfiltrateWork","maxRank","bladeburnersFactionName","favorBonus","rankNeededForSp","totalSkillPoints","gainedSkillPoints","processAction","actionTimeOverflow","calculateStaminaGainPerSecond","effAgility","maxStaminaBonus","oldMax","difficultyFac","decays","isStealth","isKill","BladesSimulacrum","op","randomEventCounter","getTypeAndNameFromActionId","types","getContractNamesNetscriptFn","getOperationNamesNetscriptFn","getBlackOpNamesNetscriptFn","getGeneralActionNamesNetscriptFn","getSkillNamesNetscriptFn","startActionNetscriptFn","errorLogText","canRunOp","getActionTimeNetscriptFn","actionObj","getActionEstimatedSuccessChanceNetscriptFn","getEstSuccessChance","recChance","getActionCountRemainingNetscriptFn","getSkillLevelNetscriptFn","getSkillUpgradeCostNetscriptFn","upgradeSkillNetscriptFn","getTeamSizeNetscriptFn","setTeamSizeNetscriptFn","sanitizedSize","joinBladeburnerFactionNetscriptFn","calculateMoneyGainRate","startingCore","sanitizedCores","coreBaseCost","win","reachedLimit","reached","Game","interpolate","settings","lerpD","lerp","Trivial","Normal","Hard","Impossible","KeyHandler","press","onKeyDown","FACTION","FactionWork","factionWorkType","HACKING","getFaction","getReputationRate","focusBonus","NeuroreceptorManager","calculateFactionRep","getExpRates","calculateFactionExp","Hashes","updateMoneyGainRate","moneyGainRatePerSecond","totalMoneyGenerated","minMax","getPurchaseServerCost","sanitizedRam","isPowerOfTwo","sign","getPurchaseServerMaxRam","getPurchaseServerLimit","clz32","purchaseServer","newServ","purchaseRamForHomeComputer","getUpgradeHomeRamCost","TextFile","append","read","show","write","getTextFile","textFiles","createTextFile","CalculateShareMult","RamCostConstants","ScriptBaseRamCost","ScriptDomRamCost","ScriptCorporationRamCost","ScriptHackRamCost","ScriptHackAnalyzeRamCost","ScriptGrowRamCost","ScriptGrowthAnalyzeRamCost","ScriptWeakenRamCost","ScriptWeakenAnalyzeRamCost","ScriptScanRamCost","ScriptRecentScriptsRamCost","ScriptPortProgramRamCost","ScriptRunRamCost","ScriptExecRamCost","ScriptSpawnRamCost","ScriptScpRamCost","ScriptKillRamCost","ScriptHasRootAccessRamCost","ScriptGetHostnameRamCost","ScriptGetHackingLevelRamCost","ScriptGetMultipliersRamCost","ScriptGetServerRamCost","ScriptGetServerMaxRam","ScriptGetServerUsedRam","ScriptFileExistsRamCost","ScriptIsRunningRamCost","ScriptHacknetNodesRamCost","ScriptHNUpgLevelRamCost","ScriptHNUpgRamRamCost","ScriptHNUpgCoreRamCost","ScriptGetStockRamCost","ScriptBuySellStockRamCost","ScriptGetPurchaseServerRamCost","ScriptPurchaseServerRamCost","ScriptGetPurchasedServerLimit","ScriptGetPurchasedServerMaxRam","ScriptRoundRamCost","ScriptReadWriteRamCost","ScriptArbScriptRamCost","ScriptGetScriptRamCost","ScriptGetRunningScriptRamCost","ScriptGetHackTimeRamCost","ScriptGetFavorToDonate","ScriptCodingContractBaseRamCost","ScriptSleeveBaseRamCost","ScriptClearTerminalCost","ScriptSingularityFn1RamCost","ScriptSingularityFn2RamCost","ScriptSingularityFn3RamCost","ScriptGangApiBaseRamCost","ScriptBladeburnerApiBaseRamCost","ScriptStanekWidth","ScriptStanekHeight","ScriptStanekCharge","ScriptStanekFragmentDefinitions","ScriptStanekPlacedFragments","ScriptStanekClear","ScriptStanekCanPlace","ScriptStanekPlace","ScriptStanekFragmentAt","ScriptStanekDeleteAt","ScriptInfiltrationCalculateDifficulty","ScriptInfiltrationCalculateRewards","ScriptInfiltrationGetLocations","ScriptInfiltrationGetInfiltrations","ScriptStanekAcceptGift","SF4Cost","sf4","hasWSEAccount","hasTIXAPIAccess","has4SDataTIXAPI","getSymbols","getPrice","getPosition","getMaxShares","getPurchaseCost","getSaleGain","buyShort","getOrders","getVolatility","getForecast","purchase4SMarketData","purchase4SMarketDataTixApi","purchaseWseAccount","purchaseTixApi","universityCourse","gymWorkout","travelToCity","goToLocation","purchaseTor","purchaseProgram","connect","manualHack","installBackdoor","getDarkwebProgramCost","getDarkwebPrograms","isBusy","stopAction","upgradeHomeRam","upgradeHomeCores","getUpgradeHomeCoresCost","workForCompany","applyToCompany","getCompanyFavor","getCompanyFavorGain","checkFactionInvitations","workForFaction","getFactionRep","getFactionFavor","getFactionFavorGain","donateToFaction","createProgram","commitCrime","getCrimeChance","getCrimeStats","getOwnedAugmentations","getOwnedSourceFiles","getAugmentationsFromFaction","getAugmentationCost","getAugmentationPrereq","getAugmentationPrice","getAugmentationBasePrice","getAugmentationRepReq","getAugmentationStats","isFocused","setFocus","b1tflum3","destroyW0r1dD43m0n","getCurrentWork","createGang","getMemberNames","getGangInformation","getOtherGangInformation","getMemberInformation","canRecruitMember","recruitMember","getTaskNames","getTaskStats","setMemberTask","getEquipmentNames","getEquipmentCost","getEquipmentType","getEquipmentStats","purchaseEquipment","ascendMember","getAscensionResult","setTerritoryWarfare","getChanceToWinClash","getBonusTime","getContractNames","getOperationNames","getBlackOpNames","getBlackOpRank","getGeneralActionNames","getSkillNames","stopBladeburnerAction","getCurrentAction","getActionCurrentTime","getActionEstimatedSuccessChance","getActionRepGain","getActionCountRemaining","getActionMaxLevel","getActionCurrentLevel","getActionAutolevel","setActionAutolevel","setActionLevel","getRank","getSkillPoints","getSkillLevel","getSkillUpgradeCost","getTeamSize","setTeamSize","getCityEstimatedPopulation","getCityCommunities","getCityChaos","getCity","switchCity","getStamina","joinBladeburnerFaction","joinBladeburnerDivision","infiltration","getPossibleLocations","getInfiltration","codingcontract","getContractType","getNumTriesRemaining","getNumSleeves","setToShockRecovery","setToSynchronize","setToCommitCrime","setToUniversityCourse","setToCompanyWork","setToFactionWork","setToGymWorkout","getSleeveStats","getTask","getInformation","getSleeveAugmentations","getSleevePurchasableAugs","purchaseSleeveAug","setToBladeburnerAction","getSleeveAugmentationPrice","getSleeveAugmentationRepReq","stanek","giftWidth","giftHeight","chargeFragment","fragmentDefinitions","activeFragments","clearGift","canPlaceFragment","placeFragment","getFragment","removeFragment","acceptGift","SourceRamCosts","enums","getMaterialNames","getIndustryTypes","getUnlockables","getUpgradeNames","getResearchNames","createCorporation","hasUnlockUpgrade","getUnlockUpgradeCost","getUpgradeLevel","getUpgradeLevelCost","getExpandIndustryCost","getExpandCityCost","getInvestmentOffer","acceptInvestmentOffer","goPublic","bribe","getCorporation","getDivision","expandIndustry","expandCity","unlockUpgrade","levelUpgrade","issueDividends","buyBackShares","sellShares","sellMaterial","sellProduct","discontinueProduct","setSmartSupply","setSmartSupplyUseLeftovers","buyMaterial","bulkPurchase","getWarehouse","getProduct","getMaterial","setMaterialMarketTA1","setMaterialMarketTA2","setProductMarketTA1","setProductMarketTA2","exportMaterial","cancelExportMaterial","purchaseWarehouse","upgradeWarehouse","makeProduct","limitMaterialProduction","limitProductProduction","getPurchaseWarehouseCost","getUpgradeWarehouseCost","hasWarehouse","assignJob","hireEmployee","upgradeOfficeSize","throwParty","buyCoffee","hireAdVert","getOffice","getEmployee","getHireAdVertCost","getHireAdVertCount","getResearchCost","hasResearched","setAutoJobAssignment","getOfficeSizeUpgradeCost","hacknet","numNodes","purchaseNode","getPurchaseNodeCost","getNodeStats","getLevelUpgradeCost","getRamUpgradeCost","getCoreUpgradeCost","getCacheUpgradeCost","numHashes","hashCost","spendHashes","maxNumNodes","getHashUpgrades","getHashUpgradeLevel","getStudyMult","getTrainingMult","getTheme","setTheme","resetTheme","getStyles","setStyles","resetStyles","getGameInfo","clearTerminal","windowSize","grafting","getAugmentationGraftPrice","getAugmentationGraftTime","getGraftableAugmentations","graftAugmentation","sprintf","vsprintf","scan","hackAnalyzeThreads","hackAnalyze","hackAnalyzeSecurity","hackAnalyzeChance","sleep","asleep","share","getSharePower","grow","growthAnalyze","growthAnalyzeSecurity","weakenAnalyze","printf","tprint","tprintf","clearLog","disableLog","enableLog","isLogEnabled","getScriptLogs","nuke","brutessh","ftpcrack","relaysmtp","httpworm","sqlinject","exec","spawn","killall","exit","scp","ls","ps","getRecentScripts","hasRootAccess","getHostname","getHackingLevel","getHackingMultipliers","getHacknetMultipliers","getServerMoneyAvailable","getServerSecurityLevel","getServerBaseSecurityLevel","getServerMinSecurityLevel","getServerRequiredHackingLevel","getServerMaxMoney","getServerGrowth","getServerNumPortsRequired","getServerRam","getServerMaxRam","getServerUsedRam","serverExists","fileExists","getPurchasedServerLimit","getPurchasedServerMaxRam","getPurchasedServerCost","deleteServer","getPurchasedServers","tryWritePort","peek","writePort","readPort","getPortHandle","rm","scriptRunning","scriptKill","getScriptName","getScriptRam","getHackTime","getGrowTime","getWeakenTime","getTotalScriptIncome","getScriptIncome","getTotalScriptExpGain","getScriptExpGain","nFormat","tFormat","getTimeSinceLastAug","prompt","wget","getFavorToDonate","getPlayer","tail","toast","moveTail","resizeTail","closeTail","clearPort","openDevMenu","alert","flags","bypass","alterReality","rainbow","heart","break","formulas","mockServer","mockPlayer","calculateFavorToRep","calculateRepToFavor","repFromDonation","hackPercent","growPercent","hackTime","growTime","weakenTime","moneyGainRate","levelUpgradeCost","ramUpgradeCost","coreUpgradeCost","hacknetNodeCost","constants","hacknetServers","hashGainRate","cacheUpgradeCost","hashUpgradeCost","hacknetServerCost","wantedPenalty","respectGain","wantedLevelGain","ascensionPointsGain","ascensionMultiplier","work","crimeGains","classGains","factionGains","RamCosts","getRamCost","currType","costInc","posType","firstShares","remainingShares","numIterations","forecastChange","forecastForecastChange","calculateBuyMaxAmount","isLong","remainingMoney","currPrice","GangMemberUpgrades","GangMemberUpgrade","getStockMarket4SDataCost","getStockMarket4STixApiCost","getStockMarketWseCost","getStockMarketTixApiCost","NumberInput","textProps","HashUpgradesMetadata","HashUpgrade","GangMemberTasks","gangMemberTasksMetadata","isHacking","isCombat","materials","updateMaterialSizeUsed","matName","getStorageMultiplier","Output","formatTime","RawOutput","raw","Link","dashes","TTimer","timeLeft","recursiveMode","thisUpgrade","unFloored","ConfirmationModal","confirmationText","onConfirm","additionalButton","createProgressBarText","derived","totalTicks","bars","hash","__COMMIT_HASH__","gameCPS","classs","discount","calculateClassEarnings","locationName","hashMult","expMult","globalModuleSequenceNumber","Script","otherScripts","moduleSequenceNumber","saveScript","formatCode","dependent","dependents","dependentScript","calculateRamUsage","ramUsageEntries","imports","StatsTable","rows","wide","MuiTable","row","elem","noWrap","DarkWebItems","BruteSSHProgram","DarkWebItem","FTPCrackProgram","RelaySMTPProgram","HTTPWormProgram","SQLInjectProgram","ServerProfiler","DeepscanV1","DeepscanV2","AutolinkProgram","AutoLink","FormulasProgram","Formulas","actionNames","actionName","Action","Suit","Card","suit","formatValue","isRedSuit","Hearts","Diamonds","getStringRepresentation","SourceFile","bitnodeKey","bitnode","timePassed","confidence","dataMap","serv","timesGrown","host","timesWeakened","compareArrays","COMPANY","SleeveCompanyWork","NewTokyoNoodleBar","getCompany","getGainRates","calculateCompanyWorkStats","influenceStockThroughCompanyWork","achievementData","bitNodeFinishedState","wd","OperationDaedalus","hasAccessToSF","knowsAboutBitverse","Icon","Condition","THE_BLACK_HAND","THE_COVENANT","Visible","MONEY_1Q","MONEY_M1B","Secret","INSTALL_1","INSTALL_100","QUEUE_40","HACKING_100000","COMBAT_3000","NEUROFLUX_255","NS2","FROZE","RUNNING_SCRIPTS_1000","running","DRAIN_SERVER","MAX_RAM","MAX_CORES","SCRIPTS_30","KARMA_1000000","STOCK_1q","DISCOUNT","SCRIPT_32GB","FIRST_HACKNET_NODE","MAX_HACKNET_NODE","HACKNET_NODE_10M","REPUTATION_10M","DONATION","TRAVEL","WORKOUT","TOR","hasTorRouter","HOSPITALIZED","hospitalization","GANG","FULL_GANG","members","GANG_TERRITORY","GANG_MEMBER_POWER","CORPORATION","CORPORATION_BRIBE","CORPORATION_PROD_1000","CORPORATION_EMPLOYEE_3000","CORPORATION_REAL_ESTATE","Description","INTELLIGENCE_255","BLADEBURNER_DIVISION","BLADEBURNER_OVERCLOCK","BLADEBURNER_UNSPENT_100000","FIRST_HACKNET_SERVER","AdditionalUnlock","ALL_HACKNET_SERVER","MAX_HACKNET_SERVER","hs","HACKNET_SERVER_1B","MAX_CACHE","capacity","SLEEVE_8","INDECISIVE","FAST_BN","CHALLENGE_BN1","CHALLENGE_BN2","CHALLENGE_BN3","CHALLENGE_BN6","CHALLENGE_BN7","CHALLENGE_BN8","CHALLENGE_BN9","hacknet_expenses","CHALLENGE_BN10","CHALLENGE_BN12","BYPASS","PROTOTYPETAMPERING","UNCLICKABLE","UNDOCUMENTEDFUNCTIONCALL","TIMECOMPRESSION","REALITYALTERATION","N00DLES","EDITSAVEFILE","UNACHIEVABLE","CHALLENGE_BN13","StaneksGift1","DEVMENU","RAINBOW","TRUE_RECURSION","playerAchievements","missingAchievements","flatMap","DefaultConstructorParams","expMultiplier","salaryMultiplier","isPlayerEmployed","isMegacorp","hasAgentPositions","hasBusinessConsultantPositions","hasBusinessPositions","hasEmployeePositions","hasITPositions","hasSecurityPositions","hasSoftwareConsultantPositions","hasSoftwarePositions","hasWaiterPositions","vals","MathJaxWrapper","version","src","lineNumber","isSleeveBladeburnerWork","BLADEBURNER","SleeveBladeburnerWork","actionType","cyclesNeeded","ret","CorporationUnlockUpgradeIndex","CorporationUnlockUpgrades","Export","SmartSupply","MarketResearchDemand","MarketDataCompetition","VeChain","ShadyAccounting","GovernmentPartnership","WarehouseAPI","OfficeAPI","getGraftingAvailableAugs","augName","graftingIntBonus","calculateGraftingTimeWithBonus","OperationTyphoon","OperationZero","OperationX","OperationTitan","OperationAres","OperationArchangel","OperationJuggernaut","OperationRedDragon","OperationK","OperationDeckard","OperationTyrell","OperationWallace","OperationShoulderOfOrion","OperationHyron","OperationMorpheus","OperationIonStorm","OperationAnnihilus","OperationUltron","OperationCenturion","OperationVindictus","ActiveFragment","highestCharge","numCharge","collide","other","thisFragment","otherFragment","dx","dy","fragSize","worldX","worldY","GameOptionsTab","workName","commit","div","startWork","CrimeWork","crimeType","successRate","HashRate","Message","ApplyToJobButton","getJobRequirementTooltip","researchMetadata","isSleeveFactionWork","SleeveFactionWork","FIELD","SECURITY","initElectron","normalizeFileName","getFiles","deleteFile","removeFile","saveFile","Buffer","overwritten","writeToScriptFile","initWebserver","funcs","typesFn","appNotifier","initAppNotifier","triggerSave","triggerGameExport","ERROR","triggerScriptsExport","exportScripts","getSaveData","getSaveInfo","getImportDataFromString","pushSaveData","appSaveFns","initSaveFunctions","bridge","electronBridge","receive","send","initElectronBridge","pushGameReady","playtime","game","pushImportResult","wasImported","pushDisableRestore","isCreateProgramWork","CREATE_PROGRAM","CreateProgramWork","unitCompleted","programFile","percComplete","unitNeeded","getProgram","reqLvl","cancelled","incompleteName","lines","Intelligence","useTheme","scope","colSpan","WorkInProgressOverview","onClickFocus","header","workCell","workHeader","pt","pb","workSubtitles","mt","details","innerText","isCrimeWork","crime","getCrime","isGraftingWork","factionWork","companyWork","textAlign","CharacterOverview","killOpen","setKillOpen","hackingProgress","strengthProgress","defenseProgress","dexterityProgress","agilityProgress","charismaProgress","borderTop","flex","aria-label","midpoint","program","description","BadRNG","WHRNG","s1","s2","s3","genSeed","CompanyWork","GameOptionsPage","Favor","TerminalEvents","TerminalClearEvents","orderType","refs","orderBook","executeOrder","isBuy","predefined","getPredefinedThemes","AlertManager","alerts","setAlerts","sha256","getMessageHash","overflowWrap","getRandomByte","SUPPORT","SleeveSupportWork","recentScripts","killedTime","unshift","timeOfDeath","getDB","indexedDB","indexedDbRequest","onupgradeneeded","createObjectStore","onerror","ev","onsuccess","db","transaction","objectStore","request","put","deleteGame","sendMessage","forced","showMessage","recvd","addMessageToServer","Messages","checkForMessagesToSend","jumper0","MessageFilenames","Jumper0","jumper1","Jumper1","jumper2","Jumper2","jumper3","Jumper3","jumper4","Jumper4","cybersecTest","CyberSecTest","nitesecTest","NiteSecTest","bitrunnersTest","BitRunnersTest","truthGazer","TruthGazer","redpill","RedPill","worldDaemon","flightName","Flight","isSleeveClassWork","SleeveClassWork","isSleeveCrimeWork","CRIME","SleeveCrimeWork","getExp","fmt","problemType","getRandomProblemType","getRandomReward","randServer","getRandomServer","contractFn","getRandomFilename","addContract","generateRandomContractOnHome","generateContract","problemTypes","rewardType","factionsThatAllowHacking","offerHackingWork","sanitizeRewardType","numFactions","randFaction","allJobs","randIndex","canGetBonus","setLastExportBonus","unixTime","ReputationRate","Option","buttonText","infoText","getTeamSuccessBonus","inst","getActionTypeSkillSuccessBonus","MightOfAres","WisdomOfAthena","ChaosOfDionysus","BeautyOfAphrodite","TrickeryOfHermes","FloodOfPoseidon","HuntOfArtemis","KnowledgeOfApollo","HemoRecirculator","Targeting1","Targeting2","Targeting3","SyntheticHeart","SynfibrilMuscle","CombatRib1","CombatRib2","CombatRib3","NanofiberWeave","SubdermalArmor","WiredReflexes","GrapheneBoneLacings","BionicSpine","GrapheneBionicSpine","BionicLegs","GrapheneBionicLegs","SpeechProcessor","TITN41Injection","EnhancedSocialInteractionImplant","BitWire","ArtificialBioNeuralNetwork","ArtificialSynapticPotentiation","EnhancedMyelinSheathing","SynapticEnhancement","NeuralRetentionEnhancement","DataJack","ENM","ENMCore","ENMCoreV2","ENMCoreV3","ENMAnalyzeEngine","ENMDMA","Neuralstimulator","NeuralAccelerator","CranialSignalProcessorsG1","CranialSignalProcessorsG2","CranialSignalProcessorsG3","CranialSignalProcessorsG4","CranialSignalProcessorsG5","NeuronalDensification","NuoptimalInjectorImplant","SpeechEnhancement","FocusWire","PCDNI","PCDNIOptimizer","PCDNINeuralNetwork","ADRPheromone1","ADRPheromone2","ShadowsSimulacrum","HacknetNodeCPUUpload","HacknetNodeCacheUpload","HacknetNodeNICUpload","HacknetNodeKernelDNI","HacknetNodeCoreDNI","Neurotrainer1","Neurotrainer2","Neurotrainer3","Hypersight","LuminCloaking1","LuminCloaking2","SmartSonar","PowerRecirculator","QLink","SPTN97","HiveMind","CordiARCReactor","SmartJaw","Neotra","Xanipher","HydroflameLeftArm","nextSENS","OmniTekInfoLoad","PhotosyntheticCells","Neurolink","CRTX42AA","Neuregen","CashRoot","NutriGen","PCMatrix","INFRARet","DermaForce","GrapheneBrachiBlades","BrachiBlades","GrapheneBionicArms","BionicArms","SNA","EsperEyewear","EMS4Recombination","OrionShoulder","HyperionV1","HyperionV2","GolemSerum","VangelisVirus","VangelisVirus3","INTERLINKED","BladeRunner","BladeArmor","BladeArmorPowerCells","BladeArmorEnergyShielding","BladeArmorUnibeam","BladeArmorOmnibeam","BladeArmorIPU","StaneksGift2","StaneksGift3","donationBonus","randomBonuses","bonuses","randomNumber","getRandomBonus","UnstableCircadianModulatorParams","UnstableCircadianModulator","AevumGalacticCybersystems","Sector12DeltaOne","AevumPolice","VolhavenZBInstituteOfTechnology","AevumSummitUniversity","AevumCrushFitnessGym","Sector12IronGym","VolhavenMilleniumFitnessGym","Sector12PowerhouseGym","AevumSnapFitnessGym","infiltrateCycles","INFILTRATE","SleeveInfiltrateWork","nextPosition","baseSalary","repMultiplier","reqdHacking","reqdStrength","reqdDefense","reqdDexterity","requiredAgility","reqdAgility","reqdCharisma","reqdReputation","hackingEffectiveness","strengthEffectiveness","defenseEffectiveness","dexterityEffectiveness","agilityEffectiveness","charismaEffectiveness","strengthExpGain","defenseExpGain","dexterityExpGain","agilityExpGain","calculateJobPerformance","hackRatio","strRatio","defRatio","dexRatio","agiRatio","chaRatio","reputationGain","moneyHacked","orgName","percTotalMoneyHacked","influenceStockThroughServerGrow","moneyGrown","percTotalMoneyGrown","performanceMult","cyclesOfWork","compName","checkEnum","enumVariable","StartButton","char","CorruptableText","setContent","counter","timers","letter","randFrom","randomize","timerId","GRAFTING","GraftingWork","gAugs","GraftableAugmentations","GraftableAugmentation","FactionInfo","offerFieldWork","offerSecurityWork","keep","keepOnInstall","assignment","FactionWorkStats","baseStats","getMult","getUpgrade","getUpgradeCost","newCap","determineCrimeSuccess","found","findCrime","roughName","atCapacity","marketCycles","emp","hireRandomEmployee","calculateTotalEmployees","calculateNextEmployees","maxEne","maxHap","maxMor","autoCoffee","perfMult","totalSalary","ene","coffeeMult","coffeeEmployees","mor","hap","partyMult","partyEmployees","minEne","minMor","minHap","calculateEmployeeProductivity","employeeNextJobs","employeeJobs","employeeProd","prod","calculateProductivity","getElementById","cre","sal","Employee","creativity","efficiency","salary","CorporationUpgradeIndex","CorporationUpgrades","SmartFactories","benefit","SmartStorage","DreamSense","WilsonAnalytics","NuoptimalNootropicInjectorImplants","SpeechProcessorImplants","NeuralAccelerators","FocusWires","ABCSalesBots","ProjectInsight","antiLog","sum","ProgressBar","withStyles","bar","transition","LinearProgress","validator","paramValidator","calculateSellInformationCashReward","levelBonus","calculateTradeInformationRepReward","calculateInfiltratorsRepReward","startingSecurityLevel","infiltrationData","sanitizedSource","prop","comprGenChar","comprLZGenerate","plain","comprLZEncode","cur_state","new_state","new_offset","tmp_state","len","comprLZDecode","compr","literal_length","backref_length","backref_offset","StatsProgressBar","remaining","StatsProgressOverviewCell","characterOverviewStyles","paddingBottom","canAccessGang","isAwareOfGang","getGangFaction","startGang","v1","v2","oldhp","baseCheck","initialCheck","netscriptCanGrow","netscriptCanWeaken","PromptEvent","PromptManager","setPrompt","PromptMenuText","PromptMenuSelect","PromptContent","PromptMenuBoolean","paddingTop","submit","autoFocus","onInput","stopPropagation","ENTER","preventDefault","choices","getItems","createCityMap","demand","competition","quality","per","performance","dur","durability","rel","reliability","aes","aesthetics","fea","features","siz","reqMats","createProduct","fin","opProd","engrProd","mgmtProd","mgmtFactor","prog","creationProd","finishProduct","totalProd","engrRatio","mgmtRatio","rndRatio","opsRatio","busRatio","totalMult","sciFac","calculateRating","advMult","busmgtgRatio","isFinite","awareness","popularity","reqMat","ProductRatingWeights","rat","Quality","Performance","Durability","Reliability","Aesthetics","Features","prodMats","ProgramsSeen","ProgramsRoot","getHackingLevelRemaining","disableGutters","gridTemplateColumns","curCompletion","getProgCompletion","Paper","flexWrap","mr","InvitationsSeen","WorkTypesOffered","FactionElement","facInfo","joined","gap","openFaction","openFactionAugPage","acceptInvitation","ml","justifyItems","gridAutoFlow","FactionsRoot","allJoinedFactions","invitations","breakpoints","down","gridTemplateRows","gridAutoRows","destroyedBitNode","newBitNode","bitNodeNumber","sourceFileKey","sourceFile","alreadyOwned","ownedSourceFile","playerSrcFile","PlayerOwnedSourceFile","giveSourceFile","ActivateRecoveryMode","RecoveryRoot","errorData","resetError","issueUrl","newIssueUrl","startIcon","onTriggered","px","multiline","fullWidth","RamCalculationErrorCode","sharePower","StartSharing","CSM","nsFuncsGenerator","sanitizedPid","Environment","getScriptOnServer","shouldLog","disableLogs","Person","crimeKey","getMemoryUpgradeCost","memory","currCost","currMemory","installAugmentation","updateStatLevels","cyclesUsed","SleeveRecoveryWork","SleeveSynchroWork","takeUniversityCourse","universityName","newCity","tryBuyAugmentation","upgradeMemory","workType","sanitizedWorkType","workoutAtGym","gymName","stat","sanitizedStat","recruitmentSuccessChance","contractSuccessChance","bb","chances","CorporationState","numUnlockUpgrades","upgradeMultipliers","addFunds","getState","gameCycles","issueNewSharesCooldown","avgProfit","cycleProfit","updateDividendTax","retainedEarnings","getCycleDividends","updateSharePrice","nextState","dividendTax","dividendsPerShare","dividends","determineValuation","getTargetSharePrice","targetPrice","immediatelyUpdateSharePrice","sharesTracker","sharesUntilUpdate","sharesSold","maxIterations","convertCooldownToString","cd","upgN","upgradeAmt","getProductionMultiplier","getDreamSenseGain","getAdvertisingMultiplier","getEmployeeCreMultiplier","getEmployeeChaMultiplier","getEmployeeIntMultiplier","getEmployeeEffMultiplier","getSalesMultiplier","getScientificResearchMultiplier","getStarterGuide","hasHandbook","handbookFn","showLiterature","popEst","locations","OptionsSlider","initialValue","_evt","newValue","onChangeCommitted","valueLabelDisplay","marks","TickerDisplayMode","DisplayModeButton","tickerDisplayMode","Portfolio","changeDisplayMode","StockTickersConfig","changeWatchlistFilter","maintainMembership","finishAction","penalty","hack_asc_points","str_asc_points","def_asc_points","dex_asc_points","agi_asc_points","cha_asc_points","resetPidCounter","setMaxRam","EPSILON","decay","getSuccessChance","baseTime","skillFac","effDexterity","statFac","est","clamp","real","low","high","competence","playerStatLvl","effMultiplier","getSuccessesNeededForNextLevel","baseSuccessesPerLevel","newCrimeType","convertCrimeType","ROBSTORE","BONDFORGERY","TRAFFICKARMS","GRANDTHEFTAUTO","calculateCrimeWorkStats","frames","Apr1Events","Apr1","getMonth","getDate","isApr1","setN","allow","currentCity","onTravel","WorldMap","SuccessChance","estimatedSuccessChance","StaticModal","isSleeveRecoveryWork","RECOVERY","isSleeveSynchroWork","SYNCHRO","logEntry","logUpd","displayLog","recordGrow","recordWeaken","litObj","Literatures","checkIfConnectedToDarkweb","listAllDarkwebItems","item","printRaw","buyDarkwebItem","itemName","buyAllDarkwebItems","itemsToBuy","calculateRawDiff","startingDifficulty","calculateDifficulty","calculateReward","parseArg","asNumber","ParseCommands","allCommands","flat","ParseCommand","idx","lastQuote","DOUBLE_QUOTE","QUOTE","CinematicText","setI","done","setDone","onDone","newI","auto","MaxSleevesFromCovenant","BaseCostPerSleeve","parseOnlyRamCalculate","dependencyMap","completedParses","parseQueue","parseCode","moduleName","currentModule","globalKey","internalToExternal","additionalModules","addRef","external","objectPrototypeProperties","getOwnPropertyNames","commonVisitors","Identifier","st","WhileStatement","walkDeeper","test","DoWhileStatement","ForStatement","update","IfStatement","consequent","alternate","MemberExpression","walk","importModuleName","spec","imported","parseOnlyCalculateDeps","initialModule","nextModule","ImportError","detailedCosts","unresolvedRefs","resolvedRefs","loadedFns","dep","findFunc","refDetail","fnRam","checkInfiniteLoop","missingAwaitLine","nodeHasTrueTest","hasAwait","AwaitExpression","codeCopy","decimal","pidCounter","tempCounter","MAX_SAFE_INTEGER","isHackingGang","respectGainRate","wantedGainRate","storedTerritoryAndPowerCycles","territoryClashChance","territoryWarfareEngaged","notifyMemberDeath","getPower","getTerritory","processGains","processExperienceGains","processTerritoryAndPowerGains","moneyGains","respectGains","wantedLevelGains","justice","recordEarnedRespect","oldWanted","newWanted","gangName","calculatePower","gainRoll","multiplicativeGain","powerMult","PowerMultiplier","additiveGain","gangs","others","thisGang","otherGang","thisPwr","thisChance","calculateTerritoryGain","winGang","loseGang","powerBonus","territoryGain","clash","gainExperience","won","baseDeathChance","modifiedDeathChance","killMember","getRespectNeededToRecruitMember","getWantedPenalty","memberTotal","totalRespect","lostRespect","earnedRespect","ascend","getDiscount","getAllTaskNames","taskName","newRemoteFileApiConnection","stopConnection","Remote","startConnection","isRemoteFileApiConnectionLive","connection","readyState","tooltiptext","reqRep","TerminalHelpText","TemplatedHelpTexts","HelpTexts","analyze","backdoor","cat","check","cls","cp","expr","free","help","history","lscpu","mem","nano","sudov","unalias","GameEnv","Platform","getErrorForDisplay","errorInfo","isElectron","Production","toDisplay","language","cookiesEnabled","cookieEnabled","doNotTrack","indexedDb","platform","Steam","Browser","environment","getErrorMetadata","Development","componentStack","Tracking","Retirement","Investigation","Raid","initValue","Hand","cards","addCards","removeByIndex","StockTickerTxButton","DummyGrid","DummyGift","fragments","ghostGrid","getContract","contractName","removeContract","existingPartialExeIndex","findIndex","newScript","writeToTextFile","newFile","CodingContractModal","setProps","setAnswer","contractType","tries","BitFlumeEvent","BitFlumeModal","terminalCommandHistory","generalMethods","workMethods","processWork","augmentationMethods","canAccessBladeburner","bladeburnerMethods","startBladeburner","canAccessCorporation","corporationMethods","startCorporation","gangMethods","serverMethods","InvitationModal","opt_initFunc","sourceCode","sourceCodeLineOffset","acorn","PARSE_OPTIONS","initFunc_","paused_","polyfills_","functionCounter_","stepFunctions_","stepMatch","methodName","createScope","stripLocations_","State","stateStack","nodeConstructor","READONLY_DESCRIPTOR","configurable","writable","NONENUMERABLE_DESCRIPTOR","READONLY_NONENUMERABLE_DESCRIPTOR","VARIABLE_DESCRIPTOR","STEP_ERROR","SCOPE_REFERENCE","VALUE_IN_DESCRIPTOR","toStringCycles_","getErrorLineNumber","getErrorLineNumberMessage","appendCode","populateScope_","initGlobalScope","OBJECT_PROTO","FUNCTION_PROTO","initFunction","initObject","proto","OBJECT","initArray","initString","initBoolean","initNumber","initDate","initRegExp","initError","initMath","initJSON","thisInterpreter","createNativeFunction","EvalError","parseInt","strFunctions","decodeURI","encodeURI","nativeFunc","throwException","URI_ERROR","FUNCTION","ARRAY","ARRAY_PROTO","REGEXP","REGEXP_PROTO","DATE","DATE_PROTO","identifierRegexp","var_args","calledWithNew","newFunc","createObjectProto","arguments","argsStr","SYNTAX_ERROR","parentScope","boxThis","isObject","getScope","strict","box","getPrototype","thisArg","func_","funcThis_","arguments_","arrayPseudoToNative","TYPE_ERROR","doneExec_","setNativeFunctionPrototype","valueOf","throwIfNullUndefined","arrayNativeToPseudo","descriptor","preventExtensions","getOwnPropertyDescriptor","setter","hasValue","pseudoDescriptor","propertyIsEnumerable","newArray","first","legalArrayLength","RANGE_ERROR","class","reverse","howmany","opt_begin","opt_end","opt_separator","iLength","getProperty","hasProperty","element","isa","jLength","searchElement","opt_fromIndex","STRING","fromCharCode","functions","compareString","locales","localeCompare","separator","jsList","search","newSubstr","BOOLEAN","NUMBER","numConsts","fractionDigits","toExponential","digits","precision","toPrecision","radix","Function","UTC","pattern","rgx","populateRegExp","lastIndex","opt_message","newError","createObject","createErrorSubclass","EVAL_ERROR","REFERENCE_ERROR","myMath","mathConsts","numFunctions","myJSON","nativeObj","child","legalArrayIndex","Value","strs","pseudoRegexp","nativeRegexp","ignoreCase","createFunction","opt_constructor","illegalConstructor","asyncFunc","pseudoDate","pseudoObj","opt_cycles","pseudo","native","nativeArray","pseudoArray","lineNum","isGetter","TypeError","opt_descriptor","ReferenceError","defObj","firstNode","expression","createSpecialScope","opt_scope","getValueFromScope","prevNode","setValueToScope","nodeClass","end","isConstructor","getValue","Completion","NORMAL","BREAK","CONTINUE","RETURN","THROW","errorClass","lineNumErrorMsg","unwind","lineNumberMsg","cv","labels","isLoop","isSwitch","realError","errorTable","RangeError","URIError","createGetter_","funcThis","doneCallee_","doneArgs_","createSetter_","elements","n_","array_","doneLeft_","doneRight_","leftReference_","doneGetter_","leftValue_","leftValue","doneSetter_","setterValue_","rightValue","directEval_","funcNode","paramName","paramValue","argsList","evalNode","argsWithCallback","done_","throwValue","mode_","test_","doneInit_","doneObject_","variable_","object_","visited_","name_","gotPropName","props_","doneVariable_","propName","doneProperty_","properties_","kinds","switchValue_","defaultCase_","index_","switchCase","matched_","tested_","doneBlock_","doneHandler_","doneFinalizer_","leftSide_","changeValue","returnValue","declarations","declarationNode","init_","doneBody_","wrapAPI","NetscriptSingularity","NetscriptGang","NetscriptBladeburner","NetscriptCodingContract","NetscriptSleeve","NetscriptCorporation","NetscriptStanek","NetscriptInfiltration","NetscriptUserInterface","NetscriptFormulas","NetscriptStockMarket","NetscriptGrafting","NetscriptHacknet","_hackAmount","hackAmount","_threads","_time","moneyBefore","moneyAfter","logGrowPercent","_growth","_cores","maxThreadsNeeded","finally","_format","_fn","possibleLogs","_x","_y","_pid","_w","_h","_scriptname","scriptServer","spawnDelay","killByPid","_safetyguard","safetyguard","scriptsKilled","_files","_destination","_source","destServer","sourceServ","noFailures","sourceTextFile","textFile","destTextFile","sourceScript","destScript","_grep","grep","allFiles","processes","speed","production","purchaseCost","coreCost","levelCost","_filename","_ram","_name","hostnameStr","_port","_data","_mode","txtFile","tryWrite","_file","status","suc","_n","_milliseconds","_milliPrecision","milliseconds","milliPrecision","_message","_variant","_duration","_txt","_url","_target","$","fail","_host","source_is_txt","dest_is_txt","source_file","dest_file","Flags","NetscriptExtra","numServerGrowthCycles","numServerGrowthCyclesAdjusted","hack_exp","hack_mult","str_exp","str_mult","def_exp","def_mult","dex_exp","dex_mult","agi_exp","agi_mult","cha_exp","cha_mult","assignToTask","unassignFromTask","difficultyPerCycles","getGainedAscensionPoints","canAscend","getCurrentAscensionMults","getAscensionMultsAfterAscend","getAscensionResults","postAscend","preAscend","applyUpgrade","respectToDeduct","buyUpgrade","defaultInterpreter","ANSI_ESCAPE","lineClass","ANSIITypography","memo","parts","groups","matchAll","startIndex","stopIndex","partText","paragraph","part","ansiCodeStyle","COLOR_MAP_BRIGHT","1","2","3","4","5","6","7","COLOR_MAP_DARK","8","9","10","11","12","13","14","15","codeParts","nextStyleKey","codePart","ir","ig","ib","grey","ansi2rgb","fontWeight","textDecoration","findSleevePurchasableAugs","ownedAugNames","availableAugs","isAvailableForSleeve","validMults","worker","companyPositionName","bn11Mult","jobPerformance","StaneksGiftEvents","maxClearanceLevel","Gym","TechVendor","techVendorMaxRam","techVendorMinRam","University","AevumCasino","Casino","Special","NewTokyoArcade","Sector12CarmichaelSecurity","Sector12CityHall","Hospital","Slums","WorldStockExchange","ChongqingChurchOfTheMachineGod","IshimaGlitch","matchEnding","zip","JSZip","zipFiles","fileNames","fileContents","zipFn","generateAsync","FileSaver","saveAs","v2ModalOpen","openV2Modal","V2Modal","stealthIcon","xmlns","viewBox","killIcon","ActionLevel","isActive","canIncrease","canDecrease","Autolevel","TeamSizeButton","graftableAug","canGraft","AugPreReqsChecklist","preAug","GraftingRoot","graftableAugmentations","selectedAug","setSelectedAug","graftOpen","setGraftOpen","selectedAugmentation","switchSortOrder","newOrder","Cost","getAugsSorted","BlinkingCursor","setOn","StyleEditorButton","styleEditorOpen","setStyleEditorOpen","ThemeEditorButton","themeEditorOpen","setThemeEditorOpen","ThemeCollaborate","DeleteGameButton","modalOpened","setModalOpened","SoftResetButton","noConfirmation","PreReqs","ownedPreReqs","hasPreReqs","Requirement","gridArea","Exclusive","PurchasableAugmentations","augNames","PurchasableAugmentation","owned","sleeveAugs","canPurchase","float","gridTemplateAreas","TravelAgencyRoot","setDestination","startTravel","symbolsLoaded","symbols","SetupTextEditor","populate","exclude","OpenScript","lastPosition","model","isTxt","openScripts","currentScript","Root","editorRef","monacoRef","vimStatusRef","vimEditor","setVimEditor","setEditor","setFilter","searchExpanded","setSearchExpanded","setRAM","ramEntries","setRamEntries","updatingRam","setUpdatingRam","decorations","setDecorations","optionsOpen","setOptionsOpen","setOptions","insertSpaces","ramInfoOpen","setRamInfoOpen","regenerateModel","createModel","updateRAM","keydown","ctrlKey","metaKey","require","initVimMode","VimMode","Vim","defineEx","saveNQuit","defineAction","_cm","nTabs","currIndex","currentTabIndex","onTabClick","nextIndex","mapCommand","context","dispose","debouncedUpdateRAM","newCode","entriesDisp","RAM","scriptToSave","cleanCode","ns1","ns2","curIndex","isDisposed","setModel","revealLineInCenter","onTabClose","closingScript","savedScriptCode","wasCurrentScript","dirty","indexOffset","openScript","serverData","getServerCode","handleFilterChange","handleExpandSearch","filteredOpenScripts","tabMaxWidth","tabTextWidth","tabIconWidth","onDragEnd","endIndex","removed","reorder","droppableId","direction","provided","snapshot","innerRef","droppableProps","isDraggingOver","spellCheck","externalScript","colorProps","borderColor","iconButtonStyle","scriptTabText","draggableId","disableInteractiveElementBlocking","draggableProps","dragHandleProps","flexShrink","serverScriptCode","onTabUpdate","beforeMount","languages","registerCompletionItemProvider","provideCompletionItems","suggestions","kind","CompletionItemKind","insertText","insertTextRules","CompletionItemInsertTextRule","InsertAsSnippet","getLanguages","loader","tokenizer","libSource","typescript","javascriptDefaults","addExtraLib","typescriptDefaults","onMount","Position","loading","defaultLanguage","defaultValue","newPos","awaitWarning","newDecorations","deltaDecorations","startLineNumber","startColumn","endLineNumber","endColumn","isWholeLine","glyphMarginClassName","glyphMarginHoverMessage","infLoop","glyphMargin","getAction","getSubdirectories","t_dir","processFile","subdir","containsFiles","dirWithTrailingSlash","makeScriptBlob","compile","shouldCompile","queueCompile","uurls","_getScriptUrls","loadedModule","isDependencyOutOfDate","scriptModuleSequenceNumber","depScript","seen","urlStack","ranges","importNodes","ExportNamedDeclaration","ExportAllDeclaration","transformedCode","matchingScripts","importedScript","urls","blob","ScriptUrl","vargs","schema","numDashes","libarg","argv","TablePaginationActionsAll","rowsPerPage","onPageChange","BitnodeMultiplierDescription","BitNodeMultipliersDisplay","maxSfLevel","columnCount","columnGap","GeneralMults","SkillMults","FactionMults","AugmentationMults","HackingMults","PurchasedServersMults","StockMults","CrimeMults","InfiltrationMults","CompanyMults","GangMults","CorporationMults","BladeburnerMults","StanekMults","BNMultTable","rowsArray","rowData","uniqueId","marginBottom","sectionName","extraSize","StnakesGiftPowerMultiplier","Cell","cellProps","onMouseEnter","Grid","activeGrid","randomColor","elems","newNs2Template","detectSimpleScriptGlob","globString","globDatabase","parsedGlob","glob","preGlob","postGlob","globError","globMatches","globAgainst","parseSimpleScriptGlob","commonEditor","scriptEditorRouteOptions","filesToLoadOrCreate","globSearch","isEmpty","filepath","getFilepath","fileIsNs2","isNs2","CursorPositions","saveCursor","column","HammingEncode","enc","data_bits","parity","HammingEncodeProperly","HammingDecode","bits","bit","ans","automate","stop","findNode","setParent","queue","getMultiplierHelper","getProductProductionMultiplier","advertisingMult","employeeChaMult","employeeCreMult","employeeEffMult","employeeIntMult","productionMult","productProductionMult","salesMult","sciResearchMult","storageMult","StanekConstants","RAMBonus","BaseSize","MaxSize","detect","hasChanges","orig","nf","fl","backups","currPos","nextPosName","corpName","additionalShares","warehouseApi","OfficeApi","Engine","_lastUpdate","updateGame","decrementAllCounters","checkCounters","Counters","autoSaveCounter","updateSkillLevelsCounter","updateDisplays","updateDisplaysLong","updateActiveScriptsDisplay","createProgramNotifications","augmentationsNotifications","passiveFactionGrowth","mechanicProcess","contractGeneration","achievementsCounter","counterName","warningToast","warnAutosaveDisabled","adjustedCycles","startExploits","setupUncaughtPromiseHandler","timeOffline","numCyclesOffline","numContracts","offlineReputation","offlineHackingIncome","offlineProductionFromHacknetNodes","hacknetProdInfo","timeOfflineString","_thisUpdate","requestAnimationFrame","LoadingScreen","setShow","loaded","setLoaded","reason","doLoad","ignoreQueued","stacks","calculateEntropy","typ","invalidArgs","baseSize","charge","af","cotmg","inBonus","updateMults","effect","boost","neighboor","CalculateEffect","canPlace","rootX","rootY","newFrag","aFrag","place","findFragment","clearCharge","Void","RFARequestHandler","pushFile","fileData","at","getFile","scriptContent","getFileNames","fileNameList","scr","getAllFiles","fileList","calculateRam","getDefinitionFile","StatsElement","EarningsElement","rates","ServerType","All","Foreign","Owned","Purchased","ServerDropdown","isValidServer","purchased","serverType","purchase","DECK_COUNT","Result","Blackjack","bet","canStartGame","playerHand","deck","safeDrawCard","dealerHand","setState","gameInProgress","Pending","getTrueHandValue","finishGame","Tie","PlayerWonByBlackjack","DealerWon","hand","handValues","getHandValue","valuesUnder21","isHandBusted","newHand","newDealerHand","PlayerWon","dealerHandValue","playerHandValue","betInput","wager","wagerInvalid","wagerInvalidHelperText","startGame","Deck","render","playerHandValues","getHandDisplayValues","dealerHandValues","wagerOnChange","helperText","playerHit","playerStay","startOnClick","elevation","card","hidden","red","ReactCard","Clubs","Spades","allFactionAugs","factionAugs","factionAug","TickerHeaderFormatData","longestName","longestSymbol","AchievementEntry","cssFiltersUnlocked","cssFiltersLocked","isUnlocked","mainColor","achievedOn","unlocked","colorFilters","Color","hueRotate","angle","PI","sin","cos","multiply","grayscale","sepia","saturate","matrix","newR","newG","newB","brightness","linear","contrast","slope","intercept","invert","hsl","Solver","targetHSL","reusedColor","solve","solveNarrow","solveWide","css","best","initial","spsa","A1","iters","bestLoss","deltas","highArgs","lowArgs","ck","lossDiff","ak","fix","filters","colorHSL","getFiltersFromHex","hex","rgb","hexToRgb","Theme","credit","screenshot","img1","reference","outputHistory","startHack","startGrow","startWeaken","startBackdoor","startAnalyze","finishHack","oldSec","newSec","finishGrow","finishWeaken","finishBackdoor","finishAnalyze","currServ","isHacknet","org","canRunScripts","hackingSkill","security","hackingChance","numPort","getProgressText","getLitFile","lit","currDir","setcwd","contractOpen","executeScanAnalyzeCommand","visited","depthQueue","newS","titleDashes","connectToServer","executeCommands","commandHistory","commandHistoryIndex","executeCommand","n00dlesServ","commandName","scananalyze","apr1","removeBracketsFromArrayString","strCpy","removeQuotesFromString","convert2DArrayToString","nums","ways","maxLen","padStart","spiral","u","col","playerAns","_arr","reach","jumps","lastJump","jumpedFrom","intervals","numIntervals","interval","sanitizedResult","sanitizedAns","B","C","ansArr","ipInAns","maxCur","maxSoFar","hold1","MIN_SAFE_INTEGER","hold2","release1","release2","prices","hold","rele","cur","createTriangleRecurse","numLevels","createTriangle","triangle","dp","numRows","numColumns","currentRow","gridString","grid","obstacleGrid","dstY","dstX","minPathLength","distanceFactor","distance","MinHeap","validPosition","neighbors","yN","xN","changeWeight","yQ","xQ","ansX","ansY","roll","dfs","pair","sanitizedPlayerAnsArr","resultInAnswer","numDigits","digitsArray","helper","evaluated","multed","_alteredBit","_buildArray","_randomIndex","edges","shuffle","vertexShuffler","sanitizedPlayerAns","neighbourhood","vertex","adjLeft","adjRight","coloring","initialVertex","frontier","validColors","aColor","bColor","plaintext","ans_plain","run_length","compressed","BinHeap","heapifyUp","heapifyDown","predicate","heapOrderABeforeB","tmp","toSwap","weightA","weightB","requireHackingLevel","targetServer","numAugReq","ipaddress","byteRange","formattedHours","getHours","formattedMinutes","getMinutes","formattedSeconds","getSeconds","AllSoftwarePositions","AllITPositions","AllNetworkEngineerPositions","SecurityEngineerPositions","AllTechnologyPositions","AllBusinessPositions","AllAgentPositions","AllSecurityPositions","AllSoftwareConsultantPositions","AllBusinessConsultantPositions","SoftwarePositionsUpToHeadOfEngineering","SoftwarePositionsUpToLeadDeveloper","BusinessPositionsUpToOperationsManager","WaiterOnly","EmployeeOnly","PartTimeWaiterOnly","PartTimeEmployeeOnly","OperationsManagerOnly","CEOOnly","effectText","costPerLevel","hasTargetServer","collapsedSum","createDescription","checkGangApiAccess","getGangMember","_faction","wantedLevelGainRate","cpy","_memberName","memberName","hack_asc_mult","str_asc_mult","def_asc_mult","dex_asc_mult","agi_asc_mult","cha_asc_mult","recruited","tasks","_taskName","getGangTask","_equipName","equipName","equipment","typecheck","_engage","engage","_otherGang","playerPower","checkSleeveAPIAccess","checkSleeveNumber","sleeveNumber","sl","_sleeveNumber","_crimeRoughName","crimeRoughName","_universityName","_className","_cityName","acompanyName","_factionName","_workType","_gymName","_stat","jobTitle","agilityExp","charismaExp","companyRep","crimeMoney","crimeSuccess","defenseExp","dexterityExp","factionRep","hackingExp","strengthExp","workMoney","purchasableAugs","_augName","_action","_contract","devMenu","doc","completely_unused_field","real_document","recur","guess","bcrypt","getHacknetNode","hi","_i","hasUpgraded","timeOnline","totalProduction","_upgName","_count","_upgTarget","checkStanekAPIAccess","_rootX","_rootY","_rotation","_fragmentId","fragmentId","getLocationsWithInfiltrations","_location","tradeRep","sellCash","SoARep","calculateInfiltrationData","newTheme","currentTheme","errors","newStyles","currentStyles","checkBladeburnerAccess","skipjoined","apiDenied","bladeburnerDenied","checkBladeburnerCity","getBladeburnerActionObject","_blackOpName","blackOpName","_type","_level","_autoLevel","_skillName","_size","getCodingContract","returnReward","answerStr","creward","upgradeName","materialName","checkAccess","api","getSafeDivision","numAdVerts","_divisionName","_amt","_materialName","sell","sll","_productName","pCost","cityData","developmentProgress","_price","_all","_enabled","enabled","_designInvest","_marketingInvest","_qty","_sourceDivision","_sourceCity","_targetDivision","_targetCity","sourceDivision","targetDivision","targetCity","_on","_researchName","_employeeName","_job","_amount","amount","_costPerEmployee","_industryName","industryName","_upgradeName","_rate","dividendEarnings","_corporationName","_selfFund","corporationName","selfFund","fundingRound","percShares","funding","investShares","_numShares","initialSharePrice","_amountCash","amountCash","startingCost","reFac","robFac","aiFac","advFac","hwFac","getProductDescriptionText","getMaximumNumberProducts","additional","hasMaximumNumberProducts","calculateProductionFactors","multSum","cityMult","updateWarehouseSizeUsed","prodName","newInd","employeeSalary","officeLoc","processMaterialMarket","processProductMarket","popularityGain","awarenessGain","MAX_VALUE","processMaterials","processProducts","wh","foo","imp","buyAmt","maxAmt","smartBuy","smartSupplyStore","worseAmt","totalSize","freeSpace","maxProd","getOfficeProductivity","totalMatSize","reqMatName","normQty","producableFrac","reqMatQtyNeeded","fooProd","fooI","businessFactor","getBusinessFactor","advertisingFactor","getAdvertisingFactors","marketFactor","getMarketFactor","markupLimit","numerator","sqrtNumerator","sqrtDenominator","denominator","sqrt","optimalPrice","marketTa2Price","sellAmt","totalExp","expI","amtStr","expIndustry","expWarehouse","processProduct","totalProfit","forProduct","netStorageSize","sCostString","businessProd","calculateEffectWithFactors","awarenessFac","popularityFac","ratioFac","updateResearchTree","expFac","linearFac","morale","happiness","energy","det","trainingEff","effCre","effEff","prodBase","checkFormulasAccess","_favor","_rep","_player","_exp","_mult","_skill","_server","_startingLevel","_extraLevels","_costMult","_startingRam","_startingCore","_extraCores","extraCores","_ramUsed","_maxRam","HScalculateHashGainRate","HScalculateLevelUpgradeCost","HScalculateRamUpgradeCost","HScalculateCoreUpgradeCost","_startingCache","_extraCache","extraCache","HScalculateCacheUpgradeCost","HScalculateServerCost","_gang","_member","_task","_points","_crimeType","_classType","_locationName","checkTixApiAccess","getStockFromSymbol","_symbol","_shares","_posType","sanitizedPosType","_pos","orderPos","ltype","lpos","stockMarketOrders","forecast","checkGraftingAPIAccess","_focus","wasFocusing","craftableAug","getPlayerFields","matchJS","matchScript","offenders","processScript","formatRules","formatOffenders","off","fileline","rule","textfield","Language","InteractiveTutorialRoot","nsSelectionOpen","setNSSelectionOpen","setLanguage","tutorialScriptExtension","NS1","tutorialScriptName","contents","canNext","square","tab","updateOptions","readOnly","overviewContainer","visibilityToggle","collapse","Overview","setX","setY","CurrentIcon","KeyboardArrowUpIcon","KeyboardArrowDownIcon","LeftIcon","SchoolIcon","EqualizerIcon","fakeDrag","triggerMouseEvent","eventType","clickEvent","createEvent","initEvent","dispatchEvent","Loading","onStop","defaultPosition","onDoubleClick","openedMixin","transitions","easing","sharp","enteringScreen","closedMixin","leavingScreen","up","Drawer","styled","shouldForwardProp","active","borderLeft","listitem","SidebarRoot","hackingOpen","setHackingOpen","characterOpen","setCharacterOpen","worldOpen","setWorldOpen","helpOpen","setHelpOpen","flashTerminal","flashStats","flashActiveScripts","flashHacknet","flashCity","flashTutorial","augmentationCount","invitationsCount","programCount","getAvailableCreatePrograms","canOpenFactions","canOpenAugmentations","canOpenSleeves","canCorporation","canGang","canJob","canStockMarket","canBladeburner","canStaneksGift","clickTerminal","clickScriptEditor","clickStats","clickActiveScripts","clickCreateProgram","clickFactions","clickAugmentations","clickHacknet","clickCity","clickTravel","clickJob","clickBladeburner","clickGang","clickTutorial","clickOptions","handleShortcuts","altKey","E","H","R","P","F","U","G","anchor","timeout","unmountOnExit","clsx","badgeContent","NeuroFluxDisplay","EntropyDisplay","AugmentationsRoot","installOpen","setInstallOpen","InstalledAugmentations","sourceAugs","Alphabetically","aug1","aug2","BitNodeModifiedStats","MultiplierList","listItems","augmented","bnMult","py","disableTypography","disablePadding","PlayerMultipliers","augP","augObj","calculateAugmentedStats","leftColData","rightColData","PurchasedAugmentations","displayName","enterNextDelay","safeGetSf","sfNum","sfObj","getMaxLevel","SourceFilesElement","sourceSfs","sf1","sf2","selectedSf","setSelectedSf","DevMenuRoot","General","setError","setCorporationName","gangFaction","setGangFaction","addMoney","TransitionProps","expandIcon","bigNumber","modifyExp","modifier","modifyKarma","resetExperience","modifyFactionRep","AllFaction","modifyFactionFavor","labelId","arial-label","setAugmentation","validSFN","setSF","sfN","sfLvl","setAllSF","setProgram","AllPrograms","Servers","setServer","setCompany","modifyCompanyRep","AllCompanies","modifyCompanyFavor","modifyBladeburnerRank","modify","modifyBladeburnerCycles","modifyGangCycles","modifyCorporationFunds","modifyCorporationCycles","CodingContracts","setCodingcontract","cc","stockPrice","setStockPrice","setStockSymbol","processStocks","inputSymbols","SM","stocks","sleeveSetStoredCycles","Stanek","modCycles","modCharge","TimeSkip","timeskip","SaveFile","importInput","setSaveFile","restoreScripts","setRestoreScripts","restoreAugs","setRestoreAugs","restoreSFs","setRestoreSFs","File","FileList","ii","playerAchievement","setPlayerAchievements","achieved","grantAchievement","removeAchievement","Entropy","BladeburnerRoot","travelOpen","setTravelOpen","inFaction","wordBreak","TravelModal","nopadding","preformatted","Line","Console","setCommand","consoleInput","consoleHistoryIndex","setConsoleHistoryIndex","Logs","tabIndex","inputRef","prevCommand","currentTarget","scrollHook","scrollTop","scrollHeight","AllPages","GeneralActionPage","GeneralActionList","actions","GeneralActionElem","computedActionTimeCurrent","actionData","ContractPage","ContractList","ContractElem","Contracts","StealthIcon","KillIcon","OperationPage","OperationList","OperationElem","TeamSizeModal","BlackOpPage","BlackOpList","blackopName","blackop","BlackOpElem","hasReqdRank","SkillPage","valid","onUpgrade","SkillList","SkillElem","canLevel","GangRoot","ManagementSubpage","GangStats","territoryStr","BonusTime","CyclerPerSecond","bonusMillis","GangMemberList","ascendOnly","setAscendOnly","onRecruit","GangMemberCard","GangMemberCardContent","ascendOpen","setAscendOpen","borderRightWidth","onAscend","borderLeftWidth","onTaskChange","GangMemberStats","asc","KillScriptsModal","TaskSelector","currentTask","setCurrentTask","contextMember","TaskDescription","AscensionModal","RecruitButton","RecruitModal","setName","recruit","onKeyUp","TerritorySubpage","gangNames","infoOpen","setInfoOpen","formatTerritory","OtherGangTerritory","clashVictoryChance","TerritoryInfoModal","NextReveal","PurchasedUpgrade","UpgradeButton","GangMemberUpgradePanel","currentCategory","setCurrentCategory","filterUpgrades","weaponUpgrades","armorUpgrades","vehicleUpgrades","rootkitUpgrades","augUpgrades","categories","Weapons","Vehicles","Rootkits","EquipmentsSubpage","CorporationRoot","setDivisionName","canExpand","industryType","MainPanel","CityTabs","setCity","cityStateSetter","SwitchButton","manualMode","switchMode","ManualManagement","setEmployee","employeePositionSelectorInitialValue","employeePositions","positionNames","EmployeeCount","next","currJob","nextJob","nextUna","AutoManagement","vechain","totalMorale","totalHappiness","totalEnergy","avgMorale","avgHappiness","avgEnergy","currUna","IndustryOffice","upgradeOfficeSizeOpen","setUpgradeOfficeSizeOpen","throwPartyOpen","setThrowPartyOpen","employeeManualAssignMode","setEmployeeManualAssignMode","UpgradeSizeButton","upgradeSize","UpgradeOfficeSizeModal","upgradeCost","upgradeCost15","maxMult","maxNum","multIncrease","upgradeCostMax","ThrowPartyModal","setCost","canParty","EffectText","MakeProductButton","makeOpen","setMakeOpen","hasMaxProducts","createProductButtonText","IndustryOverview","researchOpen","setResearchOpen","advertisingInfo","advertisingFactors","totalAdvertisingFac","convertEffectFacToGraphic","MakeProductModal","allCities","design","setDesign","marketing","setMarketing","createProductPopupText","Upgrade","wrapInTooltip","ele","but","ResearchModal","retainHeight","WarehouseRoot","smartSupplyOpen","setSmartSupplyOpen","canAffordUpgrade","stateText","mats","isInStock","isRelevant","breakdownItems","breakdown","previous","IndustryWarehouse","EmptyWarehouse","Leftover","setChecked","SmartSupplyModal","ProductElem","sellOpen","setSellOpen","limitOpen","setLimitOpen","discontinueOpen","setDiscontinueOpen","cancelOpen","setCancelOpen","marketTaOpen","setMarketTaOpen","nfB","hasUpgradeDashboard","sellButtonText","limitProductionButtonText","DiscontinueProductModal","LimitProductProductionModal","setLimit","SellProductModal","iQty","setQty","setPx","initialPrice","MarketTA2","ProductMarketTaModal","CancelProductModal","MaterialElem","purchaseMaterialOpen","setPurchaseMaterialOpen","exportOpen","setExportOpen","sellMaterialOpen","setSellMaterialOpen","materialMarketTaOpen","setMaterialMarketTaOpen","limitProductionOpen","setLimitProductionOpen","tutorial","purchaseButtonText","limitMaterialButtonText","disablePurchaseLimit","ExportModal","possibleDivisions","defaultDivision","setIndustry","setAmt","removeExport","currentDivision","possibleCities","newCost","setNewCost","MaterialMarketTaModal","SellMaterialModal","setPrice","BulkPurchaseSection","setBuyAmt","setDisabled","BulkPurchaseText","parsedAmt","PurchaseMaterialModal","purchaseMaterial","LimitMaterialProductionModal","IndustryProductEquation","reqs","reqAmt","ExpandNewCity","ExpandIndustryTab","possibleIndustries","newIndustry","multRows","appendMult","DividendsStats","PublicButtons","PrivateButtons","BribeButton","Upgrades","findInvestorsopen","setFindInvestorsopen","goPublicopen","setGoPublicopen","fundingAvailable","findInvestorsTooltip","upgradeData","sellSharesOpen","setSellSharesOpen","buybackSharesOpen","setBuybackSharesOpen","issueNewSharesOpen","setIssueNewSharesOpen","issueDividendsOpen","setIssueDividendsOpen","sellSharesOnCd","sellSharesTooltip","issueNewSharesOnCd","issueNewSharesTooltip","canBribe","totalDividends","playerEarnings","storedTime","LevelableUpgrade","xs","UU","BribeFactionModal","selectedFaction","setSelectedFaction","getRepText","SellSharesModal","setShares","ProfitIndicator","BuybackSharesModal","CostIndicator","IssueDividendsModal","percent","setPercent","canIssue","maxNewSharesUnrounded","maxNewShares","newShares","IssueNewSharesModal","issueNewShares","privateOwnedRatio","maxPrivateShares","privateShares","dialogContents","FindInvestorsModal","GoPublicModal","InfiltrationRoot","setStart","StartingDifficulty","Difficulty","Reward","cancel","Stage","minigames","SlashGame","BracketGame","BackwardGame","BribeGame","CheatCodeGame","Cyberpunk2077Game","MinesweeperGame","WireCuttingGame","setLevel","stage","setStage","Countdown","results","setResults","gameIds","setGameIds","lastGames","nextGameId","ids","setupNextGame","pushResult","stageComponent","onFinish","Minigame","MiniGame","onSuccess","Sell","onFailure","automated","Progress","difficulties","timer","words","makeAnswer","setGuess","hasAugment","BACKSPACE","shiftKey","ignorableKeyboardEvent","nextGuess","setRight","OPEN_BRACKET","LESS_THAN","OPEN_PARENTHESIS","OPEN_BRACE","generateLeftSide","CLOSE_PARENTHESIS","CLOSE_BRACKET","CLOSE_BRACE","GREATER_THAN","getChar","positive","option","negative","shuffleArray","makeChoices","correctIndex","setCorrectIndex","setIndex","currentChoice","choice","defaultColor","disabledColor","upColor","downColor","choiceColor","upIndex","upDistance","downIndex","downDistance","onCorrectIndex","newIndex","arrows","arrow","generateCode","puzzle","randChar","generatePuzzle","answers","generateAnswers","currentAnswerIndex","setCurrentAnswerIndex","setPos","flatGrid","isCorrectAnswer","optionColor","move","mines","minefield","generateEmptyField","generateMinefield","memoryPhase","setMemoryPhase","flagged","marked","fieldEquals","phase","setPhase","phaseZeroTime","timeUntilAttacking","Victory","quitInfiltration","handleInfiltrators","soa","infiltrationRepGain","isMemberOfInfiltrators","wiresmin","wiresmax","PIPE","DOT","FORWARD_SLASH","HYPHEN","HASH","colorNames","blue","wires","numWires","wireColors","generateWires","cutWires","setCutWires","questions","numQuestions","questionGenerators","randomPositionQuestion","randomColorQuestion","generateQuestion","checkWire","wireNum","shouldCut","wiresToBeCut","shouldBeCut","question","isCorrectWire","wire","wireColor","cutColor","arrowPart","Intro","CYCLES_PER_SEC","ExpRows","WorkInProgressRoot","workInfo","buttons","stopText","completion","unfocus","classWork","elapsed","stopTooltip","comp","tooltipInfo","GameOptionsRoot","currentTab","setCurrentTab","SYSTEM","setTab","INTERFACE","GAMEPLAY","MISC","REMOTE_API","SideBarTab","sideBarProps","tabName","GameOptionsSidebar","diagnosticOpen","setDiagnosticOpen","importSaveOpen","setImportSaveOpen","importData","setImportData","confirmedImportGame","alt","ServerAccordion","FileDiagnosticModal","FontFamilyField","refreshId","errorText","setErrorText","setFontFamily","LineHeightField","setLineHeight","StyleEditorModal","setRefreshId","customStyle","setCustomStyle","persistToSettings","endIcon","ColorEditor","onColorChange","hideTextfield","deferred","newColor","disableAlpha","ThemeEditorModal","customTheme","setCustomTheme","setTemplateTheme","placement","maxRows","importedTheme","GameplayPage","InterfacePage","timestampFormat","setTimestampFormat","setLocale","MiscPage","RemoteAPIPage","remoteFileApiPort","setRemoteFileApiPort","isConnected","ConnectionBauble","setConnection","ipaddr","address","protocol","WebSocket","handleMessageEvent","response","SystemPage","execTime","setExecTime","recentScriptsSize","setRecentScriptsSize","logSize","setLogSize","portSize","setPortSize","terminalSize","setTerminalSize","autosaveInterval","setAutosaveInterval","_event","SleeveRoot","FAQOpen","setFAQOpen","SleeveElem","statsOpen","setStatsOpen","augmentationsOpen","setAugmentationsOpen","abc","setABC","doing","MoreStatsModal","SleeveAugmentationsModal","PurchaseAugmentationModal","universitySelectorOptions","gymSelectorOptions","bladeburnerSelectorOptions","possibleJobs","forbiddenCompanies","otherSleeve","possibleFactions","forbiddenFactions","factionObj","second","universities","gyms","possibleContracts","Synchronize","canDo","getABC","s0","setS0","setS1","setS2","validActions","detailsF","details2","detail","FAQModal","HacknetRoot","purchaseMultiplier","setPurchaseMultiplier","purchaseMultiplierOnClicks","onClicks","GeneralInfo","HacknetNodeElem","purchaseMult","upgradeLevelButton","upgradeRAMButton","upgradeCoresButton","increase","upgradeLevelCost","upgradeRamCost","upgradeCoreCost","HacknetServerElem","upgradeRamButton","upgradeCacheButton","base_increase","modded_increase","upgradeCacheCost","HashUpgradeModal","serversMap","HacknetUpgradeElem","selectedServer","setSelectedServer","MultiplierButton","MultiplierButtons","btnProps","PlayerInfo","hasServers","PurchaseButton","GenericLocation","locContent","locName","getLocationSpecificContent","CompanyLocation","quitOpen","setQuitOpen","isEmployedHere","favorGain","onQuit","QuitJobModal","GymLocation","train","HospitalLocation","getHealed","currHp","btnStyle","SlumsLocation","shopliftChance","robStoreChance","mugChance","larcenyChance","drugsChance","bondChance","armsChance","homicideChance","gtaChance","kidnapChance","assassinateChance","heistChance","SpecialLocation","handleBladeburner","worldHeader","HTMLElement","handleGrafting","CreateCorporation","handleCotMG","renderBladeburner","toStanek","renderCotMG","CreateCorporationModal","canSelfFund","n00dlePower","ArcadeRoot","Megabyteburner2000","currentGame","BBCabinetRoot","origin","joystick","borderStyle","borderWidth","ServerButton","TechVendorLocation","purchaseServerButtons","RamButton","TorButton","purchaseTorRouter","CoresButton","maxCores","PurchaseServerModal","setHostname","tryToPurchaseServer","TravelConfirmationModal","UniversityLocation","take","dataStructuresCost","networksCost","algorithmsCost","managementCost","leadershipCost","GameType","CasinoLocation","setGame","Coin","Slots","Roulette","numDecks","drawCard","CoinFlip","investment","setInvestment","setResult","setStatus","playLock","setPlayLock","play","correct","redNumbers","strategies","Red","payout","Black","Odd","Even","High","Low","Third1","Third2","Third3","Single","canPlay","setCanPlay","lock","setLock","strategy","playerWin","isRed","currentNumber","getPayout","payLines","SlotMachine","locks","setLocks","stoppedOne","getPaylineData","payline","point","countSequence","checkWinnings","getTable","LocationLetter","ASCIICity","locationLettersRegex","letterMap","K","M","N","Q","V","Y","lineElems","startI","endI","locationI","ListCity","locationButtons","LocationCity","OptionsModal","setInsertSpaces","setFontSize","setWordWrap","setVim","themePath","themeCopy","setThemeCopy","MilestonesRoot","milestones","highestMilestone","milestone","ActionTimer","TerminalRoot","setKey","doScroll","hook","scrollIntoView","debounced","maxWait","unsubscribe","scrollId","TerminalInput","terminalInput","postUpdateValue","setPostUpdateValue","possibilities","setPossibilities","saveValue","postUpdate","modifyInput","mod","inputLength","selectionStart","inputText","delStart","moveTextCursor","keyDown","autoComplete","onBlur","TAB","semiColonIndex","allPos","determineAllPossibilitiesForTabCompletion","tabCompletion","selectionEnd","anchorEl","parentDirPath","evaledParentDirPath","addAllCodingContracts","cct","addAllLitFiles","addAllPrograms","addAllScripts","processFilepath","addAllTextFiles","addAllDirectories","subdirs","t_parentDirPath","convertParentPath","isCommand","cmd","t_cmd","autocomplete","runArgs","permissive","flagFunc","autocompleteData","txts","pos2","scriptAutocomplete","addAllMessages","allPossibilities","oldValue","longestStartSubstr","TutorialRoot","confirmResetOpen","setConfirmResetOpen","ActiveScriptsRoot","ScriptProduction","prodRateSinceLastAug","ServerAccordions","setRowsPerPage","serverToScriptMap","filtered","rowsPerPageOptions","newPage","onRowsPerPageChange","ActionsComponent","paddedName","barOptions","headerTxt","ServerAccordionContent","noborder","WorkerScriptAccordion","killScript","onlineMps","onlineEps","RecentScriptsPage","recentScript","RecentScriptAccordion","MainPage","onAugmentations","sleevesOpen","setSleevesOpen","isPlayersGang","favorToDonate","canDonate","canPurchaseSleeves","startHackingContracts","startFieldWork","startSecurityWork","FactionRoot","purchasingAugs","setPurchasingAugs","routeToMainPage","AugmentationsPage","getAugs","augName1","augName2","getAugsSortedByCost","getAugsSortedByReputation","Purchasable","canBuy","hasReq","hasRep","cantBuy","getAugsSortedByPurchasable","purchasable","multiplierComponent","costs","showModal","DonateOption","donateAmt","setDonateAmt","Status","noformat","DefaultAssignment","Info","Assignment","CovenantPurchasesRoot","setUpdate","purchaseDisabled","upgradePanels","CovenantSleeveMemoryUpgrade","maxMemory","purchaseBtnDisabled","purchaseBtnContent","calculateStat","getFactionHackingWorkRepGain","srcFile","sourceFileObject","incMult","decMult","GangButton","gangOpen","setGangOpen","CreateGangModal","EmployersModal","MultiplierTable","noMargin","effValue","CurrentBitNode","MoneyModal","convertMoneySourceTrackerToString","CharacterStats","moneyOpen","setMoneyOpen","employersOpen","setEmployersOpen","timeRows","showBitNodeMults","isEqual","StockMarketRoot","Purchase4SMarketDataTixApiAccessButton","PurchaseWseAccountButton","PurchaseTixApiAccessButton","Purchase4SMarketDataButton","InfoAndPurchases","StockTickers","setTickerDisplayMode","AllStocks","watchlistSymbols","setWatchlistSymbols","tickers","stockMarketProp","rerenderAllTickers","sanitizedWatchlist","SelectorOrderType","StockTicker","setOrderType","Market","tickerOpen","setTicketOpen","modalProps","setModalProps","placeText","getQuantity","hasOrderAccess","Limit","Stop","getBuyTransactionCostContent","getSellTransactionCostContent","playerMoney","localesWithLongPriceFormat","StockTickerHeaderText","stockPriceFormat","spacesAllottedForStockPrice","spacesAfterStockName","spacesBeforePrice","hdrText","plusOrMinus","StockTickerOrderList","StockTickerOrder","posTxt","LongPosition","percentageGains","ShortPosition","StockTickerPositionText","PlaceOrderModal","portal","level0","level1","level2","level3","BitNodePortal","portalOpen","setPortalOpen","cssClass","aria-description","BitverseRoot","destroyed","destroySequence","setDestroySequence","nextSourceFileLvl","PortalModal","bitNodeKey","maxSourceFileLevel","newLevel","CinematicLine","setLength","ms","newLength","advance","StaneksGiftRoot","MainBoard","setGhostGrid","setRotation","selectedFragment","setSelectedFragment","moveGhost","clickAt","deleteAt","doRotate","selectFragment","FragmentInspector","setC","effectAmt","FragmentOption","colorAt","FragmentSelector","FragmentPreview","ActiveFragmentSummary","summary","coordinate","formatEffect","_width","_height","getComputedStyle","Element","visibility","AchievementsRoot","AchievementList","cssPrimary","cssSecondary","secret","unavailable","locked","pr","defaultExpanded","AchievementIcon","imgLoaded","setImgLoaded","onLoad","ErrorBoundary","Component","hasError","componentDidCatch","ex","previousScrollY","modalOpen","setModalOpen","modalImageSrc","setModalImageSrc","predefinedThemes","themes","templateTheme","onActivated","scrollY","previousColors","onImageClick","handleZoom","ThemeEntry","subheader","image","ComparisonIcon","isBetter","initialAutosave","ImportSaveRoot","currentData","setCurrentData","importModalOpen","setImportModalOpen","headback","setHeadback","dataBeingImported","dataCurrentlyInGame","fetchData","BypassWrapper","getAugmentation","runAfterReset","cbScript","_purchased","_facName","_cbScript","_programName","baseserver","installTime","wasWorking","_companyName","wasFocused","_field","repNeededToDonate","crimeTime","_nextBN","_callbackScript","nextBN","callbackScript","wrapFunction","wrappedAPI","tree","functionName","branch","getNestedProperty","wrapAPILayer","setNestedProperty","empty","nerf","normalServer","relative_filename","evaledDir","t_dst","dst","srcExt","tRes","sRes","sanitizedExpr","used","avail","usedPercent","incorrectUsage","allPrograms","allScripts","allTextFiles","allContracts","allMessages","folders","handleFn","dest","parsedFn","firstParentDir","msgOrLit","ClickableScriptRow","scriptLinksWrap","scriptLink","textDecorationLine","paddingRight","rowSplitArray","rowItem","onScriptLinkClick","ClickableMessageRow","linksWrap","link","onMessageLinkClick","FileType","postSegments","group","segments","linked","filesPerRow","Folder","numThreads","verboseEntries","t_dest","sourcePath","destFile","destPath","positions","getCursor","re","matching","rsObj","delTarget","executableName","runContract","runProgram","commandArgs","threadFlag","tailFlag","toLocaleLowerCase","hasRoot","maxHostname","maxIP","args2","headers","currRunningScripts","numSpacesScript","spacesScript","numSpacesPid","spacesPid","numSpacesThread","spacesThread","tampering","last","minute","timeCompression","ReactDOM","globalThis","onbeforeunload"],"mappings":"aACE,SAASA,EAAqBC,GAQ7B,IAPA,IAMIC,EAAUC,EANV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Y,QAE3F0uD,EAAM,GAAI,CACZ,MAAM4B,EAAqB,CACzB,sBACA,qBACA,qBACA,oBACA,eACA,gBACA,eACA,iBACA,eACA,gBACA,mBACA,oBACA,mBACA,qBACA,mBACA,oBACA,mBACA,mBACA,mBACA,qBACA,kBACA,0BACA,kCACA,6BACA,8BACA,+BACA,+BACA,gCACA,4BACA,kCACA,cACA,eACA,cACA,gBACA,cACA,eACA,mBACA,cACA,YACA,WACA,eACA,cACA,yBACA,gCACA,sBACA,qBACA,qBACA,qBACA,qBACA,qBACA,kBACA,oBACA,oBACA,oBACA,mBACA,mBACA,mBACA,mBACA,mBACA,gBACA,kBACA,oBACA,sBACA,wBACA,8BACA,YACA,YACA,aACA,0BACA,2BACA,kBACA,4BACA,0BACA,UACA,SACA,WACA,UACA,YACA,UACA,WACA,gBAEIC,EAAqB,CACzB,cACA,WACA,aACA,UACA,WACA,UACA,YACA,UACA,WACA,eACA,SACA,cACA,eACA,cACA,gBACA,cACA,eACA,mBACA,eACA,gBACA,eACA,iBACA,eACA,gBACA,mBACA,oBACA,mBACA,qBACA,mBACA,oBACA,sBACA,qBACA,qBACA,oBACA,mBACA,mBACA,mBACA,qBACA,kBACA,0BACA,kCACA,6BACA,8BACA,+BACA,+BACA,gCACA,4BACA,kCACA,YACA,YACA,cACA,sBACA,qBACA,kBACA,qBACA,oBACA,kBACA,kBACA,mBACA,QAEF,IAAI3lC,EAAS4lC,OAAO7B,EAAUhY,kBAC1B9hD,MAAM+1B,KAASA,EAAS,GAC5B+jC,EAAUn1B,IAAI8D,cAAgB1S,EAC9B,IAAK,MAAM6lC,KAASH,SACX3B,EAAU8B,GAEnB,IAAK,MAAM/uB,KAAUitB,EAAUxzB,QAAS,CACtC,MAAMu1B,EAAYhvB,EAClB,IAAI9W,EAAS4lC,OAAOE,EAAU/Z,kBAC1B9hD,MAAM+1B,KAASA,EAAS,GAC5B8lC,EAAUl3B,IAAI8D,cAAgB1S,EAC9B,IAAK,MAAM6lC,KAASF,SAC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E,EACF,GACAsB,IAAOC,EACPzoB,IAAaW,QACb,EACA,IAGJsmB,EAAUnlE,KACR,IAAIolE,EACF,GACAsB,IAAOC,EACPzoB,IAAaY,SACb,EACA,IAGJqmB,EAAUnlE,KACR,IAAIolE,EACF,GACAsB,IAAOI,EACP5oB,IAAaa,aACb,EACA,IAGJomB,EAAUnlE,KACR,IAAIolE,EACF,GACAsB,IAAOM,EACP9oB,IAAac,YACb,EACA,IAGJmmB,EAAUnlE,KACR,IAAIolE,EACF,GACAsB,IAAOK,EACP7oB,IAAae,IACb,GACA,IAGJkmB,EAAUnlE,KACR,IAAIolE,EACF,GACAsB,IAAOK,EACP7oB,IAAagB,UACb,GACA,IAGJimB,EAAUnlE,KACR,IAAIolE,EACF,GACAsB,IAAOthD,EACP84B,IAAaiB,MACb,EACA,IAGJgmB,EAAUnlE,KACR,IAAIolE,EACF,GACAsB,IAAOC,EACPzoB,IAAakB,YACb,GACA,IAGJ+lB,EAAUnlE,KACR,IAAIolE,EACF,IACA,CAEE,CAACoB,EAAGC,EAAGA,GACP,CAACA,EAAGA,EAAGD,GACP,CAACA,EAAGC,EAAGD,IAETtoB,IAAa+oB,QACb,IACA,KAGJ9B,EAAUnlE,KACR,IAAIolE,EACF,IACA,CAEE,CAACqB,EAAGA,EAAGA,EAAGA,GACV,CAACA,EAAGD,EAAGA,EAAGA,IAEZtoB,IAAa+oB,QACb,IACA,KAGJ9B,EAAUnlE,KACR,IAAIolE,EACF,IACA,CAEE,CAACoB,EAAGC,EAAGA,EAAGA,GACV,CAACA,EAAGA,EAAGD,EAAGA,IAEZtoB,IAAa+oB,QACb,IACA,KAGJ9B,EAAUnlE,KACR,IAAIolE,EACF,IACA,CAEE,CAACqB,EAAGA,EAAGA,EAAGD,GACV,CAACA,EAAGA,EAAGC,EAAGA,IAEZvoB,IAAa+oB,QACb,IACA,KAGJ9B,EAAUnlE,KACR,IAAIolE,EACF,IACA,CAEE,CAACoB,EAAGC,EAAGA,GACP,CAACD,EAAG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rCkpB,GAAWkD,EAAWpsB,WAAa,eACnCkpB,GAAWmD,EAAYrsB,WAAa,gBACpCkpB,GAAW00G,EAAO59H,WAAa,gBAE/BkpB,EAAU,aACN0C,EAAa,IACf1C,GAAW0C,EAAa,cAEtBE,EAAc,IAChB5C,GAAW4C,EAAc,eAEvBE,EAAa,IACf9C,GAAW8C,EAAa,cAEtBE,EAAe,IACjBhD,GAAWgD,EAAe,gBAExBE,EAAa,IACflD,GAAWkD,EAAa,cAEtBC,EAAc,IAChBnD,GAAWmD,EAAc,eAEvBuxG,EAAS,IACX10G,GAAW00G,EAAS,iBAEtB10G,EAAUA,EAAQlqB,UAAU,EAAGkqB,EAAQjwC,OAAS,GAChDiwC,GAAW,KAENA,EAjDT,mC,6BCHA,oEAGO,MAAM20G,EAA6B,CACxC,oDACA,IACA,8EACA,sFACA,sFACA,mFACA,8EACA,qEACA,6EACA,2EACA,gEACA,uEACA,uDACA,4FACA,8EACA,kFACA,mHACA,oEACA,kGACA,wEACA,oEACA,gFACA,6FACA,4FACA,6EACA,2FACA,iGACA,6EACA,4GACA,0FACA,yEACA,uEACA,gGACA,0FACA,iFACA,+FACA,0FACA,4FACA,uEACA,wHACA,sFACA,iFACA,KAGIC,EACWx0D,GACN,CACJ,UAASA,wBACT,IACA,4GACA,4FACA,IACA,4CAA2CA,kDAC3C,kBAAiBA,yEACjB,IACA,YACA,IACA,OAAMA,YACN,OAAMA,qBACN,IACA,OAAMA,WACN,OAAMA,iBACN,KAKMy0D,EAA4B,CACvChuE,MAAO,CACL,oCACA,IACA,4FACA,uGACA,yHACA,kGACA,IACA,gCACA,IACA,mHACA,yHACA,4CACA,IACA,gCACA,IACA,6DACA,IACA,eACA,IACA,2HACA,4HACA,IACA,mCACA,IACA,8GACA,IACA,uHACA,uCACA,IACA,uDACA,KAEFiuE,QAAS,CACP,iBACA,IACA,0GACA,mHACA,kHACA,gCACA,KAEFC,SAAU,CACR,kBACA,IACA,6FACA,IACA,+BACA,KAEF3gH,IAAK,CACH,iCACA,IACA,yEACA,IACA,oHACA,oDACA,IACA,+FACA,IACA,wGACA,KAEF4gH,IAAK,CACH,oBACA,IACA,6EACA,IACA,iBACA,IACA,kBACA,IACA,sBACA,KAEFnP,GAAI,CACF,kBACA,IACA,yGACA,iFACA,IACA,yBACA,IACA,eACA,IACA,aACA,KAEFoP,MAAO,CACL,uCACA,IACA,+HACA,uDACA,kIACA,IACA,oCACA,IACA,gGACA,IACA,sCACA,KAEF7iE,MAAO,CACL,eACA,IACA,mIACA,uIACA,KAEF8iE,IAAK,CACH,aACA,IACA,mIACA,yIACA,KAEFtiD,QAAS,CACP,4BACA,IACA,+FACA,oIACA,8GACA,KAEFuiD,GAAI,CAAC,wBAAyB,IAAK,wEAAyE,KAC5G1oF,SAAU,CACR,qCACA,IACA,mFACA,IACA,4GACA,IACA,kDACA,IACA,0CACA,IACA,0CACA,KAEF2oF,KAAM,CACJ,wCACA,IACA,oFACA,IACA,oBACA,IACA,WACA,IACA,wBACA,IACA,qFACA,KAEFC,KAAM,CACJ,cACA,IACA,gIACA,gCACA,KAEFl0C,KAAM,CACJ,cACA,IACA,6GACA,2CACA,KAEF5oG,KAAM,CACJ,cACA,IACA,uHACA,KAEF+8I,KAAM,CACJ,wBACA,IACA,yHACA,0HACA,mEACA,IACA,iBACA,IACA,wBACA,KAEFC,QAAS,CACP,sBACA,IACA,6GACA,KAEFl4G,KAAM,CACJ,cACA,IACA,sGACA,KAEF/lC,SAAU,CAAC,kBAAmB,IAAK,4CAA6C,KAChFoxE,KAAM,CACJ,mDACA,IACA,4EACA,IACA,6EACA,4EACA,iFACA,4DACA,IACA,uCACA,IACA,qEACA,IACA,wCACA,IACA,qFACA,KAEF65B,QAAS,CACP,iBACA,IACA,4CACA,2HACA,uHACA,2EACA,KAEFG,GAAI,CACF,wCACA,IACA,iIACA,sDACA,IACA,8FACA,IACA,gFACA,IACA,yHACA,IACA,YACA,IACA,wEACA,IACA,2BACA,IACA,iEACA,IACA,yBACA,IACA,uFACA,IACA,oCACA,KAEF8yC,MAAO,CAAC,eAAgB,IAAK,wDAAyD,KAEtFC,IAAK,CACH,4CACA,IACA,6HACA,2HACA,gFACA,IACA,qBACA,IACA,2BACA,IACA,4HACA,iFACA,KAEFrxF,GAAI,CACF,yBACA,IACA,6FACA,6FACA,kCACA,IACA,kFACA,kBACA,aACA,IACA,qEACA,IACA,oCACA,KAEFsxF,KAAMd,EAAgC,QACtCjyC,GAAI,CAAC,YAAa,IAAK,4DAA6D,KACpF8B,GAAI,CACF,mBACA,IACA,6GACA,IACA,kDACA,KAEFn2D,IAAK,CACH,sDACA,IACA,gDACA,IACA,sHACA,2GACA,gEACA,2DACA,2FACA,IACA,kHACA,iFACA,KAEFoyD,KAAM,CACJ,cACA,IACA,6HACA,2CACA,KAEF,eAAgB,CACd,mCACA,IACA,kGACA,wGACA,4EACA,IACA,uGACA,qGACA,0BACA,IACA,iHACA,yGACA,UACA,IACA,2GACA,sEACA,KAEF+B,IAAK,CACH,4CACA,IACA,8EACA,2GACA,oCACA,2FACA,IACA,6BACA,IACA,wCACA,KAEFkzC,MAAO,CAAC,eAAgB,IAAK,oEAAqE,KAElG/vC,KAAM,CACJ,sCACA,IACA,oHACA,uHACA,oEACA,IACA,8BACA,IACA,gFACA,IACA,+BACA,KAEF/7B,IAAK,CACH,aACA,IACA,yGACA,+BACA,KAEF+rE,QAAS,CACP,8BACA,IACA,mFACA,IACA,iDACA,IACA,oBACA,IACA,kCACA,IACA,gBACA,IACA,kGACA,KAEFl6F,IAAKk5F,EAAgC,OACrC3sH,OAAQ,CACN,gBACA,IACA,oHACA,iEACA,KAEFw9E,KAAM,CACJ,kCACA,IACA,iGACA,iGACA,0CACA,IACA,mGACA,iDACA,IACA,mGACA,O,6BC/dJ,wEAIKowC,EAKAC,EATL,0B,SAIKD,O,2BAAAA,I,8BAAAA,M,cAKAC,O,qBAAAA,I,kBAAAA,M,KA2CE,MAAMrU,EAAe,qDA8BrB,SAASsU,EAAmB3+H,EAA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,wBACA,4BACA,gBACA,+DACA,kCACA,gBACA,kBACA,mDACA,IACA,IACA,cACA,IACA,MAKA,+BACA,mDACA,+BACA,sBACA,0DACA,IACA,wBACA,4BACA,yCACA,uDACA,IACA,8BACA,aACA,oBACA,qBACA,+CACA,iBACA,IACA,OACA,IACA,oBACA,KACA,sBACA,iBACA,MACA,IAKA,oCACA,wDACA,+BACA,sBACA,0DACA,IACA,wBACA,4BACA,yCACA,uDACA,IACA,8BACA,aACA,oBACA,qBACA,+CACA,YACA,IACA,OACA,IACA,aACA,KACA,sBACA,iBACA,MACA,IAIA,oDACA,8CACA,gCACA,kEACA,YACA,wBACA,4BACA,yCACA,SACA,oBACA,4CACA,OACA,IACA,IACA,MAIA,uDACA,8CACA,sBACA,0DACA,IACA,yCACA,wBACA,mDACA,4BACA,mCACA,mBACA,gBACA,IACA,yCACA,qEACA,yBACA,uBACA,qBACA,oBACA,2BACA,+BACA,uDACA,iCACA,8FACA,IACA,8BACA,oBACA,+DACA,wEACA,4CACA,eACA,IACA,0BACA,OACA,IACA,qBACA,gBACA,IACA,MAIA,gDACA,8CACA,gCACA,8DACA,eACA,wBACA,4BACA,yCACA,sBACA,SACA,oBACA,mDACA,OACA,IACA,YACA,IACA,MAIA,mDACA,8CACA,0CACA,kEACA,4DACA,gCACA,wBACA,WACA,oCACA,kBACA,kEACA,IACA,kBACA,IACA,yBACA,mDACA,IACA,gBACA,IACA,MAIA,wDACA,8CACA,0CACA,yGACA,kEACA,+BACA,wBACA,WACA,mCACA,eACA,kEACA,IACA,kBACA,IACA,wBACA,mDACA,IACA,gBACA,IACA,MAIA,iDACA,8CACA,+BACA,6DACA,wBACA,4BACA,+DACA,kCACA,iDACA,eACA,IACA,IACA,gBACA,IACA,MAEA,gBACA,oCACA,8CAEA,wCACA,2BACA,IAEA,0CACA,mBACA,kDACA,4CACA,sBACA,yBACA,sBACA,aACA,IACA,IACA,uBACA,IACA,eACA,KACA,QAEA,2DACA,8CACA,eACA,gBACA,0CACA,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ytJ,GAAQ,MAAM,IAAI31J,MAAM,kCAC3C,MAAM/I,EAAO0+J,EAMb,MAHe,IAAI1+J,EAAK,IACrB4vB,IAAKzJ,GAAa,MAANA,EAAYA,EAAItV,OAAO2gJ,cAAerrI,EAAEkB,WAAW,GAAK,GAAKrnB,EAAK,GAAK,IAAM,GAAM,KAC/F6S,KAAK,MACUmnK,IAGtB,CACEvrJ,KAAOiwI,IACL,IAAK1tJ,MAAMC,QAAQytJ,GAAQ,MAAM,IAAI31J,MAAM,kCAC3C,MAAM/I,EAAO0+J,EACb,MAAO,CACL,qEACA,2EACA,kCACA,+GACA,+FACA,sFACA,sFACA,qFACA,qFACA,qFACA,wGACA,qFACA,uFACA,8GACA,8EACA,sCACA,qDACA,6GACA,iHACA,8CACC,iBAAgB1+J,EAAK,SAASA,EAAK,SACpC,6EACA,8CACA6S,KAAK,MAET+nC,WAAY,EACZ8pB,IAAK,IAqHI,CAnHO,CACZ,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,QACA,SA4FG3+C,KAAK,IAAM7b,KAAKC,SAAW,IAC3BtG,MAAM,EAAG,GACTgP,KAAK,IA5FG,CACX,YACA,YACA,UACA,WACA,YACA,UACA,UACA,YACA,YACA,UACA,UACA,WACA,WACA,YACA,YACA,WACA,UACA,UACA,WACA,WACA,UACA,WACA,UACA,UACA,WACA,WACA,UACA,YACA,WACA,WACA,WACA,WACA,YACA,YACA,UACA,YACA,WACA,YACA,WACA,WACA,WACA,UACA,UACA,YACA,YACA,UACA,UACA,UACA,WACA,WACA,UACA,YACA,WACA,WACA,WACA,UACA,UACA,UACA,UACA,UACA,WACA,WACA,UACA,UACA,UACA,WACA,YACA,WACA,WACA,UACA,UACA,UACA,WACA,WACA,WACA,UACA,WACA,WACA,UACA,UACA,UACA,YACA,UACA,UACA,WACA,aAOKkT,KAAK,IAAM7b,KAAKC,SAAW,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AMA,MAAM9sF,EAAc,CAClB,iBACA,WACA,0BACA,cACA,UACA,gBACA,qBACA,kBACA,2BACA,sBACA,wBACA,uBACA,wBACA,8BACA,uBACA,kBACA,sBACA,gBACA,iBACA,gBACA,mBACA,wBACA,qBACA,kBACA,sBACA,gBACA,wBACA,sBACA,0BACA,wBACA,eACA,aACA,cACA,uBACA,kBACA,SACA,YACA,cACA,aACA,uBACA,kBACA,cACA,UACA,WACA,YACA,aACA,eACA,mBACA,mBACA,iBACA,iBACA,kBAGImqK,EAAkB,CACtB,mBACA,yBACA,mBACA,oBACA,sBACA,mBACA,cACA,YACA,gBACA,qBACA,WACA,qBACA,YACA,kBACA,mBACA,gCACA,sBACA,qBACA,qBACA,kBACA,oBACA,oBACA,oBACA,qBACA,mBACA,YACA,UACA,WACA,UACA,YACA,UACA,WACA,eACA,cACA,eACA,cACA,gBACA,cACA,eACA,mBACA,KACA,SACA,gBACA,kBACA,YACA,mBAGI55L,EAAQ,CACZ,sBACA,qBACA,qBACA,oBACA,eACA,mBACA,gBACA,oBACA,eACA,mBACA,iBACA,qBACA,eACA,mBACA,gBACA,oBACA,0BACA,kCACA,6BACA,8BACA,+BACA,mBACA,mBACA,kBACA,qBACA,mBACA,+BACA,gCACA,4BACA,mCAUW8zD,EAAa,KACxB,MAAM1yB,EAAOh7B,YAAU,QACvB,IAAKg7B,EAAM,MAAM,IAAI/kC,MAAM,gCAC3B,MAAMihE,EAAiB,CACrB,CACEu8H,QAAS,sBACTC,YAAa,kBACbjoB,OAAQ,2DACRkoB,UAAW,IAEb,CACEF,QAAS,wBACTC,YAAa,oBACbjoB,OAAQ,uGACRkoB,UAAW,IAEb,CACEF,QAAS,wBACTC,YAAa,oBACbjoB,OAAQ,qGACRkoB,UAAW,IAEb,CACEF,QAAS,WACTC,YAAa,OACbjoB,OACE,iJACFkoB,UAAW,IAEb,CACEF,QAAS,kBACTC,YAAa,cACbjoB,OAAQ,4FACRkoB,UAAW,IAEb,CACEF,QAAS,mBACTC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D,IAAIkjB,cAC/B5O,EAAOqgB,WAAWi0L,GACdt0M,IAAWs0M,EAAWzqM,EAAM2pM,YAChCS,EAASK,GAFqBzqM,EAAM6pM,aAUPA,UAAW7pM,EAAM6pM,YAC/C,kBAAC,IAAD,CAAYzpK,MAAO,CAAEypB,UAAWwgJ,EAAa,OAAS,eAAiBl0M,GACvE,kBAAC,IAAD,KACGogL,EACD,kBAAC,IAAD,SAkBV,MAAM2zB,EAAQ,CACZ,YACA,SACA,MACA,cACA,QACA,SACA,YACA,SACA,MACA,OACA,SACA,OACA,UACA,WACA,OACA,YACA,UACA,SACA,MACA,MACA,OACA,QACA,YACA,UACA,KACA,SACA,SACA,YACA,QACA,YACA,UACA,UACA,WACA,WACA,YACA,SACA,OACA,MACA,aACA,aACA,YACA,OACA,SACA,WACA,QACA,aACA,SACA,UACA,cACA,UACA,OACA,MACA,WACA,SACA,cACA,MACA,aACA,WACA,OACA,MACA,UACA,QACA,WACA,UACA,aACA,QACA,UACA,MACA,OACA,SACA,WACA,WACA,UACA,QACA,cACA,cACA,YACA,SACA,OACA,SACA,QACA,WACA,WACA,WACA,OACA,SACA,WACA,YACA,OACA,OACA,YACA,YACA,OACA,QACA,UACA,YACA,WACA,aACA,YACA,OACA,WACA,WACA,SACA,MACA,WACA,UACA,SACA,gBACA,OACA,QACA,UACA,QACA,QACA,UACA,YACA,QACA,YACA,UACA,QACA,SACA,SACA,QACA,UACA,cACA,QACA,aACA,MACA,UACA,OACA,WACA,WACA,UACA,SACA,aACA,YACA,SACA,SACA,SACA,OACA,WACA,QACA,OACA,WACA,SACA,SACA,WACA,SACA,UACA,QACA,SACA,QACA,UACA,UACA,UACA,UACA,aACA,WACA,QACA,SACA,MACA,WACA,SACA,aACA,UACA,MACA,OACA,SACA,UACA,OACA,OACA,UACA,SACA,aACA,SACA,SACA,SACA,SACA,SACA,WACA,SACA,YACA,QACA,QACA,YACA,WACA,oBACA,WACA,OACA,UACA,cACA,UACA,SACA,UACA,gBACA,OACA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D,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFtiH,SAAS4lE,eAAe,SAlB5B7a,cACAwzH,WAAU,MAAYp7N,IACtBo7N,WAAU,SAAeD,IACzBA,IAASh8D,OACP,kBAAC,IAAD,KACE,kBAAC,IAAD,OAEFtiH,SAAS4lE,eAAe,SAG1B1/H,WAAWm9I,IAA4B,KAarC1oE,IAAYn2B,UAAUsI,GAIwBxhD,SAASm0D,KAAKhpC,WAAW,aACvEp0B,OAAOm8O,eAAiB,WACtB,MAAO,4BAKTn8O,OAAO6yE,MAAQ,KACb,MAAM,IAAIztE,MAAM,6DAKlBpF,OAAOsyG,OAAS,KACd,MAAM,IAAIltG,MAAM,gE","file":"main.bundle.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t0: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// add entry module to deferred list\n \tdeferredModules.push([1573,1]);\n \t// run deferred modules when ready\n \treturn checkDeferredModules();\n","import { PlayerObject } from \"./PersonObjects/Player/PlayerObject\";\nimport { sanitizeExploits } from \"./Exploits/Exploit\";\n\nimport { Reviver } from \"./utils/JSONReviver\";\n\nexport let Player = new PlayerObject();\n\nexport function loadPlayer(saveString: string): void {\n Player = JSON.parse(saveString, Reviver);\n Player.money = parseFloat(Player.money + \"\");\n Player.exploits = sanitizeExploits(Player.exploits);\n}\n","import { NetscriptContext } from \"./APIWrapper\";\nimport { WorkerScript } from \"./WorkerScript\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { Player } from \"../Player\";\nimport { ScriptDeath } from \"./ScriptDeath\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { ScriptArg } from \"./ScriptArg\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { BasicHGWOptions } from \"src/ScriptEditor/NetscriptDefinitions\";\nimport { Server } from \"../Server/Server\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculateHackingTime,\n calculatePercentMoneyHacked,\n} from \"../Hacking\";\nimport { netscriptCanHack } from \"../Hacking/netscriptCanHack\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { influenceStockThroughServerHack } from \"../StockMarket/PlayerInfluencing\";\nimport { IPort } from \"../NetscriptPort\";\nimport { NetscriptPorts } from \"../NetscriptWorker\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { FormulaGang } from \"../Gang/formulas/formulas\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { toNative } from \"../NetscriptFunctions/toNative\";\nimport { ScriptIdentifier } from \"./ScriptIdentifier\";\nimport { findRunningScript, findRunningScriptByPid } from \"../Script/ScriptHelpers\";\nimport { RunningScript as IRunningScript } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { arrayToString } from \"../utils/helpers/arrayToString\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\nexport const helpers = {\n string,\n number,\n scriptArgs,\n argsToString,\n isScriptErrorMessage,\n makeRuntimeRejectMsg,\n makeRuntimeErrorMsg,\n resolveNetscriptRequestedThreads,\n checkEnvFlags,\n checkSingularityAccess,\n netscriptDelay,\n updateDynamicRam,\n city,\n getServer,\n scriptIdentifier,\n hack,\n getValidPort,\n player,\n server,\n gang,\n gangMember,\n gangTask,\n log,\n getFunctionNames,\n getRunningScript,\n getRunningScriptByArgs,\n getCannotFindRunningScriptErrorMessage,\n createPublicRunningScript,\n failOnHacknetServer,\n};\n\nconst userFriendlyString = (v: unknown): string => {\n const clip = (s: string): string => {\n if (s.length > 15) return s.slice(0, 12) + \"...\";\n return s;\n };\n if (typeof v === \"number\") return String(v);\n if (typeof v === \"string\") {\n if (v === \"\") return \"empty string\";\n return `'${clip(v)}'`;\n }\n const json = JSON.stringify(v);\n if (!json) return \"???\";\n return `'${clip(json)}'`;\n};\n\nconst debugType = (v: unknown): string => {\n if (v === null) return `Is null.`;\n if (v === undefined) return \"Is undefined.\";\n if (typeof v === \"function\") return \"Is a function.\";\n return `Is of type '${typeof v}', value: ${userFriendlyString(v)}`;\n};\n\n/** Convert a provided value v for argument argName to string. If it wasn't originally a string or number, throw. */\nfunction string(ctx: NetscriptContext, argName: string, v: unknown): string {\n if (typeof v === \"string\") return v;\n if (typeof v === \"number\") return v + \"\"; // cast to string;\n throw makeRuntimeErrorMsg(ctx, `'${argName}' should be a string. ${debugType(v)}`);\n}\n\n/** Convert provided value v for argument argName to number. Throw if could not convert to a non-NaN number. */\nfunction number(ctx: NetscriptContext, argName: string, v: unknown): number {\n if (typeof v === \"string\") {\n const x = parseFloat(v);\n if (!isNaN(x)) return x; // otherwise it wasn't even a string representing a number.\n } else if (typeof v === \"number\") {\n if (isNaN(v)) throw makeRuntimeErrorMsg(ctx, `'${argName}' is NaN.`);\n return v;\n }\n throw makeRuntimeErrorMsg(ctx, `'${argName}' should be a number. ${debugType(v)}`);\n}\n\n/** Returns args back if it is a ScriptArg[]. Throws an error if it is not. */\nfunction scriptArgs(ctx: NetscriptContext, args: unknown) {\n if (!isScriptArgs(args)) throw makeRuntimeErrorMsg(ctx, \"'args' is not an array of script args\");\n return args;\n}\n\n/** Determines if the given msg string is an error created by makeRuntimeRejectMsg. */\nfunction isScriptErrorMessage(msg: string): boolean {\n if (!isString(msg)) {\n return false;\n }\n const splitMsg = msg.split(\"|DELIMITER|\");\n return splitMsg.length == 4;\n}\n\n/** Convert multiple arguments for tprint or print into a single string. */\nfunction argsToString(args: unknown[]): string {\n let out = \"\";\n for (let arg of args) {\n if (arg === null) {\n out += \"null\";\n continue;\n }\n if (arg === undefined) {\n out += \"undefined\";\n continue;\n }\n arg = toNative(arg);\n out += typeof arg === \"object\" ? JSON.stringify(arg) : `${arg}`;\n }\n\n return out;\n}\n\n/** Creates an error message string containing hostname, scriptname, and the error message msg */\nfunction makeRuntimeRejectMsg(workerScript: WorkerScript, msg: string): string {\n for (const scriptUrl of workerScript.scriptRef.dependencies) {\n msg = msg.replace(new RegExp(scriptUrl.url, \"g\"), scriptUrl.filename);\n }\n\n return \"|DELIMITER|\" + workerScript.hostname + \"|DELIMITER|\" + workerScript.name + \"|DELIMITER|\" + msg;\n}\n\n/** Creates an error message string with a stack trace. */\nfunction makeRuntimeErrorMsg(ctx: NetscriptContext, msg: string): string {\n const errstack = new Error().stack;\n if (errstack === undefined) throw new Error(\"how did we not throw an error?\");\n const stack = errstack.split(\"\\n\").slice(1);\n const workerScript = ctx.workerScript;\n const caller = ctx.function;\n const scripts = workerScript.getServer().scripts;\n const userstack = [];\n for (const stackline of stack) {\n let filename;\n for (const script of scripts) {\n if (script.filename && stackline.includes(script.filename)) {\n filename = script.filename;\n }\n for (const dependency of script.dependencies) {\n if (stackline.includes(dependency.filename)) {\n filename = dependency.filename;\n }\n }\n }\n if (!filename) continue;\n\n interface ILine {\n line: string;\n func: string;\n }\n\n function parseChromeStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+.*/;\n const funcRe = /.*at (.+) \\(.*/;\n\n const lineMatch = line.match(lineRe);\n const funcMatch = line.match(funcRe);\n if (lineMatch && funcMatch) {\n return { line: lineMatch[1], func: funcMatch[1] };\n }\n return null;\n }\n let call = { line: \"-1\", func: \"unknown\" };\n const chromeCall = parseChromeStackline(stackline);\n if (chromeCall) {\n call = chromeCall;\n }\n\n function parseFirefoxStackline(line: string): ILine | null {\n const lineRe = /.*:(\\d+):\\d+$/;\n const lineMatch = line.match(lineRe);\n\n const lio = line.lastIndexOf(\"@\");\n\n if (lineMatch && lio !== -1) {\n return { line: lineMatch[1], func: line.slice(0, lio) };\n }\n return null;\n }\n\n const firefoxCall = parseFirefoxStackline(stackline);\n if (firefoxCall) {\n call = firefoxCall;\n }\n\n userstack.push(`${filename}:L${call.line}@${call.func}`);\n }\n\n workerScript.log(caller, () => msg);\n let rejectMsg = `${caller}: ${msg}`;\n if (userstack.length !== 0) rejectMsg += `

Stack:
${userstack.join(\"
\")}`;\n return makeRuntimeRejectMsg(workerScript, rejectMsg);\n}\n\n/** Validate requested number of threads for h/g/w options */\nfunction resolveNetscriptRequestedThreads(ctx: NetscriptContext, requestedThreads?: number): number {\n const threads = ctx.workerScript.scriptRef.threads;\n if (!requestedThreads) {\n return isNaN(threads) || threads < 1 ? 1 : threads;\n }\n const requestedThreadsAsInt = requestedThreads | 0;\n if (isNaN(requestedThreads) || requestedThreadsAsInt < 1) {\n throw makeRuntimeRejectMsg(\n ctx.workerScript,\n `Invalid thread count passed to ${ctx.function}: ${requestedThreads}. Threads must be a positive number.`,\n );\n }\n if (requestedThreadsAsInt > threads) {\n throw makeRuntimeRejectMsg(\n ctx.workerScript,\n `Too many threads requested by ${ctx.function}. Requested: ${requestedThreads}. Has: ${threads}.`,\n );\n }\n return requestedThreadsAsInt;\n}\n\n/** Validate singularity access by throwing an error if the player does not have access. */\nfunction checkSingularityAccess(ctx: NetscriptContext): void {\n if (Player.bitNodeN !== 4 && Player.sourceFileLvl(4) === 0) {\n throw makeRuntimeErrorMsg(\n ctx,\n `This singularity function requires Source-File 4 to run. A power up you obtain later in the game.\n It will be very obvious when and how you can obtain it.`,\n );\n }\n}\n\n/** Create an error if a script is dead or if concurrent ns function calls are made */\nfunction checkEnvFlags(ctx: NetscriptContext): void {\n const ws = ctx.workerScript;\n if (ws.env.stopFlag) throw new ScriptDeath(ws);\n if (ws.env.runningFn && ctx.function !== \"asleep\") {\n ws.errorMessage = makeRuntimeRejectMsg(\n ws,\n `Concurrent calls to Netscript functions are not allowed!\n Did you forget to await hack(), grow(), or some other\n promise-returning function?\n Currently running: ${ws.env.runningFn} tried to run: ${ctx.function}`,\n );\n if (ws.delayReject) ws.delayReject(new ScriptDeath(ws));\n throw new ScriptDeath(ws); //No idea if this is the right thing to throw\n }\n}\n\n/** Set a timeout for performing a task, mark the script as busy in the meantime. */\nfunction netscriptDelay(ctx: NetscriptContext, time: number): Promise {\n const ws = ctx.workerScript;\n return new Promise(function (resolve, reject) {\n ws.delay = window.setTimeout(() => {\n ws.delay = null;\n ws.delayReject = undefined;\n ws.env.runningFn = \"\";\n if (ws.env.stopFlag) reject(new ScriptDeath(ws));\n else resolve();\n }, time);\n ws.delayReject = reject;\n ws.env.runningFn = ctx.function;\n });\n}\n\n/** Adds to dynamic ram cost when calling new ns functions from a script */\nfunction updateDynamicRam(ctx: NetscriptContext, ramCost: number): void {\n const ws = ctx.workerScript;\n const fnName = ctx.function;\n if (ws.dynamicLoadedFns[fnName]) return;\n ws.dynamicLoadedFns[fnName] = true;\n\n let threads = ws.scriptRef.threads;\n if (typeof threads !== \"number\") {\n console.warn(`WorkerScript detected NaN for threadcount for ${ws.name} on ${ws.hostname}`);\n threads = 1;\n }\n ws.dynamicRamUsage += ramCost;\n if (ws.dynamicRamUsage > 1.01 * ws.ramUsage) {\n ws.errorMessage = makeRuntimeRejectMsg(\n ws,\n `Dynamic RAM usage calculated to be greater than initial RAM usage on fn: ${fnName}.\n This is probably because you somehow circumvented the static RAM calculation.\n\n Threads: ${threads}\n Dynamic RAM Usage: ${numeralWrapper.formatRAM(ws.dynamicRamUsage)}\n Static RAM Usage: ${numeralWrapper.formatRAM(ws.ramUsage)}\n\n One of these could be the reason:\n * Using eval() to get a reference to a ns function\n   const myScan = eval('ns.scan');\n\n * Using map access to do the same\n   const myScan = ns['scan'];\n\n Sorry :(`,\n );\n throw new ScriptDeath(ws);\n }\n}\n\n/** Validates the input v as being a CityName. Throws an error if it is not. */\nfunction city(ctx: NetscriptContext, argName: string, v: unknown): CityName {\n if (typeof v !== \"string\") throw makeRuntimeErrorMsg(ctx, `${argName} should be a city name.`);\n const s = v as CityName;\n if (!Object.values(CityName).includes(s)) throw makeRuntimeErrorMsg(ctx, `${argName} should be a city name.`);\n return s;\n}\n\nfunction scriptIdentifier(\n ctx: NetscriptContext,\n scriptID: unknown,\n _hostname: unknown,\n _args: unknown,\n): ScriptIdentifier {\n const ws = ctx.workerScript;\n // Provide the pid for the current script if no identifier provided\n if (scriptID === undefined) return ws.pid;\n if (typeof scriptID === \"number\") return scriptID;\n if (typeof scriptID === \"string\") {\n const hostname = _hostname === undefined ? ctx.workerScript.hostname : string(ctx, \"hostname\", _hostname);\n const args = _args === undefined ? [] : scriptArgs(ctx, _args);\n return {\n scriptname: scriptID,\n hostname,\n args,\n };\n }\n throw new Error(\"not implemented\");\n}\n\n/**\n * Gets the Server for a specific hostname/ip, throwing an error\n * if the server doesn't exist.\n * @param {NetscriptContext} ctx - Context from which getServer is being called. For logging purposes.\n * @param {string} hostname - Hostname of the server\n * @returns {BaseServer} The specified server as a BaseServer\n */\nfunction getServer(ctx: NetscriptContext, hostname: string) {\n const server = GetServer(hostname);\n if (server == null) {\n const str = hostname === \"\" ? \"'' (empty string)\" : \"'\" + hostname + \"'\";\n throw makeRuntimeErrorMsg(ctx, `Invalid hostname: ${str}`);\n }\n return server;\n}\n\nfunction isScriptArgs(args: unknown): args is ScriptArg[] {\n const isScriptArg = (arg: unknown) => typeof arg === \"string\" || typeof arg === \"number\" || typeof arg === \"boolean\";\n return Array.isArray(args) && args.every(isScriptArg);\n}\n\nasync function hack(\n ctx: NetscriptContext,\n hostname: string,\n manual: boolean,\n { threads: requestedThreads, stock }: BasicHGWOptions = {},\n): Promise {\n const ws = ctx.workerScript;\n const threads = helpers.resolveNetscriptRequestedThreads(ctx, requestedThreads);\n const server = getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n throw makeRuntimeErrorMsg(ctx, \"Cannot be executed on this server.\");\n }\n\n // Calculate the hacking time\n const hackingTime = calculateHackingTime(server, Player); // This is in seconds\n\n // No root access or skill level too low\n const canHack = netscriptCanHack(server, Player);\n if (!canHack.res) {\n throw makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n hackingTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n\n return helpers.netscriptDelay(ctx, hackingTime * 1000).then(function () {\n const hackChance = calculateHackingChance(server, Player);\n const rand = Math.random();\n let expGainedOnSuccess = calculateHackingExpGain(server, Player) * threads;\n const expGainedOnFailure = expGainedOnSuccess / 4;\n if (rand < hackChance) {\n // Success!\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n let maxThreadNeeded = Math.ceil(1 / percentHacked);\n if (isNaN(maxThreadNeeded)) {\n // Server has a 'max money' of 0 (probably). We'll set this to an arbitrarily large value\n maxThreadNeeded = 1e6;\n }\n\n let moneyDrained = Math.floor(server.moneyAvailable * percentHacked) * threads;\n\n // Over-the-top safety checks\n if (moneyDrained <= 0) {\n moneyDrained = 0;\n expGainedOnSuccess = expGainedOnFailure;\n }\n if (moneyDrained > server.moneyAvailable) {\n moneyDrained = server.moneyAvailable;\n }\n server.moneyAvailable -= moneyDrained;\n if (server.moneyAvailable < 0) {\n server.moneyAvailable = 0;\n }\n\n let moneyGained = moneyDrained * BitNodeMultipliers.ScriptHackMoneyGain;\n if (manual) {\n moneyGained = moneyDrained * BitNodeMultipliers.ManualHackMoney;\n }\n\n Player.gainMoney(moneyGained, \"hacking\");\n ws.scriptRef.onlineMoneyMade += moneyGained;\n Player.scriptProdSinceLastAug += moneyGained;\n ws.scriptRef.recordHack(server.hostname, moneyGained, threads);\n Player.gainHackingExp(expGainedOnSuccess);\n if (manual) Player.gainIntelligenceExp(0.005);\n ws.scriptRef.onlineExpGained += expGainedOnSuccess;\n log(\n ctx,\n () =>\n `Successfully hacked '${server.hostname}' for ${numeralWrapper.formatMoney(\n moneyGained,\n )} and ${numeralWrapper.formatExp(expGainedOnSuccess)} exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n server.fortify(CONSTANTS.ServerFortifyAmount * Math.min(threads, maxThreadNeeded));\n if (stock) {\n influenceStockThroughServerHack(server, moneyDrained);\n }\n if (manual) {\n server.backdoorInstalled = true;\n }\n return Promise.resolve(moneyGained);\n } else {\n // Player only gains 25% exp for failure?\n Player.gainHackingExp(expGainedOnFailure);\n ws.scriptRef.onlineExpGained += expGainedOnFailure;\n log(\n ctx,\n () =>\n `Failed to hack '${server.hostname}'. Gained ${numeralWrapper.formatExp(\n expGainedOnFailure,\n )} exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return Promise.resolve(0);\n }\n });\n}\n\nfunction getValidPort(ctx: NetscriptContext, port: number): IPort {\n if (isNaN(port)) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Invalid argument. Must be a port number between 1 and ${CONSTANTS.NumNetscriptPorts}, is ${port}`,\n );\n }\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw makeRuntimeErrorMsg(\n ctx,\n `Trying to use an invalid port: ${port}. Only ports 1-${CONSTANTS.NumNetscriptPorts} are valid.`,\n );\n }\n const iport = NetscriptPorts[port - 1];\n if (iport == null || !(iport instanceof Object)) {\n throw makeRuntimeErrorMsg(ctx, `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return iport;\n}\n\nfunction player(ctx: NetscriptContext, p: unknown): IPlayer {\n const fakePlayer = {\n hp: undefined,\n mults: undefined,\n numPeopleKilled: undefined,\n money: undefined,\n city: undefined,\n location: undefined,\n bitNodeN: undefined,\n totalPlaytime: undefined,\n playtimeSinceLastAug: undefined,\n playtimeSinceLastBitnode: undefined,\n jobs: undefined,\n factions: undefined,\n tor: undefined,\n inBladeburner: undefined,\n hasCorporation: undefined,\n entropy: undefined,\n };\n if (!roughlyIs(fakePlayer, p)) throw makeRuntimeErrorMsg(ctx, `player should be a Player.`);\n return p as IPlayer;\n}\n\nfunction server(ctx: NetscriptContext, s: unknown): Server {\n const fakeServer = {\n cpuCores: undefined,\n ftpPortOpen: undefined,\n hasAdminRights: undefined,\n hostname: undefined,\n httpPortOpen: undefined,\n ip: undefined,\n isConnectedTo: undefined,\n maxRam: undefined,\n organizationName: undefined,\n ramUsed: undefined,\n smtpPortOpen: undefined,\n sqlPortOpen: undefined,\n sshPortOpen: undefined,\n purchasedByPlayer: undefined,\n backdoorInstalled: undefined,\n baseDifficulty: undefined,\n hackDifficulty: undefined,\n minDifficulty: undefined,\n moneyAvailable: undefined,\n moneyMax: undefined,\n numOpenPortsRequired: undefined,\n openPortCount: undefined,\n requiredHackingSkill: undefined,\n serverGrowth: undefined,\n };\n if (!roughlyIs(fakeServer, s)) throw makeRuntimeErrorMsg(ctx, `server should be a Server.`);\n return s as Server;\n}\n\nfunction roughlyIs(expect: object, actual: unknown): boolean {\n if (typeof actual !== \"object\" || actual == null) return false;\n\n const expects = Object.keys(expect);\n const actuals = Object.keys(actual);\n for (const expect of expects)\n if (!actuals.includes(expect)) {\n return false;\n }\n return true;\n}\n\nfunction gang(ctx: NetscriptContext, g: unknown): FormulaGang {\n if (!roughlyIs({ respect: 0, territory: 0, wantedLevel: 0 }, g))\n throw makeRuntimeErrorMsg(ctx, `gang should be a Gang.`);\n return g as FormulaGang;\n}\n\nfunction gangMember(ctx: NetscriptContext, m: unknown): GangMember {\n if (!roughlyIs(new GangMember(), m)) throw makeRuntimeErrorMsg(ctx, `member should be a GangMember.`);\n return m as GangMember;\n}\n\nfunction gangTask(ctx: NetscriptContext, t: unknown): GangMemberTask {\n if (!roughlyIs(new GangMemberTask(\"\", \"\", false, false, {}), t))\n throw makeRuntimeErrorMsg(ctx, `task should be a GangMemberTask.`);\n return t as GangMemberTask;\n}\n\nfunction log(ctx: NetscriptContext, message: () => string) {\n ctx.workerScript.log(ctx.functionPath, message);\n}\n\n/**\n * Searches for and returns the RunningScript object for the specified script.\n * If the 'fn' argument is not specified, this returns the current RunningScript.\n * @param {string} fn - Filename of script\n * @param {string} hostname - Hostname/ip of the server on which the script resides\n * @param {any[]} scriptArgs - Running script's arguments\n * @returns {RunningScript}\n * Running script identified by the parameters, or null if no such script\n * exists, or the current running script if the first argument 'fn'\n * is not specified.\n */\nfunction getRunningScriptByArgs(\n ctx: NetscriptContext,\n fn: string,\n hostname: string,\n scriptArgs: ScriptArg[],\n): RunningScript | null {\n if (!Array.isArray(scriptArgs)) {\n throw helpers.makeRuntimeRejectMsg(\n ctx.workerScript,\n `Invalid scriptArgs argument passed into getRunningScript() from ${ctx.function}(). ` +\n `This is probably a bug. Please report to game developer`,\n );\n }\n\n if (fn != null && typeof fn === \"string\") {\n // Get Logs of another script\n if (hostname == null) {\n hostname = ctx.workerScript.hostname;\n }\n const server = helpers.getServer(ctx, hostname);\n\n return findRunningScript(fn, scriptArgs, server);\n }\n\n // If no arguments are specified, return the current RunningScript\n return ctx.workerScript.scriptRef;\n}\n\n/** Provides an array of all function names on a nested object */\nfunction getFunctionNames(obj: object, prefix: string): string[] {\n const functionNames: string[] = [];\n for (const [key, value] of Object.entries(obj)) {\n if (key === \"args\") {\n continue;\n } else if (typeof value == \"function\") {\n functionNames.push(prefix + key);\n } else if (typeof value == \"object\") {\n functionNames.push(...getFunctionNames(value, key + \".\"));\n }\n }\n return functionNames;\n}\n\nfunction getRunningScriptByPid(pid: number): RunningScript | null {\n for (const server of GetAllServers()) {\n const runningScript = findRunningScriptByPid(pid, server);\n if (runningScript) return runningScript;\n }\n return null;\n}\n\nfunction getRunningScript(ctx: NetscriptContext, ident: ScriptIdentifier): RunningScript | null {\n if (typeof ident === \"number\") {\n return getRunningScriptByPid(ident);\n } else {\n return getRunningScriptByArgs(ctx, ident.scriptname, ident.hostname, ident.args);\n }\n}\n\n/**\n * Helper function for getting the error log message when the user specifies\n * a nonexistent running script\n * @param {string} fn - Filename of script\n * @param {string} hostname - Hostname/ip of the server on which the script resides\n * @param {any[]} scriptArgs - Running script's arguments\n * @returns {string} Error message to print to logs\n */\nfunction getCannotFindRunningScriptErrorMessage(ident: ScriptIdentifier): string {\n if (typeof ident === \"number\") return `Cannot find running script with pid: ${ident}`;\n\n return `Cannot find running script ${ident.scriptname} on server ${ident.hostname} with args: ${arrayToString(\n ident.args,\n )}`;\n}\n\n/**\n * Sanitizes a `RunningScript` to remove sensitive information, making it suitable for\n * return through an NS function.\n * @see NS.getRecentScripts\n * @see NS.getRunningScript\n * @param runningScript Existing, internal RunningScript\n * @returns A sanitized, NS-facing copy of the RunningScript\n */\nfunction createPublicRunningScript(runningScript: RunningScript): IRunningScript {\n return {\n args: runningScript.args.slice(),\n filename: runningScript.filename,\n logs: runningScript.logs.slice(),\n offlineExpGained: runningScript.offlineExpGained,\n offlineMoneyMade: runningScript.offlineMoneyMade,\n offlineRunningTime: runningScript.offlineRunningTime,\n onlineExpGained: runningScript.onlineExpGained,\n onlineMoneyMade: runningScript.onlineMoneyMade,\n onlineRunningTime: runningScript.onlineRunningTime,\n pid: runningScript.pid,\n ramUsage: runningScript.ramUsage,\n server: runningScript.server,\n threads: runningScript.threads,\n };\n}\n\n/**\n * Used to fail a function if the function's target is a Hacknet Server.\n * This is used for functions that should run on normal Servers, but not Hacknet Servers\n * @param {Server} server - Target server\n * @param {string} callingFn - Name of calling function. For logging purposes\n * @returns {boolean} True if the server is a Hacknet Server, false otherwise\n */\nfunction failOnHacknetServer(ctx: NetscriptContext, server: BaseServer, callingFn = \"\"): boolean {\n if (server instanceof HacknetServer) {\n ctx.workerScript.log(callingFn, () => `Does not work on Hacknet Servers`);\n return true;\n } else {\n return false;\n }\n}\n","export enum FactionNames {\n Illuminati = \"Illuminati\",\n Daedalus = \"Daedalus\",\n TheCovenant = \"The Covenant\",\n ECorp = \"ECorp\",\n MegaCorp = \"MegaCorp\",\n BachmanAssociates = \"Bachman & Associates\",\n BladeIndustries = \"Blade Industries\",\n NWO = \"NWO\",\n ClarkeIncorporated = \"Clarke Incorporated\",\n OmniTekIncorporated = \"OmniTek Incorporated\",\n FourSigma = \"Four Sigma\",\n KuaiGongInternational = \"KuaiGong International\",\n FulcrumSecretTechnologies = \"Fulcrum Secret Technologies\",\n BitRunners = \"BitRunners\",\n TheBlackHand = \"The Black Hand\",\n NiteSec = \"NiteSec\",\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n SpeakersForTheDead = \"Speakers for the Dead\",\n TheDarkArmy = \"The Dark Army\",\n TheSyndicate = \"The Syndicate\",\n Silhouette = \"Silhouette\",\n Tetrads = \"Tetrads\",\n SlumSnakes = \"Slum Snakes\",\n Netburners = \"Netburners\",\n TianDiHui = \"Tian Di Hui\",\n CyberSec = \"CyberSec\",\n Bladeburners = \"Bladeburners\",\n ChurchOfTheMachineGod = \"Church of the Machine God\",\n ShadowsOfAnarchy = \"Shadows of Anarchy\",\n}\n","import { ISelfInitializer, ISelfLoading } from \"../types\";\nimport { OwnedAugmentationsOrderSetting, PurchaseAugmentationsOrderSetting } from \"./SettingEnums\";\nimport { defaultTheme, ITheme } from \"../Themes/Themes\";\nimport { defaultStyles } from \"../Themes/Styles\";\nimport { WordWrapOptions } from \"../ScriptEditor/ui/Options\";\nimport { OverviewSettings } from \"../ui/React/Overview\";\nimport { IStyleSettings } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { defaultMonacoTheme, IScriptEditorTheme } from \"../ScriptEditor/ui/themes\";\n\n/**\n * Represents the default settings the player could customize.\n */\ninterface IDefaultSettings {\n /**\n * How many servers per page\n */\n ActiveScriptsServerPageSize: number;\n /**\n * How many scripts per page\n */\n ActiveScriptsScriptPageSize: number;\n /**\n * How often the game should autosave the player's progress, in seconds.\n */\n AutosaveInterval: number;\n\n /**\n * How many milliseconds between execution points for Netscript 1 statements.\n */\n CodeInstructionRunTime: number;\n\n /**\n * Render city as list of buttons.\n */\n DisableASCIIArt: boolean;\n\n /**\n * Whether global keyboard shortcuts should be recognized throughout the game.\n */\n DisableHotkeys: boolean;\n\n /**\n * Whether text effects such as corruption should be visible.\n */\n DisableTextEffects: boolean;\n\n /**\n * Whether overview progress bars should be visible.\n */\n DisableOverviewProgressBars: boolean;\n\n /**\n * Enable bash hotkeys\n */\n EnableBashHotkeys: boolean;\n\n /**\n * Timestamps format\n */\n TimestampsFormat: string;\n\n /**\n * Locale used for display numbers\n */\n Locale: string;\n\n /**\n * Limit the number of recently killed script entries being tracked.\n */\n MaxRecentScriptsCapacity: number;\n\n /**\n * Limit the number of log entries for each script being executed on each server.\n */\n MaxLogCapacity: number;\n\n /**\n * Limit how many entries can be written to a Netscript Port before entries start to get pushed out.\n */\n MaxPortCapacity: number;\n\n /**\n * Limit the number of entries in the terminal.\n */\n MaxTerminalCapacity: number;\n\n /**\n * Port the Remote File API client will try to connect to.\n */\n RemoteFileApiPort: number;\n\n /**\n * Save the game when you save any file.\n */\n SaveGameOnFileSave: boolean;\n\n /**\n * Whether the player should be asked to confirm purchasing each and every augmentation.\n */\n SuppressBuyAugmentationConfirmation: boolean;\n\n /**\n * Whether the user should be prompted to join each faction via a dialog box.\n */\n SuppressFactionInvites: boolean;\n\n /**\n * Whether the user should be shown a dialog box whenever they receive a new message file.\n */\n SuppressMessages: boolean;\n\n /**\n * Whether the user should be asked to confirm travelling between cities.\n */\n SuppressTravelConfirmation: boolean;\n\n /**\n * Whether the user should be displayed a popup message when his Bladeburner actions are cancelled.\n */\n SuppressBladeburnerPopup: boolean;\n\n /**\n * Whether the user should be displayed a popup message on stock market actions.\n */\n SuppressTIXPopup: boolean;\n\n /**\n * Whether the user should be displayed a toast alert when the game is saved.\n */\n SuppressSavedGameToast: boolean;\n\n /**\n * Whether the user should be displayed a toast warning when the autosave is disabled.\n */\n SuppressAutosaveDisabledWarnings: boolean;\n\n /*\n * Whether the game should skip saving the running scripts for late game\n */\n ExcludeRunningScriptsFromSave: boolean;\n\n /*\n * Theme colors\n */\n theme: ITheme;\n\n /*\n * Interface styles\n */\n styles: IStyleSettings;\n\n /*\n * Use GiB instead of GB\n */\n UseIEC60027_2: boolean;\n\n /*\n * Character overview settings\n */\n overview: OverviewSettings;\n\n /**\n * If the game's sidebar is opened\n */\n IsSidebarOpened: boolean;\n\n /**\n * Script editor theme data\n */\n EditorTheme: IScriptEditorTheme;\n}\n\n/**\n * Represents all possible settings the player wants to customize to their play style.\n */\ninterface ISettings extends IDefaultSettings {\n /**\n * What order the player's owned Augmentations/Source Files should be displayed in\n */\n OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting;\n\n /**\n * What order the Augmentations should be displayed in when purchasing from a Faction\n */\n PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting;\n\n MonacoTheme: string;\n\n MonacoInsertSpaces: boolean;\n\n MonacoFontSize: number;\n\n MonacoVim: boolean;\n\n MonacoWordWrap: WordWrapOptions;\n}\n\nexport const defaultSettings: IDefaultSettings = {\n ActiveScriptsServerPageSize: 10,\n ActiveScriptsScriptPageSize: 10,\n AutosaveInterval: 60,\n CodeInstructionRunTime: 50,\n DisableASCIIArt: false,\n DisableHotkeys: false,\n DisableTextEffects: false,\n DisableOverviewProgressBars: false,\n EnableBashHotkeys: false,\n TimestampsFormat: \"\",\n Locale: \"en\",\n MaxRecentScriptsCapacity: 50,\n MaxLogCapacity: 50,\n MaxPortCapacity: 50,\n MaxTerminalCapacity: 500,\n RemoteFileApiPort: 0,\n SaveGameOnFileSave: true,\n SuppressBuyAugmentationConfirmation: false,\n SuppressFactionInvites: false,\n SuppressMessages: false,\n SuppressTravelConfirmation: false,\n SuppressBladeburnerPopup: false,\n SuppressTIXPopup: false,\n SuppressSavedGameToast: false,\n SuppressAutosaveDisabledWarnings: false,\n UseIEC60027_2: false,\n ExcludeRunningScriptsFromSave: false,\n IsSidebarOpened: true,\n\n theme: defaultTheme,\n styles: defaultStyles,\n overview: { x: 0, y: 0, opened: true },\n\n EditorTheme: defaultMonacoTheme,\n};\n\n/**\n * The current options the player has customized to their play style.\n */\n// tslint:disable-next-line:variable-name\nexport const Settings: ISettings & ISelfInitializer & ISelfLoading = {\n ActiveScriptsServerPageSize: defaultSettings.ActiveScriptsServerPageSize,\n ActiveScriptsScriptPageSize: defaultSettings.ActiveScriptsScriptPageSize,\n AutosaveInterval: defaultSettings.AutosaveInterval,\n CodeInstructionRunTime: 25,\n DisableASCIIArt: defaultSettings.DisableASCIIArt,\n DisableHotkeys: defaultSettings.DisableHotkeys,\n DisableTextEffects: defaultSettings.DisableTextEffects,\n DisableOverviewProgressBars: defaultSettings.DisableOverviewProgressBars,\n EnableBashHotkeys: defaultSettings.EnableBashHotkeys,\n TimestampsFormat: defaultSettings.TimestampsFormat,\n Locale: \"en\",\n MaxRecentScriptsCapacity: defaultSettings.MaxRecentScriptsCapacity,\n MaxLogCapacity: defaultSettings.MaxLogCapacity,\n MaxPortCapacity: defaultSettings.MaxPortCapacity,\n MaxTerminalCapacity: defaultSettings.MaxTerminalCapacity,\n OwnedAugmentationsOrder: OwnedAugmentationsOrderSetting.AcquirementTime,\n PurchaseAugmentationsOrder: PurchaseAugmentationsOrderSetting.Default,\n RemoteFileApiPort: defaultSettings.RemoteFileApiPort,\n SaveGameOnFileSave: defaultSettings.SaveGameOnFileSave,\n SuppressBuyAugmentationConfirmation: defaultSettings.SuppressBuyAugmentationConfirmation,\n SuppressFactionInvites: defaultSettings.SuppressFactionInvites,\n SuppressMessages: defaultSettings.SuppressMessages,\n SuppressTravelConfirmation: defaultSettings.SuppressTravelConfirmation,\n SuppressBladeburnerPopup: defaultSettings.SuppressBladeburnerPopup,\n SuppressTIXPopup: defaultSettings.SuppressTIXPopup,\n SuppressSavedGameToast: defaultSettings.SuppressSavedGameToast,\n SuppressAutosaveDisabledWarnings: defaultSettings.SuppressAutosaveDisabledWarnings,\n UseIEC60027_2: defaultSettings.UseIEC60027_2,\n ExcludeRunningScriptsFromSave: defaultSettings.ExcludeRunningScriptsFromSave,\n IsSidebarOpened: defaultSettings.IsSidebarOpened,\n\n MonacoTheme: \"monokai\",\n MonacoInsertSpaces: false,\n MonacoFontSize: 20,\n MonacoVim: false,\n MonacoWordWrap: \"off\",\n\n theme: { ...defaultTheme },\n styles: { ...defaultStyles },\n overview: defaultSettings.overview,\n EditorTheme: { ...defaultMonacoTheme },\n init() {\n Object.assign(Settings, defaultSettings);\n },\n load(saveString: string) {\n const save = JSON.parse(saveString);\n Object.assign(Settings.theme, save.theme);\n delete save.theme;\n Object.assign(Settings.styles, save.styles);\n delete save.styles;\n Object.assign(Settings.overview, save.overview);\n delete save.overview;\n Object.assign(Settings.EditorTheme, save.EditorTheme);\n delete save.EditorTheme;\n Object.assign(Settings, save);\n },\n};\n","import numeral from \"numeral\";\nimport \"numeral/locales/bg\";\nimport \"numeral/locales/cs\";\nimport \"numeral/locales/da-dk\";\nimport \"numeral/locales/de\";\nimport \"numeral/locales/en-au\";\nimport \"numeral/locales/en-gb\";\nimport \"numeral/locales/es\";\nimport \"numeral/locales/fr\";\nimport \"numeral/locales/hu\";\nimport \"numeral/locales/it\";\nimport \"numeral/locales/lv\";\nimport \"numeral/locales/no\";\nimport \"numeral/locales/pl\";\nimport \"numeral/locales/ru\";\n\nimport { Settings } from \"../Settings/Settings\";\n\nconst extraFormats = [1e15, 1e18, 1e21, 1e24, 1e27, 1e30];\nconst extraNotations = [\"q\", \"Q\", \"s\", \"S\", \"o\", \"n\"];\nconst gigaMultiplier = { standard: 1e9, iec60027_2: 2 ** 30 };\n\nclass NumeralFormatter {\n // Default Locale\n defaultLocale = \"en\";\n\n constructor() {\n this.defaultLocale = \"en\";\n }\n\n updateLocale(l: string): boolean {\n if (numeral.locale(l) == null) {\n console.warn(`Invalid locale for numeral: ${l}`);\n\n numeral.locale(this.defaultLocale);\n return false;\n }\n return true;\n }\n\n format(n: number, format: string): string {\n // numeraljs doesnt properly format numbers that are too big or too small\n if (Math.abs(n) < 1e-6) {\n n = 0;\n }\n const answer = numeral(n).format(format);\n if (answer === \"NaN\") {\n return `${n}`;\n }\n return answer;\n }\n\n formatBigNumber(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n // TODO: leverage numeral.js to do it. This function also implies you can\n // use this format in some text field but you can't. ( \"1t\" will parse but\n // \"1s\" will not)\n formatReallyBigNumber(n: number, decimalPlaces = 3): string {\n const nAbs = Math.abs(n);\n if (n === Infinity) return \"∞\";\n for (let i = 0; i < extraFormats.length; i++) {\n if (extraFormats[i] < nAbs && nAbs <= extraFormats[i] * 1000) {\n return this.format(n / extraFormats[i], \"0.\" + \"0\".repeat(decimalPlaces)) + extraNotations[i];\n }\n }\n if (nAbs < 1000) {\n return this.format(n, \"0.\" + \"0\".repeat(decimalPlaces));\n }\n const str = this.format(n, \"0.\" + \"0\".repeat(decimalPlaces) + \"a\");\n if (str === \"NaNt\") return this.format(n, \"0.\" + \" \".repeat(decimalPlaces) + \"e+0\");\n return str;\n }\n\n formatHp(n: number): string {\n if (n < 1e6) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatMoney(n: number): string {\n return \"$\" + this.formatReallyBigNumber(n);\n }\n\n formatSkill(n: number): string {\n if (n < 1e15) {\n return this.format(n, \"0,0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatExp(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatHashes(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatReputation(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatFavor(n: number): string {\n return this.format(n, \"0,0\");\n }\n\n formatSecurity(n: number): string {\n return n.toFixed(3);\n }\n\n formatRAM(n: number): string {\n if (Settings.UseIEC60027_2) {\n return this.format(n * gigaMultiplier.iec60027_2, \"0.00ib\");\n }\n return this.format(n * gigaMultiplier.standard, \"0.00b\");\n }\n\n formatPercentage(n: number, decimalPlaces = 2): string {\n const formatter: string = \"0.\" + \"0\".repeat(decimalPlaces) + \"%\";\n return this.format(n, formatter);\n }\n\n formatServerSecurity(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatRespect(n: number): string {\n return this.formatReallyBigNumber(n, 5);\n }\n\n formatWanted(n: number): string {\n return this.formatReallyBigNumber(n, 5);\n }\n\n formatMultiplier(n: number): string {\n return this.format(n, \"0,0.00\");\n }\n\n formatSleeveShock(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatSleeveSynchro(n: number): string {\n return this.format(n, \"0,0.000\");\n }\n\n formatSleeveMemory(n: number): string {\n return this.format(n, \"0\");\n }\n\n formatPopulation(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStamina(n: number): string {\n return this.format(n, \"0.0\");\n }\n\n formatShares(n: number): string {\n if (n < 1000) {\n return this.format(n, \"0\");\n }\n return this.formatReallyBigNumber(n);\n }\n\n formatInfiltrationSecurity(n: number): string {\n return this.formatReallyBigNumber(n);\n }\n\n formatThreads(n: number): string {\n return this.format(n, \"0,0\");\n }\n\n formatStaneksGiftHeat(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStaneksGiftCharge(n: number): string {\n return this.format(n, \"0.000a\");\n }\n\n formatStaneksGiftPower(n: number): string {\n return this.format(n, \"0.00\");\n }\n\n parseCustomLargeNumber(str: string): number {\n const numericRegExp = new RegExp(\"^(-?\\\\d+\\\\.?\\\\d*)([\" + extraNotations.join(\"\") + \"]?)$\");\n const match = str.match(numericRegExp);\n if (match == null) {\n return NaN;\n }\n const [, number, notation] = match;\n const notationIndex = extraNotations.indexOf(notation);\n if (notationIndex === -1) {\n return NaN;\n }\n return parseFloat(number) * extraFormats[notationIndex];\n }\n\n largestAbsoluteNumber(n1: number, n2 = 0, n3 = 0): number {\n if (isNaN(n1)) n1 = 0;\n if (isNaN(n2)) n2 = 0;\n if (isNaN(n3)) n3 = 0;\n const largestAbsolute = Math.max(Math.abs(n1), Math.abs(n2), Math.abs(n3));\n switch (largestAbsolute) {\n case Math.abs(n1):\n return n1;\n case Math.abs(n2):\n return n2;\n case Math.abs(n3):\n return n3;\n }\n return 0;\n }\n\n parseMoney(s: string): number {\n // numeral library does not handle formats like 1s (returns 1) and 1e10 (returns 110) well,\n // so if more then 1 return a valid number, return the one farthest from 0\n const numeralValue = numeral(s).value();\n const parsed = parseFloat(s);\n const selfParsed = this.parseCustomLargeNumber(s);\n // Check for one or more NaN values\n if (isNaN(parsed) && isNaN(selfParsed)) {\n if (numeralValue === null) {\n // 3x NaN\n return NaN;\n }\n // 2x NaN\n return numeralValue;\n } else if (numeralValue === null && isNaN(selfParsed)) {\n // 2x NaN\n return parsed;\n } else if (isNaN(parsed)) {\n if (numeralValue === null) {\n // 2x NaN\n return selfParsed;\n }\n // 1x NaN\n return this.largestAbsoluteNumber(numeralValue, selfParsed);\n } else if (numeralValue === null) {\n // 1x NaN\n return this.largestAbsoluteNumber(parsed, selfParsed);\n } else if (isNaN(selfParsed)) {\n // 1x NaN\n return this.largestAbsoluteNumber(numeralValue, parsed);\n } else {\n // no NaN\n return this.largestAbsoluteNumber(numeralValue, parsed, selfParsed);\n }\n }\n}\n\nexport const numeralWrapper = new NumeralFormatter();\n","/**\n * Names of all locations\n */\nexport enum LocationName {\n // Aevum Locations\n AevumAeroCorp = \"AeroCorp\",\n AevumBachmanAndAssociates = \"Bachman & Associates\",\n AevumClarkeIncorporated = \"Clarke Incorporated\",\n AevumCrushFitnessGym = \"Crush Fitness Gym\",\n AevumECorp = \"ECorp\",\n AevumFulcrumTechnologies = \"Fulcrum Technologies\",\n AevumGalacticCybersystems = \"Galactic Cybersystems\",\n AevumNetLinkTechnologies = \"NetLink Technologies\",\n AevumPolice = \"Aevum Police Headquarters\",\n AevumRhoConstruction = \"Rho Construction\",\n AevumSnapFitnessGym = \"Snap Fitness Gym\",\n AevumSummitUniversity = \"Summit University\",\n AevumWatchdogSecurity = \"Watchdog Security\",\n AevumCasino = \"Iker Molina Casino\",\n\n // Chongqing locations\n ChongqingKuaiGongInternational = \"KuaiGong International\",\n ChongqingSolarisSpaceSystems = \"Solaris Space Systems\",\n ChongqingChurchOfTheMachineGod = \"Church of the Machine God\",\n\n // Sector 12\n Sector12AlphaEnterprises = \"Alpha Enterprises\",\n Sector12BladeIndustries = \"Blade Industries\",\n Sector12CIA = \"Central Intelligence Agency\",\n Sector12CarmichaelSecurity = \"Carmichael Security\",\n Sector12CityHall = \"Sector-12 City Hall\",\n Sector12DeltaOne = \"DeltaOne\",\n Sector12FoodNStuff = \"FoodNStuff\",\n Sector12FourSigma = \"Four Sigma\",\n Sector12IcarusMicrosystems = \"Icarus Microsystems\",\n Sector12IronGym = \"Iron Gym\",\n Sector12JoesGuns = \"Joe's Guns\",\n Sector12MegaCorp = \"MegaCorp\",\n Sector12NSA = \"National Security Agency\",\n Sector12PowerhouseGym = \"Powerhouse Gym\",\n Sector12RothmanUniversity = \"Rothman University\",\n Sector12UniversalEnergy = \"Universal Energy\",\n\n // New Tokyo\n NewTokyoDefComm = \"DefComm\",\n NewTokyoGlobalPharmaceuticals = \"Global Pharmaceuticals\",\n NewTokyoNoodleBar = \"Noodle Bar\",\n NewTokyoVitaLife = \"VitaLife\",\n NewTokyoArcade = \"Arcade\",\n\n // Ishima\n IshimaNovaMedical = \"Nova Medical\",\n IshimaOmegaSoftware = \"Omega Software\",\n IshimaStormTechnologies = \"Storm Technologies\",\n IshimaGlitch = \"0x6C1\",\n\n // Volhaven\n VolhavenCompuTek = \"CompuTek\",\n VolhavenHeliosLabs = \"Helios Labs\",\n VolhavenLexoCorp = \"LexoCorp\",\n VolhavenMilleniumFitnessGym = \"Millenium Fitness Gym\",\n VolhavenNWO = \"NWO\",\n VolhavenOmniTekIncorporated = \"OmniTek Incorporated\",\n VolhavenOmniaCybersystems = \"Omnia Cybersystems\",\n VolhavenSysCoreSecurities = \"SysCore Securities\",\n VolhavenZBInstituteOfTechnology = \"ZB Institute of Technology\",\n\n // Generic locations\n Hospital = \"Hospital\",\n Slums = \"The Slums\",\n TravelAgency = \"Travel Agency\",\n WorldStockExchange = \"World Stock Exchange\",\n\n // Default name for Location objects\n Void = \"The Void\",\n}\n","export enum AugmentationNames {\n Targeting1 = \"Augmented Targeting I\",\n Targeting2 = \"Augmented Targeting II\",\n Targeting3 = \"Augmented Targeting III\",\n SyntheticHeart = \"Synthetic Heart\",\n SynfibrilMuscle = \"Synfibril Muscle\",\n CombatRib1 = \"Combat Rib I\",\n CombatRib2 = \"Combat Rib II\",\n CombatRib3 = \"Combat Rib III\",\n NanofiberWeave = \"Nanofiber Weave\",\n SubdermalArmor = \"NEMEAN Subdermal Weave\",\n WiredReflexes = \"Wired Reflexes\",\n GrapheneBoneLacings = \"Graphene Bone Lacings\",\n BionicSpine = \"Bionic Spine\",\n GrapheneBionicSpine = \"Graphene Bionic Spine Upgrade\",\n BionicLegs = \"Bionic Legs\",\n GrapheneBionicLegs = \"Graphene Bionic Legs Upgrade\",\n SpeechProcessor = \"Speech Processor Implant\",\n TITN41Injection = \"TITN-41 Gene-Modification Injection\",\n EnhancedSocialInteractionImplant = \"Enhanced Social Interaction Implant\",\n BitWire = \"BitWire\",\n ArtificialBioNeuralNetwork = \"Artificial Bio-neural Network Implant\",\n ArtificialSynapticPotentiation = \"Artificial Synaptic Potentiation\",\n EnhancedMyelinSheathing = \"Enhanced Myelin Sheathing\",\n SynapticEnhancement = \"Synaptic Enhancement Implant\",\n NeuralRetentionEnhancement = \"Neural-Retention Enhancement\",\n DataJack = \"DataJack\",\n ENM = \"Embedded Netburner Module\",\n ENMCore = \"Embedded Netburner Module Core Implant\",\n ENMCoreV2 = \"Embedded Netburner Module Core V2 Upgrade\",\n ENMCoreV3 = \"Embedded Netburner Module Core V3 Upgrade\",\n ENMAnalyzeEngine = \"Embedded Netburner Module Analyze Engine\",\n ENMDMA = \"Embedded Netburner Module Direct Memory Access Upgrade\",\n Neuralstimulator = \"Neuralstimulator\",\n NeuralAccelerator = \"Neural Accelerator\",\n CranialSignalProcessorsG1 = \"Cranial Signal Processors - Gen I\",\n CranialSignalProcessorsG2 = \"Cranial Signal Processors - Gen II\",\n CranialSignalProcessorsG3 = \"Cranial Signal Processors - Gen III\",\n CranialSignalProcessorsG4 = \"Cranial Signal Processors - Gen IV\",\n CranialSignalProcessorsG5 = \"Cranial Signal Processors - Gen V\",\n NeuronalDensification = \"Neuronal Densification\",\n NeuroreceptorManager = \"Neuroreceptor Management Implant\",\n NuoptimalInjectorImplant = \"Nuoptimal Nootropic Injector Implant\",\n SpeechEnhancement = \"Speech Enhancement\",\n FocusWire = \"FocusWire\",\n PCDNI = \"PC Direct-Neural Interface\",\n PCDNIOptimizer = \"PC Direct-Neural Interface Optimization Submodule\",\n PCDNINeuralNetwork = \"PC Direct-Neural Interface NeuroNet Injector\",\n PCMatrix = \"PCMatrix\",\n ADRPheromone1 = \"ADR-V1 Pheromone Gene\",\n ADRPheromone2 = \"ADR-V2 Pheromone Gene\",\n ShadowsSimulacrum = \"The Shadow's Simulacrum\",\n HacknetNodeCPUUpload = \"Hacknet Node CPU Architecture Neural-Upload\",\n HacknetNodeCacheUpload = \"Hacknet Node Cache Architecture Neural-Upload\",\n HacknetNodeNICUpload = \"Hacknet Node NIC Architecture Neural-Upload\",\n HacknetNodeKernelDNI = \"Hacknet Node Kernel Direct-Neural Interface\",\n HacknetNodeCoreDNI = \"Hacknet Node Core Direct-Neural Interface\",\n NeuroFluxGovernor = \"NeuroFlux Governor\",\n Neurotrainer1 = \"Neurotrainer I\",\n Neurotrainer2 = \"Neurotrainer II\",\n Neurotrainer3 = \"Neurotrainer III\",\n Hypersight = \"HyperSight Corneal Implant\",\n LuminCloaking1 = \"LuminCloaking-V1 Skin Implant\",\n LuminCloaking2 = \"LuminCloaking-V2 Skin Implant\",\n HemoRecirculator = \"HemoRecirculator\",\n SmartSonar = \"SmartSonar Implant\",\n PowerRecirculator = \"Power Recirculation Core\",\n QLink = \"QLink\",\n TheRedPill = \"The Red Pill\",\n SPTN97 = \"SPTN-97 Gene Modification\",\n HiveMind = \"ECorp HVMind Implant\",\n CordiARCReactor = \"CordiARC Fusion Reactor\",\n SmartJaw = \"SmartJaw\",\n Neotra = \"Neotra\",\n Xanipher = \"Xanipher\",\n nextSENS = \"nextSENS Gene Modification\",\n OmniTekInfoLoad = \"OmniTek InfoLoad\",\n PhotosyntheticCells = \"Photosynthetic Cells\",\n Neurolink = \"BitRunners Neurolink\",\n TheBlackHand = \"The Black Hand\",\n UnstableCircadianModulator = \"Unstable Circadian Modulator\",\n CRTX42AA = \"CRTX42-AA Gene Modification\",\n Neuregen = \"Neuregen Gene Modification\",\n CashRoot = \"CashRoot Starter Kit\",\n NutriGen = \"NutriGen Implant\",\n INFRARet = \"INFRARET Enhancement\",\n DermaForce = \"DermaForce Particle Barrier\",\n GrapheneBrachiBlades = \"Graphene BrachiBlades Upgrade\",\n GrapheneBionicArms = \"Graphene Bionic Arms Upgrade\",\n BrachiBlades = \"BrachiBlades\",\n BionicArms = \"Bionic Arms\",\n SNA = \"Social Negotiation Assistant (S.N.A)\",\n HydroflameLeftArm = \"Hydroflame Left Arm\",\n CongruityImplant = \"nickofolas Congruity Implant\",\n EsperEyewear = \"EsperTech Bladeburner Eyewear\",\n EMS4Recombination = \"EMS-4 Recombination\",\n OrionShoulder = \"ORION-MKIV Shoulder\",\n HyperionV1 = \"Hyperion Plasma Cannon V1\",\n HyperionV2 = \"Hyperion Plasma Cannon V2\",\n GolemSerum = \"GOLEM Serum\",\n VangelisVirus = \"Vangelis Virus\",\n VangelisVirus3 = \"Vangelis Virus 3.0\",\n INTERLINKED = \"I.N.T.E.R.L.I.N.K.E.D\",\n BladeRunner = \"Blade's Runners\",\n BladeArmor = \"BLADE-51b Tesla Armor\",\n BladeArmorPowerCells = \"BLADE-51b Tesla Armor: Power Cells Upgrade\",\n BladeArmorEnergyShielding = \"BLADE-51b Tesla Armor: Energy Shielding Upgrade\",\n BladeArmorUnibeam = \"BLADE-51b Tesla Armor: Unibeam Upgrade\",\n BladeArmorOmnibeam = \"BLADE-51b Tesla Armor: Omnibeam Upgrade\",\n BladeArmorIPU = \"BLADE-51b Tesla Armor: IPU Upgrade\",\n BladesSimulacrum = \"The Blade's Simulacrum\",\n\n StaneksGift1 = \"Stanek's Gift - Genesis\",\n StaneksGift2 = \"Stanek's Gift - Awakening\",\n StaneksGift3 = \"Stanek's Gift - Serenity\",\n\n // Infiltrators MiniGames\n MightOfAres = \"SoA - Might of Ares\", // slash\n WisdomOfAthena = \"SoA - Wisdom of Athena\", // bracket\n TrickeryOfHermes = \"SoA - Trickery of Hermes\", // cheatcode\n BeautyOfAphrodite = \"SoA - Beauty of Aphrodite\", // bribe\n ChaosOfDionysus = \"SoA - Chaos of Dionysus\", // reverse\n FloodOfPoseidon = \"SoA - Flood of Poseidon\", // hex\n HuntOfArtemis = \"SoA - Hunt of Artemis\", // mine\n KnowledgeOfApollo = \"SoA - Knowledge of Apollo\", // wire\n WKSharmonizer = \"SoA - phyzical WKS harmonizer\",\n}\n","/**\n * Generic Game Constants\n *\n * Constants for specific mechanics or features will NOT be here.\n */\nexport const CONSTANTS: {\n VersionString: string;\n VersionNumber: number;\n _idleSpeed: number;\n MaxSkillLevel: number;\n MilliPerCycle: number;\n CorpFactionRepRequirement: number;\n BaseFocusBonus: number;\n BaseCostFor1GBOfRamHome: number;\n BaseCostFor1GBOfRamServer: number;\n TravelCost: number;\n BaseFavorToDonate: number;\n DonateMoneyToRepDivisor: number;\n FactionReputationToFavorBase: number;\n FactionReputationToFavorMult: number;\n CompanyReputationToFavorBase: number;\n CompanyReputationToFavorMult: number;\n NeuroFluxGovernorLevelMult: number;\n NumNetscriptPorts: number;\n HomeComputerMaxRam: number;\n ServerBaseGrowthRate: number;\n ServerMaxGrowthRate: number;\n ServerFortifyAmount: number;\n ServerWeakenAmount: number;\n PurchasedServerLimit: number;\n PurchasedServerMaxRam: number;\n MultipleAugMultiplier: number;\n TorRouterCost: number;\n WSEAccountCost: number;\n TIXAPICost: number;\n MarketData4SCost: number;\n MarketDataTixApi4SCost: number;\n StockMarketCommission: number;\n HospitalCostPerHp: number;\n IntelligenceCrimeWeight: number;\n IntelligenceInfiltrationWeight: number;\n IntelligenceCrimeBaseExpGain: number;\n IntelligenceProgramBaseExpGain: number;\n IntelligenceGraftBaseExpGain: number;\n IntelligenceTerminalHackBaseExpGain: number;\n IntelligenceSingFnBaseExpGain: number;\n IntelligenceClassBaseExpGain: number;\n MillisecondsPer20Hours: number;\n GameCyclesPer20Hours: number;\n MillisecondsPer10Hours: number;\n GameCyclesPer10Hours: number;\n MillisecondsPer8Hours: number;\n GameCyclesPer8Hours: number;\n MillisecondsPer4Hours: number;\n GameCyclesPer4Hours: number;\n MillisecondsPer2Hours: number;\n GameCyclesPer2Hours: number;\n MillisecondsPerHour: number;\n GameCyclesPerHour: number;\n MillisecondsPerHalfHour: number;\n GameCyclesPerHalfHour: number;\n MillisecondsPerQuarterHour: number;\n GameCyclesPerQuarterHour: number;\n MillisecondsPerFiveMinutes: number;\n GameCyclesPerFiveMinutes: number;\n ClassDataStructuresBaseCost: number;\n ClassNetworksBaseCost: number;\n ClassAlgorithmsBaseCost: number;\n ClassManagementBaseCost: number;\n ClassLeadershipBaseCost: number;\n ClassGymBaseCost: number;\n ClassStudyComputerScienceBaseExp: number;\n ClassDataStructuresBaseExp: number;\n ClassNetworksBaseExp: number;\n ClassAlgorithmsBaseExp: number;\n ClassManagementBaseExp: number;\n ClassLeadershipBaseExp: number;\n CodingContractBaseFactionRepGain: number;\n CodingContractBaseCompanyRepGain: number;\n CodingContractBaseMoneyGain: number;\n AugmentationGraftingCostMult: number;\n AugmentationGraftingTimeBase: number;\n SoACostMult: number;\n SoARepMult: number;\n EntropyEffect: number;\n TotalNumBitNodes: number;\n InfiniteLoopLimit: number;\n Donations: number; // number of blood/plasma/palette donation the dev have verified., boosts NFG\n LatestUpdate: string;\n} = {\n VersionString: \"2.1.0\",\n VersionNumber: 25,\n\n // Speed (in ms) at which the main loop is updated\n _idleSpeed: 200,\n\n /** Max level for any skill, assuming no multipliers. Determined by max numerical value in javascript for experience\n * and the skill level formula in Player.js. Note that all this means it that when experience hits MAX_INT, then\n * the player will have this level assuming no multipliers. Multipliers can cause skills to go above this.\n */\n MaxSkillLevel: 975,\n\n // Milliseconds per game cycle\n MilliPerCycle: 200,\n\n // How much reputation is needed to join a megacorporation's faction\n CorpFactionRepRequirement: 400e3,\n\n // Base RAM costs\n BaseCostFor1GBOfRamHome: 32000,\n BaseCostFor1GBOfRamServer: 55000, //1 GB of RAM\n\n // Cost to travel to another city\n TravelCost: 200e3,\n\n // Faction and Company favor-related things\n BaseFavorToDonate: 150,\n DonateMoneyToRepDivisor: 1e6,\n FactionReputationToFavorBase: 500,\n FactionReputationToFavorMult: 1.02,\n CompanyReputationToFavorBase: 500,\n CompanyReputationToFavorMult: 1.02,\n\n // NeuroFlux Governor Augmentation cost multiplier\n NeuroFluxGovernorLevelMult: 1.14,\n\n NumNetscriptPorts: 20,\n\n // Server-related constants\n HomeComputerMaxRam: 1073741824, // 2 ^ 30\n ServerBaseGrowthRate: 1.03, // Unadjusted Growth rate\n ServerMaxGrowthRate: 1.0035, // Maximum possible growth rate (max rate accounting for server security)\n ServerFortifyAmount: 0.002, // Amount by which server's security increases when its hacked/grown\n ServerWeakenAmount: 0.05, // Amount by which server's security decreases when weakened\n\n PurchasedServerLimit: 25,\n PurchasedServerMaxRam: 1048576, // 2^20\n\n // Augmentation Constants\n MultipleAugMultiplier: 1.9,\n\n // TOR Router\n TorRouterCost: 200e3,\n\n // Stock market\n WSEAccountCost: 200e6,\n TIXAPICost: 5e9,\n MarketData4SCost: 1e9,\n MarketDataTixApi4SCost: 25e9,\n StockMarketCommission: 100e3,\n\n // Hospital/Health\n HospitalCostPerHp: 100e3,\n\n // Intelligence-related constants\n IntelligenceCrimeWeight: 0.025, // Weight for how much int affects crime success rates\n IntelligenceInfiltrationWeight: 0.1, // Weight for how much int affects infiltration success rates\n IntelligenceCrimeBaseExpGain: 0.05,\n IntelligenceProgramBaseExpGain: 0.1, // Program required hack level divided by this to determine int exp gain\n IntelligenceGraftBaseExpGain: 0.05,\n IntelligenceTerminalHackBaseExpGain: 200, // Hacking exp divided by this to determine int exp gain\n IntelligenceSingFnBaseExpGain: 1.5,\n IntelligenceClassBaseExpGain: 0.01,\n\n // Time-related constants\n MillisecondsPer20Hours: 72000000,\n GameCyclesPer20Hours: 72000000 / 200,\n\n MillisecondsPer10Hours: 36000000,\n GameCyclesPer10Hours: 36000000 / 200,\n\n MillisecondsPer8Hours: 28800000,\n GameCyclesPer8Hours: 28800000 / 200,\n\n MillisecondsPer4Hours: 14400000,\n GameCyclesPer4Hours: 14400000 / 200,\n\n MillisecondsPer2Hours: 7200000,\n GameCyclesPer2Hours: 7200000 / 200,\n\n MillisecondsPerHour: 3600000,\n GameCyclesPerHour: 3600000 / 200,\n\n MillisecondsPerHalfHour: 1800000,\n GameCyclesPerHalfHour: 1800000 / 200,\n\n MillisecondsPerQuarterHour: 900000,\n GameCyclesPerQuarterHour: 900000 / 200,\n\n MillisecondsPerFiveMinutes: 300000,\n GameCyclesPerFiveMinutes: 300000 / 200,\n\n // Player Work & Action\n BaseFocusBonus: 0.8,\n\n ClassDataStructuresBaseCost: 40,\n ClassNetworksBaseCost: 80,\n ClassAlgorithmsBaseCost: 320,\n ClassManagementBaseCost: 160,\n ClassLeadershipBaseCost: 320,\n ClassGymBaseCost: 120,\n\n ClassStudyComputerScienceBaseExp: 0.5,\n ClassDataStructuresBaseExp: 1,\n ClassNetworksBaseExp: 2,\n ClassAlgorithmsBaseExp: 4,\n ClassManagementBaseExp: 2,\n ClassLeadershipBaseExp: 4,\n\n // Coding Contract\n // TODO: Move this into Coding contract implementation?\n CodingContractBaseFactionRepGain: 2500,\n CodingContractBaseCompanyRepGain: 4000,\n CodingContractBaseMoneyGain: 75e6,\n\n // Augmentation grafting multipliers\n AugmentationGraftingCostMult: 3,\n AugmentationGraftingTimeBase: 3600000,\n\n // SoA mults\n SoACostMult: 7,\n SoARepMult: 1.3,\n\n // Value raised to the number of entropy stacks, then multiplied to player multipliers\n EntropyEffect: 0.98,\n\n // BitNode/Source-File related stuff\n TotalNumBitNodes: 24,\n\n InfiniteLoopLimit: 2000,\n\n Donations: 25,\n\n LatestUpdate: `\nv2.1.0 - 2022-08-23\n-------------------\n\n * pending\n * nerf noodle bar\n\n`,\n};\n","/* Generic Reviver, toJSON, and fromJSON functions used for saving and loading objects */\n\nimport { validateObject } from \"./Validator\";\n\nexport interface IReviverValue {\n ctor: string;\n data: any;\n}\n\n// A generic \"smart reviver\" function.\n// Looks for object values with a `ctor` property and\n// a `data` property. If it finds them, and finds a matching\n// constructor that has a `fromJSON` property on it, it hands\n// off to that `fromJSON` fuunction, passing in the value.\nexport function Reviver(key: string, value: IReviverValue | null): any {\n if (value == null) {\n return null;\n }\n\n if (typeof value === \"object\" && typeof value.ctor === \"string\" && typeof value.data !== \"undefined\") {\n // Compatibility for version v0.43.1\n // TODO Remove this eventually\n if (value.ctor === \"AllServersMap\") {\n console.warn(\"Converting AllServersMap for v0.43.1\");\n return value.data;\n }\n\n const ctor = Reviver.constructors[value.ctor];\n\n if (typeof ctor === \"function\" && typeof ctor.fromJSON === \"function\") {\n const obj = ctor.fromJSON(value);\n if (ctor.validationData !== undefined) {\n validateObject(obj, ctor.validationData);\n }\n return obj;\n }\n }\n return value;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\nexport namespace Reviver {\n export const constructors: { [key: string]: any } = {};\n}\n\n// A generic \"toJSON\" function that creates the data expected\n// by Reviver.\n// `ctorName` The name of the constructor to use to revive it\n// `obj` The object being serialized\n// `keys` (Optional) Array of the properties to serialize,\n// if not given then all of the objects \"own\" properties\n// that don't have function values will be serialized.\n// (Note: If you list a property in `keys`, it will be serialized\n// regardless of whether it's an \"own\" property.)\n// Returns: The structure (which will then be turned into a string\n// as part of the JSON.stringify algorithm)\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function Generic_toJSON(ctorName: string, obj: Record, keys?: string[]): IReviverValue {\n if (!keys) {\n keys = Object.keys(obj); // Only \"own\" properties are included\n }\n\n const data: Record = {};\n for (let index = 0; index < keys.length; ++index) {\n const key = keys[index];\n data[key] = obj[key];\n }\n return { ctor: ctorName, data: data };\n}\n\n// A generic \"fromJSON\" function for use with Reviver: Just calls the\n// constructor function with no arguments, then applies all of the\n// key/value pairs from the raw data to the instance. Only useful for\n// constructors that can be reasonably called without arguments!\n// `ctor` The constructor to call\n// `data` The data to apply\n// Returns: The object\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport function Generic_fromJSON(ctor: new () => T, data: any): T {\n const obj: any = new ctor();\n for (const name in data) {\n obj[name] = data[name];\n }\n return obj;\n}\n","import { AlertEvents } from \"./AlertManager\";\n\nimport React from \"react\";\nimport { SxProps } from \"@mui/system\";\nimport { Typography } from \"@mui/material\";\n\nexport function dialogBoxCreate(txt: string | JSX.Element, styles?: SxProps): void {\n if (typeof txt !== \"string\") {\n AlertEvents.emit(txt);\n } else {\n AlertEvents.emit();\n }\n}\n","/**\n * All possible Cities in the game. Names only, not actual \"City\" object\n * Implemented as an enum for typing purposes\n */\nexport enum CityName {\n Aevum = \"Aevum\",\n Chongqing = \"Chongqing\",\n Ishima = \"Ishima\",\n NewTokyo = \"New Tokyo\",\n Sector12 = \"Sector-12\",\n Volhaven = \"Volhaven\",\n}\n","import { defaultMultipliers } from \"./BitNode\";\n\n/**\n * Bitnode multipliers influence the difficulty of different aspects of the game.\n * Each Bitnode has a different theme/strategy to achieving the end goal, so these multipliers will can help drive the\n * player toward the intended strategy. Unless they really want to play the long, slow game of waiting...\n */\nexport interface IBitNodeMultipliers {\n /**\n * Influences how quickly the player's agility level (not exp) scales\n */\n AgilityLevelMultiplier: number;\n\n /**\n * Influences the base cost to purchase an augmentation.\n */\n AugmentationMoneyCost: number;\n\n /**\n * Influences the base rep the player must have with a faction to purchase an augmentation.\n */\n AugmentationRepCost: number;\n\n /**\n * Influences how quickly the player can gain rank within Bladeburner.\n */\n BladeburnerRank: number;\n\n /**\n * Influences the cost of skill levels from Bladeburner.\n */\n BladeburnerSkillCost: number;\n\n /**\n * Influences how quickly the player's charisma level (not exp) scales\n */\n CharismaLevelMultiplier: number;\n\n /**\n * Influences the experience gained for each ability when a player completes a class.\n */\n ClassGymExpGain: number;\n\n /**\n * Influences the amount of money gained from completing Coding Contracts\n **/\n CodingContractMoney: number;\n\n /**\n * Influences the experience gained for each ability when the player completes working their job.\n */\n CompanyWorkExpGain: number;\n\n /**\n * Influences how much money the player earns when completing working their job.\n */\n CompanyWorkMoney: number;\n\n /**\n * Influences the valuation of corporations created by the player.\n */\n CorporationValuation: number;\n\n /**\n * Influences the base experience gained for each ability when the player commits a crime.\n */\n CrimeExpGain: number;\n\n /**\n * Influences the base money gained when the player commits a crime.\n */\n CrimeMoney: number;\n\n /**\n * Influences how many Augmentations you need in order to get invited to the Daedalus faction\n */\n DaedalusAugsRequirement: number;\n\n /**\n * Influences how quickly the player's defense level (not exp) scales\n */\n DefenseLevelMultiplier: number;\n\n /**\n * Influences how quickly the player's dexterity level (not exp) scales\n */\n DexterityLevelMultiplier: number;\n\n /**\n * Influences how much rep the player gains in each faction simply by being a member.\n */\n FactionPassiveRepGain: number;\n\n /**\n * Influences the experience gained for each ability when the player completes work for a Faction.\n */\n FactionWorkExpGain: number;\n\n /**\n * Influences how much rep the player gains when performing work for a faction.\n */\n FactionWorkRepGain: number;\n\n /**\n * Influences how much it costs to unlock the stock market's 4S Market Data API\n */\n FourSigmaMarketDataApiCost: number;\n\n /**\n * Influences how much it costs to unlock the stock market's 4S Market Data (NOT API)\n */\n FourSigmaMarketDataCost: number;\n\n /**\n * Reduces gangs earning.\n */\n GangSoftcap: number;\n\n /**\n * Percentage of unique augs that the gang has.\n */\n GangUniqueAugs: number;\n\n /**\n * Influences the experienced gained when hacking a server.\n */\n HackExpGain: number;\n\n /**\n * Influences how quickly the player's hacking level (not experience) scales\n */\n HackingLevelMultiplier: number;\n\n /**\n * Influences how much money is produced by Hacknet Nodes.\n * Influeces the hash rate of Hacknet Servers (unlocked in BitNode-9)\n */\n HacknetNodeMoney: number;\n\n /**\n * Influences how much money it costs to upgrade your home computer's RAM\n */\n HomeComputerRamCost: number;\n\n /**\n * Influences how much money is gained when the player infiltrates a company.\n */\n InfiltrationMoney: number;\n\n /**\n * Influences how much rep the player can gain from factions when selling stolen documents and secrets\n */\n InfiltrationRep: number;\n\n /**\n * Influences how much money can be stolen from a server when the player performs a hack against it through\n * the Terminal.\n */\n ManualHackMoney: number;\n\n /**\n * Influence how much it costs to purchase a server\n */\n PurchasedServerCost: number;\n\n /**\n * Influence how much it costs to purchase a server\n */\n PurchasedServerSoftcap: number;\n\n /**\n * Influences the maximum number of purchased servers you can have\n */\n PurchasedServerLimit: number;\n\n /**\n * Influences the maximum allowed RAM for a purchased server\n */\n PurchasedServerMaxRam: number;\n /**\n * Influences the minimum favor the player must have with a faction before they can donate to gain rep.\n */\n RepToDonateToFaction: number;\n\n /**\n * Influences how much money can be stolen from a server when a script performs a hack against it.\n */\n ScriptHackMoney: number;\n\n /**\n * The amount of money actually gained when script hack a server. This is\n * different than the above because you can reduce the amount of money but\n * not gain that same amount.\n */\n ScriptHackMoneyGain: number;\n\n /**\n * Influences the growth percentage per cycle against a server.\n */\n ServerGrowthRate: number;\n\n /**\n * Influences the maxmimum money that a server can grow to.\n */\n ServerMaxMoney: number;\n\n /**\n * Influences the initial money that a server starts with.\n */\n ServerStartingMoney: number;\n\n /**\n * Influences the initial security level (hackDifficulty) of a server.\n */\n ServerStartingSecurity: number;\n\n /**\n * Influences the weaken amount per invocation against a server.\n */\n ServerWeakenRate: number;\n\n /**\n * Influences how quickly the player's strength level (not exp) scales\n */\n StrengthLevelMultiplier: number;\n\n /**\n * Influences the power of the gift.\n */\n StaneksGiftPowerMultiplier: number;\n\n /**\n * Influences the size of the gift.\n */\n StaneksGiftExtraSize: number;\n\n /**\n * Influences the hacking skill required to backdoor the world daemon.\n */\n WorldDaemonDifficulty: number;\n\n /**\n * Influences corporation dividends.\n */\n CorporationSoftcap: number;\n\n // Index signature\n [key: string]: number;\n}\n\n/**\n * The multipliers that are influenced by current Bitnode progression.\n */\n// tslint:disable-next-line:variable-name\nexport const BitNodeMultipliers = Object.assign({}, defaultMultipliers);\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n unbuyable: {\n color: theme.palette.action.disabled,\n },\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\ninterface IProps {\n money: number | string;\n player?: IPlayer;\n}\nexport function Money(props: IProps): React.ReactElement {\n const classes = useStyles();\n if (props.player !== undefined) {\n if (typeof props.money !== \"number\") throw new Error(\"if player if provided, money should be number, contact dev\");\n if (!props.player.canAfford(props.money))\n return {numeralWrapper.formatMoney(props.money)};\n }\n return (\n \n {typeof props.money === \"number\" ? numeralWrapper.formatMoney(props.money) : props.money}\n \n );\n}\n","import { Server } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { serverMetadata } from \"./data/servers\";\n\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\n\nimport { IMap, IMinMaxRange } from \"../types\";\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Reviver } from \"../utils/JSONReviver\";\nimport { isValidIPAddress } from \"../utils/helpers/isValidIPAddress\";\nimport { SpecialServers } from \"./data/SpecialServers\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\n/**\n * Map of all Servers that exist in the game\n * Key (string) = IP\n * Value = Server object\n */\nlet AllServers: IMap = {};\n\nfunction GetServerByIP(ip: string): BaseServer | undefined {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.ip !== ip) continue;\n return server;\n }\n}\n\n//Returns server object with corresponding hostname\n// Relatively slow, would rather not use this a lot\nfunction GetServerByHostname(hostname: string): BaseServer | null {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.hostname == hostname) {\n return server;\n }\n }\n\n return null;\n}\n\n//Get server by IP or hostname. Returns null if invalid\nexport function GetServer(s: string): BaseServer | null {\n if (AllServers.hasOwnProperty(s)) {\n const server = AllServers[s];\n if (server) return server;\n }\n\n if (!isValidIPAddress(s)) {\n return GetServerByHostname(s);\n }\n\n const ipserver = GetServerByIP(s);\n if (ipserver !== undefined) {\n return ipserver;\n }\n\n return null;\n}\n\nexport function GetAllServers(): BaseServer[] {\n const servers: BaseServer[] = [];\n for (const key of Object.keys(AllServers)) {\n servers.push(AllServers[key]);\n }\n return servers;\n}\n\nexport function DeleteServer(serverkey: string): void {\n for (const key of Object.keys(AllServers)) {\n const server = AllServers[key];\n if (server.ip !== serverkey && server.hostname !== serverkey) continue;\n delete AllServers[key];\n break;\n }\n}\n\nexport function ipExists(ip: string): boolean {\n for (const hostName in AllServers) {\n if (AllServers[hostName].ip === ip) {\n return true;\n }\n }\n return false;\n}\n\nexport function createUniqueRandomIp(): string {\n let ip: string;\n // Repeat generating ip, until unique one is found\n do {\n ip = createRandomIp();\n } while (ipExists(ip));\n\n return ip;\n}\n\n// Saftely add a Server to the AllServers map\nexport function AddToAllServers(server: Server | HacknetServer): void {\n if (GetServer(server.hostname)) {\n console.warn(`Hostname of the server thats being added: ${server.hostname}`);\n console.warn(`The server that already has this IP is: ${AllServers[server.hostname].hostname}`);\n throw new Error(\"Error: Trying to add a server with an existing IP\");\n }\n\n AllServers[server.hostname] = server;\n}\n\ninterface IServerParams {\n hackDifficulty?: number;\n hostname: string;\n ip: string;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired: number;\n organizationName: string;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n}\n\nexport function initForeignServers(homeComputer: Server): void {\n /* Create a randomized network for all the foreign servers */\n //Groupings for creating a randomized network\n const networkLayers: Server[][] = [];\n for (let i = 0; i < 15; i++) {\n networkLayers.push([]);\n }\n\n const toNumber = (value: number | IMinMaxRange): number => {\n if (typeof value === \"number\") return value;\n else return getRandomInt(value.min, value.max);\n };\n\n for (const metadata of serverMetadata) {\n const serverParams: IServerParams = {\n hostname: metadata.hostname,\n ip: createUniqueRandomIp(),\n numOpenPortsRequired: metadata.numOpenPortsRequired,\n organizationName: metadata.organizationName,\n };\n\n if (metadata.maxRamExponent !== undefined) {\n serverParams.maxRam = Math.pow(2, toNumber(metadata.maxRamExponent));\n }\n\n if (metadata.hackDifficulty) serverParams.hackDifficulty = toNumber(metadata.hackDifficulty);\n if (metadata.moneyAvailable) serverParams.moneyAvailable = toNumber(metadata.moneyAvailable);\n if (metadata.requiredHackingSkill) serverParams.requiredHackingSkill = toNumber(metadata.requiredHackingSkill);\n if (metadata.serverGrowth) serverParams.serverGrowth = toNumber(metadata.serverGrowth);\n\n const server = new Server(serverParams);\n for (const filename of metadata.literature || []) {\n server.messages.push(filename);\n }\n\n if (server.hostname === SpecialServers.WorldDaemon) {\n server.requiredHackingSkill *= BitNodeMultipliers.WorldDaemonDifficulty;\n }\n AddToAllServers(server);\n if (metadata.networkLayer !== undefined) {\n networkLayers[toNumber(metadata.networkLayer) - 1].push(server);\n }\n }\n\n /* Create a randomized network for all the foreign servers */\n const linkComputers = (server1: Server, server2: Server): void => {\n server1.serversOnNetwork.push(server2.hostname);\n server2.serversOnNetwork.push(server1.hostname);\n };\n\n const getRandomArrayItem = (arr: T[]): T => arr[Math.floor(Math.random() * arr.length)];\n\n const linkNetworkLayers = (network1: Server[], selectServer: () => Server): void => {\n for (const server of network1) {\n linkComputers(server, selectServer());\n }\n };\n\n // Connect the first tier of servers to the player's home computer\n linkNetworkLayers(networkLayers[0], () => homeComputer);\n for (let i = 1; i < networkLayers.length; i++) {\n linkNetworkLayers(networkLayers[i], () => getRandomArrayItem(networkLayers[i - 1]));\n }\n}\n\nexport function prestigeAllServers(): void {\n for (const member of Object.keys(AllServers)) {\n delete AllServers[member];\n }\n AllServers = {};\n}\n\nexport function loadAllServers(saveString: string): void {\n AllServers = JSON.parse(saveString, Reviver);\n}\n\nexport function saveAllServers(excludeRunningScripts = false): string {\n const TempAllServers = JSON.parse(JSON.stringify(AllServers), Reviver);\n for (const key of Object.keys(TempAllServers)) {\n const server = TempAllServers[key];\n if (excludeRunningScripts) {\n server.runningScripts = [];\n continue;\n }\n for (let i = 0; i < server.runningScripts.length; ++i) {\n const runningScriptObj = server.runningScripts[i];\n runningScriptObj.logs.length = 0;\n runningScriptObj.logs = [];\n }\n }\n\n return JSON.stringify(TempAllServers);\n}\n","import React, { useContext } from \"react\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"./Router\";\n\nexport const Context: {\n Player: React.Context;\n Router: React.Context;\n} = {\n Player: React.createContext({} as IPlayer),\n Router: React.createContext({} as IRouter),\n};\n\nexport const use: {\n Player: () => IPlayer;\n Router: () => IRouter;\n} = {\n Player: () => useContext(Context.Player),\n Router: () => useContext(Context.Router),\n};\n","import { Faction } from \"../Faction/Faction\";\nimport { Location } from \"../Locations/Location\";\n\n/**\n * The full-screen page the player is currently be on.\n * These pages are mutually exclusive.\n */\nexport enum Page {\n ActiveScripts,\n Augmentations,\n BitVerse,\n Bladeburner,\n City,\n Corporation,\n CreateProgram,\n ScriptEditor,\n DevMenu,\n Faction,\n Factions,\n Gang,\n Hacknet,\n Infiltration,\n Job,\n Milestones,\n Options,\n Grafting,\n Sleeves,\n Stats,\n StockMarket,\n Terminal,\n Travel,\n Tutorial,\n Work,\n BladeburnerCinematic,\n Location,\n Loading,\n StaneksGift,\n Recovery,\n Achievements,\n ThemeBrowser,\n ImportSave,\n}\n\nexport interface ScriptEditorRouteOptions {\n vim: boolean;\n}\n\n/**\n * This class keeps track of player navigation/routing within the game.\n */\nexport interface IRouter {\n // toCinematicText(): void;\n // toInfiltration(): void;\n // toMission(): void;\n // toRedPill(): void;\n // toworkInProgress(): void;\n isInitialized: boolean;\n page(): Page;\n allowRouting(value: boolean): void;\n toActiveScripts(): void;\n toAugmentations(): void;\n toBitVerse(flume: boolean, quick: boolean): void;\n toBladeburner(): void;\n toStats(): void;\n toCity(): void; // travel ? city ?\n toCorporation(): void;\n toCreateProgram(): void;\n toDevMenu(): void;\n toFaction(faction: Faction, augPage?: boolean): void; // faction name\n toFactions(): void;\n toGameOptions(): void;\n toGang(): void;\n toHacknetNodes(): void;\n toInfiltration(location: Location): void;\n toJob(location: Location): void;\n toMilestones(): void;\n toGrafting(): void;\n toScriptEditor(files?: Record, options?: ScriptEditorRouteOptions): void;\n toSleeves(): void;\n toStockMarket(): void;\n toTerminal(): void;\n toTravel(): void;\n toTutorial(): void;\n toWork(): void;\n toBladeburnerCinematic(): void;\n toLocation(location: Location): void;\n toStaneksGift(): void;\n toAchievements(): void;\n toThemeBrowser(): void;\n toImportSave(base64Save: string, automatic?: boolean): void;\n}\n","import { EqualityFunc } from \"../types\";\nimport { isString } from \"./helpers/isString\";\n\n/*\nConverts a date representing time in milliseconds to a string with the format H hours M minutes and S seconds\ne.g. 10000 -> \"10 seconds\"\n 120000 -> \"2 minutes and 0 seconds\"\n*/\nfunction convertTimeMsToTimeElapsedString(time: number, showMilli = false): string {\n time = Math.floor(time);\n const millisecondsPerSecond = 1000;\n const secondPerMinute = 60;\n const minutesPerHours = 60;\n const secondPerHours: number = secondPerMinute * minutesPerHours;\n const hoursPerDays = 24;\n const secondPerDay: number = secondPerHours * hoursPerDays;\n\n // Convert ms to seconds, since we only have second-level precision\n const totalSeconds: number = Math.floor(time / millisecondsPerSecond);\n\n const days: number = Math.floor(totalSeconds / secondPerDay);\n const secTruncDays: number = totalSeconds % secondPerDay;\n\n const hours: number = Math.floor(secTruncDays / secondPerHours);\n const secTruncHours: number = secTruncDays % secondPerHours;\n\n const minutes: number = Math.floor(secTruncHours / secondPerMinute);\n const secTruncMinutes: number = secTruncHours % secondPerMinute;\n\n const milliTruncSec: string = (() => {\n let str = `${time % millisecondsPerSecond}`;\n while (str.length < 3) str = \"0\" + str;\n return str;\n })();\n\n const seconds: string = showMilli ? `${secTruncMinutes}.${milliTruncSec}` : `${secTruncMinutes}`;\n\n let res = \"\";\n if (days > 0) {\n res += `${days} days `;\n }\n if (hours > 0) {\n res += `${hours} hours `;\n }\n if (minutes > 0) {\n res += `${minutes} minutes `;\n }\n res += `${seconds} seconds`;\n\n return res;\n}\n\n// Finds the longest common starting substring in a set of strings\nfunction longestCommonStart(strings: string[]): string {\n if (!containsAllStrings(strings)) {\n return \"\";\n }\n if (strings.length === 0) {\n return \"\";\n }\n\n const A: string[] = strings.concat().sort();\n const a1: string = A[0];\n const a2: string = A[A.length - 1];\n const L: number = a1.length;\n let i = 0;\n const areEqualCaseInsensitive: EqualityFunc = (a: string, b: string) => a.toUpperCase() === b.toUpperCase();\n while (i < L && areEqualCaseInsensitive(a1.charAt(i), a2.charAt(i))) {\n i++;\n }\n\n return a1.substring(0, i);\n}\n\n// Returns whether an array contains entirely of string objects\nfunction containsAllStrings(arr: string[]): boolean {\n return arr.every(isString);\n}\n\n// Formats a number with commas and a specific number of decimal digits\nfunction formatNumber(num: number, numFractionDigits = 0): string {\n return num.toLocaleString(undefined, {\n maximumFractionDigits: numFractionDigits,\n minimumFractionDigits: numFractionDigits,\n });\n}\n\n// Generates a random alphanumeric string with N characters\nfunction generateRandomString(n: number): string {\n let str = \"\";\n const chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\n for (let i = 0; i < n; i++) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n\n/**\n * Hashes the input string. This is a fast hash, so NOT good for cryptography.\n * This has been ripped off here: https://stackoverflow.com/a/52171480\n * @param str The string that is to be hashed\n * @param seed A seed to randomize the result\n * @returns An hexadecimal string representation of the hashed input\n */\nfunction cyrb53(str: string, seed = 0): string {\n let h1 = 0xdeadbeef ^ seed;\n let h2 = 0x41c6ce57 ^ seed;\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 = Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^ Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 = Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^ Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n return (4294967296 * (2097151 & h2) + (h1 >>> 0)).toString(16);\n}\n\nfunction capitalizeFirstLetter(s: string): string {\n return s.charAt(0).toUpperCase() + s.slice(1);\n}\n\nfunction capitalizeEachWord(s: string): string {\n return s\n .split(\" \")\n .map((word) => capitalizeFirstLetter(word))\n .join(\" \");\n}\n\nexport {\n convertTimeMsToTimeElapsedString,\n longestCommonStart,\n containsAllStrings,\n formatNumber,\n generateRandomString,\n cyrb53,\n capitalizeFirstLetter,\n capitalizeEachWord,\n};\n","/**\n * Initialization and manipulation of the Factions object, which stores data\n * about all Factions in the game\n */\nimport { Faction } from \"./Faction\";\nimport { FactionInfos } from \"./FactionInfo\";\n\nimport { IMap } from \"../types\";\n\nimport { Reviver } from \"../utils/JSONReviver\";\n\nexport let Factions: IMap = {};\n\nexport function loadFactions(saveString: string): void {\n Factions = JSON.parse(saveString, Reviver);\n // safety check for when we load older save file that don't have newer factions\n for (const faction of Object.keys(Factions)) {\n try {\n Factions[faction].getInfo();\n } catch (err) {\n console.error(\"deleting \" + faction);\n delete Factions[faction];\n }\n }\n}\n\nfunction AddToFactions(faction: Faction): void {\n const name: string = faction.name;\n Factions[name] = faction;\n}\n\nexport function factionExists(name: string): boolean {\n return Factions.hasOwnProperty(name);\n}\n\nexport function initFactions(): void {\n for (const name of Object.keys(FactionInfos)) {\n resetFaction(new Faction(name));\n }\n}\n\n//Resets a faction during (re-)initialization. Saves the favor in the new\n//Faction object and deletes the old Faction Object from \"Factions\". Then\n//reinserts the new Faction object\nfunction resetFaction(newFactionObject: Faction): void {\n if (!(newFactionObject instanceof Faction)) {\n throw new Error(\"Invalid argument 'newFactionObject' passed into resetFaction()\");\n }\n const factionName: string = newFactionObject.name;\n if (factionExists(factionName)) {\n newFactionObject.favor = Factions[factionName].favor;\n delete Factions[factionName];\n }\n AddToFactions(newFactionObject);\n}\n","/**\n * Keyboard key codes as returned by event.key\n */\nexport enum KEY {\n //SHIFT: 16, // Check by `&& event.shiftKey`\n //CTRL: 17, // Check by `&& event.ctrlKey`\n //ALT: 18, // Check by `&& event.altKey`\n ENTER = \"Enter\",\n ESC = \"Escape\",\n TAB = \"Tab\",\n SPACE = \" \",\n BACKSPACE = \"Backspace\",\n UP_ARROW = \"ArrowUp\",\n DOWN_ARROW = \"ArrowDown\",\n LEFT_ARROW = \"ArrowLeft\",\n RIGHT_ARROW = \"ArrowRight\",\n\n QUOTE = \"'\",\n DOUBLE_QUOTE = '\"',\n OPEN_BRACKET = \"[\",\n CLOSE_BRACKET = \"]\",\n LESS_THAN = \"<\",\n GREATER_THAN = \">\",\n OPEN_PARENTHESIS = \"(\",\n CLOSE_PARENTHESIS = \")\",\n OPEN_BRACE = \"{\",\n CLOSE_BRACE = \"}\",\n EQUAL = \"=\",\n\n PIPE = \"|\",\n DOT = \".\",\n FORWARD_SLASH = \"/\",\n HYPHEN = \"-\",\n HASH = \"#\",\n\n k0 = \"0\",\n k1 = \"1\",\n k2 = \"2\",\n k3 = \"3\",\n k4 = \"4\",\n k5 = \"5\",\n k6 = \"6\",\n k7 = \"7\",\n k8 = \"8\",\n k9 = \"9\",\n\n A = \"a\",\n B = \"b\",\n C = \"c\",\n D = \"d\",\n E = \"e\",\n F = \"f\",\n G = \"g\",\n H = \"h\",\n I = \"i\",\n J = \"j\",\n K = \"k\",\n L = \"l\",\n M = \"m\",\n N = \"n\",\n O = \"o\",\n P = \"p\",\n Q = \"q\",\n R = \"r\",\n S = \"s\",\n T = \"t\",\n U = \"u\",\n V = \"v\",\n W = \"w\",\n X = \"x\",\n Y = \"y\",\n Z = \"z\",\n}\n\n/**\n * Keyboard key codes as returned by event.code\n */\nexport enum KEYCODE {\n //SHIFT: 16, // Check by `&& event.shiftKey`\n //CTRL: 17, // Check by `&& event.ctrlKey`\n //ALT: 18, // Check by `&& event.altKey`\n ENTER = \"Enter\",\n ESC = \"Escape\",\n TAB = \"Tab\",\n SPACE = \"Space\",\n BACKSPACE = \"Backspace\",\n UP_ARROW = \"ArrowUp\",\n DOWN_ARROW = \"ArrowDown\",\n LEFT_ARROW = \"ArrowLeft\",\n RIGHT_ARROW = \"ArrowRight\",\n\n BACKWARD_SLASH = \"Backslash\",\n BACKQUOTE = \"Backquote\",\n COMMA = \"Comma\",\n DOT = \"Period\",\n EQUAL = \"Equal\",\n FORWARD_SLASH = \"Slash\",\n HYPHEN = \"Minus\",\n SEMICOLON = \"Semicolon\",\n QUOTE = \"Quote\",\n\n k0 = \"Digit0\",\n k1 = \"Digit1\",\n k2 = \"Digit2\",\n k3 = \"Digit3\",\n k4 = \"Digit4\",\n k5 = \"Digit5\",\n k6 = \"Digit6\",\n k7 = \"Digit7\",\n k8 = \"Digit8\",\n k9 = \"Digit9\",\n\n A = \"KeyA\",\n B = \"KeyB\",\n C = \"KeyC\",\n D = \"KeyD\",\n E = \"KeyE\",\n F = \"KeyF\",\n G = \"KeyG\",\n H = \"KeyH\",\n I = \"KeyI\",\n J = \"KeyJ\",\n K = \"KeyK\",\n L = \"KeyL\",\n M = \"KeyM\",\n N = \"KeyN\",\n O = \"KeyO\",\n P = \"KeyP\",\n Q = \"KeyQ\",\n R = \"KeyR\",\n S = \"KeyS\",\n T = \"KeyT\",\n U = \"KeyU\",\n V = \"KeyV\",\n W = \"KeyW\",\n X = \"KeyX\",\n Y = \"KeyY\",\n Z = \"KeyZ\",\n}\n","// Defs for job titles, stored in arrays and categorized by job \"type\"\n\nexport const SoftwareCompanyPositions: string[] = [\n \"Software Engineering Intern\",\n \"Junior Software Engineer\",\n \"Senior Software Engineer\",\n \"Lead Software Developer\",\n \"Head of Software\",\n \"Head of Engineering\",\n \"Vice President of Technology\",\n \"Chief Technology Officer\",\n];\n\nexport const ITCompanyPositions: string[] = [\"IT Intern\", \"IT Analyst\", \"IT Manager\", \"Systems Administrator\"];\n\nexport const SecurityEngineerCompanyPositions: string[] = [\"Security Engineer\"];\n\nexport const NetworkEngineerCompanyPositions: string[] = [\"Network Engineer\", \"Network Administrator\"];\n\nexport const BusinessCompanyPositions: string[] = [\n \"Business Intern\",\n \"Business Analyst\",\n \"Business Manager\",\n \"Operations Manager\",\n \"Chief Financial Officer\",\n \"Chief Executive Officer\",\n];\n\nexport const SecurityCompanyPositions: string[] = [\n \"Police Officer\",\n \"Police Chief\",\n \"Security Guard\",\n \"Security Officer\",\n \"Security Supervisor\",\n \"Head of Security\",\n];\n\nexport const AgentCompanyPositions: string[] = [\"Field Agent\", \"Secret Agent\", \"Special Operative\"];\n\nexport const MiscCompanyPositions: string[] = [\"Waiter\", \"Employee\"];\n\nexport const SoftwareConsultantCompanyPositions: string[] = [\"Software Consultant\", \"Senior Software Consultant\"];\n\nexport const BusinessConsultantCompanyPositions: string[] = [\"Business Consultant\", \"Senior Business Consultant\"];\n\nexport const PartTimeCompanyPositions: string[] = [\"Part-time Waiter\", \"Part-time Employee\"];\n","/**\n * Gets a random integer bounded by the values passed in.\n * @param min The minimum value in the range.\n * @param max The maximum value in the range.\n */\nexport function getRandomInt(min: number, max: number): number {\n const lower: number = Math.min(min, max);\n const upper: number = Math.max(min, max);\n\n return Math.floor(Math.random() * (upper - lower + 1)) + lower;\n}\n","import { CityName } from \"./../../Locations/data/CityNames\";\nconst CyclesPerMarketCycle = 50;\nconst AllCorporationStates = [\"START\", \"PURCHASE\", \"PRODUCTION\", \"SALE\", \"EXPORT\"];\nexport const CorporationConstants: {\n INITIALSHARES: number;\n SHARESPERPRICEUPDATE: number;\n IssueNewSharesCooldown: number;\n SellSharesCooldown: number;\n CyclesPerMarketCycle: number;\n CyclesPerIndustryStateCycle: number;\n SecsPerMarketCycle: number;\n Cities: string[];\n WarehouseInitialCost: number;\n WarehouseInitialSize: number;\n WarehouseUpgradeBaseCost: number;\n OfficeInitialCost: number;\n OfficeInitialSize: number;\n OfficeUpgradeBaseCost: number;\n BribeThreshold: number;\n BribeToRepRatio: number;\n ProductProductionCostRatio: number;\n DividendMaxRate: number;\n EmployeeSalaryMultiplier: number;\n CyclesPerEmployeeRaise: number;\n EmployeeRaiseAmount: number;\n BaseMaxProducts: number;\n AllCorporationStates: string[];\n AllMaterials: string[];\n AllIndustryTypes: string[];\n AllUnlocks: string[];\n AllUpgrades: string[];\n AllResearch: string[];\n FundingRoundShares: number[];\n FundingRoundMultiplier: number[];\n AvgProfitLength: number;\n} = {\n INITIALSHARES: 1e9, //Total number of shares you have at your company\n SHARESPERPRICEUPDATE: 1e6, //When selling large number of shares, price is dynamically updated for every batch of this amount\n IssueNewSharesCooldown: 216e3, // 12 Hour in terms of game cycles\n SellSharesCooldown: 18e3, // 1 Hour in terms of game cycles\n\n CyclesPerMarketCycle: CyclesPerMarketCycle,\n CyclesPerIndustryStateCycle: CyclesPerMarketCycle / AllCorporationStates.length,\n SecsPerMarketCycle: CyclesPerMarketCycle / 5,\n\n Cities: [\n CityName.Aevum,\n CityName.Chongqing,\n CityName.Sector12,\n CityName.NewTokyo,\n CityName.Ishima,\n CityName.Volhaven,\n ],\n\n WarehouseInitialCost: 5e9, //Initial purchase cost of warehouse\n WarehouseInitialSize: 100,\n WarehouseUpgradeBaseCost: 1e9,\n\n OfficeInitialCost: 4e9,\n OfficeInitialSize: 3,\n OfficeUpgradeBaseCost: 1e9,\n\n BribeThreshold: 100e12, //Money needed to be able to bribe for faction rep\n BribeToRepRatio: 1e9, //Bribe Value divided by this = rep gain\n\n ProductProductionCostRatio: 5, //Ratio of material cost of a product to its production cost\n\n DividendMaxRate: 1,\n\n EmployeeSalaryMultiplier: 3, // Employee stats multiplied by this to determine initial salary\n CyclesPerEmployeeRaise: 400, // All employees get a raise every X market cycles\n EmployeeRaiseAmount: 50, // Employee salary increases by this (additive)\n\n BaseMaxProducts: 3, // Initial value for maximum number of products allowed\n AllCorporationStates: AllCorporationStates,\n AllMaterials: [\n \"Water\",\n \"Energy\",\n \"Food\",\n \"Plants\",\n \"Metal\",\n \"Hardware\",\n \"Chemicals\",\n \"Drugs\",\n \"Robots\",\n \"AI Cores\",\n \"Real Estate\",\n ],\n AllIndustryTypes: [\n \"Energy\",\n \"Utilities\",\n \"Agriculture\",\n \"Fishing\",\n \"Mining\",\n \"Food\",\n \"Tobacco\",\n \"Chemical\",\n \"Pharmaceutical\",\n \"Hardware\",\n \"Robotics\",\n \"Software\",\n \"Healthcare\",\n \"RealEstate\",\n ],\n AllUnlocks: [\n \"Export\",\n \"Smart Supply\",\n \"Market Research - Demand\",\n \"Market Data - Competition\",\n \"VeChain\",\n \"Shady Accounting\",\n \"Government Partnership\",\n \"Warehouse API\",\n \"Office API\",\n ],\n AllUpgrades: [\n \"Smart Factories\",\n \"Smart Storage\",\n \"DreamSense\",\n \"Wilson Analytics\",\n \"Nuoptimal Nootropic Injector Implants\",\n \"Speech Processor Implants\",\n \"Neural Accelerators\",\n \"FocusWires\",\n \"ABC SalesBots\",\n \"Project Insight\",\n ],\n AllResearch: [\n \"Hi-Tech R&D Laboratory\",\n \"AutoBrew\",\n \"AutoPartyManager\",\n \"Automatic Drug Administration\",\n \"Bulk Purchasing\",\n \"CPH4 Injections\",\n \"Drones\",\n \"Drones - Assembly\",\n \"Drones - Transport\",\n \"Go-Juice\",\n \"HRBuddy-Recruitment\",\n \"HRBuddy-Training\",\n \"JoyWire\",\n \"Market-TA.I\",\n \"Market-TA.II\",\n \"Overclock\",\n \"Self-Correcting Assemblers\",\n \"Sti.mu\",\n \"sudo.Assist\",\n \"uPgrade: Capacity.I\",\n \"uPgrade: Capacity.II\",\n \"uPgrade: Dashboard\",\n \"uPgrade: Fulcrum\",\n ],\n FundingRoundShares: [0.1, 0.35, 0.25, 0.2],\n FundingRoundMultiplier: [4, 3, 3, 2.5],\n\n AvgProfitLength: 1,\n};\n","// Class definition for a single Augmentation object\nimport * as React from \"react\";\n\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions } from \"../Faction/Factions\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\nimport { CONSTANTS } from \"../Constants\";\nimport { StaticAugmentations } from \"./StaticAugmentations\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { getBaseAugmentationPriceMultiplier, getGenericAugmentationPriceMultiplier } from \"./AugmentationHelpers\";\nimport { initSoAAugmentations } from \"./data/AugmentationCreator\";\nimport { Multipliers, defaultMultipliers } from \"../PersonObjects/Multipliers\";\n\nexport interface AugmentationCosts {\n moneyCost: number;\n repCost: number;\n}\n\nexport interface IConstructorParams {\n info: string | JSX.Element;\n stats?: JSX.Element | null;\n isSpecial?: boolean;\n moneyCost: number;\n name: string;\n prereqs?: string[];\n repCost: number;\n factions: string[];\n\n hacking?: number;\n strength?: number;\n defense?: number;\n dexterity?: number;\n agility?: number;\n charisma?: number;\n hacking_exp?: number;\n strength_exp?: number;\n defense_exp?: number;\n dexterity_exp?: number;\n agility_exp?: number;\n charisma_exp?: number;\n hacking_chance?: number;\n hacking_speed?: number;\n hacking_money?: number;\n hacking_grow?: number;\n company_rep?: number;\n faction_rep?: number;\n crime_money?: number;\n crime_success?: number;\n work_money?: number;\n hacknet_node_money?: number;\n hacknet_node_purchase_cost?: number;\n hacknet_node_ram_cost?: number;\n hacknet_node_core_cost?: number;\n hacknet_node_level_cost?: number;\n bladeburner_max_stamina?: number;\n bladeburner_stamina_gain?: number;\n bladeburner_analysis?: number;\n bladeburner_success_chance?: number;\n infiltration_base_rep_increase?: number;\n infiltration_rep?: number;\n infiltration_trade?: number;\n infiltration_sell?: number;\n infiltration_timer?: number;\n infiltration_damage_reduction?: number;\n\n startingMoney?: number;\n programs?: string[];\n}\n\nfunction generateStatsDescription(mults: Multipliers, programs?: string[], startingMoney?: number): JSX.Element {\n const f = (x: number, decimals = 0): string => {\n // look, I don't know how to make a \"smart decimals\"\n // todo, make it smarter\n if (x === 1.0777 - 1) return \"7.77%\";\n if (x === 1.777 - 1) return \"77.7%\";\n return numeralWrapper.formatPercentage(x, decimals);\n };\n let desc = <>Effects:;\n\n if (\n mults.hacking !== 1 &&\n mults.hacking == mults.strength &&\n mults.hacking == mults.defense &&\n mults.hacking == mults.dexterity &&\n mults.hacking == mults.agility &&\n mults.hacking == mults.charisma\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.hacking - 1)} all skills\n \n );\n } else {\n if (mults.hacking !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking - 1)} hacking skill\n \n );\n\n if (\n mults.strength !== 1 &&\n mults.strength == mults.defense &&\n mults.strength == mults.dexterity &&\n mults.strength == mults.agility\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.strength - 1)} combat skills\n \n );\n } else {\n if (mults.strength !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.strength - 1)} strength skill\n \n );\n if (mults.defense !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.defense - 1)} defense skill\n \n );\n if (mults.dexterity !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.dexterity - 1)} dexterity skill\n \n );\n if (mults.agility !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.agility - 1)} agility skill\n \n );\n }\n if (mults.charisma !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.charisma - 1)} charisma skill\n \n );\n }\n\n if (\n mults.hacking_exp !== 1 &&\n mults.hacking_exp === mults.strength_exp &&\n mults.hacking_exp === mults.defense_exp &&\n mults.hacking_exp === mults.dexterity_exp &&\n mults.hacking_exp === mults.agility_exp &&\n mults.hacking_exp === mults.charisma_exp\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_exp - 1)} exp for all skills\n \n );\n } else {\n if (mults.hacking_exp !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_exp - 1)} hacking exp\n \n );\n\n if (\n mults.strength_exp !== 1 &&\n mults.strength_exp === mults.defense_exp &&\n mults.strength_exp === mults.dexterity_exp &&\n mults.strength_exp === mults.agility_exp\n ) {\n desc = (\n <>\n {desc}\n
+{f(mults.strength_exp - 1)} combat exp\n \n );\n } else {\n if (mults.strength_exp !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.strength_exp - 1)} strength exp\n \n );\n if (mults.defense_exp !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.defense_exp - 1)} defense exp\n \n );\n if (mults.dexterity_exp !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.dexterity_exp - 1)} dexterity exp\n \n );\n if (mults.agility_exp !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.agility_exp - 1)} agility exp\n \n );\n }\n if (mults.charisma_exp !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.charisma_exp - 1)} charisma exp\n \n );\n }\n\n if (mults.hacking_speed !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_speed - 1)} faster hack(), grow(), and weaken()\n \n );\n if (mults.hacking_chance !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_chance - 1)} hack() success chance\n \n );\n if (mults.hacking_money !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_money - 1)} hack() power\n \n );\n if (mults.hacking_grow !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.hacking_grow - 1)} grow() power\n \n );\n\n if (mults.faction_rep !== 1 && mults.faction_rep === mults.company_rep) {\n desc = (\n <>\n {desc}\n
+{f(mults.faction_rep - 1)} reputation from factions and companies\n \n );\n } else {\n if (mults.faction_rep !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.faction_rep - 1)} reputation from factions\n \n );\n if (mults.company_rep !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.company_rep - 1)} reputation from companies\n \n );\n }\n\n if (mults.crime_money !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.crime_money - 1)} crime money\n \n );\n if (mults.crime_success !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.crime_success - 1)} crime success rate\n \n );\n if (mults.work_money !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.work_money - 1)} work money\n \n );\n\n if (mults.hacknet_node_money !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.hacknet_node_money - 1)} hacknet production\n \n );\n if (mults.hacknet_node_purchase_cost !== 1)\n desc = (\n <>\n {desc}\n
-{f(-(mults.hacknet_node_purchase_cost - 1))} hacknet nodes cost\n \n );\n if (mults.hacknet_node_level_cost !== 1)\n desc = (\n <>\n {desc}\n
-{f(-(mults.hacknet_node_level_cost - 1))} hacknet nodes upgrade cost\n \n );\n\n if (mults.bladeburner_max_stamina !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_max_stamina - 1)} Bladeburner Max Stamina\n \n );\n if (mults.bladeburner_stamina_gain !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_stamina_gain - 1)} Bladeburner Stamina gain\n \n );\n if (mults.bladeburner_analysis !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_analysis - 1)} Bladeburner Field Analysis effectiveness\n \n );\n if (mults.bladeburner_success_chance !== 1)\n desc = (\n <>\n {desc}\n
+{f(mults.bladeburner_success_chance - 1)} Bladeburner Contracts and Operations success chance\n \n );\n if (startingMoney)\n desc = (\n <>\n {desc}\n
\n Start with after installing Augmentations.\n \n );\n\n if (programs)\n desc = (\n <>\n {desc}\n
\n Start with {programs.join(\" and \")} after installing Augmentations.\n \n );\n return desc;\n}\n\nexport class Augmentation {\n // How much money this costs to buy before multipliers\n baseCost = 0;\n\n // How much faction reputation is required to unlock this before multipliers\n baseRepRequirement = 0;\n\n // Description of what this Aug is and what it does\n info: string | JSX.Element;\n\n // Description of the stats, often autogenerated, sometimes manually written.\n stats: JSX.Element | null;\n\n // Any Augmentation not immediately available in BitNode-1 is special (e.g. Bladeburner augs)\n isSpecial = false;\n\n // Name of Augmentation\n name = \"\";\n\n // Array of names of all prerequisites\n prereqs: string[] = [];\n\n // Multipliers given by this Augmentation. Must match the property name in\n // The Player/Person classes\n mults: Multipliers = defaultMultipliers();\n\n // Factions that offer this aug.\n factions: string[] = [];\n\n constructor(\n params: IConstructorParams = {\n info: \"\",\n moneyCost: 0,\n name: \"\",\n repCost: 0,\n factions: [],\n },\n ) {\n this.name = params.name;\n this.info = params.info;\n this.prereqs = params.prereqs ? params.prereqs : [];\n\n this.baseRepRequirement = params.repCost;\n Object.freeze(this.baseRepRequirement);\n this.baseCost = params.moneyCost;\n Object.freeze(this.baseCost);\n this.factions = params.factions;\n\n if (params.isSpecial) {\n this.isSpecial = true;\n }\n\n // Set multipliers\n if (params.hacking) {\n this.mults.hacking = params.hacking;\n }\n if (params.strength) {\n this.mults.strength = params.strength;\n }\n if (params.defense) {\n this.mults.defense = params.defense;\n }\n if (params.dexterity) {\n this.mults.dexterity = params.dexterity;\n }\n if (params.agility) {\n this.mults.agility = params.agility;\n }\n if (params.charisma) {\n this.mults.charisma = params.charisma;\n }\n if (params.hacking_exp) {\n this.mults.hacking_exp = params.hacking_exp;\n }\n if (params.strength_exp) {\n this.mults.strength_exp = params.strength_exp;\n }\n if (params.defense_exp) {\n this.mults.defense_exp = params.defense_exp;\n }\n if (params.dexterity_exp) {\n this.mults.dexterity_exp = params.dexterity_exp;\n }\n if (params.agility_exp) {\n this.mults.agility_exp = params.agility_exp;\n }\n if (params.charisma_exp) {\n this.mults.charisma_exp = params.charisma_exp;\n }\n if (params.hacking_chance) {\n this.mults.hacking_chance = params.hacking_chance;\n }\n if (params.hacking_speed) {\n this.mults.hacking_speed = params.hacking_speed;\n }\n if (params.hacking_money) {\n this.mults.hacking_money = params.hacking_money;\n }\n if (params.hacking_grow) {\n this.mults.hacking_grow = params.hacking_grow;\n }\n if (params.company_rep) {\n this.mults.company_rep = params.company_rep;\n }\n if (params.faction_rep) {\n this.mults.faction_rep = params.faction_rep;\n }\n if (params.crime_money) {\n this.mults.crime_money = params.crime_money;\n }\n if (params.crime_success) {\n this.mults.crime_success = params.crime_success;\n }\n if (params.work_money) {\n this.mults.work_money = params.work_money;\n }\n if (params.hacknet_node_money) {\n this.mults.hacknet_node_money = params.hacknet_node_money;\n }\n if (params.hacknet_node_purchase_cost) {\n this.mults.hacknet_node_purchase_cost = params.hacknet_node_purchase_cost;\n }\n if (params.hacknet_node_ram_cost) {\n this.mults.hacknet_node_ram_cost = params.hacknet_node_ram_cost;\n }\n if (params.hacknet_node_core_cost) {\n this.mults.hacknet_node_core_cost = params.hacknet_node_core_cost;\n }\n if (params.hacknet_node_level_cost) {\n this.mults.hacknet_node_level_cost = params.hacknet_node_level_cost;\n }\n if (params.bladeburner_max_stamina) {\n this.mults.bladeburner_max_stamina = params.bladeburner_max_stamina;\n }\n if (params.bladeburner_stamina_gain) {\n this.mults.bladeburner_stamina_gain = params.bladeburner_stamina_gain;\n }\n if (params.bladeburner_analysis) {\n this.mults.bladeburner_analysis = params.bladeburner_analysis;\n }\n if (params.bladeburner_success_chance) {\n this.mults.bladeburner_success_chance = params.bladeburner_success_chance;\n }\n\n if (params.stats === undefined)\n this.stats = generateStatsDescription(this.mults, params.programs, params.startingMoney);\n else this.stats = params.stats;\n }\n\n // Adds this Augmentation to the specified Factions\n addToFactions(factionList: string[]): void {\n for (let i = 0; i < factionList.length; ++i) {\n const faction: Faction | null = Factions[factionList[i]];\n if (faction == null) {\n console.warn(`In Augmentation.addToFactions(), could not find faction with this name: ${factionList[i]}`);\n continue;\n }\n faction.augmentations.push(this.name);\n }\n }\n\n getCost(player: IPlayer): AugmentationCosts {\n const augmentationReference = StaticAugmentations[this.name];\n let moneyCost = augmentationReference.baseCost;\n let repCost = augmentationReference.baseRepRequirement;\n\n if (augmentationReference.name === AugmentationNames.NeuroFluxGovernor) {\n let nextLevel = this.getLevel(player);\n --nextLevel;\n const multiplier = Math.pow(CONSTANTS.NeuroFluxGovernorLevelMult, nextLevel);\n repCost = augmentationReference.baseRepRequirement * multiplier * BitNodeMultipliers.AugmentationRepCost;\n moneyCost = augmentationReference.baseCost * multiplier * BitNodeMultipliers.AugmentationMoneyCost;\n\n for (let i = 0; i < player.queuedAugmentations.length; ++i) {\n moneyCost *= getBaseAugmentationPriceMultiplier();\n }\n } else if (augmentationReference.factions.includes(FactionNames.ShadowsOfAnarchy)) {\n const soaAugmentationNames = initSoAAugmentations().map((augmentation) => augmentation.name);\n const soaMultiplier = Math.pow(\n CONSTANTS.SoACostMult,\n soaAugmentationNames.filter((augmentationName) => player.hasAugmentation(augmentationName)).length,\n );\n moneyCost = augmentationReference.baseCost * soaMultiplier;\n if (soaAugmentationNames.find((augmentationName) => augmentationName === augmentationReference.name)) {\n repCost = augmentationReference.baseRepRequirement * soaMultiplier;\n }\n } else {\n moneyCost =\n augmentationReference.baseCost *\n getGenericAugmentationPriceMultiplier() *\n BitNodeMultipliers.AugmentationMoneyCost;\n repCost = augmentationReference.baseRepRequirement * BitNodeMultipliers.AugmentationRepCost;\n }\n return { moneyCost, repCost };\n }\n\n getLevel(player: IPlayer): number {\n // Get current Neuroflux level based on Player's augmentations\n if (this.name === AugmentationNames.NeuroFluxGovernor) {\n let currLevel = 0;\n for (let i = 0; i < player.augmentations.length; ++i) {\n if (player.augmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n currLevel = player.augmentations[i].level;\n }\n }\n\n // Account for purchased but uninstalled Augmentations\n for (let i = 0; i < player.queuedAugmentations.length; ++i) {\n if (player.queuedAugmentations[i].name == AugmentationNames.NeuroFluxGovernor) {\n ++currLevel;\n }\n }\n return currLevel + 1;\n }\n return 0;\n }\n\n // Adds this Augmentation to all Factions\n addToAllFactions(): void {\n for (const fac of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(fac)) {\n const facObj: Faction | null = Factions[fac];\n if (facObj == null) {\n console.warn(`Invalid Faction object in addToAllFactions(). Key value: ${fac}`);\n continue;\n }\n if (facObj.getInfo().special) continue;\n facObj.augmentations.push(this.name);\n }\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Augmentation\", this);\n }\n\n // Initiatizes a Augmentation object from a JSON save state.\n static fromJSON(value: IReviverValue): Augmentation {\n return Generic_fromJSON(Augmentation, value.data);\n }\n}\n\nReviver.constructors.Augmentation = Augmentation;\n","import { Theme } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\nimport Fade from \"@mui/material/Fade\";\nimport M from \"@mui/material/Modal\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { SxProps } from \"@mui/system\";\nimport React from \"react\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n modal: {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n },\n paper: {\n backgroundColor: theme.palette.background.default,\n border: \"2px solid \" + theme.palette.primary.main,\n boxShadow: `0px 3px 5px -1px ${theme.palette.primary.dark},0px 5px 8px 0px ${theme.palette.primary.dark},0px 1px 14px 0px ${theme.palette.primary.dark}`,\n padding: 2,\n maxWidth: \"80%\",\n maxHeight: \"80%\",\n overflow: \"auto\",\n \"&::-webkit-scrollbar\": {\n // webkit\n display: \"none\",\n },\n scrollbarWidth: \"none\", // firefox\n },\n }),\n);\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: React.ReactNode;\n sx?: SxProps;\n}\n\nexport const Modal = (props: IProps): React.ReactElement => {\n const classes = useStyles();\n return (\n \n \n
\n {props.children}\n
\n
\n \n );\n};\n","export const HacknetNodeConstants: {\n // Constants for Hacknet Node production\n MoneyGainPerLevel: number;\n\n // Constants for Hacknet Node purchase/upgrade costs\n BaseCost: number;\n LevelBaseCost: number;\n RamBaseCost: number;\n CoreBaseCost: number;\n\n PurchaseNextMult: number;\n UpgradeLevelMult: number;\n UpgradeRamMult: number;\n UpgradeCoreMult: number;\n\n // Constants for max upgrade levels for Hacknet Nodes\n MaxLevel: number;\n MaxRam: number;\n MaxCores: number;\n} = {\n MoneyGainPerLevel: 1.5,\n\n BaseCost: 1000,\n LevelBaseCost: 1,\n RamBaseCost: 30e3,\n CoreBaseCost: 500e3,\n\n PurchaseNextMult: 1.85,\n UpgradeLevelMult: 1.04,\n UpgradeRamMult: 1.28,\n UpgradeCoreMult: 1.48,\n\n MaxLevel: 200,\n MaxRam: 64,\n MaxCores: 16,\n};\n\nexport const PurchaseMultipliers: {\n [key: string]: number | \"MAX\" | undefined;\n x1: number;\n x5: number;\n x10: number;\n MAX: \"MAX\";\n} = {\n x1: 1,\n x5: 5,\n x10: 10,\n MAX: \"MAX\",\n};\n\nexport const HacknetServerConstants: {\n // Constants for Hacknet Server stats/production\n HashesPerLevel: number;\n\n // Constants for Hacknet Server purchase/upgrade costs\n BaseCost: number;\n RamBaseCost: number;\n CoreBaseCost: number;\n CacheBaseCost: number;\n\n PurchaseMult: number; // Multiplier for puchasing an additional Hacknet Server\n UpgradeLevelMult: number; // Multiplier for cost when upgrading level\n UpgradeRamMult: number; // Multiplier for cost when upgrading RAM\n UpgradeCoreMult: number; // Multiplier for cost when buying another core\n UpgradeCacheMult: number; // Multiplier for cost when upgrading cache\n MaxServers: number; // Max number of Hacknet Servers you can own\n\n // Constants for max upgrade levels for Hacknet Server\n MaxLevel: number;\n MaxRam: number;\n MaxCores: number;\n MaxCache: number;\n} = {\n HashesPerLevel: 0.001,\n\n BaseCost: 50e3,\n RamBaseCost: 200e3,\n CoreBaseCost: 1e6,\n CacheBaseCost: 10e6,\n\n PurchaseMult: 3.2,\n UpgradeLevelMult: 1.1,\n UpgradeRamMult: 1.4,\n UpgradeCoreMult: 1.55,\n UpgradeCacheMult: 1.85,\n\n MaxServers: 20,\n\n MaxLevel: 300,\n MaxRam: 8192,\n MaxCores: 128,\n MaxCache: 15,\n};\n","import { IMap } from \"../types\";\n\nexport const EmployeePositions: IMap = {\n Operations: \"Operations\",\n Engineer: \"Engineer\",\n Business: \"Business\",\n Management: \"Management\",\n RandD: \"Research & Development\",\n Training: \"Training\",\n Unassigned: \"Unassigned\",\n};\n","// Action Identifier enum\nexport const ActionTypes: {\n [key: string]: number;\n Idle: number;\n Contract: number;\n Operation: number;\n BlackOp: number;\n BlackOperation: number;\n Training: number;\n Recruitment: number;\n FieldAnalysis: number;\n \"Field Analysis\": number;\n Diplomacy: number;\n \"Hyperbolic Regeneration Chamber\": number;\n \"Incite Violence\": number;\n} = {\n Idle: 1,\n Contract: 2,\n Operation: 3,\n BlackOp: 4,\n BlackOperation: 4,\n Training: 5,\n Recruitment: 6,\n FieldAnalysis: 7,\n \"Field Analysis\": 7,\n Diplomacy: 8,\n \"Hyperbolic Regeneration Chamber\": 9,\n \"Incite Violence\": 10,\n};\n","import { Player } from \"./Player\";\n\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { ITutorialEvents } from \"./ui/InteractiveTutorial/ITutorialEvents\";\n\n// Ordered array of keys to Interactive Tutorial Steps\nenum iTutorialSteps {\n Start,\n NSSelection,\n GoToCharacterPage, // Click on 'Stats' page\n CharacterPage, // Introduction to 'Stats' page\n CharacterGoToTerminalPage, // Go back to Terminal\n TerminalIntro, // Introduction to Terminal\n TerminalHelp, // Using 'help' Terminal command\n TerminalLs, // Using 'ls' Terminal command\n TerminalScan, // Using 'scan' Terminal command\n TerminalScanAnalyze1, // Using 'scan-analyze' Terminal command\n TerminalScanAnalyze2, // Using 'scan-analyze 3' Terminal command\n TerminalConnect, // Connecting to n00dles\n TerminalAnalyze, // Analyzing n00dles\n TerminalNuke, // NUKE n00dles\n TerminalManualHack, // Hack n00dles\n TerminalHackingMechanics, // Explanation of hacking mechanics\n TerminalGoHome, // Go home before creating a script.\n TerminalCreateScript, // Create a script using 'nano'\n TerminalTypeScript, // Script Editor page - Type script and then save & close\n TerminalFree, // Using 'Free' Terminal command\n TerminalRunScript, // Running script using 'run' Terminal command\n TerminalGoToActiveScriptsPage,\n ActiveScriptsPage,\n ActiveScriptsToTerminal,\n TerminalTailScript,\n GoToHacknetNodesPage,\n HacknetNodesIntroduction,\n HacknetNodesGoToWorldPage,\n WorldDescription,\n TutorialPageInfo,\n End,\n}\n\nconst ITutorial: {\n currStep: iTutorialSteps;\n isRunning: boolean;\n stepIsDone: {\n [iTutorialSteps.Start]: boolean;\n [iTutorialSteps.NSSelection]: boolean;\n [iTutorialSteps.GoToCharacterPage]: boolean;\n [iTutorialSteps.CharacterPage]: boolean;\n [iTutorialSteps.CharacterGoToTerminalPage]: boolean;\n [iTutorialSteps.TerminalIntro]: boolean;\n [iTutorialSteps.TerminalHelp]: boolean;\n [iTutorialSteps.TerminalLs]: boolean;\n [iTutorialSteps.TerminalScan]: boolean;\n [iTutorialSteps.TerminalScanAnalyze1]: boolean;\n [iTutorialSteps.TerminalScanAnalyze2]: boolean;\n [iTutorialSteps.TerminalConnect]: boolean;\n [iTutorialSteps.TerminalAnalyze]: boolean;\n [iTutorialSteps.TerminalNuke]: boolean;\n [iTutorialSteps.TerminalManualHack]: boolean;\n [iTutorialSteps.TerminalHackingMechanics]: boolean;\n [iTutorialSteps.TerminalGoHome]: boolean;\n [iTutorialSteps.TerminalCreateScript]: boolean;\n [iTutorialSteps.TerminalTypeScript]: boolean;\n [iTutorialSteps.TerminalFree]: boolean;\n [iTutorialSteps.TerminalRunScript]: boolean;\n [iTutorialSteps.TerminalGoToActiveScriptsPage]: boolean;\n [iTutorialSteps.ActiveScriptsPage]: boolean;\n [iTutorialSteps.ActiveScriptsToTerminal]: boolean;\n [iTutorialSteps.TerminalTailScript]: boolean;\n [iTutorialSteps.GoToHacknetNodesPage]: boolean;\n [iTutorialSteps.HacknetNodesIntroduction]: boolean;\n [iTutorialSteps.HacknetNodesGoToWorldPage]: boolean;\n [iTutorialSteps.WorldDescription]: boolean;\n [iTutorialSteps.TutorialPageInfo]: boolean;\n [iTutorialSteps.End]: boolean;\n };\n} = {\n currStep: iTutorialSteps.Start,\n isRunning: false,\n\n // Keeps track of whether each step has been done\n stepIsDone: {\n [iTutorialSteps.Start]: false,\n [iTutorialSteps.NSSelection]: false,\n [iTutorialSteps.GoToCharacterPage]: false,\n [iTutorialSteps.CharacterPage]: false,\n [iTutorialSteps.CharacterGoToTerminalPage]: false,\n [iTutorialSteps.TerminalIntro]: false,\n [iTutorialSteps.TerminalHelp]: false,\n [iTutorialSteps.TerminalLs]: false,\n [iTutorialSteps.TerminalScan]: false,\n [iTutorialSteps.TerminalScanAnalyze1]: false,\n [iTutorialSteps.TerminalScanAnalyze2]: false,\n [iTutorialSteps.TerminalConnect]: false,\n [iTutorialSteps.TerminalAnalyze]: false,\n [iTutorialSteps.TerminalNuke]: false,\n [iTutorialSteps.TerminalManualHack]: false,\n [iTutorialSteps.TerminalHackingMechanics]: false,\n [iTutorialSteps.TerminalGoHome]: false,\n [iTutorialSteps.TerminalCreateScript]: false,\n [iTutorialSteps.TerminalTypeScript]: false,\n [iTutorialSteps.TerminalFree]: false,\n [iTutorialSteps.TerminalRunScript]: false,\n [iTutorialSteps.TerminalGoToActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsPage]: false,\n [iTutorialSteps.ActiveScriptsToTerminal]: false,\n [iTutorialSteps.TerminalTailScript]: false,\n [iTutorialSteps.GoToHacknetNodesPage]: false,\n [iTutorialSteps.HacknetNodesIntroduction]: false,\n [iTutorialSteps.HacknetNodesGoToWorldPage]: false,\n [iTutorialSteps.WorldDescription]: false,\n [iTutorialSteps.TutorialPageInfo]: false,\n [iTutorialSteps.End]: false,\n },\n};\n\nfunction iTutorialStart(): void {\n ITutorial.isRunning = true;\n ITutorial.currStep = iTutorialSteps.Start;\n}\n\n// Go to the next step and evaluate it\nfunction iTutorialNextStep(): void {\n ITutorial.stepIsDone[ITutorial.currStep] = true;\n if (ITutorial.currStep < iTutorialSteps.End) {\n ITutorial.currStep += 1;\n }\n if (ITutorial.currStep === iTutorialSteps.End) iTutorialEnd();\n ITutorialEvents.emit();\n}\n\n// Go to previous step and evaluate\nfunction iTutorialPrevStep(): void {\n if (ITutorial.currStep > iTutorialSteps.Start) {\n ITutorial.currStep -= 1;\n }\n ITutorialEvents.emit();\n}\n\nfunction iTutorialEnd(): void {\n ITutorial.isRunning = false;\n ITutorial.currStep = iTutorialSteps.Start;\n Player.getHomeComputer().messages.push(LiteratureNames.HackersStartingHandbook);\n ITutorialEvents.emit();\n}\n\nexport { iTutorialSteps, iTutorialEnd, iTutorialStart, iTutorialNextStep, ITutorial, iTutorialPrevStep };\n","// Class representing a single hackable Server\nimport { BaseServer } from \"./BaseServer\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nimport { createRandomString } from \"../utils/helpers/createRandomString\";\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n adminRights?: boolean;\n hackDifficulty?: number;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n moneyAvailable?: number;\n numOpenPortsRequired?: number;\n organizationName?: string;\n purchasedByPlayer?: boolean;\n requiredHackingSkill?: number;\n serverGrowth?: number;\n}\n\nexport class Server extends BaseServer {\n // Flag indicating whether this server has a backdoor installed by a player\n backdoorInstalled = false;\n\n // Initial server security level\n // (i.e. security level when the server was created)\n baseDifficulty = 1;\n\n // Server Security Level\n hackDifficulty = 1;\n\n // Minimum server security level that this server can be weakened to\n minDifficulty = 1;\n\n // How much money currently resides on the server and can be hacked\n moneyAvailable = 0;\n\n // Maximum amount of money that this server can hold\n moneyMax = 0;\n\n // Number of open ports required in order to gain admin/root access\n numOpenPortsRequired = 5;\n\n // How many ports are currently opened on the server\n openPortCount = 0;\n\n // Hacking level required to hack this server\n requiredHackingSkill = 1;\n\n // Parameter that affects how effectively this server's money can\n // be increased using the grow() Netscript function\n serverGrowth = 1;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n super(params);\n\n // \"hacknet-node-X\" hostnames are reserved for Hacknet Servers\n if (this.hostname.startsWith(\"hacknet-node-\")) {\n this.hostname = createRandomString(10);\n }\n\n this.purchasedByPlayer = params.purchasedByPlayer != null ? params.purchasedByPlayer : false;\n\n //RAM, CPU speed and Scripts\n this.maxRam = params.maxRam != null ? params.maxRam : 0; //GB\n\n /* Hacking information (only valid for \"foreign\" aka non-purchased servers) */\n this.requiredHackingSkill = params.requiredHackingSkill != null ? params.requiredHackingSkill : 1;\n this.moneyAvailable =\n params.moneyAvailable != null ? params.moneyAvailable * BitNodeMultipliers.ServerStartingMoney : 0;\n this.moneyMax = 25 * this.moneyAvailable * BitNodeMultipliers.ServerMaxMoney;\n\n //Hack Difficulty is synonymous with server security. Base Difficulty = Starting difficulty\n this.hackDifficulty =\n params.hackDifficulty != null ? params.hackDifficulty * BitNodeMultipliers.ServerStartingSecurity : 1;\n this.baseDifficulty = this.hackDifficulty;\n this.minDifficulty = Math.max(1, Math.round(this.hackDifficulty / 3));\n this.serverGrowth = params.serverGrowth != null ? params.serverGrowth : 1; //Integer from 0 to 100. Affects money increase from grow()\n\n //Port information, required for porthacking servers to get admin rights\n this.numOpenPortsRequired = params.numOpenPortsRequired != null ? params.numOpenPortsRequired : 5;\n }\n\n /**\n * Ensures that the server's difficulty (server security) doesn't get too high\n */\n capDifficulty(): void {\n if (this.hackDifficulty < this.minDifficulty) {\n this.hackDifficulty = this.minDifficulty;\n }\n if (this.hackDifficulty < 1) {\n this.hackDifficulty = 1;\n }\n\n // Place some arbitrarily limit that realistically should never happen unless someone is\n // screwing around with the game\n if (this.hackDifficulty > 100) {\n this.hackDifficulty = 100;\n }\n }\n\n /**\n * Change this server's minimum security\n * @param n - Value by which to increase/decrease the server's minimum security\n * @param perc - Whether it should be changed by a percentage, or a flat value\n */\n changeMinimumSecurity(n: number, perc = false): void {\n if (perc) {\n this.minDifficulty *= n;\n } else {\n this.minDifficulty += n;\n }\n\n // Server security cannot go below 1\n this.minDifficulty = Math.max(1, this.minDifficulty);\n }\n\n /**\n * Change this server's maximum money\n * @param n - Value by which to change the server's maximum money\n */\n changeMaximumMoney(n: number): void {\n const softCap = 10e12;\n if (this.moneyMax > softCap) {\n const aboveCap = this.moneyMax - softCap;\n n = 1 + (n - 1) / Math.log(aboveCap) / Math.log(8);\n }\n\n this.moneyMax *= n;\n }\n\n /**\n * Strengthens a server's security level (difficulty) by the specified amount\n */\n fortify(amt: number): void {\n this.hackDifficulty += amt;\n this.capDifficulty();\n }\n\n /**\n * Lowers the server's security level (difficulty) by the specified amount)\n */\n weaken(amt: number): void {\n this.hackDifficulty -= amt * BitNodeMultipliers.ServerWeakenRate;\n this.capDifficulty();\n }\n\n /**\n * Serialize the current object to a JSON save state\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Server\", this);\n }\n\n // Initializes a Server Object from a JSON save state\n static fromJSON(value: IReviverValue): Server {\n return Generic_fromJSON(Server, value.data);\n }\n}\n\nReviver.constructors.Server = Server;\n","import React, { useContext } from \"react\";\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\n\nexport const Context: {\n Corporation: React.Context;\n Division: React.Context;\n} = {\n Corporation: React.createContext({} as ICorporation),\n Division: React.createContext({} as IIndustry),\n};\n\nexport const useCorporation = (): ICorporation => useContext(Context.Corporation);\nexport const useDivision = (): IIndustry => useContext(Context.Division);\n","import React from \"react\";\nimport { ResearchTree } from \"./ResearchTree\";\nimport { ICorporation } from \"./ICorporation\";\nimport { getBaseResearchTreeCopy, getProductIndustryResearchTreeCopy } from \"./data/BaseResearchTree\";\nimport { MoneyCost } from \"./ui/MoneyCost\";\n\ninterface IIndustryMap {\n [key: string]: T | undefined;\n Energy: T;\n Utilities: T;\n Agriculture: T;\n Fishing: T;\n Mining: T;\n Food: T;\n Tobacco: T;\n Chemical: T;\n Pharmaceutical: T;\n Computer: T;\n Robotics: T;\n Software: T;\n Healthcare: T;\n RealEstate: T;\n}\n\n// Map of official names for each Industry\nexport const Industries: IIndustryMap = {\n Energy: \"Energy\",\n Utilities: \"Water Utilities\",\n Agriculture: \"Agriculture\",\n Fishing: \"Fishing\",\n Mining: \"Mining\",\n Food: \"Food\",\n Tobacco: \"Tobacco\",\n Chemical: \"Chemical\",\n Pharmaceutical: \"Pharmaceutical\",\n Computer: \"Computer Hardware\",\n Robotics: \"Robotics\",\n Software: \"Software\",\n Healthcare: \"Healthcare\",\n RealEstate: \"RealEstate\",\n};\n\n// Map of how much money it takes to start each industry\nexport const IndustryStartingCosts: IIndustryMap = {\n Energy: 225e9,\n Utilities: 150e9,\n Agriculture: 40e9,\n Fishing: 80e9,\n Mining: 300e9,\n Food: 10e9,\n Tobacco: 20e9,\n Chemical: 70e9,\n Pharmaceutical: 200e9,\n Computer: 500e9,\n Robotics: 1e12,\n Software: 25e9,\n Healthcare: 750e9,\n RealEstate: 600e9,\n};\n\n// Map of description for each industry\nexport const IndustryDescriptions: IIndustryMap<(corp: ICorporation) => React.ReactElement> = {\n Energy: (corp: ICorporation) => (\n <>\n Engage in the production and distribution of energy.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Utilities: (corp: ICorporation) => (\n <>\n Distribute water and provide wastewater services.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Agriculture: (corp: ICorporation) => (\n <>\n Cultivate crops and breed livestock to produce food.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: YES\n \n ),\n Fishing: (corp: ICorporation) => (\n <>\n Produce food through the breeding and processing of fish and fish products.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Mining: (corp: ICorporation) => (\n <>\n Extract and process metals from the earth.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Food: (corp: ICorporation) => (\n <>\n Create your own restaurants all around the world.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: YES\n \n ),\n Tobacco: (corp: ICorporation) => (\n <>\n Create and distribute tobacco and tobacco-related products.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: YES\n \n ),\n Chemical: (corp: ICorporation) => (\n <>\n Produce industrial chemicals.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Pharmaceutical: (corp: ICorporation) => (\n <>\n Discover, develop, and create new pharmaceutical drugs.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Computer: (corp: ICorporation) => (\n <>\n Develop and manufacture new computer hardware and networking infrastructures.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Robotics: (corp: ICorporation) => (\n <>\n Develop and create robots.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n Software: (corp: ICorporation) => (\n <>\n Develop computer software and create AI Cores.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: YES\n \n ),\n Healthcare: (corp: ICorporation) => (\n <>\n Create and manage hospitals.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n RealEstate: (corp: ICorporation) => (\n <>\n Develop and manage real estate properties.\n
\n
\n Starting cost: \n
\n Recommended starting Industry: NO\n \n ),\n};\n\n// Map of available Research for each Industry. This data is held in a\n// ResearchTree object\nexport const IndustryResearchTrees: IIndustryMap = {\n Energy: getBaseResearchTreeCopy(),\n Utilities: getBaseResearchTreeCopy(),\n Agriculture: getBaseResearchTreeCopy(),\n Fishing: getBaseResearchTreeCopy(),\n Mining: getBaseResearchTreeCopy(),\n Food: getProductIndustryResearchTreeCopy(),\n Tobacco: getProductIndustryResearchTreeCopy(),\n Chemical: getBaseResearchTreeCopy(),\n Pharmaceutical: getProductIndustryResearchTreeCopy(),\n Computer: getProductIndustryResearchTreeCopy(),\n Robotics: getProductIndustryResearchTreeCopy(),\n Software: getProductIndustryResearchTreeCopy(),\n Healthcare: getProductIndustryResearchTreeCopy(),\n RealEstate: getProductIndustryResearchTreeCopy(),\n};\n\nexport function resetIndustryResearchTrees(): void {\n IndustryResearchTrees.Energy = getBaseResearchTreeCopy();\n IndustryResearchTrees.Utilities = getBaseResearchTreeCopy();\n IndustryResearchTrees.Agriculture = getBaseResearchTreeCopy();\n IndustryResearchTrees.Fishing = getBaseResearchTreeCopy();\n IndustryResearchTrees.Mining = getBaseResearchTreeCopy();\n IndustryResearchTrees.Food = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Tobacco = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Chemical = getBaseResearchTreeCopy();\n IndustryResearchTrees.Pharmaceutical = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Computer = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Robotics = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Software = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.Healthcare = getProductIndustryResearchTreeCopy();\n IndustryResearchTrees.RealEstate = getProductIndustryResearchTreeCopy();\n}\n","/**\n * Enum defining the different types of possible locations\n */\nexport enum LocationType {\n Company,\n Gym,\n Hospital,\n Slums,\n Special, // This location has special options/activities (e.g. Bladeburner, Re-sleeving)\n StockMarket,\n TechVendor,\n TravelAgency,\n University,\n Casino,\n}\n","import React from \"react\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { CONSTANTS } from \"../Constants\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Money } from \"../ui/React/Money\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { calculateClassEarnings as calculateClassEarningsRate } from \"./formulas/Class\";\nimport { Work, WorkType } from \"./Work\";\nimport { applyWorkStats, newWorkStats, sumWorkStats, WorkStats } from \"./WorkStats\";\n\nexport enum ClassType {\n StudyComputerScience = \"STUDYCOMPUTERSCIENCE\",\n DataStructures = \"DATASTRUCTURES\",\n Networks = \"NETWORKS\",\n Algorithms = \"ALGORITHMS\",\n\n Management = \"MANAGEMENT\",\n Leadership = \"LEADERSHIP\",\n\n GymStrength = \"GYMSTRENGTH\",\n GymDefense = \"GYMDEFENSE\",\n GymDexterity = \"GYMDEXTERITY\",\n GymAgility = \"GYMAGILITY\",\n}\n\nexport interface Class {\n youAreCurrently: string;\n type: ClassType;\n earnings: WorkStats;\n}\n\nexport const Classes: Record = {\n [ClassType.StudyComputerScience]: {\n youAreCurrently: \"studying Computer Science\",\n type: ClassType.StudyComputerScience,\n earnings: newWorkStats({ hackExp: 0.5, intExp: 0.01 }),\n },\n [ClassType.DataStructures]: {\n youAreCurrently: \"taking a Data Structures course\",\n type: ClassType.DataStructures,\n earnings: newWorkStats({\n money: -40,\n hackExp: 1,\n intExp: 0.01,\n }),\n },\n [ClassType.Networks]: {\n youAreCurrently: \"taking a Networks course\",\n type: ClassType.Networks,\n earnings: newWorkStats({\n money: -80,\n hackExp: 2,\n intExp: 0.01,\n }),\n },\n [ClassType.Algorithms]: {\n youAreCurrently: \"taking an Algorithms course\",\n type: ClassType.Algorithms,\n earnings: newWorkStats({\n money: -320,\n hackExp: 4,\n intExp: 0.01,\n }),\n },\n [ClassType.Management]: {\n youAreCurrently: \"taking a Management course\",\n type: ClassType.Management,\n earnings: newWorkStats({\n money: -160,\n chaExp: 2,\n intExp: 0.01,\n }),\n },\n [ClassType.Leadership]: {\n youAreCurrently: \"taking a Leadership course\",\n type: ClassType.Leadership,\n earnings: newWorkStats({\n money: -320,\n chaExp: 4,\n intExp: 0.01,\n }),\n },\n [ClassType.GymStrength]: {\n youAreCurrently: \"training your strength at a gym\",\n type: ClassType.GymStrength,\n earnings: newWorkStats({\n money: -120,\n strExp: 1,\n }),\n },\n [ClassType.GymDefense]: {\n youAreCurrently: \"training your defense at a gym\",\n type: ClassType.GymDefense,\n earnings: newWorkStats({\n money: -120,\n defExp: 1,\n }),\n },\n [ClassType.GymDexterity]: {\n youAreCurrently: \"training your dexterity at a gym\",\n type: ClassType.GymDexterity,\n earnings: newWorkStats({\n money: -120,\n dexExp: 1,\n }),\n },\n [ClassType.GymAgility]: {\n youAreCurrently: \"training your agility at a gym\",\n type: ClassType.GymAgility,\n earnings: newWorkStats({\n money: -120,\n agiExp: 1,\n }),\n },\n};\n\ninterface ClassWorkParams {\n classType: ClassType;\n location: LocationName;\n singularity: boolean;\n}\n\nexport const isClassWork = (w: Work | null): w is ClassWork => w !== null && w.type === WorkType.CLASS;\n\nexport class ClassWork extends Work {\n classType: ClassType;\n location: LocationName;\n earnings = newWorkStats();\n\n constructor(params?: ClassWorkParams) {\n super(WorkType.CLASS, params?.singularity ?? true);\n this.classType = params?.classType ?? ClassType.StudyComputerScience;\n this.location = params?.location ?? LocationName.Sector12RothmanUniversity;\n }\n\n isGym(): boolean {\n return [ClassType.GymAgility, ClassType.GymDefense, ClassType.GymDexterity, ClassType.GymStrength].includes(\n this.classType,\n );\n }\n\n getClass(): Class {\n return Classes[this.classType];\n }\n\n calculateRates(player: IPlayer): WorkStats {\n return calculateClassEarningsRate(player, player, this.classType, this.location);\n }\n\n process(player: IPlayer, cycles: number): boolean {\n this.cyclesWorked += cycles;\n const rate = this.calculateRates(player);\n const earnings = applyWorkStats(player, player, rate, cycles, \"class\");\n this.earnings = sumWorkStats(this.earnings, earnings);\n return false;\n }\n\n finish(): void {\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n After {this.getClass().youAreCurrently} for{\" \"}\n {convertTimeMsToTimeElapsedString(this.cyclesWorked * CONSTANTS._idleSpeed)},
\n you spent a total of .
\n
\n You earned a total of:
\n {numeralWrapper.formatExp(this.earnings.hackExp)} hacking exp
\n {numeralWrapper.formatExp(this.earnings.strExp)} strength exp
\n {numeralWrapper.formatExp(this.earnings.defExp)} defense exp
\n {numeralWrapper.formatExp(this.earnings.dexExp)} dexterity exp
\n {numeralWrapper.formatExp(this.earnings.agiExp)} agility exp
\n {numeralWrapper.formatExp(this.earnings.chaExp)} charisma exp\n
\n ,\n );\n }\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n classType: this.classType,\n location: this.location,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"ClassWork\", this);\n }\n\n /**\n * Initiatizes a ClassWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): ClassWork {\n return Generic_fromJSON(ClassWork, value.data);\n }\n}\n\nReviver.constructors.ClassWork = ClassWork;\n","/**\n * Generic helper/utility functions for the Hacknet mechanic:\n * - Purchase nodes/upgrades\n * - Calculating maximum number of upgrades\n * - Processing Hacknet earnings\n * - Updating Hash Manager capacity\n * - Purchasing hash upgrades\n *\n * TODO Should probably split the different types of functions into their own modules\n */\nimport { HacknetNode } from \"./HacknetNode\";\nimport { calculateNodeCost } from \"./formulas/HacknetNodes\";\nimport { calculateServerCost } from \"./formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"./data/Constants\";\nimport { HacknetServer } from \"./HacknetServer\";\nimport { HashManager } from \"./HashManager\";\nimport { HashUpgrades } from \"./HashUpgrades\";\n\nimport { generateRandomContract } from \"../CodingContractGenerator\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../InteractiveTutorial\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { Server } from \"../Server/Server\";\n\n// Returns a boolean indicating whether the player has Hacknet Servers\n// (the upgraded form of Hacknet Nodes)\nexport function hasHacknetServers(player: IPlayer): boolean {\n return player.bitNodeN === 9 || player.sourceFileLvl(9) > 0;\n}\n\nexport function purchaseHacknet(player: IPlayer): number {\n /* INTERACTIVE TUTORIAL */\n if (ITutorial.isRunning) {\n if (ITutorial.currStep === iTutorialSteps.HacknetNodesIntroduction) {\n iTutorialNextStep();\n } else {\n return -1;\n }\n }\n /* END INTERACTIVE TUTORIAL */\n\n const numOwned = player.hacknetNodes.length;\n if (hasHacknetServers(player)) {\n const cost = getCostOfNextHacknetServer(player);\n if (isNaN(cost)) {\n throw new Error(`Calculated cost of purchasing HacknetServer is NaN`);\n }\n\n if (!player.canAfford(cost) || numOwned >= HacknetServerConstants.MaxServers) {\n return -1;\n }\n player.loseMoney(cost, \"hacknet_expenses\");\n player.createHacknetServer();\n updateHashManagerCapacity(player);\n\n return numOwned;\n } else {\n const cost = getCostOfNextHacknetNode(player);\n if (isNaN(cost)) {\n throw new Error(`Calculated cost of purchasing HacknetNode is NaN`);\n }\n\n if (!player.canAfford(cost)) {\n return -1;\n }\n\n // Auto generate a name for the Node\n const name = \"hacknet-node-\" + numOwned;\n const node = new HacknetNode(name, player.mults.hacknet_node_money);\n\n player.loseMoney(cost, \"hacknet_expenses\");\n player.hacknetNodes.push(node);\n\n return numOwned;\n }\n}\n\nexport function hasMaxNumberHacknetServers(player: IPlayer): boolean {\n return hasHacknetServers(player) && player.hacknetNodes.length >= HacknetServerConstants.MaxServers;\n}\n\nexport function getCostOfNextHacknetNode(player: IPlayer): number {\n return calculateNodeCost(player.hacknetNodes.length + 1, player.mults.hacknet_node_purchase_cost);\n}\n\nexport function getCostOfNextHacknetServer(player: IPlayer): number {\n return calculateServerCost(player.hacknetNodes.length + 1, player.mults.hacknet_node_purchase_cost);\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's level\nexport function getMaxNumberLevelUpgrades(\n player: IPlayer,\n nodeObj: HacknetNode | HacknetServer,\n maxLevel: number,\n): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberLevelUpgrades() called without maxLevel arg`);\n }\n\n if (player.money < nodeObj.calculateLevelUpgradeCost(1, player.mults.hacknet_node_level_cost)) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.level;\n if (player.money > nodeObj.calculateLevelUpgradeCost(levelsToMax, player.mults.hacknet_node_level_cost)) {\n return levelsToMax;\n }\n\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr !== maxLevel &&\n player.money > nodeObj.calculateLevelUpgradeCost(curr, player.mults.hacknet_node_level_cost) &&\n player.money < nodeObj.calculateLevelUpgradeCost(curr + 1, player.mults.hacknet_node_level_cost)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money < nodeObj.calculateLevelUpgradeCost(curr, player.mults.hacknet_node_level_cost)) {\n max = curr - 1;\n } else if (player.money > nodeObj.calculateLevelUpgradeCost(curr, player.mults.hacknet_node_level_cost)) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's RAM\nexport function getMaxNumberRamUpgrades(\n player: IPlayer,\n nodeObj: HacknetNode | HacknetServer,\n maxLevel: number,\n): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberRamUpgrades() called without maxLevel arg`);\n }\n\n if (player.money < nodeObj.calculateRamUpgradeCost(1, player.mults.hacknet_node_ram_cost)) {\n return 0;\n }\n\n let levelsToMax;\n if (nodeObj instanceof HacknetServer) {\n levelsToMax = Math.round(Math.log2(maxLevel / nodeObj.maxRam));\n } else {\n levelsToMax = Math.round(Math.log2(maxLevel / nodeObj.ram));\n }\n if (player.money > nodeObj.calculateRamUpgradeCost(levelsToMax, player.mults.hacknet_node_ram_cost)) {\n return levelsToMax;\n }\n\n //We'll just loop until we find the max\n for (let i = levelsToMax - 1; i >= 0; --i) {\n if (player.money > nodeObj.calculateRamUpgradeCost(i, player.mults.hacknet_node_ram_cost)) {\n return i;\n }\n }\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's cores\nexport function getMaxNumberCoreUpgrades(\n player: IPlayer,\n nodeObj: HacknetNode | HacknetServer,\n maxLevel: number,\n): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberCoreUpgrades() called without maxLevel arg`);\n }\n\n if (player.money < nodeObj.calculateCoreUpgradeCost(1, player.mults.hacknet_node_core_cost)) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.cores;\n if (player.money > nodeObj.calculateCoreUpgradeCost(levelsToMax, player.mults.hacknet_node_core_cost)) {\n return levelsToMax;\n }\n\n // Use a binary search to find the max possible number of upgrades\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr != maxLevel &&\n player.money > nodeObj.calculateCoreUpgradeCost(curr, player.mults.hacknet_node_core_cost) &&\n player.money < nodeObj.calculateCoreUpgradeCost(curr + 1, player.mults.hacknet_node_core_cost)\n ) {\n return Math.min(levelsToMax, curr);\n } else if (player.money < nodeObj.calculateCoreUpgradeCost(curr, player.mults.hacknet_node_core_cost)) {\n max = curr - 1;\n } else if (player.money > nodeObj.calculateCoreUpgradeCost(curr, player.mults.hacknet_node_core_cost)) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n\n return 0;\n}\n\n// Calculate the maximum number of times the Player can afford to upgrade a Hacknet Node's cache\nexport function getMaxNumberCacheUpgrades(player: IPlayer, nodeObj: HacknetServer, maxLevel: number): number {\n if (maxLevel == null) {\n throw new Error(`getMaxNumberCacheUpgrades() called without maxLevel arg`);\n }\n\n if (!player.canAfford(nodeObj.calculateCacheUpgradeCost(1))) {\n return 0;\n }\n\n let min = 1;\n let max = maxLevel - 1;\n const levelsToMax = maxLevel - nodeObj.cache;\n if (player.canAfford(nodeObj.calculateCacheUpgradeCost(levelsToMax))) {\n return levelsToMax;\n }\n\n // Use a binary search to find the max possible number of upgrades\n while (min <= max) {\n const curr = ((min + max) / 2) | 0;\n if (\n curr != maxLevel &&\n player.canAfford(nodeObj.calculateCacheUpgradeCost(curr)) &&\n !player.canAfford(nodeObj.calculateCacheUpgradeCost(curr + 1))\n ) {\n return Math.min(levelsToMax, curr);\n } else if (!player.canAfford(nodeObj.calculateCacheUpgradeCost(curr))) {\n max = curr - 1;\n } else if (player.canAfford(nodeObj.calculateCacheUpgradeCost(curr))) {\n min = curr + 1;\n } else {\n return Math.min(levelsToMax, curr);\n }\n }\n\n return 0;\n}\n\nexport function purchaseLevelUpgrade(player: IPlayer, node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateLevelUpgradeCost(sanitizedLevels, player.mults.hacknet_node_level_cost);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n const isServer = node instanceof HacknetServer;\n\n // If we're at max level, return false\n if (node.level >= (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel)) {\n return false;\n }\n\n // If the number of specified upgrades would exceed the max level, calculate\n // the maximum number of upgrades and use that\n if (node.level + sanitizedLevels > (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel)) {\n const diff = Math.max(0, (isServer ? HacknetServerConstants.MaxLevel : HacknetNodeConstants.MaxLevel) - node.level);\n return purchaseLevelUpgrade(player, node, diff);\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeLevel(sanitizedLevels, player.mults.hacknet_node_money);\n\n return true;\n}\n\nexport function purchaseRamUpgrade(player: IPlayer, node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateRamUpgradeCost(sanitizedLevels, player.mults.hacknet_node_ram_cost);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n if (node instanceof HacknetServer && node.maxRam >= HacknetServerConstants.MaxRam) {\n return false;\n }\n\n if (node instanceof HacknetNode && node.ram >= HacknetNodeConstants.MaxRam) {\n return false;\n }\n\n // If the number of specified upgrades would exceed the max RAM, calculate the\n // max possible number of upgrades and use that\n if (node instanceof HacknetServer) {\n if (node.maxRam * Math.pow(2, sanitizedLevels) > HacknetServerConstants.MaxRam) {\n const diff = Math.max(0, Math.log2(Math.round(HacknetServerConstants.MaxRam / node.maxRam)));\n return purchaseRamUpgrade(player, node, diff);\n }\n } else if (node instanceof HacknetNode) {\n if (node.ram * Math.pow(2, sanitizedLevels) > HacknetNodeConstants.MaxRam) {\n const diff = Math.max(0, Math.log2(Math.round(HacknetNodeConstants.MaxRam / node.ram)));\n return purchaseRamUpgrade(player, node, diff);\n }\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeRam(sanitizedLevels, player.mults.hacknet_node_money);\n\n return true;\n}\n\nexport function purchaseCoreUpgrade(player: IPlayer, node: HacknetNode | HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateCoreUpgradeCost(sanitizedLevels, player.mults.hacknet_node_core_cost);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n const isServer = node instanceof HacknetServer;\n\n // Fail if we're already at max\n if (node.cores >= (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores)) {\n return false;\n }\n\n // If the specified number of upgrades would exceed the max Cores, calculate\n // the max possible number of upgrades and use that\n if (node.cores + sanitizedLevels > (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores)) {\n const diff = Math.max(0, (isServer ? HacknetServerConstants.MaxCores : HacknetNodeConstants.MaxCores) - node.cores);\n return purchaseCoreUpgrade(player, node, diff);\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeCore(sanitizedLevels, player.mults.hacknet_node_money);\n\n return true;\n}\n\nexport function purchaseCacheUpgrade(player: IPlayer, node: HacknetServer, levels = 1): boolean {\n const sanitizedLevels = Math.round(levels);\n const cost = node.calculateCacheUpgradeCost(sanitizedLevels);\n if (isNaN(cost) || cost <= 0 || sanitizedLevels < 0) {\n return false;\n }\n\n if (!(node instanceof HacknetServer)) {\n console.warn(`purchaseCacheUpgrade() called for a non-HacknetNode`);\n return false;\n }\n\n // Fail if we're already at max\n if (node.cache + sanitizedLevels > HacknetServerConstants.MaxCache) {\n const diff = Math.max(0, HacknetServerConstants.MaxCache - node.cache);\n return purchaseCacheUpgrade(player, node, diff);\n }\n\n if (!player.canAfford(cost)) {\n return false;\n }\n\n player.loseMoney(cost, \"hacknet_expenses\");\n node.upgradeCache(sanitizedLevels);\n\n return true;\n}\n\nexport function processHacknetEarnings(player: IPlayer, numCycles: number): number {\n // Determine if player has Hacknet Nodes or Hacknet Servers, then\n // call the appropriate function\n if (player.hacknetNodes.length === 0) {\n return 0;\n }\n if (hasHacknetServers(player)) {\n return processAllHacknetServerEarnings(player, numCycles);\n } else if (player.hacknetNodes[0] instanceof HacknetNode) {\n return processAllHacknetNodeEarnings(player, numCycles);\n } else {\n return 0;\n }\n}\n\nfunction processAllHacknetNodeEarnings(player: IPlayer, numCycles: number): number {\n let total = 0;\n for (let i = 0; i < player.hacknetNodes.length; ++i) {\n const node = player.hacknetNodes[i];\n if (typeof node === \"string\") throw new Error(\"player node should not be ip string\");\n total += processSingleHacknetNodeEarnings(player, numCycles, node);\n }\n\n return total;\n}\n\nfunction processSingleHacknetNodeEarnings(player: IPlayer, numCycles: number, nodeObj: HacknetNode): number {\n const totalEarnings = nodeObj.process(numCycles);\n player.gainMoney(totalEarnings, \"hacknet\");\n\n return totalEarnings;\n}\n\nfunction processAllHacknetServerEarnings(player: IPlayer, numCycles: number): number {\n if (!(player.hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager (should be in 'hashManager' prop)`);\n }\n\n let hashes = 0;\n for (let i = 0; i < player.hacknetNodes.length; ++i) {\n // hacknetNodes array only contains the IP addresses of the servers.\n // Also, update the hash rate before processing\n const ip = player.hacknetNodes[i];\n if (ip instanceof HacknetNode) throw new Error(`player nodes should not be HacketNode`);\n const hserver = GetServer(ip);\n if (!(hserver instanceof HacknetServer)) throw new Error(`player nodes shoud not be Server`);\n hserver.updateHashRate(player.mults.hacknet_node_money);\n const h = hserver.process(numCycles);\n hashes += h;\n }\n\n const wastedHashes = player.hashManager.storeHashes(hashes);\n if (wastedHashes > 0) {\n const upgrade = HashUpgrades[\"Sell for Money\"];\n if (upgrade === null) throw new Error(\"Could not get the hash upgrade\");\n if (!upgrade.cost) throw new Error(\"Upgrade is not properly configured\");\n\n const multiplier = wastedHashes / upgrade.cost;\n if (multiplier > 0) {\n player.gainMoney(upgrade.value * multiplier, \"hacknet\");\n }\n }\n\n return hashes;\n}\n\nexport function updateHashManagerCapacity(player: IPlayer): void {\n if (!(player.hashManager instanceof HashManager)) {\n console.error(`Player does not have a HashManager`);\n return;\n }\n\n const nodes = player.hacknetNodes;\n if (nodes.length === 0) {\n player.hashManager.updateCapacity(0);\n return;\n }\n\n let total = 0;\n for (let i = 0; i < nodes.length; ++i) {\n if (typeof nodes[i] !== \"string\") {\n player.hashManager.updateCapacity(0);\n return;\n }\n const ip = nodes[i];\n if (ip instanceof HacknetNode) throw new Error(`player nodes should be string but isn't`);\n const h = GetServer(ip);\n if (!(h instanceof HacknetServer)) {\n player.hashManager.updateCapacity(0);\n return;\n }\n\n total += h.hashCapacity;\n }\n\n player.hashManager.updateCapacity(total);\n}\n\nexport function purchaseHashUpgrade(player: IPlayer, upgName: string, upgTarget: string, count = 1): boolean {\n if (!(player.hashManager instanceof HashManager)) {\n console.error(`Player does not have a HashManager`);\n return false;\n }\n\n // HashManager handles the transaction. This just needs to actually implement\n // the effects of the upgrade\n if (player.hashManager.upgrade(upgName, count)) {\n const upg = HashUpgrades[upgName];\n\n switch (upgName) {\n case \"Sell for Money\": {\n player.gainMoney(upg.value * count, \"hacknet\");\n break;\n }\n case \"Sell for Corporation Funds\": {\n const corp = player.corporation;\n if (corp === null) {\n player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n corp.funds = corp.funds + upg.value * count;\n break;\n }\n case \"Reduce Minimum Security\": {\n try {\n const target = GetServer(upgTarget);\n if (target == null) {\n console.error(`Invalid target specified in purchaseHashUpgrade(): ${upgTarget}`);\n throw new Error(`'${upgTarget}' is not a server.`);\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n target.changeMinimumSecurity(upg.value ** count, true);\n } catch (e) {\n player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n break;\n }\n case \"Increase Maximum Money\": {\n try {\n const target = GetServer(upgTarget);\n if (target == null) {\n console.error(`Invalid target specified in purchaseHashUpgrade(): ${upgTarget}`);\n throw new Error(`'${upgTarget}' is not a server.`);\n }\n if (!(target instanceof Server)) throw new Error(`'${upgTarget}' is not a normal server.`);\n\n //Manually loop the change so as to properly handle the softcap\n for (let i = 0; i < count; i++) {\n target.changeMaximumMoney(upg.value);\n }\n } catch (e) {\n player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n break;\n }\n case \"Improve Studying\": {\n // Multiplier handled by HashManager\n break;\n }\n case \"Improve Gym Training\": {\n // Multiplier handled by HashManager\n break;\n }\n case \"Exchange for Corporation Research\": {\n // This will throw if player doesn't have a corporation\n const corp = player.corporation;\n if (corp === null) {\n player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n for (const division of corp.divisions) {\n division.sciResearch.qty += upg.value * count;\n }\n break;\n }\n case \"Exchange for Bladeburner Rank\": {\n // This will throw if player isnt in Bladeburner\n const bladeburner = player.bladeburner;\n if (bladeburner === null) {\n player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n bladeburner.changeRank(player, upg.value * count);\n break;\n }\n case \"Exchange for Bladeburner SP\": {\n // This will throw if player isnt in Bladeburner\n const bladeburner = player.bladeburner;\n if (bladeburner === null) {\n player.hashManager.refundUpgrade(upgName, count);\n return false;\n }\n\n bladeburner.skillPoints += upg.value * count;\n break;\n }\n case \"Generate Coding Contract\": {\n for (let i = 0; i < count; i++) {\n generateRandomContract();\n }\n break;\n }\n default:\n console.warn(`Unrecognized upgrade name ${upgName}. Upgrade has no effect`);\n return false;\n }\n\n return true;\n }\n\n return false;\n}\n","import { IPlayer } from \"src/PersonObjects/IPlayer\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\nimport { IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { Industry } from \"./Industry\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Material } from \"./Material\";\nimport { Product } from \"./Product\";\nimport { Warehouse } from \"./Warehouse\";\nimport { CorporationUnlockUpgrade } from \"./data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade } from \"./data/CorporationUpgrades\";\nimport { Cities } from \"../Locations/Cities\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ResearchMap } from \"./ResearchMap\";\nimport { isRelevantMaterial } from \"./ui/Helpers\";\n\nexport function NewIndustry(corporation: ICorporation, industry: string, name: string): void {\n if (corporation.divisions.find(({ type }) => industry == type))\n throw new Error(`You have already expanded into the ${industry} industry!`);\n\n for (let i = 0; i < corporation.divisions.length; ++i) {\n if (corporation.divisions[i].name === name) {\n throw new Error(\"This division name is already in use!\");\n }\n }\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n if (corporation.funds < cost) {\n throw new Error(\"Not enough money to create a new division in this industry\");\n } else if (name === \"\") {\n throw new Error(\"New division must have a name!\");\n } else {\n corporation.funds = corporation.funds - cost;\n corporation.divisions.push(\n new Industry({\n corp: corporation,\n name: name,\n type: industry,\n }),\n );\n }\n}\n\nexport function NewCity(corporation: ICorporation, division: IIndustry, city: string): void {\n if (corporation.funds < CorporationConstants.OfficeInitialCost) {\n throw new Error(\"You don't have enough company funds to open a new office!\");\n }\n if (division.offices[city]) {\n throw new Error(`You have already expanded into ${city} for ${division.name}`);\n }\n corporation.funds = corporation.funds - CorporationConstants.OfficeInitialCost;\n division.offices[city] = new OfficeSpace({\n loc: city,\n size: CorporationConstants.OfficeInitialSize,\n });\n}\n\nexport function UnlockUpgrade(corporation: ICorporation, upgrade: CorporationUnlockUpgrade): void {\n if (corporation.funds < upgrade.price) {\n throw new Error(\"Insufficient funds\");\n }\n if (corporation.unlockUpgrades[upgrade.index] === 1) {\n throw new Error(`You have already unlocked the ${upgrade.name} upgrade!`);\n }\n corporation.unlock(upgrade);\n}\n\nexport function LevelUpgrade(corporation: ICorporation, upgrade: CorporationUpgrade): void {\n const baseCost = upgrade.basePrice;\n const priceMult = upgrade.priceMult;\n const level = corporation.upgrades[upgrade.index];\n const cost = baseCost * Math.pow(priceMult, level);\n if (corporation.funds < cost) {\n throw new Error(\"Insufficient funds\");\n } else {\n corporation.upgrade(upgrade);\n }\n}\n\nexport function IssueDividends(corporation: ICorporation, rate: number): void {\n if (isNaN(rate) || rate < 0 || rate > CorporationConstants.DividendMaxRate) {\n throw new Error(`Invalid value. Must be an number between 0 and ${CorporationConstants.DividendMaxRate}`);\n }\n\n corporation.dividendRate = rate;\n}\n\nexport function SellMaterial(mat: Material, amt: string, price: string): void {\n if (price === \"\") price = \"0\";\n if (amt === \"\") amt = \"0\";\n let cost = price.replace(/\\s+/g, \"\");\n cost = cost.replace(/[^-()\\d/*+.MPe]/g, \"\"); //Sanitize cost\n let temp = cost.replace(/MP/g, mat.bCost + \"\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell price field\");\n }\n\n if (cost.includes(\"MP\")) {\n mat.sCost = cost; //Dynamically evaluated\n } else {\n mat.sCost = temp;\n }\n\n //Parse quantity\n amt = amt.toUpperCase();\n if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n let q = amt.replace(/\\s+/g, \"\");\n q = q.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let tempQty = q.replace(/MAX/g, mat.maxsll.toString());\n tempQty = tempQty.replace(/PROD/g, mat.prd.toString());\n try {\n tempQty = eval(tempQty);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\n\n if (tempQty == null || isNaN(parseFloat(tempQty)) || parseFloat(tempQty) < 0) {\n throw new Error(\"Invalid value or expression for sell quantity field\");\n }\n\n mat.sllman[0] = true;\n mat.sllman[1] = q; //Use sanitized input\n } else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'\");\n } else {\n let q = parseFloat(amt);\n if (isNaN(q)) {\n q = 0;\n }\n if (q === 0) {\n mat.sllman[0] = false;\n mat.sllman[1] = 0;\n } else {\n mat.sllman[0] = true;\n mat.sllman[1] = q;\n }\n }\n}\n\nexport function SellProduct(product: Product, city: string, amt: string, price: string, all: boolean): void {\n //Parse price\n if (price.includes(\"MP\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n //Sanitize input, then replace dynamic variables with arbitrary numbers\n price = price.replace(/\\s+/g, \"\");\n price = price.replace(/[^-()\\d/*+.MP]/g, \"\");\n let temp = price.replace(/MP/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell price field: \" + e);\n }\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell price field.\");\n }\n product.sCost = price; //Use sanitized price\n } else {\n const cost = parseFloat(price);\n if (isNaN(cost)) {\n throw new Error(\"Invalid value for sell price field\");\n }\n product.sCost = cost;\n }\n\n // Array of all cities. Used later\n const cities = Object.keys(Cities);\n\n // Parse quantity\n amt = amt.toUpperCase();\n if (amt.includes(\"MAX\") || amt.includes(\"PROD\")) {\n //Dynamically evaluated quantity. First test to make sure its valid\n let qty = amt.replace(/\\s+/g, \"\");\n qty = qty.replace(/[^-()\\d/*+.MAXPROD]/g, \"\");\n let temp = qty.replace(/MAX/g, product.maxsll.toString());\n temp = temp.replace(/PROD/g, product.data[city][1].toString());\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid value or expression for sell quantity field: \" + e);\n }\n\n if (temp == null || isNaN(parseFloat(temp)) || parseFloat(temp) < 0) {\n throw new Error(\"Invalid value or expression for sell quantity field\");\n }\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty; //Use sanitized input\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty; //Use sanitized input\n }\n } else if (isNaN(parseFloat(amt)) || parseFloat(amt) < 0) {\n throw new Error(\"Invalid value for sell quantity field! Must be numeric or 'PROD' or 'MAX'\");\n } else {\n let qty = parseFloat(amt);\n if (isNaN(qty)) {\n qty = 0;\n }\n if (qty === 0) {\n if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = false;\n product.sllman[tempCity][1] = \"\";\n }\n } else {\n product.sllman[city][0] = false;\n product.sllman[city][1] = \"\";\n }\n } else if (all) {\n for (let i = 0; i < cities.length; ++i) {\n const tempCity = cities[i];\n product.sllman[tempCity][0] = true;\n product.sllman[tempCity][1] = qty;\n }\n } else {\n product.sllman[city][0] = true;\n product.sllman[city][1] = qty;\n }\n }\n}\n\nexport function SetSmartSupply(warehouse: Warehouse, smartSupply: boolean): void {\n warehouse.smartSupplyEnabled = smartSupply;\n}\n\nexport function SetSmartSupplyUseLeftovers(warehouse: Warehouse, material: Material, useLeftover: boolean): void {\n if (!Object.keys(warehouse.smartSupplyUseLeftovers).includes(material.name.replace(/ /g, \"\")))\n throw new Error(`Invalid material '${material.name}'`);\n warehouse.smartSupplyUseLeftovers[material.name.replace(/ /g, \"\")] = useLeftover;\n}\n\nexport function BuyMaterial(material: Material, amt: number): void {\n if (isNaN(amt) || amt < 0) {\n throw new Error(`Invalid amount '${amt}' to buy material '${material.name}'`);\n }\n material.buy = amt;\n}\n\nexport function BulkPurchase(corp: ICorporation, warehouse: Warehouse, material: Material, amt: number): void {\n const matSize = MaterialSizes[material.name];\n const maxAmount = (warehouse.size - warehouse.sizeUsed) / matSize;\n if (isNaN(amt) || amt < 0) {\n throw new Error(`Invalid input amount`);\n }\n if (amt > maxAmount) {\n throw new Error(`You do not have enough warehouse size to fit this purchase`);\n }\n const cost = amt * material.bCost;\n if (corp.funds >= cost) {\n corp.funds = corp.funds - cost;\n material.qty += amt;\n } else {\n throw new Error(`You cannot afford this purchase.`);\n }\n}\n\nexport function SellShares(corporation: ICorporation, player: IPlayer, numShares: number): number {\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of shares\");\n if (numShares > corporation.numShares) throw new Error(\"You don't have that many shares to sell!\");\n if (!corporation.public) throw new Error(\"You haven't gone public!\");\n if (corporation.shareSaleCooldown) throw new Error(\"Share sale on cooldown!\");\n const stockSaleResults = corporation.calculateShareSale(numShares);\n const profit = stockSaleResults[0];\n const newSharePrice = stockSaleResults[1];\n const newSharesUntilUpdate = stockSaleResults[2];\n\n corporation.numShares -= numShares;\n corporation.issuedShares += numShares;\n corporation.sharePrice = newSharePrice;\n corporation.shareSalesUntilPriceUpdate = newSharesUntilUpdate;\n corporation.shareSaleCooldown = CorporationConstants.SellSharesCooldown;\n player.gainMoney(profit, \"corporation\");\n return profit;\n}\n\nexport function BuyBackShares(corporation: ICorporation, player: IPlayer, numShares: number): boolean {\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of shares\");\n if (numShares > corporation.issuedShares) throw new Error(\"You don't have that many shares to buy!\");\n if (!corporation.public) throw new Error(\"You haven't gone public!\");\n const buybackPrice = corporation.sharePrice * 1.1;\n if (player.money < numShares * buybackPrice) throw new Error(\"You cant afford that many shares!\");\n corporation.numShares += numShares;\n corporation.issuedShares -= numShares;\n player.loseMoney(numShares * buybackPrice, \"corporation\");\n return true;\n}\n\nexport function AssignJob(office: OfficeSpace, employeeName: string, job: string): void {\n const employee = office.employees.find((e) => e.name === employeeName);\n\n if (!employee) throw new Error(`Could not find employee '${name}'.`);\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n\n office.assignSingleJob(employee, job);\n}\n\nexport function AutoAssignJob(office: OfficeSpace, job: string, count: number): boolean {\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n\n return office.autoAssignJob(job, count);\n}\n\nexport function UpgradeOfficeSize(corp: ICorporation, office: OfficeSpace, size: number): void {\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const cost = CorporationConstants.OfficeInitialCost * mult;\n if (corp.funds < cost) return;\n office.size += size;\n corp.funds = corp.funds - cost;\n}\n\nexport function BuyCoffee(corp: ICorporation, office: OfficeSpace): boolean {\n const cost = office.getCoffeeCost();\n if (corp.funds < cost) {\n return false;\n }\n\n if (!office.setCoffee()) {\n return false;\n }\n corp.funds -= cost;\n\n return true;\n}\n\nexport function ThrowParty(corp: ICorporation, office: OfficeSpace, costPerEmployee: number): number {\n const mult = 1 + costPerEmployee / 10e6;\n const cost = costPerEmployee * office.employees.length;\n if (corp.funds < cost) {\n return 0;\n }\n\n if (!office.setParty(mult)) {\n return 0;\n }\n corp.funds -= cost;\n\n return mult;\n}\n\nexport function PurchaseWarehouse(corp: ICorporation, division: IIndustry, city: string): void {\n if (corp.funds < CorporationConstants.WarehouseInitialCost) return;\n if (division.warehouses[city] instanceof Warehouse) return;\n division.warehouses[city] = new Warehouse({\n corp: corp,\n industry: division,\n loc: city,\n size: CorporationConstants.WarehouseInitialSize,\n });\n corp.funds = corp.funds - CorporationConstants.WarehouseInitialCost;\n}\n\nexport function UpgradeWarehouseCost(warehouse: Warehouse, amt: number): number {\n return Array.from(Array(amt).keys()).reduce(\n (acc, index) => acc + CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, warehouse.level + 1 + index),\n 0,\n );\n}\n\nexport function UpgradeWarehouse(corp: ICorporation, division: IIndustry, warehouse: Warehouse, amt = 1): void {\n const sizeUpgradeCost = UpgradeWarehouseCost(warehouse, amt);\n if (corp.funds < sizeUpgradeCost) return;\n warehouse.level += amt;\n warehouse.updateSize(corp, division);\n corp.funds = corp.funds - sizeUpgradeCost;\n}\n\nexport function HireAdVert(corp: ICorporation, division: IIndustry): void {\n const cost = division.getAdVertCost();\n if (corp.funds < cost) return;\n corp.funds = corp.funds - cost;\n division.applyAdVert(corp);\n}\n\nexport function MakeProduct(\n corp: ICorporation,\n division: IIndustry,\n city: string,\n productName: string,\n designInvest: number,\n marketingInvest: number,\n): void {\n if (designInvest < 0) {\n designInvest = 0;\n }\n if (marketingInvest < 0) {\n marketingInvest = 0;\n }\n if (productName == null || productName === \"\") {\n throw new Error(\"You must specify a name for your product!\");\n }\n if (!division.makesProducts) {\n throw new Error(\"You cannot create products for this industry!\");\n }\n if (isNaN(designInvest)) {\n throw new Error(\"Invalid value for design investment\");\n }\n if (isNaN(marketingInvest)) {\n throw new Error(\"Invalid value for marketing investment\");\n }\n if (corp.funds < designInvest + marketingInvest) {\n throw new Error(\"You don't have enough company funds to make this large of an investment\");\n }\n let maxProducts = 3;\n if (division.hasResearch(\"uPgrade: Capacity.II\")) {\n maxProducts = 5;\n } else if (division.hasResearch(\"uPgrade: Capacity.I\")) {\n maxProducts = 4;\n }\n const products = division.products;\n if (Object.keys(products).length >= maxProducts) {\n throw new Error(`You are already at the max products (${maxProducts}) for division: ${division.name}!`);\n }\n\n const product = new Product({\n name: productName.replace(/[<>]/g, \"\").trim(), //Sanitize for HTMl elements\n createCity: city,\n designCost: designInvest,\n advCost: marketingInvest,\n });\n if (products[product.name] instanceof Product) {\n throw new Error(`You already have a product with this name!`);\n }\n\n corp.funds = corp.funds - (designInvest + marketingInvest);\n products[product.name] = product;\n}\n\nexport function Research(division: IIndustry, researchName: string): void {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n\n if (division.researched[researchName]) return;\n if (division.sciResearch.qty < research.cost)\n throw new Error(`You do not have enough Scientific Research for ${research.name}`);\n division.sciResearch.qty -= research.cost;\n\n // Get the Node from the Research Tree and set its 'researched' property\n researchTree.research(researchName);\n division.researched[researchName] = true;\n}\n\nexport function ExportMaterial(\n divisionName: string,\n cityName: string,\n material: Material,\n amt: string,\n division?: Industry,\n): void {\n // Sanitize amt\n let sanitizedAmt = amt.replace(/\\s+/g, \"\").toUpperCase();\n sanitizedAmt = sanitizedAmt.replace(/[^-()\\d/*+.MAX]/g, \"\");\n let temp = sanitizedAmt.replace(/MAX/g, \"1\");\n try {\n temp = eval(temp);\n } catch (e) {\n throw new Error(\"Invalid expression entered for export amount: \" + e);\n }\n\n const n = parseFloat(temp);\n\n if (n == null || isNaN(n) || n < 0) {\n throw new Error(\"Invalid amount entered for export\");\n }\n\n if (!division || !isRelevantMaterial(material.name, division)) {\n throw new Error(`You cannot export material: ${material.name} to division: ${divisionName}!`);\n }\n\n const exportObj = { ind: divisionName, city: cityName, amt: sanitizedAmt };\n material.exp.push(exportObj);\n}\n\nexport function CancelExportMaterial(divisionName: string, cityName: string, material: Material, amt: string): void {\n for (let i = 0; i < material.exp.length; ++i) {\n if (material.exp[i].ind !== divisionName || material.exp[i].city !== cityName || material.exp[i].amt !== amt)\n continue;\n material.exp.splice(i, 1);\n break;\n }\n}\n\nexport function LimitProductProduction(product: Product, cityName: string, qty: number): void {\n if (qty < 0 || isNaN(qty)) {\n product.prdman[cityName][0] = false;\n product.prdman[cityName][1] = 0;\n } else {\n product.prdman[cityName][0] = true;\n product.prdman[cityName][1] = qty;\n }\n}\n\nexport function LimitMaterialProduction(material: Material, qty: number): void {\n if (qty < 0 || isNaN(qty)) {\n material.prdman[0] = false;\n material.prdman[1] = 0;\n } else {\n material.prdman[0] = true;\n material.prdman[1] = qty;\n }\n}\n\nexport function SetMaterialMarketTA1(material: Material, on: boolean): void {\n material.marketTa1 = on;\n}\n\nexport function SetMaterialMarketTA2(material: Material, on: boolean): void {\n material.marketTa2 = on;\n}\n\nexport function SetProductMarketTA1(product: Product, on: boolean): void {\n product.marketTa1 = on;\n}\n\nexport function SetProductMarketTA2(product: Product, on: boolean): void {\n product.marketTa2 = on;\n}\n","export enum BlackOperationNames {\n OperationTyphoon = \"Operation Typhoon\",\n OperationZero = \"Operation Zero\",\n OperationX = \"Operation X\",\n OperationTitan = \"Operation Titan\",\n OperationAres = \"Operation Ares\",\n OperationArchangel = \"Operation Archangel\",\n OperationJuggernaut = \"Operation Juggernaut\",\n OperationRedDragon = \"Operation Red Dragon\",\n OperationK = \"Operation K\",\n OperationDeckard = \"Operation Deckard\",\n OperationTyrell = \"Operation Tyrell\",\n OperationWallace = \"Operation Wallace\",\n OperationShoulderOfOrion = \"Operation Shoulder of Orion\",\n OperationHyron = \"Operation Hyron\",\n OperationMorpheus = \"Operation Morpheus\",\n OperationIonStorm = \"Operation Ion Storm\",\n OperationAnnihilus = \"Operation Annihilus\",\n OperationUltron = \"Operation Ultron\",\n OperationCenturion = \"Operation Centurion\",\n OperationVindictus = \"Operation Vindictus\",\n OperationDaedalus = \"Operation Daedalus\",\n}\n","import { IPlayer } from \"../IPlayer\";\nimport { PlayerObject } from \"./PlayerObject\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { PlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CodingContractRewardType, ICodingContractReward } from \"../../CodingContracts\";\nimport { Company } from \"../../Company/Company\";\nimport { Companies } from \"../../Company/Companies\";\nimport { getNextCompanyPositionHelper } from \"../../Company/GetNextCompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Programs } from \"../../Programs/Programs\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { resetGangs } from \"../../Gang/AllGangs\";\nimport { Cities } from \"../../Locations/Cities\";\nimport { Locations } from \"../../Locations/Locations\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { isSleeveCompanyWork } from \"../Sleeve/Work/SleeveCompanyWork\";\nimport {\n calculateSkill as calculateSkillF,\n calculateSkillProgress as calculateSkillProgressF,\n ISkillProgress,\n} from \"../formulas/skill\";\nimport { calculateIntelligenceBonus } from \"../formulas/intelligence\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { safetlyCreateUniqueServer } from \"../../Server/ServerHelpers\";\n\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { applySourceFile } from \"../../SourceFile/applySourceFile\";\nimport { applyExploit } from \"../../Exploits/applyExploits\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { ITaskTracker } from \"../ITaskTracker\";\nimport { IPerson } from \"../IPerson\";\nimport { Player } from \"../../Player\";\n\nimport { isCompanyWork } from \"../../Work/CompanyWork\";\nimport { defaultMultipliers } from \"../Multipliers\";\nimport { serverMetadata } from \"../../Server/data/servers\";\n\nexport function init(this: IPlayer): void {\n /* Initialize Player's home computer */\n const t_homeComp = safetlyCreateUniqueServer({\n adminRights: true,\n hostname: \"home\",\n ip: createUniqueRandomIp(),\n isConnectedTo: true,\n maxRam: 8,\n organizationName: \"Home PC\",\n purchasedByPlayer: true,\n });\n this.currentServer = SpecialServers.Home;\n AddToAllServers(t_homeComp);\n\n this.getHomeComputer().programs.push(Programs.NukeProgram.name);\n}\n\nexport function prestigeAugmentation(this: PlayerObject): void {\n this.currentServer = SpecialServers.Home;\n\n this.numPeopleKilled = 0;\n\n //Reset stats\n this.skills.hacking = 1;\n\n this.skills.strength = 1;\n this.skills.defense = 1;\n this.skills.dexterity = 1;\n this.skills.agility = 1;\n\n this.skills.charisma = 1;\n\n this.exp.hacking = 0;\n this.exp.strength = 0;\n this.exp.defense = 0;\n this.exp.dexterity = 0;\n this.exp.agility = 0;\n this.exp.charisma = 0;\n\n this.money = 1000 + CONSTANTS.Donations;\n\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n this.jobs = {};\n\n this.purchasedServers = [];\n\n this.factions = [];\n this.factionInvitations = [];\n\n this.queuedAugmentations = [];\n\n const numSleeves = Math.min(3, this.sourceFileLvl(10) + (this.bitNodeN === 10 ? 1 : 0)) + this.sleevesFromCovenant;\n if (this.sleeves.length > numSleeves) this.sleeves.length = numSleeves;\n for (let i = this.sleeves.length; i < numSleeves; i++) {\n this.sleeves.push(new Sleeve(this));\n }\n\n for (let i = 0; i < this.sleeves.length; ++i) {\n if (this.sleeves[i] instanceof Sleeve) {\n if (this.sleeves[i].shock >= 100) {\n this.sleeves[i].synchronize(this);\n } else {\n this.sleeves[i].shockRecovery(this);\n }\n }\n }\n\n this.lastUpdate = new Date().getTime();\n\n // Statistics Trackers\n this.playtimeSinceLastAug = 0;\n this.scriptProdSinceLastAug = 0;\n this.moneySourceA.reset();\n\n this.hacknetNodes.length = 0;\n this.hashManager.prestige();\n\n // Reapply augs, re-calculate skills and reset HP\n this.reapplyAllAugmentations(true);\n this.hp.current = this.hp.max;\n\n this.finishWork(true);\n}\n\nexport function prestigeSourceFile(this: IPlayer): void {\n this.entropy = 0;\n this.prestigeAugmentation();\n this.karma = 0;\n // Duplicate sleeves are reset to level 1 every Bit Node (but the number of sleeves you have persists)\n for (let i = 0; i < this.sleeves.length; ++i) {\n if (this.sleeves[i] instanceof Sleeve) {\n this.sleeves[i].prestige(this);\n } else {\n this.sleeves[i] = new Sleeve(this);\n }\n }\n\n if (this.bitNodeN === 10) {\n for (let i = 0; i < this.sleeves.length; i++) {\n this.sleeves[i].shock = Math.max(25, this.sleeves[i].shock);\n this.sleeves[i].sync = Math.max(25, this.sleeves[i].sync);\n }\n }\n\n // Gang\n this.gang = null;\n resetGangs();\n\n // Reset Stock market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n // BitNode 3: Corporatocracy\n this.corporation = null;\n\n this.moneySourceB.reset();\n this.playtimeSinceLastBitnode = 0;\n this.augmentations = [];\n}\n\nexport function receiveInvite(this: IPlayer, factionName: string): void {\n if (this.factionInvitations.includes(factionName) || this.factions.includes(factionName)) {\n return;\n }\n this.factionInvitations.push(factionName);\n}\n\n//Calculates skill level based on experience. The same formula will be used for every skill\nexport function calculateSkill(this: IPerson, exp: number, mult = 1): number {\n return calculateSkillF(exp, mult);\n}\n\n//Calculates skill level progress based on experience. The same formula will be used for every skill\nexport function calculateSkillProgress(this: IPlayer, exp: number, mult = 1): ISkillProgress {\n return calculateSkillProgressF(exp, mult);\n}\n\nexport function updateSkillLevels(this: IPlayer): void {\n this.skills.hacking = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.exp.hacking, this.mults.hacking * BitNodeMultipliers.HackingLevelMultiplier)),\n );\n this.skills.strength = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.exp.strength, this.mults.strength * BitNodeMultipliers.StrengthLevelMultiplier),\n ),\n );\n this.skills.defense = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.exp.defense, this.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier)),\n );\n this.skills.dexterity = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.exp.dexterity, this.mults.dexterity * BitNodeMultipliers.DexterityLevelMultiplier),\n ),\n );\n this.skills.agility = Math.max(\n 1,\n Math.floor(this.calculateSkill(this.exp.agility, this.mults.agility * BitNodeMultipliers.AgilityLevelMultiplier)),\n );\n this.skills.charisma = Math.max(\n 1,\n Math.floor(\n this.calculateSkill(this.exp.charisma, this.mults.charisma * BitNodeMultipliers.CharismaLevelMultiplier),\n ),\n );\n\n if (this.skills.intelligence > 0) {\n this.skills.intelligence = Math.floor(this.calculateSkill(this.exp.intelligence));\n } else {\n this.skills.intelligence = 0;\n }\n\n const ratio = this.hp.current / this.hp.max;\n this.hp.max = Math.floor(10 + this.skills.defense / 10);\n this.hp.current = Math.round(this.hp.max * ratio);\n}\n\nexport function resetMultipliers(this: IPlayer): void {\n this.mults = defaultMultipliers();\n}\n\nexport function hasProgram(this: IPlayer, programName: string): boolean {\n const home = this.getHomeComputer();\n if (home == null) {\n return false;\n }\n\n for (let i = 0; i < home.programs.length; ++i) {\n if (programName.toLowerCase() == home.programs[i].toLowerCase()) {\n return true;\n }\n }\n return false;\n}\n\nexport function setMoney(this: PlayerObject, money: number): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.setMoney()\");\n return;\n }\n this.money = money;\n}\n\nexport function gainMoney(this: PlayerObject, money: number, source: string): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.gainMoney()\");\n return;\n }\n\n this.money = this.money + money;\n this.recordMoneySource(money, source);\n}\n\nexport function loseMoney(this: PlayerObject, money: number, source: string): void {\n if (isNaN(money)) {\n console.error(\"NaN passed into Player.loseMoney()\");\n return;\n }\n if (this.money === Infinity && money === Infinity) return;\n this.money = this.money - money;\n this.recordMoneySource(-1 * money, source);\n}\n\nexport function canAfford(this: IPlayer, cost: number): boolean {\n if (isNaN(cost)) {\n console.error(`NaN passed into Player.canAfford()`);\n return false;\n }\n return this.money >= cost;\n}\n\nexport function recordMoneySource(this: PlayerObject, amt: number, source: string): void {\n if (!(this.moneySourceA instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceA was not properly initialized. Resetting`);\n this.moneySourceA = new MoneySourceTracker();\n }\n if (!(this.moneySourceB instanceof MoneySourceTracker)) {\n console.warn(`Player.moneySourceB was not properly initialized. Resetting`);\n this.moneySourceB = new MoneySourceTracker();\n }\n this.moneySourceA.record(amt, source);\n this.moneySourceB.record(amt, source);\n}\n\nexport function gainHackingExp(this: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainHackingExp()\");\n return;\n }\n this.exp.hacking += exp;\n if (this.exp.hacking < 0) {\n this.exp.hacking = 0;\n }\n\n this.skills.hacking = calculateSkillF(\n this.exp.hacking,\n this.mults.hacking * BitNodeMultipliers.HackingLevelMultiplier,\n );\n}\n\nexport function gainStrengthExp(this: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainStrengthExp()\");\n return;\n }\n this.exp.strength += exp;\n if (this.exp.strength < 0) {\n this.exp.strength = 0;\n }\n\n this.skills.strength = calculateSkillF(\n this.exp.strength,\n this.mults.strength * BitNodeMultipliers.StrengthLevelMultiplier,\n );\n}\n\nexport function gainDefenseExp(this: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into player.gainDefenseExp()\");\n return;\n }\n this.exp.defense += exp;\n if (this.exp.defense < 0) {\n this.exp.defense = 0;\n }\n\n this.skills.defense = calculateSkillF(\n this.exp.defense,\n this.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier,\n );\n const ratio = this.hp.current / this.hp.max;\n this.hp.max = Math.floor(10 + this.skills.defense / 10);\n this.hp.current = Math.round(this.hp.max * ratio);\n}\n\nexport function gainDexterityExp(this: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainDexterityExp()\");\n return;\n }\n this.exp.dexterity += exp;\n if (this.exp.dexterity < 0) {\n this.exp.dexterity = 0;\n }\n\n this.skills.dexterity = calculateSkillF(\n this.exp.dexterity,\n this.mults.dexterity * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n}\n\nexport function gainAgilityExp(this: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainAgilityExp()\");\n return;\n }\n this.exp.agility += exp;\n if (this.exp.agility < 0) {\n this.exp.agility = 0;\n }\n\n this.skills.agility = calculateSkillF(\n this.exp.agility,\n this.mults.agility * BitNodeMultipliers.AgilityLevelMultiplier,\n );\n}\n\nexport function gainCharismaExp(this: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERR: NaN passed into Player.gainCharismaExp()\");\n return;\n }\n this.exp.charisma += exp;\n if (this.exp.charisma < 0) {\n this.exp.charisma = 0;\n }\n\n this.skills.charisma = calculateSkillF(\n this.exp.charisma,\n this.mults.charisma * BitNodeMultipliers.CharismaLevelMultiplier,\n );\n}\n\nexport function gainIntelligenceExp(this: IPerson, exp: number): void {\n if (isNaN(exp)) {\n console.error(\"ERROR: NaN passed into Player.gainIntelligenceExp()\");\n return;\n }\n if (Player.sourceFileLvl(5) > 0 || this.skills.intelligence > 0 || Player.bitNodeN === 5) {\n this.exp.intelligence += exp;\n this.skills.intelligence = Math.floor(this.calculateSkill(this.exp.intelligence, 1));\n }\n}\n\nexport function gainStats(this: IPerson, retValue: ITaskTracker): void {\n this.gainHackingExp(retValue.hack * this.mults.hacking_exp);\n this.gainStrengthExp(retValue.str * this.mults.strength_exp);\n this.gainDefenseExp(retValue.def * this.mults.defense_exp);\n this.gainDexterityExp(retValue.dex * this.mults.dexterity_exp);\n this.gainAgilityExp(retValue.agi * this.mults.agility_exp);\n this.gainCharismaExp(retValue.cha * this.mults.charisma_exp);\n this.gainIntelligenceExp(retValue.int);\n}\n\n//Given a string expression like \"str\" or \"strength\", returns the given stat\nexport function queryStatFromString(this: IPlayer, str: string): number {\n const tempStr = str.toLowerCase();\n if (tempStr.includes(\"hack\")) {\n return this.skills.hacking;\n }\n if (tempStr.includes(\"str\")) {\n return this.skills.strength;\n }\n if (tempStr.includes(\"def\")) {\n return this.skills.defense;\n }\n if (tempStr.includes(\"dex\")) {\n return this.skills.dexterity;\n }\n if (tempStr.includes(\"agi\")) {\n return this.skills.agility;\n }\n if (tempStr.includes(\"cha\")) {\n return this.skills.charisma;\n }\n if (tempStr.includes(\"int\")) {\n return this.skills.intelligence;\n }\n return 0;\n}\n\nexport function startFocusing(this: IPlayer): void {\n this.focus = true;\n}\n\nexport function stopFocusing(this: IPlayer): void {\n this.focus = false;\n}\n\n// Returns true if hospitalized, false otherwise\nexport function takeDamage(this: IPlayer, amt: number): boolean {\n if (typeof amt !== \"number\") {\n console.warn(`Player.takeDamage() called without a numeric argument: ${amt}`);\n return false;\n }\n\n this.hp.current -= amt;\n if (this.hp.current <= 0) {\n this.hospitalize();\n return true;\n } else {\n return false;\n }\n}\n\nexport function regenerateHp(this: IPerson, amt: number): void {\n if (typeof amt !== \"number\") {\n console.warn(`Player.regenerateHp() called without a numeric argument: ${amt}`);\n return;\n }\n this.hp.current += amt;\n if (this.hp.current > this.hp.max) {\n this.hp.current = this.hp.max;\n }\n}\n\nexport function hospitalize(this: IPlayer): number {\n const cost = getHospitalizationCost(this);\n SnackbarEvents.emit(`You've been Hospitalized for ${numeralWrapper.formatMoney(cost)}`, ToastVariant.WARNING, 2000);\n\n this.loseMoney(cost, \"hospitalization\");\n this.hp.current = this.hp.max;\n return cost;\n}\n\n/********* Company job application **********/\n//Determines the job that the Player should get (if any) at the current company\n//The 'sing' argument designates whether or not this is being called from\n//the applyToCompany() Netscript Singularity function\nexport function applyForJob(this: IPlayer, entryPosType: CompanyPosition, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (!(company instanceof Company)) {\n console.error(`Could not find company that matches the location: ${this.location}. Player.applyToCompany() failed`);\n return false;\n }\n\n let pos = entryPosType;\n\n if (!this.isQualified(company, pos)) {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position
\" + getJobRequirementText(company, pos));\n }\n return false;\n }\n\n if (!company.hasPosition(pos)) {\n console.error(`Company ${company.name} does not have position ${pos}. Player.applyToCompany() failed`);\n return false;\n }\n\n while (true) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null) break;\n if (company.hasPosition(nextPos) && this.isQualified(company, nextPos)) {\n pos = nextPos;\n } else break;\n }\n\n //Check if player already has the assigned job\n if (this.jobs[company.name] === pos.name) {\n if (!sing) {\n const nextPos = getNextCompanyPositionHelper(pos);\n if (nextPos == null || !company.hasPosition(nextPos)) {\n dialogBoxCreate(\"You are already at the highest position for your field! No promotion available\");\n } else {\n const reqText = getJobRequirementText(company, nextPos);\n dialogBoxCreate(\"Unfortunately, you do not qualify for a promotion
\" + reqText);\n }\n }\n return false;\n }\n\n this.jobs[company.name] = pos.name;\n\n if (!sing) {\n dialogBoxCreate(\"Congratulations! You were offered a new job at \" + company.name + \" as a \" + pos.name + \"!\");\n }\n return true;\n}\n\n//Returns your next position at a company given the field (software, business, etc.)\nexport function getNextCompanyPosition(\n this: IPlayer,\n company: Company,\n entryPosType: CompanyPosition,\n): CompanyPosition | null {\n const currCompany = Companies[company.name];\n\n //Not employed at this company, so return the entry position\n if (currCompany == null || currCompany.name != company.name) {\n return entryPosType;\n }\n\n //If the entry pos type and the player's current position have the same type,\n //return the player's \"nextCompanyPosition\". Otherwise return the entryposType\n //Employed at this company, so just return the next position if it exists.\n const currentPositionName = this.jobs[company.name];\n if (!currentPositionName) return entryPosType;\n const currentPosition = CompanyPositions[currentPositionName];\n if (\n (currentPosition.isSoftwareJob() && entryPosType.isSoftwareJob()) ||\n (currentPosition.isITJob() && entryPosType.isITJob()) ||\n (currentPosition.isBusinessJob() && entryPosType.isBusinessJob()) ||\n (currentPosition.isSecurityEngineerJob() && entryPosType.isSecurityEngineerJob()) ||\n (currentPosition.isNetworkEngineerJob() && entryPosType.isNetworkEngineerJob()) ||\n (currentPosition.isSecurityJob() && entryPosType.isSecurityJob()) ||\n (currentPosition.isAgentJob() && entryPosType.isAgentJob()) ||\n (currentPosition.isSoftwareConsultantJob() && entryPosType.isSoftwareConsultantJob()) ||\n (currentPosition.isBusinessConsultantJob() && entryPosType.isBusinessConsultantJob()) ||\n (currentPosition.isPartTimeJob() && entryPosType.isPartTimeJob())\n ) {\n return getNextCompanyPositionHelper(currentPosition);\n }\n\n return entryPosType;\n}\n\nexport function quitJob(this: IPlayer, company: string): void {\n if (isCompanyWork(this.currentWork) && this.currentWork.companyName === company) {\n this.finishWork(true);\n }\n for (const sleeve of this.sleeves) {\n if (isSleeveCompanyWork(sleeve.currentWork) && sleeve.currentWork.companyName === company) {\n sleeve.stopWork(this);\n dialogBoxCreate(`You quit ${company} while one of your sleeves was working there. The sleeve is now idle.`);\n }\n }\n delete this.jobs[company];\n}\n\n/**\n * Method to see if the player has at least one job assigned to them\n * @param this The player instance\n * @returns Whether the user has at least one job\n */\nexport function hasJob(this: IPlayer): boolean {\n return Boolean(Object.keys(this.jobs).length);\n}\n\nexport function applyForSoftwareJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareCompanyPositions[0]], sing);\n}\n\nexport function applyForSoftwareConsultantJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.SoftwareConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForItJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.ITCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityEngineerJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]])) {\n return this.applyForJob(CompanyPositions[posNames.SecurityEngineerCompanyPositions[0]], sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForNetworkEngineerJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.NetworkEngineerCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForBusinessJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessCompanyPositions[0]], sing);\n}\n\nexport function applyForBusinessConsultantJob(this: IPlayer, sing = false): boolean {\n return this.applyForJob(CompanyPositions[posNames.BusinessConsultantCompanyPositions[0]], sing);\n}\n\nexport function applyForSecurityJob(this: IPlayer, sing = false): boolean {\n // TODO Police Jobs\n // Indexing starts at 2 because 0 is for police officer\n return this.applyForJob(CompanyPositions[posNames.SecurityCompanyPositions[2]], sing);\n}\n\nexport function applyForAgentJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n if (this.isQualified(company, CompanyPositions[posNames.AgentCompanyPositions[0]])) {\n const pos = CompanyPositions[posNames.AgentCompanyPositions[0]];\n return this.applyForJob(pos, sing);\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForEmployeeJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.MiscCompanyPositions[1];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed at \" + this.location);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForPartTimeEmployeeJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.PartTimeCompanyPositions[1];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed part-time at \" + this.location);\n }\n\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n\n return false;\n }\n}\n\nexport function applyForWaiterJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.MiscCompanyPositions[0];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a waiter at \" + this.location);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\nexport function applyForPartTimeWaiterJob(this: IPlayer, sing = false): boolean {\n const company = Companies[this.location]; //Company being applied to\n const position = posNames.PartTimeCompanyPositions[0];\n // Check if this company has the position\n if (!company.hasPosition(position)) {\n return false;\n }\n if (this.isQualified(company, CompanyPositions[position])) {\n this.jobs[company.name] = position;\n if (!sing) {\n dialogBoxCreate(\"Congratulations, you are now employed as a part-time waiter at \" + this.location);\n }\n return true;\n } else {\n if (!sing) {\n dialogBoxCreate(\"Unfortunately, you do not qualify for this position\");\n }\n return false;\n }\n}\n\n//Checks if the Player is qualified for a certain position\nexport function isQualified(this: IPlayer, company: Company, position: CompanyPosition): boolean {\n const offset = company.jobStatReqOffset;\n const reqHacking = position.requiredHacking > 0 ? position.requiredHacking + offset : 0;\n const reqStrength = position.requiredStrength > 0 ? position.requiredStrength + offset : 0;\n const reqDefense = position.requiredDefense > 0 ? position.requiredDefense + offset : 0;\n const reqDexterity = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqAgility = position.requiredDexterity > 0 ? position.requiredDexterity + offset : 0;\n const reqCharisma = position.requiredCharisma > 0 ? position.requiredCharisma + offset : 0;\n\n return (\n this.skills.hacking >= reqHacking &&\n this.skills.strength >= reqStrength &&\n this.skills.defense >= reqDefense &&\n this.skills.dexterity >= reqDexterity &&\n this.skills.agility >= reqAgility &&\n this.skills.charisma >= reqCharisma &&\n company.playerReputation >= position.requiredReputation\n );\n}\n\n/********** Reapplying Augmentations and Source File ***********/\nexport function reapplyAllAugmentations(this: IPlayer, resetMultipliers = true): void {\n if (resetMultipliers) {\n this.resetMultipliers();\n }\n\n for (let i = 0; i < this.augmentations.length; ++i) {\n //Compatibility with new version\n if (this.augmentations[i].name === \"HacknetNode NIC Architecture Neural-Upload\") {\n this.augmentations[i].name = \"Hacknet Node NIC Architecture Neural-Upload\";\n }\n\n const playerAug = this.augmentations[i];\n const augName = playerAug.name;\n\n if (augName == AugmentationNames.NeuroFluxGovernor) {\n for (let j = 0; j < playerAug.level; ++j) {\n applyAugmentation(this.augmentations[i], true);\n }\n continue;\n }\n applyAugmentation(this.augmentations[i], true);\n }\n\n this.updateSkillLevels();\n}\n\nexport function reapplyAllSourceFiles(this: IPlayer): void {\n //Will always be called after reapplyAllAugmentations() so multipliers do not have to be reset\n //this.resetMultipliers();\n\n for (let i = 0; i < this.sourceFiles.length; ++i) {\n const srcFileKey = \"SourceFile\" + this.sourceFiles[i].n;\n const sourceFileObject = SourceFiles[srcFileKey];\n if (sourceFileObject == null) {\n console.error(`Invalid source file number: ${this.sourceFiles[i].n}`);\n continue;\n }\n applySourceFile(this.sourceFiles[i]);\n }\n applyExploit();\n this.updateSkillLevels();\n}\n\n/*************** Check for Faction Invitations *************/\n//This function sets the requirements to join a Faction. It checks whether the Player meets\n//those requirements and will return an array of all factions that the Player should\n//receive an invitation to\nexport function checkForFactionInvitations(this: IPlayer): Faction[] {\n const invitedFactions: Faction[] = []; //Array which will hold all Factions the player should be invited to\n\n const numAugmentations = this.augmentations.length;\n\n const allCompanies = Object.keys(this.jobs);\n const allPositions = Object.values(this.jobs);\n\n // Given a company name, safely returns the reputation (returns 0 if invalid company is specified)\n function getCompanyRep(companyName: string): number {\n const company = Companies[companyName];\n if (company == null) {\n return 0;\n } else {\n return company.playerReputation;\n }\n }\n\n // Helper function that returns a boolean indicating whether the Player meets\n // the requirements for the specified company. There are two requirements:\n // 1. High enough reputation\n // 2. Player is employed at the company\n function checkMegacorpRequirements(companyName: string): boolean {\n const serverMeta = serverMetadata.find((s) => s.specialName === companyName);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n const bonus = (server as Server).backdoorInstalled ? -100e3 : 0;\n return (\n allCompanies.includes(companyName) && getCompanyRep(companyName) > CONSTANTS.CorpFactionRepRequirement + bonus\n );\n }\n\n //Illuminati\n const illuminatiFac = Factions[FactionNames.Illuminati];\n if (\n !illuminatiFac.isBanned &&\n !illuminatiFac.isMember &&\n !illuminatiFac.alreadyInvited &&\n numAugmentations >= 30 &&\n this.money >= 150000000000 &&\n this.skills.hacking >= 1500 &&\n this.skills.strength >= 1200 &&\n this.skills.defense >= 1200 &&\n this.skills.dexterity >= 1200 &&\n this.skills.agility >= 1200\n ) {\n invitedFactions.push(illuminatiFac);\n }\n\n //Daedalus\n const daedalusFac = Factions[FactionNames.Daedalus];\n if (\n !daedalusFac.isBanned &&\n !daedalusFac.isMember &&\n !daedalusFac.alreadyInvited &&\n numAugmentations >= BitNodeMultipliers.DaedalusAugsRequirement &&\n this.money >= 100000000000 &&\n (this.skills.hacking >= 2500 ||\n (this.skills.strength >= 1500 &&\n this.skills.defense >= 1500 &&\n this.skills.dexterity >= 1500 &&\n this.skills.agility >= 1500))\n ) {\n invitedFactions.push(daedalusFac);\n }\n\n //The Covenant\n const covenantFac = Factions[FactionNames.TheCovenant];\n if (\n !covenantFac.isBanned &&\n !covenantFac.isMember &&\n !covenantFac.alreadyInvited &&\n numAugmentations >= 20 &&\n this.money >= 75000000000 &&\n this.skills.hacking >= 850 &&\n this.skills.strength >= 850 &&\n this.skills.defense >= 850 &&\n this.skills.dexterity >= 850 &&\n this.skills.agility >= 850\n ) {\n invitedFactions.push(covenantFac);\n }\n\n //ECorp\n const ecorpFac = Factions[FactionNames.ECorp];\n if (\n !ecorpFac.isBanned &&\n !ecorpFac.isMember &&\n !ecorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumECorp)\n ) {\n invitedFactions.push(ecorpFac);\n }\n\n //MegaCorp\n const megacorpFac = Factions[FactionNames.MegaCorp];\n if (\n !megacorpFac.isBanned &&\n !megacorpFac.isMember &&\n !megacorpFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12MegaCorp)\n ) {\n invitedFactions.push(megacorpFac);\n }\n\n //Bachman & Associates\n const bachmanandassociatesFac = Factions[FactionNames.BachmanAssociates];\n if (\n !bachmanandassociatesFac.isBanned &&\n !bachmanandassociatesFac.isMember &&\n !bachmanandassociatesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumBachmanAndAssociates)\n ) {\n invitedFactions.push(bachmanandassociatesFac);\n }\n\n //Blade Industries\n const bladeindustriesFac = Factions[FactionNames.BladeIndustries];\n if (\n !bladeindustriesFac.isBanned &&\n !bladeindustriesFac.isMember &&\n !bladeindustriesFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12BladeIndustries)\n ) {\n invitedFactions.push(bladeindustriesFac);\n }\n\n //NWO\n const nwoFac = Factions[FactionNames.NWO];\n if (\n !nwoFac.isBanned &&\n !nwoFac.isMember &&\n !nwoFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenNWO)\n ) {\n invitedFactions.push(nwoFac);\n }\n\n //Clarke Incorporated\n const clarkeincorporatedFac = Factions[FactionNames.ClarkeIncorporated];\n if (\n !clarkeincorporatedFac.isBanned &&\n !clarkeincorporatedFac.isMember &&\n !clarkeincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.AevumClarkeIncorporated)\n ) {\n invitedFactions.push(clarkeincorporatedFac);\n }\n\n //OmniTek Incorporated\n const omnitekincorporatedFac = Factions[FactionNames.OmniTekIncorporated];\n if (\n !omnitekincorporatedFac.isBanned &&\n !omnitekincorporatedFac.isMember &&\n !omnitekincorporatedFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.VolhavenOmniTekIncorporated)\n ) {\n invitedFactions.push(omnitekincorporatedFac);\n }\n\n //Four Sigma\n const foursigmaFac = Factions[FactionNames.FourSigma];\n if (\n !foursigmaFac.isBanned &&\n !foursigmaFac.isMember &&\n !foursigmaFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.Sector12FourSigma)\n ) {\n invitedFactions.push(foursigmaFac);\n }\n\n //KuaiGong International\n const kuaigonginternationalFac = Factions[FactionNames.KuaiGongInternational];\n if (\n !kuaigonginternationalFac.isBanned &&\n !kuaigonginternationalFac.isMember &&\n !kuaigonginternationalFac.alreadyInvited &&\n checkMegacorpRequirements(LocationName.ChongqingKuaiGongInternational)\n ) {\n invitedFactions.push(kuaigonginternationalFac);\n }\n\n //Fulcrum Secret Technologies - If u've unlocked fulcrum secret technolgoies server and have a high rep with the company\n const fulcrumsecrettechonologiesFac = Factions[FactionNames.FulcrumSecretTechnologies];\n const fulcrumSecretServer = GetServer(SpecialServers.FulcrumSecretTechnologies);\n if (!(fulcrumSecretServer instanceof Server))\n throw new Error(`${FactionNames.FulcrumSecretTechnologies} should be normal server`);\n if (fulcrumSecretServer == null) {\n console.error(`Could not find ${FactionNames.FulcrumSecretTechnologies} Server`);\n } else if (\n !fulcrumsecrettechonologiesFac.isBanned &&\n !fulcrumsecrettechonologiesFac.isMember &&\n !fulcrumsecrettechonologiesFac.alreadyInvited &&\n fulcrumSecretServer.backdoorInstalled &&\n checkMegacorpRequirements(LocationName.AevumFulcrumTechnologies)\n ) {\n invitedFactions.push(fulcrumsecrettechonologiesFac);\n }\n\n //BitRunners\n const bitrunnersFac = Factions[FactionNames.BitRunners];\n const bitrunnersServer = GetServer(SpecialServers.BitRunnersServer);\n if (!(bitrunnersServer instanceof Server)) throw new Error(`${FactionNames.BitRunners} should be normal server`);\n if (bitrunnersServer == null) {\n console.error(`Could not find ${FactionNames.BitRunners} Server`);\n } else if (\n !bitrunnersFac.isBanned &&\n !bitrunnersFac.isMember &&\n bitrunnersServer.backdoorInstalled &&\n !bitrunnersFac.alreadyInvited\n ) {\n invitedFactions.push(bitrunnersFac);\n }\n\n //The Black Hand\n\n const theblackhandFac = Factions[FactionNames.TheBlackHand];\n const blackhandServer = GetServer(SpecialServers.TheBlackHandServer);\n if (!(blackhandServer instanceof Server)) throw new Error(`${FactionNames.TheBlackHand} should be normal server`);\n if (blackhandServer == null) {\n console.error(`Could not find ${FactionNames.TheBlackHand} Server`);\n } else if (\n !theblackhandFac.isBanned &&\n !theblackhandFac.isMember &&\n blackhandServer.backdoorInstalled &&\n !theblackhandFac.alreadyInvited\n ) {\n invitedFactions.push(theblackhandFac);\n }\n\n //NiteSec\n const nitesecFac = Factions[FactionNames.NiteSec];\n const nitesecServer = GetServer(SpecialServers.NiteSecServer);\n if (!(nitesecServer instanceof Server)) throw new Error(`${FactionNames.NiteSec} should be normal server`);\n if (nitesecServer == null) {\n console.error(`Could not find ${FactionNames.NiteSec} Server`);\n } else if (\n !nitesecFac.isBanned &&\n !nitesecFac.isMember &&\n nitesecServer.backdoorInstalled &&\n !nitesecFac.alreadyInvited\n ) {\n invitedFactions.push(nitesecFac);\n }\n\n //Chongqing\n const chongqingFac = Factions[FactionNames.Chongqing];\n if (\n !chongqingFac.isBanned &&\n !chongqingFac.isMember &&\n !chongqingFac.alreadyInvited &&\n this.money >= 20000000 &&\n this.city == CityName.Chongqing\n ) {\n invitedFactions.push(chongqingFac);\n }\n\n //Sector-12\n const sector12Fac = Factions[FactionNames.Sector12];\n if (\n !sector12Fac.isBanned &&\n !sector12Fac.isMember &&\n !sector12Fac.alreadyInvited &&\n this.money >= 15000000 &&\n this.city == CityName.Sector12\n ) {\n invitedFactions.push(sector12Fac);\n }\n\n //New Tokyo\n const newtokyoFac = Factions[FactionNames.NewTokyo];\n if (\n !newtokyoFac.isBanned &&\n !newtokyoFac.isMember &&\n !newtokyoFac.alreadyInvited &&\n this.money >= 20000000 &&\n this.city == CityName.NewTokyo\n ) {\n invitedFactions.push(newtokyoFac);\n }\n\n //Aevum\n const aevumFac = Factions[FactionNames.Aevum];\n if (\n !aevumFac.isBanned &&\n !aevumFac.isMember &&\n !aevumFac.alreadyInvited &&\n this.money >= 40000000 &&\n this.city == CityName.Aevum\n ) {\n invitedFactions.push(aevumFac);\n }\n\n //Ishima\n const ishimaFac = Factions[FactionNames.Ishima];\n if (\n !ishimaFac.isBanned &&\n !ishimaFac.isMember &&\n !ishimaFac.alreadyInvited &&\n this.money >= 30000000 &&\n this.city == CityName.Ishima\n ) {\n invitedFactions.push(ishimaFac);\n }\n\n //Volhaven\n const volhavenFac = Factions[FactionNames.Volhaven];\n if (\n !volhavenFac.isBanned &&\n !volhavenFac.isMember &&\n !volhavenFac.alreadyInvited &&\n this.money >= 50000000 &&\n this.city == CityName.Volhaven\n ) {\n invitedFactions.push(volhavenFac);\n }\n\n //Speakers for the Dead\n const speakersforthedeadFac = Factions[FactionNames.SpeakersForTheDead];\n if (\n !speakersforthedeadFac.isBanned &&\n !speakersforthedeadFac.isMember &&\n !speakersforthedeadFac.alreadyInvited &&\n this.skills.hacking >= 100 &&\n this.skills.strength >= 300 &&\n this.skills.defense >= 300 &&\n this.skills.dexterity >= 300 &&\n this.skills.agility >= 300 &&\n this.numPeopleKilled >= 30 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(speakersforthedeadFac);\n }\n\n //The Dark Army\n const thedarkarmyFac = Factions[FactionNames.TheDarkArmy];\n if (\n !thedarkarmyFac.isBanned &&\n !thedarkarmyFac.isMember &&\n !thedarkarmyFac.alreadyInvited &&\n this.skills.hacking >= 300 &&\n this.skills.strength >= 300 &&\n this.skills.defense >= 300 &&\n this.skills.dexterity >= 300 &&\n this.skills.agility >= 300 &&\n this.city == CityName.Chongqing &&\n this.numPeopleKilled >= 5 &&\n this.karma <= -45 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thedarkarmyFac);\n }\n\n //The Syndicate\n const thesyndicateFac = Factions[FactionNames.TheSyndicate];\n if (\n !thesyndicateFac.isBanned &&\n !thesyndicateFac.isMember &&\n !thesyndicateFac.alreadyInvited &&\n this.skills.hacking >= 200 &&\n this.skills.strength >= 200 &&\n this.skills.defense >= 200 &&\n this.skills.dexterity >= 200 &&\n this.skills.agility >= 200 &&\n (this.city == CityName.Aevum || this.city == CityName.Sector12) &&\n this.money >= 10000000 &&\n this.karma <= -90 &&\n !allCompanies.includes(LocationName.Sector12CIA) &&\n !allCompanies.includes(LocationName.Sector12NSA)\n ) {\n invitedFactions.push(thesyndicateFac);\n }\n\n //Silhouette\n const silhouetteFac = Factions[FactionNames.Silhouette];\n if (\n !silhouetteFac.isBanned &&\n !silhouetteFac.isMember &&\n !silhouetteFac.alreadyInvited &&\n (allPositions.includes(\"Chief Technology Officer\") ||\n allPositions.includes(\"Chief Financial Officer\") ||\n allPositions.includes(\"Chief Executive Officer\")) &&\n this.money >= 15000000 &&\n this.karma <= -22\n ) {\n invitedFactions.push(silhouetteFac);\n }\n\n //Tetrads\n const tetradsFac = Factions[FactionNames.Tetrads];\n if (\n !tetradsFac.isBanned &&\n !tetradsFac.isMember &&\n !tetradsFac.alreadyInvited &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima) &&\n this.skills.strength >= 75 &&\n this.skills.defense >= 75 &&\n this.skills.dexterity >= 75 &&\n this.skills.agility >= 75 &&\n this.karma <= -18\n ) {\n invitedFactions.push(tetradsFac);\n }\n\n //SlumSnakes\n const slumsnakesFac = Factions[FactionNames.SlumSnakes];\n if (\n !slumsnakesFac.isBanned &&\n !slumsnakesFac.isMember &&\n !slumsnakesFac.alreadyInvited &&\n this.skills.strength >= 30 &&\n this.skills.defense >= 30 &&\n this.skills.dexterity >= 30 &&\n this.skills.agility >= 30 &&\n this.karma <= -9 &&\n this.money >= 1000000\n ) {\n invitedFactions.push(slumsnakesFac);\n }\n\n //Netburners\n const netburnersFac = Factions[FactionNames.Netburners];\n let totalHacknetRam = 0;\n let totalHacknetCores = 0;\n let totalHacknetLevels = 0;\n for (let i = 0; i < this.hacknetNodes.length; ++i) {\n const v = this.hacknetNodes[i];\n if (typeof v === \"string\") {\n const hserver = GetServer(v);\n if (hserver === null || !(hserver instanceof HacknetServer))\n throw new Error(\"player hacknet server was not HacknetServer\");\n totalHacknetLevels += hserver.level;\n totalHacknetRam += hserver.maxRam;\n totalHacknetCores += hserver.cores;\n } else {\n totalHacknetLevels += v.level;\n totalHacknetRam += v.ram;\n totalHacknetCores += v.cores;\n }\n }\n if (\n !netburnersFac.isBanned &&\n !netburnersFac.isMember &&\n !netburnersFac.alreadyInvited &&\n this.skills.hacking >= 80 &&\n totalHacknetRam >= 8 &&\n totalHacknetCores >= 4 &&\n totalHacknetLevels >= 100\n ) {\n invitedFactions.push(netburnersFac);\n }\n\n //Tian Di Hui\n const tiandihuiFac = Factions[FactionNames.TianDiHui];\n if (\n !tiandihuiFac.isBanned &&\n !tiandihuiFac.isMember &&\n !tiandihuiFac.alreadyInvited &&\n this.money >= 1000000 &&\n this.skills.hacking >= 50 &&\n (this.city == CityName.Chongqing || this.city == CityName.NewTokyo || this.city == CityName.Ishima)\n ) {\n invitedFactions.push(tiandihuiFac);\n }\n\n //CyberSec\n const cybersecFac = Factions[FactionNames.CyberSec];\n const cybersecServer = GetServer(SpecialServers.CyberSecServer);\n if (!(cybersecServer instanceof Server)) throw new Error(`${FactionNames.CyberSec} should be normal server`);\n if (cybersecServer == null) {\n console.error(`Could not find ${FactionNames.CyberSec} Server`);\n } else if (\n !cybersecFac.isBanned &&\n !cybersecFac.isMember &&\n cybersecServer.backdoorInstalled &&\n !cybersecFac.alreadyInvited\n ) {\n invitedFactions.push(cybersecFac);\n }\n\n return invitedFactions;\n}\n\n/************* BitNodes **************/\nexport function setBitNodeNumber(this: IPlayer, n: number): void {\n this.bitNodeN = n;\n}\n\nexport function queueAugmentation(this: IPlayer, name: string): void {\n for (const aug of this.queuedAugmentations) {\n if (aug.name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n for (const aug of this.augmentations) {\n if (aug.name == name) {\n console.warn(`tried to queue ${name} twice, this may be a bug`);\n return;\n }\n }\n\n this.queuedAugmentations.push(new PlayerOwnedAugmentation(name));\n}\n\n/************* Coding Contracts **************/\nexport function gainCodingContractReward(this: IPlayer, reward: ICodingContractReward, difficulty = 1): string {\n if (reward == null || reward.type == null) {\n return `No reward for this contract`;\n }\n\n /* eslint-disable no-case-declarations */\n switch (reward.type) {\n case CodingContractRewardType.FactionReputation:\n if (reward.name == null || !(Factions[reward.name] instanceof Faction)) {\n // If no/invalid faction was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n Factions[reward.name].playerReputation += repGain;\n return `Gained ${repGain} faction reputation for ${reward.name}`;\n case CodingContractRewardType.FactionReputationAll:\n const totalGain = CONSTANTS.CodingContractBaseFactionRepGain * difficulty;\n\n // Ignore Bladeburners and other special factions for this calculation\n const specialFactions = [FactionNames.Bladeburners as string];\n const factions = this.factions.slice().filter((f) => {\n return !specialFactions.includes(f);\n });\n\n // If the player was only part of the special factions, we'll just give money\n if (factions.length == 0) {\n reward.type = CodingContractRewardType.Money;\n return this.gainCodingContractReward(reward, difficulty);\n }\n\n const gainPerFaction = Math.floor(totalGain / factions.length);\n for (const facName of factions) {\n if (!(Factions[facName] instanceof Faction)) {\n continue;\n }\n Factions[facName].playerReputation += gainPerFaction;\n }\n return `Gained ${gainPerFaction} reputation for each of the following factions: ${factions.toString()}`;\n case CodingContractRewardType.CompanyReputation: {\n if (reward.name == null || !(Companies[reward.name] instanceof Company)) {\n //If no/invalid company was designated, just give rewards to all factions\n reward.type = CodingContractRewardType.FactionReputationAll;\n return this.gainCodingContractReward(reward);\n }\n const repGain = CONSTANTS.CodingContractBaseCompanyRepGain * difficulty;\n Companies[reward.name].playerReputation += repGain;\n return `Gained ${repGain} company reputation for ${reward.name}`;\n }\n case CodingContractRewardType.Money:\n default: {\n const moneyGain = CONSTANTS.CodingContractBaseMoneyGain * difficulty * BitNodeMultipliers.CodingContractMoney;\n this.gainMoney(moneyGain, \"codingcontract\");\n return `Gained ${numeralWrapper.formatMoney(moneyGain)}`;\n }\n }\n /* eslint-enable no-case-declarations */\n}\n\nexport function travel(this: IPlayer, to: CityName): boolean {\n if (Cities[to] == null) {\n console.warn(`Player.travel() called with invalid city: ${to}`);\n return false;\n }\n this.city = to;\n\n return true;\n}\n\nexport function gotoLocation(this: IPlayer, to: LocationName): boolean {\n if (Locations[to] == null) {\n console.warn(`Player.gotoLocation() called with invalid location: ${to}`);\n return false;\n }\n this.location = to;\n\n return true;\n}\n\nexport function canAccessGrafting(this: IPlayer): boolean {\n return this.bitNodeN === 10 || this.sourceFileLvl(10) > 0;\n}\n\nexport function giveExploit(this: IPlayer, exploit: Exploit): void {\n if (!this.exploits.includes(exploit)) {\n this.exploits.push(exploit);\n SnackbarEvents.emit(\"SF -1 acquired!\", ToastVariant.SUCCESS, 2000);\n }\n}\n\nexport function giveAchievement(this: IPlayer, achievementId: string): void {\n const achievement = achievements[achievementId];\n if (!achievement) return;\n if (!this.achievements.map((a) => a.ID).includes(achievementId)) {\n this.achievements.push({ ID: achievementId, unlockedOn: new Date().getTime() });\n SnackbarEvents.emit(`Unlocked Achievement: \"${achievement.Name}\"`, ToastVariant.SUCCESS, 2000);\n }\n}\n\nexport function getIntelligenceBonus(this: IPlayer, weight: number): number {\n return calculateIntelligenceBonus(this.skills.intelligence, weight);\n}\n\nexport function getCasinoWinnings(this: IPlayer): number {\n return this.moneySourceA.casino;\n}\n\nexport function canAccessCotMG(this: IPlayer): boolean {\n return this.bitNodeN === 13 || this.sourceFileLvl(13) > 0;\n}\n\nexport function sourceFileLvl(this: IPlayer, n: number): number {\n const sf = this.sourceFiles.find((sf) => sf.n === n);\n if (!sf) return 0;\n return sf.lvl;\n}\n\nexport function focusPenalty(this: IPlayer): number {\n let focus = 1;\n if (!this.hasAugmentation(AugmentationNames[\"NeuroreceptorManager\"])) {\n focus = this.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n return focus;\n}\n","import { CityName } from \"./../../Locations/data/CityNames\";\nexport const BladeburnerConstants: {\n CityNames: string[];\n CyclesPerSecond: number;\n StaminaGainPerSecond: number;\n BaseStaminaLoss: number;\n MaxStaminaToGainFactor: number;\n DifficultyToTimeFactor: number;\n DiffMultExponentialFactor: number;\n DiffMultLinearFactor: number;\n EffAgiLinearFactor: number;\n EffDexLinearFactor: number;\n EffAgiExponentialFactor: number;\n EffDexExponentialFactor: number;\n BaseRecruitmentTimeNeeded: number;\n PopulationThreshold: number;\n PopulationExponent: number;\n ChaosThreshold: number;\n BaseStatGain: number;\n BaseIntGain: number;\n ActionCountGrowthPeriod: number;\n RankToFactionRepFactor: number;\n RankNeededForFaction: number;\n ContractSuccessesPerLevel: number;\n OperationSuccessesPerLevel: number;\n RanksPerSkillPoint: number;\n ContractBaseMoneyGain: number;\n HrcHpGain: number;\n HrcStaminaGain: number;\n} = {\n CityNames: [\n CityName.Aevum,\n CityName.Chongqing,\n CityName.Sector12,\n CityName.NewTokyo,\n CityName.Ishima,\n CityName.Volhaven,\n ],\n CyclesPerSecond: 5, // Game cycle is 200 ms\n\n StaminaGainPerSecond: 0.0085,\n BaseStaminaLoss: 0.285, // Base stamina loss per action. Increased based on difficulty\n MaxStaminaToGainFactor: 70000, // Max Stamina is divided by this to get bonus stamina gain\n\n DifficultyToTimeFactor: 10, // Action Difficulty divided by this to get base action time\n\n /**\n * The difficulty multiplier affects stamina loss and hp loss of an action. Also affects\n * experience gain. Its formula is:\n * difficulty ^ exponentialFactor + difficulty / linearFactor\n */\n DiffMultExponentialFactor: 0.28,\n DiffMultLinearFactor: 650,\n\n /**\n * These factors are used to calculate action time.\n * They affect how much action time is reduced based on your agility and dexterity\n */\n EffAgiLinearFactor: 10e3,\n EffDexLinearFactor: 10e3,\n EffAgiExponentialFactor: 0.04,\n EffDexExponentialFactor: 0.035,\n\n BaseRecruitmentTimeNeeded: 300, // Base time needed (s) to complete a Recruitment action\n\n PopulationThreshold: 1e9, // Population which determines baseline success rate\n PopulationExponent: 0.7, // Exponent that influences how different populations affect success rate\n ChaosThreshold: 50, // City chaos level after which it starts making tasks harder\n\n BaseStatGain: 1, // Base stat gain per second\n BaseIntGain: 0.003, // Base intelligence stat gain\n\n ActionCountGrowthPeriod: 480, // Time (s) it takes for action count to grow by its specified value\n\n RankToFactionRepFactor: 2, // Delta Faction Rep = this * Delta Rank\n RankNeededForFaction: 25,\n\n ContractSuccessesPerLevel: 3, // How many successes you need to level up a contract\n OperationSuccessesPerLevel: 2.5, // How many successes you need to level up an op\n\n RanksPerSkillPoint: 3, // How many ranks needed to get 1 Skill Point\n\n ContractBaseMoneyGain: 250e3, // Base Money Gained per contract\n\n HrcHpGain: 2, // HP Gained from Hyperbolic Regeneration chamber\n HrcStaminaGain: 1, // Percentage Stamina gained from Hyperbolic Regeneration Chamber\n};\n","import { Program } from \"./Program\";\nimport { programsMetadata } from \"./data/ProgramsMetadata\";\nimport { IMap } from \"../types\";\n\nexport const Programs: IMap = {};\n\nfor (const params of programsMetadata) {\n Programs[params.key] = new Program(params.name, params.create, params.run);\n}\n","export enum FragmentType {\n // Special fragments for the UI\n None,\n Delete,\n\n // Stats boosting fragments\n HackingChance,\n HackingSpeed,\n HackingMoney,\n HackingGrow,\n Hacking,\n Strength,\n Defense,\n Dexterity,\n Agility,\n Charisma,\n HacknetMoney,\n HacknetCost,\n Rep,\n WorkMoney,\n Crime,\n Bladeburner,\n\n // utility fragments.\n Booster,\n}\n\nexport function Effect(tpe: FragmentType): string {\n switch (tpe) {\n case FragmentType.HackingChance: {\n return \"+x% hack() success chance\";\n }\n case FragmentType.HackingSpeed: {\n return \"+x% faster hack(), grow(), and weaken()\";\n }\n case FragmentType.HackingMoney: {\n return \"+x% hack() power\";\n }\n case FragmentType.HackingGrow: {\n return \"+x% grow() power\";\n }\n case FragmentType.Hacking: {\n return \"+x% hacking skill\";\n }\n case FragmentType.Strength: {\n return \"+x% strength skill\";\n }\n case FragmentType.Defense: {\n return \"+x% defense skill\";\n }\n case FragmentType.Dexterity: {\n return \"+x% dexterity skill\";\n }\n case FragmentType.Agility: {\n return \"+x% agility skill\";\n }\n case FragmentType.Charisma: {\n return \"+x% charisma skill\";\n }\n case FragmentType.HacknetMoney: {\n return \"+x% hacknet production\";\n }\n case FragmentType.HacknetCost: {\n return \"-x% cheaper hacknet cost\";\n }\n case FragmentType.Rep: {\n return \"+x% reputation from factions and companies\";\n }\n case FragmentType.WorkMoney: {\n return \"+x% work money\";\n }\n case FragmentType.Crime: {\n return \"+x% crime money\";\n }\n case FragmentType.Bladeburner: {\n return \"+x% all bladeburner stats\";\n }\n }\n throw new Error(\"Calling effect for fragment type that doesn't have an effect \" + tpe);\n}\n","import { IMap } from \"../../types\";\n\nexport const LiteratureNames: IMap = {\n HackersStartingHandbook: \"hackers-starting-handbook.lit\",\n CorporationManagementHandbook: \"corporation-management-handbook.lit\",\n HistoryOfSynthoids: \"history-of-synthoids.lit\",\n AGreenTomorrow: \"A-Green-Tomorrow.lit\",\n AlphaOmega: \"alpha-omega.lit\",\n SimulatedReality: \"simulated-reality.lit\",\n BeyondMan: \"beyond-man.lit\",\n BrighterThanTheSun: \"brighter-than-the-sun.lit\",\n DemocracyIsDead: \"democracy-is-dead.lit\",\n Sector12Crime: \"sector-12-crime.lit\",\n ManAndMachine: \"man-and-machine.lit\",\n SecretSocieties: \"secret-societies.lit\",\n TheFailedFrontier: \"the-failed-frontier.lit\",\n CodedIntelligence: \"coded-intelligence.lit\",\n SyntheticMuscles: \"synthetic-muscles.lit\",\n TensionsInTechRace: \"tensions-in-tech-race.lit\",\n CostOfImmortality: \"cost-of-immortality.lit\",\n TheHiddenWorld: \"the-hidden-world.lit\",\n TheNewGod: \"the-new-god.lit\",\n NewTriads: \"new-triads.lit\",\n TheSecretWar: \"the-secret-war.lit\",\n};\n","import React from \"react\";\n\nimport { Typography, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { characterOverviewStyles as useStyles } from \"./CharacterOverview\";\nimport { ClassNameMap } from \"@material-ui/core/styles/withStyles\";\n\ninterface ITableRowData {\n content?: string;\n level?: number;\n exp?: number;\n}\n\ninterface IProps {\n name: string;\n color: string;\n classes?: ClassNameMap;\n data?: ITableRowData;\n children?: React.ReactElement;\n}\n\nexport const StatsRow = ({ name, color, classes = useStyles(), children, data }: IProps): React.ReactElement => {\n let content = \"\";\n\n if (data) {\n if (data.content !== undefined) {\n content = data.content;\n } else if (data.level !== undefined && data.exp !== undefined) {\n content = `${formatNumber(data.level, 0)} (${numeralWrapper.formatExp(data.exp)} exp)`;\n } else if (data.level !== undefined && data.exp === undefined) {\n content = `${formatNumber(data.level, 0)}`;\n }\n }\n\n return (\n \n \n {name}\n \n \n {content ? {content} : <>}\n {children}\n \n \n );\n};\n","import { Augmentation } from \"./Augmentation\";\nimport { IMap } from \"../types\";\n\nexport const StaticAugmentations: IMap = {};\n","export enum PositionTypes {\n Long = \"L\",\n Short = \"S\",\n}\n","import React from \"react\";\nimport { TableCell as MuiTableCell, TableCellProps, Table as MuiTable, TableProps } from \"@mui/material\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\n\nconst useStyles = makeStyles({\n root: {\n borderBottom: \"none\",\n },\n small: {\n width: \"1px\",\n },\n});\n\nexport const TableCell: React.FC = (props: TableCellProps) => {\n return (\n \n );\n};\n\nexport const Table: React.FC = (props: TableProps) => {\n return (\n \n );\n};\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains functions that deal only with that string manipulation.\n * Functions that need to access/process Server-related things can be\n * found in ./DirectoryServerHelpers.ts\n */\n\n/**\n * Removes leading forward slash (\"/\") from a string.\n */\nexport function removeLeadingSlash(s: string): string {\n if (s.startsWith(\"/\")) {\n return s.slice(1);\n }\n\n return s;\n}\n\n/**\n * Removes trailing forward slash (\"/\") from a string.\n * Note that this will also remove the slash if it is the leading slash (i.e. if s = \"/\")\n */\nexport function removeTrailingSlash(s: string): string {\n if (s.endsWith(\"/\")) {\n return s.slice(0, -1);\n }\n\n return s;\n}\n\n/**\n * Checks whether a string is a valid filename. Only used for the filename itself,\n * not the entire filepath\n */\nexport function isValidFilename(filename: string): boolean {\n // Allows alphanumerics, hyphens, underscores, and percentage signs\n // Must have a file extension\n const regex = /^[.&'a-zA-Z0-9_-]+\\.[a-zA-Z0-9]+(?:-\\d+(?:\\.\\d*)?%-INC)?$/;\n\n // match() returns null if no match is found\n return filename.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory name. Only used for the directory itself,\n * not an entire path\n */\nexport function isValidDirectoryName(name: string): boolean {\n // A valid directory name:\n // Must be at least 1 character long\n // Can only include characters in the character set [-.%a-zA-Z0-9_]\n // Cannot end with a '.'\n const regex = /^.?[a-zA-Z0-9_-]+$/;\n\n // match() returns null if no match is found\n return name.match(regex) != null;\n}\n\n/**\n * Checks whether a string is a valid directory path.\n * This only checks if it has the proper formatting. It does NOT check\n * if the directories actually exist on Terminal\n */\nexport function isValidDirectoryPath(path: string): boolean {\n let t_path: string = path;\n\n if (t_path.length === 0) {\n return false;\n }\n if (t_path.length === 1) {\n return t_path === \"/\";\n }\n\n // A full path must have a leading slash, but we'll ignore it for the checks\n if (t_path.startsWith(\"/\")) {\n t_path = t_path.slice(1);\n } else {\n return false;\n }\n\n // Trailing slash does not matter\n t_path = removeTrailingSlash(t_path);\n\n // Check that every section of the path is a valid directory name\n const dirs = t_path.split(\"/\");\n for (const dir of dirs) {\n // Special case, \".\" and \"..\" are valid for path\n if (dir === \".\" || dir === \"..\") {\n continue;\n }\n if (!isValidDirectoryName(dir)) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Checks whether a string is a valid file path. This only checks if it has the\n * proper formatting. It dose NOT check if the file actually exists on Terminal\n */\nexport function isValidFilePath(path: string): boolean {\n if (path == null || typeof path !== \"string\") {\n return false;\n }\n const t_path = path;\n\n // Impossible for filename to have less than length of 3\n if (t_path.length < 3) {\n return false;\n }\n\n // Full filepath can't end with trailing slash because it must be a file\n if (t_path.endsWith(\"/\")) {\n return false;\n }\n\n // Everything after the last forward slash is the filename. Everything before\n // it is the file path\n const fnSeparator = t_path.lastIndexOf(\"/\");\n if (fnSeparator === -1) {\n return isValidFilename(t_path);\n }\n\n const fn = t_path.slice(fnSeparator + 1);\n const dirPath = t_path.slice(0, fnSeparator + 1);\n\n return isValidDirectoryPath(dirPath) && isValidFilename(fn);\n}\n\n/**\n * Returns a formatted string for the first parent directory in a filepath. For example:\n * /home/var/test/ -> home/\n * If there is no first parent directory, then it returns \"/\" for root\n */\nexport function getFirstParentDirectory(path: string): string {\n let t_path = path;\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n if (t_path.lastIndexOf(\"/\") === -1) {\n return \"/\";\n }\n\n const dirs = t_path.split(\"/\");\n if (dirs.length === 0) {\n return \"/\";\n }\n\n return dirs[0] + \"/\";\n}\n\n/**\n * Given a filepath, returns a formatted string for all of the parent directories\n * in that filepath. For example:\n * /home/var/tes -> home/var/\n * /home/var/test/ -> home/var/test/\n * If there are no parent directories, it returns the empty string\n */\nexport function getAllParentDirectories(path: string): string {\n const t_path = path;\n const lastSlash = t_path.lastIndexOf(\"/\");\n if (lastSlash === -1) {\n return \"\";\n }\n\n return t_path.slice(0, lastSlash + 1);\n}\n\n/**\n * Given a destination that only contains a directory part, returns the\n * path to the source filename inside the new destination directory.\n * Otherwise, returns the path to the destination file.\n * @param destination The destination path or file name\n * @param source The source path\n * @param cwd The current working directory\n * @returns A file path which may be absolute or relative\n */\nexport function getDestinationFilepath(destination: string, source: string, cwd: string): string {\n const dstDir = evaluateDirectoryPath(destination, cwd);\n // If evaluating the directory for this destination fails, we have a filename or full path.\n if (dstDir === null) {\n return destination;\n } else {\n // Append the filename to the directory provided.\n const t_path = removeTrailingSlash(dstDir);\n const fileName = getFileName(source);\n return t_path + \"/\" + fileName;\n }\n}\n\n/**\n * Given a filepath, returns the file name (e.g. without directory parts)\n * For example:\n * /home/var/test.js -> test.js\n * ./var/test.js -> test.js\n * test.js -> test.js\n */\nexport function getFileName(path: string): string {\n const t_path = path;\n const lastSlash = t_path.lastIndexOf(\"/\");\n if (lastSlash === -1) {\n return t_path;\n }\n\n return t_path.slice(lastSlash + 1);\n}\n\n/**\n * Checks if a file path refers to a file in the root directory.\n */\nexport function isInRootDirectory(path: string): boolean {\n if (!isValidFilePath(path)) {\n return false;\n }\n if (path == null || path.length === 0) {\n return false;\n }\n\n return path.lastIndexOf(\"/\") <= 0;\n}\n\n/**\n * Evaluates a directory path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateDirectoryPath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidDirectoryPath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n t_path = removeTrailingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n\n/**\n * Evaluates a file path, including the processing of linux dots.\n * Returns the full, proper path, or null if an invalid path is passed in\n */\nexport function evaluateFilePath(path: string, currPath?: string): string | null {\n let t_path = path;\n\n // If the path begins with a slash, then its an absolute path. Otherwise its relative\n // For relative paths, we need to prepend the current directory\n if (!t_path.startsWith(\"/\") && currPath != null) {\n t_path = currPath + (currPath.endsWith(\"/\") ? \"\" : \"/\") + t_path;\n }\n\n if (!isValidFilePath(t_path)) {\n return null;\n }\n\n // Trim leading/trailing slashes\n t_path = removeLeadingSlash(t_path);\n\n const dirs = t_path.split(\"/\");\n const reconstructedPath: string[] = [];\n\n for (const dir of dirs) {\n if (dir === \".\") {\n // Current directory, do nothing\n continue;\n } else if (dir === \"..\") {\n // Parent directory\n const res = reconstructedPath.pop();\n if (res == null) {\n return null; // Array was empty, invalid path\n }\n } else {\n reconstructedPath.push(dir);\n }\n }\n\n return \"/\" + reconstructedPath.join(\"/\");\n}\n\nexport function areFilesEqual(f0: string, f1: string): boolean {\n if (!f0.startsWith(\"/\")) f0 = \"/\" + f0;\n if (!f1.startsWith(\"/\")) f1 = \"/\" + f1;\n return f0 === f1;\n}\n\nexport function areImportsEquals(f0: string, f1: string): boolean {\n if (!f0.endsWith(\".js\")) f0 = f0 + \".js\";\n if (!f1.endsWith(\".js\")) f1 = f1 + \".js\";\n return areFilesEqual(f0, f1);\n}\n","// Constructs all CompanyPosition objects using the metadata in data/companypositions.ts\nimport { companiesMetadata } from \"./data/CompaniesMetadata\";\nimport { Company, IConstructorParams } from \"./Company\";\nimport { IMap } from \"../types\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\nexport let Companies: IMap = {};\n\nfunction addCompany(params: IConstructorParams): void {\n if (Companies[params.name] != null) {\n console.warn(`Duplicate Company Position being defined: ${params.name}`);\n }\n Companies[params.name] = new Company(params);\n}\n\n// Used to initialize new Company objects for the Companies map\n// Called when creating new game or after a prestige/reset\nexport function initCompanies(): void {\n // Save Old Company data for 'favor'\n const oldCompanies = Companies;\n\n // Re-construct all Companies\n Companies = {};\n companiesMetadata.forEach((e) => {\n addCompany(e);\n });\n\n // Reset data\n for (const companyName of Object.keys(Companies)) {\n const company = Companies[companyName];\n const oldCompany = oldCompanies[companyName];\n if (!(oldCompany instanceof Company)) {\n // New game, so no OldCompanies data\n company.favor = 0;\n } else {\n company.favor = oldCompanies[companyName].favor;\n if (isNaN(company.favor)) {\n company.favor = 0;\n }\n }\n }\n}\n\n// Used to load Companies map from a save\nexport function loadCompanies(saveString: string): void {\n Companies = JSON.parse(saveString, Reviver);\n}\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Reviver } from \"../utils/JSONReviver\";\n\ninterface GangTerritory {\n power: number;\n territory: number;\n}\n\nexport let AllGangs: {\n [key: string]: GangTerritory;\n} = {\n [FactionNames.SlumSnakes]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.Tetrads]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheSyndicate]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheDarkArmy]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.SpeakersForTheDead]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.NiteSec]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheBlackHand]: {\n power: 1,\n territory: 1 / 7,\n },\n};\n\nexport function resetGangs(): void {\n AllGangs = {\n [FactionNames.SlumSnakes]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.Tetrads]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheSyndicate]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheDarkArmy]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.SpeakersForTheDead]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.NiteSec]: {\n power: 1,\n territory: 1 / 7,\n },\n [FactionNames.TheBlackHand]: {\n power: 1,\n territory: 1 / 7,\n },\n };\n}\n\nexport function loadAllGangs(saveString: string): void {\n AllGangs = JSON.parse(saveString, Reviver);\n}\n","import { Terminal as TTerminal } from \"./Terminal/Terminal\";\n\nexport const Terminal = new TTerminal();\n","import React, { useEffect } from \"react\";\nimport { useSnackbar, SnackbarProvider as SB } from \"notistack\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Alert from \"@mui/material/Alert\";\nimport Paper from \"@mui/material/Paper\";\nimport { logBoxBaseZIndex } from \"./LogBoxManager\";\n\ninterface IProps {\n children: React.ReactNode | React.ReactNode[];\n}\n\nexport enum ToastVariant {\n SUCCESS = \"success\",\n WARNING = \"warning\",\n ERROR = \"error\",\n INFO = \"info\",\n}\n\nconst useStyles = makeStyles(() => ({\n snackbar: {\n // Log popup z-index increments, so let's add a padding to be well above them.\n zIndex: `${logBoxBaseZIndex + 1000} !important` as any,\n\n \"& .MuiAlert-icon\": {\n alignSelf: \"center\",\n },\n },\n}));\n\nexport function SnackbarProvider(props: IProps): React.ReactElement {\n const classes = useStyles();\n return (\n \n {props.children}\n \n );\n}\n\nexport const SnackbarEvents = new EventEmitter<[string | React.ReactNode, ToastVariant, number | null]>();\n\nexport function Snackbar(): React.ReactElement {\n const { enqueueSnackbar, closeSnackbar } = useSnackbar();\n\n useEffect(() =>\n SnackbarEvents.subscribe((s, variant, duration) => {\n const id = enqueueSnackbar({s}, {\n content: (k, m) => {m},\n variant: variant,\n autoHideDuration: duration,\n onClick: () => closeSnackbar(id),\n });\n }),\n );\n return <>;\n}\n","import { Crime } from \"./Crime\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IMap } from \"../types\";\n\nimport { CrimeType } from \"../utils/WorkType\";\n\nexport const Crimes: IMap = {\n Shoplift: new Crime(\"Shoplift\", \"to shoplift\", CrimeType.SHOPLIFT, 2e3, 15e3, 1 / 20, 0.1, {\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n dexterity_exp: 2,\n agility_exp: 2,\n }),\n\n RobStore: new Crime(\"Rob Store\", \"to rob a store\", CrimeType.ROB_STORE, 60e3, 400e3, 1 / 5, 0.5, {\n hacking_exp: 30,\n dexterity_exp: 45,\n agility_exp: 45,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 7.5 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Mug: new Crime(\"Mug\", \"to mug\", CrimeType.MUG, 4e3, 36e3, 1 / 5, 0.25, {\n strength_exp: 3,\n defense_exp: 3,\n dexterity_exp: 3,\n agility_exp: 3,\n\n strength_success_weight: 1.5,\n defense_success_weight: 0.5,\n dexterity_success_weight: 1.5,\n agility_success_weight: 0.5,\n }),\n\n Larceny: new Crime(\"Larceny\", \"larceny\", CrimeType.LARCENY, 90e3, 800e3, 1 / 3, 1.5, {\n hacking_exp: 45,\n dexterity_exp: 60,\n agility_exp: 60,\n\n hacking_success_weight: 0.5,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 15 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n DealDrugs: new Crime(\"Deal Drugs\", \"to deal drugs\", CrimeType.DRUGS, 10e3, 120e3, 1, 0.5, {\n dexterity_exp: 5,\n agility_exp: 5,\n charisma_exp: 10,\n\n charisma_success_weight: 3,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n }),\n\n BondForgery: new Crime(\"Bond Forgery\", \"to forge bonds\", CrimeType.BOND_FORGERY, 300e3, 4.5e6, 1 / 2, 0.1, {\n hacking_exp: 100,\n dexterity_exp: 150,\n charisma_exp: 15,\n\n hacking_success_weight: 0.05,\n dexterity_success_weight: 1.25,\n\n intelligence_exp: 60 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n TraffickArms: new Crime(\"Traffick Arms\", \"to traffic arms\", CrimeType.TRAFFIC_ARMS, 40e3, 600e3, 2, 1, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 20,\n charisma_exp: 40,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n }),\n\n Homicide: new Crime(\"Homicide\", \"homicide\", CrimeType.HOMICIDE, 3e3, 45e3, 1, 3, {\n strength_exp: 2,\n defense_exp: 2,\n dexterity_exp: 2,\n agility_exp: 2,\n\n strength_success_weight: 2,\n defense_success_weight: 2,\n dexterity_success_weight: 0.5,\n agility_success_weight: 0.5,\n\n kills: 1,\n }),\n\n GrandTheftAuto: new Crime(\"Grand Theft Auto\", \"grand theft auto\", CrimeType.GRAND_THEFT_AUTO, 80e3, 1.6e6, 8, 5, {\n strength_exp: 20,\n defense_exp: 20,\n dexterity_exp: 20,\n agility_exp: 80,\n charisma_exp: 40,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 4,\n agility_success_weight: 2,\n charisma_success_weight: 2,\n\n intelligence_exp: 16 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Kidnap: new Crime(\"Kidnap\", \"to kidnap\", CrimeType.KIDNAP, 120e3, 3.6e6, 5, 6, {\n strength_exp: 80,\n defense_exp: 80,\n dexterity_exp: 80,\n agility_exp: 80,\n charisma_exp: 80,\n\n charisma_success_weight: 1,\n strength_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n\n intelligence_exp: 26 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n\n Assassination: new Crime(\"Assassination\", \"to assassinate\", CrimeType.ASSASSINATION, 300e3, 12e6, 8, 10, {\n strength_exp: 300,\n defense_exp: 300,\n dexterity_exp: 300,\n agility_exp: 300,\n\n strength_success_weight: 1,\n dexterity_success_weight: 2,\n agility_success_weight: 1,\n\n intelligence_exp: 65 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n\n kills: 1,\n }),\n\n Heist: new Crime(\"Heist\", \"a heist\", CrimeType.HEIST, 600e3, 120e6, 18, 15, {\n hacking_exp: 450,\n strength_exp: 450,\n defense_exp: 450,\n dexterity_exp: 450,\n agility_exp: 450,\n charisma_exp: 450,\n\n hacking_success_weight: 1,\n strength_success_weight: 1,\n defense_success_weight: 1,\n dexterity_success_weight: 1,\n agility_success_weight: 1,\n charisma_success_weight: 1,\n\n intelligence_exp: 130 * CONSTANTS.IntelligenceCrimeBaseExpGain,\n }),\n};\n","import * as React from \"react\";\n\nexport function trusted(f: () => void): (event: React.MouseEvent) => void {\n return function (event: React.MouseEvent): void {\n if (!event.isTrusted) return;\n f();\n };\n}\n","/* Holds IP of Special Servers */\nexport const SpecialServers: {\n [key: string]: string | undefined;\n\n Home: string;\n FulcrumSecretTechnologies: string;\n CyberSecServer: string;\n NiteSecServer: string;\n TheBlackHandServer: string;\n BitRunnersServer: string;\n TheDarkArmyServer: string;\n DaedalusServer: string;\n WorldDaemon: string;\n DarkWeb: string;\n} = {\n Home: \"home\",\n FulcrumSecretTechnologies: \"fulcrumassets\",\n CyberSecServer: \"CSEC\",\n NiteSecServer: \"avmnite-02h\",\n TheBlackHandServer: \"I.I.I.I\",\n BitRunnersServer: \"run4theh111z\",\n TheDarkArmyServer: \".\",\n DaedalusServer: \"The-Cave\",\n WorldDaemon: \"w0r1d_d43m0n\",\n DarkWeb: \"darkweb\",\n};\n","import { IPerson } from \"src/PersonObjects/IPerson\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nexport interface WorkStats {\n money: number;\n reputation: number;\n hackExp: number;\n strExp: number;\n defExp: number;\n dexExp: number;\n agiExp: number;\n chaExp: number;\n intExp: number;\n}\n\ninterface newWorkStatsParams {\n money?: number;\n reputation?: number;\n hackExp?: number;\n strExp?: number;\n defExp?: number;\n dexExp?: number;\n agiExp?: number;\n chaExp?: number;\n intExp?: number;\n}\n\nexport const newWorkStats = (params?: newWorkStatsParams): WorkStats => {\n return {\n money: params?.money ?? 0,\n reputation: params?.reputation ?? 0,\n hackExp: params?.hackExp ?? 0,\n strExp: params?.strExp ?? 0,\n defExp: params?.defExp ?? 0,\n dexExp: params?.dexExp ?? 0,\n agiExp: params?.agiExp ?? 0,\n chaExp: params?.chaExp ?? 0,\n intExp: params?.intExp ?? 0,\n };\n};\n\nexport const sumWorkStats = (w0: WorkStats, w1: WorkStats): WorkStats => {\n return {\n money: w0.money + w1.money,\n reputation: w0.reputation + w1.reputation,\n hackExp: w0.hackExp + w1.hackExp,\n strExp: w0.strExp + w1.strExp,\n defExp: w0.defExp + w1.defExp,\n dexExp: w0.dexExp + w1.dexExp,\n agiExp: w0.agiExp + w1.agiExp,\n chaExp: w0.chaExp + w1.chaExp,\n intExp: w0.intExp + w1.intExp,\n };\n};\n\nexport const scaleWorkStats = (w: WorkStats, n: number, scaleMoney = true): WorkStats => {\n const m = scaleMoney ? n : 1;\n return {\n money: w.money * m,\n reputation: w.reputation * n,\n hackExp: w.hackExp * n,\n strExp: w.strExp * n,\n defExp: w.defExp * n,\n dexExp: w.dexExp * n,\n agiExp: w.agiExp * n,\n chaExp: w.chaExp * n,\n intExp: w.intExp * n,\n };\n};\n\nexport const applyWorkStats = (\n player: IPlayer,\n target: IPerson,\n workStats: WorkStats,\n cycles: number,\n source: string,\n): WorkStats => {\n const expStats = applyWorkStatsExp(target, workStats, cycles);\n const gains = {\n money: workStats.money * cycles,\n reputation: 0,\n hackExp: expStats.hackExp,\n strExp: expStats.strExp,\n defExp: expStats.defExp,\n dexExp: expStats.dexExp,\n agiExp: expStats.agiExp,\n chaExp: expStats.chaExp,\n intExp: expStats.intExp,\n };\n player.gainMoney(gains.money, source);\n\n return gains;\n};\n\nexport const applyWorkStatsExp = (target: IPerson, workStats: WorkStats, cycles: number): WorkStats => {\n const gains = {\n money: 0,\n reputation: 0,\n hackExp: workStats.hackExp * cycles,\n strExp: workStats.strExp * cycles,\n defExp: workStats.defExp * cycles,\n dexExp: workStats.dexExp * cycles,\n agiExp: workStats.agiExp * cycles,\n chaExp: workStats.chaExp * cycles,\n intExp: workStats.intExp * cycles,\n };\n target.gainHackingExp(gains.hackExp);\n target.gainStrengthExp(gains.strExp);\n target.gainDefenseExp(gains.defExp);\n target.gainDexterityExp(gains.dexExp);\n target.gainAgilityExp(gains.agiExp);\n target.gainCharismaExp(gains.chaExp);\n target.gainIntelligenceExp(gains.intExp);\n return gains;\n};\n","import React, { useState, useEffect } from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IEngine } from \"../IEngine\";\nimport { ITerminal } from \"../Terminal/ITerminal\";\nimport { installAugmentations } from \"../Augmentation/AugmentationHelpers\";\nimport { saveObject } from \"../SaveObject\";\nimport { onExport } from \"../ExportBonus\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Location } from \"../Locations/Location\";\nimport { ITutorial, iTutorialStart } from \"../InteractiveTutorial\";\nimport { InteractiveTutorialRoot } from \"./InteractiveTutorial/InteractiveTutorialRoot\";\nimport { ITutorialEvents } from \"./InteractiveTutorial/ITutorialEvents\";\n\nimport { Faction } from \"../Faction/Faction\";\nimport { prestigeAugmentation } from \"../Prestige\";\nimport { dialogBoxCreate } from \"./React/DialogBox\";\nimport { GetAllServers } from \"../Server/AllServers\";\nimport { Factions } from \"../Faction/Factions\";\nimport { StockMarket } from \"../StockMarket/StockMarket\";\n\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\n\nimport { Page, IRouter, ScriptEditorRouteOptions } from \"./Router\";\nimport { Overview } from \"./React/Overview\";\nimport { SidebarRoot } from \"../Sidebar/ui/SidebarRoot\";\nimport { AugmentationsRoot } from \"../Augmentation/ui/AugmentationsRoot\";\nimport { DevMenuRoot } from \"../DevMenu\";\nimport { BladeburnerRoot } from \"../Bladeburner/ui/BladeburnerRoot\";\nimport { GangRoot } from \"../Gang/ui/GangRoot\";\nimport { CorporationRoot } from \"../Corporation/ui/CorporationRoot\";\nimport { InfiltrationRoot } from \"../Infiltration/ui/InfiltrationRoot\";\nimport { GraftingRoot } from \"../PersonObjects/Grafting/ui/GraftingRoot\";\nimport { WorkInProgressRoot } from \"./WorkInProgressRoot\";\nimport { GameOptionsRoot } from \"../GameOptions/ui/GameOptionsRoot\";\nimport { SleeveRoot } from \"../PersonObjects/Sleeve/ui/SleeveRoot\";\nimport { HacknetRoot } from \"../Hacknet/ui/HacknetRoot\";\nimport { GenericLocation } from \"../Locations/ui/GenericLocation\";\nimport { LocationCity } from \"../Locations/ui/City\";\nimport { ProgramsRoot } from \"../Programs/ui/ProgramsRoot\";\nimport { Root as ScriptEditorRoot } from \"../ScriptEditor/ui/ScriptEditorRoot\";\nimport { MilestonesRoot } from \"../Milestones/ui/MilestonesRoot\";\nimport { TerminalRoot } from \"../Terminal/ui/TerminalRoot\";\nimport { TutorialRoot } from \"../Tutorial/ui/TutorialRoot\";\nimport { ActiveScriptsRoot } from \"./ActiveScripts/ActiveScriptsRoot\";\nimport { FactionsRoot } from \"../Faction/ui/FactionsRoot\";\nimport { FactionRoot } from \"../Faction/ui/FactionRoot\";\nimport { CharacterStats } from \"./CharacterStats\";\nimport { TravelAgencyRoot } from \"../Locations/ui/TravelAgencyRoot\";\nimport { StockMarketRoot } from \"../StockMarket/ui/StockMarketRoot\";\nimport { BitverseRoot } from \"../BitNode/ui/BitverseRoot\";\nimport { StaneksGiftRoot } from \"../CotMG/ui/StaneksGiftRoot\";\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { CharacterOverview } from \"./React/CharacterOverview\";\nimport { BladeburnerCinematic } from \"../Bladeburner/ui/BladeburnerCinematic\";\nimport { workerScripts } from \"../Netscript/WorkerScripts\";\nimport { Unclickable } from \"../Exploits/Unclickable\";\nimport { Snackbar, SnackbarProvider } from \"./React/Snackbar\";\nimport { LogBoxManager } from \"./React/LogBoxManager\";\nimport { AlertManager } from \"./React/AlertManager\";\nimport { PromptManager } from \"./React/PromptManager\";\nimport { InvitationModal } from \"../Faction/ui/InvitationModal\";\nimport { calculateAchievements } from \"../Achievements/Achievements\";\n\nimport { enterBitNode } from \"../RedPill\";\nimport { Context } from \"./Context\";\nimport { RecoveryMode, RecoveryRoot } from \"./React/RecoveryRoot\";\nimport { AchievementsRoot } from \"../Achievements/AchievementsRoot\";\nimport { ErrorBoundary } from \"./ErrorBoundary\";\nimport { Settings } from \"../Settings/Settings\";\nimport { ThemeBrowser } from \"../Themes/ui/ThemeBrowser\";\nimport { ImportSaveRoot } from \"./React/ImportSaveRoot\";\nimport { BypassWrapper } from \"./React/BypassWrapper\";\n\nimport _wrap from \"lodash/wrap\";\nimport _functions from \"lodash/functions\";\nimport { Apr1 } from \"./Apr1\";\nimport { isFactionWork } from \"../Work/FactionWork\";\nimport { V2Modal } from \"../utils/V2Modal\";\n\nconst htmlLocation = location;\n\ninterface IProps {\n terminal: ITerminal;\n player: IPlayer;\n engine: IEngine;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n \"-ms-overflow-style\": \"none\" /* for Internet Explorer, Edge */,\n \"scrollbar-width\": \"none\" /* for Firefox */,\n margin: theme.spacing(0),\n flexGrow: 1,\n padding: \"8px\",\n minHeight: \"100vh\",\n boxSizing: \"border-box\",\n width: \"1px\",\n },\n }),\n);\n\nconst uninitialized = (): void => {\n throw new Error(\"Router called before initialization\");\n};\n\nexport let Router: IRouter = {\n isInitialized: false,\n page: () => {\n throw new Error(\"Router called before initialization\");\n },\n allowRouting: uninitialized,\n toActiveScripts: uninitialized,\n toAugmentations: uninitialized,\n toBitVerse: uninitialized,\n toBladeburner: uninitialized,\n toStats: uninitialized,\n toCity: uninitialized,\n toCorporation: uninitialized,\n toCreateProgram: uninitialized,\n toDevMenu: uninitialized,\n toFaction: uninitialized,\n toFactions: uninitialized,\n toGameOptions: uninitialized,\n toGang: uninitialized,\n toHacknetNodes: uninitialized,\n toInfiltration: uninitialized,\n toJob: uninitialized,\n toMilestones: uninitialized,\n toGrafting: uninitialized,\n toScriptEditor: uninitialized,\n toSleeves: uninitialized,\n toStockMarket: uninitialized,\n toTerminal: uninitialized,\n toTravel: uninitialized,\n toTutorial: uninitialized,\n toWork: uninitialized,\n toBladeburnerCinematic: uninitialized,\n toLocation: uninitialized,\n toStaneksGift: uninitialized,\n toAchievements: uninitialized,\n toThemeBrowser: uninitialized,\n toImportSave: uninitialized,\n};\n\nfunction determineStartPage(player: IPlayer): Page {\n if (RecoveryMode) return Page.Recovery;\n if (player.currentWork !== null) return Page.Work;\n return Page.Terminal;\n}\n\nexport function GameRoot({ player, engine, terminal }: IProps): React.ReactElement {\n const classes = useStyles();\n const [{ files, vim }, setEditorOptions] = useState({ files: {}, vim: false });\n const [page, setPage] = useState(determineStartPage(player));\n const setRerender = useState(0)[1];\n const [augPage, setAugPage] = useState(false);\n const [faction, setFaction] = useState(\n isFactionWork(player.currentWork) ? Factions[player.currentWork.factionName] : (undefined as unknown as Faction),\n );\n if (faction === undefined && page === Page.Faction)\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [flume, setFlume] = useState(false);\n const [quick, setQuick] = useState(false);\n const [location, setLocation] = useState(undefined as unknown as Location);\n if (location === undefined && (page === Page.Infiltration || page === Page.Location || page === Page.Job))\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [cinematicText, setCinematicText] = useState(\"\");\n const [errorBoundaryKey, setErrorBoundaryKey] = useState(0);\n const [sidebarOpened, setSideBarOpened] = useState(Settings.IsSidebarOpened);\n\n const [importString, setImportString] = useState(undefined as unknown as string);\n const [importAutomatic, setImportAutomatic] = useState(false);\n if (importString === undefined && page === Page.ImportSave)\n throw new Error(\"Trying to go to a page without the proper setup\");\n\n const [allowRoutingCalls, setAllowRoutingCalls] = useState(true);\n\n function resetErrorBoundary(): void {\n setErrorBoundaryKey(errorBoundaryKey + 1);\n }\n\n function rerender(): void {\n setRerender((old) => old + 1);\n }\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n\n function killAllScripts(): void {\n for (const server of GetAllServers()) {\n server.runningScripts = [];\n }\n saveObject.saveGame();\n setTimeout(() => htmlLocation.reload(), 2000);\n }\n\n Router = {\n isInitialized: true,\n page: () => page,\n allowRouting: (value: boolean) => setAllowRoutingCalls(value),\n toActiveScripts: () => setPage(Page.ActiveScripts),\n toAugmentations: () => setPage(Page.Augmentations),\n toBladeburner: () => setPage(Page.Bladeburner),\n toStats: () => setPage(Page.Stats),\n toCorporation: () => setPage(Page.Corporation),\n toCreateProgram: () => setPage(Page.CreateProgram),\n toDevMenu: () => setPage(Page.DevMenu),\n toFaction: (faction: Faction, augPage = false) => {\n setAugPage(augPage);\n setPage(Page.Faction);\n if (faction) setFaction(faction);\n },\n toFactions: () => setPage(Page.Factions),\n toGameOptions: () => setPage(Page.Options),\n toGang: () => setPage(Page.Gang),\n toHacknetNodes: () => setPage(Page.Hacknet),\n toMilestones: () => setPage(Page.Milestones),\n toGrafting: () => setPage(Page.Grafting),\n toScriptEditor: (files: Record, options?: ScriptEditorRouteOptions) => {\n setEditorOptions({\n files,\n vim: !!options?.vim,\n });\n setPage(Page.ScriptEditor);\n },\n toSleeves: () => setPage(Page.Sleeves),\n toStockMarket: () => setPage(Page.StockMarket),\n toTerminal: () => setPage(Page.Terminal),\n toTutorial: () => setPage(Page.Tutorial),\n toJob: (location: Location) => {\n setLocation(location);\n setPage(Page.Job);\n },\n toCity: () => {\n setPage(Page.City);\n },\n toTravel: () => {\n player.gotoLocation(LocationName.TravelAgency);\n setPage(Page.Travel);\n },\n toBitVerse: (flume: boolean, quick: boolean) => {\n setFlume(flume);\n setQuick(quick);\n calculateAchievements();\n setPage(Page.BitVerse);\n },\n toInfiltration: (location: Location) => {\n setLocation(location);\n setPage(Page.Infiltration);\n },\n toWork: () => setPage(Page.Work),\n toBladeburnerCinematic: () => {\n setPage(Page.BladeburnerCinematic);\n setCinematicText(cinematicText);\n },\n toLocation: (location: Location) => {\n setLocation(location);\n setPage(Page.Location);\n },\n toStaneksGift: () => {\n setPage(Page.StaneksGift);\n },\n toAchievements: () => {\n setPage(Page.Achievements);\n },\n toThemeBrowser: () => {\n setPage(Page.ThemeBrowser);\n },\n toImportSave: (base64save: string, automatic = false) => {\n setImportString(base64save);\n setImportAutomatic(automatic);\n setPage(Page.ImportSave);\n },\n };\n\n useEffect(() => {\n // Wrap Router navigate functions to be able to disable the execution\n _functions(Router)\n .filter((fnName) => fnName.startsWith(\"to\"))\n .forEach((fnName) => {\n // @ts-ignore - tslint does not like this, couldn't find a way to make it cooperate\n Router[fnName] = _wrap(Router[fnName], (func, ...args) => {\n if (!allowRoutingCalls) {\n // Let's just log to console.\n console.error(`Routing is currently disabled - Attempted router.${fnName}()`);\n return;\n }\n\n // Call the function normally\n return func(...args);\n });\n });\n });\n\n useEffect(() => {\n if (page !== Page.Terminal) window.scrollTo(0, 0);\n });\n\n function softReset(): void {\n dialogBoxCreate(\"Soft Reset!\");\n installAugmentations(true);\n resetErrorBoundary();\n Router.toTerminal();\n }\n\n let mainPage = Cannot load;\n let withSidebar = true;\n let withPopups = true;\n let bypassGame = false;\n switch (page) {\n case Page.Recovery: {\n mainPage = ;\n withSidebar = false;\n withPopups = false;\n bypassGame = true;\n break;\n }\n case Page.BitVerse: {\n mainPage = ;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.Infiltration: {\n mainPage = ;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.BladeburnerCinematic: {\n mainPage = ;\n withSidebar = false;\n withPopups = false;\n break;\n }\n case Page.Work: {\n mainPage = ;\n withSidebar = false;\n break;\n }\n case Page.Terminal: {\n mainPage = ;\n break;\n }\n case Page.Sleeves: {\n mainPage = ;\n break;\n }\n case Page.StaneksGift: {\n mainPage = ;\n break;\n }\n case Page.Stats: {\n mainPage = ;\n break;\n }\n case Page.ScriptEditor: {\n mainPage = (\n \n );\n break;\n }\n case Page.ActiveScripts: {\n mainPage = ;\n break;\n }\n case Page.Hacknet: {\n mainPage = ;\n break;\n }\n case Page.CreateProgram: {\n mainPage = ;\n break;\n }\n case Page.Factions: {\n mainPage = ;\n break;\n }\n case Page.Faction: {\n mainPage = ;\n break;\n }\n case Page.Milestones: {\n mainPage = ;\n break;\n }\n case Page.Tutorial: {\n mainPage = (\n {\n prestigeAugmentation();\n Router.toTerminal();\n iTutorialStart();\n }}\n />\n );\n break;\n }\n case Page.DevMenu: {\n mainPage = ;\n break;\n }\n case Page.Gang: {\n mainPage = ;\n break;\n }\n case Page.Corporation: {\n mainPage = ;\n break;\n }\n case Page.Bladeburner: {\n mainPage = ;\n break;\n }\n case Page.Grafting: {\n mainPage = ;\n break;\n }\n case Page.Travel: {\n mainPage = ;\n break;\n }\n case Page.StockMarket: {\n mainPage = ;\n break;\n }\n case Page.City: {\n mainPage = ;\n break;\n }\n case Page.Job:\n case Page.Location: {\n mainPage = ;\n break;\n }\n case Page.Options: {\n mainPage = (\n saveObject.saveGame()}\n export={() => {\n // Apply the export bonus before saving the game\n onExport(player);\n saveObject.exportGame();\n }}\n forceKill={killAllScripts}\n softReset={softReset}\n />\n );\n break;\n }\n case Page.Augmentations: {\n mainPage = (\n {\n // Apply the export bonus before saving the game\n onExport(player);\n saveObject.exportGame();\n }}\n installAugmentationsFn={() => {\n installAugmentations();\n }}\n />\n );\n break;\n }\n case Page.Achievements: {\n mainPage = ;\n break;\n }\n case Page.ThemeBrowser: {\n mainPage = ;\n break;\n }\n case Page.ImportSave: {\n mainPage = ;\n withSidebar = false;\n withPopups = false;\n bypassGame = true;\n }\n }\n\n return (\n \n \n \n \n \n \n {!ITutorial.isRunning ? (\n saveObject.saveGame()} killScripts={killAllScripts} />\n ) : (\n \n )}\n \n {withSidebar ? (\n \n {\n setSideBarOpened(isOpened);\n Settings.IsSidebarOpened = isOpened;\n }}\n />\n {mainPage}\n \n ) : (\n {mainPage}\n )}\n \n {withPopups && (\n <>\n \n \n \n \n \n \n )}\n \n \n \n \n \n \n \n );\n}\n","/**\n * Hacknet Servers - Reworked Hacknet Node mechanic for BitNode-9\n */\nimport { CONSTANTS } from \"../Constants\";\n\nimport { IHacknetNode } from \"./IHacknetNode\";\n\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { HacknetServerConstants } from \"./data/Constants\";\nimport {\n calculateHashGainRate,\n calculateLevelUpgradeCost,\n calculateRamUpgradeCost,\n calculateCoreUpgradeCost,\n calculateCacheUpgradeCost,\n} from \"./formulas/HacknetServers\";\n\nimport { createRandomIp } from \"../utils/IPAddress\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\ninterface IConstructorParams {\n adminRights?: boolean;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n organizationName?: string;\n}\n\nexport class HacknetServer extends BaseServer implements IHacknetNode {\n // Cache level. Affects hash Capacity\n cache = 1;\n\n // Number of cores. Improves hash production\n cores = 1;\n\n // Number of hashes that can be stored by this Hacknet Server\n hashCapacity = 0;\n\n // Hashes produced per second\n hashRate = 0;\n\n // Similar to Node level. Improves hash production\n level = 1;\n\n // How long this HacknetServer has existed, in seconds\n onlineTimeSeconds = 0;\n\n // Total number of hashes earned by this server\n totalHashesGenerated = 0;\n\n // Flag indicating wehther this is a purchased server\n purchasedByPlayer = true;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n super(params);\n\n this.maxRam = 1;\n this.updateHashCapacity();\n }\n\n calculateCacheUpgradeCost(levels: number): number {\n return calculateCacheUpgradeCost(this.cache, levels);\n }\n\n calculateCoreUpgradeCost(levels: number, costMult: number): number {\n return calculateCoreUpgradeCost(this.cores, levels, costMult);\n }\n\n calculateLevelUpgradeCost(levels: number, costMult: number): number {\n return calculateLevelUpgradeCost(this.level, levels, costMult);\n }\n\n calculateRamUpgradeCost(levels: number, costMult: number): number {\n return calculateRamUpgradeCost(this.maxRam, levels, costMult);\n }\n\n // Process this Hacknet Server in the game loop. Returns the number of hashes generated\n process(numCycles = 1): number {\n const seconds = (numCycles * CONSTANTS.MilliPerCycle) / 1000;\n this.onlineTimeSeconds += seconds;\n\n const hashes = this.hashRate * seconds;\n this.totalHashesGenerated += hashes;\n\n return hashes;\n }\n\n upgradeCache(levels: number): void {\n this.cache = Math.min(HacknetServerConstants.MaxCache, Math.round(this.cache + levels));\n this.updateHashCapacity();\n }\n\n upgradeCore(levels: number, prodMult: number): void {\n this.cores = Math.min(HacknetServerConstants.MaxCores, Math.round(this.cores + levels));\n this.updateHashRate(prodMult);\n this.cpuCores = this.cores;\n }\n\n upgradeLevel(levels: number, prodMult: number): void {\n this.level = Math.min(HacknetServerConstants.MaxLevel, Math.round(this.level + levels));\n this.updateHashRate(prodMult);\n }\n\n upgradeRam(levels: number, prodMult: number): boolean {\n for (let i = 0; i < levels; ++i) {\n this.maxRam *= 2;\n }\n this.maxRam = Math.min(HacknetServerConstants.MaxRam, Math.round(this.maxRam));\n this.updateHashRate(prodMult);\n\n return true;\n }\n\n // Whenever a script is run, we must update this server's hash rate\n runScript(script: RunningScript, prodMult?: number): void {\n super.runScript(script);\n if (prodMult != null && typeof prodMult === \"number\") {\n this.updateHashRate(prodMult);\n }\n }\n\n updateRamUsed(ram: number, player: IPlayer): void {\n super.updateRamUsed(ram, player);\n this.updateHashRate(player.mults.hacknet_node_money);\n }\n\n updateHashCapacity(): void {\n this.hashCapacity = 32 * Math.pow(2, this.cache);\n }\n\n updateHashRate(prodMult: number): void {\n this.hashRate = calculateHashGainRate(this.level, this.ramUsed, this.maxRam, this.cores, prodMult);\n\n if (isNaN(this.hashRate)) {\n this.hashRate = 0;\n console.error(\n `Error calculating Hacknet Server hash production. This is a bug. Please report to game dev`,\n false,\n );\n }\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): IReviverValue {\n return Generic_toJSON(\"HacknetServer\", this);\n }\n\n // Initializes a HacknetServer Object from a JSON save state\n static fromJSON(value: IReviverValue): HacknetServer {\n return Generic_fromJSON(HacknetServer, value.data);\n }\n}\n\nReviver.constructors.HacknetServer = HacknetServer;\n","export const validScriptExtensions: Array = [`.js`, `.script`];\n\nexport function isScriptFilename(f: string): boolean {\n return validScriptExtensions.some((ext) => f.endsWith(ext));\n}\n","import { IOrderBook } from \"./IOrderBook\";\nimport { IStockMarket } from \"./IStockMarket\";\nimport { Order } from \"./Order\";\nimport { processOrders } from \"./OrderProcessing\";\nimport { Stock } from \"./Stock\";\nimport { TicksPerCycle } from \"./StockMarketConstants\";\nimport { InitStockMetadata } from \"./data/InitStockMetadata\";\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\nimport { StockSymbols } from \"./data/StockSymbols\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { IMap } from \"../types\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver } from \"../utils/JSONReviver\";\nimport { NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport let StockMarket: IStockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n} as IStockMarket; // Maps full stock name -> Stock object\nexport const SymbolToStockMap: IMap = {}; // Maps symbol -> Stock object\n\nexport function placeOrder(\n stock: Stock,\n shares: number,\n price: number,\n type: OrderTypes,\n position: PositionTypes,\n ctx?: NetscriptContext,\n): boolean {\n if (!(stock instanceof Stock)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid stock: '${stock}'`);\n } else {\n dialogBoxCreate(`ERROR: Invalid stock passed to placeOrder() function`);\n }\n return false;\n }\n if (typeof shares !== \"number\" || typeof price !== \"number\") {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: shares='${shares}' price='${price}'`);\n } else {\n dialogBoxCreate(\"ERROR: Invalid numeric value provided for either 'shares' or 'price' argument\");\n }\n return false;\n }\n\n const order = new Order(stock.symbol, shares, price, type, position);\n if (StockMarket[\"Orders\"] == null) {\n const orders: IOrderBook = {};\n for (const name of Object.keys(StockMarket)) {\n const stk = StockMarket[name];\n if (!(stk instanceof Stock)) {\n continue;\n }\n orders[stk.symbol] = [];\n }\n StockMarket[\"Orders\"] = orders;\n }\n StockMarket[\"Orders\"][stock.symbol].push(order);\n\n // Process to see if it should be executed immediately\n const processOrderRefs = {\n stockMarket: StockMarket,\n symbolToStockMap: SymbolToStockMap,\n };\n processOrders(stock, order.type, order.pos, processOrderRefs);\n\n return true;\n}\n\n// Returns true if successfully cancels an order, false otherwise\nexport interface ICancelOrderParams {\n order?: Order;\n pos?: PositionTypes;\n price?: number;\n shares?: number;\n stock?: Stock;\n type?: OrderTypes;\n}\nexport function cancelOrder(params: ICancelOrderParams, ctx?: NetscriptContext): boolean {\n if (StockMarket[\"Orders\"] == null) return false;\n if (params.order && params.order instanceof Order) {\n const order = params.order;\n // An 'Order' object is passed in\n const stockOrders = StockMarket[\"Orders\"][order.stockSymbol];\n for (let i = 0; i < stockOrders.length; ++i) {\n if (order == stockOrders[i]) {\n stockOrders.splice(i, 1);\n return true;\n }\n }\n return false;\n } else if (\n params.stock &&\n params.shares &&\n params.price &&\n params.type &&\n params.pos &&\n params.stock instanceof Stock\n ) {\n // Order properties are passed in. Need to look for the order\n const stockOrders = StockMarket[\"Orders\"][params.stock.symbol];\n const orderTxt = params.stock.symbol + \" - \" + params.shares + \" @ \" + numeralWrapper.formatMoney(params.price);\n for (let i = 0; i < stockOrders.length; ++i) {\n const order = stockOrders[i];\n if (\n params.shares === order.shares &&\n params.price === order.price &&\n params.type === order.type &&\n params.pos === order.pos\n ) {\n stockOrders.splice(i, 1);\n if (ctx) helpers.log(ctx, () => \"Successfully cancelled order: \" + orderTxt);\n return true;\n }\n }\n if (ctx) helpers.log(ctx, () => \"Failed to cancel order: \" + orderTxt);\n return false;\n }\n return false;\n}\n\nexport function loadStockMarket(saveString: string): void {\n if (saveString === \"\") {\n StockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n } as IStockMarket;\n } else StockMarket = JSON.parse(saveString, Reviver);\n}\n\nexport function deleteStockMarket(): void {\n StockMarket = {\n lastUpdate: 0,\n Orders: {},\n storedCycles: 0,\n ticksUntilCycle: 0,\n } as IStockMarket;\n}\n\nexport function initStockMarket(): void {\n for (const stk of Object.keys(StockMarket)) {\n if (StockMarket.hasOwnProperty(stk)) delete StockMarket[stk];\n }\n\n for (const metadata of InitStockMetadata) {\n const name = metadata.name;\n StockMarket[name] = new Stock(metadata);\n }\n\n const orders: IOrderBook = {};\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) continue;\n orders[stock.symbol] = [];\n }\n StockMarket[\"Orders\"] = orders;\n\n StockMarket.storedCycles = 0;\n StockMarket.lastUpdate = 0;\n StockMarket.ticksUntilCycle = TicksPerCycle;\n}\n\nexport function initSymbolToStockMap(): void {\n for (const name of Object.keys(StockSymbols)) {\n if (StockSymbols.hasOwnProperty(name)) {\n const stock = StockMarket[name];\n if (stock == null) {\n console.error(`Could not find Stock for ${name}`);\n continue;\n }\n const symbol = StockSymbols[name];\n SymbolToStockMap[symbol] = stock;\n }\n }\n}\n\nfunction stockMarketCycle(): void {\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) continue;\n\n const roll = Math.random();\n if (roll < 0.45) {\n stock.b = !stock.b;\n stock.flipForecastForecast();\n }\n\n StockMarket.ticksUntilCycle = TicksPerCycle;\n }\n}\n\n// Stock prices updated every 6 seconds\nconst msPerStockUpdate = 6e3;\nconst cyclesPerStockUpdate = msPerStockUpdate / CONSTANTS.MilliPerCycle;\nexport function processStockPrices(numCycles = 1): void {\n if (StockMarket.storedCycles == null || isNaN(StockMarket.storedCycles)) {\n StockMarket.storedCycles = 0;\n }\n StockMarket.storedCycles += numCycles;\n\n if (StockMarket.storedCycles < cyclesPerStockUpdate) {\n return;\n }\n\n // We can process the update every 4 seconds as long as there are enough\n // stored cycles. This lets us account for offline time\n const timeNow = new Date().getTime();\n if (timeNow - StockMarket.lastUpdate < 4e3) return;\n\n StockMarket.lastUpdate = timeNow;\n StockMarket.storedCycles -= cyclesPerStockUpdate;\n\n // Cycle\n if (StockMarket.ticksUntilCycle == null || typeof StockMarket.ticksUntilCycle !== \"number\") {\n StockMarket.ticksUntilCycle = TicksPerCycle;\n }\n --StockMarket.ticksUntilCycle;\n if (StockMarket.ticksUntilCycle <= 0) stockMarketCycle();\n\n const v = Math.random();\n for (const name of Object.keys(StockMarket)) {\n const stock = StockMarket[name];\n if (!(stock instanceof Stock)) continue;\n let av = (v * stock.mv) / 100;\n if (isNaN(av)) {\n av = 0.02;\n }\n\n let chc = 50;\n if (stock.b) {\n chc = (chc + stock.otlkMag) / 100;\n } else {\n chc = (chc - stock.otlkMag) / 100;\n }\n if (stock.price >= stock.cap) {\n chc = 0.1; // \"Soft Limit\" on stock price. It could still go up but its unlikely\n stock.b = false;\n }\n if (isNaN(chc)) {\n chc = 0.5;\n }\n\n const c = Math.random();\n const processOrderRefs = {\n stockMarket: StockMarket,\n symbolToStockMap: SymbolToStockMap,\n };\n if (c < chc) {\n stock.changePrice(stock.price * (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Short, processOrderRefs);\n } else {\n stock.changePrice(stock.price / (1 + av));\n processOrders(stock, OrderTypes.LimitBuy, PositionTypes.Long, processOrderRefs);\n processOrders(stock, OrderTypes.LimitSell, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopBuy, PositionTypes.Short, processOrderRefs);\n processOrders(stock, OrderTypes.StopSell, PositionTypes.Long, processOrderRefs);\n }\n\n let otlkMagChange = stock.otlkMag * av;\n if (stock.otlkMag < 5) {\n if (stock.otlkMag <= 1) {\n otlkMagChange = 1;\n } else {\n otlkMagChange *= 10;\n }\n }\n stock.cycleForecast(otlkMagChange);\n stock.cycleForecastForecast(otlkMagChange / 2);\n\n // Shares required for price movement gradually approaches max over time\n stock.shareTxUntilMovement = Math.min(stock.shareTxUntilMovement + 10, stock.shareTxForMovement);\n }\n}\n\nexport function initStockMarketFn(): void {\n initStockMarket();\n initSymbolToStockMap();\n}\n","import { IMap } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nexport const StockSymbols: IMap = {};\n\n// Stocks for companies at which you can work\nStockSymbols[LocationName.AevumECorp] = \"ECP\";\nStockSymbols[LocationName.Sector12MegaCorp] = \"MGCP\";\nStockSymbols[LocationName.Sector12BladeIndustries] = \"BLD\";\nStockSymbols[LocationName.AevumClarkeIncorporated] = \"CLRK\";\nStockSymbols[LocationName.VolhavenOmniTekIncorporated] = \"OMTK\";\nStockSymbols[LocationName.Sector12FourSigma] = \"FSIG\";\nStockSymbols[LocationName.ChongqingKuaiGongInternational] = \"KGI\";\nStockSymbols[LocationName.AevumFulcrumTechnologies] = \"FLCM\";\nStockSymbols[LocationName.IshimaStormTechnologies] = \"STM\";\nStockSymbols[LocationName.NewTokyoDefComm] = \"DCOMM\";\nStockSymbols[LocationName.VolhavenHeliosLabs] = \"HLS\";\nStockSymbols[LocationName.NewTokyoVitaLife] = \"VITA\";\nStockSymbols[LocationName.Sector12IcarusMicrosystems] = \"ICRS\";\nStockSymbols[LocationName.Sector12UniversalEnergy] = \"UNV\";\nStockSymbols[LocationName.AevumAeroCorp] = \"AERO\";\nStockSymbols[LocationName.VolhavenOmniaCybersystems] = \"OMN\";\nStockSymbols[LocationName.ChongqingSolarisSpaceSystems] = \"SLRS\";\nStockSymbols[LocationName.NewTokyoGlobalPharmaceuticals] = \"GPH\";\nStockSymbols[LocationName.IshimaNovaMedical] = \"NVMD\";\nStockSymbols[LocationName.AevumWatchdogSecurity] = \"WDS\";\nStockSymbols[LocationName.VolhavenLexoCorp] = \"LXO\";\nStockSymbols[LocationName.AevumRhoConstruction] = \"RHOC\";\nStockSymbols[LocationName.Sector12AlphaEnterprises] = \"APHE\";\nStockSymbols[LocationName.VolhavenSysCoreSecurities] = \"SYSC\";\nStockSymbols[LocationName.VolhavenCompuTek] = \"CTK\";\nStockSymbols[LocationName.AevumNetLinkTechnologies] = \"NTLK\";\nStockSymbols[LocationName.IshimaOmegaSoftware] = \"OMGA\";\nStockSymbols[LocationName.Sector12FoodNStuff] = \"FNS\";\nStockSymbols[LocationName.Sector12JoesGuns] = \"JGN\";\n\n// Stocks for other companies\nStockSymbols[\"Sigma Cosmetics\"] = \"SGC\";\nStockSymbols[\"Catalyst Ventures\"] = \"CTYS\";\nStockSymbols[\"Microdyne Technologies\"] = \"MDYN\";\nStockSymbols[\"Titan Laboratories\"] = \"TITN\";\n","import { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { Server } from \"./Server/Server\";\n\n/**\n * Returns the chance the player has to successfully hack a server\n */\nexport function calculateHackingChance(server: Server, player: IPlayer): number {\n const hackFactor = 1.75;\n const difficultyMult = (100 - server.hackDifficulty) / 100;\n const skillMult = hackFactor * player.skills.hacking;\n const skillChance = (skillMult - server.requiredHackingSkill) / skillMult;\n const chance =\n skillChance *\n difficultyMult *\n player.mults.hacking_chance *\n calculateIntelligenceBonus(player.skills.intelligence, 1);\n if (chance > 1) {\n return 1;\n }\n if (chance < 0) {\n return 0;\n }\n\n return chance;\n}\n\n/**\n * Returns the amount of hacking experience the player will gain upon\n * successfully hacking a server\n */\nexport function calculateHackingExpGain(server: Server, player: IPlayer): number {\n const baseExpGain = 3;\n const diffFactor = 0.3;\n if (server.baseDifficulty == null) {\n server.baseDifficulty = server.hackDifficulty;\n }\n let expGain = baseExpGain;\n expGain += server.baseDifficulty * diffFactor;\n\n return expGain * player.mults.hacking_exp * BitNodeMultipliers.HackExpGain;\n}\n\n/**\n * Returns the percentage of money that will be stolen from a server if\n * it is successfully hacked (returns the decimal form, not the actual percent value)\n */\nexport function calculatePercentMoneyHacked(server: Server, player: IPlayer): number {\n // Adjust if needed for balancing. This is the divisor for the final calculation\n const balanceFactor = 240;\n\n const difficultyMult = (100 - server.hackDifficulty) / 100;\n const skillMult = (player.skills.hacking - (server.requiredHackingSkill - 1)) / player.skills.hacking;\n const percentMoneyHacked =\n (difficultyMult * skillMult * player.mults.hacking_money * BitNodeMultipliers.ScriptHackMoney) / balanceFactor;\n if (percentMoneyHacked < 0) {\n return 0;\n }\n if (percentMoneyHacked > 1) {\n return 1;\n }\n\n return percentMoneyHacked;\n}\n\n/**\n * Returns time it takes to complete a hack on a server, in seconds\n */\nexport function calculateHackingTime(server: Server, player: IPlayer): number {\n const difficultyMult = server.requiredHackingSkill * server.hackDifficulty;\n\n const baseDiff = 500;\n const baseSkill = 50;\n const diffFactor = 2.5;\n let skillFactor = diffFactor * difficultyMult + baseDiff;\n // tslint:disable-next-line\n skillFactor /= player.skills.hacking + baseSkill;\n\n const hackTimeMultiplier = 5;\n const hackingTime =\n (hackTimeMultiplier * skillFactor) /\n (player.mults.hacking_speed * calculateIntelligenceBonus(player.skills.intelligence, 1));\n\n return hackingTime;\n}\n\n/**\n * Returns time it takes to complete a grow operation on a server, in seconds\n */\nexport function calculateGrowTime(server: Server, player: IPlayer): number {\n const growTimeMultiplier = 3.2; // Relative to hacking time. 16/5 = 3.2\n\n return growTimeMultiplier * calculateHackingTime(server, player);\n}\n\n/**\n * Returns time it takes to complete a weaken operation on a server, in seconds\n */\nexport function calculateWeakenTime(server: Server, player: IPlayer): number {\n const weakenTimeMultiplier = 4; // Relative to hacking time\n\n return weakenTimeMultiplier * calculateHackingTime(server, player);\n}\n","import { IPlayer } from \"../../IPlayer\";\nimport { IReviverValue } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applyWorkStats, applyWorkStatsExp, scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\n\nexport const applySleeveGains = (player: IPlayer, sleeve: Sleeve, rawStats: WorkStats, cycles = 1): void => {\n const shockedStats = scaleWorkStats(rawStats, sleeve.shockBonus(), rawStats.money > 0);\n applyWorkStatsExp(sleeve, shockedStats, cycles);\n const syncStats = scaleWorkStats(shockedStats, sleeve.syncBonus(), rawStats.money > 0);\n applyWorkStats(player, player, syncStats, cycles, \"sleeves\");\n player.sleeves.filter((s) => s != sleeve).forEach((s) => applyWorkStatsExp(s, syncStats, cycles));\n};\n\nexport abstract class Work {\n type: WorkType;\n\n constructor(type: WorkType) {\n this.type = type;\n }\n\n abstract process(player: IPlayer, sleeve: Sleeve, cycles: number): number;\n abstract APICopy(): Record;\n abstract toJSON(): IReviverValue;\n finish(__player: IPlayer): void {\n /* left for children to implement */\n }\n}\n\nexport enum WorkType {\n COMPANY = \"COMPANY\",\n FACTION = \"FACTION\",\n CRIME = \"CRIME\",\n CLASS = \"CLASS\",\n RECOVERY = \"RECOVERY\",\n SYNCHRO = \"SYNCHRO\",\n BLADEBURNER = \"BLADEBURNER\",\n INFILTRATE = \"INFILTRATE\",\n SUPPORT = \"SUPPORT\",\n}\n","import { Reviver } from \"../utils/JSONReviver\";\n\nimport { IStaneksGift } from \"./IStaneksGift\";\nimport { StaneksGift } from \"./StaneksGift\";\n\nexport let staneksGift: IStaneksGift = new StaneksGift();\n\nexport function loadStaneksGift(saveString: string): void {\n if (saveString) {\n staneksGift = JSON.parse(saveString, Reviver);\n } else {\n staneksGift = new StaneksGift();\n }\n}\n\nexport function zeros(width: number, height: number): number[][] {\n const array = [];\n\n for (let i = 0; i < width; ++i) {\n array.push(Array(height).fill(0));\n }\n\n return array;\n}\n\nexport function calculateGrid(gift: IStaneksGift): number[][] {\n const newgrid = zeros(gift.width(), gift.height()) as unknown as number[][];\n for (let i = 0; i < gift.width(); i++) {\n for (let j = 0; j < gift.height(); j++) {\n const fragment = gift.fragmentAt(i, j);\n if (!fragment) continue;\n newgrid[i][j] = 1;\n }\n }\n\n return newgrid;\n}\n","import { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nimport { Faction } from \"./Faction\";\nimport { Factions } from \"./Factions\";\nimport { Player } from \"../Player\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Settings } from \"../Settings/Settings\";\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"../PersonObjects/formulas/reputation\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { InvitationEvent } from \"./ui/InvitationModal\";\nimport { FactionNames } from \"./data/FactionNames\";\nimport { SFC32RNG } from \"../Casino/RNG\";\nimport { isFactionWork } from \"../Work/FactionWork\";\n\nexport function inviteToFaction(faction: Faction): void {\n Player.receiveInvite(faction.name);\n faction.alreadyInvited = true;\n if (!Settings.SuppressFactionInvites) {\n InvitationEvent.emit(faction);\n }\n}\n\nexport function joinFaction(faction: Faction): void {\n if (faction.isMember) return;\n faction.isMember = true;\n Player.factions.push(faction.name);\n const allFactions = Object.values(FactionNames).map((faction) => faction as string);\n Player.factions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));\n const factionInfo = faction.getInfo();\n\n //Determine what factions you are banned from now that you have joined this faction\n for (const enemy of factionInfo.enemies) {\n if (Factions[enemy] instanceof Faction) {\n Factions[enemy].isBanned = true;\n }\n }\n for (let i = 0; i < Player.factionInvitations.length; ++i) {\n if (Player.factionInvitations[i] == faction.name || Factions[Player.factionInvitations[i]].isBanned) {\n Player.factionInvitations.splice(i, 1);\n i--;\n }\n }\n}\n\n//Returns a boolean indicating whether the player has the prerequisites for the\n//specified Augmentation\nexport function hasAugmentationPrereqs(aug: Augmentation): boolean {\n return aug.prereqs.every((aug) => Player.hasAugmentation(aug));\n}\n\nexport function purchaseAugmentation(aug: Augmentation, fac: Faction, sing = false): string {\n const hasPrereqs = hasAugmentationPrereqs(aug);\n const augCosts = aug.getCost(Player);\n if (!hasPrereqs) {\n const txt = `You must first purchase or install ${aug.prereqs\n .filter((req) => !Player.hasAugmentation(req))\n .join(\",\")} before you can purchase this one.`;\n if (sing) {\n return txt;\n } else {\n dialogBoxCreate(txt);\n }\n } else if (augCosts.moneyCost !== 0 && Player.money < augCosts.moneyCost) {\n const txt = \"You don't have enough money to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (fac.playerReputation < augCosts.repCost) {\n const txt = \"You don't have enough faction reputation to purchase \" + aug.name;\n if (sing) {\n return txt;\n }\n dialogBoxCreate(txt);\n } else if (augCosts.moneyCost === 0 || Player.money >= augCosts.moneyCost) {\n const queuedAugmentation = new PlayerOwnedAugmentation(aug.name);\n if (aug.name == AugmentationNames.NeuroFluxGovernor) {\n queuedAugmentation.level = aug.getLevel(Player);\n }\n Player.queuedAugmentations.push(queuedAugmentation);\n\n Player.loseMoney(augCosts.moneyCost, \"augmentations\");\n\n if (sing) {\n return \"You purchased \" + aug.name;\n } else if (!Settings.SuppressBuyAugmentationConfirmation) {\n dialogBoxCreate(\n \"You purchased \" +\n aug.name +\n \". Its enhancements will not take \" +\n \"effect until they are installed. To install your augmentations, go to the \" +\n \"'Augmentations' tab on the left-hand navigation menu. Purchasing additional \" +\n \"augmentations will now be more expensive.\",\n );\n }\n } else {\n dialogBoxCreate(\n \"Hmm, something went wrong when trying to purchase an Augmentation. \" +\n \"Please report this to the game developer with an explanation of how to \" +\n \"reproduce this.\",\n );\n }\n return \"\";\n}\n\nexport function processPassiveFactionRepGain(numCycles: number): void {\n for (const name of Object.keys(Factions)) {\n if (isFactionWork(Player.currentWork) && name === Player.currentWork.factionName) continue;\n if (!Factions.hasOwnProperty(name)) continue;\n const faction = Factions[name];\n if (!faction.isMember) continue;\n // No passive rep for special factions\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No passive rep for gangs.\n if (Player.getGangName() === name) continue;\n // 0 favor = 1%/s\n // 50 favor = 6%/s\n // 100 favor = 11%/s\n const favorMult = Math.min(0.1, faction.favor / 1000 + 0.01);\n // Find the best of all possible favor gain, minimum 1 rep / 2 minute.\n const hRep = getHackingWorkRepGain(Player, faction.favor);\n const sRep = getFactionSecurityWorkRepGain(Player, faction.favor);\n const fRep = getFactionFieldWorkRepGain(Player, faction.favor);\n const rate = Math.max(hRep * favorMult, sRep * favorMult, fRep * favorMult, 1 / 120);\n\n faction.playerReputation += rate * numCycles * Player.mults.faction_rep * BitNodeMultipliers.FactionPassiveRepGain;\n }\n}\n\nexport const getFactionAugmentationsFiltered = (player: IPlayer, faction: Faction): string[] => {\n // If player has a gang with this faction, return (almost) all augmentations\n if (player.hasGangWith(faction.name)) {\n let augs = Object.values(StaticAugmentations);\n\n // Remove special augs\n augs = augs.filter((a) => !a.isSpecial && a.name !== AugmentationNames.CongruityImplant);\n\n if (player.bitNodeN === 2) {\n // TRP is not available outside of BN2 for Gangs\n augs.push(StaticAugmentations[AugmentationNames.TheRedPill]);\n }\n\n const rng = SFC32RNG(`BN${player.bitNodeN}.${player.sourceFileLvl(player.bitNodeN)}`);\n // Remove faction-unique augs that don't belong to this faction\n const uniqueFilter = (a: Augmentation): boolean => {\n // Keep all the non-unique one\n if (a.factions.length > 1) {\n return true;\n }\n // Keep all the ones that this faction has anyway.\n if (faction.augmentations.includes(a.name)) {\n return true;\n }\n\n return rng() >= 1 - BitNodeMultipliers.GangUniqueAugs;\n };\n augs = augs.filter(uniqueFilter);\n\n return augs.map((a) => a.name);\n }\n\n return faction.augmentations.slice();\n};\n","import { loadAliases, loadGlobalAliases, Aliases, GlobalAliases } from \"./Alias\";\nimport { Companies, loadCompanies } from \"./Company/Companies\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, loadFactions } from \"./Faction/Factions\";\nimport { loadAllGangs, AllGangs } from \"./Gang/AllGangs\";\nimport { Player, loadPlayer } from \"./Player\";\nimport {\n saveAllServers,\n loadAllServers,\n GetAllServers,\n createUniqueRandomIp,\n AddToAllServers,\n GetServer,\n} from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { loadStockMarket, StockMarket } from \"./StockMarket/StockMarket\";\nimport { staneksGift, loadStaneksGift } from \"./CotMG/Helper\";\n\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\n\nimport * as ExportBonus from \"./ExportBonus\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"./utils/JSONReviver\";\nimport { save } from \"./db\";\nimport { AwardNFG, v1APIBreak } from \"./utils/v1APIBreak\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { PlayerOwnedAugmentation } from \"./Augmentation/PlayerOwnedAugmentation\";\nimport { LocationName } from \"./Locations/data/LocationNames\";\nimport { SxProps } from \"@mui/system\";\nimport { PlayerObject } from \"./PersonObjects/Player/PlayerObject\";\nimport { pushGameSaved } from \"./Electron\";\nimport { defaultMonacoTheme } from \"./ScriptEditor/ui/themes\";\nimport { FactionNames } from \"./Faction/data/FactionNames\";\nimport { Faction } from \"./Faction/Faction\";\nimport { safetlyCreateUniqueServer } from \"./Server/ServerHelpers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { v2APIBreak } from \"./utils/v2APIBreak\";\n\n/* SaveObject.js\n * Defines the object used to save/load games\n */\n\nexport interface SaveData {\n playerIdentifier: string;\n fileName: string;\n save: string;\n savedOn: number;\n}\n\nexport interface ImportData {\n base64: string;\n playerData?: ImportPlayerData;\n}\n\nexport interface ImportPlayerData {\n identifier: string;\n lastSave: number;\n totalPlaytime: number;\n\n money: number;\n hacking: number;\n\n augmentations: number;\n factions: number;\n achievements: number;\n\n bitNode: number;\n bitNodeLevel: number;\n sourceFiles: number;\n}\n\nclass BitburnerSaveObject {\n PlayerSave = \"\";\n AllServersSave = \"\";\n CompaniesSave = \"\";\n FactionsSave = \"\";\n AliasesSave = \"\";\n GlobalAliasesSave = \"\";\n StockMarketSave = \"\";\n SettingsSave = \"\";\n VersionSave = \"\";\n AllGangsSave = \"\";\n LastExportBonus = \"\";\n StaneksGiftSave = \"\";\n\n getSaveString(excludeRunningScripts = false): string {\n this.PlayerSave = JSON.stringify(Player);\n\n this.AllServersSave = saveAllServers(excludeRunningScripts);\n this.CompaniesSave = JSON.stringify(Companies);\n this.FactionsSave = JSON.stringify(Factions);\n this.AliasesSave = JSON.stringify(Aliases);\n this.GlobalAliasesSave = JSON.stringify(GlobalAliases);\n this.StockMarketSave = JSON.stringify(StockMarket);\n this.SettingsSave = JSON.stringify(Settings);\n this.VersionSave = JSON.stringify(CONSTANTS.VersionNumber);\n this.LastExportBonus = JSON.stringify(ExportBonus.LastExportBonus);\n this.StaneksGiftSave = JSON.stringify(staneksGift);\n\n if (Player.inGang()) {\n this.AllGangsSave = JSON.stringify(AllGangs);\n }\n const saveString = btoa(unescape(encodeURIComponent(JSON.stringify(this))));\n\n return saveString;\n }\n\n saveGame(emitToastEvent = true): Promise {\n const savedOn = new Date().getTime();\n Player.lastSave = savedOn;\n const saveString = this.getSaveString(Settings.ExcludeRunningScriptsFromSave);\n return new Promise((resolve, reject) => {\n save(saveString)\n .then(() => {\n const saveData: SaveData = {\n playerIdentifier: Player.identifier,\n fileName: this.getSaveFileName(),\n save: saveString,\n savedOn,\n };\n pushGameSaved(saveData);\n\n if (emitToastEvent) {\n SnackbarEvents.emit(\"Game Saved!\", ToastVariant.INFO, 2000);\n }\n return resolve();\n })\n .catch((err) => {\n console.error(err);\n return reject();\n });\n });\n }\n\n getSaveFileName(isRecovery = false): string {\n // Save file name is based on current timestamp and BitNode\n const epochTime = Math.round(Date.now() / 1000);\n const bn = Player.bitNodeN;\n let filename = `bitburnerSave_${epochTime}_BN${bn}x${Player.sourceFileLvl(bn) + 1}.json`;\n if (isRecovery) filename = \"RECOVERY\" + filename;\n return filename;\n }\n\n exportGame(): void {\n const saveString = this.getSaveString(Settings.ExcludeRunningScriptsFromSave);\n const filename = this.getSaveFileName();\n download(filename, saveString);\n }\n\n importGame(base64Save: string, reload = true): Promise {\n if (!base64Save || base64Save === \"\") throw new Error(\"Invalid import string\");\n return save(base64Save).then(() => {\n if (reload) setTimeout(() => location.reload(), 1000);\n return Promise.resolve();\n });\n }\n\n getImportStringFromFile(files: FileList | null): Promise {\n if (files === null) return Promise.reject(new Error(\"No file selected\"));\n const file = files[0];\n if (!file) return Promise.reject(new Error(\"Invalid file selected\"));\n\n const reader = new FileReader();\n const promise: Promise = new Promise((resolve, reject) => {\n reader.onload = function (this: FileReader, e: ProgressEvent) {\n const target = e.target;\n if (target === null) {\n return reject(new Error(\"Error importing file\"));\n }\n const result = target.result;\n if (typeof result !== \"string\") {\n return reject(new Error(\"FileReader event was not type string\"));\n }\n const contents = result;\n resolve(contents);\n };\n });\n reader.readAsText(file);\n return promise;\n }\n\n async getImportDataFromString(base64Save: string): Promise {\n if (!base64Save || base64Save === \"\") throw new Error(\"Invalid import string\");\n\n let newSave;\n try {\n newSave = window.atob(base64Save);\n newSave = newSave.trim();\n } catch (error) {\n console.error(error); // We'll handle below\n }\n\n if (!newSave || newSave === \"\") {\n return Promise.reject(new Error(\"Save game had not content or was not base64 encoded\"));\n }\n\n let parsedSave;\n try {\n parsedSave = JSON.parse(newSave);\n } catch (error) {\n console.error(error); // We'll handle below\n }\n\n if (!parsedSave || parsedSave.ctor !== \"BitburnerSaveObject\" || !parsedSave.data) {\n return Promise.reject(new Error(\"Save game did not seem valid\"));\n }\n\n const data: ImportData = {\n base64: base64Save,\n };\n\n const importedPlayer = PlayerObject.fromJSON(JSON.parse(parsedSave.data.PlayerSave));\n\n const playerData: ImportPlayerData = {\n identifier: importedPlayer.identifier,\n lastSave: importedPlayer.lastSave,\n totalPlaytime: importedPlayer.totalPlaytime,\n\n money: importedPlayer.money,\n hacking: importedPlayer.skills.hacking,\n\n augmentations: importedPlayer.augmentations?.reduce((total, current) => (total += current.level), 0) ?? 0,\n factions: importedPlayer.factions?.length ?? 0,\n achievements: importedPlayer.achievements?.length ?? 0,\n\n bitNode: importedPlayer.bitNodeN,\n bitNodeLevel: importedPlayer.sourceFileLvl(Player.bitNodeN) + 1,\n sourceFiles: importedPlayer.sourceFiles?.reduce((total, current) => (total += current.lvl), 0) ?? 0,\n };\n\n data.playerData = playerData;\n return Promise.resolve(data);\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"BitburnerSaveObject\", this);\n }\n\n static fromJSON(value: IReviverValue): BitburnerSaveObject {\n return Generic_fromJSON(BitburnerSaveObject, value.data);\n }\n}\n\n// Makes necessary changes to the loaded/imported data to ensure\n// the game stills works with new versions\nfunction evaluateVersionCompatibility(ver: string | number): void {\n // We have to do this because ts won't let us otherwise\n const anyPlayer = Player as any;\n if (typeof ver === \"string\") {\n // This version refactored the Company/job-related code\n if (ver <= \"0.41.2\") {\n // Player's company position is now a string\n if (anyPlayer.companyPosition != null && typeof anyPlayer.companyPosition !== \"string\") {\n anyPlayer.companyPosition = anyPlayer.companyPosition.data.positionName;\n if (anyPlayer.companyPosition == null) {\n anyPlayer.companyPosition = \"\";\n }\n }\n\n // The \"companyName\" property of all Companies is renamed to \"name\"\n interface Company0_41_2 {\n name: string | number;\n companyName: string;\n companyPositions: Record;\n }\n for (const companyName of Object.keys(Companies)) {\n const company = Companies[companyName] as unknown as Company0_41_2;\n if (company.name == 0 && company.companyName != null) {\n company.name = company.companyName;\n }\n\n if (company.companyPositions instanceof Array) {\n const pos: Record = {};\n\n for (let i = 0; i < company.companyPositions.length; ++i) {\n pos[company.companyPositions[i]] = true;\n }\n company.companyPositions = pos;\n }\n }\n }\n\n // This version allowed players to hold multiple jobs\n if (ver < \"0.43.0\") {\n if (anyPlayer.companyName !== \"\" && anyPlayer.companyPosition != null && anyPlayer.companyPosition !== \"\") {\n anyPlayer.jobs[anyPlayer.companyName] = anyPlayer.companyPosition;\n }\n\n delete anyPlayer.companyPosition;\n }\n if (ver < \"0.56.0\") {\n for (const q of anyPlayer.queuedAugmentations) {\n if (q.name === \"Graphene BranchiBlades Upgrade\") {\n q.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n for (const q of anyPlayer.augmentations) {\n if (q.name === \"Graphene BranchiBlades Upgrade\") {\n q.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n }\n if (ver < \"0.56.1\") {\n if (anyPlayer.bladeburner === 0) {\n anyPlayer.bladeburner = null;\n }\n if (anyPlayer.gang === 0) {\n anyPlayer.gang = null;\n }\n if (anyPlayer.corporation === 0) {\n anyPlayer.corporation = null;\n }\n // convert all Messages to just filename to save space.\n const home = anyPlayer.getHomeComputer();\n for (let i = 0; i < home.messages.length; i++) {\n if (home.messages[i].filename) {\n home.messages[i] = home.messages[i].filename;\n }\n }\n }\n if (ver < \"0.58.0\") {\n const changes: [RegExp, string][] = [\n [/getStockSymbols/g, \"stock.getSymbols\"],\n [/getStockPrice/g, \"stock.getPrice\"],\n [/getStockAskPrice/g, \"stock.getAskPrice\"],\n [/getStockBidPrice/g, \"stock.getBidPrice\"],\n [/getStockPosition/g, \"stock.getPosition\"],\n [/getStockMaxShares/g, \"stock.getMaxShares\"],\n [/getStockPurchaseCost/g, \"stock.getPurchaseCost\"],\n [/getStockSaleGain/g, \"stock.getSaleGain\"],\n [/buyStock/g, \"stock.buy\"],\n [/sellStock/g, \"stock.sell\"],\n [/shortStock/g, \"stock.short\"],\n [/sellShort/g, \"stock.sellShort\"],\n [/placeOrder/g, \"stock.placeOrder\"],\n [/cancelOrder/g, \"stock.cancelOrder\"],\n [/getOrders/g, \"stock.getOrders\"],\n [/getStockVolatility/g, \"stock.getVolatility\"],\n [/getStockForecast/g, \"stock.getForecast\"],\n [/purchase4SMarketData/g, \"stock.purchase4SMarketData\"],\n [/purchase4SMarketDataTixApi/g, \"stock.purchase4SMarketDataTixApi\"],\n ];\n function convert(code: string): string {\n for (const change of changes) {\n code = code.replace(change[0], change[1]);\n }\n return code;\n }\n for (const server of GetAllServers()) {\n for (const script of server.scripts) {\n script.code = convert(script.code);\n }\n }\n }\n v1APIBreak();\n ver = 1;\n }\n if (typeof ver === \"number\") {\n if (ver < 2) {\n AwardNFG(10);\n Player.reapplyAllAugmentations(true);\n Player.reapplyAllSourceFiles();\n }\n if (ver < 3) {\n anyPlayer.money = parseFloat(anyPlayer.money);\n if (anyPlayer.corporation) {\n anyPlayer.corporation.funds = parseFloat(anyPlayer.corporation.funds);\n anyPlayer.corporation.revenue = parseFloat(anyPlayer.corporation.revenue);\n anyPlayer.corporation.expenses = parseFloat(anyPlayer.corporation.expenses);\n\n for (let i = 0; i < anyPlayer.corporation.divisions.length; ++i) {\n const ind = anyPlayer.corporation.divisions[i];\n ind.lastCycleRevenue = parseFloat(ind.lastCycleRevenue);\n ind.lastCycleExpenses = parseFloat(ind.lastCycleExpenses);\n ind.thisCycleRevenue = parseFloat(ind.thisCycleRevenue);\n ind.thisCycleExpenses = parseFloat(ind.thisCycleExpenses);\n }\n }\n }\n if (ver < 9) {\n if (StockMarket.hasOwnProperty(\"Joes Guns\")) {\n const s = StockMarket[\"Joes Guns\"];\n delete StockMarket[\"Joes Guns\"];\n StockMarket[LocationName.Sector12JoesGuns] = s;\n }\n }\n if (ver < 10) {\n // Augmentation name was changed in 0.56.0 but sleeves aug list was missed.\n if (anyPlayer.sleeves && anyPlayer.sleeves.length > 0) {\n for (const sleeve of anyPlayer.sleeves) {\n if (!sleeve.augmentations || sleeve.augmentations.length === 0) continue;\n for (const augmentation of sleeve.augmentations) {\n if (augmentation.name !== \"Graphene BranchiBlades Upgrade\") continue;\n augmentation.name = \"Graphene BrachiBlades Upgrade\";\n }\n }\n }\n }\n if (ver < 12) {\n if (anyPlayer.resleeves !== undefined) {\n delete anyPlayer.resleeves;\n }\n }\n\n if (ver < 15) {\n Settings.EditorTheme = { ...defaultMonacoTheme };\n }\n //Fix contract names\n if (ver < 16) {\n Factions[FactionNames.ShadowsOfAnarchy] = new Faction(FactionNames.ShadowsOfAnarchy);\n //Iterate over all contracts on all servers\n for (const server of GetAllServers()) {\n for (const contract of server.contracts) {\n //Rename old \"HammingCodes: Integer to encoded Binary\" contracts\n //to \"HammingCodes: Integer to Encoded Binary\"\n if (contract.type == \"HammingCodes: Integer to encoded Binary\") {\n contract.type = \"HammingCodes: Integer to Encoded Binary\";\n }\n }\n }\n }\n\n const v22PlayerBreak = () => {\n // reset HP correctly to avoid crash\n anyPlayer.hp = { current: 1, max: 1 };\n for (const sleeve of anyPlayer.sleeves) {\n sleeve.hp = { current: 1, max: 1 };\n }\n\n // transfer over old exp to new struct\n anyPlayer.exp.hacking = anyPlayer.hacking_exp;\n anyPlayer.exp.strength = anyPlayer.strength_exp;\n anyPlayer.exp.defense = anyPlayer.defense_exp;\n anyPlayer.exp.dexterity = anyPlayer.dexterity_exp;\n anyPlayer.exp.agility = anyPlayer.agility_exp;\n anyPlayer.exp.charisma = anyPlayer.charisma_exp;\n anyPlayer.exp.intelligence = anyPlayer.intelligence_exp;\n };\n\n // Fix bugged NFG accumulation in owned augmentations\n if (ver < 17) {\n let ownedNFGs = [...Player.augmentations];\n ownedNFGs = ownedNFGs.filter((aug) => aug.name === AugmentationNames.NeuroFluxGovernor);\n const newNFG = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n newNFG.level = 0;\n\n for (const nfg of ownedNFGs) {\n newNFG.level += nfg.level;\n }\n\n Player.augmentations = [\n ...Player.augmentations.filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor),\n newNFG,\n ];\n\n v22PlayerBreak();\n Player.reapplyAllAugmentations(true);\n Player.reapplyAllSourceFiles();\n }\n\n if (ver < 20) {\n // Create the darkweb for everyone but it won't be linked\n const dw = GetServer(SpecialServers.DarkWeb);\n if (!dw) {\n const darkweb = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: SpecialServers.DarkWeb,\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: false,\n purchasedByPlayer: false,\n maxRam: 1,\n });\n AddToAllServers(darkweb);\n }\n }\n if (ver < 21) {\n // 2.0.0 work rework\n AwardNFG(10);\n const create = anyPlayer[\"createProgramName\"];\n if (create) Player.getHomeComputer().pushProgram(create);\n const graft = anyPlayer[\"graftAugmentationName\"];\n if (graft) Player.augmentations.push({ name: graft, level: 1 });\n }\n if (ver < 22) {\n v22PlayerBreak();\n v2APIBreak();\n }\n if (ver < 23) {\n anyPlayer.currentWork = null;\n }\n if (ver < 24) {\n Player.getHomeComputer().scripts.forEach((s) => s.filename.endsWith(\".ns\") && (s.filename += \".js\"));\n }\n if (ver < 25) {\n const removePlayerFields = [\n \"hacking_chance_mult\",\n \"hacking_speed_mult\",\n \"hacking_money_mult\",\n \"hacking_grow_mult\",\n \"hacking_mult\",\n \"strength_mult\",\n \"defense_mult\",\n \"dexterity_mult\",\n \"agility_mult\",\n \"charisma_mult\",\n \"hacking_exp_mult\",\n \"strength_exp_mult\",\n \"defense_exp_mult\",\n \"dexterity_exp_mult\",\n \"agility_exp_mult\",\n \"charisma_exp_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"crime_money_mult\",\n \"crime_success_mult\",\n \"work_money_mult\",\n \"hacknet_node_money_mult\",\n \"hacknet_node_purchase_cost_mult\",\n \"hacknet_node_ram_cost_mult\",\n \"hacknet_node_core_cost_mult\",\n \"hacknet_node_level_cost_mult\",\n \"bladeburner_max_stamina_mult\",\n \"bladeburner_stamina_gain_mult\",\n \"bladeburner_analysis_mult\",\n \"bladeburner_success_chance_mult\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"intelligence_exp\",\n \"companyName\",\n \"isWorking\",\n \"workType\",\n \"workCostMult\",\n \"workExpMult\",\n \"currentWorkFactionName\",\n \"currentWorkFactionDescription\",\n \"workHackExpGainRate\",\n \"workStrExpGainRate\",\n \"workDefExpGainRate\",\n \"workDexExpGainRate\",\n \"workAgiExpGainRate\",\n \"workChaExpGainRate\",\n \"workRepGainRate\",\n \"workMoneyGainRate\",\n \"workMoneyLossRate\",\n \"workHackExpGained\",\n \"workStrExpGained\",\n \"workDefExpGained\",\n \"workDexExpGained\",\n \"workAgiExpGained\",\n \"workChaExpGained\",\n \"workRepGained\",\n \"workMoneyGained\",\n \"createProgramName\",\n \"createProgramReqLvl\",\n \"graftAugmentationName\",\n \"timeWorkedGraftAugmentation\",\n \"className\",\n \"crimeType\",\n \"timeWorked\",\n \"timeWorkedCreateProgram\",\n \"timeNeededToCompleteWork\",\n \"factionWorkType\",\n \"committingCrimeThruSingFn\",\n \"singFnCrimeWorkerScript\",\n \"hacking\",\n \"max_hp\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"intelligence\",\n ];\n const removeSleeveFields = [\n \"gymStatType\",\n \"bbAction\",\n \"bbContract\",\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"intelligence\",\n \"max_hp\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"intelligence_exp\",\n \"hacking_mult\",\n \"strength_mult\",\n \"defense_mult\",\n \"dexterity_mult\",\n \"agility_mult\",\n \"charisma_mult\",\n \"hacking_exp_mult\",\n \"strength_exp_mult\",\n \"defense_exp_mult\",\n \"dexterity_exp_mult\",\n \"agility_exp_mult\",\n \"charisma_exp_mult\",\n \"hacking_chance_mult\",\n \"hacking_speed_mult\",\n \"hacking_money_mult\",\n \"hacking_grow_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"crime_money_mult\",\n \"crime_success_mult\",\n \"work_money_mult\",\n \"hacknet_node_money_mult\",\n \"hacknet_node_purchase_cost_mult\",\n \"hacknet_node_ram_cost_mult\",\n \"hacknet_node_core_cost_mult\",\n \"hacknet_node_level_cost_mult\",\n \"bladeburner_max_stamina_mult\",\n \"bladeburner_stamina_gain_mult\",\n \"bladeburner_analysis_mult\",\n \"bladeburner_success_chance_mult\",\n \"className\",\n \"crimeType\",\n \"currentTask\",\n \"currentTaskLocation\",\n \"currentTaskMaxTime\",\n \"currentTaskTime\",\n \"earningsForSleeves\",\n \"earningsForPlayer\",\n \"earningsForTask\",\n \"factionWorkType\",\n \"gainRatesForTask\",\n \"logs\",\n ];\n let intExp = Number(anyPlayer.intelligence_exp);\n if (isNaN(intExp)) intExp = 0;\n anyPlayer.exp.intelligence += intExp;\n for (const field of removePlayerFields) {\n delete anyPlayer[field];\n }\n for (const sleeve of anyPlayer.sleeves) {\n const anySleeve = sleeve as any;\n let intExp = Number(anySleeve.intelligence_exp);\n if (isNaN(intExp)) intExp = 0;\n anySleeve.exp.intelligence += intExp;\n for (const field of removeSleeveFields) {\n delete sleeve[field];\n }\n }\n }\n }\n}\n\nfunction loadGame(saveString: string): boolean {\n createScamUpdateText();\n if (!saveString) return false;\n saveString = decodeURIComponent(escape(atob(saveString)));\n\n const saveObj = JSON.parse(saveString, Reviver);\n\n loadPlayer(saveObj.PlayerSave);\n loadAllServers(saveObj.AllServersSave);\n loadCompanies(saveObj.CompaniesSave);\n loadFactions(saveObj.FactionsSave);\n\n if (saveObj.hasOwnProperty(\"StaneksGiftSave\")) {\n loadStaneksGift(saveObj.StaneksGiftSave);\n } else {\n console.warn(`Could not load Staneks Gift from save`);\n loadStaneksGift(\"\");\n }\n if (saveObj.hasOwnProperty(\"AliasesSave\")) {\n try {\n loadAliases(saveObj.AliasesSave);\n } catch (e) {\n console.warn(`Could not load Aliases from save`);\n loadAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain an Aliases property`);\n loadAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"GlobalAliasesSave\")) {\n try {\n loadGlobalAliases(saveObj.GlobalAliasesSave);\n } catch (e) {\n console.warn(`Could not load GlobalAliases from save`);\n loadGlobalAliases(\"\");\n }\n } else {\n console.warn(`Save file did not contain a GlobalAliases property`);\n loadGlobalAliases(\"\");\n }\n if (saveObj.hasOwnProperty(\"StockMarketSave\")) {\n try {\n loadStockMarket(saveObj.StockMarketSave);\n } catch (e) {\n loadStockMarket(\"\");\n }\n } else {\n loadStockMarket(\"\");\n }\n if (saveObj.hasOwnProperty(\"SettingsSave\")) {\n try {\n Settings.load(saveObj.SettingsSave);\n } catch (e) {\n console.error(\"ERROR: Failed to parse Settings. Re-initing default values\");\n Settings.init();\n }\n } else {\n Settings.init();\n }\n if (saveObj.hasOwnProperty(\"LastExportBonus\")) {\n try {\n ExportBonus.setLastExportBonus(JSON.parse(saveObj.LastExportBonus));\n } catch (err) {\n ExportBonus.setLastExportBonus(new Date().getTime());\n console.error(\"ERROR: Failed to parse last export bonus Settings \" + err);\n }\n }\n if (Player.inGang() && saveObj.hasOwnProperty(\"AllGangsSave\")) {\n try {\n loadAllGangs(saveObj.AllGangsSave);\n } catch (e) {\n console.error(\"ERROR: Failed to parse AllGangsSave: \" + e);\n }\n }\n if (saveObj.hasOwnProperty(\"VersionSave\")) {\n try {\n const ver = JSON.parse(saveObj.VersionSave, Reviver);\n evaluateVersionCompatibility(ver);\n if (window.location.href.toLowerCase().includes(\"bitburner-beta\")) {\n // Beta branch, always show changes\n createBetaUpdateText();\n } else if (ver !== CONSTANTS.VersionNumber) {\n createNewUpdateText();\n }\n } catch (e) {\n createNewUpdateText();\n }\n } else {\n createNewUpdateText();\n }\n return true;\n}\n\nfunction createScamUpdateText(): void {\n if (navigator.userAgent.indexOf(\"wv\") !== -1 && navigator.userAgent.indexOf(\"Chrome/\") !== -1) {\n setInterval(() => {\n dialogBoxCreate(\"SCAM ALERT. This app is not official and you should uninstall it.\");\n }, 1000);\n }\n}\n\nconst resets: SxProps = {\n \"& h1, & h2, & h3, & h4, & p, & a, & ul\": {\n margin: 0,\n color: Settings.theme.primary,\n whiteSpace: \"initial\",\n },\n \"& ul\": {\n paddingLeft: \"1.5em\",\n lineHeight: 1.5,\n },\n};\n\nfunction createNewUpdateText(): void {\n setTimeout(\n () =>\n dialogBoxCreate(\n \"New update!
\" +\n \"Please report any bugs/issues through the GitHub repository \" +\n \"or the Bitburner subreddit (reddit.com/r/bitburner).

\" +\n CONSTANTS.LatestUpdate,\n resets,\n ),\n 1000,\n );\n}\n\nfunction createBetaUpdateText(): void {\n dialogBoxCreate(\n \"You are playing on the beta environment! This branch of the game \" +\n \"features the latest developments in the game. This version may be unstable.
\" +\n \"Please report any bugs/issues through the github repository (https://github.com/danielyxie/bitburner/issues) \" +\n \"or the Bitburner subreddit (reddit.com/r/bitburner).

\" +\n CONSTANTS.LatestUpdate,\n resets,\n );\n}\n\nfunction download(filename: string, content: string): void {\n const file = new Blob([content], { type: \"text/plain\" });\n\n const a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n}\n\nReviver.constructors.BitburnerSaveObject = BitburnerSaveObject;\n\nexport { saveObject, loadGame, download };\n\nconst saveObject = new BitburnerSaveObject();\n","// Constructs all CompanyPosition objects using the metadata in data/companypositions.ts\nimport { companyPositionMetadata } from \"./data/CompanyPositionsMetadata\";\nimport { CompanyPosition, IConstructorParams } from \"./CompanyPosition\";\nimport { IMap } from \"../types\";\n\nexport const CompanyPositions: IMap = {};\n\nfunction addCompanyPosition(params: IConstructorParams): void {\n if (CompanyPositions[params.name] != null) {\n console.warn(`Duplicate Company Position being defined: ${params.name}`);\n }\n CompanyPositions[params.name] = new CompanyPosition(params);\n}\n\ncompanyPositionMetadata.forEach((e) => {\n addCompanyPosition(e);\n});\n","export enum FactionWorkType {\n HACKING = \"HACKING\",\n FIELD = \"FIELD\",\n SECURITY = \"SECURITY\",\n}\n","/*\nThe game cannot block every possible exploits. Specially since one of them is\nthat you can just edit your save file and that's impragmatic to prevent.\n\nSo instead we have source file minus 1. It is not obtained by destroying a\nBitNode but instead it is awarded when the player finds innovative ways to break\nthe game, this serves 2 purpose, [one] the developpers don't have to spend time\ntrying to implement anti-cheat measures and [two] finding ways to break a\nhacking game is very much in the spirit of the game.\nSource-File minus 1 is extremely weak because it can be fully level up quickly.\n*/\n\nexport enum Exploit {\n Bypass = \"Bypass\",\n PrototypeTampering = \"PrototypeTampering\",\n Unclickable = \"Unclickable\",\n UndocumentedFunctionCall = \"UndocumentedFunctionCall\",\n TimeCompression = \"TimeCompression\",\n RealityAlteration = \"RealityAlteration\",\n N00dles = \"N00dles\",\n YoureNotMeantToAccessThis = \"YoureNotMeantToAccessThis\",\n TrueRecursion = \"TrueRecursion\",\n INeedARainbow = \"INeedARainbow\",\n // To the players reading this. Yes you're supposed to add EditSaveFile by\n // editing your save file, yes you could add them all, no we don't care\n // that's not the point.\n EditSaveFile = \"EditSaveFile\",\n}\n\nconst names: {\n [key: string]: string;\n} = {\n Bypass: \"by circumventing the ram cost of document.\",\n EditSaveFile: \"by editing your save file.\",\n PrototypeTampering: \"by tampering with Numbers prototype.\",\n TimeCompression: \"by compressing time.\",\n Unclickable: \"by clicking the unclickable.\",\n UndocumentedFunctionCall: \"by looking beyond the documentation.\",\n RealityAlteration: \"by altering reality to suit your whims.\",\n N00dles: \"by harnessing the power of the n00dles.\",\n YoureNotMeantToAccessThis: \"by accessing the dev menu.\",\n TrueRecursion: \"by truly recursing.\",\n INeedARainbow: \"by using the power of the rainbow.\",\n};\n\nexport function ExploitName(exploit: string): string {\n return names[exploit];\n}\n\nexport function sanitizeExploits(exploits: Exploit[]): Exploit[] {\n exploits = exploits.filter((e: Exploit) => Object.keys(Exploit).includes(e));\n return [...new Set(exploits)];\n}\n","import { Augmentation } from \"./Augmentation\";\nimport { StaticAugmentations } from \"./StaticAugmentations\";\nimport { PlayerOwnedAugmentation, IPlayerOwnedAugmentation } from \"./PlayerOwnedAugmentation\";\nimport { AugmentationNames } from \"./data/AugmentationNames\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { Player } from \"../Player\";\nimport { prestigeAugmentation } from \"../Prestige\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { clearObject } from \"../utils/helpers/clearObject\";\n\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport {\n initBladeburnerAugmentations,\n initChurchOfTheMachineGodAugmentations,\n initGeneralAugmentations,\n initSoAAugmentations,\n initNeuroFluxGovernor,\n initUnstableCircadianModulator,\n} from \"./data/AugmentationCreator\";\nimport { Router } from \"../ui/GameRoot\";\nimport { mergeMultipliers } from \"../PersonObjects/Multipliers\";\n\nexport function AddToStaticAugmentations(aug: Augmentation): void {\n const name = aug.name;\n StaticAugmentations[name] = aug;\n}\n\nfunction createAugmentations(): void {\n [\n initNeuroFluxGovernor(),\n initUnstableCircadianModulator(),\n ...initGeneralAugmentations(),\n ...initSoAAugmentations(),\n ...(factionExists(FactionNames.Bladeburners) ? initBladeburnerAugmentations() : []),\n ...(factionExists(FactionNames.ChurchOfTheMachineGod) ? initChurchOfTheMachineGodAugmentations() : []),\n ].map(resetAugmentation);\n}\n\nfunction resetFactionAugmentations(): void {\n for (const name of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(name)) {\n Factions[name].augmentations = [];\n }\n }\n}\n\nfunction initAugmentations(): void {\n resetFactionAugmentations();\n clearObject(StaticAugmentations);\n createAugmentations();\n Player.reapplyAllAugmentations();\n}\n\nexport function getBaseAugmentationPriceMultiplier(): number {\n return CONSTANTS.MultipleAugMultiplier * [1, 0.96, 0.94, 0.93][Player.sourceFileLvl(11)];\n}\nexport function getGenericAugmentationPriceMultiplier(): number {\n return Math.pow(getBaseAugmentationPriceMultiplier(), Player.queuedAugmentations.length);\n}\n\n//Resets an Augmentation during (re-initizliation)\nfunction resetAugmentation(aug: Augmentation): void {\n aug.addToFactions(aug.factions);\n const name = aug.name;\n if (augmentationExists(name)) {\n delete StaticAugmentations[name];\n }\n AddToStaticAugmentations(aug);\n}\n\nfunction applyAugmentation(aug: IPlayerOwnedAugmentation, reapply = false): void {\n const staticAugmentation = StaticAugmentations[aug.name];\n\n // Apply multipliers\n Player.mults = mergeMultipliers(Player.mults, staticAugmentation.mults);\n\n // Special logic for Congruity Implant\n if (aug.name === AugmentationNames.CongruityImplant && !reapply) {\n Player.entropy = 0;\n Player.applyEntropy(Player.entropy);\n }\n\n // Special logic for NeuroFlux Governor\n const ownedNfg = Player.augmentations.find((pAug) => pAug.name === AugmentationNames.NeuroFluxGovernor);\n if (aug.name === AugmentationNames.NeuroFluxGovernor && !reapply && ownedNfg) {\n ownedNfg.level = aug.level;\n return;\n }\n\n // Push onto Player's Augmentation list\n if (!reapply) {\n const ownedAug = new PlayerOwnedAugmentation(aug.name);\n\n Player.augmentations.push(ownedAug);\n }\n}\n\nfunction installAugmentations(force?: boolean): boolean {\n if (Player.queuedAugmentations.length == 0 && !force) {\n dialogBoxCreate(\"You have not purchased any Augmentations to install!\");\n return false;\n }\n let augmentationList = \"\";\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; ++i) {\n const ownedAug = Player.queuedAugmentations[i];\n const aug = StaticAugmentations[ownedAug.name];\n if (aug == null) {\n console.error(`Invalid augmentation: ${ownedAug.name}`);\n continue;\n }\n\n applyAugmentation(Player.queuedAugmentations[i]);\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n\n let level = \"\";\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ` - ${ownedAug.level}`;\n }\n augmentationList += aug.name + level + \"
\";\n }\n Player.queuedAugmentations = [];\n if (!force) {\n dialogBoxCreate(\n \"You slowly drift to sleep as scientists put you under in order \" +\n \"to install the following Augmentations:
\" +\n augmentationList +\n \"
You wake up in your home...you feel different...\",\n );\n }\n prestigeAugmentation();\n Router.toTerminal();\n return true;\n}\n\nfunction augmentationExists(name: string): boolean {\n return StaticAugmentations.hasOwnProperty(name);\n}\n\nexport function isRepeatableAug(aug: Augmentation): boolean {\n const augName = aug instanceof Augmentation ? aug.name : aug;\n return augName === AugmentationNames.NeuroFluxGovernor;\n}\n\nexport { installAugmentations, initAugmentations, applyAugmentation, augmentationExists };\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Money } from \"./Money\";\n\nexport function MoneyRate({ money }: { money: number }): JSX.Element {\n return ;\n}\n","import { codingContractTypesMetadata, DescriptionFunc, GeneratorFunc, SolverFunc } from \"./data/codingcontracttypes\";\n\nimport { IMap } from \"./types\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"./utils/JSONReviver\";\nimport { CodingContractEvent } from \"./ui/React/CodingContractModal\";\n\n/* tslint:disable:no-magic-numbers completed-docs max-classes-per-file no-console */\n\n/* Represents different types of problems that a Coding Contract can have */\nclass CodingContractType {\n /**\n * Function that generates a description of the problem\n */\n desc: DescriptionFunc;\n\n /**\n * Number that generally represents the problem's difficulty. Bigger numbers = harder\n */\n difficulty: number;\n\n /**\n * A function that randomly generates a valid 'data' for the problem\n */\n generate: GeneratorFunc;\n\n /**\n * Name of the type of problem\n */\n name: string;\n\n /**\n * The maximum number of tries the player gets on this kind of problem before it self-destructs\n */\n numTries: number;\n\n /**\n * Stores a function that checks if the provided answer is correct\n */\n solver: SolverFunc;\n\n constructor(\n name: string,\n desc: DescriptionFunc,\n gen: GeneratorFunc,\n solver: SolverFunc,\n diff: number,\n numTries: number,\n ) {\n this.name = name;\n this.desc = desc;\n this.generate = gen;\n this.solver = solver;\n this.difficulty = diff;\n this.numTries = numTries;\n }\n}\n\n/* Contract Types */\n// tslint:disable-next-line\nexport const CodingContractTypes: IMap = {};\n\nfor (const md of codingContractTypesMetadata) {\n // tslint:disable-next-line\n CodingContractTypes[md.name] = new CodingContractType(\n md.name,\n md.desc,\n md.gen,\n md.solver,\n md.difficulty,\n md.numTries,\n );\n}\n\n/**\n * Enum representing the different types of rewards a Coding Contract can give\n */\nexport enum CodingContractRewardType {\n FactionReputation,\n FactionReputationAll,\n CompanyReputation,\n Money, // This must always be the last reward type\n}\n\n/**\n * Enum representing the result when trying to solve the Contract\n */\nexport enum CodingContractResult {\n Success,\n Failure,\n Cancelled,\n}\n\n/**\n * A class that represents the type of reward a contract gives\n */\nexport interface ICodingContractReward {\n /* Name of Company/Faction name for reward, if applicable */\n name?: string;\n type: CodingContractRewardType;\n}\n\n/**\n * A Coding Contract is a file that poses a programming-related problem to the Player.\n * The player receives a reward if the problem is solved correctly\n */\nexport class CodingContract {\n /* Relevant data for the contract's problem */\n data: unknown;\n\n /* Contract's filename */\n fn: string;\n\n /* Describes the reward given if this Contract is solved. The reward is actually\n processed outside of this file */\n reward: ICodingContractReward | null;\n\n /* Number of times the Contract has been attempted */\n tries = 0;\n\n /* String representing the contract's type. Must match type in ContractTypes */\n type: string;\n\n constructor(fn = \"\", type = \"Find Largest Prime Factor\", reward: ICodingContractReward | null = null) {\n this.fn = fn;\n if (!this.fn.endsWith(\".cct\")) {\n this.fn += \".cct\";\n }\n\n // tslint:disable-next-line\n if (CodingContractTypes[type] == null) {\n throw new Error(`Error: invalid contract type: ${type} please contact developer`);\n }\n\n this.type = type;\n this.data = CodingContractTypes[type].generate();\n this.reward = reward;\n }\n\n getData(): unknown {\n return this.data;\n }\n\n getDescription(): string {\n return CodingContractTypes[this.type].desc(this.data);\n }\n\n getDifficulty(): number {\n return CodingContractTypes[this.type].difficulty;\n }\n\n getMaxNumTries(): number {\n return CodingContractTypes[this.type].numTries;\n }\n\n getType(): string {\n return CodingContractTypes[this.type].name;\n }\n\n isSolution(solution: string): boolean {\n return CodingContractTypes[this.type].solver(this.data, solution);\n }\n\n /**\n * Creates a popup to prompt the player to solve the problem\n */\n async prompt(): Promise {\n return new Promise((resolve) => {\n const props = {\n c: this,\n onClose: () => {\n resolve(CodingContractResult.Cancelled);\n },\n onAttempt: (val: string) => {\n if (this.isSolution(val)) {\n resolve(CodingContractResult.Success);\n } else {\n resolve(CodingContractResult.Failure);\n }\n },\n };\n CodingContractEvent.emit(props);\n });\n }\n\n /**\n * Serialize the current file to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CodingContract\", this);\n }\n\n /**\n * Initiatizes a CodingContract from a JSON save state.\n */\n static fromJSON(value: IReviverValue): CodingContract {\n return Generic_fromJSON(CodingContract, value.data);\n }\n}\n\nReviver.constructors.CodingContract = CodingContract;\n","export enum OrderTypes {\n LimitBuy = \"Limit Buy Order\",\n LimitSell = \"Limit Sell Order\",\n StopBuy = \"Stop Buy Order\",\n StopSell = \"Stop Sell Order\",\n}\n","import { FragmentType } from \"./FragmentType\";\nimport { Shapes } from \"./data/Shapes\";\n\nexport const Fragments: Fragment[] = [];\n\nexport class Fragment {\n id: number;\n shape: boolean[][];\n type: FragmentType;\n power: number;\n limit: number;\n\n constructor(id: number, shape: boolean[][], type: FragmentType, power: number, limit: number) {\n this.id = id;\n this.shape = shape;\n this.type = type;\n this.power = power;\n this.limit = limit;\n }\n\n fullAt(x: number, y: number, rotation: number): boolean {\n if (y < 0) return false;\n if (y >= this.height(rotation)) return false;\n if (x < 0) return false;\n if (x >= this.width(rotation)) return false;\n // start xy, modifier xy\n let [sx, sy, mx, my] = [0, 0, 1, 1];\n if (rotation === 1) {\n [sx, sy, mx, my] = [this.width(rotation) - 1, 0, -1, 1];\n } else if (rotation === 2) {\n [sx, sy, mx, my] = [this.width(rotation) - 1, this.height(rotation) - 1, -1, -1];\n } else if (rotation === 3) {\n [sx, sy, mx, my] = [0, this.height(rotation) - 1, 1, -1];\n }\n let [qx, qy] = [sx + mx * x, sy + my * y];\n if (rotation % 2 === 1) [qx, qy] = [qy, qx];\n return this.shape[qy][qx];\n }\n\n width(rotation: number): number {\n if (rotation % 2 === 0) return this.shape[0].length;\n return this.shape.length;\n }\n\n height(rotation: number): number {\n if (rotation % 2 === 0) return this.shape.length;\n return this.shape[0].length;\n }\n\n // List of direct neighboors of this fragment.\n neighboors(rotation: number): number[][] {\n const candidates: number[][] = [];\n\n const add = (x: number, y: number): void => {\n if (this.fullAt(x, y, rotation)) return;\n if (candidates.some((coord) => coord[0] === x && coord[1] === y)) return;\n candidates.push([x, y]);\n };\n for (let y = 0; y < this.height(rotation); y++) {\n for (let x = 0; x < this.width(rotation); x++) {\n // This cell is full, add all it's neighboors.\n if (!this.fullAt(x, y, rotation)) continue;\n add(x - 1, y);\n add(x + 1, y);\n add(x, y - 1);\n add(x, y + 1);\n }\n }\n const cells: number[][] = [];\n for (const candidate of candidates) {\n if (cells.some((cell) => cell[0] === candidate[0] && cell[1] === candidate[1])) continue;\n cells.push(candidate);\n }\n\n return cells;\n }\n\n copy(): Fragment {\n return Object.assign({}, this);\n }\n}\n\nexport function FragmentById(id: number): Fragment | null {\n for (const fragment of Fragments) {\n if (fragment.id === id) return fragment;\n }\n return null;\n}\n\n(function () {\n const _ = false;\n const X = true;\n Fragments.push(\n new Fragment(\n 0, // id\n Shapes.S,\n FragmentType.Hacking, // type\n 1,\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 1, // id\n Shapes.Z,\n FragmentType.Hacking, // type\n 1,\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 5, // id\n Shapes.T,\n FragmentType.HackingSpeed, // type\n 1.3,\n 1, // limit\n ),\n );\n\n Fragments.push(\n new Fragment(\n 6, // id\n Shapes.I,\n FragmentType.HackingMoney, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 7, // id\n Shapes.J,\n FragmentType.HackingGrow, // type\n 0.5, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 10, // id\n Shapes.T,\n FragmentType.Strength, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 12, // id\n Shapes.L,\n FragmentType.Defense, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 14, // id\n Shapes.L,\n FragmentType.Dexterity, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 16, // id\n Shapes.S,\n FragmentType.Agility, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 18, // id\n Shapes.S,\n FragmentType.Charisma, // type\n 3, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 20, // id\n Shapes.I,\n FragmentType.HacknetMoney, // type\n 1, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 21, // id\n Shapes.O,\n FragmentType.HacknetCost, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 25, // id\n Shapes.J,\n FragmentType.Rep, // type\n 0.5, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 27, // id\n Shapes.J,\n FragmentType.WorkMoney, // type\n 10, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 28, // id\n Shapes.L,\n FragmentType.Crime, // type\n 2, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 30, // id\n Shapes.S,\n FragmentType.Bladeburner, // type\n 0.4, // power\n 1, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 100, // id\n [\n // shape\n [_, X, X],\n [X, X, _],\n [_, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 101, // id\n [\n // shape\n [X, X, X, X],\n [X, _, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 102, // id\n [\n // shape\n [_, X, X, X],\n [X, X, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 103, // id\n [\n // shape\n [X, X, X, _],\n [_, _, X, X],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 104, // id\n [\n // shape\n [_, X, X],\n [_, X, _],\n [X, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 105, // id\n [\n // shape\n [_, _, X],\n [_, X, X],\n [X, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 106, // id\n [\n // shape\n [X, _, _],\n [X, X, X],\n [X, _, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n Fragments.push(\n new Fragment(\n 107, // id\n [\n // shape\n [_, X, _],\n [X, X, X],\n [_, X, _],\n ],\n FragmentType.Booster, // type\n 1.1, // power\n 99, // limit\n ),\n );\n})();\n\nexport const NoneFragment = new Fragment(-2, [], FragmentType.None, 0, Infinity);\nexport const DeleteFragment = new Fragment(-2, [], FragmentType.Delete, 0, Infinity);\n","import * as monaco from \"monaco-editor\";\nimport type { Monaco } from \"@monaco-editor/react\";\n\nexport interface IScriptEditorTheme {\n base: \"vs\" | \"vs-dark\" | \"hc-black\";\n inherit: boolean;\n common: {\n accent: string;\n bg: string;\n fg: string;\n };\n syntax: {\n tag: string;\n entity: string;\n string: string;\n regexp: string;\n markup: string;\n keyword: string;\n comment: string;\n constant: string;\n error: string;\n };\n ui: {\n line: string;\n panel: {\n bg: string;\n selected: string;\n border: string;\n };\n selection: {\n bg: string;\n };\n };\n}\n\nexport const defaultMonacoTheme: IScriptEditorTheme = {\n base: \"vs-dark\",\n inherit: true,\n common: {\n accent: \"B5CEA8\",\n bg: \"1E1E1E\",\n fg: \"D4D4D4\",\n },\n syntax: {\n tag: \"569CD6\",\n entity: \"569CD6\",\n string: \"CE9178\",\n regexp: \"646695\",\n markup: \"569CD6\",\n keyword: \"569CD6\",\n comment: \"6A9955\",\n constant: \"569CD6\",\n error: \"F44747\",\n },\n ui: {\n line: \"1E1E1E\",\n panel: {\n bg: \"252526\",\n selected: \"252526\",\n border: \"1E1E1E\",\n },\n selection: {\n bg: \"ADD6FF26\",\n },\n },\n};\n\n// Regex used for token color validation\n// https://github.com/microsoft/vscode/blob/973684056e67153952f495fce93bf50d0ec0b892/src/vs/editor/common/languages/supports/tokenization.ts#L153\nconst colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;\n\n// Recursively sanitize the theme data to prevent errors\n// Invalid data will be replaced with FF0000 (bright red)\nexport const sanitizeTheme = (theme: IScriptEditorTheme): void => {\n for (const [k, v] of Object.entries(theme)) {\n switch (k) {\n case \"base\":\n if (![\"vs-dark\", \"vs\"].includes(theme.base)) theme.base = \"vs-dark\";\n continue;\n case \"inherit\":\n if (typeof theme.inherit !== \"boolean\") theme.inherit = true;\n continue;\n }\n\n const repairBlock = (block: { [key: string]: object | string }): void => {\n for (const [k, v] of Object.entries(block)) {\n if (typeof v === \"object\") {\n repairBlock(v as { [key: string]: string });\n } else if (!v.match(colorRegExp)) block[k] = \"FF0000\";\n }\n };\n repairBlock(v);\n }\n};\n\nexport function makeTheme(theme: IScriptEditorTheme): monaco.editor.IStandaloneThemeData {\n const themeRules = [\n {\n token: \"\",\n background: theme.ui.line,\n foreground: theme.common.fg,\n },\n {\n token: \"identifier\",\n foreground: theme.common.accent,\n },\n {\n token: \"keyword\",\n foreground: theme.syntax.keyword,\n },\n {\n token: \"string\",\n foreground: theme.syntax.string,\n },\n {\n token: \"string.escape\",\n foreground: theme.syntax.regexp,\n },\n {\n token: \"comment\",\n foreground: theme.syntax.comment,\n },\n {\n token: \"constant\",\n foreground: theme.syntax.constant,\n },\n {\n token: \"entity\",\n foreground: theme.syntax.entity,\n },\n {\n token: \"type\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"tag\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"regexp\",\n foreground: theme.syntax.regexp,\n },\n {\n token: \"attribute\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"constructor\",\n foreground: theme.syntax.markup,\n },\n {\n token: \"invalid\",\n foreground: theme.syntax.error,\n },\n {\n token: \"number\",\n foreground: theme.common.accent,\n },\n {\n token: \"delimiter\",\n foreground: theme.common.fg,\n },\n // Custom tokens\n {\n token: \"ns\",\n foreground: theme.syntax.tag,\n },\n {\n token: \"netscriptfunction\",\n foreground: theme.syntax.markup,\n },\n {\n token: \"otherkeywords\",\n foreground: theme.syntax.keyword,\n },\n {\n token: \"otherkeyvars\",\n foreground: theme.common.accent,\n },\n {\n token: \"this\",\n foreground: theme.syntax.tag,\n },\n ];\n\n const themeColors = Object.fromEntries(\n [\n [\"editor.background\", theme.common.bg],\n [\"editor.foreground\", theme.common.fg],\n [\"editor.lineHighlightBackground\", theme.ui.line],\n [\"editor.selectionBackground\", theme.ui.selection.bg],\n\n [\"editorSuggestWidget.background\", theme.ui.panel.bg],\n [\"editorSuggestWidget.border\", theme.ui.panel.border],\n [\"editorSuggestWidget.selectedBackground\", theme.ui.panel.selected],\n\n [\"editorHoverWidget.background\", theme.ui.panel.bg],\n [\"editorHoverWidget.border\", theme.ui.panel.border],\n\n [\"editorWidget.background\", theme.ui.panel.bg],\n [\"editorWidget.border\", theme.ui.panel.border],\n\n [\"input.background\", theme.ui.panel.bg],\n [\"input.border\", theme.ui.panel.border],\n ].map(([k, v]) => [k, \"#\" + v]),\n );\n\n return { base: theme.base, inherit: theme.inherit, rules: themeRules, colors: themeColors };\n}\n\nexport async function loadThemes(monaco: Monaco): Promise {\n monaco.editor.defineTheme(\"monokai\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"272822\",\n token: \"\",\n },\n {\n foreground: \"75715e\",\n token: \"comment\",\n },\n {\n foreground: \"e6db74\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"ae81ff\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"ae81ff\",\n },\n {\n foreground: \"ae81ff\",\n token: \"function\",\n },\n {\n foreground: \"f92672\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"ae81ff\",\n },\n {\n token: \"ns\",\n foreground: \"97d92b\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"53d3e4\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"53d3e4\",\n },\n {\n token: \"this\",\n foreground: \"fd971f\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#F8F8F2\",\n \"editor.background\": \"#272822\",\n \"editor.selectionBackground\": \"#49483E\",\n \"editor.lineHighlightBackground\": \"#3E3D32\",\n \"editorCursor.foreground\": \"#F8F8F0\",\n \"editorWhitespace.foreground\": \"#3B3A32\",\n \"editorIndentGuide.activeBackground\": \"#9D550FB0\",\n \"editor.selectionHighlightBorder\": \"#222218\",\n },\n });\n\n monaco.editor.defineTheme(\"solarized-dark\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"002b36\",\n token: \"\",\n },\n {\n foreground: \"586e75\",\n token: \"comment\",\n },\n {\n foreground: \"00afaf\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"00afaf\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"268bd2\",\n },\n {\n foreground: \"268bd2\",\n token: \"function\",\n },\n {\n foreground: \"859900\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"cb4b16\",\n },\n {\n token: \"ns\",\n foreground: \"cb4b16\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"268bd2\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"268bd2\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"b58900\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"this\",\n foreground: \"cb4b16\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#839496\",\n \"editor.background\": \"#002b36\",\n \"editor.selectionBackground\": \"#073642\",\n \"editor.lineHighlightBackground\": \"#073642\",\n \"editorCursor.foreground\": \"#819090\",\n \"editorWhitespace.foreground\": \"#073642\",\n \"editorIndentGuide.activeBackground\": \"#9D550FB0\",\n \"editor.selectionHighlightBorder\": \"#222218\",\n },\n });\n\n monaco.editor.defineTheme(\"solarized-light\", {\n base: \"vs\",\n inherit: true,\n rules: [\n {\n foreground: \"657b83\",\n background: \"fdf6e3\",\n token: \"\",\n },\n {\n foreground: \"586e75\",\n token: \"comment\",\n },\n {\n foreground: \"2aa198\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"2aa198\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"268bd2\",\n },\n {\n foreground: \"268bd2\",\n token: \"function\",\n },\n {\n foreground: \"859900\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"bc4b16\",\n },\n {\n token: \"ns\",\n foreground: \"cb4b16\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"268bd2\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"268bd2\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"b58900\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"0087ff\",\n },\n {\n token: \"this\",\n foreground: \"cb4b16\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#657b83\",\n \"editor.background\": \"#fdf6e3\",\n \"editor.selectionBackground\": \"#eee8d5\",\n \"editor.lineHighlightBackground\": \"#eee8d5\",\n \"editorCursor.foreground\": \"#657b83\",\n \"editorWhitespace.foreground\": \"#eee8d5\",\n \"editorIndentGuide.activeBackground\": \"#eee8d5\",\n \"editor.selectionHighlightBorder\": \"#073642\",\n },\n });\n\n monaco.editor.defineTheme(\"dracula\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n background: \"282A36\",\n foreground: \"F8F8F2\",\n token: \"\",\n },\n {\n foreground: \"6272A4\",\n token: \"comment\",\n },\n {\n foreground: \"F1FA8C\",\n token: \"string\",\n },\n {\n token: \"number\",\n foreground: \"BD93F9\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"BD93F9\",\n },\n {\n foreground: \"FF79C6\",\n token: \"function\",\n },\n {\n foreground: \"FF79C6\",\n token: \"keyword\",\n },\n {\n token: \"storage.type.function.js\",\n foreground: \"FF79C6\",\n },\n {\n token: \"ns\",\n foreground: \"FFB86C\",\n fontStyle: \"italic\",\n },\n\n {\n token: \"netscriptfunction\",\n foreground: \"FF79C6\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"FF68A7\",\n },\n {\n token: \"type.identifier.js\",\n foreground: \"7EE9FD\",\n fontStyle: \"italic\",\n },\n {\n token: \"delimiter.square.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"delimiter.parenthesis.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"delimiter.bracket.js\",\n foreground: \"FFD709\",\n },\n {\n token: \"this\",\n foreground: \"BD93F9\",\n fontStyle: \"italic\",\n },\n ],\n colors: {\n \"editor.foreground\": \"#F8F8F2\",\n \"editor.background\": \"#282A36\",\n \"editorLineNumber.foreground\": \"#6272A4\",\n \"editor.selectionBackground\": \"#44475A\",\n \"editor.selectionHighlightBackground\": \"#424450\",\n \"editor.foldBackground\": \"#21222C\",\n \"editor.wordHighlightBackground\": \"#8BE9FD50\",\n \"editor.wordHighlightStrongBackground\": \"#50FA7B50\",\n \"editor.findMatchBackground\": \"#FFB86C80\",\n \"editor.findMatchHighlightBackground\": \"#FFFFFF40\",\n \"editor.findRangeHighlightBackground\": \"#44475A75\",\n \"editor.hoverHighlightBackground\": \"#8BE9FD50\",\n \"editor.lineHighlightBorder\": \"#44475A\",\n \"editor.rangeHighlightBackground\": \"#BD93F915\",\n \"editor.snippetTabstopHighlightBackground\": \"#282A36\",\n \"editor.snippetTabstopHighlightBorder\": \"#6272A4\",\n \"editor.snippetFinalTabstopHighlightBackground\": \"#282A36\",\n \"editor.snippetFinalTabstopHighlightBorder\": \"#50FA7B\",\n },\n });\n\n monaco.editor.defineTheme(\"one-dark\", {\n base: \"vs-dark\",\n inherit: true,\n rules: [\n {\n token: \"\",\n background: \"333842\",\n foreground: \"ABB2BF\",\n },\n {\n token: \"comment\",\n foreground: \"5C6370\",\n },\n {\n token: \"string\",\n foreground: \"98C379\",\n },\n {\n token: \"number\",\n foreground: \"D19A66\",\n },\n {\n token: \"function\",\n foreground: \"C678DD\",\n },\n {\n token: \"keyword\",\n foreground: \"C678DD\",\n },\n {\n token: \"otherkeyvars\",\n foreground: \"D19A66\",\n },\n {\n token: \"otherkeywords\",\n foreground: \"C678DD\",\n },\n {\n token: \"ns\",\n foreground: \"E06C75\",\n },\n {\n token: \"netscriptfunction\",\n foreground: \"61AFEF\",\n },\n {\n token: \"type.identifier\",\n foreground: \"E5C07B\",\n },\n {\n token: \"delimiter\",\n foreground: \"ABB2BF\",\n },\n {\n token: \"this\",\n foreground: \"E06C75\",\n },\n ],\n colors: {\n \"editor.background\": \"#282C34\",\n \"editor.foreground\": \"#ABB2BF\",\n \"editor.lineHighlightBackground\": \"#99BBFF0A\",\n \"editor.selectionBackground\": \"#3E4451\",\n \"editor.findMatchHighlightBackground\": \"#528BFF3D\",\n \"editorCursor.foreground\": \"#528BFF\",\n \"editorHoverWidget.background\": \"#21252B\",\n \"editorHoverWidget.border\": \"#181A1F\",\n \"editorIndentGuide.background\": \"#ABB2BF26\",\n \"editorIndentGuide.activeBackground\": \"#626772\",\n \"editorLineNumber.foreground\": \"#636D83\",\n \"editorLineNumber.activeForeground\": \"#ABB2BF\",\n \"editorSuggestWidget.background\": \"#21252B\",\n \"editorSuggestWidget.border\": \"#181A1F\",\n \"editorSuggestWidget.selectedBackground\": \"#2C313A\",\n \"editorWhitespace.foreground\": \"#ABB2BF26\",\n \"editorWidget.background\": \"#21252B\",\n \"editorWidget.border\": \"#3A3F4B\",\n \"input.background\": \"#1B1D23\",\n \"input.border\": \"#181A1F\",\n \"peekView.border\": \"#528BFF\",\n \"peekViewResult.background\": \"#21252B\",\n \"peekViewResult.selectionBackground\": \"#2C313A\",\n \"peekViewTitle.background\": \"#1B1D23\",\n \"peekViewEditor.background\": \"#1B1D23\",\n \"scrollbarSlider.background\": \"#4E566680\",\n \"scrollbarSlider.activeBackground\": \"#747D9180\",\n \"scrollbarSlider.hoverBackground\": \"#5A637580\",\n },\n });\n}\n","/**\n * Generic Event Emitter class following a subscribe/publish paradigm.\n */\nfunction uuidv4(): string {\n return \"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx\".replace(/[xy]/g, function (c) {\n const r = (Math.random() * 16) | 0,\n v = c == \"x\" ? r : (r & 0x3) | 0x8;\n return v.toString(16);\n });\n}\n\nexport class EventEmitter {\n subscribers: { [key: string]: (...args: [...T]) => void | undefined } = {};\n\n subscribe(s: (...args: [...T]) => void): () => void {\n let uuid = uuidv4();\n while (this.subscribers[uuid] !== undefined) uuid = uuidv4();\n this.subscribers[uuid] = s;\n\n return () => {\n delete this.subscribers[uuid];\n };\n }\n\n emit(...args: [...T]): void {\n for (const s in this.subscribers) {\n const sub = this.subscribers[s];\n if (sub === undefined) continue;\n\n sub(...args);\n }\n }\n}\n","import React, { useState } from \"react\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport RemoveIcon from \"@mui/icons-material/Remove\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ClearIcon from \"@mui/icons-material/Clear\";\nimport DoubleArrowIcon from \"@mui/icons-material/DoubleArrow\";\nimport TextField from \"@mui/material/TextField\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n label: string;\n placeholder: string;\n add: (x: number) => void;\n subtract: (x: number) => void;\n tons: () => void;\n reset: () => void;\n}\n\nexport function Adjuster(props: IProps): React.ReactElement {\n const [value, setValue] = useState(\"\");\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setValue(\"\");\n else setValue(parseFloat(event.target.value));\n }\n\n const { label, placeholder, add, subtract, reset, tons } = props;\n return (\n <>\n \n \n \n \n \n \n \n add(typeof value !== \"string\" ? value : 0)} size=\"large\">\n \n \n \n \n ),\n endAdornment: (\n <>\n \n subtract(typeof value !== \"string\" ? value : 0)} size=\"large\">\n \n \n \n \n \n \n \n \n \n ),\n }}\n />\n \n );\n}\n","import { KEY } from \"../utils/helpers/keyCodes\";\n\nexport function random(min: number, max: number): number {\n return Math.random() * (max - min) + min;\n}\n\nexport const upArrowSymbol = \"↑\";\nexport const downArrowSymbol = \"↓\";\nexport const leftArrowSymbol = \"←\";\nexport const rightArrowSymbol = \"→\";\n\nexport function getArrow(event: KeyboardEvent): string {\n switch (event.key) {\n case KEY.UP_ARROW:\n case KEY.W:\n return upArrowSymbol;\n case KEY.LEFT_ARROW:\n case KEY.A:\n return leftArrowSymbol;\n case KEY.DOWN_ARROW:\n case KEY.S:\n return downArrowSymbol;\n case KEY.RIGHT_ARROW:\n case KEY.D:\n return rightArrowSymbol;\n }\n return \"\";\n}\n\nexport function getInverseArrow(event: KeyboardEvent): string {\n switch (event.key) {\n case KEY.DOWN_ARROW:\n case KEY.S:\n return upArrowSymbol;\n case KEY.RIGHT_ARROW:\n case KEY.D:\n return leftArrowSymbol;\n case KEY.UP_ARROW:\n case KEY.W:\n return downArrowSymbol;\n case KEY.LEFT_ARROW:\n case KEY.A:\n return rightArrowSymbol;\n }\n return \"\";\n}\n","import { Operation, IOperationParams } from \"./Operation\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class BlackOperation extends Operation {\n constructor(params: IOperationParams | null = null) {\n super(params);\n this.count = 1;\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1.5;\n }\n\n getChaosCompetencePenalty(/*inst: IBladeburner, params: ISuccessChanceParams*/): number {\n return 1;\n }\n\n getChaosDifficultyBonus(/*inst: IBladeburner, params: ISuccessChanceParams*/): number {\n return 1;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"BlackOperation\", this);\n }\n\n static fromJSON(value: IReviverValue): Operation {\n return Generic_fromJSON(BlackOperation, value.data);\n }\n}\n\nReviver.constructors.BlackOperation = BlackOperation;\n","export enum CrimeType {\n None = \"\",\n SHOPLIFT = \"SHOPLIFT\", //\"shoplift\",\n ROB_STORE = \"ROBSTORE\", //\"rob a store\",\n MUG = \"MUG\", //\"mug someone\",\n LARCENY = \"LARCENY\", //\"commit larceny\",\n DRUGS = \"DRUGS\", //\"deal drugs\",\n BOND_FORGERY = \"BONDFORGERY\", //\"forge corporate bonds\",\n TRAFFIC_ARMS = \"TRAFFICKARMS\", //\"traffick illegal arms\",\n HOMICIDE = \"HOMICIDE\", //\"commit homicide\",\n GRAND_THEFT_AUTO = \"GRANDTHEFTAUTO\", //\"commit grand theft auto\",\n KIDNAP = \"KIDNAP\", //\"kidnap someone for ransom\",\n ASSASSINATION = \"ASSASSINATION\", //\"assassinate a high-profile target\",\n HEIST = \"HEIST\", //\"pull off the ultimate heist\",\n}\n","// Defines the ResearchTree that is common to all Corporation Industries\n// i.e. all Industries have these types of Research available to unlock\nimport { Research } from \"../Research\";\nimport { ResearchMap } from \"../ResearchMap\";\nimport { ResearchTree, Node } from \"../ResearchTree\";\n\nfunction makeNode(name: string): Node {\n const research: Research | null = ResearchMap[name];\n if (research == null) {\n throw new Error(`Invalid research name: ${name}`);\n }\n\n return new Node({ text: research.name, cost: research.cost });\n}\n\n// Creates the Nodes for the BaseResearchTree.\n// Return the Root Node\nfunction createBaseResearchTreeNodes(): Node {\n const rootNode: Node = makeNode(\"Hi-Tech R&D Laboratory\");\n const autoBrew: Node = makeNode(\"AutoBrew\");\n const autoParty: Node = makeNode(\"AutoPartyManager\");\n const autoDrugs: Node = makeNode(\"Automatic Drug Administration\");\n const bulkPurchasing: Node = makeNode(\"Bulk Purchasing\");\n const cph4: Node = makeNode(\"CPH4 Injections\");\n const drones: Node = makeNode(\"Drones\");\n const dronesAssembly: Node = makeNode(\"Drones - Assembly\");\n const dronesTransport: Node = makeNode(\"Drones - Transport\");\n const goJuice: Node = makeNode(\"Go-Juice\");\n const hrRecruitment: Node = makeNode(\"HRBuddy-Recruitment\");\n const hrTraining: Node = makeNode(\"HRBuddy-Training\");\n const joywire: Node = makeNode(\"JoyWire\");\n const marketta1: Node = makeNode(\"Market-TA.I\");\n const marketta2: Node = makeNode(\"Market-TA.II\");\n const overclock: Node = makeNode(\"Overclock\");\n const scAssemblers: Node = makeNode(\"Self-Correcting Assemblers\");\n const stimu: Node = makeNode(\"Sti.mu\");\n\n autoDrugs.addChild(goJuice);\n autoDrugs.addChild(cph4);\n\n drones.addChild(dronesAssembly);\n drones.addChild(dronesTransport);\n\n hrRecruitment.addChild(hrTraining);\n\n marketta1.addChild(marketta2);\n\n overclock.addChild(stimu);\n\n rootNode.addChild(autoBrew);\n rootNode.addChild(autoParty);\n rootNode.addChild(autoDrugs);\n rootNode.addChild(bulkPurchasing);\n rootNode.addChild(drones);\n rootNode.addChild(hrRecruitment);\n rootNode.addChild(joywire);\n rootNode.addChild(marketta1);\n rootNode.addChild(overclock);\n rootNode.addChild(scAssemblers);\n\n return rootNode;\n}\n\nexport function getBaseResearchTreeCopy(): ResearchTree {\n const baseResearchTree: ResearchTree = new ResearchTree();\n baseResearchTree.setRoot(createBaseResearchTreeNodes());\n\n return baseResearchTree;\n}\n\n// Base Research Tree for Industry's that make products\nexport function getProductIndustryResearchTreeCopy(): ResearchTree {\n const researchTree: ResearchTree = new ResearchTree();\n const root = createBaseResearchTreeNodes();\n\n const upgradeFulcrum = makeNode(\"uPgrade: Fulcrum\");\n const upgradeCapacity1 = makeNode(\"uPgrade: Capacity.I\");\n const upgradeCapacity2 = makeNode(\"uPgrade: Capacity.II\");\n const upgradeDashboard = makeNode(\"uPgrade: Dashboard\");\n\n upgradeCapacity1.addChild(upgradeCapacity2);\n upgradeFulcrum.addChild(upgradeCapacity1);\n upgradeFulcrum.addChild(upgradeDashboard);\n root.addChild(upgradeFulcrum);\n\n researchTree.setRoot(root);\n\n return researchTree;\n}\n","import { GetServer, createUniqueRandomIp, ipExists } from \"./AllServers\";\nimport { Server, IConstructorParams } from \"./Server\";\nimport { BaseServer } from \"./BaseServer\";\nimport { calculateServerGrowth } from \"./formulas/grow\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Programs } from \"../Programs/Programs\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\n\nimport { isValidNumber } from \"../utils/helpers/isValidNumber\";\n\n/**\n * Constructs a new server, while also ensuring that the new server\n * does not have a duplicate hostname/ip.\n */\nexport function safetlyCreateUniqueServer(params: IConstructorParams): Server {\n let hostname: string = params.hostname.replace(/ /g, `-`);\n\n if (params.ip != null && ipExists(params.ip)) {\n params.ip = createUniqueRandomIp();\n }\n\n if (GetServer(hostname) != null) {\n hostname = `${hostname}-0`;\n\n // Use a for loop to ensure that we don't get suck in an infinite loop somehow\n for (let i = 0; i < 200; ++i) {\n hostname = hostname.replace(/-[0-9]+$/, `-${i}`);\n if (GetServer(hostname) == null) {\n break;\n }\n }\n }\n\n params.hostname = hostname;\n return new Server(params);\n}\n\n/**\n * Returns the number of \"growth cycles\" needed to grow the specified server by the\n * specified amount.\n * @param server - Server being grown\n * @param growth - How much the server is being grown by, in DECIMAL form (e.g. 1.5 rather than 50)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowth(server: Server, growth: number, p: IPlayer, cores = 1): number {\n let ajdGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;\n if (ajdGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n ajdGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n const serverGrowthPercentage = server.serverGrowth / 100;\n\n const coreBonus = 1 + (cores - 1) / 16;\n const cycles =\n Math.log(growth) /\n (Math.log(ajdGrowthRate) *\n p.mults.hacking_grow *\n serverGrowthPercentage *\n BitNodeMultipliers.ServerGrowthRate *\n coreBonus);\n\n return cycles;\n}\n\n/**\n * Replacement function for the above function that accounts for the +$1/thread functionality of grow\n * with parameters that are the same (for compatibility), but functionality is slightly different.\n * This function can ONLY be used to calculate the threads needed for a given server in its current state,\n * and so wouldn't be appropriate to use for formulas.exe or ns.growthAnalyze (as those are meant to\n * provide theoretical scenarios, or inverse hack respectively). Players COULD use this function with a\n * custom server object with the correct moneyAvailable and moneyMax amounts, combined with a multiplier\n * correctly calculated to bring the server to a new moneyAvailable (ie, passing in moneyAvailable 300 and x2\n * when you want the number of threads required to grow that particular server from 300 to 600), and this\n * function would pass back the correct number of threads. But the key thing is that it doesn't just\n * inverse/undo a hack (since the amount hacked from/to matters, not just the multiplier).\n * The above is also a rather unnecessarily obtuse way of thinking about it for a formulas.exe type of\n * application, so another function with different parameters is provided for that case below this one.\n * Instead this function is meant to hand-off from the old numCycleForGrowth function to the new one\n * where used internally for pro-rating or the like. Where you have applied a grow and want to determine\n * how many threads were needed for THAT SPECIFIC grow case using a multiplier.\n * Ideally, this function, and the original function above will be depreciated to use the methodology\n * and inputs of the new function below this one. Even for internal cases (it's actually easier to do so).\n * @param server - Server being grown\n * @param growth - How much the server money is expected to be multiplied by (e.g. 1.5 for *1.5 / +50%)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowthTransition(server: Server, growth: number, p: IPlayer, cores = 1): number {\n return numCycleForGrowthCorrected(server, server.moneyAvailable * growth, server.moneyAvailable, p, cores);\n}\n\n/**\n * This function calculates the number of threads needed to grow a server from one $amount to a higher $amount\n * (ie, how many threads to grow this server from $200 to $600 for example). Used primarily for a formulas (or possibly growthAnalyze)\n * type of application. It lets you \"theorycraft\" and easily ask what-if type questions. It's also the one that implements the\n * main thread calculation algorithm, and so is the function all helper functions should call.\n * It protects the inputs (so putting in INFINITY for targetMoney will use moneyMax, putting in a negative for start will use 0, etc.)\n * @param server - Server being grown\n * @param targetMoney - How much you want the server grown TO (not by), for instance, to grow from 200 to 600, input 600\n * @param startMoney - How much you are growing the server from, for instance, to grow from 200 to 600, input 200\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowthCorrected(\n server: Server,\n targetMoney: number,\n startMoney: number,\n p: IPlayer,\n cores = 1,\n): number {\n if (startMoney < 0) {\n startMoney = 0;\n } // servers \"can't\" have less than 0 dollars on them\n if (targetMoney > server.moneyMax) {\n targetMoney = server.moneyMax;\n } // can't grow a server to more than its moneyMax\n if (targetMoney <= startMoney) {\n return 0;\n } // no growth --> no threads\n\n // exponential base adjusted by security\n const adjGrowthRate = 1 + (CONSTANTS.ServerBaseGrowthRate - 1) / server.hackDifficulty;\n const exponentialBase = Math.min(adjGrowthRate, CONSTANTS.ServerMaxGrowthRate); // cap growth rate\n\n // total of all grow thread multipliers\n const serverGrowthPercentage = server.serverGrowth / 100.0;\n const coreMultiplier = 1 + (cores - 1) / 16;\n const threadMultiplier =\n serverGrowthPercentage * p.mults.hacking_grow * coreMultiplier * BitNodeMultipliers.ServerGrowthRate;\n\n /* To understand what is done below we need to do some math. I hope the explanation is clear enough.\n * First of, the names will be shortened for ease of manipulation:\n * n:= targetMoney (n for new), o:= startMoney (o for old), b:= exponentialBase, t:= threadMultiplier, c:= cycles/threads\n * c is what we are trying to compute.\n *\n * After growing, the money on a server is n = (o + c) * b^(c*t)\n * c appears in an exponent and outside it, this is usually solved using the productLog/lambert's W special function\n * this function will be noted W in the following\n * The idea behind lambert's W function is W(x)*exp(W(x)) = x, or in other words, solving for y, y*exp(y) = x, as a function of x\n * This function is provided in some advanced math library but we will compute it ourself here.\n *\n * Let's get back to solving the equation. It cannot be rewrote using W immediately because the base of the exponentiation is b\n * b^(c*t) = exp(ln(b)*c*t) (this is how a^b is defined on reals, it matches the definition on integers)\n * so n = (o + c) * exp(ln(b)*c*t) , W still cannot be used directly. We want to eliminate the other terms in 'o + c' and 'ln(b)*c*t'.\n *\n * A change of variable will do. The idea is to add an equation introducing a new variable (w here) in the form c = f(w) (for some f)\n * With this equation we will eliminate all references to c, then solve for w and plug the result in the new equation to get c.\n * The change of variable performed here should get rid of the unwanted terms mentionned above, c = w/(ln(b)*t) - o should help.\n * This change of variable is allowed because whatever the value of c is, there is a value of w such that this equation holds:\n * w = (c + o)*ln(b)*t (see how we used the terms we wanted to eliminate in order to build this variable change)\n *\n * We get n = (o + w/(ln(b)*t) - o) * exp(ln(b)*(w/(ln(b)*t) - o)*t) [ = w/(ln(b)*t) * exp(w - ln(b)*o*t) ]\n * The change of variable exposed exp(w - o*ln(b)*t), we can rewrite that with exp(a - b) = exp(a)/exp(b) to isolate 'w*exp(w)'\n * n = w/(ln(b)*t) * exp(w)/exp(ln(b)*o*t) [ = w*exp(w) / (ln(b) * t * b^(o*t)) ]\n * Almost there, we just need to cancel the denominator on the right side of the equation:\n * n * ln(b) * t * b^(o*t) = w*exp(w), Thus w = W(n * ln(b) * t * b^(o*t))\n * Finally we invert the variable change: c = W(n * ln(b) * t * b^(o*t))/(ln(b)*t) - o\n *\n * There is still an issue left: b^(o*t) doesn't fit inside a double precision float\n * because the typical amount of money on servers is arround 10^6~10^9\n * We need to get an approximation of W without computing the power when o is huge\n * Thankfully an approximation giving ~30% error uses log immediately so we will use\n * W(n * ln(b) * t * b^(o*t)) ~= log(n * ln(b) * t * b^(o*t)) = log(n * ln(b) * t) + log(exp(ln(b) * o * t))\n * = log(n * ln(b) * t) + ln(b) * o * t\n * (thanks to Drak for the grow formula, f4113nb34st and Wolfram Alpha for the rewrite, dwRchyngqxs for the explanation)\n */\n const x = threadMultiplier * Math.log(exponentialBase);\n const y = startMoney * x + Math.log(targetMoney * x);\n /* Code for the approximation of lambert's W function is adapted from\n * https://git.savannah.gnu.org/cgit/gsl.git/tree/specfunc/lambert.c\n * using the articles [1] https://doi.org/10.1007/BF02124750 (algorithm above)\n * and [2] https://doi.org/10.1145/361952.361970 (initial approximation when x < 2.5)\n */\n let w;\n if (y < Math.log(2.5)) {\n /* exp(y) can be safely computed without overflow.\n * The relative error on the result is better when exp(y) < 2.5\n * using Padé rational fraction approximation [2](5)\n */\n const ey = Math.exp(y);\n w = (ey + (4 / 3) * ey * ey) / (1 + (7 / 3) * ey + (5 / 6) * ey * ey);\n } else {\n /* obtain initial approximation from rough asymptotic [1](4.18)\n * w = y [- log y when 0 <= y]\n */\n w = y;\n if (y > 0) w -= Math.log(y);\n }\n let cycles = w / x - startMoney;\n\n /* Iterative refinement, the goal is to correct c until |(o + c) * b^(c*t) - n| < 1\n * or the correction on the approximation is less than 1\n * The Newton-Raphson method will be used, this method is a classic to find roots of functions\n * (given f, find c such that f(c) = 0).\n *\n * The idea of this method is to take the horizontal position at which the horizontal axis\n * intersects with of the tangent of the function's curve as the next approximation.\n * It is equivalent to treating the curve as a line (it is called a first order approximation)\n * If the current approximation is c then the new approximated value is c - f(c)/f'(c)\n * (where f' is the derivative of f).\n *\n * In our case f(c) = (o + c) * b^(c*t) - n, f'(c) = d((o + c) * b^(c*t) - n)/dc\n * = (ln(b)*t * (c + o) + 1) * b^(c*t)\n * And the update step is c[new] = c[old] - ((o + c) * b^(c*t) - n)/((ln(b)*t * (o + c) + 1) * b^(c*t))\n *\n * The main question to ask when using this method is \"does it converges?\"\n * (are the approximations getting better?), if it does then it does quickly.\n * DOES IT CONVERGES? In the present case it does. The reason why doesn't help explaining the algorithm.\n * If you are intrested then check out the wikipedia page.\n */\n const bt = exponentialBase ** threadMultiplier;\n let corr = Infinity;\n // Two sided error because we do not want to get stuck if the error stays on the wrong side\n do {\n // c should be above 0 so Halley's method can't be used, we have to stick to Newton-Raphson\n const bct = bt ** cycles;\n const opc = startMoney + cycles;\n const diff = opc * bct - targetMoney;\n corr = diff / (opc * x + 1.0) / bct;\n cycles -= corr;\n } while (Math.abs(corr) >= 1);\n /* c is now within +/- 1 of the exact result.\n * We want the ceiling of the exact result, so the floor if the approximation is above,\n * the ceiling if the approximation is in the same unit as the exact result,\n * and the ceiling + 1 if the approximation is below.\n */\n const fca = Math.floor(cycles);\n if (targetMoney <= (startMoney + fca) * Math.pow(exponentialBase, fca * threadMultiplier)) {\n return fca;\n }\n const cca = Math.ceil(cycles);\n if (targetMoney <= (startMoney + cca) * Math.pow(exponentialBase, cca * threadMultiplier)) {\n return cca;\n }\n return cca + 1;\n}\n\n/**\n * This function calculates the number of threads needed to grow a server based on a pre-hack money and hackAmt\n * (ie, if you're hacking a server with $1e6 moneyAvail for 60%, this function will tell you how many threads to regrow it\n * A good replacement for the current ns.growthAnalyze if you want players to have more control/responsibility\n * @param server - Server being grown\n * @param hackProp - the proportion of money hacked (total, not per thread, like 0.60 for hacking 60% of available money)\n * @param prehackMoney - how much money the server had before being hacked (like 200000 for hacking a server that had $200000 on it at time of hacking)\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed to reverse the described hack\n */\nexport function numCycleForGrowthByHackAmt(\n server: Server,\n hackProp: number,\n prehackMoney: number,\n p: IPlayer,\n cores = 1,\n): number {\n if (prehackMoney > server.moneyMax) prehackMoney = server.moneyMax;\n const posthackMoney = Math.floor(prehackMoney * Math.min(1, Math.max(0, 1 - hackProp)));\n return numCycleForGrowthCorrected(server, prehackMoney, posthackMoney, p, cores);\n}\n\n/**\n * This function calculates the number of threads needed to grow a server based on an expected growth multiplier assuming it will max out\n * (ie, if you expect to grow a server by 60% to reach maxMoney, this function will tell you how many threads to grow it)\n * PROBABLY the best replacement for the current ns.growthAnalyze to maintain existing scripts\n * @param server - Server being grown\n * @param growth - How much the server is being grown by, as a multiple in DECIMAL form (e.g. 1.5 rather than 50). Infinity is acceptable.\n * @param p - Reference to Player object\n * @returns Number of \"growth cycles\" needed\n */\nexport function numCycleForGrowthByMultiplier(server: Server, growth: number, p: IPlayer, cores = 1): number {\n if (growth < 1.0) growth = 1.0;\n const targetMoney = server.moneyMax;\n const startingMoney = server.moneyMax / growth;\n return numCycleForGrowthCorrected(server, targetMoney, startingMoney, p, cores);\n}\n\n//Applied server growth for a single server. Returns the percentage growth\nexport function processSingleServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {\n let serverGrowth = calculateServerGrowth(server, threads, p, cores);\n if (serverGrowth < 1) {\n console.warn(\"serverGrowth calculated to be less than 1\");\n serverGrowth = 1;\n }\n\n const oldMoneyAvailable = server.moneyAvailable;\n server.moneyAvailable += 1 * threads; // It can be grown even if it has no money\n server.moneyAvailable *= serverGrowth;\n\n // in case of data corruption\n if (isValidNumber(server.moneyMax) && isNaN(server.moneyAvailable)) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // cap at max\n if (isValidNumber(server.moneyMax) && server.moneyAvailable > server.moneyMax) {\n server.moneyAvailable = server.moneyMax;\n }\n\n // if there was any growth at all, increase security\n if (oldMoneyAvailable !== server.moneyAvailable) {\n let usedCycles = numCycleForGrowthCorrected(server, server.moneyAvailable, oldMoneyAvailable, p, cores);\n // Growing increases server security twice as much as hacking\n usedCycles = Math.min(Math.max(0, Math.ceil(usedCycles)), threads);\n server.fortify(2 * CONSTANTS.ServerFortifyAmount * usedCycles);\n }\n return server.moneyAvailable / oldMoneyAvailable;\n}\n\nexport function prestigeHomeComputer(player: IPlayer, homeComp: Server): void {\n const hasBitflume = homeComp.programs.includes(Programs.BitFlume.name);\n\n homeComp.programs.length = 0; //Remove programs\n homeComp.runningScripts = [];\n homeComp.serversOnNetwork = [];\n homeComp.isConnectedTo = true;\n homeComp.ramUsed = 0;\n homeComp.programs.push(Programs.NukeProgram.name);\n if (hasBitflume) {\n homeComp.programs.push(Programs.BitFlume.name);\n }\n\n //Update RAM usage on all scripts\n homeComp.scripts.forEach(function (script) {\n script.updateRamUsage(player, homeComp.scripts);\n });\n\n homeComp.messages.length = 0; //Remove .lit and .msg files\n homeComp.messages.push(LiteratureNames.HackersStartingHandbook);\n}\n\n// Returns the i-th server on the specified server's network\n// A Server's serverOnNetwork property holds only the IPs. This function returns\n// the actual Server object\nexport function getServerOnNetwork(server: BaseServer, i: number): BaseServer | null {\n if (i > server.serversOnNetwork.length) {\n console.error(\"Tried to get server on network that was out of range\");\n return null;\n }\n\n return GetServer(server.serversOnNetwork[i]);\n}\n\nexport function isBackdoorInstalled(server: BaseServer): boolean {\n if (server instanceof Server) {\n return server.backdoorInstalled;\n }\n return false;\n}\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { ICorporation } from \"../ICorporation\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n unbuyable: {\n color: theme.palette.action.disabled,\n },\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\ninterface IProps {\n money: number;\n corp: ICorporation;\n}\n\nexport function MoneyCost(props: IProps): React.ReactElement {\n const classes = useStyles();\n if (!(props.corp.funds > props.money))\n return {numeralWrapper.formatMoney(props.money)};\n\n return {numeralWrapper.formatMoney(props.money)};\n}\n","import { FormControlLabel, Switch, Tooltip, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IProps {\n checked: boolean;\n onChange: (newValue: boolean, error?: string) => void;\n text: React.ReactNode;\n tooltip: React.ReactNode;\n}\n\nexport function OptionSwitch({ checked, onChange, text, tooltip }: IProps): React.ReactElement {\n const [value, setValue] = useState(checked);\n\n function handleSwitchChange(event: React.ChangeEvent): void {\n setValue(event.target.checked);\n }\n\n useEffect(() => onChange(value), [value]);\n\n return (\n <>\n }\n label={\n {tooltip}
}>\n {text}\n \n }\n />\n
\n \n );\n}\n","export const SkillNames: {\n BladesIntuition: string;\n Cloak: string;\n Marksman: string;\n WeaponProficiency: string;\n ShortCircuit: string;\n DigitalObserver: string;\n Tracer: string;\n Overclock: string;\n Reaper: string;\n EvasiveSystem: string;\n Datamancer: string;\n CybersEdge: string;\n HandsOfMidas: string;\n Hyperdrive: string;\n} = {\n BladesIntuition: \"Blade's Intuition\",\n Cloak: \"Cloak\",\n Marksman: \"Marksman\",\n WeaponProficiency: \"Weapon Proficiency\",\n ShortCircuit: \"Short-Circuit\",\n DigitalObserver: \"Digital Observer\",\n Tracer: \"Tracer\",\n Overclock: \"Overclock\",\n Reaper: \"Reaper\",\n EvasiveSystem: \"Evasive System\",\n Datamancer: \"Datamancer\",\n CybersEdge: \"Cyber's Edge\",\n HandsOfMidas: \"Hands of Midas\",\n Hyperdrive: \"Hyperdrive\",\n};\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n reputation: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Reputation({ reputation }: { reputation: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n \n {typeof reputation === \"number\" ? numeralWrapper.formatReputation(reputation) : reputation}\n \n );\n}\n","import React, { useContext } from \"react\";\nimport { IGang } from \"../IGang\";\n\nexport const Context: {\n Gang: React.Context;\n} = {\n Gang: React.createContext({} as IGang),\n};\n\nexport const useGang = (): IGang => useContext(Context.Gang);\n","/**\n * Stops an actively-running script (represented by a WorkerScript object)\n * and removes it from the global pool of active scripts.\n */\nimport { ScriptDeath } from \"./ScriptDeath\";\nimport { WorkerScript } from \"./WorkerScript\";\nimport { workerScripts } from \"./WorkerScripts\";\nimport { WorkerScriptStartStopEventEmitter } from \"./WorkerScriptStartStopEventEmitter\";\n\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { AddRecentScript } from \"./RecentScripts\";\nimport { Player } from \"../Player\";\n\nexport type killScriptParams = WorkerScript | number | { runningScript: RunningScript; hostname: string };\n\nexport function killWorkerScript(params: killScriptParams): boolean {\n if (params instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(params);\n\n return true;\n } else if (typeof params === \"number\") {\n return killWorkerScriptByPid(params);\n } else {\n // Try to kill by PID\n const res = killWorkerScriptByPid(params.runningScript.pid);\n if (res) {\n return res;\n }\n\n // If for some reason that doesn't work, we'll try the old way\n for (const ws of workerScripts.values()) {\n if (ws.scriptRef === params.runningScript) {\n stopAndCleanUpWorkerScript(ws);\n return true;\n }\n }\n\n return false;\n }\n}\n\nfunction killWorkerScriptByPid(pid: number): boolean {\n const ws = workerScripts.get(pid);\n if (ws instanceof WorkerScript) {\n stopAndCleanUpWorkerScript(ws);\n return true;\n }\n\n return false;\n}\n\nfunction stopAndCleanUpWorkerScript(ws: WorkerScript): void {\n killNetscriptDelay(ws);\n if (typeof ws.atExit === \"function\") {\n try {\n ws.env.stopFlag = false;\n ws.atExit();\n } catch (e: unknown) {\n let message = e instanceof ScriptDeath ? e.errorMessage : String(e);\n message = message.replace(/.*\\|DELIMITER\\|/, \"\");\n dialogBoxCreate(\n `Error trying to call atExit for script ${[ws.name, ...ws.args].join(\" \")} on ${ws.hostname}\\n ${message}`,\n );\n console.error(e);\n }\n ws.atExit = undefined;\n }\n ws.env.stopFlag = true;\n removeWorkerScript(ws);\n}\n\n/**\n * Helper function that removes the script being killed from the global pool.\n * Also handles other cleanup-time operations\n *\n * @param {WorkerScript} - Identifier for WorkerScript. Either the object itself, or\n * its index in the global workerScripts array\n */\nfunction removeWorkerScript(workerScript: WorkerScript): void {\n const ip = workerScript.hostname;\n\n // Get the server on which the script runs\n const server = GetServer(ip);\n if (server == null) {\n console.error(`Could not find server on which this script is running: ${ip}`);\n return;\n }\n\n // Delete the RunningScript object from that server\n for (let i = 0; i < server.runningScripts.length; ++i) {\n const runningScript = server.runningScripts[i];\n if (runningScript === workerScript.scriptRef) {\n server.runningScripts.splice(i, 1);\n break;\n }\n }\n\n // Recalculate ram used on that server\n\n server.updateRamUsed(0, Player);\n for (const rs of server.runningScripts) server.updateRamUsed(server.ramUsed + rs.ramUsage * rs.threads, Player);\n\n // Delete script from global pool (workerScripts)\n workerScripts.delete(workerScript.pid);\n // const res = workerScripts.delete(workerScript.pid);\n // if (!res) {\n // console.warn(`removeWorkerScript() called with WorkerScript that wasn't in the global map:`);\n // console.warn(workerScript);\n // }\n AddRecentScript(workerScript);\n\n WorkerScriptStartStopEventEmitter.emit();\n}\n\n/**\n * Helper function that interrupts a script's delay if it is in the middle of a\n * timed, blocked operation (like hack(), sleep(), etc.). This allows scripts to\n * be killed immediately even if they're in the middle of one of those long operations\n */\nfunction killNetscriptDelay(workerScript: WorkerScript): void {\n if (workerScript instanceof WorkerScript) {\n if (workerScript.delay) {\n clearTimeout(workerScript.delay);\n if (workerScript.delayReject) {\n workerScript.delayReject(new ScriptDeath(workerScript));\n }\n }\n }\n}\n","import React from \"react\";\nimport { BitNodeMultipliers, IBitNodeMultipliers } from \"./BitNodeMultipliers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IMap } from \"../types\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { CityName } from \"../Locations/data/CityNames\";\n\nclass BitNode {\n // A short description, or tagline, about the BitNode\n desc: string;\n\n // A long, detailed overview of the BitNode\n info: JSX.Element;\n\n // Name of BitNode\n name: string;\n\n // BitNode number\n number: number;\n\n difficulty: 0 | 1 | 2;\n\n constructor(n: number, difficulty: 0 | 1 | 2, name: string, desc = \"\", info: JSX.Element = <>) {\n this.number = n;\n this.difficulty = difficulty;\n this.name = name;\n this.desc = desc;\n this.info = info;\n }\n}\n\nexport const BitNodes: IMap = {};\n\nBitNodes[\"BitNode1\"] = new BitNode(\n 1,\n 0,\n \"Source Genesis\",\n \"The original BitNode\",\n (\n <>\n The first BitNode created by the Enders to imprison the minds of humans. It became the prototype and\n testing-grounds for all of the BitNodes that followed.\n
\n
\n This is the first BitNode that you play through. It has no special modifications or mechanics.\n
\n
\n Destroying this BitNode will give you Source-File 1, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets the player start with 32GB of RAM on his/her home computer when\n entering a new BitNode, and also increases all of the player's multipliers by:\n
\n
\n Level 1: 16%\n
\n Level 2: 24%\n
\n Level 3: 28%\n \n ),\n);\nBitNodes[\"BitNode2\"] = new BitNode(\n 2,\n 0,\n \"Rise of the Underworld\",\n \"From the shadows, they rose\", //Gangs\n (\n <>\n From the shadows, they rose.\n
\n
\n Organized crime groups quickly filled the void of power left behind from the collapse of Western government in the\n 2050s. As society and civilization broke down, people quickly succumbed to the innate human impulse of evil and\n savagery. The organized crime factions quickly rose to the top of the modern world.\n
\n
\n Certain Factions ({FactionNames.SlumSnakes}, {FactionNames.Tetrads}, {FactionNames.TheSyndicate},{\" \"}\n {FactionNames.TheDarkArmy}, {FactionNames.SpeakersForTheDead}, {FactionNames.NiteSec}, {FactionNames.TheBlackHand}\n ) give the player the ability to form and manage their own gangs. These gangs will earn the player money and\n reputation with the corresponding Faction\n
\n Every Augmentation in the game will be available through the Factions listed above\n
\n
\n Destroying this BitNode will give you Source-File 2, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to form gangs in other BitNodes once your karma decreases\n to a certain value. It also increases the player's crime success rate, crime money, and charisma multipliers by:\n
\n
\n Level 1: 24%\n
\n Level 2: 36%\n
\n Level 3: 42%\n \n ),\n);\nBitNodes[\"BitNode3\"] = new BitNode(\n 3,\n 0,\n \"Corporatocracy\",\n \"The Price of Civilization\",\n (\n <>\n Our greatest illusion is that a healthy society can revolve around a single-minded pursuit of wealth.\n
\n
\n Sometime in the early 21st century economic and political globalization turned the world into a corporatocracy,\n and it never looked back. Now, the privileged elite will happily bankrupt their own countrymen, decimate their own\n community, and evict their neighbors from houses in their desperate bid to increase their wealth.\n
\n
\n In this BitNode you can create and manage your own corporation. Running a successful corporation has the potential\n of generating massive profits.\n
\n
\n Destroying this BitNode will give you Source-File 3, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you create corporations on other BitNodes (although some\n BitNodes will disable this mechanic) and level 3 permanently unlocks the full API. This Source-File also increases\n your charisma and company salary multipliers by:\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nBitNodes[\"BitNode4\"] = new BitNode(\n 4,\n 1,\n \"The Singularity\",\n \"The Man and the Machine\",\n (\n <>\n The Singularity has arrived. The human race is gone, replaced by artificially superintelligent beings that are\n more machine than man.
\n
\n
\n In this BitNode you will gain access to a new set of Netscript Functions known as Singularity Functions. These\n functions allow you to control most aspects of the game through scripts, including working for factions/companies,\n purchasing/installing Augmentations, and creating programs.\n
\n
\n Destroying this BitNode will give you Source-File 4, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets you access and use the Singularity Functions in other BitNodes.\n Each level of this Source-File reduces the RAM cost of singularity functions:\n
\n Level 1: 16x\n
\n Level 2: 4x\n
\n Level 3: 1x\n \n ),\n);\nBitNodes[\"BitNode5\"] = new BitNode(\n 5,\n 1,\n \"Artificial Intelligence\",\n \"Posthuman\",\n (\n <>\n They said it couldn't be done. They said the human brain, along with its consciousness and intelligence, couldn't\n be replicated. They said the complexity of the brain results from unpredictable, nonlinear interactions that\n couldn't be modeled by 1's and 0's. They were wrong.\n
\n
\n Destroying this BitNode will give you Source-File 5, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants you a special new stat called Intelligence. Intelligence is\n unique because it is permanent and persistent (it never gets reset back to 1). However gaining Intelligence\n experience is much slower than other stats. Higher Intelligence levels will boost your production for many actions\n in the game.
\n
\n In addition, this Source-File will unlock the getBitNodeMultipliers() Netscript function and let you start with\n Formulas.exe, and will also raise all of your hacking-related multipliers by:\n
\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nBitNodes[\"BitNode6\"] = new BitNode(\n 6,\n 1,\n FactionNames.Bladeburners,\n \"Like Tears in Rain\",\n (\n <>\n In the middle of the 21st century, {FactionNames.OmniTekIncorporated} began designing and manufacturing advanced\n synthetic androids, or Synthoids for short. They achieved a major technological breakthrough in the sixth\n generation of their Synthoid design, called MK-VI, by developing a hyperintelligent AI. Many argue that this was\n the first sentient AI ever created. This resulted in Synthoid models that were stronger, faster, and more\n intelligent than the humans that had created them.\n
\n
\n In this BitNode you will be able to access the {FactionNames.Bladeburners} Division at the NSA, which provides a\n new mechanic for progression.\n
\n
\n Destroying this BitNode will give you Source-File 6, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the NSA's {FactionNames.Bladeburners} Division\n in other BitNodes. In addition, this Source-File will raise both the level and experience gain rate of all your\n combat stats by:\n
\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nBitNodes[\"BitNode7\"] = new BitNode(\n 7,\n 2,\n `${FactionNames.Bladeburners} 2079`,\n \"More human than humans\",\n (\n <>\n In the middle of the 21st century, you were doing cutting-edge work at {FactionNames.OmniTekIncorporated} as part\n of the AI design team for advanced synthetic androids, or Synthoids for short. You helped achieve a major\n technological breakthrough in the sixth generation of the company's Synthoid design, called MK-VI, by developing a\n hyperintelligent AI. Many argue that this was the first sentient AI ever created. This resulted in Synthoid models\n that were stronger, faster, and more intelligent than the humans that had created them.\n
\n
\n In this BitNode you will be able to access the {FactionNames.Bladeburners} API, which allows you to access{\" \"}\n {FactionNames.Bladeburners}\n functionality through Netscript.\n
\n
\n Destroying this BitNode will give you Source-File 7, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File allows you to access the {FactionNames.Bladeburners} Netscript API in\n other BitNodes. In addition, this Source-File will increase all of your {FactionNames.Bladeburners} multipliers\n by:\n
\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nBitNodes[\"BitNode8\"] = new BitNode(\n 8,\n 2,\n \"Ghost of Wall Street\",\n \"Money never sleeps\",\n (\n <>\n You are trying to make a name for yourself as an up-and-coming hedge fund manager on Wall Street.\n
\n
\n In this BitNode:\n
\n
\n You start with $250 million\n
\n You start with a WSE membership and access to the TIX API\n
\n You are able to short stocks and place different types of orders (limit/stop)\n
\n
\n Destroying this BitNode will give you Source-File 8, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n
\n
\n Level 1: Permanent access to WSE and TIX API\n
\n Level 2: Ability to short stocks in other BitNodes\n
\n Level 3: Ability to use limit/stop orders in other BitNodes\n
\n
\n This Source-File also increases your hacking growth multipliers by:\n
\n Level 1: 12%\n
\n Level 2: 18%\n
\n Level 3: 21%\n \n ),\n);\nBitNodes[\"BitNode9\"] = new BitNode(\n 9,\n 2,\n \"Hacktocracy\",\n \"Hacknet Unleashed\",\n (\n <>\n When {FactionNames.FulcrumSecretTechnologies} released their open-source Linux distro Chapeau, it quickly became\n the OS of choice for the underground hacking community. Chapeau became especially notorious for powering the\n Hacknet, a global, decentralized network used for nefarious purposes. {FactionNames.FulcrumSecretTechnologies}{\" \"}\n quickly abandoned the project and dissociated themselves from it.\n
\n
\n This BitNode unlocks the Hacknet Server, an upgraded version of the Hacknet Node. Hacknet Servers generate hashes,\n which can be spent on a variety of different upgrades.\n
\n
\n Destroying this BitNode will give you Source-File 9, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File grants the following benefits:\n
\n
\n Level 1: Permanently unlocks the Hacknet Server in other BitNodes\n
\n Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode\n
\n Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode\n
\n
\n (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing\n Augmentations)\n
\n
\n This Source-File also increases your hacknet multipliers by:\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nBitNodes[\"BitNode10\"] = new BitNode(\n 10,\n 2,\n \"Digital Carbon\",\n \"Your body is not who you are\",\n (\n <>\n In 2084, VitaLife unveiled to the world the Persona Core, a technology that allowed people to digitize their\n consciousness. Their consciousness could then be transferred into Synthoids or other bodies by trasmitting the\n digitized data. Human bodies became nothing more than 'sleeves' for the human consciousness. Mankind had finally\n achieved immortality - at least for those that could afford it.\n
\n
\n This BitNode unlocks Sleeve and grafting technologies. Sleeve technology allows you to:\n
\n
\n 1. Grafting: Visit VitaLife in New Tokyo to be able to obtain Augmentations without needing to install\n
\n 2. Duplicate Sleeves: Duplicate your consciousness into Synthoids, allowing you to perform different tasks\n synchronously.\n
\n
\n Grafting technology allows you to graft Augmentations, which is an alternative way of installing Augmentations.\n
\n
\n Destroying this BitNode will give you Source-File 10, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File unlocks Sleeve technology, and the Grafting API in other BitNodes.\n Each level of this Source-File also grants you a Duplicate Sleeve\n \n ),\n);\nBitNodes[\"BitNode11\"] = new BitNode(\n 11,\n 1,\n \"The Big Crash\",\n \"Okay. Sell it all.\",\n (\n <>\n The 2050s was defined by the massive amounts of violent civil unrest and anarchic rebellion that rose all around\n the world. It was this period of disorder that eventually lead to the governmental reformation of many global\n superpowers, most notably the USA and China. But just as the world was slowly beginning to recover from these dark\n times, financial catastrophe hit.\n
\n
\n In many countries, the high cost of trying to deal with the civil disorder bankrupted the governments. In all of\n this chaos and confusion, hackers were able to steal billions of dollars from the world's largest electronic\n banks, prompting an international banking crisis as governments were unable to bail out insolvent banks. Now, the\n world is slowly crumbling in the middle of the biggest economic crisis of all time.\n
\n
\n Destroying this BitNode will give you Source-File 11, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File makes it so that company favor increases BOTH the player's salary and\n reputation gain rate at that company by 1% per favor (rather than just the reputation gain). This Source-File also\n increases the player's company salary and reputation gain multipliers by:\n
\n
\n Level 1: 32%\n
\n Level 2: 48%\n
\n Level 3: 56%\n
\n
\n It also reduces the price increase for every aug bought by:\n
\n
\n Level 1: 4%\n
\n Level 2: 6%\n
\n Level 3: 7%\n \n ),\n);\nBitNodes[\"BitNode12\"] = new BitNode(\n 12,\n 0,\n \"The Recursion\",\n \"Repeat.\",\n (\n <>\n To iterate is human, to recurse divine.\n
\n
\n Every time this BitNode is destroyed, it becomes slightly harder. Destroying this BitNode will give you\n Source-File 12, or if you already have this Source-File it will upgrade its level. There is no maximum level for\n Source-File 12. Each level of Source-File 12 lets you start any BitNodes with NeuroFlux Governor equal to the\n level of this source file.\n \n ),\n);\nBitNodes[\"BitNode13\"] = new BitNode(\n 13,\n 2,\n \"They're lunatics\",\n \"1 step back, 2 steps forward\",\n (\n <>\n With the invention of Augmentations in the 2040s a religious group known as the{\" \"}\n {FactionNames.ChurchOfTheMachineGod} has rallied far more support than anyone would have hoped.\n
\n
\n Their leader, Allison \"Mother\" Stanek is said to have created her own Augmentation whose power goes beyond any\n other. Find her in {CityName.Chongqing} and gain her trust.\n
\n
\n Destroying this BitNode will give you Source-File 13, or if you already have this Source-File it will upgrade its\n level up to a maximum of 3. This Source-File lets the {FactionNames.ChurchOfTheMachineGod} appear in other\n BitNodes.\n
\n
\n Each level of this Source-File increases the size of Stanek's Gift.\n \n ),\n);\n\nexport const defaultMultipliers: IBitNodeMultipliers = {\n HackingLevelMultiplier: 1,\n StrengthLevelMultiplier: 1,\n DefenseLevelMultiplier: 1,\n DexterityLevelMultiplier: 1,\n AgilityLevelMultiplier: 1,\n CharismaLevelMultiplier: 1,\n\n ServerGrowthRate: 1,\n ServerMaxMoney: 1,\n ServerStartingMoney: 1,\n ServerStartingSecurity: 1,\n ServerWeakenRate: 1,\n\n HomeComputerRamCost: 1,\n\n PurchasedServerCost: 1,\n PurchasedServerSoftcap: 1,\n PurchasedServerLimit: 1,\n PurchasedServerMaxRam: 1,\n\n CompanyWorkMoney: 1,\n CrimeMoney: 1,\n HacknetNodeMoney: 1,\n ManualHackMoney: 1,\n ScriptHackMoney: 1,\n ScriptHackMoneyGain: 1,\n CodingContractMoney: 1,\n\n ClassGymExpGain: 1,\n CompanyWorkExpGain: 1,\n CrimeExpGain: 1,\n FactionWorkExpGain: 1,\n HackExpGain: 1,\n\n FactionPassiveRepGain: 1,\n FactionWorkRepGain: 1,\n RepToDonateToFaction: 1,\n\n AugmentationMoneyCost: 1,\n AugmentationRepCost: 1,\n\n InfiltrationMoney: 1,\n InfiltrationRep: 1,\n\n FourSigmaMarketDataCost: 1,\n FourSigmaMarketDataApiCost: 1,\n\n CorporationValuation: 1,\n CorporationSoftcap: 1,\n\n BladeburnerRank: 1,\n BladeburnerSkillCost: 1,\n\n GangSoftcap: 1,\n GangUniqueAugs: 1,\n\n DaedalusAugsRequirement: 30,\n\n StaneksGiftPowerMultiplier: 1,\n StaneksGiftExtraSize: 0,\n\n WorldDaemonDifficulty: 1,\n};\n\nObject.freeze(defaultMultipliers);\n\nexport function getBitNodeMultipliers(n: number, lvl: number): IBitNodeMultipliers {\n const mults = Object.assign({}, defaultMultipliers);\n switch (n) {\n case 1: {\n return mults;\n }\n case 2: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.8,\n ServerGrowthRate: 0.8,\n ServerMaxMoney: 0.2,\n ServerStartingMoney: 0.4,\n CrimeMoney: 3,\n InfiltrationMoney: 3,\n FactionWorkRepGain: 0.5,\n FactionPassiveRepGain: 0,\n StaneksGiftPowerMultiplier: 2,\n StaneksGiftExtraSize: -6,\n PurchasedServerSoftcap: 1.3,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 5,\n });\n }\n case 3: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.8,\n RepToDonateToFaction: 0.5,\n AugmentationRepCost: 3,\n AugmentationMoneyCost: 3,\n ServerMaxMoney: 0.2,\n ServerStartingMoney: 0.2,\n ServerGrowthRate: 0.2,\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.25,\n CrimeMoney: 0.25,\n HacknetNodeMoney: 0.25,\n HomeComputerRamCost: 1.5,\n PurchasedServerCost: 2,\n StaneksGiftPowerMultiplier: 0.75,\n StaneksGiftExtraSize: -2,\n PurchasedServerSoftcap: 1.3,\n GangSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.5,\n });\n }\n case 4: {\n return Object.assign(mults, {\n ServerMaxMoney: 0.15,\n ServerStartingMoney: 0.75,\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.1,\n CrimeMoney: 0.2,\n HacknetNodeMoney: 0.05,\n CompanyWorkExpGain: 0.5,\n ClassGymExpGain: 0.5,\n FactionWorkExpGain: 0.5,\n HackExpGain: 0.4,\n CrimeExpGain: 0.5,\n FactionWorkRepGain: 0.75,\n StaneksGiftPowerMultiplier: 1.5,\n StaneksGiftExtraSize: 0,\n PurchasedServerSoftcap: 1.2,\n WorldDaemonDifficulty: 3,\n GangUniqueAugs: 0.5,\n });\n }\n case 5: {\n return Object.assign(mults, {\n ServerMaxMoney: 2,\n ServerStartingSecurity: 2,\n ServerStartingMoney: 0.5,\n ScriptHackMoney: 0.15,\n HacknetNodeMoney: 0.2,\n CrimeMoney: 0.5,\n InfiltrationRep: 1.5,\n InfiltrationMoney: 1.5,\n AugmentationMoneyCost: 2,\n HackExpGain: 0.5,\n CorporationValuation: 0.5,\n StaneksGiftPowerMultiplier: 1.3,\n StaneksGiftExtraSize: 0,\n PurchasedServerSoftcap: 1.2,\n WorldDaemonDifficulty: 1.5,\n GangUniqueAugs: 0.5,\n });\n }\n case 6: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.35,\n ServerMaxMoney: 0.4,\n ServerStartingMoney: 0.5,\n ServerStartingSecurity: 1.5,\n ScriptHackMoney: 0.75,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.75,\n InfiltrationMoney: 0.75,\n CorporationValuation: 0.2,\n HacknetNodeMoney: 0.2,\n HackExpGain: 0.25,\n DaedalusAugsRequirement: 35,\n PurchasedServerSoftcap: 2,\n StaneksGiftPowerMultiplier: 0.5,\n StaneksGiftExtraSize: 2,\n GangSoftcap: 0.7,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.2,\n });\n }\n case 7: {\n return Object.assign(mults, {\n BladeburnerRank: 0.6,\n BladeburnerSkillCost: 2,\n AugmentationMoneyCost: 3,\n HackingLevelMultiplier: 0.35,\n ServerMaxMoney: 0.4,\n ServerStartingMoney: 0.5,\n ServerStartingSecurity: 1.5,\n ScriptHackMoney: 0.5,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.75,\n InfiltrationMoney: 0.75,\n CorporationValuation: 0.2,\n HacknetNodeMoney: 0.2,\n HackExpGain: 0.25,\n FourSigmaMarketDataCost: 2,\n FourSigmaMarketDataApiCost: 2,\n DaedalusAugsRequirement: 35,\n PurchasedServerSoftcap: 2,\n StaneksGiftPowerMultiplier: 0.9,\n StaneksGiftExtraSize: -1,\n GangSoftcap: 0.7,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.2,\n });\n }\n case 8: {\n return Object.assign(mults, {\n ScriptHackMoney: 0.3,\n ScriptHackMoneyGain: 0,\n ManualHackMoney: 0,\n CompanyWorkMoney: 0,\n CrimeMoney: 0,\n HacknetNodeMoney: 0,\n InfiltrationMoney: 0,\n RepToDonateToFaction: 0,\n CorporationValuation: 0,\n CodingContractMoney: 0,\n StaneksGiftExtraSize: -99,\n PurchasedServerSoftcap: 4,\n GangSoftcap: 0,\n CorporationSoftcap: 0,\n GangUniqueAugs: 0,\n });\n }\n case 9: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.5,\n StrengthLevelMultiplier: 0.45,\n DefenseLevelMultiplier: 0.45,\n DexterityLevelMultiplier: 0.45,\n AgilityLevelMultiplier: 0.45,\n CharismaLevelMultiplier: 0.45,\n PurchasedServerLimit: 0,\n HomeComputerRamCost: 5,\n CrimeMoney: 0.5,\n ScriptHackMoney: 0.1,\n HackExpGain: 0.05,\n ServerStartingMoney: 0.1,\n ServerMaxMoney: 0.1,\n ServerStartingSecurity: 2.5,\n CorporationValuation: 0.5,\n FourSigmaMarketDataCost: 5,\n FourSigmaMarketDataApiCost: 4,\n BladeburnerRank: 0.9,\n BladeburnerSkillCost: 1.2,\n StaneksGiftPowerMultiplier: 0.5,\n StaneksGiftExtraSize: 2,\n GangSoftcap: 0.8,\n CorporationSoftcap: 0.7,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.25,\n });\n }\n case 10: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.35,\n StrengthLevelMultiplier: 0.4,\n DefenseLevelMultiplier: 0.4,\n DexterityLevelMultiplier: 0.4,\n AgilityLevelMultiplier: 0.4,\n CharismaLevelMultiplier: 0.4,\n CompanyWorkMoney: 0.5,\n CrimeMoney: 0.5,\n HacknetNodeMoney: 0.5,\n ManualHackMoney: 0.5,\n ScriptHackMoney: 0.5,\n CodingContractMoney: 0.5,\n InfiltrationMoney: 0.5,\n CorporationValuation: 0.5,\n AugmentationMoneyCost: 5,\n AugmentationRepCost: 2,\n HomeComputerRamCost: 1.5,\n PurchasedServerCost: 5,\n PurchasedServerLimit: 0.6,\n PurchasedServerMaxRam: 0.5,\n BladeburnerRank: 0.8,\n StaneksGiftPowerMultiplier: 0.75,\n StaneksGiftExtraSize: -3,\n PurchasedServerSoftcap: 1.1,\n GangSoftcap: 0.9,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 2,\n GangUniqueAugs: 0.25,\n });\n }\n case 11: {\n return Object.assign(mults, {\n HackingLevelMultiplier: 0.6,\n HackExpGain: 0.5,\n ServerMaxMoney: 0.1,\n ServerStartingMoney: 0.1,\n ServerGrowthRate: 0.2,\n ServerWeakenRate: 2,\n CrimeMoney: 3,\n CompanyWorkMoney: 0.5,\n HacknetNodeMoney: 0.1,\n AugmentationMoneyCost: 2,\n InfiltrationMoney: 2.5,\n InfiltrationRep: 2.5,\n CorporationValuation: 0.1,\n CodingContractMoney: 0.25,\n FourSigmaMarketDataCost: 4,\n FourSigmaMarketDataApiCost: 4,\n PurchasedServerSoftcap: 2,\n CorporationSoftcap: 0.9,\n WorldDaemonDifficulty: 1.5,\n GangUniqueAugs: 0.75,\n });\n }\n case 12: {\n const inc = Math.pow(1.02, lvl);\n const dec = 1 / inc;\n\n return Object.assign(mults, {\n DaedalusAugsRequirement: Math.floor(Math.min(mults.DaedalusAugsRequirement + inc, 40)),\n\n HackingLevelMultiplier: dec,\n StrengthLevelMultiplier: dec,\n DefenseLevelMultiplier: dec,\n DexterityLevelMultiplier: dec,\n AgilityLevelMultiplier: dec,\n CharismaLevelMultiplier: dec,\n\n ServerMaxMoney: dec,\n ServerStartingMoney: dec,\n ServerGrowthRate: dec,\n ServerWeakenRate: dec,\n\n //Does not scale, otherwise security might start at 300+\n ServerStartingSecurity: 1.5,\n\n HomeComputerRamCost: inc,\n\n PurchasedServerCost: inc,\n PurchasedServerLimit: dec,\n PurchasedServerMaxRam: dec,\n PurchasedServerSoftcap: inc,\n\n ManualHackMoney: dec,\n ScriptHackMoney: dec,\n CompanyWorkMoney: dec,\n CrimeMoney: dec,\n HacknetNodeMoney: dec,\n CodingContractMoney: dec,\n\n CompanyWorkExpGain: dec,\n ClassGymExpGain: dec,\n FactionWorkExpGain: dec,\n HackExpGain: dec,\n CrimeExpGain: dec,\n\n FactionWorkRepGain: dec,\n FactionPassiveRepGain: dec,\n RepToDonateToFaction: inc,\n\n AugmentationRepCost: inc,\n AugmentationMoneyCost: inc,\n\n InfiltrationMoney: dec,\n InfiltrationRep: dec,\n\n FourSigmaMarketDataCost: inc,\n FourSigmaMarketDataApiCost: inc,\n\n CorporationValuation: dec,\n\n BladeburnerRank: dec,\n BladeburnerSkillCost: inc,\n\n StaneksGiftPowerMultiplier: inc,\n StaneksGiftExtraSize: inc,\n GangSoftcap: 0.8,\n CorporationSoftcap: 0.8,\n WorldDaemonDifficulty: inc,\n\n GangUniqueAugs: dec,\n });\n }\n case 13: {\n return Object.assign(mults, {\n PurchasedServerSoftcap: 1.6,\n\n HackingLevelMultiplier: 0.25,\n StrengthLevelMultiplier: 0.7,\n DefenseLevelMultiplier: 0.7,\n DexterityLevelMultiplier: 0.7,\n AgilityLevelMultiplier: 0.7,\n\n ServerMaxMoney: 0.45,\n ServerStartingMoney: 0.75,\n\n ServerStartingSecurity: 3,\n\n ScriptHackMoney: 0.2,\n CompanyWorkMoney: 0.4,\n CrimeMoney: 0.4,\n HacknetNodeMoney: 0.4,\n CodingContractMoney: 0.4,\n\n CompanyWorkExpGain: 0.5,\n ClassGymExpGain: 0.5,\n FactionWorkExpGain: 0.5,\n HackExpGain: 0.1,\n CrimeExpGain: 0.5,\n\n FactionWorkRepGain: 0.6,\n\n FourSigmaMarketDataCost: 10,\n FourSigmaMarketDataApiCost: 10,\n\n CorporationValuation: 0.001,\n\n BladeburnerRank: 0.45,\n BladeburnerSkillCost: 2,\n StaneksGiftPowerMultiplier: 2,\n StaneksGiftExtraSize: 1,\n GangSoftcap: 0.3,\n CorporationSoftcap: 0.3,\n WorldDaemonDifficulty: 3,\n GangUniqueAugs: 0.1,\n });\n }\n default: {\n throw new Error(\"Invalid BitNodeN\");\n }\n }\n}\n\nexport function initBitNodeMultipliers(p: IPlayer): void {\n Object.assign(BitNodeMultipliers, getBitNodeMultipliers(p.bitNodeN, p.sourceFileLvl(p.bitNodeN)));\n}\n","import { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IReviverValue } from \"../utils/JSONReviver\";\n\nexport abstract class Work {\n type: WorkType;\n singularity: boolean;\n cyclesWorked: number;\n\n constructor(type: WorkType, singularity: boolean) {\n this.type = type;\n this.singularity = singularity;\n this.cyclesWorked = 0;\n }\n\n abstract process(player: IPlayer, cycles: number): boolean;\n abstract finish(player: IPlayer, cancelled: boolean): void;\n abstract APICopy(): Record;\n abstract toJSON(): IReviverValue;\n}\n\nexport enum WorkType {\n CRIME = \"CRIME\",\n CLASS = \"CLASS\",\n CREATE_PROGRAM = \"CREATE_PROGRAM\",\n GRAFTING = \"GRAFTING\",\n FACTION = \"FACTION\",\n COMPANY = \"COMPANY\",\n}\n","import { IMinMaxRange } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nexport const StockForecastInfluenceLimit = 5;\n\nexport interface IConstructorParams {\n b: boolean;\n initPrice: number | IMinMaxRange;\n marketCap: number;\n mv: number | IMinMaxRange;\n name: string;\n otlkMag: number;\n spreadPerc: number | IMinMaxRange;\n shareTxForMovement: number | IMinMaxRange;\n symbol: string;\n}\n\nconst defaultConstructorParams: IConstructorParams = {\n b: true,\n initPrice: 10e3,\n marketCap: 1e12,\n mv: 1,\n name: \"\",\n otlkMag: 0,\n spreadPerc: 0,\n shareTxForMovement: 1e6,\n symbol: \"\",\n};\n\n// Helper function that convert a IMinMaxRange to a number\nfunction toNumber(n: number | IMinMaxRange): number {\n let value: number;\n switch (typeof n) {\n case \"number\": {\n return n;\n }\n case \"object\": {\n const range = n;\n value = getRandomInt(range.min, range.max);\n break;\n }\n default:\n throw Error(`Do not know how to convert the type '${typeof n}' to a number`);\n }\n\n if (typeof n === \"object\" && typeof n.divisor === \"number\") {\n return value / n.divisor;\n }\n\n return value;\n}\n\n/**\n * Represents the valuation of a company in the World Stock Exchange.\n */\nexport class Stock {\n /**\n * Bear or bull (more likely to go up or down, based on otlkMag)\n */\n b: boolean;\n\n /**\n * Maximum price of a stock (per share)\n */\n readonly cap: number;\n\n /**\n * Stocks previous share price\n */\n lastPrice: number;\n\n /**\n * Maximum number of shares that player can own (both long and short combined)\n */\n readonly maxShares: number;\n\n /**\n * Maximum volatility\n */\n readonly mv: number;\n\n /**\n * Name of the company that the stock is for\n */\n readonly name: string;\n\n /**\n * Outlook magnitude. Represents the stock's forecast and likelihood\n * of increasing/decreasing (based on whether its in bear or bull mode)\n */\n otlkMag: number;\n\n /**\n * Forecast of outlook magnitude. Essentially a second-order forecast.\n * Unlike 'otlkMag', this number is on an absolute scale from 0-100 (rather than 0-50)\n */\n otlkMagForecast: number;\n\n /**\n * Average price of stocks that the player owns in the LONG position\n */\n playerAvgPx: number;\n\n /**\n * Average price of stocks that the player owns in the SHORT position\n */\n playerAvgShortPx: number;\n\n /**\n * Number of shares the player owns in the LONG position\n */\n playerShares: number;\n\n /**\n * Number of shares the player owns in the SHORT position\n */\n playerShortShares: number;\n\n /**\n * Stock's share price\n */\n price: number;\n\n /**\n * How many shares need to be transacted in order to trigger a price movement\n */\n readonly shareTxForMovement: number;\n\n /**\n * How many share transactions remaining until a price movement occurs\n * (separately tracked for upward and downward movements)\n */\n shareTxUntilMovement: number;\n\n /**\n * Spread percentage. The bid/ask prices for this stock are N% above or below\n * the \"real price\" to emulate spread.\n */\n readonly spreadPerc: number;\n\n /**\n * The stock's ticker symbol\n */\n readonly symbol: string;\n\n /**\n * Total number of shares of this stock\n * This is different than maxShares, as this is like authorized stock while\n * maxShares is outstanding stock.\n */\n readonly totalShares: number;\n\n constructor(p: IConstructorParams = defaultConstructorParams) {\n this.name = p.name;\n this.symbol = p.symbol;\n this.price = toNumber(p.initPrice);\n this.lastPrice = this.price;\n this.playerShares = 0;\n this.playerAvgPx = 0;\n this.playerShortShares = 0;\n this.playerAvgShortPx = 0;\n this.mv = toNumber(p.mv);\n this.b = p.b;\n this.otlkMag = p.otlkMag;\n this.otlkMagForecast = this.getAbsoluteForecast();\n this.cap = getRandomInt(this.price * 1e3, this.price * 25e3);\n this.spreadPerc = toNumber(p.spreadPerc);\n this.shareTxForMovement = toNumber(p.shareTxForMovement);\n this.shareTxUntilMovement = this.shareTxForMovement;\n\n // Total shares is determined by market cap, and is rounded to nearest 100k\n const totalSharesUnrounded: number = p.marketCap / this.price;\n this.totalShares = Math.round(totalSharesUnrounded / 1e5) * 1e5;\n\n // Max Shares (Outstanding shares) is a percentage of total shares\n const outstandingSharePercentage = 0.2;\n this.maxShares = Math.round((this.totalShares * outstandingSharePercentage) / 1e5) * 1e5;\n }\n\n /**\n * Safely set the stock's second-order forecast to a new value\n */\n changeForecastForecast(newff: number): void {\n this.otlkMagForecast = newff;\n if (this.otlkMagForecast > 100) {\n this.otlkMagForecast = 100;\n } else if (this.otlkMagForecast < 0) {\n this.otlkMagForecast = 0;\n }\n }\n\n /**\n * Set the stock to a new price. Also updates the stock's previous price tracker\n */\n changePrice(newPrice: number): void {\n this.lastPrice = this.price;\n this.price = newPrice;\n }\n\n /**\n * Change the stock's forecast during a stock market 'tick'.\n * The way a stock's forecast changes depends on various internal properties,\n * but is ultimately determined by RNG\n */\n cycleForecast(changeAmt = 0.1): void {\n const increaseChance = this.getForecastIncreaseChance();\n\n if (Math.random() < increaseChance) {\n // Forecast increases\n if (this.b) {\n this.otlkMag += changeAmt;\n } else {\n this.otlkMag -= changeAmt;\n }\n } else if (this.b) {\n // Forecast decreases\n this.otlkMag -= changeAmt;\n } else {\n this.otlkMag += changeAmt;\n }\n\n this.otlkMag = Math.min(this.otlkMag, 50);\n if (this.otlkMag < 0) {\n this.otlkMag *= -1;\n this.b = !this.b;\n }\n }\n\n /**\n * Change's the stock's second-order forecast during a stock market 'tick'.\n * The change for the second-order forecast to increase is 50/50\n */\n cycleForecastForecast(changeAmt = 0.1): void {\n if (Math.random() < 0.5) {\n this.changeForecastForecast(this.otlkMagForecast + changeAmt);\n } else {\n this.changeForecastForecast(this.otlkMagForecast - changeAmt);\n }\n }\n\n /**\n * \"Flip\" the stock's second-order forecast. This can occur during a\n * stock market \"cycle\" (determined by RNG). It is used to simulate\n * RL stock market cycles and introduce volatility\n */\n flipForecastForecast(): void {\n const diff = this.otlkMagForecast - 50;\n this.otlkMagForecast = 50 + -1 * diff;\n }\n\n /**\n * Returns the stock's absolute forecast, which is a number between 0-100\n */\n getAbsoluteForecast(): number {\n return this.b ? 50 + this.otlkMag : 50 - this.otlkMag;\n }\n\n /**\n * Return the price at which YOUR stock is bought (market ask price). Accounts for spread\n */\n getAskPrice(): number {\n return this.price * (1 + this.spreadPerc / 100);\n }\n\n /**\n * Return the price at which YOUR stock is sold (market bid price). Accounts for spread\n */\n getBidPrice(): number {\n return this.price * (1 - this.spreadPerc / 100);\n }\n\n /**\n * Returns the chance (0-1 decimal) that a stock has of having its forecast increase\n */\n getForecastIncreaseChance(): number {\n const diff = this.otlkMagForecast - this.getAbsoluteForecast();\n\n return (50 + Math.min(Math.max(diff, -45), 45)) / 100;\n }\n\n /**\n * Changes a stock's forecast. This is used when the stock is influenced\n * by a transaction. The stock's forecast always goes towards 50, but the\n * movement is capped by a certain threshold/limit\n */\n influenceForecast(change: number): void {\n if (this.otlkMag > StockForecastInfluenceLimit) {\n this.otlkMag = Math.max(StockForecastInfluenceLimit, this.otlkMag - change);\n }\n }\n\n /**\n * Changes a stock's second-order forecast. This is used when the stock is\n * influenced by a transaction. The stock's second-order forecast always\n * goes towards 50.\n */\n influenceForecastForecast(change: number): void {\n if (this.otlkMagForecast > 50) {\n this.otlkMagForecast -= change;\n this.otlkMagForecast = Math.max(50, this.otlkMagForecast);\n } else if (this.otlkMagForecast < 50) {\n this.otlkMagForecast += change;\n this.otlkMagForecast = Math.min(50, this.otlkMagForecast);\n }\n }\n\n /**\n * Serialize the Stock to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Stock\", this);\n }\n\n /**\n * Initializes a Stock from a JSON save state\n */\n static fromJSON(value: IReviverValue): Stock {\n return Generic_fromJSON(Stock, value.data);\n }\n}\n\nReviver.constructors.Stock = Stock;\n","/**\n * Map of all Cities in the game\n * Key = City Name, Value = City object\n */\nimport { City } from \"./City\";\nimport { IMap } from \"../types\";\n\nexport const Cities: IMap = {};\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { HacknetServerConstants } from \"../data/Constants\";\n\nexport function calculateHashGainRate(\n level: number,\n ramUsed: number,\n maxRam: number,\n cores: number,\n mult: number,\n): number {\n const baseGain = HacknetServerConstants.HashesPerLevel * level;\n const ramMultiplier = Math.pow(1.07, Math.log2(maxRam));\n const coreMultiplier = 1 + (cores - 1) / 5;\n const ramRatio = 1 - ramUsed / maxRam;\n\n return baseGain * ramMultiplier * coreMultiplier * ramRatio * mult * BitNodeMultipliers.HacknetNodeMoney;\n}\n\nexport function calculateLevelUpgradeCost(startingLevel: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingLevel >= HacknetServerConstants.MaxLevel) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeLevelMult;\n let totalMultiplier = 0;\n let currLevel = startingLevel;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalMultiplier += Math.pow(mult, currLevel);\n ++currLevel;\n }\n\n return 10 * HacknetServerConstants.BaseCost * totalMultiplier * costMult;\n}\n\nexport function calculateRamUpgradeCost(startingRam: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingRam >= HacknetServerConstants.MaxRam) {\n return Infinity;\n }\n\n let totalCost = 0;\n let numUpgrades = Math.round(Math.log2(startingRam));\n let currentRam = startingRam;\n for (let i = 0; i < sanitizedLevels; ++i) {\n const baseCost = currentRam * HacknetServerConstants.RamBaseCost;\n const mult = Math.pow(HacknetServerConstants.UpgradeRamMult, numUpgrades);\n\n totalCost += baseCost * mult;\n\n currentRam *= 2;\n ++numUpgrades;\n }\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCoreUpgradeCost(startingCores: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingCores >= HacknetServerConstants.MaxCores) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeCoreMult;\n let totalCost = 0;\n let currentCores = startingCores;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalCost += Math.pow(mult, currentCores - 1);\n ++currentCores;\n }\n totalCost *= HacknetServerConstants.CoreBaseCost;\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCacheUpgradeCost(startingCache: number, extraLevels = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingCache >= HacknetServerConstants.MaxCache) {\n return Infinity;\n }\n\n const mult = HacknetServerConstants.UpgradeCacheMult;\n let totalCost = 0;\n let currentCache = startingCache;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalCost += Math.pow(mult, currentCache - 1);\n ++currentCache;\n }\n totalCost *= HacknetServerConstants.CacheBaseCost;\n\n return totalCost;\n}\n\nexport function calculateServerCost(n: number, mult = 1): number {\n if (n - 1 >= HacknetServerConstants.MaxServers) {\n return Infinity;\n }\n\n return HacknetServerConstants.BaseCost * Math.pow(HacknetServerConstants.PurchaseMult, n - 1) * mult;\n}\n","/**\n * Checks whether the value passed in can be considered a string.\n * @param value The value to check if it is a string.\n */\nexport function isString(value: unknown): value is string {\n return typeof value === \"string\" || value instanceof String;\n}\n","import { IMap } from \"./types\";\nimport { Terminal } from \"./Terminal\";\n\nexport let Aliases: IMap = {};\nexport let GlobalAliases: IMap = {};\n\nexport function loadAliases(saveString: string): void {\n if (saveString === \"\") {\n Aliases = {};\n } else {\n Aliases = JSON.parse(saveString);\n }\n}\n\nexport function loadGlobalAliases(saveString: string): void {\n if (saveString === \"\") {\n GlobalAliases = {};\n } else {\n GlobalAliases = JSON.parse(saveString);\n }\n}\n\n// Prints all aliases to terminal\nexport function printAliases(): void {\n for (const name of Object.keys(Aliases)) {\n if (Aliases.hasOwnProperty(name)) {\n Terminal.print(\"alias \" + name + \"=\" + Aliases[name]);\n }\n }\n for (const name of Object.keys(GlobalAliases)) {\n if (GlobalAliases.hasOwnProperty(name)) {\n Terminal.print(\"global alias \" + name + \"=\" + GlobalAliases[name]);\n }\n }\n}\n\n// Returns true if successful, false otherwise\nexport function parseAliasDeclaration(dec: string, global = false): boolean {\n console.log(dec);\n const re = /^([\\w|!%,@-]+)=(.+)$/;\n const matches = dec.match(re);\n console.log(matches);\n if (matches == null || matches.length != 3) {\n return false;\n }\n\n if (global) {\n addGlobalAlias(matches[1], matches[2]);\n } else {\n addAlias(matches[1], matches[2]);\n }\n return true;\n}\n\nfunction addAlias(name: string, value: string): void {\n if (name in GlobalAliases) {\n delete GlobalAliases[name];\n }\n Aliases[name] = value.trim();\n}\n\nfunction addGlobalAlias(name: string, value: string): void {\n if (name in Aliases) {\n delete Aliases[name];\n }\n GlobalAliases[name] = value.trim();\n}\n\nfunction getAlias(name: string): string | null {\n if (Aliases.hasOwnProperty(name)) {\n return Aliases[name];\n }\n\n return null;\n}\n\nfunction getGlobalAlias(name: string): string | null {\n if (GlobalAliases.hasOwnProperty(name)) {\n return GlobalAliases[name];\n }\n return null;\n}\n\nexport function removeAlias(name: string): boolean {\n if (Aliases.hasOwnProperty(name)) {\n delete Aliases[name];\n return true;\n }\n\n if (GlobalAliases.hasOwnProperty(name)) {\n delete GlobalAliases[name];\n return true;\n }\n\n return false;\n}\n\n/**\n * Returns the original string with any aliases substituted in.\n * Aliases are only applied to \"whole words\", one level deep\n */\nexport function substituteAliases(origCommand: string): string {\n const commandArray = origCommand.split(\" \");\n if (commandArray.length > 0) {\n // For the alias and unalias commands, dont substite\n if (commandArray[0] === \"unalias\" || commandArray[0] === \"alias\") {\n return commandArray.join(\" \");\n }\n\n let somethingSubstituted = true;\n let depth = 0;\n\n while (somethingSubstituted && depth < 10) {\n depth++;\n somethingSubstituted = false;\n const alias = getAlias(commandArray[0])?.split(\" \");\n if (alias != null) {\n somethingSubstituted = true;\n commandArray.splice(0, 1, ...alias);\n //commandArray[0] = alias;\n }\n for (let i = 0; i < commandArray.length; ++i) {\n const alias = getGlobalAlias(commandArray[i])?.split(\" \");\n if (alias != null) {\n somethingSubstituted = true;\n commandArray.splice(i, 1, ...alias);\n i += alias.length - 1;\n //commandArray[i] = alias;\n }\n }\n }\n }\n return commandArray.join(\" \");\n}\n","/**\n * Map of all Locations in the game\n * Key = Location name, value = Location object\n */\nimport { City } from \"./City\";\nimport { Cities } from \"./Cities\";\nimport { Location, IConstructorParams } from \"./Location\";\nimport { CityName } from \"./data/CityNames\";\nimport { LocationsMetadata } from \"./data/LocationsMetadata\";\n\nimport { IMap } from \"../types\";\n\nexport const Locations: IMap = {};\n\n/**\n * Here, we'll initialize both Locations and Cities data. These can both\n * be initialized from the `LocationsMetadata`\n */\nfunction constructLocation(p: IConstructorParams): Location {\n if (!p.name) {\n throw new Error(`Invalid constructor parameters for Location. No 'name' property`);\n }\n\n if (Locations[p.name] instanceof Location) {\n console.warn(`Property with name ${p.name} already exists and is being overwritten`);\n }\n\n Locations[p.name] = new Location(p);\n\n return Locations[p.name];\n}\n\n// First construct all cities\nCities[CityName.Aevum] = new City(CityName.Aevum);\nCities[CityName.Chongqing] = new City(CityName.Chongqing);\nCities[CityName.Ishima] = new City(CityName.Ishima);\nCities[CityName.NewTokyo] = new City(CityName.NewTokyo);\nCities[CityName.Sector12] = new City(CityName.Sector12);\nCities[CityName.Volhaven] = new City(CityName.Volhaven);\n\nCities[CityName.Aevum].asciiArt = `\n [aevum police headquarters] 26 \n o \n I \\\\ [bachman & associates] \n \\\\ 56 B \n x \\\\ [summit university] \n \\\\ \\\\ 28 \n \\\\ [snap fitness gym] x o--L-----------N \n K \\\\ / \n \\\\ \\\\ Q [casino] \n x 58 \\\\ / [travel agency] \n \\\\ 94 95 o \n 90 x 59 o------o | \n \\\\ / \\\\ | 98 102 103 \n o--------O------x----o 93 96 o-----+------------o o----o \n \\\\ | \\\\ / \n [hospital] \\\\ 61 [ecorp] x 31 99 o-F-o 101 \n o | \n | o---E-- | [fulcrum tech.] \n x 62 / A [aerocorp] \n [crush fitness gym] | / | \n | / | \n o--------D------+--o o \n | |\\\\ [rho construction] \n H [netlink tech.] | J \n | | \\\\ \n | 34 x \\\\ \n [clarke inc.] C | \\\\ [world stock exchange] \n | | \\\\ \n | | o-M-------R--------o \n[galactic cybersystems] G 35 x \n | [watchdog security] \n | \n 67 o \n \n [the slums] P `;\nCities[CityName.Chongqing].asciiArt = `\n | \n 75 o \n \\\\ \n o 76 \n 7 | | \n | + 77 \n [world stock exchange] F | \n \\\\ o 78 [kuaigong international] \n \\\\ / \n 38 o----x--x------x------A------G-- \n / 39 | 41 [church] \n 37 o + 79 o--x--x-C-0 \n / | / \n / x-----+-----x-----0 [hospital] \n[solaris space system] B | \n | + 80 \n | | \n 34 o E [travel agency] \n | \n | \n x 82 \n [the slums] D `;\nCities[CityName.Ishima].asciiArt = `\n o 59 \n o o | \n [storm tech.] | | G [world stock exchange] \n | | 28 | \n 23 o--C------o--------+----x----o | \n / / 25 | 27 \\\\ x 57 \n / / | \\\\ | \n / / | \\\\ | \n o 22 o | \\\\| 29/56 \n | | o \n | [hospital] D / \\\\ 3 2 1 \n o | / \\\\ o-------x------o \n / o / \\\\ / \n 48 o / 55 x \\\\ / \n \\\\ / / x [glitch] \n \\\\ / [nova medical] / 4/30 \\\\ \n 49 x A \\\\ H \n / \\\\ / \\\\ \n / \\\\ [travel agency] F o 31 \n / \\\\ 51 / \n / o----B------x-----o \n o 50 52 \n [omega soft.] \n [the slums] E `;\nCities[CityName.NewTokyo].asciiArt = `\n \n \n o \n \\\\ \n [arcade] E [defcomm] \n \\\\ \n o--x---A--x--o [travel agency] \n 7 8 10 H \n [vitalife] o 12 [global pharmaceuticals] \n | \n o--D-x----x-------x-C-+--------x--x-B-x---x-o \n 21 22 23 \\\\ 24 25 26 27 \n \\\\ \n [noodle bar] x 14 \n \\\\ \n \\\\ \n [hospital] o 15 [world stock exchange] \n | \n o--x--F--x-----x-----x---+---x----x--I--x-o \n | \n | \n o 17 \n \n \n \n G [the slums] \n `;\nCities[CityName.Sector12].asciiArt = `\n 78 o 97 \n o [icarus microsystems] / \n N [powerhouse gym] o I \n 1 | | / \n o-----+---x----o 4 A [alpha ent.] o-------o / \n | 3 \\\\ | \\\\ / \n | \\\\ | [iron gym] x 95 \n (79) x \\\\ | / \\\\ \n | o-E----+----x----J--o 10 / o----T--o \n | | 8 \\\\ 94 x \n 80 x [city hall] | x 11 / [world stock exchange]\n | | \\\\ / \n | C [cia] \\\\ / \n Q [hospital] | F P [universal energy] \n | o [deltaone] \\\\ / \n | 35 o---------x 13/92/36 \n L [megacorp] 33 / / \\\\ \n | o------------o 34 / \\\\ \n (29) | / [carmichael sec.] D \\\\ \n o-----+-----x------o / O [rothman university] \n | 31 32 [nsa] M \n | / \n B [blade industries] H \n | / [four sigma] \n | [joe's guns] / \n | / \n 85 o--G--------K--------S-------o 88 [the slums] R \n \n [foodnstuff] [travel agency] `;\nCities[CityName.Volhaven].asciiArt = `\n [omnia cybersystems] \n 17 66 68 \n o o------G-------o \n \\\\ / \\\\ \n \\\\ o 65 o 69 \n [syscore sec.] H | | \n \\\\ | | [millenium fitness gym] \n \\\\ | 21 22 23 24 | 26 \n o----+--x--x----x---x---+-----x-------D-----o \n 19 | | 28 \n | F [omnitek inc.] \n [hospital] J 63 o \n | / 72 \n 3 | 5 6 / 9 \n o--------+----x-----x----+----------M-------o \n / | | \n / 61 x [helios labs] B [world stock exchange] \n [travel agency] L | | \n / | o \n / E [nwo] / 75 \n / [computek] | / \n / A-------o------I-----o \n 1 o | | \n | [zb] o 77 \n [lexocorp] C \n | \n o \n 57 \n \n \n [the slums] K `;\n\n// Then construct all locations, and add them to the cities as we go.\nfor (const metadata of LocationsMetadata) {\n const loc = constructLocation(metadata);\n\n const cityName = loc.city;\n if (cityName === null) {\n // Generic location, add to all cities\n for (const city of Object.keys(Cities)) {\n Cities[city].addLocation(loc.name);\n }\n } else {\n Cities[cityName].addLocation(loc.name);\n }\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { RunningScript } from \"../../Script/RunningScript\";\nimport { killWorkerScript } from \"../../Netscript/killWorkerScript\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Draggable, { DraggableEvent } from \"react-draggable\";\nimport { ResizableBox, ResizeCallbackData } from \"react-resizable\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport ArrowForwardIosIcon from \"@mui/icons-material/ArrowForwardIos\";\nimport { workerScripts } from \"../../Netscript/WorkerScripts\";\nimport { startWorkerScript } from \"../../NetscriptWorker\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { findRunningScript } from \"../../Script/ScriptHelpers\";\nimport { debounce } from \"lodash\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ANSIITypography } from \"./ANSIITypography\";\nimport { ScriptArg } from \"../../Netscript/ScriptArg\";\n\nlet layerCounter = 0;\n\nexport const LogBoxEvents = new EventEmitter<[RunningScript]>();\nexport const LogBoxCloserEvents = new EventEmitter<[number]>();\nexport const LogBoxClearEvents = new EventEmitter<[]>();\n\ninterface LogBoxUIEvent {\n pid: number;\n data: T;\n}\n\ninterface LogBoxPositionData {\n x: number;\n y: number;\n}\n\nexport const LogBoxPositionEvents = new EventEmitter<[LogBoxUIEvent]>();\n\ninterface LogBoxResizeData {\n w: number;\n h: number;\n}\n\nexport const LogBoxSizeEvents = new EventEmitter<[LogBoxUIEvent]>();\n\ninterface Log {\n id: string;\n script: RunningScript;\n}\n\nlet logs: Log[] = [];\n\nexport function LogBoxManager(): React.ReactElement {\n const setRerender = useState(true)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(\n () =>\n LogBoxEvents.subscribe((script: RunningScript) => {\n const id = script.server + \"-\" + script.filename + script.args.map((x: ScriptArg): string => `${x}`).join(\"-\");\n if (logs.find((l) => l.id === id)) return;\n logs.push({\n id: id,\n script: script,\n });\n rerender();\n }),\n [],\n );\n\n //Event used by ns.closeTail to close tail windows\n useEffect(\n () =>\n LogBoxCloserEvents.subscribe((pid: number) => {\n closePid(pid);\n }),\n [],\n );\n\n useEffect(() =>\n LogBoxClearEvents.subscribe(() => {\n logs = [];\n rerender();\n }),\n );\n\n //Close tail windows by their id\n function close(id: string): void {\n logs = logs.filter((l) => l.id !== id);\n rerender();\n }\n\n //Close tail windows by their pid\n function closePid(pid: number): void {\n logs = logs.filter((log) => log.script.pid != pid);\n rerender();\n }\n\n return (\n <>\n {logs.map((log) => (\n close(log.id)} />\n ))}\n \n );\n}\n\ninterface IProps {\n script: RunningScript;\n id: string;\n onClose: () => void;\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n logs: {\n overflowY: \"scroll\",\n overflowX: \"hidden\",\n scrollbarWidth: \"auto\",\n flexDirection: \"column-reverse\",\n whiteSpace: \"pre-wrap\",\n wordWrap: \"break-word\",\n },\n titleButton: {\n padding: \"1px 0\",\n height: \"100%\",\n },\n }),\n);\n\nexport const logBoxBaseZIndex = 1500;\n\nfunction LogWindow(props: IProps): React.ReactElement {\n const draggableRef = useRef(null);\n const rootRef = useRef(null);\n const [script, setScript] = useState(props.script);\n const classes = useStyles();\n const container = useRef(null);\n const setRerender = useState(false)[1];\n const [size, setSize] = useState<[number, number]>([500, 500]);\n const [minimized, setMinimized] = useState(false);\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const onResize = (e: React.SyntheticEvent, { size }: ResizeCallbackData) => {\n setSize([size.width, size.height]);\n };\n\n // useEffect(\n // () =>\n // WorkerScriptStartStopEventEmitter.subscribe(() => {\n // setTimeout(() => {\n // const server = GetServer(script.server);\n // if (server === null) return;\n // const exisitingScript = findRunningScript(script.filename, script.args, server);\n // if (exisitingScript) {\n // exisitingScript.logs = script.logs.concat(exisitingScript.logs)\n // setScript(exisitingScript)\n // }\n // rerender();\n // }, 100)\n // }),\n // [],\n // );\n\n const setPosition = ({ x, y }: LogBoxPositionData) => {\n const node = rootRef?.current;\n if (!node) return;\n const state = node.state as { x: number; y: number };\n console.log(`before ${state.x} ${state.y}`);\n state.x = x;\n state.y = y;\n };\n\n // Listen to Logbox positioning events.\n useEffect(\n () =>\n LogBoxPositionEvents.subscribe((e) => {\n if (e.pid !== props.script.pid) return;\n setPosition(e.data);\n }),\n [],\n );\n\n // Listen to Logbox resizing events.\n useEffect(\n () =>\n LogBoxSizeEvents.subscribe((e) => {\n if (e.pid !== props.script.pid) return;\n setSize([e.data.w, e.data.h]);\n }),\n [],\n );\n\n // initial position if 40%/30%\n useEffect(() => setPosition({ x: window.innerWidth * 0.4, y: window.innerHeight * 0.3 }), []);\n\n useEffect(() => {\n updateLayer();\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function kill(): void {\n killWorkerScript({ runningScript: script, hostname: script.server });\n }\n\n function run(): void {\n const server = GetServer(script.server);\n if (server === null) return;\n const s = findRunningScript(script.filename, script.args, server);\n if (s === null) {\n startWorkerScript(script, server);\n } else {\n setScript(s);\n }\n }\n\n function updateLayer(): void {\n const c = container.current;\n if (c === null) return;\n c.style.zIndex = logBoxBaseZIndex + layerCounter + \"\";\n layerCounter++;\n rerender();\n }\n\n function title(full = false): string {\n const maxLength = 30;\n const t = `${script.filename} ${script.args.map((x: ScriptArg): string => `${x}`).join(\" \")}`;\n if (full || t.length <= maxLength) {\n return t;\n }\n return t.slice(0, maxLength - 3) + \"...\";\n }\n\n function minimize(): void {\n setMinimized(!minimized);\n }\n\n function lineColor(s: string): \"error\" | \"success\" | \"warn\" | \"info\" | \"primary\" {\n if (s.match(/(^\\[[^\\]]+\\] )?ERROR/) || s.match(/(^\\[[^\\]]+\\] )?FAIL/)) {\n return \"error\";\n }\n if (s.match(/(^\\[[^\\]]+\\] )?SUCCESS/)) {\n return \"success\";\n }\n if (s.match(/(^\\[[^\\]]+\\] )?WARN/)) {\n return \"warn\";\n }\n if (s.match(/(^\\[[^\\]]+\\] )?INFO/)) {\n return \"info\";\n }\n return \"primary\";\n }\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", onWindowResize);\n return () => {\n window.removeEventListener(\"resize\", onWindowResize);\n };\n }, []);\n\n const onWindowResize = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n if (!isOnScreen(node)) {\n setPosition({ x: 0, y: 0 });\n }\n }, 100);\n\n const isOnScreen = (node: HTMLDivElement): boolean => {\n const bounds = node.getBoundingClientRect();\n\n return !(bounds.right < 0 || bounds.bottom < 0 || bounds.left > innerWidth || bounds.top > outerWidth);\n };\n\n const boundToBody = (e: DraggableEvent): void | false => {\n if (\n e instanceof MouseEvent &&\n (e.clientX < 0 || e.clientY < 0 || e.clientX > innerWidth || e.clientY > innerHeight)\n )\n return false;\n };\n\n // Max [width, height]\n const minConstraints: [number, number] = [250, 33];\n\n return (\n \n \n \n \n \n }\n >\n <>\n \n \n {title(true)}\n \n\n \n {!workerScripts.has(script.pid) ? (\n \n ) : (\n \n )}\n \n \n \n \n\n \n \n {script.logs.map(\n (line: string, i: number): JSX.Element => (\n \n ),\n )}\n \n \n \n \n \n \n );\n}\n","import { WorkerScript } from \"./WorkerScript\";\n\n/**\n * Script death marker.\n *\n * IMPORTANT: the game engine should not base any of it's decisions on the data\n * carried in a ScriptDeath instance.\n *\n * This is because ScriptDeath instances are thrown through player code when a\n * script is killed. Which grants the player access to the class and the ability\n * to construct new instances with arbitrary data.\n */\nexport class ScriptDeath {\n /** Process ID number. */\n pid: number;\n\n /** Filename of the script. */\n name: string;\n\n /** IP Address on which the script was running */\n hostname: string;\n\n /** Status message in case of script error. */\n errorMessage = \"\";\n\n constructor(ws: WorkerScript) {\n this.pid = ws.pid;\n this.name = ws.name;\n this.hostname = ws.hostname;\n this.errorMessage = ws.errorMessage;\n\n Object.freeze(this);\n }\n}\n\nObject.freeze(ScriptDeath);\nObject.freeze(ScriptDeath.prototype);\n","/**\n * Lore / world building literature files that can be found on servers.\n * These files can be read by the player\n */\nexport class Literature {\n title: string;\n fn: string;\n txt: string;\n\n constructor(title: string, filename: string, txt: string) {\n this.title = title;\n this.fn = filename;\n this.txt = txt;\n }\n}\n","import React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ntype IProps = {\n value: string;\n color?: string;\n variant?:\n | \"button\"\n | \"caption\"\n | \"h1\"\n | \"h2\"\n | \"h3\"\n | \"h4\"\n | \"h5\"\n | \"h6\"\n | \"subtitle1\"\n | \"subtitle2\"\n | \"body1\"\n | \"body2\"\n | \"overline\"\n | \"inherit\"\n | undefined;\n};\n\nexport function CopyableText(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n function copy(): void {\n const copyText = document.createElement(\"textarea\");\n copyText.value = props.value;\n document.body.appendChild(copyText);\n copyText.select();\n copyText.setSelectionRange(0, 1e10);\n document.execCommand(\"copy\");\n document.body.removeChild(copyText);\n setOpen(true);\n setTimeout(() => setOpen(false), 1000);\n }\n\n return (\n Copied!}>\n \n {props.value}\n \n \n );\n}\n","import React from \"react\";\nimport { createTheme, ThemeProvider, Theme, StyledEngineProvider } from \"@mui/material/styles\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Settings } from \"../../Settings/Settings\";\n\nexport const ThemeEvents = new EventEmitter<[]>();\n\ndeclare module \"@mui/material/styles\" {\n interface Theme {\n colors: {\n hp: React.CSSProperties[\"color\"];\n money: React.CSSProperties[\"color\"];\n hack: React.CSSProperties[\"color\"];\n combat: React.CSSProperties[\"color\"];\n cha: React.CSSProperties[\"color\"];\n int: React.CSSProperties[\"color\"];\n rep: React.CSSProperties[\"color\"];\n backgroundprimary: React.CSSProperties[\"color\"];\n backgroundsecondary: React.CSSProperties[\"color\"];\n button: React.CSSProperties[\"color\"];\n successlight: React.CSSProperties[\"color\"];\n success: React.CSSProperties[\"color\"];\n successdark: React.CSSProperties[\"color\"];\n white: React.CSSProperties[\"color\"];\n black: React.CSSProperties[\"color\"];\n };\n }\n interface ThemeOptions {\n colors: {\n hp: React.CSSProperties[\"color\"];\n money: React.CSSProperties[\"color\"];\n hack: React.CSSProperties[\"color\"];\n combat: React.CSSProperties[\"color\"];\n cha: React.CSSProperties[\"color\"];\n int: React.CSSProperties[\"color\"];\n rep: React.CSSProperties[\"color\"];\n backgroundprimary: React.CSSProperties[\"color\"];\n backgroundsecondary: React.CSSProperties[\"color\"];\n button: React.CSSProperties[\"color\"];\n successlight: React.CSSProperties[\"color\"];\n success: React.CSSProperties[\"color\"];\n successdark: React.CSSProperties[\"color\"];\n white: React.CSSProperties[\"color\"];\n black: React.CSSProperties[\"color\"];\n };\n }\n}\n\nlet theme: Theme;\n\nexport function refreshTheme(): void {\n theme = createTheme({\n colors: {\n hp: Settings.theme.hp,\n money: Settings.theme.money,\n hack: Settings.theme.hack,\n combat: Settings.theme.combat,\n cha: Settings.theme.cha,\n int: Settings.theme.int,\n rep: Settings.theme.rep,\n backgroundprimary: Settings.theme.backgroundprimary,\n backgroundsecondary: Settings.theme.backgroundsecondary,\n button: Settings.theme.button,\n successlight: Settings.theme.successlight,\n success: Settings.theme.success,\n successdark: Settings.theme.successdark,\n white: Settings.theme.white,\n black: Settings.theme.black,\n },\n palette: {\n primary: {\n light: Settings.theme.primarylight,\n main: Settings.theme.primary,\n dark: Settings.theme.primarydark,\n },\n secondary: {\n light: Settings.theme.secondarylight,\n main: Settings.theme.secondary,\n dark: Settings.theme.secondarydark,\n },\n error: {\n light: Settings.theme.errorlight,\n main: Settings.theme.error,\n dark: Settings.theme.errordark,\n },\n info: {\n light: Settings.theme.infolight,\n main: Settings.theme.info,\n dark: Settings.theme.infodark,\n },\n warning: {\n light: Settings.theme.warninglight,\n main: Settings.theme.warning,\n dark: Settings.theme.warningdark,\n },\n success: {\n light: Settings.theme.successlight,\n main: Settings.theme.success,\n dark: Settings.theme.successdark,\n },\n background: {\n default: Settings.theme.backgroundprimary,\n paper: Settings.theme.well,\n },\n action: {\n disabled: Settings.theme.disabled,\n },\n },\n typography: {\n fontFamily: Settings.styles.fontFamily,\n button: {\n textTransform: \"none\",\n },\n },\n components: {\n MuiInputBase: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.well,\n color: Settings.theme.primary,\n },\n input: {\n \"&::placeholder\": {\n userSelect: \"none\",\n color: Settings.theme.primarydark,\n },\n },\n },\n },\n\n MuiInput: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.well,\n borderBottomColor: \"#fff\",\n },\n underline: {\n \"&:hover\": {\n borderBottomColor: Settings.theme.primarydark,\n },\n \"&:before\": {\n borderBottomColor: Settings.theme.primary,\n },\n \"&:after\": {\n borderBottomColor: Settings.theme.primarylight,\n },\n },\n },\n },\n\n MuiInputLabel: {\n styleOverrides: {\n root: {\n color: Settings.theme.primarydark, // why is this switched?\n userSelect: \"none\",\n \"&:before\": {\n color: Settings.theme.primarylight,\n },\n },\n },\n },\n\n MuiButtonGroup: {\n styleOverrides: {\n root: {\n \"& .MuiButton-root:not(:last-of-type)\": {\n marginRight: \"1px\",\n },\n },\n },\n },\n\n MuiButton: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.button,\n border: \"1px solid \" + Settings.theme.well,\n // color: Settings.theme.primary,\n \"&:hover\": {\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n\n borderRadius: 0,\n },\n },\n },\n MuiSelect: {\n styleOverrides: {\n icon: {\n color: Settings.theme.primary,\n },\n },\n defaultProps: {\n variant: \"standard\",\n },\n },\n MuiTextField: {\n defaultProps: {\n variant: \"standard\",\n },\n },\n MuiTypography: {\n defaultProps: {\n color: \"primary\",\n },\n styleOverrides: {\n root: {\n lineHeight: Settings.styles.lineHeight,\n },\n },\n },\n MuiMenu: {\n styleOverrides: {\n list: {\n backgroundColor: Settings.theme.well,\n },\n },\n },\n MuiMenuItem: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiAccordionSummary: {\n styleOverrides: {\n root: {\n backgroundColor: \"#111\",\n },\n },\n },\n MuiAccordionDetails: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n },\n },\n MuiIconButton: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiTooltip: {\n styleOverrides: {\n tooltip: {\n fontSize: \"1em\",\n color: Settings.theme.primary,\n backgroundColor: Settings.theme.well,\n borderRadius: 0,\n border: \"2px solid white\",\n maxWidth: \"100vh\",\n },\n },\n defaultProps: {\n disableInteractive: true,\n },\n },\n MuiSlider: {\n styleOverrides: {\n valueLabel: {\n color: Settings.theme.primary,\n backgroundColor: Settings.theme.well,\n },\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: {\n \"&::-webkit-scrollbar\": {\n // webkit\n display: \"none\",\n },\n scrollbarWidth: \"none\", // firefox\n backgroundColor: Settings.theme.backgroundsecondary,\n },\n paperAnchorDockedLeft: {\n borderRight: \"1px solid \" + Settings.theme.welllight,\n },\n },\n },\n MuiDivider: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.welllight,\n },\n },\n },\n MuiFormControlLabel: {\n styleOverrides: {\n root: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiSwitch: {\n styleOverrides: {\n switchBase: {\n color: Settings.theme.primarydark,\n },\n track: {\n backgroundColor: Settings.theme.welllight,\n },\n },\n },\n MuiPaper: {\n styleOverrides: {\n root: {\n borderRadius: 0,\n backgroundColor: Settings.theme.backgroundsecondary,\n border: \"1px solid \" + Settings.theme.welllight,\n },\n },\n },\n MuiTablePagination: {\n styleOverrides: {\n select: {\n color: Settings.theme.primary,\n },\n selectLabel: {\n color: Settings.theme.primary,\n },\n displayedRows: {\n color: Settings.theme.primary,\n },\n },\n },\n MuiTab: {\n styleOverrides: {\n textColorPrimary: {\n color: Settings.theme.secondary,\n \"&.Mui-selected\": {\n color: Settings.theme.primary,\n },\n },\n root: {\n backgroundColor: Settings.theme.backgroundsecondary,\n border: \"1px solid \" + Settings.theme.well,\n margin: \"3px\",\n\n \"&.Mui-selected\": {\n backgroundColor: Settings.theme.button,\n },\n },\n },\n },\n MuiTabs: {\n styleOverrides: {\n scrollButtons: {\n backgroundColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary,\n margin: \"3px\",\n opacity: 1,\n width: \"fit-content\",\n\n \"&.Mui-disabled\": {\n opacity: 0.5,\n },\n },\n },\n defaultProps: {\n TabIndicatorProps: {\n style: {\n display: \"none\",\n },\n },\n },\n },\n MuiAlert: {\n styleOverrides: {\n root: {\n backgroundColor: Settings.theme.black,\n borderRadius: 0,\n border: \"1px solid \" + Settings.theme.well,\n },\n standardSuccess: {\n color: Settings.theme.successlight,\n },\n standardError: {\n color: Settings.theme.errorlight,\n },\n standardWarning: {\n color: Settings.theme.warninglight,\n },\n standardInfo: {\n color: Settings.theme.infolight,\n },\n },\n },\n },\n });\n\n document.body.style.backgroundColor = theme.colors.backgroundprimary?.toString() ?? \"black\";\n}\nrefreshTheme();\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element;\n}\n\nexport const TTheme = ({ children }: IProps): React.ReactElement => (\n \n {children}\n \n);\n","// Enums that defined allowed values for setting configuration\n\n/**\n * Allowed values for the 'OwnedAugmentationsOrder' setting\n */\nexport enum PurchaseAugmentationsOrderSetting {\n Cost,\n Default,\n Reputation,\n Purchasable,\n}\n\n/**\n * Allowed values for the 'OwnedAugmentationsOrder' setting\n */\nexport enum OwnedAugmentationsOrderSetting {\n Alphabetically,\n AcquirementTime,\n}\n","import { IMap } from \"../types\";\n\n// Map of material (by name) to their sizes (how much space it takes in warehouse)\nexport const MaterialSizes: IMap = {\n Water: 0.05,\n Energy: 0.01,\n Food: 0.03,\n Plants: 0.05,\n Metal: 0.1,\n Hardware: 0.06,\n Chemicals: 0.05,\n Drugs: 0.02,\n Robots: 0.5,\n AICores: 0.1,\n RealEstate: 0.005,\n \"Real Estate\": 0.005,\n \"AI Cores\": 0.1,\n};\n","export function calculateSkill(exp: number, mult = 1): number {\n return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);\n}\n\nexport function calculateExp(skill: number, mult = 1): number {\n return Math.exp((skill / mult + 200) / 32) - 534.6;\n}\n\nexport function calculateSkillProgress(exp: number, mult = 1): ISkillProgress {\n const currentSkill = calculateSkill(exp, mult);\n const nextSkill = currentSkill + 1;\n\n let baseExperience = calculateExp(currentSkill, mult);\n if (baseExperience < 0) baseExperience = 0;\n\n let nextExperience = calculateExp(nextSkill, mult);\n if (nextExperience < 0) nextExperience = 0;\n\n const normalize = (value: number): number => ((value - baseExperience) * 100) / (nextExperience - baseExperience);\n let progress = nextExperience - baseExperience !== 0 ? normalize(exp) : 99.99;\n\n // Clamp progress: When sleeves are working out, the player gets way too much progress\n if (progress < 0) progress = 0;\n if (progress > 100) progress = 100;\n\n // Clamp floating point imprecisions\n let currentExperience = exp - baseExperience;\n let remainingExperience = nextExperience - exp;\n if (currentExperience < 0) currentExperience = 0;\n if (remainingExperience < 0) remainingExperience = 0;\n\n return {\n currentSkill,\n nextSkill,\n baseExperience,\n experience: exp,\n nextExperience,\n currentExperience,\n remainingExperience,\n progress,\n };\n}\n\nexport interface ISkillProgress {\n currentSkill: number;\n nextSkill: number;\n baseExperience: number;\n experience: number;\n nextExperience: number;\n currentExperience: number;\n remainingExperience: number;\n progress: number;\n}\n\nexport function getEmptySkillProgress(): ISkillProgress {\n return {\n currentSkill: 0,\n nextSkill: 0,\n baseExperience: 0,\n experience: 0,\n nextExperience: 0,\n currentExperience: 0,\n remainingExperience: 0,\n progress: 0,\n };\n}\n","export interface IMults {\n hack?: number;\n str?: number;\n def?: number;\n dex?: number;\n agi?: number;\n cha?: number;\n}\n\nexport enum UpgradeType {\n Weapon = \"w\",\n Armor = \"a\",\n Vehicle = \"v\",\n Rootkit = \"r\",\n Augmentation = \"g\",\n}\n\n/**\n * Defines the parameters that can be used to initialize and describe a GangMemberUpgrade\n * (defined in Gang.js)\n */\ninterface IGangMemberUpgradeMetadata {\n cost: number;\n mults: IMults;\n name: string;\n upgType: UpgradeType;\n}\n\n/**\n * Array of metadata for all Gang Member upgrades. Used to construct the global GangMemberUpgrade\n * objects in Gang.js\n */\nexport const gangMemberUpgradesMetadata: IGangMemberUpgradeMetadata[] = [\n {\n cost: 1e6,\n mults: { str: 1.04, def: 1.04 },\n name: \"Baseball Bat\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 12e6,\n mults: { str: 1.08, def: 1.08, dex: 1.08 },\n name: \"Katana\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 25e6,\n mults: { str: 1.1, def: 1.1, dex: 1.1, agi: 1.1 },\n name: \"Glock 18C\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 50e6,\n mults: { str: 1.12, def: 1.1, agi: 1.1 },\n name: \"P90C\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 60e6,\n mults: { str: 1.2, def: 1.15 },\n name: \"Steyr AUG\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 100e6,\n mults: { str: 1.25, def: 1.2 },\n name: \"AK-47\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 150e6,\n mults: { str: 1.3, def: 1.25 },\n name: \"M15A10 Assault Rifle\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 225e6,\n mults: { str: 1.3, dex: 1.25, agi: 1.3 },\n name: \"AWM Sniper Rifle\",\n upgType: UpgradeType.Weapon,\n },\n {\n cost: 2e6,\n mults: { def: 1.04 },\n name: \"Bulletproof Vest\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 5e6,\n mults: { def: 1.08 },\n name: \"Full Body Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 25e6,\n mults: { def: 1.15, agi: 1.15 },\n name: \"Liquid Body Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 40e6,\n mults: { def: 1.2 },\n name: \"Graphene Plating Armor\",\n upgType: UpgradeType.Armor,\n },\n {\n cost: 3e6,\n mults: { agi: 1.04, cha: 1.04 },\n name: \"Ford Flex V20\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 9e6,\n mults: { agi: 1.08, cha: 1.08 },\n name: \"ATX1070 Superbike\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 18e6,\n mults: { agi: 1.12, cha: 1.12 },\n name: \"Mercedes-Benz S9001\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 30e6,\n mults: { agi: 1.16, cha: 1.16 },\n name: \"White Ferrari\",\n upgType: UpgradeType.Vehicle,\n },\n {\n cost: 5e6,\n mults: { hack: 1.05 },\n name: \"NUKE Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 25e6,\n mults: { hack: 1.1 },\n name: \"Soulstealer Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 75e6,\n mults: { hack: 1.15 },\n name: \"Demon Rootkit\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 40e6,\n mults: { hack: 1.12 },\n name: \"Hmap Node\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 75e6,\n mults: { hack: 1.15 },\n name: \"Jack the Ripper\",\n upgType: UpgradeType.Rootkit,\n },\n {\n cost: 10e9,\n mults: { str: 1.3, dex: 1.3 },\n name: \"Bionic Arms\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 10e9,\n mults: { agi: 1.6 },\n name: \"Bionic Legs\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 15e9,\n mults: { str: 1.15, def: 1.15, dex: 1.15, agi: 1.15 },\n name: \"Bionic Spine\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 20e9,\n mults: { str: 1.4, def: 1.4 },\n name: \"BrachiBlades\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 12e9,\n mults: { str: 1.2, def: 1.2 },\n name: \"Nanofiber Weave\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 25e9,\n mults: { str: 1.5, agi: 1.5 },\n name: \"Synthetic Heart\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 15e9,\n mults: { str: 1.3, def: 1.3 },\n name: \"Synfibril Muscle\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 5e9,\n mults: { hack: 1.05 },\n name: \"BitWire\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 10e9,\n mults: { hack: 1.15 },\n name: \"Neuralstimulator\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 7.5e9,\n mults: { hack: 1.1 },\n name: \"DataJack\",\n upgType: UpgradeType.Augmentation,\n },\n {\n cost: 50e9,\n mults: { str: 1.7, def: 1.7 },\n name: \"Graphene Bone Lacings\",\n upgType: UpgradeType.Augmentation,\n },\n];\n","/**\n * Functions for handling WorkerScripts, which are the underlying mechanism\n * that allows for scripts to run\n */\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { ScriptDeath } from \"./Netscript/ScriptDeath\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\nimport { generateNextPid } from \"./Netscript/Pid\";\n\nimport { CONSTANTS } from \"./Constants\";\nimport { Interpreter } from \"./ThirdParty/JSInterpreter\";\nimport { NetscriptFunctions } from \"./NetscriptFunctions\";\nimport { executeJSScript, Node } from \"./NetscriptJSEvaluator\";\nimport { NetscriptPort, IPort } from \"./NetscriptPort\";\nimport { RunningScript } from \"./Script/RunningScript\";\nimport { getRamUsageFromRunningScript } from \"./Script/RunningScriptHelpers\";\nimport { scriptCalculateOfflineProduction } from \"./Script/ScriptHelpers\";\nimport { Script } from \"./Script/Script\";\nimport { GetAllServers } from \"./Server/AllServers\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Settings } from \"./Settings/Settings\";\n\nimport { generate } from \"escodegen\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { roundToTwo } from \"./utils/helpers/roundToTwo\";\nimport { isString } from \"./utils/helpers/isString\";\n\nimport { parse } from \"acorn\";\nimport { simple as walksimple } from \"acorn-walk\";\nimport { areFilesEqual } from \"./Terminal/DirectoryHelpers\";\nimport { Player } from \"./Player\";\nimport { Terminal } from \"./Terminal\";\nimport { ScriptArg } from \"./Netscript/ScriptArg\";\nimport { helpers } from \"./Netscript/NetscriptHelpers\";\n\n// Netscript Ports are instantiated here\nexport const NetscriptPorts: IPort[] = [];\nfor (let i = 0; i < CONSTANTS.NumNetscriptPorts; ++i) {\n NetscriptPorts.push(NetscriptPort());\n}\n\nexport function prestigeWorkerScripts(): void {\n for (const ws of workerScripts.values()) {\n ws.env.stopFlag = true;\n killWorkerScript(ws);\n }\n for (const port of NetscriptPorts) {\n port.clear();\n }\n\n WorkerScriptStartStopEventEmitter.emit();\n workerScripts.clear();\n}\n\n// JS script promises need a little massaging to have the same guarantees as netscript\n// promises. This does said massaging and kicks the script off. It returns a promise\n// that resolves or rejects when the corresponding worker script is done.\nfunction startNetscript2Script(workerScript: WorkerScript): Promise {\n return new Promise((resolve, reject) => {\n executeJSScript(Player, workerScript.getServer().scripts, workerScript)\n .then(() => {\n resolve();\n })\n .catch((e) => reject(e));\n }).catch((e) => {\n if (e instanceof Error) {\n if (e instanceof SyntaxError) {\n workerScript.errorMessage = helpers.makeRuntimeRejectMsg(\n workerScript,\n e.message + \" (sorry we can't be more helpful)\",\n );\n } else {\n workerScript.errorMessage = helpers.makeRuntimeRejectMsg(\n workerScript,\n e.message + ((e.stack && \"\\nstack:\\n\" + e.stack.toString()) || \"\"),\n );\n }\n throw new ScriptDeath(workerScript);\n } else if (helpers.isScriptErrorMessage(e)) {\n workerScript.errorMessage = e;\n throw new ScriptDeath(workerScript);\n } else if (e instanceof ScriptDeath) {\n throw e;\n }\n\n // Don't know what to do with it, let's try making an error message out of it\n workerScript.errorMessage = helpers.makeRuntimeRejectMsg(workerScript, \"\" + e);\n throw new ScriptDeath(workerScript);\n });\n}\n\nfunction startNetscript1Script(workerScript: WorkerScript): Promise {\n const code = workerScript.code;\n\n //Process imports\n let codeWithImports, codeLineOffset;\n try {\n const importProcessingRes = processNetscript1Imports(code, workerScript);\n codeWithImports = importProcessingRes.code;\n codeLineOffset = importProcessingRes.lineOffset;\n } catch (e: unknown) {\n dialogBoxCreate(\"Error processing Imports in \" + workerScript.name + \":
\" + String(e));\n workerScript.env.stopFlag = true;\n killWorkerScript(workerScript);\n return Promise.resolve();\n }\n\n function wrapNS1Layer(int: Interpreter, intLayer: unknown, path: string[] = []) {\n //TODO: Better typing layers of interpreter scope and ns\n interface BasicObject {\n [key: string]: any;\n }\n const nsLayer = path.reduce((prev, newPath) => prev[newPath], workerScript.env.vars as BasicObject);\n for (const [name, entry] of Object.entries(nsLayer)) {\n if (typeof entry === \"function\") {\n // Async functions need to be wrapped. See JS-Interpreter documentation\n const wrapper = async (...args: unknown[]) => {\n // This async wrapper is sent a resolver function as an extra arg.\n // See JSInterpreter.js:3209\n try {\n const callback = args.pop() as (value: unknown) => void;\n const result = await entry(...args.map(int.pseudoToNative));\n return callback(int.nativeToPseudo(result));\n } catch (e: unknown) {\n // TODO: Unify error handling, this was stolen from previous async handler\n if (typeof e === \"string\") {\n console.error(e);\n const errorTextArray = e.split(\"|DELIMITER|\");\n const hostname = errorTextArray[1];\n const scriptName = errorTextArray[2];\n const errorMsg = errorTextArray[3];\n let msg = `${scriptName}@${hostname}
`;\n msg += \"
\";\n msg += errorMsg;\n dialogBoxCreate(msg);\n workerScript.env.stopFlag = true;\n killWorkerScript(workerScript);\n return;\n }\n }\n };\n int.setProperty(intLayer, name, int.createAsyncFunction(wrapper));\n } else if (Array.isArray(entry) || typeof entry !== \"object\") {\n // args, strings on enums, etc\n int.setProperty(intLayer, name, int.nativeToPseudo(entry));\n } else {\n // new object layer, e.g. bladeburner\n int.setProperty(intLayer, name, int.nativeToPseudo({}));\n wrapNS1Layer(int, (intLayer as BasicObject).properties[name], [...path, name]);\n }\n }\n }\n\n let interpreter: Interpreter;\n try {\n interpreter = new Interpreter(codeWithImports, wrapNS1Layer, codeLineOffset);\n } catch (e: unknown) {\n dialogBoxCreate(\"Syntax ERROR in \" + workerScript.name + \":
\" + String(e));\n workerScript.env.stopFlag = true;\n killWorkerScript(workerScript);\n return Promise.resolve();\n }\n\n return new Promise(function (resolve, reject) {\n function runInterpreter(): void {\n try {\n if (workerScript.env.stopFlag) {\n return reject(new ScriptDeath(workerScript));\n }\n\n let more = true;\n let i = 0;\n while (i < 3 && more) {\n more = more && interpreter.step();\n i++;\n }\n\n if (more) {\n setTimeout(runInterpreter, Settings.CodeInstructionRunTime);\n } else {\n resolve();\n }\n } catch (_e: unknown) {\n let e = String(_e);\n if (!helpers.isScriptErrorMessage(e)) {\n e = helpers.makeRuntimeRejectMsg(workerScript, e);\n }\n workerScript.errorMessage = e;\n return reject(new ScriptDeath(workerScript));\n }\n }\n\n try {\n runInterpreter();\n } catch (e: unknown) {\n if (isString(e)) {\n workerScript.errorMessage = e;\n return reject(new ScriptDeath(workerScript));\n } else if (e instanceof ScriptDeath) {\n return reject(e);\n } else {\n console.error(e);\n return reject(new ScriptDeath(workerScript));\n }\n }\n });\n}\n\n/* Since the JS Interpreter used for Netscript 1.0 only supports ES5, the keyword\n 'import' throws an error. However, since we want to support import funtionality\n we'll implement it ourselves by parsing the Nodes in the AST out.\n\n @param code - The script's code\n @returns {Object} {\n code: Newly-generated code with imported functions\n lineOffset: Net number of lines of code added/removed due to imported functions\n Should typically be positive\n }\n*/\nfunction processNetscript1Imports(code: string, workerScript: WorkerScript): { code: string; lineOffset: number } {\n //allowReserved prevents 'import' from throwing error in ES5\n const ast: Node = parse(code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n const server = workerScript.getServer();\n if (server == null) {\n throw new Error(\"Failed to find underlying Server object for script\");\n }\n\n function getScript(scriptName: string): Script | null {\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === scriptName) {\n return server.scripts[i];\n }\n }\n return null;\n }\n\n let generatedCode = \"\"; // Generated Javascript Code\n let hasImports = false;\n\n // Walk over the tree and process ImportDeclaration nodes\n walksimple(ast, {\n ImportDeclaration: (node: Node) => {\n hasImports = true;\n let scriptName = node.source.value;\n if (scriptName.startsWith(\"./\")) {\n scriptName = scriptName.slice(2);\n }\n const script = getScript(scriptName);\n if (script == null) {\n throw new Error(\"'Import' failed due to invalid script: \" + scriptName);\n }\n const scriptAst = parse(script.code, {\n ecmaVersion: 9,\n allowReserved: true,\n sourceType: \"module\",\n });\n\n if (node.specifiers.length === 1 && node.specifiers[0].type === \"ImportNamespaceSpecifier\") {\n // import * as namespace from script\n const namespace = node.specifiers[0].local.name;\n const fnNames: string[] = []; //Names only\n const fnDeclarations: Node[] = []; //FunctionDeclaration Node objects\n walksimple(scriptAst, {\n FunctionDeclaration: (node: Node) => {\n fnNames.push(node.id.name);\n fnDeclarations.push(node);\n },\n });\n\n //Now we have to generate the code that would create the namespace\n generatedCode += `var ${namespace};\\n(function (namespace) {\\n`;\n\n //Add the function declarations\n fnDeclarations.forEach((fn: Node) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n\n //Add functions to namespace\n fnNames.forEach((fnName) => {\n generatedCode += \"namespace.\" + fnName + \" = \" + fnName;\n generatedCode += \"\\n\";\n });\n\n //Finish\n generatedCode += `})(${namespace} || (\" + namespace + \" = {}));\\n`;\n } else {\n //import {...} from script\n\n //Get array of all fns to import\n const fnsToImport: string[] = [];\n node.specifiers.forEach((e: Node) => {\n fnsToImport.push(e.local.name);\n });\n\n //Walk through script and get FunctionDeclaration code for all specified fns\n const fnDeclarations: Node[] = [];\n walksimple(scriptAst, {\n FunctionDeclaration: (node: Node) => {\n if (fnsToImport.includes(node.id.name)) {\n fnDeclarations.push(node);\n }\n },\n });\n\n //Convert FunctionDeclarations into code\n fnDeclarations.forEach((fn: Node) => {\n generatedCode += generate(fn);\n generatedCode += \"\\n\";\n });\n }\n },\n });\n\n //If there are no imports, just return the original code\n if (!hasImports) {\n return { code: code, lineOffset: 0 };\n }\n\n //Remove ImportDeclarations from AST. These ImportDeclarations must be in top-level\n let linesRemoved = 0;\n if (ast.type !== \"Program\" || ast.body == null) {\n throw new Error(\"Code could not be properly parsed\");\n }\n for (let i = ast.body.length - 1; i >= 0; --i) {\n if (ast.body[i].type === \"ImportDeclaration\") {\n ast.body.splice(i, 1);\n ++linesRemoved;\n }\n }\n\n //Calculated line offset\n const lineOffset = (generatedCode.match(/\\n/g) || []).length - linesRemoved;\n\n //Convert the AST back into code\n code = generate(ast);\n\n //Add the imported code and re-generate in ES5 (JS Interpreter for NS1 only supports ES5);\n code = generatedCode + code;\n\n const res = {\n code: code,\n lineOffset: lineOffset,\n };\n return res;\n}\n\n/**\n * Used to start a RunningScript (by creating and starting its\n * corresponding WorkerScript), and add the RunningScript to the server on which\n * it is active\n */\nexport function startWorkerScript(runningScript: RunningScript, server: BaseServer, parent?: WorkerScript): number {\n if (createAndAddWorkerScript(runningScript, server, parent)) {\n // Push onto runningScripts.\n // This has to come after createAndAddWorkerScript() because that fn updates RAM usage\n server.runScript(runningScript);\n\n // Once the WorkerScript is constructed in createAndAddWorkerScript(), the RunningScript\n // object should have a PID assigned to it, so we return that\n return runningScript.pid;\n }\n\n return 0;\n}\n\n/**\n * Given a RunningScript object, constructs its corresponding WorkerScript,\n * adds it to the global 'workerScripts' pool, and begins executing it.\n * @param {RunningScript} runningScriptObj - Script that's being run\n * @param {Server} server - Server on which the script is to be run\n * returns {boolean} indicating whether or not the workerScript was successfully added\n */\nfunction createAndAddWorkerScript(runningScriptObj: RunningScript, server: BaseServer, parent?: WorkerScript): boolean {\n // Update server's ram usage\n let threads = 1;\n if (runningScriptObj.threads && !isNaN(runningScriptObj.threads)) {\n threads = runningScriptObj.threads;\n } else {\n runningScriptObj.threads = 1;\n }\n const oneRamUsage = getRamUsageFromRunningScript(runningScriptObj);\n const ramUsage = roundToTwo(oneRamUsage * threads);\n const ramAvailable = server.maxRam - server.ramUsed;\n if (ramUsage > ramAvailable + 0.001) {\n dialogBoxCreate(\n `Not enough RAM to run script ${runningScriptObj.filename} with args ` +\n `${arrayToString(runningScriptObj.args)}. This likely occurred because you re-loaded ` +\n `the game and the script's RAM usage increased (either because of an update to the game or ` +\n `your changes to the script.)`,\n );\n return false;\n }\n\n server.updateRamUsed(roundToTwo(server.ramUsed + ramUsage), Player);\n\n // Get the pid\n const pid = generateNextPid();\n if (pid === -1) {\n throw new Error(\n `Failed to start script because could not find available PID. This is most ` +\n `because you have too many scripts running.`,\n );\n }\n\n // Create the WorkerScript. NOTE: WorkerScript ctor will set the underlying\n // RunningScript's PID as well\n const workerScript = new WorkerScript(runningScriptObj, pid, NetscriptFunctions);\n workerScript.ramUsage = oneRamUsage;\n\n // Add the WorkerScript to the global pool\n workerScripts.set(pid, workerScript);\n WorkerScriptStartStopEventEmitter.emit();\n\n // Start the script's execution\n let scriptExecution: Promise | null = null; // Script's resulting promise\n if (workerScript.name.endsWith(\".js\")) {\n scriptExecution = startNetscript2Script(workerScript);\n } else {\n scriptExecution = startNetscript1Script(workerScript);\n if (!(scriptExecution instanceof Promise)) {\n return false;\n }\n }\n\n // Once the code finishes (either resolved or rejected, doesnt matter), set its\n // running status to false\n scriptExecution\n .then(function () {\n workerScript.env.stopFlag = true;\n // On natural death, the earnings are transfered to the parent if it still exists.\n if (parent !== undefined && !parent.env.stopFlag) {\n parent.scriptRef.onlineExpGained += runningScriptObj.onlineExpGained;\n parent.scriptRef.onlineMoneyMade += runningScriptObj.onlineMoneyMade;\n }\n\n killWorkerScript(workerScript);\n workerScript.log(\"\", () => \"Script finished running\");\n })\n .catch(function (e) {\n if (e instanceof Error) {\n dialogBoxCreate(\"Script runtime unknown error. This is a bug please contact game developer\");\n console.error(\"Evaluating workerscript returns an Error. THIS SHOULDN'T HAPPEN: \" + e.toString());\n return;\n } else if (e instanceof ScriptDeath) {\n if (helpers.isScriptErrorMessage(workerScript.errorMessage)) {\n const errorTextArray = workerScript.errorMessage.split(\"|DELIMITER|\");\n if (errorTextArray.length != 4) {\n console.error(\"ERROR: Something wrong with Error text in evaluator...\");\n console.error(\"Error text: \" + workerScript.errorMessage);\n return;\n }\n const hostname = errorTextArray[1];\n const scriptName = errorTextArray[2];\n const errorMsg = errorTextArray[3];\n\n let msg = `RUNTIME ERROR
${scriptName}@${hostname} (PID - ${workerScript.pid})
`;\n if (workerScript.args.length > 0) {\n msg += `Args: ${arrayToString(workerScript.args)}
`;\n }\n msg += \"
\";\n msg += errorMsg;\n\n dialogBoxCreate(msg);\n workerScript.log(\"\", () => \"Script crashed with runtime error\");\n } else {\n workerScript.log(\"\", () => \"Script killed\");\n return; // Already killed, so stop here\n }\n } else if (helpers.isScriptErrorMessage(e)) {\n dialogBoxCreate(\"Script runtime unknown error. This is a bug please contact game developer\");\n console.error(\n \"ERROR: Evaluating workerscript returns only error message rather than WorkerScript object. THIS SHOULDN'T HAPPEN: \" +\n e.toString(),\n );\n return;\n } else {\n dialogBoxCreate(\"An unknown script died for an unknown reason. This is a bug please contact game dev\");\n console.error(e);\n }\n\n killWorkerScript(workerScript);\n });\n\n return true;\n}\n\n/**\n * Updates the online running time stat of all running scripts\n */\nexport function updateOnlineScriptTimes(numCycles = 1): void {\n const time = (numCycles * CONSTANTS._idleSpeed) / 1000; //seconds\n for (const ws of workerScripts.values()) {\n ws.scriptRef.onlineRunningTime += time;\n }\n}\n\n/**\n * Called when the game is loaded. Loads all running scripts (from all servers)\n * into worker scripts so that they will start running\n */\nexport function loadAllRunningScripts(): void {\n const skipScriptLoad = window.location.href.toLowerCase().indexOf(\"?noscripts\") !== -1;\n if (skipScriptLoad) {\n Terminal.warn(\"Skipped loading player scripts during startup\");\n console.info(\"Skipping the load of any scripts during startup\");\n }\n for (const server of GetAllServers()) {\n // Reset each server's RAM usage to 0\n server.ramUsed = 0;\n\n // Reset modules on all scripts\n for (let i = 0; i < server.scripts.length; ++i) {\n server.scripts[i].markUpdated();\n }\n\n if (skipScriptLoad) {\n // Start game with no scripts\n server.runningScripts.length = 0;\n } else {\n for (let j = 0; j < server.runningScripts.length; ++j) {\n const fileName = server.runningScripts[j].filename;\n createAndAddWorkerScript(server.runningScripts[j], server);\n\n if (!server.runningScripts[j]) {\n // createAndAddWorkerScript can modify the server.runningScripts array if a script is invalid\n console.error(`createAndAddWorkerScript removed ${fileName} from ${server}`);\n continue;\n }\n\n // Offline production\n scriptCalculateOfflineProduction(server.runningScripts[j]);\n }\n }\n }\n}\n\n/**\n * Run a script from inside another script (run(), exec(), spawn(), etc.)\n */\nexport function runScriptFromScript(\n caller: string,\n server: BaseServer,\n scriptname: string,\n args: ScriptArg[],\n workerScript: WorkerScript,\n threads = 1,\n): number {\n // Sanitize arguments\n if (!(workerScript instanceof WorkerScript)) {\n return 0;\n }\n\n if (typeof scriptname !== \"string\" || !Array.isArray(args)) {\n workerScript.log(caller, () => `Invalid arguments: scriptname='${scriptname} args='${args}'`);\n console.error(`runScriptFromScript() failed due to invalid arguments`);\n return 0;\n }\n\n args.forEach((arg, i) => {\n if (typeof arg !== \"string\" && typeof arg !== \"number\" && typeof arg !== \"boolean\")\n throw new Error(\n \"Only strings, numbers, and booleans can be passed as arguments to other scripts.\\n\" +\n `${scriptname} argument index ${i} is of type ${typeof arg} and value ${JSON.stringify(arg)}`,\n );\n });\n\n // Check if the script is already running\n const runningScriptObj = server.getRunningScript(scriptname, args);\n if (runningScriptObj != null) {\n workerScript.log(caller, () => `'${scriptname}' is already running on '${server.hostname}'`);\n return 0;\n }\n\n // 'null/undefined' arguments are not allowed\n for (let i = 0; i < args.length; ++i) {\n if (args[i] == null) {\n workerScript.log(caller, () => \"Cannot execute a script with null/undefined as an argument\");\n return 0;\n }\n }\n\n // Check if the script exists and if it does run it\n for (let i = 0; i < server.scripts.length; ++i) {\n if (!areFilesEqual(server.scripts[i].filename, scriptname)) continue;\n // Check for admin rights and that there is enough RAM availble to run\n const script = server.scripts[i];\n let ramUsage = script.ramUsage;\n threads = Math.floor(Number(threads));\n if (threads === 0) {\n return 0;\n }\n ramUsage = ramUsage * threads;\n const ramAvailable = server.maxRam - server.ramUsed;\n\n if (server.hasAdminRights == false) {\n workerScript.log(caller, () => `You do not have root access on '${server.hostname}'`);\n return 0;\n } else if (ramUsage > ramAvailable + 0.001) {\n workerScript.log(\n caller,\n () =>\n `Cannot run script '${scriptname}' (t=${threads}) on '${server.hostname}' because there is not enough available RAM!`,\n );\n return 0;\n }\n // Able to run script\n workerScript.log(\n caller,\n () => `'${scriptname}' on '${server.hostname}' with ${threads} threads and args: ${arrayToString(args)}.`,\n );\n const runningScriptObj = new RunningScript(script, args);\n runningScriptObj.threads = threads;\n runningScriptObj.server = server.hostname;\n\n return startWorkerScript(runningScriptObj, server, workerScript);\n }\n\n workerScript.log(caller, () => `Could not find script '${scriptname}' on '${server.hostname}'`);\n return 0;\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\n\nexport const GangConstants: {\n GangRespectToReputationRatio: number;\n MaximumGangMembers: number;\n CyclesPerTerritoryAndPowerUpdate: number;\n AscensionMultiplierRatio: number;\n Names: string[];\n GangKarmaRequirement: number;\n} = {\n // Respect is divided by this to get rep gain\n GangRespectToReputationRatio: 75,\n MaximumGangMembers: 12,\n CyclesPerTerritoryAndPowerUpdate: 100,\n // Portion of upgrade multiplier that is kept after ascending\n AscensionMultiplierRatio: 0.15,\n // Names of possible Gangs\n Names: [\n FactionNames.SlumSnakes,\n FactionNames.Tetrads,\n FactionNames.TheSyndicate,\n FactionNames.TheDarkArmy,\n FactionNames.SpeakersForTheDead,\n FactionNames.NiteSec,\n FactionNames.TheBlackHand,\n ],\n GangKarmaRequirement: -54000,\n};\n","/**\n * Functions for buying/selling stocks. There are four functions total, two for\n * long positions and two for short positions.\n */\nimport { Stock } from \"./Stock\";\nimport {\n getBuyTransactionCost,\n getSellTransactionGain,\n processTransactionForecastMovement,\n} from \"./StockMarketHelpers\";\n\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { Player } from \"../Player\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nimport * as React from \"react\";\nimport { NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\n/**\n * Each function takes an optional config object as its last argument\n */\ninterface IOptions {\n rerenderFn?: () => void;\n suppressDialog?: boolean;\n}\n\n/**\n * Attempt to buy a stock in the long position\n * @param {Stock} stock - Stock to buy\n * @param {number} shares - Number of shares to buy\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} - true if successful, false otherwise\n */\nexport function buyStock(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n // Validate arguments\n shares = Math.round(shares);\n if (shares <= 0) {\n return false;\n }\n if (stock == null || isNaN(shares)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\"Failed to buy stock. This may be a bug, contact developer\");\n }\n\n return false;\n }\n\n // Does player have enough money?\n const totalPrice = getBuyTransactionCost(stock, shares, PositionTypes.Long);\n if (totalPrice == null) {\n return false;\n }\n if (Player.money < totalPrice) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n `You do not have enough money to purchase this position. You need ${numeralWrapper.formatMoney(totalPrice)}.`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n You do not have enough money to purchase this. You need \n ,\n );\n }\n\n return false;\n }\n\n // Would this purchase exceed the maximum number of shares?\n if (shares + stock.playerShares + stock.playerShortShares > stock.maxShares) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n `Purchasing '${shares + stock.playerShares + stock.playerShortShares}' shares would exceed ${\n stock.symbol\n }'s maximum (${stock.maxShares}) number of shares`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n `You cannot purchase this many shares. ${stock.symbol} has a maximum of ${numeralWrapper.formatShares(\n stock.maxShares,\n )} shares.`,\n );\n }\n\n return false;\n }\n\n const origTotal = stock.playerShares * stock.playerAvgPx;\n Player.loseMoney(totalPrice, \"stock\");\n const newTotal = origTotal + totalPrice - CONSTANTS.StockMarketCommission;\n stock.playerShares = Math.round(stock.playerShares + shares);\n stock.playerAvgPx = newTotal / stock.playerShares;\n processTransactionForecastMovement(stock, shares);\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt = `Bought ${numeralWrapper.formatShares(shares)} shares of ${\n stock.symbol\n } for ${numeralWrapper.formatMoney(totalPrice)}. Paid ${numeralWrapper.formatMoney(\n CONSTANTS.StockMarketCommission,\n )} in commission fees.`;\n helpers.log(ctx, () => resultTxt);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n Bought {numeralWrapper.formatShares(shares)} shares of {stock.symbol} for . Paid{\" \"}\n in commission fees.\n ,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to sell a stock in the long position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to sell\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * returns {boolean} - true if successfully sells given number of shares OR MAX owned, false otherwise\n */\nexport function sellStock(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n // Sanitize/Validate arguments\n if (stock == null || shares < 0 || isNaN(shares)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n \"Failed to sell stock. This is probably due to an invalid quantity. Otherwise, this may be a bug, contact developer\",\n );\n }\n\n return false;\n }\n shares = Math.round(shares);\n if (shares > stock.playerShares) {\n shares = stock.playerShares;\n }\n if (shares === 0) {\n return false;\n }\n\n const gains = getSellTransactionGain(stock, shares, PositionTypes.Long);\n if (gains == null) {\n return false;\n }\n let netProfit = gains - stock.playerAvgPx * shares;\n if (isNaN(netProfit)) {\n netProfit = 0;\n }\n Player.gainMoney(gains, \"stock\");\n if (ctx) {\n ctx.workerScript.scriptRef.onlineMoneyMade += netProfit;\n Player.scriptProdSinceLastAug += netProfit;\n }\n\n stock.playerShares = Math.round(stock.playerShares - shares);\n if (stock.playerShares === 0) {\n stock.playerAvgPx = 0;\n }\n\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt =\n `Sold ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol}. ` +\n `After commissions, you gained a total of ${numeralWrapper.formatMoney(gains)}.`;\n helpers.log(ctx, () => resultTxt);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatShares(shares)} shares of {stock.symbol}. After commissions, you gained a total of{\" \"}\n .\n ,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to buy a stock in the short position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to short\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} - true if successful, false otherwise\n */\nexport function shortStock(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n // Validate arguments\n shares = Math.round(shares);\n if (shares <= 0) {\n return false;\n }\n if (stock == null || isNaN(shares)) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n \"Failed to initiate a short position in a stock. This is probably \" +\n \"due to an invalid quantity. Otherwise, this may be a bug, so contact developer\",\n );\n }\n return false;\n }\n\n // Does the player have enough money?\n const totalPrice = getBuyTransactionCost(stock, shares, PositionTypes.Short);\n if (totalPrice == null) {\n return false;\n }\n if (Player.money < totalPrice) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n \"You do not have enough \" +\n \"money to purchase this short position. You need \" +\n numeralWrapper.formatMoney(totalPrice),\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n <>\n You do not have enough money to purchase this short position. You need \n ,\n );\n }\n\n return false;\n }\n\n // Would this purchase exceed the maximum number of shares?\n if (shares + stock.playerShares + stock.playerShortShares > stock.maxShares) {\n if (ctx) {\n helpers.log(\n ctx,\n () =>\n `This '${shares + stock.playerShares + stock.playerShortShares}' short shares would exceed ${\n stock.symbol\n }'s maximum (${stock.maxShares}) number of shares.`,\n );\n } else if (opts.suppressDialog !== true) {\n dialogBoxCreate(\n `You cannot purchase this many shares. ${stock.symbol} has a maximum of ${stock.maxShares} shares.`,\n );\n }\n\n return false;\n }\n\n const origTotal = stock.playerShortShares * stock.playerAvgShortPx;\n Player.loseMoney(totalPrice, \"stock\");\n const newTotal = origTotal + totalPrice - CONSTANTS.StockMarketCommission;\n stock.playerShortShares = Math.round(stock.playerShortShares + shares);\n stock.playerAvgShortPx = newTotal / stock.playerShortShares;\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt =\n `Bought a short position of ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol} ` +\n `for ${numeralWrapper.formatMoney(totalPrice)}. Paid ${numeralWrapper.formatMoney(\n CONSTANTS.StockMarketCommission,\n )} ` +\n `in commission fees.`;\n helpers.log(ctx, () => resultTxt);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n <>\n Bought a short position of {numeralWrapper.formatShares(shares)} shares of {stock.symbol} for{\" \"}\n . Paid in commission fees.\n ,\n );\n }\n\n return true;\n}\n\n/**\n * Attempt to sell a stock in the short position\n * @param {Stock} stock - Stock to sell\n * @param {number} shares - Number of shares to sell\n * @param {NetscriptContext} ctx - If this is being called through Netscript\n * @param opts - Optional configuration for this function's behavior. See top of file\n * @returns {boolean} true if successfully sells given amount OR max owned, false otherwise\n */\nexport function sellShort(\n stock: Stock,\n shares: number,\n ctx: NetscriptContext | null = null,\n opts: IOptions = {},\n): boolean {\n if (stock == null || isNaN(shares) || shares < 0) {\n if (ctx) {\n helpers.log(ctx, () => `Invalid arguments: stock='${stock}' shares='${shares}'`);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n \"Failed to sell a short position in a stock. This is probably \" +\n \"due to an invalid quantity. Otherwise, this may be a bug, so contact developer\",\n );\n }\n\n return false;\n }\n shares = Math.round(shares);\n if (shares > stock.playerShortShares) {\n shares = stock.playerShortShares;\n }\n if (shares === 0) {\n return false;\n }\n\n const origCost = shares * stock.playerAvgShortPx;\n const totalGain = getSellTransactionGain(stock, shares, PositionTypes.Short);\n if (totalGain == null || isNaN(totalGain) || origCost == null) {\n if (ctx) {\n helpers.log(\n ctx,\n () => `Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug`,\n );\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n `Failed to sell short position in a stock. This is probably either due to invalid arguments, or a bug`,\n );\n }\n\n return false;\n }\n let profit = totalGain - origCost;\n if (isNaN(profit)) {\n profit = 0;\n }\n Player.gainMoney(totalGain, \"stock\");\n if (ctx) {\n ctx.workerScript.scriptRef.onlineMoneyMade += profit;\n Player.scriptProdSinceLastAug += profit;\n }\n\n stock.playerShortShares = Math.round(stock.playerShortShares - shares);\n if (stock.playerShortShares === 0) {\n stock.playerAvgShortPx = 0;\n }\n processTransactionForecastMovement(stock, shares);\n\n if (opts.rerenderFn != null && typeof opts.rerenderFn === \"function\") {\n opts.rerenderFn();\n }\n\n if (ctx) {\n const resultTxt =\n `Sold your short position of ${numeralWrapper.formatShares(shares)} shares of ${stock.symbol}. ` +\n `After commissions, you gained a total of ${numeralWrapper.formatMoney(totalGain)}`;\n helpers.log(ctx, () => resultTxt);\n } else if (!opts.suppressDialog) {\n dialogBoxCreate(\n <>\n Sold your short position of {numeralWrapper.formatShares(shares)} shares of {stock.symbol}. After commissions,\n you gained a total of \n ,\n );\n }\n\n return true;\n}\n","import { FactionInfo, FactionInfos } from \"./FactionInfo\";\nimport { favorToRep, repToFavor } from \"./formulas/favor\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Faction {\n /**\n * Flag signalling whether the player has already received an invitation\n * to this faction\n */\n alreadyInvited = false;\n\n /**\n * Holds names of all augmentations that this Faction offers\n */\n augmentations: string[] = [];\n\n /**\n * Amount of favor the player has with this faction.\n */\n favor = 0;\n\n /**\n * Flag signalling whether player has been banned from this faction\n */\n isBanned = false;\n\n /**\n * Flag signalling whether player is a member of this faction\n */\n isMember = false;\n\n /**\n * Name of faction\n */\n name = \"\";\n\n /**\n * Amount of reputation player has with this faction\n */\n playerReputation = 0;\n\n constructor(name = \"\") {\n this.name = name;\n }\n\n getInfo(): FactionInfo {\n const info = FactionInfos[this.name];\n if (info == null) {\n throw new Error(\n `Missing faction from FactionInfos: ${this.name} this probably means the faction got corrupted somehow`,\n );\n }\n\n return info;\n }\n\n gainFavor(): void {\n if (this.favor == null) {\n this.favor = 0;\n }\n this.favor += this.getFavorGain();\n }\n\n //Returns an array with [How much favor would be gained, how much rep would be left over]\n getFavorGain(): number {\n if (this.favor == null) {\n this.favor = 0;\n }\n const storedRep = Math.max(0, favorToRep(this.favor));\n const totalRep = storedRep + this.playerReputation;\n const newFavor = repToFavor(totalRep);\n return newFavor - this.favor;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Faction\", this);\n }\n\n /**\n * Initiatizes a Faction object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Faction {\n return Generic_fromJSON(Faction, value.data);\n }\n}\n\nReviver.constructors.Faction = Faction;\n","/**\n * Global pool of all active scripts (scripts that are currently running)\n */\nimport { WorkerScript } from \"./WorkerScript\";\n\nexport const workerScripts: Map = new Map();\n","import { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { Export } from \"./Export\";\n\ninterface IConstructorParams {\n name?: string;\n}\n\nexport class Material {\n // Name of material\n name = \"InitName\";\n\n // Amount of material owned\n qty = 0;\n\n // Material's \"quality\". Unbounded\n qlt = 0;\n\n // How much demand the Material has in the market, and the range of possible\n // values for this \"demand\"\n dmd = 0;\n dmdR: number[] = [0, 0];\n\n // How much competition there is for this Material in the market, and the range\n // of possible values for this \"competition\"\n cmp = 0;\n cmpR: number[] = [0, 0];\n\n // Maximum volatility of this Materials stats\n mv = 0;\n\n // Markup. Determines how high of a price you can charge on the material\n // compared to the market price without suffering loss in # of sales\n // Quality is divided by this to determine markup limits\n // e,g, If mku is 10 and quality is 100 then you can markup prices by 100/10 = 10\n mku = 0;\n\n // How much of this material is being bought, sold, imported and produced every second\n buy = 0;\n sll = 0;\n prd = 0;\n imp = 0;\n\n // Exports of this material to another warehouse/industry\n exp: Export[] = [];\n\n // Total amount of this material exported in the last cycle\n totalExp = 0;\n\n // Cost / sec to buy this material. AKA Market Price\n bCost = 0;\n\n // Cost / sec to sell this material\n sCost: string | number = 0;\n\n // Flags to keep track of whether production and/or sale of this material is limited\n // [Whether production/sale is limited, limit amount]\n prdman: [boolean, number] = [false, 0]; // Production\n sllman: [boolean, string | number] = [false, 0]; // Sale\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price = 0;\n\n // Determines the maximum amount of this material that can be sold in one market cycle\n maxsll = 0;\n\n constructor(params: IConstructorParams = {}) {\n if (params.name) {\n this.name = params.name;\n }\n this.init();\n }\n\n getMarkupLimit(): number {\n return this.qlt / this.mku;\n }\n\n init(): void {\n switch (this.name) {\n case \"Water\":\n this.dmd = 75;\n this.dmdR = [65, 85];\n this.cmp = 50;\n this.cmpR = [40, 60];\n this.bCost = 1500;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Energy\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 2000;\n this.mv = 0.2;\n this.mku = 6;\n break;\n case \"Food\":\n this.dmd = 80;\n this.dmdR = [70, 90];\n this.cmp = 60;\n this.cmpR = [35, 85];\n this.bCost = 5000;\n this.mv = 1;\n this.mku = 3;\n break;\n case \"Plants\":\n this.dmd = 70;\n this.dmdR = [20, 90];\n this.cmp = 50;\n this.cmpR = [30, 70];\n this.bCost = 3000;\n this.mv = 0.6;\n this.mku = 3.75;\n break;\n case \"Metal\":\n this.dmd = 80;\n this.dmdR = [75, 85];\n this.cmp = 70;\n this.cmpR = [60, 80];\n this.bCost = 2650;\n this.mv = 1;\n this.mku = 6;\n break;\n case \"Hardware\":\n this.dmd = 85;\n this.dmdR = [80, 90];\n this.cmp = 80;\n this.cmpR = [65, 95];\n this.bCost = 8e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"Chemicals\":\n this.dmd = 55;\n this.dmdR = [40, 70];\n this.cmp = 60;\n this.cmpR = [40, 80];\n this.bCost = 9e3;\n this.mv = 1.2;\n this.mku = 2;\n break;\n case \"Real Estate\":\n this.dmd = 50;\n this.dmdR = [5, 99];\n this.cmp = 50;\n this.cmpR = [25, 75];\n this.bCost = 80e3;\n this.mv = 1.5; //Less mv bc its processed twice\n this.mku = 1.5;\n break;\n case \"Drugs\":\n this.dmd = 60;\n this.dmdR = [45, 75];\n this.cmp = 70;\n this.cmpR = [40, 99];\n this.bCost = 40e3;\n this.mv = 1.6;\n this.mku = 1;\n break;\n case \"Robots\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 90;\n this.cmpR = [80, 99];\n this.bCost = 75e3;\n this.mv = 0.5; //Less mv bc its processed twice\n this.mku = 1;\n break;\n case \"AI Cores\":\n this.dmd = 90;\n this.dmdR = [80, 99];\n this.cmp = 90;\n this.cmpR = [80, 99];\n this.bCost = 15e3;\n this.mv = 0.8; //Less mv bc its processed twice\n this.mku = 0.5;\n break;\n case \"Scientific Research\":\n case \"InitName\":\n break;\n default:\n console.error(`Invalid material type in init(): ${this.name}`);\n break;\n }\n }\n\n // Process change in demand, competition, and buy cost of this material\n processMarket(): void {\n // The price will change in accordance with demand and competition.\n // e.g. If demand goes up, then so does price. If competition goes up, price goes down\n const priceVolatility: number = (Math.random() * this.mv) / 300;\n const priceChange: number = 1 + priceVolatility;\n\n //This 1st random check determines whether competition increases or decreases\n const compVolatility: number = (Math.random() * this.mv) / 100;\n const compChange: number = 1 + compVolatility;\n if (Math.random() < 0.5) {\n this.cmp *= compChange;\n if (this.cmp > this.cmpR[1]) {\n this.cmp = this.cmpR[1];\n }\n this.bCost *= 1 / priceChange; // Competition increases, so price goes down\n } else {\n this.cmp *= 1 / compChange;\n if (this.cmp < this.cmpR[0]) {\n this.cmp = this.cmpR[0];\n }\n this.bCost *= priceChange; // Competition decreases, so price goes up\n }\n\n // This 2nd random check determines whether demand increases or decreases\n const dmdVolatility: number = (Math.random() * this.mv) / 100;\n const dmdChange: number = 1 + dmdVolatility;\n if (Math.random() < 0.5) {\n this.dmd *= dmdChange;\n if (this.dmd > this.dmdR[1]) {\n this.dmd = this.dmdR[1];\n }\n this.bCost *= priceChange; // Demand increases, so price goes up\n } else {\n this.dmd *= 1 / dmdChange;\n if (this.dmd < this.dmdR[0]) {\n this.dmd = this.dmdR[0];\n }\n this.bCost *= 1 / priceChange;\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Material\", this);\n }\n\n // Initiatizes a Material object from a JSON save state.\n static fromJSON(value: IReviverValue): Material {\n return Generic_fromJSON(Material, value.data);\n }\n}\n\nReviver.constructors.Material = Material;\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberTask } from \"../GangMemberTask\";\n\nexport interface FormulaGang {\n respect: number;\n territory: number;\n wantedLevel: number;\n}\n\nexport function calculateWantedPenalty(gang: FormulaGang): number {\n return gang.respect / (gang.respect + gang.wantedLevel);\n}\n\nexport function calculateRespectGain(gang: FormulaGang, member: GangMember, task: GangMemberTask): number {\n if (task.baseRespect === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n statWeight -= 4 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.respect) / 100);\n const territoryPenalty = (0.2 * gang.territory + 0.8) * BitNodeMultipliers.GangSoftcap;\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = calculateWantedPenalty(gang);\n return Math.pow(11 * task.baseRespect * statWeight * territoryMult * respectMult, territoryPenalty);\n}\n\nexport function calculateWantedLevelGain(gang: FormulaGang, member: GangMember, task: GangMemberTask): number {\n if (task.baseWanted === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n statWeight -= 3.5 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.wanted) / 100);\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n if (task.baseWanted < 0) {\n return 0.4 * task.baseWanted * statWeight * territoryMult;\n }\n const calc = (7 * task.baseWanted) / Math.pow(3 * statWeight * territoryMult, 0.8);\n\n // Put an arbitrary cap on this to prevent wanted level from rising too fast if the\n // denominator is very small. Might want to rethink formula later\n return Math.min(100, calc);\n}\n\nexport function calculateMoneyGain(gang: FormulaGang, member: GangMember, task: GangMemberTask): number {\n if (task.baseMoney === 0) return 0;\n let statWeight =\n (task.hackWeight / 100) * member.hack +\n (task.strWeight / 100) * member.str +\n (task.defWeight / 100) * member.def +\n (task.dexWeight / 100) * member.dex +\n (task.agiWeight / 100) * member.agi +\n (task.chaWeight / 100) * member.cha;\n\n statWeight -= 3.2 * task.difficulty;\n if (statWeight <= 0) return 0;\n const territoryMult = Math.max(0.005, Math.pow(gang.territory * 100, task.territory.money) / 100);\n if (isNaN(territoryMult) || territoryMult <= 0) return 0;\n const respectMult = calculateWantedPenalty(gang);\n const territoryPenalty = (0.2 * gang.territory + 0.8) * BitNodeMultipliers.GangSoftcap;\n return Math.pow(5 * task.baseMoney * statWeight * territoryMult * respectMult, territoryPenalty);\n}\n\nexport function calculateAscensionPointsGain(exp: number): number {\n return Math.max(exp - 1000, 0);\n}\n\nexport function calculateAscensionMult(points: number): number {\n return Math.max(Math.pow(points / 2000, 0.5), 1);\n}\n","export class RFAMessage {\n jsonrpc = \"2.0\"; // Transmits version of JSON-RPC. Compliance maybe allows some funky interaction with external tools?\n public method?: string; // Is defined when it's a request/notification, otherwise undefined\n public result?: ResultType; // Is defined when it's a response, otherwise undefined\n public params?: FileMetadata; // Optional parameters to method\n public error?: string; // Only defined on error\n public id?: number; // ID to keep track of request -> response interaction, undefined with notifications, defined with request/response\n\n constructor(obj: { method?: string; result?: ResultType; params?: FileMetadata; error?: string; id?: number } = {}) {\n this.method = obj.method;\n this.result = obj.result;\n this.params = obj.params;\n this.error = obj.error;\n this.id = obj.id;\n }\n}\n\ntype ResultType = string | number | Array | Array;\ntype FileMetadata = FileData | FileContent | FileLocation | FileServer;\n\nexport interface FileData {\n filename: string;\n content: string;\n server: string;\n}\n\nexport interface FileContent {\n filename: string;\n content: string;\n}\n\nexport interface FileLocation {\n filename: string;\n server: string;\n}\n\nexport interface FileServer {\n server: string;\n}\n\nexport function isFileData(p: unknown): p is FileData {\n const pf = p as FileData;\n return typeof pf.server === \"string\" && typeof pf.filename === \"string\" && typeof pf.content === \"string\";\n}\n\nexport function isFileLocation(p: unknown): p is FileLocation {\n const pf = p as FileLocation;\n return typeof pf.server === \"string\" && typeof pf.filename === \"string\";\n}\n\nexport function isFileContent(p: unknown): p is FileContent {\n const pf = p as FileContent;\n return typeof pf.filename === \"string\" && typeof pf.content === \"string\";\n}\n\nexport function isFileServer(p: unknown): p is FileServer {\n const pf = p as FileServer;\n return typeof pf.server === \"string\";\n}\n","import { Paper } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { use } from \"../../ui/Context\";\nimport { ProgressBar } from \"../../ui/React/Progress\";\n\ninterface IProps {\n millis: number;\n onExpire: () => void;\n noPaper?: boolean;\n}\n\nexport function GameTimer(props: IProps): React.ReactElement {\n const player = use.Player();\n const [v, setV] = useState(100);\n const totalMillis = (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.3 : 1) * props.millis;\n\n const tick = 200;\n useEffect(() => {\n const intervalId = setInterval(() => {\n setV((old) => {\n if (old <= 0) props.onExpire();\n return old - (tick / totalMillis) * 100;\n });\n }, tick);\n return () => {\n clearInterval(intervalId);\n };\n }, []);\n\n // https://stackoverflow.com/questions/55593367/disable-material-uis-linearprogress-animation\n // TODO(hydroflame): there's like a bug where it triggers the end before the\n // bar physically reaches the end\n return props.noPaper ? (\n \n ) : (\n \n \n \n );\n}\n","import { AugmentationStats } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport interface Multipliers {\n hacking_chance: number;\n hacking_speed: number;\n hacking_money: number;\n hacking_grow: number;\n hacking: number;\n hacking_exp: number;\n strength: number;\n strength_exp: number;\n defense: number;\n defense_exp: number;\n dexterity: number;\n dexterity_exp: number;\n agility: number;\n agility_exp: number;\n charisma: number;\n charisma_exp: number;\n hacknet_node_money: number;\n hacknet_node_purchase_cost: number;\n hacknet_node_ram_cost: number;\n hacknet_node_core_cost: number;\n hacknet_node_level_cost: number;\n company_rep: number;\n faction_rep: number;\n work_money: number;\n crime_success: number;\n crime_money: number;\n bladeburner_max_stamina: number;\n bladeburner_stamina_gain: number;\n bladeburner_analysis: number;\n bladeburner_success_chance: number;\n}\n\nexport const defaultMultipliers = (): Multipliers => {\n return {\n hacking_chance: 1,\n hacking_speed: 1,\n hacking_money: 1,\n hacking_grow: 1,\n hacking: 1,\n hacking_exp: 1,\n strength: 1,\n strength_exp: 1,\n defense: 1,\n defense_exp: 1,\n dexterity: 1,\n dexterity_exp: 1,\n agility: 1,\n agility_exp: 1,\n charisma: 1,\n charisma_exp: 1,\n hacknet_node_money: 1,\n hacknet_node_purchase_cost: 1,\n hacknet_node_ram_cost: 1,\n hacknet_node_core_cost: 1,\n hacknet_node_level_cost: 1,\n company_rep: 1,\n faction_rep: 1,\n work_money: 1,\n crime_success: 1,\n crime_money: 1,\n bladeburner_max_stamina: 1,\n bladeburner_stamina_gain: 1,\n bladeburner_analysis: 1,\n bladeburner_success_chance: 1,\n };\n};\n\nexport const mergeMultipliers = (m0: Multipliers, m1: AugmentationStats): Multipliers => {\n return {\n hacking_chance: m0.hacking_chance * (m1.hacking_chance ?? 1),\n hacking_speed: m0.hacking_speed * (m1.hacking_speed ?? 1),\n hacking_money: m0.hacking_money * (m1.hacking_money ?? 1),\n hacking_grow: m0.hacking_grow * (m1.hacking_grow ?? 1),\n hacking: m0.hacking * (m1.hacking ?? 1),\n hacking_exp: m0.hacking_exp * (m1.hacking_exp ?? 1),\n strength: m0.strength * (m1.strength ?? 1),\n strength_exp: m0.strength_exp * (m1.strength_exp ?? 1),\n defense: m0.defense * (m1.defense ?? 1),\n defense_exp: m0.defense_exp * (m1.defense_exp ?? 1),\n dexterity: m0.dexterity * (m1.dexterity ?? 1),\n dexterity_exp: m0.dexterity_exp * (m1.dexterity_exp ?? 1),\n agility: m0.agility * (m1.agility ?? 1),\n agility_exp: m0.agility_exp * (m1.agility_exp ?? 1),\n charisma: m0.charisma * (m1.charisma ?? 1),\n charisma_exp: m0.charisma_exp * (m1.charisma_exp ?? 1),\n hacknet_node_money: m0.hacknet_node_money * (m1.hacknet_node_money ?? 1),\n hacknet_node_purchase_cost: m0.hacknet_node_purchase_cost * (m1.hacknet_node_purchase_cost ?? 1),\n hacknet_node_ram_cost: m0.hacknet_node_ram_cost * (m1.hacknet_node_ram_cost ?? 1),\n hacknet_node_core_cost: m0.hacknet_node_core_cost * (m1.hacknet_node_core_cost ?? 1),\n hacknet_node_level_cost: m0.hacknet_node_level_cost * (m1.hacknet_node_level_cost ?? 1),\n company_rep: m0.company_rep * (m1.company_rep ?? 1),\n faction_rep: m0.faction_rep * (m1.faction_rep ?? 1),\n work_money: m0.work_money * (m1.work_money ?? 1),\n crime_success: m0.crime_success * (m1.crime_success ?? 1),\n crime_money: m0.crime_money * (m1.crime_money ?? 1),\n bladeburner_max_stamina: m0.bladeburner_max_stamina * (m1.bladeburner_max_stamina ?? 1),\n bladeburner_stamina_gain: m0.bladeburner_stamina_gain * (m1.bladeburner_stamina_gain ?? 1),\n bladeburner_analysis: m0.bladeburner_analysis * (m1.bladeburner_analysis ?? 1),\n bladeburner_success_chance: m0.bladeburner_success_chance * (m1.bladeburner_success_chance ?? 1),\n };\n};\n","import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { IBladeburner } from \"./IBladeburner\";\nimport { IActionIdentifier } from \"./IActionIdentifier\";\nimport { ActionIdentifier } from \"./ActionIdentifier\";\nimport { ActionTypes } from \"./data/ActionTypes\";\nimport { Growths } from \"./data/Growths\";\nimport { BlackOperations } from \"./BlackOperations\";\nimport { BlackOperation } from \"./BlackOperation\";\nimport { Operation } from \"./Operation\";\nimport { Contract } from \"./Contract\";\nimport { GeneralActions } from \"./GeneralActions\";\nimport { formatNumber } from \"../utils/StringHelperFunctions\";\nimport { Skills } from \"./Skills\";\nimport { Skill } from \"./Skill\";\nimport { City } from \"./City\";\nimport { IAction } from \"./IAction\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { createTaskTracker, ITaskTracker } from \"../PersonObjects/ITaskTracker\";\nimport { IPerson } from \"../PersonObjects/IPerson\";\nimport { IRouter } from \"../ui/Router\";\nimport { ConsoleHelpText } from \"./data/Help\";\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions, factionExists } from \"../Faction/Factions\";\nimport { calculateHospitalizationCost } from \"../Hospital/Hospital\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Settings } from \"../Settings/Settings\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { getTimestamp } from \"../utils/helpers/getTimestamp\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { KEY } from \"../utils/helpers/keyCodes\";\nimport { isSleeveInfiltrateWork } from \"../PersonObjects/Sleeve/Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../PersonObjects/Sleeve/Work/SleeveSupportWork\";\n\ninterface BlackOpsAttempt {\n error?: string;\n isAvailable?: boolean;\n action?: BlackOperation;\n}\n\nexport class Bladeburner implements IBladeburner {\n numHosp = 0;\n moneyLost = 0;\n rank = 0;\n maxRank = 0;\n\n skillPoints = 0;\n totalSkillPoints = 0;\n\n teamSize = 0;\n sleeveSize = 0;\n teamLost = 0;\n hpLost = 0;\n\n storedCycles = 0;\n\n randomEventCounter: number = getRandomInt(240, 600);\n\n actionTimeToComplete = 0;\n actionTimeCurrent = 0;\n actionTimeOverflow = 0;\n\n action: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n\n cities: Record = {};\n city: string = BladeburnerConstants.CityNames[2];\n skills: Record = {};\n skillMultipliers: Record = {};\n staminaBonus = 0;\n maxStamina = 0;\n stamina = 0;\n contracts: Record = {};\n operations: Record = {};\n blackops: Record = {};\n logging = {\n general: true,\n contracts: true,\n ops: true,\n blackops: true,\n events: true,\n };\n automateEnabled = false;\n automateActionHigh: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshHigh = 0;\n automateActionLow: IActionIdentifier = new ActionIdentifier({\n type: ActionTypes[\"Idle\"],\n });\n automateThreshLow = 0;\n consoleHistory: string[] = [];\n consoleLogs: string[] = [\"Bladeburner Console\", \"Type 'help' to see console commands\"];\n\n constructor(player?: IPlayer) {\n for (let i = 0; i < BladeburnerConstants.CityNames.length; ++i) {\n this.cities[BladeburnerConstants.CityNames[i]] = new City(BladeburnerConstants.CityNames[i]);\n }\n\n this.updateSkillMultipliers(); // Calls resetSkillMultipliers()\n\n // Max Stamina is based on stats and Bladeburner-specific bonuses\n if (player) this.calculateMaxStamina(player);\n this.stamina = this.maxStamina;\n this.create();\n }\n\n getCurrentCity(): City {\n const city = this.cities[this.city];\n if (!(city instanceof City)) {\n throw new Error(\"Bladeburner.getCurrentCity() did not properly return a City object\");\n }\n return city;\n }\n\n calculateStaminaPenalty(): number {\n return Math.min(1, this.stamina / (0.5 * this.maxStamina));\n }\n\n canAttemptBlackOp(actionId: IActionIdentifier): BlackOpsAttempt {\n // Safety measure - don't repeat BlackOps that are already done\n if (this.blackops[actionId.name] != null) {\n return { error: \"Tried to start a Black Operation that had already been completed\" };\n }\n\n const action = this.getActionObject(actionId);\n if (!(action instanceof BlackOperation)) throw new Error(`Action should be BlackOperation but isn't`);\n if (action == null) throw new Error(\"Failed to get BlackOperation object for: \" + actionId.name);\n\n if (action.reqdRank > this.rank) {\n return { error: \"Tried to start a Black Operation without the rank requirement\" };\n }\n\n // Can't start a BlackOp if you haven't done the one before it\n const blackops = [];\n for (const nm of Object.keys(BlackOperations)) {\n if (BlackOperations.hasOwnProperty(nm)) {\n blackops.push(nm);\n }\n }\n blackops.sort(function (a, b) {\n return BlackOperations[a].reqdRank - BlackOperations[b].reqdRank; // Sort black ops in intended order\n });\n\n const i = blackops.indexOf(actionId.name);\n if (i === -1) {\n return { error: `Invalid Black Op: '${name}'` };\n }\n\n if (i > 0 && this.blackops[blackops[i - 1]] == null) {\n return { error: `Preceding Black Op must be completed before starting '${actionId.name}'.` };\n }\n\n return { isAvailable: true, action };\n }\n\n startAction(person: IPerson, actionId: IActionIdentifier): void {\n if (actionId == null) return;\n this.action = actionId;\n this.actionTimeCurrent = 0;\n switch (actionId.type) {\n case ActionTypes[\"Idle\"]:\n this.actionTimeToComplete = 0;\n break;\n case ActionTypes[\"Contract\"]:\n try {\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get Contract Object for: \" + actionId.name);\n }\n if (action.count < 1) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this, person);\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n case ActionTypes[\"Operation\"]: {\n try {\n const action = this.getActionObject(actionId);\n if (action == null) {\n throw new Error(\"Failed to get Operation Object for: \" + actionId.name);\n }\n if (action.count < 1) {\n return this.resetAction();\n }\n if (actionId.name === \"Raid\" && this.getCurrentCity().comms === 0) {\n return this.resetAction();\n }\n this.actionTimeToComplete = action.getActionTime(this, person);\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n const testBlackOp = this.canAttemptBlackOp(actionId);\n if (!testBlackOp.isAvailable) {\n this.resetAction();\n this.log(`Error: ${testBlackOp.error}`);\n break;\n }\n if (testBlackOp.action === undefined) {\n throw new Error(\"action should not be null\");\n }\n this.actionTimeToComplete = testBlackOp.action.getActionTime(this, person);\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]:\n this.actionTimeToComplete = this.getRecruitmentTime(person);\n break;\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]:\n this.actionTimeToComplete = 30;\n break;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n this.actionTimeToComplete = 60;\n break;\n default:\n throw new Error(\"Invalid Action Type in startAction(Bladeburner,player, ): \" + actionId.type);\n }\n }\n\n upgradeSkill(skill: Skill, count = 1): void {\n // This does NOT handle deduction of skill points\n const skillName = skill.name;\n if (this.skills[skillName]) {\n this.skills[skillName] += count;\n } else {\n this.skills[skillName] = count;\n }\n if (isNaN(this.skills[skillName]) || this.skills[skillName] < 0) {\n throw new Error(\"Level of Skill \" + skillName + \" is invalid: \" + this.skills[skillName]);\n }\n this.updateSkillMultipliers();\n }\n\n executeConsoleCommands(player: IPlayer, commands: string): void {\n try {\n // Console History\n if (this.consoleHistory[this.consoleHistory.length - 1] != commands) {\n this.consoleHistory.push(commands);\n if (this.consoleHistory.length > 50) {\n this.consoleHistory.splice(0, 1);\n }\n }\n\n const arrayOfCommands = commands.split(\";\");\n for (let i = 0; i < arrayOfCommands.length; ++i) {\n this.executeConsoleCommand(player, arrayOfCommands[i]);\n }\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n }\n\n postToConsole(input: string, saveToLogs = true): void {\n const MaxConsoleEntries = 100;\n if (saveToLogs) {\n this.consoleLogs.push(input);\n if (this.consoleLogs.length > MaxConsoleEntries) {\n this.consoleLogs.shift();\n }\n }\n }\n\n log(input: string): void {\n // Adds a timestamp and then just calls postToConsole\n this.postToConsole(`[${getTimestamp()}] ${input}`);\n }\n\n resetAction(): void {\n this.action = new ActionIdentifier({ type: ActionTypes.Idle });\n this.actionTimeCurrent = 0;\n this.actionTimeToComplete = 0;\n }\n\n clearConsole(): void {\n this.consoleLogs.length = 0;\n }\n\n prestige(): void {\n this.resetAction();\n const bladeburnerFac = Factions[FactionNames.Bladeburners];\n if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n }\n }\n\n storeCycles(numCycles = 0): void {\n this.storedCycles += numCycles;\n }\n\n // working on\n getActionIdFromTypeAndName(type = \"\", name = \"\"): IActionIdentifier | null {\n if (type === \"\" || name === \"\") {\n return null;\n }\n const action = new ActionIdentifier();\n const convertedType = type.toLowerCase().trim();\n const convertedName = name.toLowerCase().trim();\n switch (convertedType) {\n case \"contract\":\n case \"contracts\":\n case \"contr\":\n action.type = ActionTypes[\"Contract\"];\n if (this.contracts.hasOwnProperty(name)) {\n action.name = name;\n return action;\n }\n return null;\n case \"operation\":\n case \"operations\":\n case \"op\":\n case \"ops\":\n action.type = ActionTypes[\"Operation\"];\n if (this.operations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n }\n return null;\n case \"blackoperation\":\n case \"black operation\":\n case \"black operations\":\n case \"black op\":\n case \"black ops\":\n case \"blackop\":\n case \"blackops\":\n action.type = ActionTypes[\"BlackOp\"];\n if (BlackOperations.hasOwnProperty(name)) {\n action.name = name;\n return action;\n }\n return null;\n case \"general\":\n case \"general action\":\n case \"gen\":\n break;\n default:\n return null;\n }\n\n if (convertedType.startsWith(\"gen\")) {\n switch (convertedName) {\n case \"training\":\n action.type = ActionTypes[\"Training\"];\n action.name = \"Training\";\n break;\n case \"recruitment\":\n case \"recruit\":\n action.type = ActionTypes[\"Recruitment\"];\n action.name = \"Recruitment\";\n break;\n case \"field analysis\":\n case \"fieldanalysis\":\n action.type = ActionTypes[\"Field Analysis\"];\n action.name = \"Field Analysis\";\n break;\n case \"diplomacy\":\n action.type = ActionTypes[\"Diplomacy\"];\n action.name = \"Diplomacy\";\n break;\n case \"hyperbolic regeneration chamber\":\n action.type = ActionTypes[\"Hyperbolic Regeneration Chamber\"];\n action.name = \"Hyperbolic Regeneration Chamber\";\n break;\n case \"incite violence\":\n action.type = ActionTypes[\"Incite Violence\"];\n action.name = \"Incite Violence\";\n break;\n default:\n return null;\n }\n return action;\n }\n\n return null;\n }\n\n executeStartConsoleCommand(player: IPlayer, args: string[]): void {\n if (args.length !== 3) {\n this.postToConsole(\"Invalid usage of 'start' console command: start [type] [name]\");\n this.postToConsole(\"Use 'help start' for more info\");\n return;\n }\n const name = args[2];\n switch (args[1].toLowerCase()) {\n case \"general\":\n case \"gen\":\n if (GeneralActions[name] != null) {\n this.action.type = ActionTypes[name];\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid action name specified: \" + args[2]);\n }\n break;\n case \"contract\":\n case \"contracts\":\n if (this.contracts[name] != null) {\n this.action.type = ActionTypes.Contract;\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid contract name specified: \" + args[2]);\n }\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n if (this.operations[name] != null) {\n this.action.type = ActionTypes.Operation;\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid Operation name specified: \" + args[2]);\n }\n break;\n case \"blackops\":\n case \"blackop\":\n case \"black operations\":\n case \"black operation\":\n if (BlackOperations[name] != null) {\n this.action.type = ActionTypes.BlackOperation;\n this.action.name = name;\n this.startAction(player, this.action);\n } else {\n this.postToConsole(\"Invalid BlackOp name specified: \" + args[2]);\n }\n break;\n default:\n this.postToConsole(\"Invalid action/event type specified: \" + args[1]);\n this.postToConsole(\"Examples of valid action/event identifiers are: [general, contract, op, blackop]\");\n break;\n }\n }\n\n executeSkillConsoleCommand(args: string[]): void {\n switch (args.length) {\n case 1: {\n // Display Skill Help Command\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n break;\n }\n case 2: {\n if (args[1].toLowerCase() === \"list\") {\n // List all skills and their level\n this.postToConsole(\"Skills: \");\n const skillNames = Object.keys(Skills);\n for (let i = 0; i < skillNames.length; ++i) {\n const skill = Skills[skillNames[i]];\n let level = 0;\n if (this.skills[skill.name] != null) {\n level = this.skills[skill.name];\n }\n this.postToConsole(skill.name + \": Level \" + formatNumber(level, 0));\n }\n this.postToConsole(\" \");\n this.postToConsole(\"Effects: \");\n const multKeys = Object.keys(this.skillMultipliers);\n for (let i = 0; i < multKeys.length; ++i) {\n const mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n const mults = formatNumber(mult, 3);\n switch (multKeys[i]) {\n case \"successChanceAll\":\n this.postToConsole(\"Total Success Chance: x\" + mults);\n break;\n case \"successChanceStealth\":\n this.postToConsole(\"Stealth Success Chance: x\" + mults);\n break;\n case \"successChanceKill\":\n this.postToConsole(\"Retirement Success Chance: x\" + mults);\n break;\n case \"successChanceContract\":\n this.postToConsole(\"Contract Success Chance: x\" + mults);\n break;\n case \"successChanceOperation\":\n this.postToConsole(\"Operation Success Chance: x\" + mults);\n break;\n case \"successChanceEstimate\":\n this.postToConsole(\"Synthoid Data Estimate: x\" + mults);\n break;\n case \"actionTime\":\n this.postToConsole(\"Action Time: x\" + mults);\n break;\n case \"effHack\":\n this.postToConsole(\"Hacking Skill: x\" + mults);\n break;\n case \"effStr\":\n this.postToConsole(\"Strength: x\" + mults);\n break;\n case \"effDef\":\n this.postToConsole(\"Defense: x\" + mults);\n break;\n case \"effDex\":\n this.postToConsole(\"Dexterity: x\" + mults);\n break;\n case \"effAgi\":\n this.postToConsole(\"Agility: x\" + mults);\n break;\n case \"effCha\":\n this.postToConsole(\"Charisma: x\" + mults);\n break;\n case \"effInt\":\n this.postToConsole(\"Intelligence: x\" + mults);\n break;\n case \"stamina\":\n this.postToConsole(\"Stamina: x\" + mults);\n break;\n default:\n console.warn(`Unrecognized SkillMult Key: ${multKeys[i]}`);\n break;\n }\n }\n }\n } else {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n }\n break;\n }\n case 3: {\n const skillName = args[2];\n const skill = Skills[skillName];\n if (skill == null || !(skill instanceof Skill)) {\n this.postToConsole(\"Invalid skill name (Note that it is case-sensitive): \" + skillName);\n break;\n }\n if (args[1].toLowerCase() === \"list\") {\n let level = 0;\n if (this.skills[skill.name] !== undefined) {\n level = this.skills[skill.name];\n }\n this.postToConsole(skill.name + \": Level \" + formatNumber(level));\n } else if (args[1].toLowerCase() === \"level\") {\n let currentLevel = 0;\n if (this.skills[skillName] && !isNaN(this.skills[skillName])) {\n currentLevel = this.skills[skillName];\n }\n const pointCost = skill.calculateCost(currentLevel);\n if (skill.maxLvl !== 0 && currentLevel >= skill.maxLvl) {\n this.postToConsole(`This skill ${skill.name} is already at max level (${currentLevel}/${skill.maxLvl}).`);\n } else if (this.skillPoints >= pointCost) {\n this.skillPoints -= pointCost;\n this.upgradeSkill(skill);\n this.log(skill.name + \" upgraded to Level \" + this.skills[skillName]);\n } else {\n this.postToConsole(\n \"You do not have enough Skill Points to upgrade this. You need \" + formatNumber(pointCost, 0),\n );\n }\n } else {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n }\n break;\n }\n default: {\n this.postToConsole(\"Invalid usage of 'skill' console command: skill [action] [name]\");\n this.postToConsole(\"Use 'help skill' for more info\");\n break;\n }\n }\n }\n\n executeLogConsoleCommand(args: string[]): void {\n if (args.length < 3) {\n this.postToConsole(\"Invalid usage of log command: log [enable/disable] [action/event]\");\n this.postToConsole(\"Use 'help log' for more details and examples\");\n return;\n }\n\n let flag = true;\n if (args[1].toLowerCase().includes(\"d\")) {\n flag = false;\n } // d for disable\n\n switch (args[2].toLowerCase()) {\n case \"general\":\n case \"gen\":\n this.logging.general = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for general actions\");\n break;\n case \"contract\":\n case \"contracts\":\n this.logging.contracts = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Contracts\");\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n this.logging.ops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for Operations\");\n break;\n case \"blackops\":\n case \"blackop\":\n case \"black operations\":\n case \"black operation\":\n this.logging.blackops = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for BlackOps\");\n break;\n case \"event\":\n case \"events\":\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for events\");\n break;\n case \"all\":\n this.logging.general = flag;\n this.logging.contracts = flag;\n this.logging.ops = flag;\n this.logging.blackops = flag;\n this.logging.events = flag;\n this.log(\"Logging \" + (flag ? \"enabled\" : \"disabled\") + \" for everything\");\n break;\n default:\n this.postToConsole(\"Invalid action/event type specified: \" + args[2]);\n this.postToConsole(\n \"Examples of valid action/event identifiers are: [general, contracts, ops, blackops, events]\",\n );\n break;\n }\n }\n\n executeHelpConsoleCommand(args: string[]): void {\n if (args.length === 1) {\n for (const line of ConsoleHelpText.helpList) {\n this.postToConsole(line);\n }\n } else {\n for (let i = 1; i < args.length; ++i) {\n if (!(args[i] in ConsoleHelpText)) continue;\n const helpText = ConsoleHelpText[args[i]];\n for (const line of helpText) {\n this.postToConsole(line);\n }\n }\n }\n }\n\n executeAutomateConsoleCommand(args: string[]): void {\n if (args.length !== 2 && args.length !== 4) {\n this.postToConsole(\n \"Invalid use of 'automate' command: automate [var] [val] [hi/low]. Use 'help automate' for more info\",\n );\n return;\n }\n\n // Enable/Disable\n if (args.length === 2) {\n const flag = args[1];\n if (flag.toLowerCase() === \"status\") {\n this.postToConsole(\"Automation: \" + (this.automateEnabled ? \"enabled\" : \"disabled\"));\n this.postToConsole(\n \"When your stamina drops to \" +\n formatNumber(this.automateThreshLow, 0) +\n \", you will automatically switch to \" +\n this.automateActionLow.name +\n \". When your stamina recovers to \" +\n formatNumber(this.automateThreshHigh, 0) +\n \", you will automatically \" +\n \"switch to \" +\n this.automateActionHigh.name +\n \".\",\n );\n } else if (flag.toLowerCase().includes(\"en\")) {\n if (\n !(this.automateActionLow instanceof ActionIdentifier) ||\n !(this.automateActionHigh instanceof ActionIdentifier)\n ) {\n return this.log(\"Failed to enable automation. Actions were not set\");\n }\n this.automateEnabled = true;\n this.log(\"Bladeburner automation enabled\");\n } else if (flag.toLowerCase().includes(\"d\")) {\n this.automateEnabled = false;\n this.log(\"Bladeburner automation disabled\");\n } else {\n this.log(\"Invalid argument for 'automate' console command: \" + args[1]);\n }\n return;\n }\n\n // Set variables\n if (args.length === 4) {\n const variable = args[1].toLowerCase(); // allows Action Type to be with or without capitalisation.\n const val = args[2];\n\n let highLow = false; // True for high, false for low\n if (args[3].toLowerCase().includes(\"hi\")) {\n highLow = true;\n }\n\n switch (variable) {\n case \"general\":\n case \"gen\":\n if (GeneralActions[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes[val],\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid action name specified: \" + val);\n }\n break;\n case \"contract\":\n case \"contracts\":\n if (this.contracts[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Contract,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid contract name specified: \" + val);\n }\n break;\n case \"ops\":\n case \"op\":\n case \"operations\":\n case \"operation\":\n if (this.operations[val] != null) {\n const action = new ActionIdentifier({\n type: ActionTypes.Operation,\n name: val,\n });\n if (highLow) {\n this.automateActionHigh = action;\n } else {\n this.automateActionLow = action;\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") action set to \" + val);\n } else {\n this.postToConsole(\"Invalid Operation name specified: \" + val);\n }\n break;\n case \"stamina\":\n if (isNaN(parseFloat(val))) {\n this.postToConsole(\"Invalid value specified for stamina threshold (must be numeric): \" + val);\n } else {\n if (highLow) {\n this.automateThreshHigh = Number(val);\n } else {\n this.automateThreshLow = Number(val);\n }\n this.log(\"Automate (\" + (highLow ? \"HIGH\" : \"LOW\") + \") stamina threshold set to \" + val);\n }\n break;\n default:\n break;\n }\n\n return;\n }\n }\n\n parseCommandArguments(command: string): string[] {\n /**\n * Returns an array with command and its arguments in each index.\n * e.g. skill \"blade's intuition\" foo returns [skill, blade's intuition, foo]\n * The input to the fn will be trimmed and will have all whitespace replaced w/ a single space\n */\n const args = [];\n let start = 0;\n let i = 0;\n while (i < command.length) {\n const c = command.charAt(i);\n if (c === '\"' || c === \"'\") {\n // Double quotes or Single quotes\n const endQuote = command.indexOf(c, i + 1);\n if (endQuote !== -1 && (endQuote === command.length - 1 || command.charAt(endQuote + 1) === KEY.SPACE)) {\n args.push(command.substr(i + 1, endQuote - i - 1));\n if (endQuote === command.length - 1) {\n start = i = endQuote + 1;\n } else {\n start = i = endQuote + 2; // Skip the space\n }\n continue;\n }\n } else if (c === KEY.SPACE) {\n args.push(command.substr(start, i - start));\n start = i + 1;\n }\n ++i;\n }\n if (start !== i) {\n args.push(command.substr(start, i - start));\n }\n return args;\n }\n\n executeConsoleCommand(player: IPlayer, command: string): void {\n command = command.trim();\n command = command.replace(/\\s\\s+/g, \" \"); // Replace all whitespace w/ a single space\n\n const args = this.parseCommandArguments(command);\n if (args.length <= 0) return; // Log an error?\n\n switch (args[0].toLowerCase()) {\n case \"automate\":\n this.executeAutomateConsoleCommand(args);\n break;\n case \"clear\":\n case \"cls\":\n this.clearConsole();\n break;\n case \"help\":\n this.executeHelpConsoleCommand(args);\n break;\n case \"log\":\n this.executeLogConsoleCommand(args);\n break;\n case \"skill\":\n this.executeSkillConsoleCommand(args);\n break;\n case \"start\":\n this.executeStartConsoleCommand(player, args);\n break;\n case \"stop\":\n this.resetAction();\n break;\n default:\n this.postToConsole(\"Invalid console command\");\n break;\n }\n }\n\n triggerMigration(sourceCityName: string): void {\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n const sourceCity = this.cities[sourceCityName];\n if (destCity == null || sourceCity == null) {\n throw new Error(\"Failed to find City with name: \" + destCityName);\n }\n const rand = Math.random();\n let percentage = getRandomInt(3, 15) / 100;\n\n if (rand < 0.05 && sourceCity.comms > 0) {\n // 5% chance for community migration\n percentage *= getRandomInt(2, 4); // Migration increases population change\n --sourceCity.comms;\n ++destCity.comms;\n }\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n }\n\n triggerPotentialMigration(sourceCityName: string, chance: number): void {\n if (chance == null || isNaN(chance)) {\n console.error(\"Invalid 'chance' parameter passed into Bladeburner.triggerPotentialMigration()\");\n }\n if (chance > 1) {\n chance /= 100;\n }\n if (Math.random() < chance) {\n this.triggerMigration(sourceCityName);\n }\n }\n\n randomEvent(): void {\n const chance = Math.random();\n\n // Choose random source/destination city for events\n const sourceCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n const sourceCity = this.cities[sourceCityName];\n if (!(sourceCity instanceof City)) {\n throw new Error(\"sourceCity was not a City object in Bladeburner.randomEvent()\");\n }\n\n let destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n while (destCityName === sourceCityName) {\n destCityName = BladeburnerConstants.CityNames[getRandomInt(0, 5)];\n }\n const destCity = this.cities[destCityName];\n\n if (!(sourceCity instanceof City) || !(destCity instanceof City)) {\n throw new Error(\"sourceCity/destCity was not a City object in Bladeburner.randomEvent()\");\n }\n\n if (chance <= 0.05) {\n // New Synthoid Community, 5%\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else if (chance <= 0.1) {\n // Synthoid Community Migration, 5%\n if (sourceCity.comms <= 0) {\n // If no comms in source city, then instead trigger a new Synthoid community event\n ++sourceCity.comms;\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\"Intelligence indicates that a new Synthoid community was formed in a city\");\n }\n } else {\n --sourceCity.comms;\n ++destCity.comms;\n\n // Change pop\n const percentage = getRandomInt(10, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n destCity.pop += count;\n\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a Synthoid community migrated from \" + sourceCityName + \" to some other city\",\n );\n }\n }\n } else if (chance <= 0.3) {\n // New Synthoids (non community), 20%\n const percentage = getRandomInt(8, 24) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop += count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n } else if (chance <= 0.5) {\n // Synthoid migration (non community) 20%\n this.triggerMigration(sourceCityName);\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that a large number of Synthoids migrated from \" +\n sourceCityName +\n \" to some other city\",\n );\n }\n } else if (chance <= 0.7) {\n // Synthoid Riots (+chaos), 20%\n sourceCity.chaos += 1;\n sourceCity.chaos *= 1 + getRandomInt(5, 20) / 100;\n if (this.logging.events) {\n this.log(\"Tensions between Synthoids and humans lead to riots in \" + sourceCityName + \"! Chaos increased\");\n }\n } else if (chance <= 0.9) {\n // Less Synthoids, 20%\n const percentage = getRandomInt(8, 20) / 100;\n const count = Math.round(sourceCity.pop * percentage);\n sourceCity.pop -= count;\n if (this.logging.events) {\n this.log(\n \"Intelligence indicates that the Synthoid population of \" + sourceCityName + \" just changed significantly\",\n );\n }\n }\n // 10% chance of nothing happening\n }\n\n /**\n * Return stat to be gained from Contracts, Operations, and Black Operations\n * @param action(Action obj) - Derived action class\n * @param success(bool) - Whether action was successful\n */\n getActionStats(action: IAction, person: IPerson, success: boolean): ITaskTracker {\n const difficulty = action.getDifficulty();\n\n /**\n * Gain multiplier based on difficulty. If it changes then the\n * same variable calculated in completeAction() needs to change too\n */\n const difficultyMult =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n const time = action.getActionTime(this, person);\n const successMult = success ? 1 : 0.5;\n\n const unweightedGain = time * BladeburnerConstants.BaseStatGain * successMult * difficultyMult;\n const unweightedIntGain = time * BladeburnerConstants.BaseIntGain * successMult * difficultyMult;\n const skillMult = this.skillMultipliers.expGain;\n\n return {\n hack: unweightedGain * action.weights.hack * skillMult,\n str: unweightedGain * action.weights.str * skillMult,\n def: unweightedGain * action.weights.def * skillMult,\n dex: unweightedGain * action.weights.dex * skillMult,\n agi: unweightedGain * action.weights.agi * skillMult,\n cha: unweightedGain * action.weights.cha * skillMult,\n int: unweightedIntGain * action.weights.int * skillMult,\n money: 0,\n };\n }\n\n getDiplomacyEffectiveness(person: IPerson): number {\n // Returns a decimal by which the city's chaos level should be multiplied (e.g. 0.98)\n const CharismaLinearFactor = 1e3;\n const CharismaExponentialFactor = 0.045;\n\n const charismaEff =\n Math.pow(person.skills.charisma, CharismaExponentialFactor) + person.skills.charisma / CharismaLinearFactor;\n return (100 - charismaEff) / 100;\n }\n\n getRecruitmentSuccessChance(person: IPerson): number {\n return Math.pow(person.skills.charisma, 0.45) / (this.teamSize - this.sleeveSize + 1);\n }\n\n getRecruitmentTime(person: IPerson): number {\n const effCharisma = person.skills.charisma * this.skillMultipliers.effCha;\n const charismaFactor = Math.pow(effCharisma, 0.81) + effCharisma / 90;\n return Math.max(10, Math.round(BladeburnerConstants.BaseRecruitmentTimeNeeded - charismaFactor));\n }\n\n sleeveSupport(joining: boolean): void {\n if (joining) {\n this.sleeveSize += 1;\n this.teamSize += 1;\n } else {\n this.sleeveSize -= 1;\n this.teamSize -= 1;\n }\n }\n\n resetSkillMultipliers(): void {\n this.skillMultipliers = {\n successChanceAll: 1,\n successChanceStealth: 1,\n successChanceKill: 1,\n successChanceContract: 1,\n successChanceOperation: 1,\n successChanceEstimate: 1,\n actionTime: 1,\n effHack: 1,\n effStr: 1,\n effDef: 1,\n effDex: 1,\n effAgi: 1,\n effCha: 1,\n effInt: 1,\n stamina: 1,\n money: 1,\n expGain: 1,\n };\n }\n\n updateSkillMultipliers(): void {\n this.resetSkillMultipliers();\n for (const skillName of Object.keys(this.skills)) {\n if (this.skills.hasOwnProperty(skillName)) {\n const skill = Skills[skillName];\n if (skill == null) {\n throw new Error(\"Could not find Skill Object for: \" + skillName);\n }\n const level = this.skills[skillName];\n if (level == null || level <= 0) {\n continue;\n } //Not upgraded\n\n const multiplierNames = Object.keys(this.skillMultipliers);\n for (let i = 0; i < multiplierNames.length; ++i) {\n const multiplierName = multiplierNames[i];\n if (skill.getMultiplier(multiplierName) != null && !isNaN(skill.getMultiplier(multiplierName))) {\n const value = skill.getMultiplier(multiplierName) * level;\n let multiplierValue = 1 + value / 100;\n if (multiplierName === \"actionTime\") {\n multiplierValue = 1 - value / 100;\n }\n this.skillMultipliers[multiplierName] *= multiplierValue;\n }\n }\n }\n }\n }\n\n completeOperation(success: boolean, player: IPlayer): void {\n if (this.action.type !== ActionTypes.Operation) {\n throw new Error(\"completeOperation() called even though current action is not an Operation\");\n }\n const action = this.getActionObject(this.action);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + this.action.name);\n }\n\n // Calculate team losses\n const teamCount = action.teamCount;\n if (teamCount >= 1) {\n let max;\n if (success) {\n max = Math.ceil(teamCount / 2);\n } else {\n max = Math.floor(teamCount);\n }\n const losses = getRandomInt(0, max);\n this.teamSize -= losses;\n if (this.teamSize < this.sleeveSize) {\n const sup = player.sleeves.filter((x) => isSleeveSupportWork(x.currentWork));\n for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {\n const r = Math.floor(Math.random() * sup.length);\n sup[r].takeDamage(sup[r].hp.max);\n sup.splice(r, 1);\n }\n this.teamSize += this.sleeveSize;\n }\n this.teamLost += losses;\n if (this.logging.ops && losses > 0) {\n this.log(\"Lost \" + formatNumber(losses, 0) + \" team members during this \" + action.name);\n }\n }\n\n const city = this.getCurrentCity();\n switch (action.name) {\n case \"Investigation\":\n if (success) {\n city.improvePopulationEstimateByPercentage(0.4 * this.skillMultipliers.successChanceEstimate);\n } else {\n this.triggerPotentialMigration(this.city, 0.1);\n }\n break;\n case \"Undercover Operation\":\n if (success) {\n city.improvePopulationEstimateByPercentage(0.8 * this.skillMultipliers.successChanceEstimate);\n } else {\n this.triggerPotentialMigration(this.city, 0.15);\n }\n break;\n case \"Sting Operation\":\n if (success) {\n city.changePopulationByPercentage(-0.1, {\n changeEstEqually: true,\n nonZero: true,\n });\n }\n city.changeChaosByCount(0.1);\n break;\n case \"Raid\":\n if (success) {\n city.changePopulationByPercentage(-1, {\n changeEstEqually: true,\n nonZero: true,\n });\n --city.comms;\n } else {\n const change = getRandomInt(-10, -5) / 10;\n city.changePopulationByPercentage(change, {\n nonZero: true,\n changeEstEqually: false,\n });\n }\n city.changeChaosByPercentage(getRandomInt(1, 5));\n break;\n case \"Stealth Retirement Operation\":\n if (success) {\n city.changePopulationByPercentage(-0.5, {\n changeEstEqually: true,\n nonZero: true,\n });\n }\n city.changeChaosByPercentage(getRandomInt(-3, -1));\n break;\n case \"Assassination\":\n if (success) {\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n }\n city.changeChaosByPercentage(getRandomInt(-5, 5));\n break;\n default:\n throw new Error(\"Invalid Action name in completeOperation: \" + this.action.name);\n }\n }\n\n getActionObject(actionId: IActionIdentifier): IAction | null {\n /**\n * Given an ActionIdentifier object, returns the corresponding\n * GeneralAction, Contract, Operation, or BlackOperation object\n */\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n return this.contracts[actionId.name];\n case ActionTypes[\"Operation\"]:\n return this.operations[actionId.name];\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return BlackOperations[actionId.name];\n case ActionTypes[\"Training\"]:\n return GeneralActions[\"Training\"];\n case ActionTypes[\"Field Analysis\"]:\n return GeneralActions[\"Field Analysis\"];\n case ActionTypes[\"Recruitment\"]:\n return GeneralActions[\"Recruitment\"];\n case ActionTypes[\"Diplomacy\"]:\n return GeneralActions[\"Diplomacy\"];\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n return GeneralActions[\"Hyperbolic Regeneration Chamber\"];\n case ActionTypes[\"Incite Violence\"]:\n return GeneralActions[\"Incite Violence\"];\n default:\n return null;\n }\n }\n\n completeContract(success: boolean, actionIdent: IActionIdentifier): void {\n if (actionIdent.type !== ActionTypes.Contract) {\n throw new Error(\"completeContract() called even though current action is not a Contract\");\n }\n const city = this.getCurrentCity();\n if (success) {\n switch (actionIdent.name) {\n case \"Tracking\":\n // Increase estimate accuracy by a relatively small amount\n city.improvePopulationEstimateByCount(getRandomInt(100, 1e3));\n break;\n case \"Bounty Hunter\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.02);\n break;\n case \"Retirement\":\n city.changePopulationByCount(-1, { estChange: -1, estOffset: 0 });\n city.changeChaosByCount(0.04);\n break;\n default:\n throw new Error(\"Invalid Action name in completeContract: \" + actionIdent.name);\n }\n }\n }\n\n completeAction(player: IPlayer, person: IPerson, actionIdent: IActionIdentifier, isPlayer = true): ITaskTracker {\n let retValue = createTaskTracker();\n switch (actionIdent.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]: {\n try {\n const isOperation = actionIdent.type === ActionTypes[\"Operation\"];\n const action = this.getActionObject(actionIdent);\n if (action == null) {\n throw new Error(\"Failed to get Contract/Operation Object for: \" + actionIdent.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n const rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n\n if (isPlayer) {\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n }\n\n // Process Contract/Operation success/failure\n if (action.attempt(this, person)) {\n retValue = this.getActionStats(action, person, true);\n ++action.successes;\n --action.count;\n\n // Earn money for contracts\n let moneyGain = 0;\n if (!isOperation) {\n moneyGain = BladeburnerConstants.ContractBaseMoneyGain * rewardMultiplier * this.skillMultipliers.money;\n retValue.money = moneyGain;\n }\n\n if (isOperation) {\n action.setMaxLevel(BladeburnerConstants.OperationSuccessesPerLevel);\n } else {\n action.setMaxLevel(BladeburnerConstants.ContractSuccessesPerLevel);\n }\n if (action.rankGain) {\n const gain = addOffset(action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(person, gain);\n if (isOperation && this.logging.ops) {\n this.log(\n `${person.whoAmI()}: ` +\n action.name +\n \" successfully completed! Gained \" +\n formatNumber(gain, 3) +\n \" rank\",\n );\n } else if (!isOperation && this.logging.contracts) {\n this.log(\n `${person.whoAmI()}: ` +\n action.name +\n \" contract successfully completed! Gained \" +\n formatNumber(gain, 3) +\n \" rank and \" +\n numeralWrapper.formatMoney(moneyGain),\n );\n }\n }\n isOperation ? this.completeOperation(true, player) : this.completeContract(true, actionIdent);\n } else {\n retValue = this.getActionStats(action, person, false);\n ++action.failures;\n let loss = 0,\n damage = 0;\n if (action.rankLoss) {\n loss = addOffset(action.rankLoss * rewardMultiplier, 10);\n this.changeRank(person, -1 * loss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n this.hpLost += damage;\n const cost = calculateHospitalizationCost(player, damage);\n if (person.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n let logLossText = \"\";\n if (loss > 0) {\n logLossText += \"Lost \" + formatNumber(loss, 3) + \" rank. \";\n }\n if (damage > 0) {\n logLossText += \"Took \" + formatNumber(damage, 0) + \" damage.\";\n }\n if (isOperation && this.logging.ops) {\n this.log(`${person.whoAmI()}: ` + action.name + \" failed! \" + logLossText);\n } else if (!isOperation && this.logging.contracts) {\n this.log(`${person.whoAmI()}: ` + action.name + \" contract failed! \" + logLossText);\n }\n isOperation ? this.completeOperation(false, player) : this.completeContract(false, actionIdent);\n }\n if (action.autoLevel) {\n action.level = action.maxLevel;\n } // Autolevel\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n break;\n }\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]: {\n try {\n const action = this.getActionObject(actionIdent);\n if (action == null || !(action instanceof BlackOperation)) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + actionIdent.name);\n }\n const difficulty = action.getDifficulty();\n const difficultyMultiplier =\n Math.pow(difficulty, BladeburnerConstants.DiffMultExponentialFactor) +\n difficulty / BladeburnerConstants.DiffMultLinearFactor;\n\n // Stamina loss is based on difficulty\n this.stamina -= BladeburnerConstants.BaseStaminaLoss * difficultyMultiplier;\n if (this.stamina < 0) {\n this.stamina = 0;\n }\n\n // Team loss variables\n const teamCount = action.teamCount;\n let teamLossMax;\n\n if (action.attempt(this, person)) {\n retValue = this.getActionStats(action, person, true);\n action.count = 0;\n this.blackops[action.name] = true;\n let rankGain = 0;\n if (action.rankGain) {\n rankGain = addOffset(action.rankGain * BitNodeMultipliers.BladeburnerRank, 10);\n this.changeRank(person, rankGain);\n }\n teamLossMax = Math.ceil(teamCount / 2);\n\n if (this.logging.blackops) {\n this.log(\n `${person.whoAmI()}: ` + action.name + \" successful! Gained \" + formatNumber(rankGain, 1) + \" rank\",\n );\n }\n } else {\n retValue = this.getActionStats(action, person, false);\n let rankLoss = 0;\n let damage = 0;\n if (action.rankLoss) {\n rankLoss = addOffset(action.rankLoss, 10);\n this.changeRank(person, -1 * rankLoss);\n }\n if (action.hpLoss) {\n damage = action.hpLoss * difficultyMultiplier;\n damage = Math.ceil(addOffset(damage, 10));\n const cost = calculateHospitalizationCost(player, damage);\n if (person.takeDamage(damage)) {\n ++this.numHosp;\n this.moneyLost += cost;\n }\n }\n teamLossMax = Math.floor(teamCount);\n\n if (this.logging.blackops) {\n this.log(\n `${person.whoAmI()}: ` +\n action.name +\n \" failed! Lost \" +\n formatNumber(rankLoss, 1) +\n \" rank and took \" +\n formatNumber(damage, 0) +\n \" damage\",\n );\n }\n }\n\n this.resetAction(); // Stop regardless of success or fail\n\n // Calculate team lossses\n if (teamCount >= 1) {\n const losses = getRandomInt(1, teamLossMax);\n this.teamSize -= losses;\n if (this.teamSize < this.sleeveSize) {\n const sup = player.sleeves.filter((x) => isSleeveSupportWork(x.currentWork));\n for (let i = 0; i > this.teamSize - this.sleeveSize; i--) {\n const r = Math.floor(Math.random() * sup.length);\n sup[r].takeDamage(sup[r].hp.max);\n sup.splice(r, 1);\n }\n this.teamSize += this.sleeveSize;\n }\n this.teamLost += losses;\n if (this.logging.blackops) {\n this.log(`${person.whoAmI()}: You lost ${formatNumber(losses, 0)} team members during ${action.name}`);\n }\n }\n } catch (e: unknown) {\n exceptionAlert(String(e));\n }\n break;\n }\n case ActionTypes[\"Training\"]: {\n this.stamina -= 0.5 * BladeburnerConstants.BaseStaminaLoss;\n const strExpGain = 30 * person.mults.strength_exp,\n defExpGain = 30 * person.mults.defense_exp,\n dexExpGain = 30 * person.mults.dexterity_exp,\n agiExpGain = 30 * person.mults.agility_exp,\n staminaGain = 0.04 * this.skillMultipliers.stamina;\n retValue.str = strExpGain;\n retValue.def = defExpGain;\n retValue.dex = dexExpGain;\n retValue.agi = agiExpGain;\n this.staminaBonus += staminaGain;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Training completed. Gained: \" +\n formatNumber(strExpGain, 1) +\n \" str exp, \" +\n formatNumber(defExpGain, 1) +\n \" def exp, \" +\n formatNumber(dexExpGain, 1) +\n \" dex exp, \" +\n formatNumber(agiExpGain, 1) +\n \" agi exp, \" +\n formatNumber(staminaGain, 3) +\n \" max stamina\",\n );\n }\n break;\n }\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Field Analysis\"]: {\n // Does not use stamina. Effectiveness depends on hacking, int, and cha\n let eff =\n 0.04 * Math.pow(person.skills.hacking, 0.3) +\n 0.04 * Math.pow(person.skills.intelligence, 0.9) +\n 0.02 * Math.pow(person.skills.charisma, 0.3);\n eff *= person.mults.bladeburner_analysis;\n if (isNaN(eff) || eff < 0) {\n throw new Error(\"Field Analysis Effectiveness calculated to be NaN or negative\");\n }\n const hackingExpGain = 20 * person.mults.hacking_exp;\n const charismaExpGain = 20 * person.mults.charisma_exp;\n const rankGain = 0.1 * BitNodeMultipliers.BladeburnerRank;\n retValue.hack = hackingExpGain;\n retValue.cha = charismaExpGain;\n retValue.int = BladeburnerConstants.BaseIntGain;\n this.changeRank(person, rankGain);\n this.getCurrentCity().improvePopulationEstimateByPercentage(eff * this.skillMultipliers.successChanceEstimate);\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n `Field analysis completed. Gained ${formatNumber(rankGain, 2)} rank, ` +\n `${formatNumber(hackingExpGain, 1)} hacking exp, and ` +\n `${formatNumber(charismaExpGain, 1)} charisma exp`,\n );\n }\n break;\n }\n case ActionTypes[\"Recruitment\"]: {\n const successChance = this.getRecruitmentSuccessChance(person);\n const recruitTime = this.getRecruitmentTime(person) * 1000;\n if (Math.random() < successChance) {\n const expGain = 2 * BladeburnerConstants.BaseStatGain * recruitTime;\n retValue.cha = expGain;\n ++this.teamSize;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Successfully recruited a team member! Gained \" +\n formatNumber(expGain, 1) +\n \" charisma exp\",\n );\n }\n } else {\n const expGain = BladeburnerConstants.BaseStatGain * recruitTime;\n retValue.cha = expGain;\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: ` +\n \"Failed to recruit a team member. Gained \" +\n formatNumber(expGain, 1) +\n \" charisma exp\",\n );\n }\n }\n break;\n }\n case ActionTypes[\"Diplomacy\"]: {\n const eff = this.getDiplomacyEffectiveness(person);\n this.getCurrentCity().chaos *= eff;\n if (this.getCurrentCity().chaos < 0) {\n this.getCurrentCity().chaos = 0;\n }\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: Diplomacy completed. Chaos levels in the current city fell by ${numeralWrapper.formatPercentage(\n 1 - eff,\n )}`,\n );\n }\n break;\n }\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]: {\n person.regenerateHp(BladeburnerConstants.HrcHpGain);\n\n const staminaGain = this.maxStamina * (BladeburnerConstants.HrcStaminaGain / 100);\n this.stamina = Math.min(this.maxStamina, this.stamina + staminaGain);\n if (this.logging.general) {\n this.log(\n `${person.whoAmI()}: Rested in Hyperbolic Regeneration Chamber. Restored ${\n BladeburnerConstants.HrcHpGain\n } HP and gained ${numeralWrapper.formatStamina(staminaGain)} stamina`,\n );\n }\n break;\n }\n case ActionTypes[\"Incite Violence\"]: {\n for (const contract of Object.keys(this.contracts)) {\n const growthF = Growths[contract];\n if (!growthF) throw new Error(\"trying to generate count for action that doesn't exist? \" + contract);\n this.contracts[contract].count += (60 * 3 * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n for (const operation of Object.keys(this.operations)) {\n const growthF = Growths[operation];\n if (!growthF) throw new Error(\"trying to generate count for action that doesn't exist? \" + operation);\n this.operations[operation].count += (60 * 3 * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n if (this.logging.general) {\n this.log(`${person.whoAmI()}: Incited violence in the synthoid communities.`);\n }\n for (const cityName of Object.keys(this.cities)) {\n const city = this.cities[cityName];\n city.chaos += 10;\n city.chaos += city.chaos / (Math.log(city.chaos) / Math.log(10));\n }\n break;\n }\n default:\n console.error(`Bladeburner.completeAction() called for invalid action: ${actionIdent.type}`);\n break;\n }\n return retValue;\n }\n\n infiltrateSynthoidCommunities(p: IPlayer): void {\n const infilSleeves = p.sleeves.filter((s) => isSleeveInfiltrateWork(s.currentWork)).length;\n const amt = Math.pow(infilSleeves, -0.5) / 2;\n for (const contract of Object.keys(this.contracts)) {\n this.contracts[contract].count += amt;\n }\n for (const operation of Object.keys(this.operations)) {\n this.operations[operation].count += amt;\n }\n if (this.logging.general) {\n this.log(`Sleeve: Infiltrate the synthoid communities.`);\n }\n }\n\n changeRank(person: IPerson, change: number): void {\n if (isNaN(change)) {\n throw new Error(\"NaN passed into Bladeburner.changeRank()\");\n }\n this.rank += change;\n if (this.rank < 0) {\n this.rank = 0;\n }\n this.maxRank = Math.max(this.rank, this.maxRank);\n\n const bladeburnersFactionName = FactionNames.Bladeburners;\n if (factionExists(bladeburnersFactionName)) {\n const bladeburnerFac = Factions[bladeburnersFactionName];\n if (!(bladeburnerFac instanceof Faction)) {\n throw new Error(\n `Could not properly get ${FactionNames.Bladeburners} Faction object in ${FactionNames.Bladeburners} UI Overview Faction button`,\n );\n }\n if (bladeburnerFac.isMember) {\n const favorBonus = 1 + bladeburnerFac.favor / 100;\n bladeburnerFac.playerReputation +=\n BladeburnerConstants.RankToFactionRepFactor * change * person.mults.faction_rep * favorBonus;\n }\n }\n\n // Gain skill points\n const rankNeededForSp = (this.totalSkillPoints + 1) * BladeburnerConstants.RanksPerSkillPoint;\n if (this.maxRank >= rankNeededForSp) {\n // Calculate how many skill points to gain\n const gainedSkillPoints = Math.floor(\n (this.maxRank - rankNeededForSp) / BladeburnerConstants.RanksPerSkillPoint + 1,\n );\n this.skillPoints += gainedSkillPoints;\n this.totalSkillPoints += gainedSkillPoints;\n }\n }\n\n processAction(router: IRouter, player: IPlayer, seconds: number): void {\n if (this.action.type === ActionTypes[\"Idle\"]) return;\n if (this.actionTimeToComplete <= 0) {\n throw new Error(`Invalid actionTimeToComplete value: ${this.actionTimeToComplete}, type; ${this.action.type}`);\n }\n if (!(this.action instanceof ActionIdentifier)) {\n throw new Error(\"Bladeburner.action is not an ActionIdentifier Object\");\n }\n\n // If the previous action went past its completion time, add to the next action\n // This is not added inmediatly in case the automation changes the action\n this.actionTimeCurrent += seconds + this.actionTimeOverflow;\n this.actionTimeOverflow = 0;\n if (this.actionTimeCurrent >= this.actionTimeToComplete) {\n this.actionTimeOverflow = this.actionTimeCurrent - this.actionTimeToComplete;\n const action = this.getActionObject(this.action);\n const retValue = this.completeAction(player, player, this.action);\n player.gainMoney(retValue.money, \"bladeburner\");\n player.gainStats(retValue);\n // Operation Daedalus\n if (action == null) {\n throw new Error(\"Failed to get BlackOperation Object for: \" + this.action.name);\n } else if (this.action.type != ActionTypes[\"BlackOperation\"] && this.action.type != ActionTypes[\"BlackOp\"]) {\n this.startAction(player, this.action); // Repeat action\n }\n }\n }\n\n calculateStaminaGainPerSecond(player: IPlayer): number {\n const effAgility = player.skills.agility * this.skillMultipliers.effAgi;\n const maxStaminaBonus = this.maxStamina / BladeburnerConstants.MaxStaminaToGainFactor;\n const gain = (BladeburnerConstants.StaminaGainPerSecond + maxStaminaBonus) * Math.pow(effAgility, 0.17);\n return gain * (this.skillMultipliers.stamina * player.mults.bladeburner_stamina_gain);\n }\n\n calculateMaxStamina(player: IPlayer): void {\n const effAgility = player.skills.agility * this.skillMultipliers.effAgi;\n const maxStamina =\n (Math.pow(effAgility, 0.8) + this.staminaBonus) *\n this.skillMultipliers.stamina *\n player.mults.bladeburner_max_stamina;\n if (this.maxStamina !== maxStamina) {\n const oldMax = this.maxStamina;\n this.maxStamina = maxStamina;\n this.stamina = (this.maxStamina * this.stamina) / oldMax;\n }\n if (isNaN(maxStamina)) {\n throw new Error(\"Max Stamina calculated to be NaN in Bladeburner.calculateMaxStamina()\");\n }\n }\n\n create(): void {\n this.contracts[\"Tracking\"] = new Contract({\n name: \"Tracking\",\n baseDifficulty: 125,\n difficultyFac: 1.02,\n rewardFac: 1.041,\n rankGain: 0.3,\n hpLoss: 0.5,\n count: getRandomInt(25, 150),\n weights: {\n hack: 0,\n str: 0.05,\n def: 0.05,\n dex: 0.35,\n agi: 0.35,\n cha: 0.1,\n int: 0.05,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.9,\n int: 1,\n },\n isStealth: true,\n });\n this.contracts[\"Bounty Hunter\"] = new Contract({\n name: \"Bounty Hunter\",\n baseDifficulty: 250,\n difficultyFac: 1.04,\n rewardFac: 1.085,\n rankGain: 0.9,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.15,\n def: 0.15,\n dex: 0.25,\n agi: 0.25,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n this.contracts[\"Retirement\"] = new Contract({\n name: \"Retirement\",\n baseDifficulty: 200,\n difficultyFac: 1.03,\n rewardFac: 1.065,\n rankGain: 0.6,\n hpLoss: 1,\n count: getRandomInt(5, 150),\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0.1,\n int: 0.1,\n },\n decays: {\n hack: 0,\n str: 0.91,\n def: 0.91,\n dex: 0.91,\n agi: 0.91,\n cha: 0.8,\n int: 0.9,\n },\n isKill: true,\n });\n\n this.operations[\"Investigation\"] = new Operation({\n name: \"Investigation\",\n baseDifficulty: 400,\n difficultyFac: 1.03,\n rewardFac: 1.07,\n reqdRank: 25,\n rankGain: 2.2,\n rankLoss: 0.2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.1,\n cha: 0.25,\n int: 0.1,\n },\n decays: {\n hack: 0.85,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Undercover Operation\"] = new Operation({\n name: \"Undercover Operation\",\n baseDifficulty: 500,\n difficultyFac: 1.04,\n rewardFac: 1.09,\n reqdRank: 100,\n rankGain: 4.4,\n rankLoss: 0.4,\n hpLoss: 2,\n count: getRandomInt(1, 100),\n weights: {\n hack: 0.2,\n str: 0.05,\n def: 0.05,\n dex: 0.2,\n agi: 0.2,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Sting Operation\"] = new Operation({\n name: \"Sting Operation\",\n baseDifficulty: 650,\n difficultyFac: 1.04,\n rewardFac: 1.095,\n reqdRank: 500,\n rankGain: 5.5,\n rankLoss: 0.5,\n hpLoss: 2.5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.25,\n str: 0.05,\n def: 0.05,\n dex: 0.25,\n agi: 0.1,\n cha: 0.2,\n int: 0.1,\n },\n decays: {\n hack: 0.8,\n str: 0.85,\n def: 0.85,\n dex: 0.85,\n agi: 0.85,\n cha: 0.7,\n int: 0.9,\n },\n isStealth: true,\n });\n this.operations[\"Raid\"] = new Operation({\n name: \"Raid\",\n baseDifficulty: 800,\n difficultyFac: 1.045,\n rewardFac: 1.1,\n reqdRank: 3000,\n rankGain: 55,\n rankLoss: 2.5,\n hpLoss: 50,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isKill: true,\n });\n this.operations[\"Stealth Retirement Operation\"] = new Operation({\n name: \"Stealth Retirement Operation\",\n baseDifficulty: 1000,\n difficultyFac: 1.05,\n rewardFac: 1.11,\n reqdRank: 20e3,\n rankGain: 22,\n rankLoss: 2,\n hpLoss: 10,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.7,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.9,\n },\n isStealth: true,\n isKill: true,\n });\n this.operations[\"Assassination\"] = new Operation({\n name: \"Assassination\",\n baseDifficulty: 1500,\n difficultyFac: 1.06,\n rewardFac: 1.14,\n reqdRank: 50e3,\n rankGain: 44,\n rankLoss: 4,\n hpLoss: 5,\n count: getRandomInt(1, 150),\n weights: {\n hack: 0.1,\n str: 0.1,\n def: 0.1,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.8,\n },\n isStealth: true,\n isKill: true,\n });\n }\n\n process(router: IRouter, player: IPlayer): void {\n // Edge race condition when the engine checks the processing counters and attempts to route before the router is initialized.\n if (!router.isInitialized) return;\n\n // If the Player starts doing some other actions, set action to idle and alert\n if (!player.hasAugmentation(AugmentationNames.BladesSimulacrum, true) && player.currentWork) {\n if (this.action.type !== ActionTypes[\"Idle\"]) {\n let msg = \"Your Bladeburner action was cancelled because you started doing something else.\";\n if (this.automateEnabled) {\n msg += `

Your automation was disabled as well. You will have to re-enable it through the Bladeburner console`;\n this.automateEnabled = false;\n }\n if (!Settings.SuppressBladeburnerPopup) {\n dialogBoxCreate(msg);\n }\n }\n this.resetAction();\n }\n\n // If the Player has no Stamina, set action to idle\n if (this.stamina <= 0) {\n this.log(\"Your Bladeburner action was cancelled because your stamina hit 0\");\n this.resetAction();\n }\n\n // A 'tick' for this mechanic is one second (= 5 game cycles)\n if (this.storedCycles >= BladeburnerConstants.CyclesPerSecond) {\n let seconds = Math.floor(this.storedCycles / BladeburnerConstants.CyclesPerSecond);\n seconds = Math.min(seconds, 5); // Max of 5 'ticks'\n this.storedCycles -= seconds * BladeburnerConstants.CyclesPerSecond;\n\n // Stamina\n this.calculateMaxStamina(player);\n this.stamina += this.calculateStaminaGainPerSecond(player) * seconds;\n this.stamina = Math.min(this.maxStamina, this.stamina);\n\n // Count increase for contracts/operations\n for (const contract of Object.values(this.contracts)) {\n const growthF = Growths[contract.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${contract.name}' is undefined`);\n contract.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n for (const op of Object.values(this.operations)) {\n const growthF = Growths[op.name];\n if (growthF === undefined) throw new Error(`growth formula for action '${op.name}' is undefined`);\n if (growthF !== undefined) {\n op.count += (seconds * growthF()) / BladeburnerConstants.ActionCountGrowthPeriod;\n }\n }\n\n // Chaos goes down very slowly\n for (const cityName of BladeburnerConstants.CityNames) {\n const city = this.cities[cityName];\n if (!(city instanceof City)) {\n throw new Error(\"Invalid City object when processing passive chaos reduction in Bladeburner.process\");\n }\n city.chaos -= 0.0001 * seconds;\n city.chaos = Math.max(0, city.chaos);\n }\n\n // Random Events\n this.randomEventCounter -= seconds;\n if (this.randomEventCounter <= 0) {\n this.randomEvent();\n // Add instead of setting because we might have gone over the required time for the event\n this.randomEventCounter += getRandomInt(240, 600);\n }\n\n this.processAction(router, player, seconds);\n\n // Automation\n if (this.automateEnabled) {\n // Note: Do NOT set this.action = this.automateActionHigh/Low since it creates a reference\n if (this.stamina <= this.automateThreshLow) {\n if (this.action.name !== this.automateActionLow.name || this.action.type !== this.automateActionLow.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionLow.type,\n name: this.automateActionLow.name,\n });\n this.startAction(player, this.action);\n }\n } else if (this.stamina >= this.automateThreshHigh) {\n if (this.action.name !== this.automateActionHigh.name || this.action.type !== this.automateActionHigh.type) {\n this.action = new ActionIdentifier({\n type: this.automateActionHigh.type,\n name: this.automateActionHigh.name,\n });\n this.startAction(player, this.action);\n }\n }\n }\n }\n }\n\n getTypeAndNameFromActionId(actionId: IActionIdentifier): {\n type: string;\n name: string;\n } {\n const res = { type: \"\", name: \"\" };\n const types = Object.keys(ActionTypes);\n for (let i = 0; i < types.length; ++i) {\n if (actionId.type === ActionTypes[types[i]]) {\n res.type = types[i];\n break;\n }\n }\n const gen = [\n \"Training\",\n \"Recruitment\",\n \"FieldAnalysis\",\n \"Field Analysis\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n \"Incite Violence\",\n ];\n if (gen.includes(res.type)) {\n res.type = \"General\";\n }\n\n if (res.type == null) {\n res.type = \"Idle\";\n }\n\n res.name = actionId.name != null ? actionId.name : \"Idle\";\n return res;\n }\n\n getContractNamesNetscriptFn(): string[] {\n return Object.keys(this.contracts);\n }\n\n getOperationNamesNetscriptFn(): string[] {\n return Object.keys(this.operations);\n }\n\n getBlackOpNamesNetscriptFn(): string[] {\n return Object.keys(BlackOperations);\n }\n\n getGeneralActionNamesNetscriptFn(): string[] {\n return Object.keys(GeneralActions);\n }\n\n getSkillNamesNetscriptFn(): string[] {\n return Object.keys(Skills);\n }\n\n startActionNetscriptFn(player: IPlayer, type: string, name: string, workerScript: WorkerScript): boolean {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.startAction\", () => errorLogText);\n return false;\n }\n\n // Special logic for Black Ops\n if (actionId.type === ActionTypes[\"BlackOp\"]) {\n const canRunOp = this.canAttemptBlackOp(actionId);\n if (!canRunOp.isAvailable) {\n workerScript.log(\"bladeburner.startAction\", () => canRunOp.error + \"\");\n return false;\n }\n }\n\n try {\n this.startAction(player, actionId);\n workerScript.log(\n \"bladeburner.startAction\",\n () => `Starting bladeburner action with type '${type}' and name '${name}'`,\n );\n return true;\n } catch (e: unknown) {\n console.error(e);\n this.resetAction();\n workerScript.log(\"bladeburner.startAction\", () => errorLogText);\n return false;\n }\n }\n\n getActionTimeNetscriptFn(person: IPerson, type: string, name: string): number | string {\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n return \"bladeburner.getActionTime\";\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n return \"bladeburner.getActionTime\";\n }\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getActionTime(this, person) * 1000;\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n return 30000;\n case ActionTypes[\"Recruitment\"]:\n return this.getRecruitmentTime(person) * 1000;\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return 60000;\n default:\n return \"bladeburner.getActionTime\";\n }\n }\n\n getActionEstimatedSuccessChanceNetscriptFn(person: IPerson, type: string, name: string): [number, number] | string {\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n return \"bladeburner.getActionEstimatedSuccessChance\";\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n return \"bladeburner.getActionEstimatedSuccessChance\";\n }\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n return actionObj.getEstSuccessChance(this, person);\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return [1, 1];\n case ActionTypes[\"Recruitment\"]: {\n const recChance = this.getRecruitmentSuccessChance(person);\n return [recChance, recChance];\n }\n default:\n return \"bladeburner.getActionEstimatedSuccessChance\";\n }\n }\n\n getActionCountRemainingNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n\n switch (actionId.type) {\n case ActionTypes[\"Contract\"]:\n case ActionTypes[\"Operation\"]:\n return Math.floor(actionObj.count);\n case ActionTypes[\"BlackOp\"]:\n case ActionTypes[\"BlackOperation\"]:\n if (this.blackops[name] != null) {\n return 0;\n } else {\n return 1;\n }\n case ActionTypes[\"Training\"]:\n case ActionTypes[\"Recruitment\"]:\n case ActionTypes[\"Field Analysis\"]:\n case ActionTypes[\"FieldAnalysis\"]:\n case ActionTypes[\"Diplomacy\"]:\n case ActionTypes[\"Hyperbolic Regeneration Chamber\"]:\n case ActionTypes[\"Incite Violence\"]:\n return Infinity;\n default:\n workerScript.log(\"bladeburner.getActionCountRemaining\", () => errorLogText);\n return -1;\n }\n }\n\n getSkillLevelNetscriptFn(skillName: string, workerScript: WorkerScript): number {\n if (skillName === \"\" || !Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.getSkillLevel\", () => `Invalid skill: '${skillName}'`);\n return -1;\n }\n\n if (this.skills[skillName] == null) {\n return 0;\n } else {\n return this.skills[skillName];\n }\n }\n\n getSkillUpgradeCostNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): number {\n if (skillName === \"\" || !Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.getSkillUpgradeCost\", () => `Invalid skill: '${skillName}'`);\n return -1;\n }\n\n const skill = Skills[skillName];\n if (this.skills[skillName] == null) {\n return skill.calculateCost(0, count);\n } else {\n return skill.calculateCost(this.skills[skillName], count);\n }\n }\n\n upgradeSkillNetscriptFn(skillName: string, count: number, workerScript: WorkerScript): boolean {\n const errorLogText = `Invalid skill: '${skillName}'`;\n if (!Skills.hasOwnProperty(skillName)) {\n workerScript.log(\"bladeburner.upgradeSkill\", () => errorLogText);\n return false;\n }\n\n const skill = Skills[skillName];\n let currentLevel = 0;\n if (this.skills[skillName] && !isNaN(this.skills[skillName])) {\n currentLevel = this.skills[skillName];\n }\n const cost = skill.calculateCost(currentLevel, count);\n\n if (skill.maxLvl && currentLevel + count > skill.maxLvl) {\n workerScript.log(\"bladeburner.upgradeSkill\", () => `Skill '${skillName}' cannot be upgraded ${count} time(s).`);\n return false;\n }\n\n if (this.skillPoints < cost) {\n workerScript.log(\n \"bladeburner.upgradeSkill\",\n () =>\n `You do not have enough skill points to upgrade ${skillName} ${count} time(s). (You have ${this.skillPoints}, you need ${cost})`,\n );\n return false;\n }\n\n this.skillPoints -= cost;\n this.upgradeSkill(skill, count);\n workerScript.log(\"bladeburner.upgradeSkill\", () => `'${skillName}' upgraded to level ${this.skills[skillName]}`);\n return true;\n }\n\n getTeamSizeNetscriptFn(type: string, name: string, workerScript: WorkerScript): number {\n if (type === \"\" && name === \"\") {\n return this.teamSize;\n }\n\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.getTeamSize\", () => errorLogText);\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.getTeamSize\", () => errorLogText);\n return -1;\n }\n\n if (\n actionId.type === ActionTypes[\"Operation\"] ||\n actionId.type === ActionTypes[\"BlackOp\"] ||\n actionId.type === ActionTypes[\"BlackOperation\"]\n ) {\n return actionObj.teamCount;\n } else {\n return 0;\n }\n }\n\n setTeamSizeNetscriptFn(type: string, name: string, size: number, workerScript: WorkerScript): number {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n const actionId = this.getActionIdFromTypeAndName(type, name);\n if (actionId == null) {\n workerScript.log(\"bladeburner.setTeamSize\", () => errorLogText);\n return -1;\n }\n\n if (\n actionId.type !== ActionTypes[\"Operation\"] &&\n actionId.type !== ActionTypes[\"BlackOp\"] &&\n actionId.type !== ActionTypes[\"BlackOperation\"]\n ) {\n workerScript.log(\"bladeburner.setTeamSize\", () => \"Only valid for 'Operations' and 'BlackOps'\");\n return -1;\n }\n\n const actionObj = this.getActionObject(actionId);\n if (actionObj == null) {\n workerScript.log(\"bladeburner.setTeamSize\", () => errorLogText);\n return -1;\n }\n\n let sanitizedSize = Math.round(size);\n if (isNaN(sanitizedSize) || sanitizedSize < 0) {\n workerScript.log(\"bladeburner.setTeamSize\", () => `Invalid size: ${size}`);\n return -1;\n }\n if (this.teamSize < sanitizedSize) {\n sanitizedSize = this.teamSize;\n }\n actionObj.teamCount = sanitizedSize;\n workerScript.log(\"bladeburner.setTeamSize\", () => `Team size for '${name}' set to ${sanitizedSize}.`);\n return sanitizedSize;\n }\n\n joinBladeburnerFactionNetscriptFn(workerScript: WorkerScript): boolean {\n const bladeburnerFac = Factions[FactionNames.Bladeburners];\n if (bladeburnerFac.isMember) {\n return true;\n } else if (this.rank >= BladeburnerConstants.RankNeededForFaction) {\n joinFaction(bladeburnerFac);\n workerScript.log(\"bladeburner.joinBladeburnerFaction\", () => `Joined ${FactionNames.Bladeburners} faction.`);\n return true;\n } else {\n workerScript.log(\n \"bladeburner.joinBladeburnerFaction\",\n () => `You do not have the required rank (${this.rank}/${BladeburnerConstants.RankNeededForFaction}).`,\n );\n return false;\n }\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Bladeburner\", this);\n }\n\n /**\n * Initiatizes a Bladeburner object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Bladeburner {\n return Generic_fromJSON(Bladeburner, value.data);\n }\n}\n\nReviver.constructors.Bladeburner = Bladeburner;\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { HacknetNodeConstants } from \"../data/Constants\";\n\nexport function calculateMoneyGainRate(level: number, ram: number, cores: number, mult: number): number {\n const gainPerLevel = HacknetNodeConstants.MoneyGainPerLevel;\n\n const levelMult = level * gainPerLevel;\n const ramMult = Math.pow(1.035, ram - 1);\n const coresMult = (cores + 5) / 6;\n return levelMult * ramMult * coresMult * mult * BitNodeMultipliers.HacknetNodeMoney;\n}\n\nexport function calculateLevelUpgradeCost(startingLevel: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingLevel >= HacknetNodeConstants.MaxLevel) {\n return Infinity;\n }\n\n const mult = HacknetNodeConstants.UpgradeLevelMult;\n let totalMultiplier = 0;\n let currLevel = startingLevel;\n for (let i = 0; i < sanitizedLevels; ++i) {\n totalMultiplier += HacknetNodeConstants.LevelBaseCost * Math.pow(mult, currLevel);\n ++currLevel;\n }\n\n return (HacknetNodeConstants.BaseCost / 2) * totalMultiplier * costMult;\n}\n\nexport function calculateRamUpgradeCost(startingRam: number, extraLevels = 1, costMult = 1): number {\n const sanitizedLevels = Math.round(extraLevels);\n if (isNaN(sanitizedLevels) || sanitizedLevels < 1) {\n return 0;\n }\n\n if (startingRam >= HacknetNodeConstants.MaxRam) {\n return Infinity;\n }\n\n let totalCost = 0;\n let numUpgrades = Math.round(Math.log2(startingRam));\n let currentRam = startingRam;\n\n for (let i = 0; i < sanitizedLevels; ++i) {\n const baseCost = currentRam * HacknetNodeConstants.RamBaseCost;\n const mult = Math.pow(HacknetNodeConstants.UpgradeRamMult, numUpgrades);\n\n totalCost += baseCost * mult;\n\n currentRam *= 2;\n ++numUpgrades;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateCoreUpgradeCost(startingCore: number, extraLevels = 1, costMult = 1): number {\n const sanitizedCores = Math.round(extraLevels);\n if (isNaN(sanitizedCores) || sanitizedCores < 1) {\n return 0;\n }\n\n if (startingCore >= HacknetNodeConstants.MaxCores) {\n return Infinity;\n }\n\n const coreBaseCost = HacknetNodeConstants.CoreBaseCost;\n const mult = HacknetNodeConstants.UpgradeCoreMult;\n let totalCost = 0;\n let currentCores = startingCore;\n for (let i = 0; i < sanitizedCores; ++i) {\n totalCost += coreBaseCost * Math.pow(mult, currentCores - 1);\n ++currentCores;\n }\n\n totalCost *= costMult;\n\n return totalCost;\n}\n\nexport function calculateNodeCost(n: number, mult = 1): number {\n if (n <= 0) {\n return 0;\n }\n return HacknetNodeConstants.BaseCost * Math.pow(HacknetNodeConstants.PurchaseNextMult, n - 1) * mult;\n}\n","import * as React from \"react\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nconst gainLimit = 10e9;\n\nexport function win(p: IPlayer, n: number): void {\n p.gainMoney(n, \"casino\");\n}\n\nexport function reachedLimit(p: IPlayer): boolean {\n const reached = p.getCasinoWinnings() > gainLimit;\n if (reached) {\n dialogBoxCreate(<>Alright cheater get out of here. You're not allowed here anymore.);\n }\n return reached;\n}\n\nexport class Game extends React.Component {\n win(p: IPlayer, n: number): void {\n p.gainMoney(n, \"casino\");\n }\n\n reachedLimit(p: IPlayer): boolean {\n const reached = p.getCasinoWinnings() > gainLimit;\n if (reached) {\n dialogBoxCreate(<>Alright cheater get out of here. You're not allowed here anymore.);\n }\n return reached;\n }\n}\n","const _ = false;\nconst X = true;\nexport const Shapes: {\n O: boolean[][];\n I: boolean[][];\n L: boolean[][];\n J: boolean[][];\n S: boolean[][];\n Z: boolean[][];\n T: boolean[][];\n} = {\n O: [\n [X, X],\n [X, X],\n ],\n I: [[X, X, X, X]],\n L: [\n [_, _, X],\n [X, X, X],\n ],\n J: [\n [X, _, _],\n [X, X, X],\n ],\n S: [\n [_, X, X],\n [X, X, _],\n ],\n Z: [\n [X, X, _],\n [_, X, X],\n ],\n T: [\n [X, X, X],\n [_, X, _],\n ],\n};\n","interface DifficultySetting {\n [key: string]: number;\n}\n\ninterface DifficultySettings {\n Trivial: DifficultySetting;\n Normal: DifficultySetting;\n Hard: DifficultySetting;\n Impossible: DifficultySetting;\n}\n\n// I could use `any` to simply some of this but I also want to take advantage\n// of the type safety that typescript provides. I'm just not sure how in this\n// case.\nexport function interpolate(settings: DifficultySettings, n: number, out: DifficultySetting): DifficultySetting {\n // interpolates between 2 difficulties.\n function lerpD(a: DifficultySetting, b: DifficultySetting, t: number): DifficultySetting {\n // interpolates between 2 numbers.\n function lerp(x: number, y: number, t: number): number {\n return (1 - t) * x + t * y;\n }\n for (const key of Object.keys(a)) {\n out[key] = lerp(a[key], b[key], t);\n }\n return a;\n }\n if (n < 0) return lerpD(settings.Trivial, settings.Trivial, 0);\n if (n >= 0 && n < 1) return lerpD(settings.Trivial, settings.Normal, n);\n if (n >= 1 && n < 2) return lerpD(settings.Normal, settings.Hard, n - 1);\n if (n >= 2 && n < 3) return lerpD(settings.Hard, settings.Impossible, n - 2);\n return lerpD(settings.Impossible, settings.Impossible, 0);\n}\n","import React, { useEffect } from \"react\";\n\ninterface IProps {\n onKeyDown: (this: Document, event: KeyboardEvent) => void;\n onFailure: (options?: { automated: boolean }) => void;\n}\n\nexport function KeyHandler(props: IProps): React.ReactElement {\n useEffect(() => {\n function press(this: Document, event: KeyboardEvent): void {\n if (!event.isTrusted) return;\n const f = props.onKeyDown.bind(this);\n f(event);\n }\n document.addEventListener(\"keydown\", press);\n return () => document.removeEventListener(\"keydown\", press);\n });\n\n // invisible autofocused element that eats all the keypress for the minigames.\n return <>;\n}\n","import React from \"react\";\nimport { Work, WorkType } from \"./Work\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { applyWorkStats, scaleWorkStats, WorkStats } from \"./WorkStats\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reputation } from \"../ui/React/Reputation\";\nimport { CONSTANTS } from \"../Constants\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { calculateFactionExp, calculateFactionRep } from \"./formulas/Faction\";\nimport { FactionWorkType } from \"./data/FactionWorkType\";\n\ninterface FactionWorkParams {\n singularity: boolean;\n factionWorkType: FactionWorkType;\n faction: string;\n}\n\nexport const isFactionWork = (w: Work | null): w is FactionWork => w !== null && w.type === WorkType.FACTION;\n\nexport class FactionWork extends Work {\n factionWorkType: FactionWorkType;\n factionName: string;\n\n constructor(params?: FactionWorkParams) {\n super(WorkType.FACTION, params?.singularity ?? true);\n this.factionWorkType = params?.factionWorkType ?? FactionWorkType.HACKING;\n this.factionName = params?.faction ?? FactionNames.Sector12;\n }\n\n getFaction(): Faction {\n const f = Factions[this.factionName];\n if (!f) throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);\n return f;\n }\n\n getReputationRate(player: IPlayer): number {\n let focusBonus = 1;\n if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {\n focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n return calculateFactionRep(player, this.factionWorkType, this.getFaction().favor) * focusBonus;\n }\n\n getExpRates(player: IPlayer): WorkStats {\n let focusBonus = 1;\n if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {\n focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n const rate = calculateFactionExp(player, this.factionWorkType);\n return scaleWorkStats(rate, focusBonus, false);\n }\n\n process(player: IPlayer, cycles: number): boolean {\n this.cyclesWorked += cycles;\n this.getFaction().playerReputation += this.getReputationRate(player) * cycles;\n\n const rate = this.getExpRates(player);\n applyWorkStats(player, player, rate, cycles, \"class\");\n\n return false;\n }\n\n finish(): void {\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n You worked for {this.getFaction().name}.\n
\n They now have a total of reputation.\n ,\n );\n }\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n factionWorkType: this.factionWorkType,\n factionName: this.factionName,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"FactionWork\", this);\n }\n\n /**\n * Initiatizes a FactionWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): FactionWork {\n return Generic_fromJSON(FactionWork, value.data);\n }\n}\n\nReviver.constructors.FactionWork = FactionWork;\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n money: {\n color: theme.colors.money,\n },\n }),\n);\n\nexport function Hashes({ hashes }: { hashes: number | string }): React.ReactElement {\n const classes = useStyles();\n return (\n {typeof hashes === \"number\" ? numeralWrapper.formatHashes(hashes) : hashes}\n );\n}\n","/**\n * Hacknet Node Class\n *\n * Hacknet Nodes are specialized machines that passively earn the player money over time.\n * They can be upgraded to increase their production\n */\nimport { IHacknetNode } from \"./IHacknetNode\";\n\nimport { CONSTANTS } from \"../Constants\";\n\nimport {\n calculateMoneyGainRate,\n calculateLevelUpgradeCost,\n calculateCoreUpgradeCost,\n calculateRamUpgradeCost,\n} from \"./formulas/HacknetNodes\";\nimport { HacknetNodeConstants } from \"./data/Constants\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { ObjectValidator, minMax } from \"../utils/Validator\";\n\nexport class HacknetNode implements IHacknetNode {\n static validationData: ObjectValidator = {\n cores: minMax(1, 1, HacknetNodeConstants.MaxCores),\n level: minMax(1, 1, HacknetNodeConstants.MaxLevel),\n ram: minMax(1, 1, HacknetNodeConstants.MaxRam),\n onlineTimeSeconds: minMax(0, 0, Infinity),\n totalMoneyGenerated: minMax(0, 0, Infinity),\n };\n\n // Node's number of cores\n cores = 1;\n\n // Node's Level\n level = 1;\n\n // Node's production per second\n moneyGainRatePerSecond = 0;\n\n // Identifier for Node. Includes the full \"name\" (hacknet-node-N)\n name: string;\n\n // How long this Node has existed, in seconds\n onlineTimeSeconds = 0;\n\n // Node's RAM (GB)\n ram = 1;\n\n // Total money earned by this Node\n totalMoneyGenerated = 0;\n\n constructor(name = \"\", prodMult = 1) {\n this.name = name;\n\n this.updateMoneyGainRate(prodMult);\n }\n\n // Get the cost to upgrade this Node's number of cores\n calculateCoreUpgradeCost(levels = 1, costMult: number): number {\n return calculateCoreUpgradeCost(this.cores, levels, costMult);\n }\n\n // Get the cost to upgrade this Node's level\n calculateLevelUpgradeCost(levels = 1, costMult: number): number {\n return calculateLevelUpgradeCost(this.level, levels, costMult);\n }\n\n // Get the cost to upgrade this Node's RAM\n calculateRamUpgradeCost(levels = 1, costMult: number): number {\n return calculateRamUpgradeCost(this.ram, levels, costMult);\n }\n\n // Process this Hacknet Node in the game loop.\n // Returns the amount of money generated\n process(numCycles = 1): number {\n const seconds = (numCycles * CONSTANTS.MilliPerCycle) / 1000;\n let gain = this.moneyGainRatePerSecond * seconds;\n if (isNaN(gain)) {\n console.error(`Hacknet Node ${this.name} calculated earnings of NaN`);\n gain = 0;\n }\n\n this.totalMoneyGenerated += gain;\n this.onlineTimeSeconds += seconds;\n\n return gain;\n }\n\n // Upgrade this Node's number of cores, if possible\n // Returns a boolean indicating whether new cores were successfully bought\n upgradeCore(levels = 1, prodMult: number): void {\n this.cores = Math.min(HacknetNodeConstants.MaxCores, Math.round(this.cores + levels));\n this.updateMoneyGainRate(prodMult);\n }\n\n // Upgrade this Node's level, if possible\n // Returns a boolean indicating whether the level was successfully updated\n upgradeLevel(levels = 1, prodMult: number): void {\n this.level = Math.min(HacknetNodeConstants.MaxLevel, Math.round(this.level + levels));\n this.updateMoneyGainRate(prodMult);\n }\n\n // Upgrade this Node's RAM, if possible\n // Returns a boolean indicating whether the RAM was successfully upgraded\n upgradeRam(levels = 1, prodMult: number): void {\n for (let i = 0; i < levels; ++i) {\n this.ram *= 2; // Ram is always doubled\n }\n this.ram = Math.round(this.ram); // Handle any floating point precision issues\n this.updateMoneyGainRate(prodMult);\n }\n\n // Re-calculate this Node's production and update the moneyGainRatePerSecond prop\n updateMoneyGainRate(prodMult: number): void {\n this.moneyGainRatePerSecond = calculateMoneyGainRate(this.level, this.ram, this.cores, prodMult);\n if (isNaN(this.moneyGainRatePerSecond)) {\n this.moneyGainRatePerSecond = 0;\n dialogBoxCreate(\"Error in calculating Hacknet Node production. Please report to game developer\");\n }\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"HacknetNode\", this);\n }\n\n /**\n * Initiatizes a HacknetNode object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): HacknetNode {\n return Generic_fromJSON(HacknetNode, value.data);\n }\n}\n\nReviver.constructors.HacknetNode = HacknetNode;\n","/**\n * Implements functions for purchasing servers or purchasing more RAM for\n * the home computer\n */\nimport { AddToAllServers, createUniqueRandomIp } from \"./AllServers\";\nimport { safetlyCreateUniqueServer } from \"./ServerHelpers\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { isPowerOfTwo } from \"../utils/helpers/isPowerOfTwo\";\n\n// Returns the cost of purchasing a server with the given RAM\n// Returns Infinity for invalid 'ram' arguments\n/**\n * @param ram Amount of RAM on purchased server (GB)\n * @returns Cost of purchasing the given server. Returns infinity for invalid arguments\n */\nexport function getPurchaseServerCost(ram: number): number {\n const sanitizedRam = Math.round(ram);\n if (isNaN(sanitizedRam) || !isPowerOfTwo(sanitizedRam) || !(Math.sign(sanitizedRam) === 1)) {\n return Infinity;\n }\n\n if (sanitizedRam > getPurchaseServerMaxRam()) {\n return Infinity;\n }\n\n const upg = Math.max(0, Math.log(sanitizedRam) / Math.log(2) - 6);\n\n return (\n sanitizedRam *\n CONSTANTS.BaseCostFor1GBOfRamServer *\n BitNodeMultipliers.PurchasedServerCost *\n Math.pow(BitNodeMultipliers.PurchasedServerSoftcap, upg)\n );\n}\n\nexport function getPurchaseServerLimit(): number {\n return Math.round(CONSTANTS.PurchasedServerLimit * BitNodeMultipliers.PurchasedServerLimit);\n}\n\nexport function getPurchaseServerMaxRam(): number {\n const ram = Math.round(CONSTANTS.PurchasedServerMaxRam * BitNodeMultipliers.PurchasedServerMaxRam);\n\n // Round this to the nearest power of 2\n return 1 << (31 - Math.clz32(ram));\n}\n\n// Manually purchase a server (NOT through Netscript)\nexport function purchaseServer(hostname: string, ram: number, cost: number, p: IPlayer): void {\n //Check if player has enough money\n if (!p.canAfford(cost)) {\n dialogBoxCreate(\"You don't have enough money to purchase this server!\");\n return;\n }\n\n //Maximum server limit\n if (p.purchasedServers.length >= getPurchaseServerLimit()) {\n dialogBoxCreate(\n \"You have reached the maximum limit of \" +\n getPurchaseServerLimit() +\n \" servers. \" +\n \"You cannot purchase any more. You can \" +\n \"delete some of your purchased servers using the deleteServer() Netscript function in a script\",\n );\n return;\n }\n\n if (hostname == \"\") {\n dialogBoxCreate(\"You must enter a hostname for your new server!\");\n return;\n }\n\n // Create server\n const newServ = safetlyCreateUniqueServer({\n adminRights: true,\n hostname: hostname,\n ip: createUniqueRandomIp(),\n isConnectedTo: false,\n maxRam: ram,\n organizationName: \"\",\n purchasedByPlayer: true,\n });\n AddToAllServers(newServ);\n\n // Add to Player's purchasedServers array\n p.purchasedServers.push(newServ.hostname);\n\n // Connect new server to home computer\n const homeComputer = p.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.hostname);\n newServ.serversOnNetwork.push(homeComputer.hostname);\n\n p.loseMoney(cost, \"servers\");\n\n dialogBoxCreate(\"Server successfully purchased with hostname \" + newServ.hostname);\n}\n\n// Manually upgrade RAM on home computer (NOT through Netscript)\nexport function purchaseRamForHomeComputer(p: IPlayer): void {\n const cost = p.getUpgradeHomeRamCost();\n if (!p.canAfford(cost)) {\n dialogBoxCreate(\"You do not have enough money to purchase additional RAM for your home computer\");\n return;\n }\n\n const homeComputer = p.getHomeComputer();\n if (homeComputer.maxRam >= CONSTANTS.HomeComputerMaxRam) {\n dialogBoxCreate(`You cannot upgrade your home computer RAM because it is at its maximum possible value`);\n return;\n }\n\n homeComputer.maxRam *= 2;\n p.loseMoney(cost, \"servers\");\n}\n","import { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { BaseServer } from \"./Server/BaseServer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"./utils/JSONReviver\";\nimport { removeLeadingSlash, isInRootDirectory } from \"./Terminal/DirectoryHelpers\";\n\n/**\n * Represents a plain text file that is typically stored on a server.\n */\nexport class TextFile {\n /**\n * The full file name.\n */\n fn: string;\n\n /**\n * The content of the file.\n */\n text: string;\n\n /**\n * The full file name.\n */\n get filename(): string {\n return this.fn;\n }\n\n /**\n * The full file name.\n */\n set filename(value: string) {\n this.fn = value;\n }\n\n constructor(fn = \"\", txt = \"\") {\n this.fn = (fn.endsWith(\".txt\") ? fn : `${fn}.txt`).replace(/\\s+/g, \"\");\n this.text = txt;\n }\n\n /**\n * Concatenates the raw values to the end of current content.\n */\n append(txt: string): void {\n this.text += txt;\n }\n\n /**\n * Serves the file to the user as a downloadable resource through the browser.\n */\n download(): void {\n const file: Blob = new Blob([this.text], { type: \"text/plain\" });\n const a: HTMLAnchorElement = document.createElement(\"a\");\n const url: string = URL.createObjectURL(file);\n a.href = url;\n a.download = this.fn;\n document.body.appendChild(a);\n a.click();\n setTimeout(() => {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n\n /**\n * Retrieve the content of the file.\n */\n read(): string {\n return this.text;\n }\n\n /**\n * Shows the content to the user via the game's dialog box.\n */\n show(): void {\n dialogBoxCreate(`${this.fn}

${this.text}`);\n }\n\n /**\n * Serialize the current file to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"TextFile\", this);\n }\n\n /**\n * Replaces the current content with the text provided.\n */\n write(txt: string): void {\n this.text = txt;\n }\n\n /**\n * Initiatizes a TextFile from a JSON save state.\n */\n static fromJSON(value: IReviverValue): TextFile {\n return Generic_fromJSON(TextFile, value.data);\n }\n}\n\nReviver.constructors.TextFile = TextFile;\n\n/**\n * Retrieve the file object for the filename on the specified server.\n * @param fn The file name to look for\n * @param server The server object to look in\n * @returns The file object, or null if it couldn't find it.\n */\nexport function getTextFile(fn: string, server: BaseServer): TextFile | null {\n let filename: string = !fn.endsWith(\".txt\") ? `${fn}.txt` : fn;\n\n if (isInRootDirectory(filename)) {\n filename = removeLeadingSlash(filename);\n }\n\n for (const file of server.textFiles) {\n if (file.fn === filename) {\n return file;\n }\n }\n\n return null;\n}\n\n/**\n * Creates a TextFile on the target server.\n * @param fn The file name to create.\n * @param txt The contents of the file.\n * @param server The server that the file should be created on.\n * @returns The instance of the file.\n */\nexport function createTextFile(fn: string, txt: string, server: BaseServer): TextFile | undefined {\n if (getTextFile(fn, server) !== null) {\n // This should probably be a `throw`...\n /* tslint:disable-next-line:no-console */\n console.error(`A file named \"${fn}\" already exists on server ${server.hostname}.`);\n\n return undefined;\n }\n const file: TextFile = new TextFile(fn, txt);\n server.textFiles.push(file);\n\n return file;\n}\n","import { CONSTANTS } from \"../../Constants\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CalculateShareMult } from \"../../NetworkShare/Share\";\nimport { IPerson } from \"../IPerson\";\nimport { calculateIntelligenceBonus } from \"./intelligence\";\n\nfunction mult(favor: number): number {\n let favorMult = 1 + favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n return favorMult * BitNodeMultipliers.FactionWorkRepGain;\n}\n\nexport function getHackingWorkRepGain(p: IPerson, favor: number): number {\n return (\n ((p.skills.hacking + p.skills.intelligence / 3) / CONSTANTS.MaxSkillLevel) *\n p.mults.faction_rep *\n calculateIntelligenceBonus(p.skills.intelligence, 1) *\n mult(favor) *\n CalculateShareMult()\n );\n}\n\nexport function getFactionSecurityWorkRepGain(p: IPerson, favor: number): number {\n const t =\n (0.9 *\n (p.skills.strength +\n p.skills.defense +\n p.skills.dexterity +\n p.skills.agility +\n (p.skills.hacking + p.skills.intelligence) * CalculateShareMult())) /\n CONSTANTS.MaxSkillLevel /\n 4.5;\n return t * p.mults.faction_rep * mult(favor) * calculateIntelligenceBonus(p.skills.intelligence, 1);\n}\n\nexport function getFactionFieldWorkRepGain(p: IPerson, favor: number): number {\n const t =\n (0.9 *\n (p.skills.strength +\n p.skills.defense +\n p.skills.dexterity +\n p.skills.agility +\n p.skills.charisma +\n (p.skills.hacking + p.skills.intelligence) * CalculateShareMult())) /\n CONSTANTS.MaxSkillLevel /\n 5.5;\n return t * p.mults.faction_rep * mult(favor) * calculateIntelligenceBonus(p.skills.intelligence, 1);\n}\n","import { IPlayer } from \"src/PersonObjects/IPlayer\";\nimport { IMap } from \"../types\";\n\nimport { NS as INS } from \"../ScriptEditor/NetscriptDefinitions\";\n\nimport { INetscriptExtra } from \"../NetscriptFunctions/Extra\";\n\ntype RamCostTree = {\n [Property in keyof API]: API[Property] extends () => void\n ? number | ((p: IPlayer) => void)\n : API[Property] extends object\n ? RamCostTree\n : never;\n};\n\n// TODO remember to update RamCalculations.js and WorkerScript.js\n\n// RAM costs for Netscript functions\nexport const RamCostConstants: IMap = {\n ScriptBaseRamCost: 1.6,\n ScriptDomRamCost: 25,\n ScriptCorporationRamCost: 1024 - 1.6,\n ScriptHackRamCost: 0.1,\n ScriptHackAnalyzeRamCost: 1,\n ScriptGrowRamCost: 0.15,\n ScriptGrowthAnalyzeRamCost: 1,\n ScriptWeakenRamCost: 0.15,\n ScriptWeakenAnalyzeRamCost: 1,\n ScriptScanRamCost: 0.2,\n ScriptRecentScriptsRamCost: 0.2,\n ScriptPortProgramRamCost: 0.05,\n ScriptRunRamCost: 1.0,\n ScriptExecRamCost: 1.3,\n ScriptSpawnRamCost: 2.0,\n ScriptScpRamCost: 0.6,\n ScriptKillRamCost: 0.5,\n ScriptHasRootAccessRamCost: 0.05,\n ScriptGetHostnameRamCost: 0.05,\n ScriptGetHackingLevelRamCost: 0.05,\n ScriptGetMultipliersRamCost: 4.0,\n ScriptGetServerRamCost: 0.1,\n ScriptGetServerMaxRam: 0.05,\n ScriptGetServerUsedRam: 0.05,\n ScriptFileExistsRamCost: 0.1,\n ScriptIsRunningRamCost: 0.1,\n ScriptHacknetNodesRamCost: 4.0,\n ScriptHNUpgLevelRamCost: 0.4,\n ScriptHNUpgRamRamCost: 0.6,\n ScriptHNUpgCoreRamCost: 0.8,\n ScriptGetStockRamCost: 2.0,\n ScriptBuySellStockRamCost: 2.5,\n ScriptGetPurchaseServerRamCost: 0.25,\n ScriptPurchaseServerRamCost: 2.25,\n ScriptGetPurchasedServerLimit: 0.05,\n ScriptGetPurchasedServerMaxRam: 0.05,\n ScriptRoundRamCost: 0.05,\n ScriptReadWriteRamCost: 1.0,\n ScriptArbScriptRamCost: 1.0,\n ScriptGetScriptRamCost: 0.1,\n ScriptGetRunningScriptRamCost: 0.3,\n ScriptGetHackTimeRamCost: 0.05,\n ScriptGetFavorToDonate: 0.1,\n ScriptCodingContractBaseRamCost: 10,\n ScriptSleeveBaseRamCost: 4,\n ScriptClearTerminalCost: 0.2,\n\n ScriptSingularityFn1RamCost: 2,\n ScriptSingularityFn2RamCost: 3,\n ScriptSingularityFn3RamCost: 5,\n\n ScriptGangApiBaseRamCost: 4,\n\n ScriptBladeburnerApiBaseRamCost: 4,\n\n ScriptStanekWidth: 0.4,\n ScriptStanekHeight: 0.4,\n ScriptStanekCharge: 0.4,\n ScriptStanekFragmentDefinitions: 0,\n ScriptStanekPlacedFragments: 5,\n ScriptStanekClear: 0,\n ScriptStanekCanPlace: 0.5,\n ScriptStanekPlace: 5,\n ScriptStanekFragmentAt: 2,\n ScriptStanekDeleteAt: 0.15,\n ScriptInfiltrationCalculateDifficulty: 2.5,\n ScriptInfiltrationCalculateRewards: 2.5,\n ScriptInfiltrationGetLocations: 5,\n ScriptInfiltrationGetInfiltrations: 15,\n ScriptStanekAcceptGift: 2,\n};\n\nfunction SF4Cost(cost: number): (player: IPlayer) => number {\n return (player: IPlayer): number => {\n if (player.bitNodeN === 4) return cost;\n const sf4 = player.sourceFileLvl(4);\n if (sf4 <= 1) return cost * 16;\n if (sf4 === 2) return cost * 4;\n return cost;\n };\n}\n\n// Hacknet API\nconst hacknet = {\n numNodes: 0,\n purchaseNode: 0,\n getPurchaseNodeCost: 0,\n getNodeStats: 0,\n upgradeLevel: 0,\n upgradeRam: 0,\n upgradeCore: 0,\n upgradeCache: 0,\n getLevelUpgradeCost: 0,\n getRamUpgradeCost: 0,\n getCoreUpgradeCost: 0,\n getCacheUpgradeCost: 0,\n numHashes: 0,\n hashCost: 0,\n spendHashes: 0,\n maxNumNodes: 0,\n hashCapacity: 0,\n getHashUpgrades: 0,\n getHashUpgradeLevel: 0,\n getStudyMult: 0,\n getTrainingMult: 0,\n};\n\n// Stock API\nconst stock = {\n hasWSEAccount: 0.05,\n hasTIXAPIAccess: 0.05,\n has4SData: 0.05,\n has4SDataTIXAPI: 0.05,\n getSymbols: RamCostConstants.ScriptGetStockRamCost,\n getPrice: RamCostConstants.ScriptGetStockRamCost,\n getAskPrice: RamCostConstants.ScriptGetStockRamCost,\n getBidPrice: RamCostConstants.ScriptGetStockRamCost,\n getPosition: RamCostConstants.ScriptGetStockRamCost,\n getMaxShares: RamCostConstants.ScriptGetStockRamCost,\n getPurchaseCost: RamCostConstants.ScriptGetStockRamCost,\n getSaleGain: RamCostConstants.ScriptGetStockRamCost,\n buyStock: RamCostConstants.ScriptBuySellStockRamCost,\n sellStock: RamCostConstants.ScriptBuySellStockRamCost,\n buyShort: RamCostConstants.ScriptBuySellStockRamCost,\n sellShort: RamCostConstants.ScriptBuySellStockRamCost,\n placeOrder: RamCostConstants.ScriptBuySellStockRamCost,\n cancelOrder: RamCostConstants.ScriptBuySellStockRamCost,\n getOrders: RamCostConstants.ScriptBuySellStockRamCost,\n getVolatility: RamCostConstants.ScriptBuySellStockRamCost,\n getForecast: RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketData: RamCostConstants.ScriptBuySellStockRamCost,\n purchase4SMarketDataTixApi: RamCostConstants.ScriptBuySellStockRamCost,\n purchaseWseAccount: RamCostConstants.ScriptBuySellStockRamCost,\n purchaseTixApi: RamCostConstants.ScriptBuySellStockRamCost,\n};\n\n// Singularity API\nconst singularity = {\n universityCourse: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n gymWorkout: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n travelToCity: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n goToLocation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n purchaseTor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n purchaseProgram: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n getCurrentServer: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n connect: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n manualHack: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n installBackdoor: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost),\n getDarkwebProgramCost: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n getDarkwebPrograms: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n hospitalize: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n isBusy: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 4),\n stopAction: SF4Cost(RamCostConstants.ScriptSingularityFn1RamCost / 2),\n upgradeHomeRam: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n upgradeHomeCores: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getUpgradeHomeRamCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),\n getUpgradeHomeCoresCost: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 2),\n workForCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n applyToCompany: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n quitJob: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getCompanyRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getCompanyFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getCompanyFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),\n checkFactionInvitations: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n joinFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n workForFaction: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost),\n getFactionRep: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getFactionFavor: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 3),\n getFactionFavorGain: SF4Cost(RamCostConstants.ScriptSingularityFn2RamCost / 4),\n donateToFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n createProgram: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n commitCrime: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getCrimeChance: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getCrimeStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getOwnedAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getOwnedSourceFiles: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationsFromFaction: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationCost: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrereq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n getAugmentationPrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationBasePrice: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationRepReq: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost / 2),\n getAugmentationStats: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n purchaseAugmentation: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n softReset: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n installAugmentations: SF4Cost(RamCostConstants.ScriptSingularityFn3RamCost),\n isFocused: SF4Cost(0.1),\n setFocus: SF4Cost(0.1),\n b1tflum3: SF4Cost(16),\n destroyW0r1dD43m0n: SF4Cost(32),\n getCurrentWork: SF4Cost(0.5),\n};\n\n// Gang API\nconst gang = {\n createGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n inGang: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getMemberNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getOtherGangInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getMemberInformation: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n canRecruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n recruitMember: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getTaskNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getTaskStats: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n setMemberTask: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentNames: RamCostConstants.ScriptGangApiBaseRamCost / 4,\n getEquipmentCost: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentType: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getEquipmentStats: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n purchaseEquipment: RamCostConstants.ScriptGangApiBaseRamCost,\n ascendMember: RamCostConstants.ScriptGangApiBaseRamCost,\n getAscensionResult: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n setTerritoryWarfare: RamCostConstants.ScriptGangApiBaseRamCost / 2,\n getChanceToWinClash: RamCostConstants.ScriptGangApiBaseRamCost,\n getBonusTime: 0,\n};\n\n// Bladeburner API\nconst bladeburner = {\n getContractNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getOperationNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getBlackOpRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getGeneralActionNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n getSkillNames: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 10,\n startAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n stopBladeburnerAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 2,\n getCurrentAction: RamCostConstants.ScriptBladeburnerApiBaseRamCost / 4,\n getActionTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCurrentTime: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionEstimatedSuccessChance: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionRepGain: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCountRemaining: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionMaxLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionCurrentLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionAutolevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setActionLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getRank: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillPoints: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillLevel: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getSkillUpgradeCost: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n upgradeSkill: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n setTeamSize: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityEstimatedPopulation: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityCommunities: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCityChaos: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n switchCity: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getStamina: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerFaction: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n joinBladeburnerDivision: RamCostConstants.ScriptBladeburnerApiBaseRamCost,\n getBonusTime: 0,\n};\n\nconst infiltration = {\n getPossibleLocations: RamCostConstants.ScriptInfiltrationGetLocations,\n getInfiltration: RamCostConstants.ScriptInfiltrationGetInfiltrations,\n};\n\n// Coding Contract API\nconst codingcontract = {\n attempt: RamCostConstants.ScriptCodingContractBaseRamCost,\n getContractType: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getData: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getDescription: RamCostConstants.ScriptCodingContractBaseRamCost / 2,\n getNumTriesRemaining: RamCostConstants.ScriptCodingContractBaseRamCost / 5,\n};\n\n// Duplicate Sleeve API\nconst sleeve = {\n getNumSleeves: RamCostConstants.ScriptSleeveBaseRamCost,\n setToShockRecovery: RamCostConstants.ScriptSleeveBaseRamCost,\n setToSynchronize: RamCostConstants.ScriptSleeveBaseRamCost,\n setToCommitCrime: RamCostConstants.ScriptSleeveBaseRamCost,\n setToUniversityCourse: RamCostConstants.ScriptSleeveBaseRamCost,\n travel: RamCostConstants.ScriptSleeveBaseRamCost,\n setToCompanyWork: RamCostConstants.ScriptSleeveBaseRamCost,\n setToFactionWork: RamCostConstants.ScriptSleeveBaseRamCost,\n setToGymWorkout: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveStats: RamCostConstants.ScriptSleeveBaseRamCost,\n getTask: RamCostConstants.ScriptSleeveBaseRamCost,\n getInformation: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentations: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleevePurchasableAugs: RamCostConstants.ScriptSleeveBaseRamCost,\n purchaseSleeveAug: RamCostConstants.ScriptSleeveBaseRamCost,\n setToBladeburnerAction: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentationPrice: RamCostConstants.ScriptSleeveBaseRamCost,\n getSleeveAugmentationRepReq: RamCostConstants.ScriptSleeveBaseRamCost,\n};\n\n// Stanek API\nconst stanek = {\n giftWidth: RamCostConstants.ScriptStanekWidth,\n giftHeight: RamCostConstants.ScriptStanekHeight,\n chargeFragment: RamCostConstants.ScriptStanekCharge,\n fragmentDefinitions: RamCostConstants.ScriptStanekFragmentDefinitions,\n activeFragments: RamCostConstants.ScriptStanekPlacedFragments,\n clearGift: RamCostConstants.ScriptStanekClear,\n canPlaceFragment: RamCostConstants.ScriptStanekCanPlace,\n placeFragment: RamCostConstants.ScriptStanekPlace,\n getFragment: RamCostConstants.ScriptStanekFragmentAt,\n removeFragment: RamCostConstants.ScriptStanekDeleteAt,\n acceptGift: RamCostConstants.ScriptStanekAcceptGift,\n};\n\n// UI API\nconst ui = {\n getTheme: 0,\n setTheme: 0,\n resetTheme: 0,\n getStyles: 0,\n setStyles: 0,\n resetStyles: 0,\n getGameInfo: 0,\n clearTerminal: 0,\n windowSize: 0,\n};\n\n// Grafting API\nconst grafting = {\n getAugmentationGraftPrice: 3.75,\n getAugmentationGraftTime: 3.75,\n getGraftableAugmentations: 5,\n graftAugmentation: 7.5,\n};\n\nconst corporation = {\n getMaterialNames: 0,\n getIndustryTypes: 0,\n getUnlockables: 0,\n getUpgradeNames: 0,\n getResearchNames: 0,\n createCorporation: 0,\n hasUnlockUpgrade: 0,\n getUnlockUpgradeCost: 0,\n getUpgradeLevel: 0,\n getUpgradeLevelCost: 0,\n getExpandIndustryCost: 0,\n getExpandCityCost: 0,\n getInvestmentOffer: 0,\n acceptInvestmentOffer: 0,\n goPublic: 0,\n bribe: 0,\n getCorporation: 0,\n getDivision: 0,\n expandIndustry: 0,\n expandCity: 0,\n unlockUpgrade: 0,\n levelUpgrade: 0,\n issueDividends: 0,\n buyBackShares: 0,\n sellShares: 0,\n getBonusTime: 0,\n sellMaterial: 0,\n sellProduct: 0,\n discontinueProduct: 0,\n setSmartSupply: 0,\n setSmartSupplyUseLeftovers: 0,\n buyMaterial: 0,\n bulkPurchase: 0,\n getWarehouse: 0,\n getProduct: 0,\n getMaterial: 0,\n setMaterialMarketTA1: 0,\n setMaterialMarketTA2: 0,\n setProductMarketTA1: 0,\n setProductMarketTA2: 0,\n exportMaterial: 0,\n cancelExportMaterial: 0,\n purchaseWarehouse: 0,\n upgradeWarehouse: 0,\n makeProduct: 0,\n limitMaterialProduction: 0,\n limitProductProduction: 0,\n getPurchaseWarehouseCost: 0,\n getUpgradeWarehouseCost: 0,\n hasWarehouse: 0,\n assignJob: 0,\n hireEmployee: 0,\n upgradeOfficeSize: 0,\n throwParty: 0,\n buyCoffee: 0,\n hireAdVert: 0,\n research: 0,\n getOffice: 0,\n getEmployee: 0,\n getHireAdVertCost: 0,\n getHireAdVertCount: 0,\n getResearchCost: 0,\n hasResearched: 0,\n setAutoJobAssignment: 0,\n getOfficeSizeUpgradeCost: 0,\n};\n\nconst SourceRamCosts = {\n args: undefined as unknown as never[], // special use case\n enums: undefined as unknown as never,\n corporation,\n hacknet,\n stock,\n singularity,\n ...singularity, // singularity is in namespace & toplevel\n gang,\n bladeburner,\n infiltration,\n codingcontract,\n sleeve,\n stanek,\n ui,\n grafting,\n\n sprintf: 0,\n vsprintf: 0,\n scan: RamCostConstants.ScriptScanRamCost,\n hack: RamCostConstants.ScriptHackRamCost,\n hackAnalyzeThreads: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyze: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyzeSecurity: RamCostConstants.ScriptHackAnalyzeRamCost,\n hackAnalyzeChance: RamCostConstants.ScriptHackAnalyzeRamCost,\n sleep: 0,\n asleep: 0,\n share: 2.4,\n getSharePower: 0.2,\n grow: RamCostConstants.ScriptGrowRamCost,\n growthAnalyze: RamCostConstants.ScriptGrowthAnalyzeRamCost,\n growthAnalyzeSecurity: RamCostConstants.ScriptGrowthAnalyzeRamCost,\n weaken: RamCostConstants.ScriptWeakenRamCost,\n weakenAnalyze: RamCostConstants.ScriptWeakenAnalyzeRamCost,\n print: 0,\n printf: 0,\n tprint: 0,\n tprintf: 0,\n clearLog: 0,\n disableLog: 0,\n enableLog: 0,\n isLogEnabled: 0,\n getScriptLogs: 0,\n nuke: RamCostConstants.ScriptPortProgramRamCost,\n brutessh: RamCostConstants.ScriptPortProgramRamCost,\n ftpcrack: RamCostConstants.ScriptPortProgramRamCost,\n relaysmtp: RamCostConstants.ScriptPortProgramRamCost,\n httpworm: RamCostConstants.ScriptPortProgramRamCost,\n sqlinject: RamCostConstants.ScriptPortProgramRamCost,\n run: RamCostConstants.ScriptRunRamCost,\n exec: RamCostConstants.ScriptExecRamCost,\n spawn: RamCostConstants.ScriptSpawnRamCost,\n kill: RamCostConstants.ScriptKillRamCost,\n killall: RamCostConstants.ScriptKillRamCost,\n exit: 0,\n atExit: 0,\n scp: RamCostConstants.ScriptScpRamCost,\n ls: RamCostConstants.ScriptScanRamCost,\n ps: RamCostConstants.ScriptScanRamCost,\n getRecentScripts: RamCostConstants.ScriptRecentScriptsRamCost,\n hasRootAccess: RamCostConstants.ScriptHasRootAccessRamCost,\n getHostname: RamCostConstants.ScriptGetHostnameRamCost,\n getHackingLevel: RamCostConstants.ScriptGetHackingLevelRamCost,\n getHackingMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getHacknetMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getBitNodeMultipliers: RamCostConstants.ScriptGetMultipliersRamCost,\n getServer: RamCostConstants.ScriptGetMultipliersRamCost / 2,\n getServerMoneyAvailable: RamCostConstants.ScriptGetServerRamCost,\n getServerSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerBaseSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerMinSecurityLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerRequiredHackingLevel: RamCostConstants.ScriptGetServerRamCost,\n getServerMaxMoney: RamCostConstants.ScriptGetServerRamCost,\n getServerGrowth: RamCostConstants.ScriptGetServerRamCost,\n getServerNumPortsRequired: RamCostConstants.ScriptGetServerRamCost,\n getServerRam: RamCostConstants.ScriptGetServerRamCost,\n getServerMaxRam: RamCostConstants.ScriptGetServerMaxRam,\n getServerUsedRam: RamCostConstants.ScriptGetServerUsedRam,\n serverExists: RamCostConstants.ScriptGetServerRamCost,\n fileExists: RamCostConstants.ScriptFileExistsRamCost,\n isRunning: RamCostConstants.ScriptIsRunningRamCost,\n getPurchasedServerLimit: RamCostConstants.ScriptGetPurchasedServerLimit,\n getPurchasedServerMaxRam: RamCostConstants.ScriptGetPurchasedServerMaxRam,\n getPurchasedServerCost: RamCostConstants.ScriptGetPurchaseServerRamCost,\n purchaseServer: RamCostConstants.ScriptPurchaseServerRamCost,\n deleteServer: RamCostConstants.ScriptPurchaseServerRamCost,\n getPurchasedServers: RamCostConstants.ScriptPurchaseServerRamCost,\n write: 0,\n tryWritePort: 0,\n read: 0,\n peek: 0,\n clear: 0,\n writePort: 0,\n readPort: 0,\n getPortHandle: 0,\n rm: RamCostConstants.ScriptReadWriteRamCost,\n scriptRunning: RamCostConstants.ScriptArbScriptRamCost,\n scriptKill: RamCostConstants.ScriptArbScriptRamCost,\n getScriptName: 0,\n getScriptRam: RamCostConstants.ScriptGetScriptRamCost,\n getHackTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getGrowTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getWeakenTime: RamCostConstants.ScriptGetHackTimeRamCost,\n getTotalScriptIncome: RamCostConstants.ScriptGetScriptRamCost,\n getScriptIncome: RamCostConstants.ScriptGetScriptRamCost,\n getTotalScriptExpGain: RamCostConstants.ScriptGetScriptRamCost,\n getScriptExpGain: RamCostConstants.ScriptGetScriptRamCost,\n getRunningScript: RamCostConstants.ScriptGetRunningScriptRamCost,\n nFormat: 0,\n tFormat: 0,\n getTimeSinceLastAug: RamCostConstants.ScriptGetHackTimeRamCost,\n prompt: 0,\n wget: 0,\n getFavorToDonate: RamCostConstants.ScriptGetFavorToDonate,\n getPlayer: RamCostConstants.ScriptSingularityFn1RamCost / 4,\n mv: 0,\n tail: 0,\n toast: 0,\n moveTail: 0,\n resizeTail: 0,\n closeTail: 0,\n clearPort: 0,\n openDevMenu: 0,\n alert: 0,\n flags: 0,\n exploit: 0,\n bypass: 0,\n alterReality: 0,\n rainbow: 0,\n heart: {\n // Easter egg function\n break: 0,\n },\n\n formulas: {\n mockServer: 0,\n mockPlayer: 0,\n reputation: {\n calculateFavorToRep: 0,\n calculateRepToFavor: 0,\n repFromDonation: 0,\n },\n skills: {\n calculateSkill: 0,\n calculateExp: 0,\n },\n hacking: {\n hackChance: 0,\n hackExp: 0,\n hackPercent: 0,\n growPercent: 0,\n hackTime: 0,\n growTime: 0,\n weakenTime: 0,\n },\n hacknetNodes: {\n moneyGainRate: 0,\n levelUpgradeCost: 0,\n ramUpgradeCost: 0,\n coreUpgradeCost: 0,\n hacknetNodeCost: 0,\n constants: 0,\n },\n hacknetServers: {\n hashGainRate: 0,\n levelUpgradeCost: 0,\n ramUpgradeCost: 0,\n coreUpgradeCost: 0,\n cacheUpgradeCost: 0,\n hashUpgradeCost: 0,\n hacknetServerCost: 0,\n constants: 0,\n },\n gang: {\n wantedPenalty: 0,\n respectGain: 0,\n wantedLevelGain: 0,\n moneyGain: 0,\n ascensionPointsGain: 0,\n ascensionMultiplier: 0,\n },\n work: {\n crimeGains: 0,\n classGains: 0,\n factionGains: 0,\n },\n },\n};\n\nexport const RamCosts: IMap = SourceRamCosts;\n\n// This line in particular is there so typescript typechecks that we are not missing any static ram cost.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst _typecheck: RamCostTree = SourceRamCosts;\n\nexport function getRamCost(player: IPlayer, ...args: string[]): number {\n if (args.length === 0) {\n console.warn(`No arguments passed to getRamCost()`);\n return 0;\n }\n\n let curr = RamCosts[args[0]];\n for (let i = 1; i < args.length; ++i) {\n if (curr == null) {\n console.warn(`Invalid function passed to getRamCost: ${args}`);\n return 0;\n }\n\n const currType = typeof curr;\n if (currType === \"function\" || currType === \"number\") {\n break;\n }\n\n curr = curr[args[i]];\n }\n\n if (typeof curr === \"number\") {\n return curr;\n }\n\n if (typeof curr === \"function\") {\n return curr(player);\n }\n\n console.warn(`Unexpected type (${curr}) for value [${args}]`);\n return 0;\n}\n","import { Skill } from \"./Skill\";\nimport { SkillNames } from \"./data/SkillNames\";\nimport { IMap } from \"../types\";\n\nexport const Skills: IMap = {};\n\n(function () {\n Skills[SkillNames.BladesIntuition] = new Skill({\n name: SkillNames.BladesIntuition,\n desc: \"Each level of this skill increases your success chance for all Contracts, Operations, and BlackOps by 3%\",\n baseCost: 3,\n costInc: 2.1,\n successChanceAll: 3,\n });\n Skills[SkillNames.Cloak] = new Skill({\n name: SkillNames.Cloak,\n desc:\n \"Each level of this skill increases your \" +\n \"success chance in stealth-related Contracts, Operations, and BlackOps by 5.5%\",\n baseCost: 2,\n costInc: 1.1,\n successChanceStealth: 5.5,\n });\n Skills[SkillNames.ShortCircuit] = new Skill({\n name: SkillNames.ShortCircuit,\n desc:\n \"Each level of this skill increases your success chance \" +\n \"in Contracts, Operations, and BlackOps that involve retirement by 5.5%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceKill: 5.5,\n });\n Skills[SkillNames.DigitalObserver] = new Skill({\n name: SkillNames.DigitalObserver,\n desc: \"Each level of this skill increases your success chance in all Operations and BlackOps by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceOperation: 4,\n });\n Skills[SkillNames.Tracer] = new Skill({\n name: SkillNames.Tracer,\n desc: \"Each level of this skill increases your success chance in all Contracts by 4%\",\n baseCost: 2,\n costInc: 2.1,\n successChanceContract: 4,\n });\n Skills[SkillNames.Overclock] = new Skill({\n name: SkillNames.Overclock,\n desc:\n \"Each level of this skill decreases the time it takes \" +\n \"to attempt a Contract, Operation, and BlackOp by 1% (Max Level: 90)\",\n baseCost: 3,\n costInc: 1.4,\n maxLvl: 90,\n actionTime: 1,\n });\n Skills[SkillNames.Reaper] = new Skill({\n name: SkillNames.Reaper,\n desc: \"Each level of this skill increases your effective combat stats for Bladeburner actions by 2%\",\n baseCost: 2,\n costInc: 2.1,\n effStr: 2,\n effDef: 2,\n effDex: 2,\n effAgi: 2,\n });\n Skills[SkillNames.EvasiveSystem] = new Skill({\n name: SkillNames.EvasiveSystem,\n desc: \"Each level of this skill increases your effective dexterity and agility for Bladeburner actions by 4%\",\n baseCost: 2,\n costInc: 2.1,\n effDex: 4,\n effAgi: 4,\n });\n Skills[SkillNames.Datamancer] = new Skill({\n name: SkillNames.Datamancer,\n desc:\n \"Each level of this skill increases your effectiveness in \" +\n \"synthoid population analysis and investigation by 5%. \" +\n \"This affects all actions that can potentially increase \" +\n \"the accuracy of your synthoid population/community estimates.\",\n baseCost: 3,\n costInc: 1,\n successChanceEstimate: 5,\n });\n Skills[SkillNames.CybersEdge] = new Skill({\n name: SkillNames.CybersEdge,\n desc: \"Each level of this skill increases your max stamina by 2%\",\n baseCost: 1,\n costInc: 3,\n stamina: 2,\n });\n Skills[SkillNames.HandsOfMidas] = new Skill({\n name: SkillNames.HandsOfMidas,\n desc: \"Each level of this skill increases the amount of money you receive from Contracts by 10%\",\n baseCost: 2,\n costInc: 2.5,\n money: 10,\n });\n Skills[SkillNames.Hyperdrive] = new Skill({\n name: SkillNames.Hyperdrive,\n desc: \"Each level of this skill increases the experience earned from Contracts, Operations, and BlackOps by 10%\",\n baseCost: 1,\n costInc: 2.5,\n expGain: 10,\n });\n})();\n","/**\n * Stock Market Helper Functions\n */\nimport { Stock } from \"./Stock\";\nimport { PositionTypes } from \"./data/PositionTypes\";\nimport { CONSTANTS } from \"../Constants\";\n\n// Amount by which a stock's forecast changes during each price movement\nexport const forecastChangePerPriceMovement = 0.006;\n\n/**\n * Calculate the total cost of a \"buy\" transaction. This accounts for spread and commission.\n * @param {Stock} stock - Stock being purchased\n * @param {number} shares - Number of shares being transacted\n * @param {PositionTypes} posType - Long or short position\n * @returns {number | null} Total transaction cost. Returns null for an invalid transaction\n */\nexport function getBuyTransactionCost(stock: Stock, shares: number, posType: PositionTypes): number | null {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return null;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n const isLong = posType === PositionTypes.Long;\n\n // If the number of shares doesn't trigger a price movement, its a simple calculation\n if (isLong) {\n return shares * stock.getAskPrice() + CONSTANTS.StockMarketCommission;\n } else {\n return shares * stock.getBidPrice() + CONSTANTS.StockMarketCommission;\n }\n}\n\n/**\n * Calculate the TOTAL amount of money gained from a sale (NOT net profit). This accounts\n * for spread and commission.\n * @param {Stock} stock - Stock being sold\n * @param {number} shares - Number of sharse being transacted\n * @param {PositionTypes} posType - Long or short position\n * @returns {number | null} Amount of money gained from transaction. Returns null for an invalid transaction\n */\nexport function getSellTransactionGain(stock: Stock, shares: number, posType: PositionTypes): number | null {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return null;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n const isLong = posType === PositionTypes.Long;\n if (isLong) {\n return shares * stock.getBidPrice() - CONSTANTS.StockMarketCommission;\n } else {\n // Calculating gains for a short position requires calculating the profit made\n const origCost = shares * stock.playerAvgShortPx;\n const profit = (stock.playerAvgShortPx - stock.getAskPrice()) * shares - CONSTANTS.StockMarketCommission;\n\n return origCost + profit;\n }\n}\n\n/**\n * Processes a stock's change in forecast & second-order forecast\n * whenever it is transacted\n * @param {Stock} stock - Stock being sold\n * @param {number} shares - Number of sharse being transacted\n * @param {PositionTypes} posType - Long or short position\n */\nexport function processTransactionForecastMovement(stock: Stock, shares: number): void {\n if (isNaN(shares) || shares <= 0 || !(stock instanceof Stock)) {\n return;\n }\n\n // Cap the 'shares' arg at the stock's maximum shares. This'll prevent\n // hanging in the case when a really big number is passed in\n shares = Math.min(shares, stock.maxShares);\n\n // If there's only going to be one iteration at most\n const firstShares = stock.shareTxUntilMovement;\n if (shares <= firstShares) {\n stock.shareTxUntilMovement -= shares;\n if (stock.shareTxUntilMovement <= 0) {\n stock.shareTxUntilMovement = stock.shareTxForMovement;\n stock.influenceForecast(forecastChangePerPriceMovement);\n stock.influenceForecastForecast(forecastChangePerPriceMovement * (stock.mv / 100));\n }\n\n return;\n }\n\n // Calculate how many iterations of price changes we need to account for\n const remainingShares = shares - firstShares;\n let numIterations = 1 + Math.ceil(remainingShares / stock.shareTxForMovement);\n\n // If on the offchance we end up perfectly at the next price movement\n stock.shareTxUntilMovement =\n stock.shareTxForMovement - ((shares - stock.shareTxUntilMovement) % stock.shareTxForMovement);\n if (stock.shareTxUntilMovement === stock.shareTxForMovement || stock.shareTxUntilMovement <= 0) {\n ++numIterations;\n stock.shareTxUntilMovement = stock.shareTxForMovement;\n }\n\n // Forecast always decreases in magnitude\n const forecastChange = forecastChangePerPriceMovement * (numIterations - 1);\n const forecastForecastChange = forecastChange * (stock.mv / 100);\n stock.influenceForecast(forecastChange);\n stock.influenceForecastForecast(forecastForecastChange);\n}\n\n/**\n * Calculate the maximum number of shares of a stock that can be purchased.\n * Handles mid-transaction price movements, both L and S positions, etc.\n * Used for the \"Buy Max\" button in the UI\n * @param {Stock} stock - Stock being purchased\n * @param {PositionTypes} posType - Long or short position\n * @param {number} money - Amount of money player has\n * @returns maximum number of shares that the player can purchase\n */\nexport function calculateBuyMaxAmount(stock: Stock, posType: PositionTypes, money: number): number {\n if (!(stock instanceof Stock)) {\n return 0;\n }\n\n const isLong = posType === PositionTypes.Long;\n\n const remainingMoney = money - CONSTANTS.StockMarketCommission;\n const currPrice = isLong ? stock.getAskPrice() : stock.getBidPrice();\n\n return Math.floor(remainingMoney / currPrice);\n}\n","import { gangMemberUpgradesMetadata } from \"./data/upgrades\";\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\n\nexport const GangMemberUpgrades: {\n [key: string]: GangMemberUpgrade;\n} = {};\n\n(function () {\n gangMemberUpgradesMetadata.forEach((e) => {\n GangMemberUpgrades[e.name] = new GangMemberUpgrade(e.name, e.cost, e.upgType, e.mults);\n });\n})();\n","import { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../Constants\";\n\nexport function getStockMarket4SDataCost(): number {\n return CONSTANTS.MarketData4SCost * BitNodeMultipliers.FourSigmaMarketDataCost;\n}\n\nexport function getStockMarket4STixApiCost(): number {\n return CONSTANTS.MarketDataTixApi4SCost * BitNodeMultipliers.FourSigmaMarketDataApiCost;\n}\n\nexport function getStockMarketWseCost(): number {\n return CONSTANTS.WSEAccountCost;\n}\n\nexport function getStockMarketTixApiCost(): number {\n return CONSTANTS.TIXAPICost;\n}\n","import { TextField, StandardTextFieldProps } from \"@mui/material\";\nimport React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\n\ninterface IProps extends Omit {\n onChange: (v: number) => void;\n}\n\nexport function NumberInput(props: IProps): React.ReactElement {\n const textProps = {\n ...props,\n onChange: (event: React.ChangeEvent) => {\n const amt = numeralWrapper.parseMoney(event.target.value);\n if (event.target.value === \"\" || isNaN(amt)) props.onChange(NaN);\n else props.onChange(amt);\n },\n };\n return ;\n}\n","/**\n * Map of all Hash Upgrades\n * Key = Hash name, Value = HashUpgrade object\n */\nimport { HashUpgrade, IConstructorParams } from \"./HashUpgrade\";\nimport { HashUpgradesMetadata } from \"./data/HashUpgradesMetadata\";\nimport { IMap } from \"../types\";\n\nexport const HashUpgrades: IMap = {};\n\nfunction createHashUpgrade(p: IConstructorParams): void {\n HashUpgrades[p.name] = new HashUpgrade(p);\n}\n\nfor (const metadata of HashUpgradesMetadata) {\n createHashUpgrade(metadata);\n}\n","import { gangMemberTasksMetadata } from \"./data/tasks\";\nimport { GangMemberTask } from \"./GangMemberTask\";\n\nexport const GangMemberTasks: {\n [key: string]: GangMemberTask;\n} = {};\n\n(function () {\n gangMemberTasksMetadata.forEach((e) => {\n GangMemberTasks[e.name] = new GangMemberTask(e.name, e.desc, e.isHacking, e.isCombat, e.params);\n });\n})();\n","import { Material } from \"./Material\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { IMap } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\n\ninterface IConstructorParams {\n corp?: ICorporation;\n industry?: IIndustry;\n loc?: string;\n size?: number;\n}\n\nexport class Warehouse {\n // Warehouse's level, which affects its maximum size\n level = 1;\n\n // City that this Warehouse is in\n loc: string;\n\n // Map of Materials held by this Warehouse\n materials: IMap;\n\n // Maximum amount warehouse can hold\n size: number;\n\n // Amount of space currently used by warehouse\n sizeUsed = 0;\n\n // Whether Smart Supply is enabled for this Industry (the Industry that this Warehouse is for)\n smartSupplyEnabled = false;\n\n // Decide if smart supply should use the materials already in the warehouse when deciding on the amount to buy.\n smartSupplyUseLeftovers: { [key: string]: boolean | undefined } = {};\n\n // Stores the amount of product to be produced. Used for Smart Supply unlock.\n // The production tracked by smart supply is always based on the previous cycle,\n // so it will always trail the \"true\" production by 1 cycle\n smartSupplyStore = 0;\n\n constructor(params: IConstructorParams = {}) {\n this.loc = params.loc ? params.loc : \"\";\n this.size = params.size ? params.size : 0;\n\n this.materials = {\n Water: new Material({ name: \"Water\" }),\n Energy: new Material({ name: \"Energy\" }),\n Food: new Material({ name: \"Food\" }),\n Plants: new Material({ name: \"Plants\" }),\n Metal: new Material({ name: \"Metal\" }),\n Hardware: new Material({ name: \"Hardware\" }),\n Chemicals: new Material({ name: \"Chemicals\" }),\n Drugs: new Material({ name: \"Drugs\" }),\n Robots: new Material({ name: \"Robots\" }),\n AICores: new Material({ name: \"AI Cores\" }),\n RealEstate: new Material({ name: \"Real Estate\" }),\n };\n\n this.smartSupplyUseLeftovers = {\n Water: true,\n Energy: true,\n Food: true,\n Plants: true,\n Metal: true,\n Hardware: true,\n Chemicals: true,\n Drugs: true,\n Robots: true,\n AICores: true,\n RealEstate: true,\n };\n\n if (params.corp && params.industry) {\n this.updateSize(params.corp, params.industry);\n }\n\n // Default smart supply to being enabled if the upgrade is unlocked\n if (params.corp?.unlockUpgrades[1]) {\n this.smartSupplyEnabled = true;\n }\n }\n\n // Re-calculate how much space is being used by this Warehouse\n updateMaterialSizeUsed(): void {\n this.sizeUsed = 0;\n for (const matName of Object.keys(this.materials)) {\n const mat = this.materials[matName];\n if (MaterialSizes.hasOwnProperty(matName)) {\n this.sizeUsed += mat.qty * MaterialSizes[matName];\n }\n }\n if (this.sizeUsed > this.size) {\n console.warn(\"Warehouse size used greater than capacity, something went wrong\");\n }\n }\n\n updateSize(corporation: ICorporation, industry: IIndustry): void {\n try {\n this.size = this.level * 100 * corporation.getStorageMultiplier() * industry.getStorageMultiplier();\n } catch (e: unknown) {\n exceptionAlert(e);\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Warehouse\", this);\n }\n\n // Initiatizes a Warehouse object from a JSON save state.\n static fromJSON(value: IReviverValue): Warehouse {\n return Generic_fromJSON(Warehouse, value.data);\n }\n}\n\nReviver.constructors.Warehouse = Warehouse;\n","import React from \"react\";\nimport { TextFile } from \"../TextFile\";\nimport { Script } from \"../Script/Script\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"../ui/Router\";\nimport { Settings } from \"../Settings/Settings\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\nexport class Output {\n text: string;\n color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\";\n constructor(text: string, color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\") {\n if (Settings.TimestampsFormat) text = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + text;\n this.text = text;\n this.color = color;\n }\n}\n\nexport class RawOutput {\n raw: React.ReactNode;\n constructor(node: React.ReactNode) {\n if (Settings.TimestampsFormat)\n node = (\n <>\n [{formatTime(Settings.TimestampsFormat)}] {node}\n \n );\n this.raw = node;\n }\n}\n\nexport class Link {\n hostname: string;\n dashes: string;\n constructor(dashes: string, hostname: string) {\n if (Settings.TimestampsFormat) dashes = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + dashes;\n this.hostname = hostname;\n this.dashes = dashes;\n }\n}\n\nexport class TTimer {\n time: number;\n timeLeft: number;\n action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\";\n server?: BaseServer;\n\n constructor(time: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\", server?: BaseServer) {\n this.time = time;\n this.timeLeft = time;\n this.action = action;\n this.server = server;\n }\n}\n\nexport interface ITerminal {\n action: TTimer | null;\n\n commandHistory: string[];\n commandHistoryIndex: number;\n\n outputHistory: (Output | Link | RawOutput)[];\n\n // True if a Coding Contract prompt is opened\n contractOpen: boolean;\n\n // Full Path of current directory\n // Excludes the trailing forward slash\n currDir: string;\n\n print(s: string): void;\n printRaw(node: React.ReactNode): void;\n error(s: string): void;\n success(s: string): void;\n info(s: string): void;\n warn(s: string): void;\n\n clear(): void;\n startAnalyze(player: IPlayer): void;\n startBackdoor(player: IPlayer): void;\n startHack(player: IPlayer): void;\n startGrow(player: IPlayer): void;\n startWeaken(player: IPlayer): void;\n finishHack(router: IRouter, player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishGrow(player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishWeaken(player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishBackdoor(router: IRouter, player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishAnalyze(player: IPlayer, server: BaseServer, cancelled?: boolean): void;\n finishAction(router: IRouter, player: IPlayer, cancelled?: boolean): void;\n getFilepath(filename: string): string;\n getFile(player: IPlayer, filename: string): Script | TextFile | string | null;\n getScript(player: IPlayer, filename: string): Script | null;\n getTextFile(player: IPlayer, filename: string): TextFile | null;\n getLitFile(player: IPlayer, filename: string): string | null;\n cwd(): string;\n setcwd(dir: string): void;\n runContract(player: IPlayer, name: string): void;\n executeScanAnalyzeCommand(player: IPlayer, depth?: number, all?: boolean): void;\n connectToServer(player: IPlayer, server: string): void;\n executeCommand(router: IRouter, player: IPlayer, command: string): void;\n executeCommands(router: IRouter, player: IPlayer, commands: string): void;\n // If there was any changes, will return true, once.\n process(router: IRouter, player: IPlayer, cycles: number): void;\n prestige(): void;\n getProgressText(): string;\n}\n","import { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\ninterface ISkillParams {\n name: string;\n desc: string;\n\n baseCost?: number;\n costInc?: number;\n maxLvl?: number;\n\n successChanceAll?: number;\n successChanceStealth?: number;\n successChanceKill?: number;\n successChanceContract?: number;\n successChanceOperation?: number;\n successChanceEstimate?: number;\n\n actionTime?: number;\n\n effHack?: number;\n effStr?: number;\n effDef?: number;\n effDex?: number;\n effAgi?: number;\n effCha?: number;\n\n stamina?: number;\n money?: number;\n expGain?: number;\n}\n\nexport class Skill {\n name: string;\n desc: string;\n // Cost is in Skill Points\n baseCost = 1;\n // Additive cost increase per level\n costInc = 1;\n maxLvl = 0;\n\n /**\n * These benefits are additive. So total multiplier will be level (handled externally) times the\n * effects below\n */\n successChanceAll = 0;\n successChanceStealth = 0;\n successChanceKill = 0;\n successChanceContract = 0;\n successChanceOperation = 0;\n\n /**\n * This multiplier affects everything that increases synthoid population/community estimate\n * e.g. Field analysis, Investigation Op, Undercover Op\n */\n successChanceEstimate = 0;\n actionTime = 0;\n effHack = 0;\n effStr = 0;\n effDef = 0;\n effDex = 0;\n effAgi = 0;\n effCha = 0;\n stamina = 0;\n money = 0;\n expGain = 0;\n\n constructor(params: ISkillParams = { name: \"foo\", desc: \"foo\" }) {\n if (!params.name) {\n throw new Error(\"Failed to initialize Bladeburner Skill. No name was specified in ctor\");\n }\n if (!params.desc) {\n throw new Error(\"Failed to initialize Bladeburner Skills. No desc was specified in ctor\");\n }\n this.name = params.name;\n this.desc = params.desc;\n this.baseCost = params.baseCost ? params.baseCost : 1;\n this.costInc = params.costInc ? params.costInc : 1;\n\n if (params.maxLvl) {\n this.maxLvl = params.maxLvl;\n }\n\n if (params.successChanceAll) {\n this.successChanceAll = params.successChanceAll;\n }\n if (params.successChanceStealth) {\n this.successChanceStealth = params.successChanceStealth;\n }\n if (params.successChanceKill) {\n this.successChanceKill = params.successChanceKill;\n }\n if (params.successChanceContract) {\n this.successChanceContract = params.successChanceContract;\n }\n if (params.successChanceOperation) {\n this.successChanceOperation = params.successChanceOperation;\n }\n\n if (params.successChanceEstimate) {\n this.successChanceEstimate = params.successChanceEstimate;\n }\n\n if (params.actionTime) {\n this.actionTime = params.actionTime;\n }\n if (params.effHack) {\n this.effHack = params.effHack;\n }\n if (params.effStr) {\n this.effStr = params.effStr;\n }\n if (params.effDef) {\n this.effDef = params.effDef;\n }\n if (params.effDex) {\n this.effDex = params.effDex;\n }\n if (params.effAgi) {\n this.effAgi = params.effAgi;\n }\n if (params.effCha) {\n this.effCha = params.effCha;\n }\n\n if (params.stamina) {\n this.stamina = params.stamina;\n }\n if (params.money) {\n this.money = params.money;\n }\n if (params.expGain) {\n this.expGain = params.expGain;\n }\n }\n\n calculateCost(currentLevel: number, count = 1): number {\n //Recursive mode does not handle invalid inputs properly, but it should never\n //be possible for it to run with them. For the sake of not crashing the game,\n const recursiveMode = (currentLevel: number, count: number): number => {\n if (count <= 1) {\n return Math.floor((this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost);\n } else {\n const thisUpgrade = Math.floor(\n (this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost,\n );\n return this.calculateCost(currentLevel + 1, count - 1) + thisUpgrade;\n }\n };\n\n //Count must be a positive integer.\n if (count < 0 || count % 1 != 0) {\n throw new Error(`${count} is an invalid number of upgrades`);\n }\n //Use recursive mode if count is small\n if (count <= 100) {\n return recursiveMode(currentLevel, count);\n }\n //Use optimized mode if count is large\n else {\n //unFloored is roughly equivalent to\n //(this.baseCost + currentLevel * this.costInc) * BitNodeMultipliers.BladeburnerSkillCost\n //being repeated for increasing currentLevel\n const preMult = (count * (2 * this.baseCost + this.costInc * (2 * currentLevel + count + 1))) / 2;\n const unFloored = preMult * BitNodeMultipliers.BladeburnerSkillCost - count / 2;\n return Math.floor(unFloored);\n }\n }\n\n getMultiplier(name: string): number {\n if (name === \"successChanceAll\") return this.successChanceAll;\n if (name === \"successChanceStealth\") return this.successChanceStealth;\n if (name === \"successChanceKill\") return this.successChanceKill;\n if (name === \"successChanceContract\") return this.successChanceContract;\n if (name === \"successChanceOperation\") return this.successChanceOperation;\n if (name === \"successChanceEstimate\") return this.successChanceEstimate;\n\n if (name === \"actionTime\") return this.actionTime;\n\n if (name === \"effHack\") return this.effHack;\n if (name === \"effStr\") return this.effStr;\n if (name === \"effDef\") return this.effDef;\n if (name === \"effDex\") return this.effDex;\n if (name === \"effAgi\") return this.effAgi;\n if (name === \"effCha\") return this.effCha;\n\n if (name === \"stamina\") return this.stamina;\n if (name === \"money\") return this.money;\n if (name === \"expGain\") return this.expGain;\n return 0;\n }\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n onConfirm: () => void;\n confirmationText: string | React.ReactNode;\n additionalButton?: React.ReactNode;\n}\n\nexport function ConfirmationModal(props: IProps): React.ReactElement {\n return (\n \n <>\n {props.confirmationText}\n {\n props.onConfirm();\n }}\n >\n Confirm\n \n {props.additionalButton && <>{props.additionalButton}}\n \n \n );\n}\n","/**\n * Represents the possible configuration values that can be provided when creating the progress bar text.\n */\ninterface IProgressBarConfiguration {\n /**\n * Current progress, taken as a decimal (i.e. '0.6' to represent '60%')\n */\n progress?: number;\n\n /**\n * Total number of ticks in progress bar. Preferably a factor of 100.\n */\n totalTicks?: number;\n}\n\n/**\n * Represents concrete configuration values when creating the progress bar text.\n */\ninterface IProgressBarConfigurationMaterialized extends IProgressBarConfiguration {\n progress: number;\n totalTicks: number;\n}\n\n/**\n * Creates a graphical \"progress bar\"\n * e.g.: [||||---------------]\n * @param params The configuration parameters for the progress bar\n */\nexport function createProgressBarText(params: IProgressBarConfiguration): string {\n // Default values\n const defaultParams: IProgressBarConfigurationMaterialized = {\n progress: 0,\n totalTicks: 20,\n };\n\n // tslint:disable-next-line:prefer-object-spread\n const derived: IProgressBarConfigurationMaterialized = Object.assign({}, defaultParams, params);\n // Ensure it is 0..1\n derived.progress = Math.max(Math.min(derived.progress, 1), 0);\n\n // This way there is always at least one bar filled in...\n const bars: number = Math.max(Math.floor(derived.progress / (1 / derived.totalTicks)), 1);\n const dashes: number = Math.max(derived.totalTicks - bars, 0);\n\n // String.prototype.repeat isn't completley supported, but good enough for our purposes\n return `[${\"|\".repeat(bars)}${\"-\".repeat(dashes)}]`;\n}\n","export function hash(): string {\n try {\n if (__COMMIT_HASH__) {\n return __COMMIT_HASH__;\n }\n } catch (err) {}\n return \"DEV\";\n}\n","import { Locations } from \"../../Locations/Locations\";\nimport { Location } from \"../../Locations/Location\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Class, Classes, ClassType } from \"../ClassWork\";\nimport { WorkStats } from \"../WorkStats\";\nimport { Server } from \"../../Server/Server\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { IPerson } from \"../../PersonObjects/IPerson\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nconst gameCPS = 1000 / CONSTANTS._idleSpeed; // 5 cycles per second\n\nexport function calculateCost(classs: Class, location: Location): number {\n const serverMeta = serverMetadata.find((s) => s.specialName === location.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n const discount = (server as Server).backdoorInstalled ? 0.9 : 1;\n return classs.earnings.money * location.costMult * discount;\n}\n\nexport function calculateClassEarnings(\n player: IPlayer,\n target: IPerson,\n type: ClassType,\n locationName: LocationName,\n): WorkStats {\n //Find cost and exp gain per game cycle\n const hashManager = player.hashManager;\n const classs = Classes[type];\n const location = Locations[locationName];\n\n const hashMult = [ClassType.GymAgility, ClassType.GymDefense, ClassType.GymStrength, ClassType.GymDexterity].includes(\n type,\n )\n ? hashManager.getTrainingMult()\n : hashManager.getStudyMult();\n\n const cost = calculateCost(classs, location) / gameCPS;\n const hackExp = ((classs.earnings.hackExp * location.expMult) / gameCPS) * hashMult;\n const strExp = ((classs.earnings.strExp * location.expMult) / gameCPS) * hashMult;\n const defExp = ((classs.earnings.defExp * location.expMult) / gameCPS) * hashMult;\n const dexExp = ((classs.earnings.dexExp * location.expMult) / gameCPS) * hashMult;\n const agiExp = ((classs.earnings.agiExp * location.expMult) / gameCPS) * hashMult;\n const chaExp = ((classs.earnings.chaExp * location.expMult) / gameCPS) * hashMult;\n return {\n money: cost,\n reputation: 0,\n hackExp: hackExp * target.mults.hacking_exp * BitNodeMultipliers.ClassGymExpGain,\n strExp: strExp * target.mults.strength_exp * BitNodeMultipliers.ClassGymExpGain,\n defExp: defExp * target.mults.defense_exp * BitNodeMultipliers.ClassGymExpGain,\n dexExp: dexExp * target.mults.dexterity_exp * BitNodeMultipliers.ClassGymExpGain,\n agiExp: agiExp * target.mults.agility_exp * BitNodeMultipliers.ClassGymExpGain,\n chaExp: chaExp * target.mults.charisma_exp * BitNodeMultipliers.ClassGymExpGain,\n intExp: 0,\n };\n}\n","/**\n * Class representing a script file.\n *\n * This does NOT represent a script that is actively running and\n * being evaluated. See RunningScript for that\n */\nimport { calculateRamUsage, RamUsageEntry } from \"./RamCalculations\";\nimport { ScriptUrl } from \"./ScriptUrl\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { roundToTwo } from \"../utils/helpers/roundToTwo\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { ScriptModule } from \"./ScriptModule\";\n\nlet globalModuleSequenceNumber = 0;\n\ninterface ScriptReference {\n filename: string;\n server: string;\n}\n\nexport class Script {\n // Code for this script\n code = \"\";\n\n // Filename for the script file\n filename = \"\";\n\n // url of the script if any, only for NS2.\n url = \"\";\n\n // The dynamic module generated for this script when it is run.\n // This is only applicable for NetscriptJS\n module: Promise | null = null;\n\n // The timestamp when when the script was last updated.\n moduleSequenceNumber: number;\n\n // Only used with NS2 scripts; the list of dependency script filenames. This is constructed\n // whenever the script is first evaluated, and therefore may be out of date if the script\n // has been updated since it was last run.\n dependencies: ScriptUrl[] = [];\n dependents: ScriptReference[] = [];\n\n // Amount of RAM this Script requres to run\n ramUsage = 0;\n ramUsageEntries?: RamUsageEntry[];\n\n // Used to deconflict multiple simultaneous compilations.\n queueCompile = false;\n\n // hostname of server that this script is on.\n server = \"\";\n\n constructor(player: IPlayer | null = null, fn = \"\", code = \"\", server = \"\", otherScripts: Script[] = []) {\n this.filename = fn;\n this.code = code;\n this.server = server; // hostname of server this script is on\n this.moduleSequenceNumber = ++globalModuleSequenceNumber;\n if (this.code !== \"\" && player !== null) {\n this.updateRamUsage(player, otherScripts);\n }\n }\n\n /**\n * Download the script as a file\n */\n download(): void {\n const filename = this.filename;\n const file = new Blob([this.code], { type: \"text/plain\" });\n const a = document.createElement(\"a\"),\n url = URL.createObjectURL(file);\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n setTimeout(function () {\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url);\n }, 0);\n }\n\n /**\n * Marks this script as having been updated. It will be recompiled next time something tries\n * to exec it.\n */\n markUpdated(): void {\n this.module = null;\n this.moduleSequenceNumber = ++globalModuleSequenceNumber;\n }\n\n /**\n * Save a script from the script editor\n * @param {string} code - The new contents of the script\n * @param {Script[]} otherScripts - Other scripts on the server. Used to process imports\n */\n saveScript(player: IPlayer, filename: string, code: string, hostname: string, otherScripts: Script[]): void {\n // Update code and filename\n this.code = Script.formatCode(code);\n\n this.filename = filename;\n this.server = hostname;\n this.updateRamUsage(player, otherScripts);\n this.markUpdated();\n for (const dependent of this.dependents) {\n const [dependentScript] = otherScripts.filter(\n (s) => s.filename === dependent.filename && s.server == dependent.server,\n );\n dependentScript?.markUpdated();\n }\n }\n\n /**\n * Calculates and updates the script's RAM usage based on its code\n * @param {Script[]} otherScripts - Other scripts on the server. Used to process imports\n */\n updateRamUsage(player: IPlayer, otherScripts: Script[]): void {\n const res = calculateRamUsage(player, this.code, otherScripts);\n if (res.cost > 0) {\n this.ramUsage = roundToTwo(res.cost);\n this.ramUsageEntries = res.entries;\n }\n this.markUpdated();\n }\n\n imports(): string[] {\n return [];\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Script\", this);\n }\n\n // Initializes a Script Object from a JSON save state\n static fromJSON(value: IReviverValue): Script {\n const s = Generic_fromJSON(Script, value.data);\n // Force the url to blank from the save data. Urls are not valid outside the current browser page load.\n s.url = \"\";\n s.dependents = [];\n return s;\n }\n\n /**\n * Formats code: Removes the starting & trailing whitespace\n * @param {string} code - The code to format\n * @returns The formatted code\n */\n static formatCode(code: string): string {\n return code.replace(/^\\s+|\\s+$/g, \"\");\n }\n}\n\nReviver.constructors.Script = Script;\n","import React from \"react\";\n\nimport { Table, TableCell } from \"./Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { Table as MuiTable } from \"@mui/material\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n rows: React.ReactNode[][];\n title?: string;\n wide?: boolean;\n}\n\nexport function StatsTable({ rows, title, wide }: IProps): React.ReactElement {\n const T = wide ? MuiTable : Table;\n return (\n <>\n {title && {title}}\n \n \n {rows.map((row: React.ReactNode[], i: number) => (\n \n {row.map((elem: React.ReactNode, i: number) => (\n \n {elem}\n \n ))}\n \n ))}\n \n \n \n );\n}\n","import { DarkWebItem } from \"./DarkWebItem\";\nimport { IMap } from \"../types\";\nimport { Programs } from \"../Programs/Programs\";\n\nexport const DarkWebItems: IMap = {\n BruteSSHProgram: new DarkWebItem(Programs.BruteSSHProgram.name, 500e3, \"Opens up SSH Ports.\"),\n FTPCrackProgram: new DarkWebItem(Programs.FTPCrackProgram.name, 1500e3, \"Opens up FTP Ports.\"),\n RelaySMTPProgram: new DarkWebItem(Programs.RelaySMTPProgram.name, 5e6, \"Opens up SMTP Ports.\"),\n HTTPWormProgram: new DarkWebItem(Programs.HTTPWormProgram.name, 30e6, \"Opens up HTTP Ports.\"),\n SQLInjectProgram: new DarkWebItem(Programs.SQLInjectProgram.name, 250e6, \"Opens up SQL Ports.\"),\n ServerProfiler: new DarkWebItem(\n Programs.ServerProfiler.name,\n 500000,\n \"Displays detailed information about a server.\",\n ),\n DeepscanV1: new DarkWebItem(Programs.DeepscanV1.name, 500000, \"Enables 'scan-analyze' with a depth up to 5.\"),\n DeepscanV2: new DarkWebItem(Programs.DeepscanV2.name, 25e6, \"Enables 'scan-analyze' with a depth up to 10.\"),\n AutolinkProgram: new DarkWebItem(Programs.AutoLink.name, 1e6, \"Enables direct connect via 'scan-analyze'.\"),\n FormulasProgram: new DarkWebItem(Programs.Formulas.name, 5e9, \"Unlock access to the formulas API.\"),\n};\n","import { Action } from \"./Action\";\nimport { IMap } from \"../types\";\n\nexport const GeneralActions: IMap = {};\n\nconst actionNames: Array = [\n \"Training\",\n \"Field Analysis\",\n \"Recruitment\",\n \"Diplomacy\",\n \"Hyperbolic Regeneration Chamber\",\n \"Incite Violence\",\n];\n\nfor (const actionName of actionNames) {\n GeneralActions[actionName] = new Action({\n name: actionName,\n });\n}\n","// Enum values are lowercased to match css classes\nexport enum Suit {\n Clubs = \"clubs\",\n Diamonds = \"diamonds\",\n Hearts = \"hearts\",\n Spades = \"spades\",\n}\n\nexport class Card {\n constructor(readonly value: number, readonly suit: Suit) {\n if (value < 1 || value > 13) {\n throw new Error(`Card instantiated with improper value: ${value}`);\n }\n }\n\n formatValue(): string {\n switch (this.value) {\n case 1:\n return \"A\";\n case 11:\n return \"J\";\n case 12:\n return \"Q\";\n case 13:\n return \"K\";\n default:\n return `${this.value}`;\n }\n }\n\n isRedSuit(): boolean {\n return this.suit === Suit.Hearts || this.suit === Suit.Diamonds;\n }\n\n getStringRepresentation(): string {\n const value = this.formatValue();\n\n return `${value} of ${this.suit}`;\n }\n}\n","import { IActionIdentifier } from \"./IActionIdentifier\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\ninterface IParams {\n name?: string;\n type?: number;\n}\n\nexport class ActionIdentifier implements IActionIdentifier {\n name = \"\";\n type = -1;\n\n constructor(params: IParams = {}) {\n if (params.name) this.name = params.name;\n if (params.type) this.type = params.type;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"ActionIdentifier\", this);\n }\n\n static fromJSON(value: IReviverValue): ActionIdentifier {\n return Generic_fromJSON(ActionIdentifier, value.data);\n }\n}\n\nReviver.constructors.ActionIdentifier = ActionIdentifier;\n","import { BitNodes } from \"../BitNode/BitNode\";\n\nexport class SourceFile {\n info: JSX.Element;\n lvl = 1;\n n: number;\n name: string;\n owned = false;\n\n constructor(number: number, info: JSX.Element) {\n const bitnodeKey = \"BitNode\" + number;\n const bitnode = BitNodes[bitnodeKey];\n if (bitnode == null) {\n throw new Error(\"Invalid Bit Node for this Source File\");\n }\n\n this.n = number;\n this.name = `Source-File ${number}: ${bitnode.name}`;\n this.info = info;\n }\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { Player } from \"../Player\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { RunningScript } from \"./RunningScript\";\nimport { processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\n\nexport function scriptCalculateOfflineProduction(runningScript: RunningScript): void {\n //The Player object stores the last update time from when we were online\n const thisUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timePassed = (thisUpdate - lastUpdate) / 1000; //Seconds\n\n //Calculate the \"confidence\" rating of the script's true production. This is based\n //entirely off of time. We will arbitrarily say that if a script has been running for\n //4 hours (14400 sec) then we are completely confident in its ability\n let confidence = runningScript.onlineRunningTime / 14400;\n if (confidence >= 1) {\n confidence = 1;\n }\n\n //Data map: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n\n // Grow\n for (const hostname of Object.keys(runningScript.dataMap)) {\n if (runningScript.dataMap.hasOwnProperty(hostname)) {\n if (runningScript.dataMap[hostname][2] == 0 || runningScript.dataMap[hostname][2] == null) {\n continue;\n }\n const serv = GetServer(hostname);\n if (serv == null) {\n continue;\n }\n const timesGrown = Math.round(\n ((0.5 * runningScript.dataMap[hostname][2]) / runningScript.onlineRunningTime) * timePassed,\n );\n runningScript.log(`Called on ${serv.hostname} ${timesGrown} times while offline`);\n const host = GetServer(runningScript.server);\n if (host === null) throw new Error(\"getServer of null key?\");\n if (!(serv instanceof Server)) throw new Error(\"trying to grow a non-normal server\");\n const growth = processSingleServerGrowth(serv, timesGrown, Player, host.cpuCores);\n runningScript.log(\n `'${serv.hostname}' grown by ${numeralWrapper.format(growth * 100 - 100, \"0.000000%\")} while offline`,\n );\n }\n }\n\n // Offline EXP gain\n // A script's offline production will always be at most half of its online production.\n const expGain = confidence * (runningScript.onlineExpGained / runningScript.onlineRunningTime) * timePassed;\n Player.gainHackingExp(expGain);\n\n // Update script stats\n runningScript.offlineRunningTime += timePassed;\n runningScript.offlineExpGained += expGain;\n\n // Weaken\n for (const hostname of Object.keys(runningScript.dataMap)) {\n if (runningScript.dataMap.hasOwnProperty(hostname)) {\n if (runningScript.dataMap[hostname][3] == 0 || runningScript.dataMap[hostname][3] == null) {\n continue;\n }\n const serv = GetServer(hostname);\n if (serv == null) {\n continue;\n }\n\n if (!(serv instanceof Server)) throw new Error(\"trying to weaken a non-normal server\");\n const host = GetServer(runningScript.server);\n if (host === null) throw new Error(\"getServer of null key?\");\n const timesWeakened = Math.round(\n ((0.5 * runningScript.dataMap[hostname][3]) / runningScript.onlineRunningTime) * timePassed,\n );\n runningScript.log(`Called weaken() on ${serv.hostname} ${timesWeakened} times while offline`);\n const coreBonus = 1 + (host.cpuCores - 1) / 16;\n serv.weaken(CONSTANTS.ServerWeakenAmount * timesWeakened * coreBonus);\n }\n }\n}\n\n//Returns a RunningScript object matching the filename and arguments on the\n//designated server, and false otherwise\nexport function findRunningScript(\n filename: string,\n args: (string | number | boolean)[],\n server: BaseServer,\n): RunningScript | null {\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename === filename && compareArrays(server.runningScripts[i].args, args)) {\n return server.runningScripts[i];\n }\n }\n return null;\n}\n\n//Returns a RunningScript object matching the pid on the\n//designated server, and false otherwise\nexport function findRunningScriptByPid(pid: number, server: BaseServer): RunningScript | null {\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].pid === pid) {\n return server.runningScripts[i];\n }\n }\n return null;\n}\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { Companies } from \"../../../Company/Companies\";\nimport { Company } from \"../../../Company/Company\";\nimport { calculateCompanyWorkStats } from \"../../../Work/formulas/Company\";\nimport { WorkStats } from \"../../../Work/WorkStats\";\nimport { influenceStockThroughCompanyWork } from \"../../../StockMarket/PlayerInfluencing\";\n\ninterface SleeveCompanyWorkParams {\n companyName: string;\n}\n\nexport const isSleeveCompanyWork = (w: Work | null): w is SleeveCompanyWork =>\n w !== null && w.type === WorkType.COMPANY;\n\nexport class SleeveCompanyWork extends Work {\n companyName: string;\n\n constructor(params?: SleeveCompanyWorkParams) {\n super(WorkType.COMPANY);\n this.companyName = params?.companyName ?? LocationName.NewTokyoNoodleBar;\n }\n\n getCompany(): Company {\n const c = Companies[this.companyName];\n if (!c) throw new Error(`Company not found: '${this.companyName}'`);\n return c;\n }\n\n getGainRates(player: IPlayer, sleeve: Sleeve): WorkStats {\n return calculateCompanyWorkStats(player, sleeve, this.getCompany());\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n const company = this.getCompany();\n const gains = this.getGainRates(player, sleeve);\n applySleeveGains(player, sleeve, gains, cycles);\n company.playerReputation += gains.reputation * cycles;\n influenceStockThroughCompanyWork(company, gains.reputation, cycles);\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n companyName: this.companyName,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveCompanyWork\", this);\n }\n\n /**\n * Initiatizes a CompanyWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveCompanyWork {\n return Generic_fromJSON(SleeveCompanyWork, value.data);\n }\n}\n\nReviver.constructors.SleeveCompanyWork = SleeveCompanyWork;\n","import { PlayerObject } from \"src/PersonObjects/Player/PlayerObject\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { SkillNames } from \"../Bladeburner/data/SkillNames\";\nimport { Skills } from \"../Bladeburner/Skills\";\nimport { CONSTANTS } from \"../Constants\";\nimport { Industries } from \"../Corporation/IndustryData\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport { Factions } from \"../Faction/Factions\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangConstants } from \"../Gang/data/Constants\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { hasHacknetServers } from \"../Hacknet/HacknetHelpers\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { Player } from \"../Player\";\nimport { Programs } from \"../Programs/Programs\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Server } from \"../Server/Server\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Page } from \"../ui/Router\";\nimport { IMap } from \"../types\";\nimport * as data from \"./AchievementData.json\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { BlackOperationNames } from \"../Bladeburner/data/BlackOperationNames\";\nimport { isClassWork } from \"../Work/ClassWork\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\n// Unable to correctly cast the JSON data into AchievementDataJson type otherwise...\nconst achievementData = ((data)).achievements;\n\nexport interface Achievement {\n ID: string;\n Icon?: string;\n Name?: string;\n Description?: string;\n Secret?: boolean;\n Condition: () => boolean;\n Visible?: () => boolean;\n AdditionalUnlock?: string[]; // IDs of achievements that should be awarded when awarding this one\n}\n\nexport interface PlayerAchievement {\n ID: string;\n unlockedOn?: number;\n}\n\nexport interface AchievementDataJson {\n achievements: IMap;\n}\n\nexport interface AchievementData {\n ID: string;\n Name: string;\n Description: string;\n}\n\nfunction bitNodeFinishedState(): boolean {\n const wd = GetServer(SpecialServers.WorldDaemon);\n if (!(wd instanceof Server)) return false;\n if (wd.backdoorInstalled) return true;\n return (\n Player.bladeburner !== null && Player.bladeburner.blackops.hasOwnProperty(BlackOperationNames.OperationDaedalus)\n );\n}\n\nfunction hasAccessToSF(player: PlayerObject, bn: number): boolean {\n return player.bitNodeN === bn || player.sourceFiles.some((a) => a.n === bn);\n}\n\nfunction knowsAboutBitverse(player: PlayerObject): boolean {\n return player.sourceFiles.some((a) => a.n === 1);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nfunction sfAchievement(): Achievement[] {\n const achs: Achievement[] = [];\n for (let i = 0; i <= 11; i++) {\n for (let j = 1; j <= 3; j++) {\n achs.push({\n ID: `SF${i}.${j}`,\n Condition: () => Player.sourceFileLvl(i) >= j,\n });\n }\n }\n return achs;\n}\n\nexport const achievements: IMap = {\n [FactionNames.CyberSec.toUpperCase()]: {\n ...achievementData[FactionNames.CyberSec.toUpperCase()],\n Icon: \"CSEC\",\n Condition: () => Player.factions.includes(FactionNames.CyberSec),\n },\n [FactionNames.NiteSec.toUpperCase()]: {\n ...achievementData[FactionNames.NiteSec.toUpperCase()],\n Icon: FactionNames.NiteSec,\n Condition: () => Player.factions.includes(FactionNames.NiteSec),\n },\n THE_BLACK_HAND: {\n ...achievementData[\"THE_BLACK_HAND\"],\n Icon: \"TBH\",\n Condition: () => Player.factions.includes(FactionNames.TheBlackHand),\n },\n [FactionNames.BitRunners.toUpperCase()]: {\n ...achievementData[FactionNames.BitRunners.toUpperCase()],\n Icon: FactionNames.BitRunners.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.BitRunners),\n },\n [FactionNames.Daedalus.toUpperCase()]: {\n ...achievementData[FactionNames.Daedalus.toUpperCase()],\n Icon: FactionNames.Daedalus.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.Daedalus),\n },\n THE_COVENANT: {\n ...achievementData[\"THE_COVENANT\"],\n Icon: FactionNames.TheCovenant.toLowerCase().replace(/ /g, \"\"),\n Condition: () => Player.factions.includes(FactionNames.TheCovenant),\n },\n [FactionNames.Illuminati.toUpperCase()]: {\n ...achievementData[FactionNames.Illuminati.toUpperCase()],\n Icon: FactionNames.Illuminati.toLowerCase(),\n Condition: () => Player.factions.includes(FactionNames.Illuminati),\n },\n \"BRUTESSH.EXE\": {\n ...achievementData[\"BRUTESSH.EXE\"],\n Icon: \"p0\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.BruteSSHProgram.name),\n },\n \"FTPCRACK.EXE\": {\n ...achievementData[\"FTPCRACK.EXE\"],\n Icon: \"p1\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.FTPCrackProgram.name),\n },\n //-----------------------------------------------------\n \"RELAYSMTP.EXE\": {\n ...achievementData[\"RELAYSMTP.EXE\"],\n Icon: \"p2\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.RelaySMTPProgram.name),\n },\n \"HTTPWORM.EXE\": {\n ...achievementData[\"HTTPWORM.EXE\"],\n Icon: \"p3\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.HTTPWormProgram.name),\n },\n \"SQLINJECT.EXE\": {\n ...achievementData[\"SQLINJECT.EXE\"],\n Icon: \"p4\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.SQLInjectProgram.name),\n },\n \"FORMULAS.EXE\": {\n ...achievementData[\"FORMULAS.EXE\"],\n Icon: \"formulas\",\n Condition: () => Player.getHomeComputer().programs.includes(Programs.Formulas.name),\n },\n \"SF1.1\": {\n ...achievementData[\"SF1.1\"],\n Icon: \"SF1.1\",\n Visible: () => hasAccessToSF(Player, 1),\n Condition: () => Player.sourceFileLvl(1) >= 1,\n },\n \"SF2.1\": {\n ...achievementData[\"SF2.1\"],\n Icon: \"SF2.1\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.sourceFileLvl(2) >= 1,\n },\n \"SF3.1\": {\n ...achievementData[\"SF3.1\"],\n Icon: \"SF3.1\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.sourceFileLvl(3) >= 1,\n },\n \"SF4.1\": {\n ...achievementData[\"SF4.1\"],\n Icon: \"SF4.1\",\n Visible: () => hasAccessToSF(Player, 4),\n Condition: () => Player.sourceFileLvl(4) >= 1,\n },\n \"SF5.1\": {\n ...achievementData[\"SF5.1\"],\n Icon: \"SF5.1\",\n Visible: () => hasAccessToSF(Player, 5),\n Condition: () => Player.sourceFileLvl(5) >= 1,\n },\n \"SF6.1\": {\n ...achievementData[\"SF6.1\"],\n Icon: \"SF6.1\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.sourceFileLvl(6) >= 1,\n },\n \"SF7.1\": {\n ...achievementData[\"SF7.1\"],\n Icon: \"SF7.1\",\n Visible: () => hasAccessToSF(Player, 7),\n Condition: () => Player.sourceFileLvl(7) >= 1,\n },\n \"SF8.1\": {\n ...achievementData[\"SF8.1\"],\n Icon: \"SF8.1\",\n Visible: () => hasAccessToSF(Player, 8),\n Condition: () => Player.sourceFileLvl(8) >= 1,\n },\n \"SF9.1\": {\n ...achievementData[\"SF9.1\"],\n Icon: \"SF9.1\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => Player.sourceFileLvl(9) >= 1,\n },\n \"SF10.1\": {\n ...achievementData[\"SF10.1\"],\n Icon: \"SF10.1\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () => Player.sourceFileLvl(10) >= 1,\n },\n \"SF11.1\": {\n ...achievementData[\"SF11.1\"],\n Icon: \"SF11.1\",\n Visible: () => hasAccessToSF(Player, 11),\n Condition: () => Player.sourceFileLvl(11) >= 1,\n },\n \"SF12.1\": {\n ...achievementData[\"SF12.1\"],\n Icon: \"SF12.1\",\n Visible: () => hasAccessToSF(Player, 12),\n Condition: () => Player.sourceFileLvl(12) >= 1,\n },\n MONEY_1Q: {\n ...achievementData[\"MONEY_1Q\"],\n Icon: \"$1Q\",\n Condition: () => Player.money >= 1e18,\n },\n MONEY_M1B: {\n ...achievementData[\"MONEY_M1B\"],\n Icon: \"-1b\",\n Secret: true,\n Condition: () => Player.money <= -1e9,\n },\n INSTALL_1: {\n ...achievementData[\"INSTALL_1\"],\n Icon: \"install\",\n Condition: () => Player.augmentations.length >= 1,\n },\n INSTALL_100: {\n ...achievementData[\"INSTALL_100\"],\n Icon: \"install_100\",\n Condition: () => Player.augmentations.length >= 100,\n },\n QUEUE_40: {\n ...achievementData[\"QUEUE_40\"],\n Icon: \"queue40\",\n Condition: () => Player.queuedAugmentations.length >= 40,\n },\n HACKING_100000: {\n ...achievementData[\"HACKING_100000\"],\n Icon: \"hack100000\",\n Condition: () => Player.skills.hacking >= 100000,\n },\n COMBAT_3000: {\n ...achievementData[\"COMBAT_3000\"],\n Icon: \"combat3000\",\n Condition: () =>\n Player.skills.strength >= 3000 &&\n Player.skills.defense >= 3000 &&\n Player.skills.dexterity >= 3000 &&\n Player.skills.agility >= 3000,\n },\n NEUROFLUX_255: {\n ...achievementData[\"NEUROFLUX_255\"],\n Icon: \"nf255\",\n Condition: () => Player.augmentations.some((a) => a.name === AugmentationNames.NeuroFluxGovernor && a.level >= 255),\n },\n NS2: {\n ...achievementData[\"NS2\"],\n Icon: \"ns2\",\n Condition: () => Player.getHomeComputer().scripts.some((s) => s.filename.endsWith(\".js\")),\n },\n FROZE: {\n ...achievementData[\"FROZE\"],\n Icon: \"forze\",\n Condition: () => location.href.includes(\"noScripts\"),\n },\n RUNNING_SCRIPTS_1000: {\n ...achievementData[\"RUNNING_SCRIPTS_1000\"],\n Icon: \"run1000\",\n Condition: (): boolean => {\n let running = 0;\n for (const s of GetAllServers()) {\n running += s.runningScripts.length;\n }\n return running >= 1000;\n },\n },\n DRAIN_SERVER: {\n ...achievementData[\"DRAIN_SERVER\"],\n Icon: \"drain\",\n Condition: (): boolean => {\n for (const s of GetAllServers()) {\n if (s instanceof Server) {\n if (s.moneyMax > 0 && s.moneyAvailable === 0) return true;\n }\n }\n return false;\n },\n },\n MAX_RAM: {\n ...achievementData[\"MAX_RAM\"],\n Icon: \"maxram\",\n Condition: () => Player.getHomeComputer().maxRam === CONSTANTS.HomeComputerMaxRam,\n },\n MAX_CORES: {\n ...achievementData[\"MAX_CORES\"],\n Icon: \"maxcores\",\n Condition: () => Player.getHomeComputer().cpuCores === 8,\n },\n SCRIPTS_30: {\n ...achievementData[\"SCRIPTS_30\"],\n Icon: \"folders\",\n Condition: () => Player.getHomeComputer().scripts.length >= 30,\n },\n KARMA_1000000: {\n ...achievementData[\"KARMA_1000000\"],\n Icon: \"karma\",\n Secret: true,\n Condition: () => Player.karma <= -1e6,\n },\n STOCK_1q: {\n ...achievementData[\"STOCK_1q\"],\n Icon: \"$1Q\",\n Condition: () => Player.moneySourceB.stock >= 1e15,\n },\n DISCOUNT: {\n ...achievementData[\"DISCOUNT\"],\n Icon: \"discount\",\n Condition: (): boolean => {\n const p = GetServer(\"powerhouse-fitness\");\n if (!(p instanceof Server)) return false;\n return p.backdoorInstalled;\n },\n },\n SCRIPT_32GB: {\n ...achievementData[\"SCRIPT_32GB\"],\n Icon: \"bigcost\",\n Condition: () => Player.getHomeComputer().scripts.some((s) => s.ramUsage >= 32),\n },\n FIRST_HACKNET_NODE: {\n ...achievementData[\"FIRST_HACKNET_NODE\"],\n Icon: \"node\",\n Condition: () => !hasHacknetServers(Player) && Player.hacknetNodes.length > 0,\n },\n \"30_HACKNET_NODE\": {\n ...achievementData[\"30_HACKNET_NODE\"],\n Icon: \"hacknet-all\",\n Condition: () => !hasHacknetServers(Player) && Player.hacknetNodes.length >= 30,\n },\n MAX_HACKNET_NODE: {\n ...achievementData[\"MAX_HACKNET_NODE\"],\n Icon: \"hacknet-max\",\n Condition: (): boolean => {\n if (hasHacknetServers(Player)) return false;\n for (const h of Player.hacknetNodes) {\n if (!(h instanceof HacknetNode)) return false;\n if (\n h.ram === HacknetNodeConstants.MaxRam &&\n h.cores === HacknetNodeConstants.MaxCores &&\n h.level === HacknetNodeConstants.MaxLevel\n )\n return true;\n }\n return false;\n },\n },\n HACKNET_NODE_10M: {\n ...achievementData[\"HACKNET_NODE_10M\"],\n Icon: \"hacknet-10m\",\n Condition: () => !hasHacknetServers(Player) && Player.moneySourceB.hacknet >= 10e6,\n },\n REPUTATION_10M: {\n ...achievementData[\"REPUTATION_10M\"],\n Icon: \"reputation\",\n Condition: () => Object.values(Factions).some((f) => f.playerReputation >= 10e6),\n },\n DONATION: {\n ...achievementData[\"DONATION\"],\n Icon: \"donation\",\n Condition: () =>\n Object.values(Factions).some(\n (f) => f.favor >= Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction),\n ),\n },\n TRAVEL: {\n ...achievementData[\"TRAVEL\"],\n Icon: \"TRAVEL\",\n Condition: () => Player.city !== CityName.Sector12,\n },\n WORKOUT: {\n ...achievementData[\"WORKOUT\"],\n Icon: \"WORKOUT\",\n Condition: () => isClassWork(Player.currentWork),\n },\n TOR: {\n ...achievementData[\"TOR\"],\n Icon: \"TOR\",\n Condition: () => Player.hasTorRouter(),\n },\n HOSPITALIZED: {\n ...achievementData[\"HOSPITALIZED\"],\n Icon: \"OUCH\",\n Condition: () => Player.moneySourceB.hospitalization !== 0,\n },\n GANG: {\n ...achievementData[\"GANG\"],\n Icon: \"GANG\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null,\n },\n FULL_GANG: {\n ...achievementData[\"FULL_GANG\"],\n Icon: \"GANGMAX\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null && Player.gang.members.length === GangConstants.MaximumGangMembers,\n },\n GANG_TERRITORY: {\n ...achievementData[\"GANG_TERRITORY\"],\n Icon: \"GANG100%\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.gang !== null && AllGangs[Player.gang.facName].territory >= 0.999,\n },\n GANG_MEMBER_POWER: {\n ...achievementData[\"GANG_MEMBER_POWER\"],\n Icon: \"GANG10000\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () =>\n Player.gang !== null &&\n Player.gang.members.some(\n (m) =>\n m.hack >= 10000 || m.str >= 10000 || m.def >= 10000 || m.dex >= 10000 || m.agi >= 10000 || m.cha >= 10000,\n ),\n },\n CORPORATION: {\n ...achievementData[\"CORPORATION\"],\n Icon: \"CORP\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null,\n },\n CORPORATION_BRIBE: {\n ...achievementData[\"CORPORATION_BRIBE\"],\n Icon: \"CORPLOBBY\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null && Player.corporation.unlockUpgrades[6] === 1,\n },\n CORPORATION_PROD_1000: {\n ...achievementData[\"CORPORATION_PROD_1000\"],\n Icon: \"CORP1000\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.corporation !== null && Player.corporation.divisions.some((d) => d.prodMult >= 1000),\n },\n CORPORATION_EMPLOYEE_3000: {\n ...achievementData[\"CORPORATION_EMPLOYEE_3000\"],\n Icon: \"CORPCITY\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: (): boolean => {\n if (Player.corporation === null) return false;\n for (const d of Player.corporation.divisions) {\n for (const o of Object.values(d.offices)) {\n if (o === 0) continue;\n if (o.employees.length >= 3000) return true;\n }\n }\n return false;\n },\n },\n CORPORATION_REAL_ESTATE: {\n ...achievementData[\"CORPORATION_REAL_ESTATE\"],\n Icon: \"CORPRE\",\n Name: \"Own the land\",\n Description: \"Expand to the Real Estate division.\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () =>\n Player.corporation !== null && Player.corporation.divisions.some((d) => d.type === Industries.RealEstate),\n },\n INTELLIGENCE_255: {\n ...achievementData[\"INTELLIGENCE_255\"],\n Icon: \"INT255\",\n Visible: () => hasAccessToSF(Player, 5),\n Condition: () => Player.skills.intelligence >= 255,\n },\n BLADEBURNER_DIVISION: {\n ...achievementData[\"BLADEBURNER_DIVISION\"],\n Icon: \"BLADE\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bladeburner !== null,\n },\n BLADEBURNER_OVERCLOCK: {\n ...achievementData[\"BLADEBURNER_OVERCLOCK\"],\n Icon: \"BLADEOVERCLOCK\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () =>\n Player.bladeburner !== null &&\n Player.bladeburner.skills[SkillNames.Overclock] === Skills[SkillNames.Overclock].maxLvl,\n },\n BLADEBURNER_UNSPENT_100000: {\n ...achievementData[\"BLADEBURNER_UNSPENT_100000\"],\n Icon: \"BLADE100K\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bladeburner !== null && Player.bladeburner.skillPoints >= 100000,\n },\n \"4S\": {\n ...achievementData[\"4S\"],\n Icon: \"4S\",\n Condition: () => Player.has4SData,\n },\n FIRST_HACKNET_SERVER: {\n ...achievementData[\"FIRST_HACKNET_SERVER\"],\n Icon: \"HASHNET\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers(Player) && Player.hacknetNodes.length > 0,\n AdditionalUnlock: [achievementData.FIRST_HACKNET_NODE.ID],\n },\n ALL_HACKNET_SERVER: {\n ...achievementData[\"ALL_HACKNET_SERVER\"],\n Icon: \"HASHNETALL\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers(Player) && Player.hacknetNodes.length === HacknetServerConstants.MaxServers,\n AdditionalUnlock: [achievementData[\"30_HACKNET_NODE\"].ID],\n },\n MAX_HACKNET_SERVER: {\n ...achievementData[\"MAX_HACKNET_SERVER\"],\n Icon: \"HASHNETALL\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: (): boolean => {\n if (!hasHacknetServers(Player)) return false;\n for (const h of Player.hacknetNodes) {\n if (typeof h !== \"string\") return false;\n const hs = GetServer(h);\n if (!(hs instanceof HacknetServer)) return false;\n if (\n hs.maxRam === HacknetServerConstants.MaxRam &&\n hs.cores === HacknetServerConstants.MaxCores &&\n hs.level === HacknetServerConstants.MaxLevel &&\n hs.cache === HacknetServerConstants.MaxCache\n )\n return true;\n }\n return false;\n },\n AdditionalUnlock: [achievementData.MAX_HACKNET_NODE.ID],\n },\n HACKNET_SERVER_1B: {\n ...achievementData[\"HACKNET_SERVER_1B\"],\n Icon: \"HASHNETMONEY\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () => hasHacknetServers(Player) && Player.moneySourceB.hacknet >= 1e9,\n AdditionalUnlock: [achievementData.HACKNET_NODE_10M.ID],\n },\n MAX_CACHE: {\n ...achievementData[\"MAX_CACHE\"],\n Icon: \"HASHNETCAP\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () =>\n hasHacknetServers(Player) &&\n Player.hashManager.hashes === Player.hashManager.capacity &&\n Player.hashManager.capacity > 0,\n },\n SLEEVE_8: {\n ...achievementData[\"SLEEVE_8\"],\n Icon: \"SLEEVE8\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () => Player.sleeves.length === 8 && Player.sourceFileLvl(10) === 3,\n },\n INDECISIVE: {\n ...achievementData[\"INDECISIVE\"],\n Icon: \"1H\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: (function () {\n let c = 0;\n setInterval(() => {\n if (Router.page() === Page.BitVerse) {\n c++;\n } else {\n c = 0;\n }\n }, 60 * 1000);\n return () => c > 60;\n })(),\n },\n FAST_BN: {\n ...achievementData[\"FAST_BN\"],\n Icon: \"2DAYS\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: () => bitNodeFinishedState() && Player.playtimeSinceLastBitnode < 1000 * 60 * 60 * 24 * 2,\n },\n CHALLENGE_BN1: {\n ...achievementData[\"CHALLENGE_BN1\"],\n Icon: \"BN1+\",\n Visible: () => knowsAboutBitverse(Player),\n Condition: () =>\n Player.bitNodeN === 1 &&\n bitNodeFinishedState() &&\n Player.getHomeComputer().maxRam <= 128 &&\n Player.getHomeComputer().cpuCores === 1,\n },\n CHALLENGE_BN2: {\n ...achievementData[\"CHALLENGE_BN2\"],\n Icon: \"BN2+\",\n Visible: () => hasAccessToSF(Player, 2),\n Condition: () => Player.bitNodeN === 2 && bitNodeFinishedState() && Player.gang === null,\n },\n CHALLENGE_BN3: {\n ...achievementData[\"CHALLENGE_BN3\"],\n Icon: \"BN3+\",\n Visible: () => hasAccessToSF(Player, 3),\n Condition: () => Player.bitNodeN === 3 && bitNodeFinishedState() && Player.corporation === null,\n },\n CHALLENGE_BN6: {\n ...achievementData[\"CHALLENGE_BN6\"],\n Icon: \"BN6+\",\n Visible: () => hasAccessToSF(Player, 6),\n Condition: () => Player.bitNodeN === 6 && bitNodeFinishedState() && Player.bladeburner === null,\n },\n CHALLENGE_BN7: {\n ...achievementData[\"CHALLENGE_BN7\"],\n Icon: \"BN7+\",\n Visible: () => hasAccessToSF(Player, 7),\n Condition: () => Player.bitNodeN === 7 && bitNodeFinishedState() && Player.bladeburner === null,\n },\n CHALLENGE_BN8: {\n ...achievementData[\"CHALLENGE_BN8\"],\n Icon: \"BN8+\",\n Visible: () => hasAccessToSF(Player, 8),\n Condition: () => Player.bitNodeN === 8 && bitNodeFinishedState() && !Player.has4SData && !Player.has4SDataTixApi,\n },\n CHALLENGE_BN9: {\n ...achievementData[\"CHALLENGE_BN9\"],\n Icon: \"BN9+\",\n Visible: () => hasAccessToSF(Player, 9),\n Condition: () =>\n Player.bitNodeN === 9 &&\n bitNodeFinishedState() &&\n Player.moneySourceB.hacknet === 0 &&\n Player.moneySourceB.hacknet_expenses === 0,\n },\n CHALLENGE_BN10: {\n ...achievementData[\"CHALLENGE_BN10\"],\n Icon: \"BN10+\",\n Visible: () => hasAccessToSF(Player, 10),\n Condition: () =>\n Player.bitNodeN === 10 &&\n bitNodeFinishedState() &&\n !Player.sleeves.some(\n (s) =>\n s.augmentations.length > 0 ||\n s.exp.hacking > 0 ||\n s.exp.strength > 0 ||\n s.exp.defense > 0 ||\n s.exp.agility > 0 ||\n s.exp.dexterity > 0 ||\n s.exp.charisma > 0,\n ),\n },\n CHALLENGE_BN12: {\n ...achievementData[\"CHALLENGE_BN12\"],\n Icon: \"BN12+\",\n Visible: () => hasAccessToSF(Player, 12),\n Condition: () => Player.sourceFileLvl(12) >= 50,\n },\n BYPASS: {\n ...achievementData[\"BYPASS\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.Bypass),\n },\n PROTOTYPETAMPERING: {\n ...achievementData[\"PROTOTYPETAMPERING\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.PrototypeTampering),\n },\n UNCLICKABLE: {\n ...achievementData[\"UNCLICKABLE\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.Unclickable),\n },\n UNDOCUMENTEDFUNCTIONCALL: {\n ...achievementData[\"UNDOCUMENTEDFUNCTIONCALL\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.UndocumentedFunctionCall),\n },\n TIMECOMPRESSION: {\n ...achievementData[\"TIMECOMPRESSION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.TimeCompression),\n },\n REALITYALTERATION: {\n ...achievementData[\"REALITYALTERATION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.RealityAlteration),\n },\n N00DLES: {\n ...achievementData[\"N00DLES\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.N00dles),\n },\n EDITSAVEFILE: {\n ...achievementData[\"EDITSAVEFILE\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.EditSaveFile),\n },\n UNACHIEVABLE: {\n ...achievementData[\"UNACHIEVABLE\"],\n Icon: \"SF-1\",\n Secret: true,\n // Hey Players! Yes, you're supposed to modify this to get the achievement!\n Condition: () => false,\n },\n CHALLENGE_BN13: {\n ...achievementData[\"CHALLENGE_BN13\"],\n Icon: \"BN13+\",\n Visible: () => hasAccessToSF(Player, 13),\n Condition: () =>\n Player.bitNodeN === 13 &&\n bitNodeFinishedState() &&\n !Player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1),\n },\n DEVMENU: {\n ...achievementData[\"DEVMENU\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.YoureNotMeantToAccessThis),\n },\n RAINBOW: {\n ...achievementData[\"RAINBOW\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.INeedARainbow),\n },\n TRUE_RECURSION: {\n ...achievementData[\"TRUE_RECURSION\"],\n Icon: \"SF-1\",\n Secret: true,\n Condition: () => Player.exploits.includes(Exploit.TrueRecursion),\n },\n};\n\n// Steam has a limit of 100 achievement. So these were planned but commented for now.\n// { ID: FactionNames.ECorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.ECorp) },\n// { ID: FactionNames.MegaCorp.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.MegaCorp) },\n// { ID: \"BACHMAN_&_ASSOCIATES\", Condition: () => Player.factions.includes(FactionNames.BachmanAssociates) },\n// { ID: \"BLADE_INDUSTRIES\", Condition: () => Player.factions.includes(FactionNames.BladeIndustries) },\n// { ID: FactionNames.NWO.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.NWO) },\n// { ID: \"CLARKE_INCORPORATED\", Condition: () => Player.factions.includes(FactionNames.ClarkeIncorporated) },\n// { ID: \"OMNITEK_INCORPORATED\", Condition: () => Player.factions.includes(FactionNames.OmniTekIncorporated) },\n// { ID: \"FOUR_SIGMA\", Condition: () => Player.factions.includes(FactionNames.FourSigma) },\n// { ID: \"KUAIGONG_INTERNATIONAL\", Condition: () => Player.factions.includes(FactionNames.KuaiGongInternational) },\n// { ID: \"FULCRUM_SECRET_TECHNOLOGIES\", Condition: () => Player.factions.includes(FactionNames.FulcrumSecretTechnologies) },\n// { ID: FactionNames.Aevum.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Aevum) },\n// { ID: FactionNames.Chongqing.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Chongqing) },\n// { ID: FactionNames.Ishima.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Ishima) },\n// { ID: \"NEW_TOKYO\", Condition: () => Player.factions.includes(FactionNames.NewTokyo) },\n// { ID: \"SECTOR-12\", Condition: () => Player.factions.includes(FactionNames.Sector12) },\n// { ID: FactionNames.Volhaven.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Volhaven) },\n// { ID: \"SPEAKERS_FOR_THE_DEAD\", Condition: () => Player.factions.includes(FactionNames.SpeakersForTheDead) },\n// { ID: \"THE_DARK_ARMY\", Condition: () => Player.factions.includes(FactionNames.TheDarkArmy) },\n// { ID: \"THE_SYNDICATE\", Condition: () => Player.factions.includes(FactionNames.TheSyndicate) },\n// { ID: FactionNames.Silhouette.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Silhouette) },\n// { ID: FactionNames.Tetrads.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Tetrads) },\n// { ID: \"SLUM_SNAKES\", Condition: () => Player.factions.includes(FactionNames.SlumSnakes) },\n// { ID: FactionNames.Netburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Netburners) },\n// { ID: \"TIAN_DI_HUI\", Condition: () => Player.factions.includes(FactionNames.TianDiHui) },\n// { ID: FactionNames.Bladeburners.toUpperCase(), Condition: () => Player.factions.includes(FactionNames.Bladeburners) },\n// { ID: \"DEEPSCANV1.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV1.name) },\n// { ID: \"DEEPSCANV2.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.DeepscanV2.name) },\n// { ID: \"INFILTRATORS\", Condition: () => Player.factions.includes(FactionNames.Infiltrators) },\n// {\n// ID: \"SERVERPROFILER.EXE\",\n// Condition: () => Player.getHomeComputer().programs.includes(Programs.ServerProfiler.name),\n// },\n// { ID: \"AUTOLINK.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.AutoLink.name) },\n// { ID: \"FLIGHT.EXE\", Condition: () => Player.getHomeComputer().programs.includes(Programs.Flight.name) },\n\nexport function calculateAchievements(): void {\n const playerAchievements = Player.achievements.map((a) => a.ID);\n\n const missingAchievements = Object.values(achievements)\n .filter((a) => !playerAchievements.includes(a.ID) && a.Condition())\n // callback returns array of achievement id and id of any in the additional list, flatmap means we have only a 1D array\n .flatMap((a) => [a.ID, ...(a.AdditionalUnlock || [])]);\n\n for (const id of missingAchievements) {\n Player.giveAchievement(id);\n }\n\n // Write all player's achievements to document for Steam/Electron\n // This could be replaced by \"availableAchievements\"\n // if we don't want to grant the save game achievements to steam but only currently available\n document.achievements = [...Player.achievements.map((a) => a.ID)];\n}\n","export function calculateIntelligenceBonus(intelligence: number, weight = 1): number {\n return 1 + (weight * Math.pow(intelligence, 0.8)) / 600;\n}\n","import { CompanyPosition } from \"./CompanyPosition\";\nimport * as posNames from \"./data/companypositionnames\";\nimport { favorToRep, repToFavor } from \"../Faction/formulas/favor\";\n\nimport { IMap } from \"../types\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IConstructorParams {\n name: string;\n info: string;\n companyPositions: IMap;\n expMultiplier: number;\n salaryMultiplier: number;\n jobStatReqOffset: number;\n isMegacorp?: boolean;\n}\n\nconst DefaultConstructorParams: IConstructorParams = {\n name: \"\",\n info: \"\",\n companyPositions: {},\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n};\n\nexport class Company {\n /**\n * Company name\n */\n name: string;\n\n /**\n * Description and general information about company\n */\n info: string;\n\n /**\n * Has faction associated.\n */\n isMegacorp: boolean;\n\n /**\n * Object that holds all available positions in this Company.\n * Position names are held in keys.\n * The values for the keys don't matter, but we'll make them booleans\n *\n * Must match names of Company Positions, defined in data/companypositionnames.ts\n */\n companyPositions: IMap;\n\n /**\n * Company-specific multiplier for earnings\n */\n expMultiplier: number;\n salaryMultiplier: number;\n\n /**\n * The additional levels of stats you need to quality for a job\n * in this company.\n *\n * For example, the base stat requirement for an intern position is 1.\n * But if a company has a offset of 200, then you would need stat(s) of 201\n */\n jobStatReqOffset: number;\n\n /**\n * Properties to track the player's progress in this company\n */\n isPlayerEmployed: boolean;\n playerReputation: number;\n favor: number;\n\n constructor(p: IConstructorParams = DefaultConstructorParams) {\n this.name = p.name;\n this.info = p.info;\n this.companyPositions = p.companyPositions;\n this.expMultiplier = p.expMultiplier;\n this.salaryMultiplier = p.salaryMultiplier;\n this.jobStatReqOffset = p.jobStatReqOffset;\n\n this.isPlayerEmployed = false;\n this.playerReputation = 1;\n this.favor = 0;\n this.isMegacorp = false;\n if (p.isMegacorp) this.isMegacorp = true;\n }\n\n hasPosition(pos: CompanyPosition | string): boolean {\n if (pos instanceof CompanyPosition) {\n return this.companyPositions[pos.name] != null;\n } else {\n return this.companyPositions[pos] != null;\n }\n }\n\n hasAgentPositions(): boolean {\n return this.companyPositions[posNames.AgentCompanyPositions[0]] != null;\n }\n\n hasBusinessConsultantPositions(): boolean {\n return this.companyPositions[posNames.BusinessConsultantCompanyPositions[0]] != null;\n }\n\n hasBusinessPositions(): boolean {\n return this.companyPositions[posNames.BusinessCompanyPositions[0]] != null;\n }\n\n hasEmployeePositions(): boolean {\n return this.companyPositions[posNames.MiscCompanyPositions[1]] != null;\n }\n\n hasITPositions(): boolean {\n return this.companyPositions[posNames.ITCompanyPositions[0]] != null;\n }\n\n hasSecurityPositions(): boolean {\n return this.companyPositions[posNames.SecurityCompanyPositions[2]] != null;\n }\n\n hasSoftwareConsultantPositions(): boolean {\n return this.companyPositions[posNames.SoftwareConsultantCompanyPositions[0]] != null;\n }\n\n hasSoftwarePositions(): boolean {\n return this.companyPositions[posNames.SoftwareCompanyPositions[0]] != null;\n }\n\n hasWaiterPositions(): boolean {\n return this.companyPositions[posNames.MiscCompanyPositions[0]] != null;\n }\n\n gainFavor(): void {\n if (this.favor == null) {\n this.favor = 0;\n }\n this.favor += this.getFavorGain();\n }\n\n getFavorGain(): number {\n if (this.favor == null) {\n this.favor = 0;\n }\n const storedRep = Math.max(0, favorToRep(this.favor));\n const totalRep = storedRep + this.playerReputation;\n const newFavor = repToFavor(totalRep);\n return newFavor - this.favor;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Company\", this);\n }\n\n /**\n * Initiatizes a Company from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Company {\n return Generic_fromJSON(Company, value.data);\n }\n}\n\nReviver.constructors.Company = Company;\n","/**\n * Returns the input array as a comma separated string.\n *\n * Does several things that Array.toString() doesn't do\n * - Adds brackets around the array\n * - Adds quotation marks around strings\n */\nexport function arrayToString(a: unknown[]): string {\n const vals: unknown[] = [];\n for (let i = 0; i < a.length; ++i) {\n let elem: unknown = a[i];\n if (Array.isArray(elem)) {\n elem = arrayToString(elem);\n } else if (typeof elem === \"string\") {\n elem = `\"${elem}\"`;\n }\n vals.push(elem);\n }\n\n return `[${vals.join(\", \")}]`;\n}\n","import React from \"react\";\nimport { MathJax, MathJaxContext } from \"better-react-mathjax\";\n\ninterface IProps {\n children: React.ReactNode;\n}\n\nexport function MathJaxWrapper({ children }: IProps): React.ReactElement {\n return (\n \n {children}\n \n );\n}\n","import { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ninterface IError {\n fileName?: string;\n lineNumber?: number;\n}\n\nexport const isIError = (v: unknown): v is IError => {\n if (typeof v !== \"object\" || v == null) return false;\n return v.hasOwnProperty(\"fileName\") && v.hasOwnProperty(\"lineNumber\");\n};\n\nexport function exceptionAlert(e: unknown): void {\n console.error(e);\n let msg = \"\";\n let file = \"UNKNOWN FILE NAME\";\n let line = \"UNKNOWN LINE NUMBER\";\n if (isIError(e)) {\n file = e.fileName ?? file;\n line = e.lineNumber?.toString() ?? line;\n } else {\n msg = String(e);\n }\n dialogBoxCreate(\n \"Caught an exception: \" +\n msg +\n \"

\" +\n \"Filename: \" +\n file +\n \"

\" +\n \"Line Number: \" +\n line +\n \"

\" +\n \"This is a bug, please report to game developer with this \" +\n \"message as well as details about how to reproduce the bug.

\" +\n \"If you want to be safe, I suggest refreshing the game WITHOUT saving so that your \" +\n \"save doesn't get corrupted\",\n );\n}\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { GeneralActions } from \"../../../Bladeburner/data/GeneralActions\";\nimport { WorkStats } from \"../../../Work/WorkStats\";\n\ninterface SleeveBladeburnerWorkParams {\n type: string;\n name: string;\n}\n\nexport const isSleeveBladeburnerWork = (w: Work | null): w is SleeveBladeburnerWork =>\n w !== null && w.type === WorkType.BLADEBURNER;\n\nexport class SleeveBladeburnerWork extends Work {\n cyclesWorked = 0;\n actionType: string;\n actionName: string;\n\n constructor(params?: SleeveBladeburnerWorkParams) {\n super(WorkType.BLADEBURNER);\n this.actionType = params?.type ?? \"General\";\n this.actionName = params?.name ?? \"Field analysis\";\n }\n\n cyclesNeeded(player: IPlayer, sleeve: Sleeve): number {\n const ret = player.bladeburner?.getActionTimeNetscriptFn(sleeve, this.actionType, this.actionName);\n if (!ret || typeof ret === \"string\") throw new Error(`Error querying ${this.actionName} time`);\n return ret / CONSTANTS._idleSpeed;\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n if (!player.bladeburner) throw new Error(\"sleeve doing blade work without being a member\");\n this.cyclesWorked += cycles;\n const actionIdent = player.bladeburner.getActionIdFromTypeAndName(this.actionType, this.actionName);\n if (!actionIdent) throw new Error(`Error getting ${this.actionName} action`);\n if (this.actionType === \"Contracts\") {\n const action = player.bladeburner.getActionObject(actionIdent);\n if (!action) throw new Error(`Error getting ${this.actionName} action object`);\n if (action.count <= 0) {\n sleeve.stopWork(player);\n return 0;\n }\n }\n\n while (this.cyclesWorked > this.cyclesNeeded(player, sleeve)) {\n if (this.actionType === \"Contracts\") {\n const action = player.bladeburner.getActionObject(actionIdent);\n if (!action) throw new Error(`Error getting ${this.actionName} action object`);\n if (action.count <= 0) {\n sleeve.stopWork(player);\n return 0;\n }\n }\n const retValue = player.bladeburner.completeAction(player, sleeve, actionIdent, false);\n let exp: WorkStats | undefined;\n if (this.actionType === \"General\") {\n exp = GeneralActions[this.actionName]?.exp;\n if (!exp) throw new Error(`Somehow there was no exp for action ${this.actionType} ${this.actionName}`);\n applySleeveGains(player, sleeve, exp, 1);\n }\n player.gainMoney(retValue.money, \"sleeves\");\n player.gainStats(retValue);\n this.cyclesWorked -= this.cyclesNeeded(player, sleeve);\n }\n return 0;\n }\n\n APICopy(): Record {\n return {\n actionType: this.actionType,\n actionName: this.actionName,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveBladeburnerWork\", this);\n }\n\n /**\n * Initiatizes a BladeburnerWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveBladeburnerWork {\n return Generic_fromJSON(SleeveBladeburnerWork, value.data);\n }\n}\n\nReviver.constructors.SleeveBladeburnerWork = SleeveBladeburnerWork;\n","export interface CorporationUnlockUpgrade {\n index: number;\n price: number;\n name: string;\n desc: string;\n}\n\nexport enum CorporationUnlockUpgradeIndex {\n Export = 0,\n SmartSupply = 1,\n MarketResearchDemand = 2,\n MarketDataCompetition = 3,\n VeChain = 4,\n ShadyAccounting = 5,\n GovernmentPartnership = 6,\n WarehouseAPI = 7,\n OfficeAPI = 8,\n}\n\n// Corporation Unlock Upgrades\n// Upgrades for entire corporation, unlocks features, either you have it or you dont\nexport const CorporationUnlockUpgrades: Record = {\n //Lets you export goods\n [CorporationUnlockUpgradeIndex.Export]: {\n index: 0,\n price: 20e9,\n name: \"Export\",\n desc:\n \"Develop infrastructure to export your materials to your other facilities. \" +\n \"This allows you to move materials around between different divisions and cities.\",\n },\n\n //Lets you buy exactly however many required materials you need for production\n [CorporationUnlockUpgradeIndex.SmartSupply]: {\n index: 1,\n price: 25e9,\n name: \"Smart Supply\",\n desc:\n \"Use advanced AI to anticipate your supply needs. \" +\n \"This allows you to purchase exactly however many materials you need for production.\",\n },\n\n //Displays each material/product's demand\n [CorporationUnlockUpgradeIndex.MarketResearchDemand]: {\n index: 2,\n price: 5e9,\n name: \"Market Research - Demand\",\n desc:\n \"Mine and analyze market data to determine the demand of all resources. \" +\n \"The demand attribute, which affects sales, will be displayed for every material and product.\",\n },\n\n //Display's each material/product's competition\n [CorporationUnlockUpgradeIndex.MarketDataCompetition]: {\n index: 3,\n price: 5e9,\n name: \"Market Data - Competition\",\n desc:\n \"Mine and analyze market data to determine how much competition there is on the market \" +\n \"for all resources. The competition attribute, which affects sales, will be displayed for \" +\n \"every material and product.\",\n },\n [CorporationUnlockUpgradeIndex.VeChain]: {\n index: 4,\n price: 10e9,\n name: \"VeChain\",\n desc:\n \"Use AI and blockchain technology to identify where you can improve your supply chain systems. \" +\n \"This upgrade will allow you to view a wide array of useful statistics about your \" +\n \"Corporation.\",\n },\n [CorporationUnlockUpgradeIndex.ShadyAccounting]: {\n index: 5,\n price: 500e12,\n name: \"Shady Accounting\",\n desc:\n \"Utilize unscrupulous accounting practices and pay off government officials to save money \" +\n \"on taxes. This reduces the dividend tax rate by 5%.\",\n },\n [CorporationUnlockUpgradeIndex.GovernmentPartnership]: {\n index: 6,\n price: 2e15,\n name: \"Government Partnership\",\n desc:\n \"Help national governments further their agendas in exchange for lowered taxes. \" +\n \"This reduces the dividend tax rate by 10%\",\n },\n [CorporationUnlockUpgradeIndex.WarehouseAPI]: {\n index: 7,\n price: 50e9,\n name: \"Warehouse API\",\n desc: \"Enables the warehouse API.\",\n },\n [CorporationUnlockUpgradeIndex.OfficeAPI]: {\n index: 8,\n price: 50e9,\n name: \"Office API\",\n desc: \"Enables the office API.\",\n },\n};\n","import { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { GraftableAugmentation } from \"./GraftableAugmentation\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport const getGraftingAvailableAugs = (player: IPlayer): string[] => {\n const augs: string[] = [];\n\n for (const [augName, aug] of Object.entries(StaticAugmentations)) {\n if (aug.isSpecial) continue;\n augs.push(augName);\n }\n\n return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation));\n};\n\nexport const graftingIntBonus = (player: IPlayer): number => {\n return 1 + (player.getIntelligenceBonus(3) - 1) / 3;\n};\n\nexport const calculateGraftingTimeWithBonus = (player: IPlayer, aug: GraftableAugmentation): number => {\n const baseTime = aug.time;\n return baseTime / graftingIntBonus(player);\n};\n","import { BlackOperation } from \"./BlackOperation\";\nimport { IMap } from \"../types\";\nimport { BlackOperationNames } from \"./data/BlackOperationNames\";\n\nexport const BlackOperations: IMap = {};\n\n(function () {\n BlackOperations[BlackOperationNames.OperationTyphoon] = new BlackOperation({\n name: BlackOperationNames.OperationTyphoon,\n baseDifficulty: 2000,\n reqdRank: 2.5e3,\n rankGain: 50,\n rankLoss: 10,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationZero] = new BlackOperation({\n name: BlackOperationNames.OperationZero,\n baseDifficulty: 2500,\n reqdRank: 5e3,\n rankGain: 60,\n rankLoss: 15,\n hpLoss: 50,\n weights: {\n hack: 0.2,\n str: 0.15,\n def: 0.15,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[BlackOperationNames.OperationX] = new BlackOperation({\n name: BlackOperationNames.OperationX,\n baseDifficulty: 3000,\n reqdRank: 7.5e3,\n rankGain: 75,\n rankLoss: 15,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationTitan] = new BlackOperation({\n name: BlackOperationNames.OperationTitan,\n baseDifficulty: 4000,\n reqdRank: 10e3,\n rankGain: 100,\n rankLoss: 20,\n hpLoss: 100,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationAres] = new BlackOperation({\n name: BlackOperationNames.OperationAres,\n baseDifficulty: 5000,\n reqdRank: 12.5e3,\n rankGain: 125,\n rankLoss: 20,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationArchangel] = new BlackOperation({\n name: BlackOperationNames.OperationArchangel,\n baseDifficulty: 7500,\n reqdRank: 15e3,\n rankGain: 200,\n rankLoss: 20,\n hpLoss: 25,\n weights: {\n hack: 0,\n str: 0.2,\n def: 0.2,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationJuggernaut] = new BlackOperation({\n name: BlackOperationNames.OperationJuggernaut,\n baseDifficulty: 10e3,\n reqdRank: 20e3,\n rankGain: 300,\n rankLoss: 40,\n hpLoss: 300,\n weights: {\n hack: 0,\n str: 0.25,\n def: 0.25,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationRedDragon] = new BlackOperation({\n name: BlackOperationNames.OperationRedDragon,\n baseDifficulty: 12.5e3,\n reqdRank: 25e3,\n rankGain: 500,\n rankLoss: 50,\n hpLoss: 500,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationK] = new BlackOperation({\n name: BlackOperationNames.OperationK,\n baseDifficulty: 15e3,\n reqdRank: 30e3,\n rankGain: 750,\n rankLoss: 60,\n hpLoss: 1000,\n weights: {\n hack: 0.05,\n str: 0.2,\n def: 0.2,\n dex: 0.25,\n agi: 0.25,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationDeckard] = new BlackOperation({\n name: BlackOperationNames.OperationDeckard,\n baseDifficulty: 20e3,\n reqdRank: 40e3,\n rankGain: 1e3,\n rankLoss: 75,\n hpLoss: 200,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationTyrell] = new BlackOperation({\n name: BlackOperationNames.OperationTyrell,\n baseDifficulty: 25e3,\n reqdRank: 50e3,\n rankGain: 1.5e3,\n rankLoss: 100,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationWallace] = new BlackOperation({\n name: BlackOperationNames.OperationWallace,\n baseDifficulty: 30e3,\n reqdRank: 75e3,\n rankGain: 2e3,\n rankLoss: 150,\n hpLoss: 1500,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationShoulderOfOrion] = new BlackOperation({\n name: BlackOperationNames.OperationShoulderOfOrion,\n baseDifficulty: 35e3,\n reqdRank: 100e3,\n rankGain: 2.5e3,\n rankLoss: 500,\n hpLoss: 1500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[BlackOperationNames.OperationHyron] = new BlackOperation({\n name: BlackOperationNames.OperationHyron,\n baseDifficulty: 40e3,\n reqdRank: 125e3,\n rankGain: 3e3,\n rankLoss: 1e3,\n hpLoss: 500,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationMorpheus] = new BlackOperation({\n name: BlackOperationNames.OperationMorpheus,\n baseDifficulty: 45e3,\n reqdRank: 150e3,\n rankGain: 4e3,\n rankLoss: 1e3,\n hpLoss: 100,\n weights: {\n hack: 0.05,\n str: 0.15,\n def: 0.15,\n dex: 0.3,\n agi: 0.3,\n cha: 0,\n int: 0.05,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isStealth: true,\n });\n BlackOperations[BlackOperationNames.OperationIonStorm] = new BlackOperation({\n name: BlackOperationNames.OperationIonStorm,\n baseDifficulty: 50e3,\n reqdRank: 175e3,\n rankGain: 5e3,\n rankLoss: 1e3,\n hpLoss: 5000,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationAnnihilus] = new BlackOperation({\n name: BlackOperationNames.OperationAnnihilus,\n baseDifficulty: 55e3,\n reqdRank: 200e3,\n rankGain: 7.5e3,\n rankLoss: 1e3,\n hpLoss: 10e3,\n weights: {\n hack: 0,\n str: 0.24,\n def: 0.24,\n dex: 0.24,\n agi: 0.24,\n cha: 0,\n int: 0.04,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationUltron] = new BlackOperation({\n name: BlackOperationNames.OperationUltron,\n baseDifficulty: 60e3,\n reqdRank: 250e3,\n rankGain: 10e3,\n rankLoss: 2e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n isKill: true,\n });\n BlackOperations[BlackOperationNames.OperationCenturion] = new BlackOperation({\n name: BlackOperationNames.OperationCenturion,\n baseDifficulty: 70e3,\n reqdRank: 300e3,\n rankGain: 15e3,\n rankLoss: 5e3,\n hpLoss: 10e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[BlackOperationNames.OperationVindictus] = new BlackOperation({\n name: BlackOperationNames.OperationVindictus,\n baseDifficulty: 75e3,\n reqdRank: 350e3,\n rankGain: 20e3,\n rankLoss: 20e3,\n hpLoss: 20e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n BlackOperations[BlackOperationNames.OperationDaedalus] = new BlackOperation({\n name: BlackOperationNames.OperationDaedalus,\n baseDifficulty: 80e3,\n reqdRank: 400e3,\n rankGain: 40e3,\n rankLoss: 10e3,\n hpLoss: 100e3,\n weights: {\n hack: 0.1,\n str: 0.2,\n def: 0.2,\n dex: 0.2,\n agi: 0.2,\n cha: 0,\n int: 0.1,\n },\n decays: {\n hack: 0.6,\n str: 0.8,\n def: 0.8,\n dex: 0.8,\n agi: 0.8,\n cha: 0,\n int: 0.75,\n },\n });\n})();\n","import { Fragment, FragmentById } from \"./Fragment\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IActiveFragmentParams {\n x: number;\n y: number;\n rotation: number;\n fragment: Fragment;\n}\n\nexport class ActiveFragment {\n id: number;\n highestCharge: number;\n numCharge: number;\n rotation: number;\n x: number;\n y: number;\n\n constructor(params?: IActiveFragmentParams) {\n if (params) {\n this.id = params.fragment.id;\n this.x = params.x;\n this.y = params.y;\n this.highestCharge = 0;\n this.numCharge = 0;\n this.rotation = params.rotation;\n } else {\n this.id = -1;\n this.x = -1;\n this.y = -1;\n this.highestCharge = 0;\n this.numCharge = 0;\n this.rotation = 0;\n }\n }\n\n collide(other: ActiveFragment): boolean {\n const thisFragment = this.fragment();\n const otherFragment = other.fragment();\n // These 2 variables converts 'this' local coordinates to world to other local.\n const dx: number = other.x - this.x;\n const dy: number = other.y - this.y;\n const fragSize = Math.max(thisFragment.shape.length, thisFragment.shape[0].length);\n for (let j = 0; j < fragSize; j++) {\n for (let i = 0; i < fragSize; i++) {\n if (thisFragment.fullAt(i, j, this.rotation) && otherFragment.fullAt(i - dx, j - dy, other.rotation))\n return true;\n }\n }\n\n return false;\n }\n\n fragment(): Fragment {\n const fragment = FragmentById(this.id);\n if (fragment === null) throw new Error(\"ActiveFragment id refers to unknown Fragment.\");\n return fragment;\n }\n\n fullAt(worldX: number, worldY: number): boolean {\n return this.fragment().fullAt(worldX - this.x, worldY - this.y, this.rotation);\n }\n\n neighboors(): number[][] {\n return this.fragment()\n .neighboors(this.rotation)\n .map((cell) => [this.x + cell[0], this.y + cell[1]]);\n }\n\n copy(): ActiveFragment {\n return Object.assign({}, this);\n }\n\n /**\n * Serialize an active fragment to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"ActiveFragment\", this);\n }\n\n /**\n * Initializes an acive fragment from a JSON save state\n */\n static fromJSON(value: IReviverValue): ActiveFragment {\n return Generic_fromJSON(ActiveFragment, value.data);\n }\n}\n\nReviver.constructors.ActiveFragment = ActiveFragment;\n","export enum GameOptionsTab {\n SYSTEM,\n INTERFACE,\n GAMEPLAY,\n MISC,\n REMOTE_API,\n}\n","import { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IPerson } from \"../PersonObjects/IPerson\";\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { CrimeType } from \"../utils/WorkType\";\nimport { CrimeWork } from \"../Work/CrimeWork\";\n\ninterface IConstructorParams {\n hacking_success_weight?: number;\n strength_success_weight?: number;\n defense_success_weight?: number;\n dexterity_success_weight?: number;\n agility_success_weight?: number;\n charisma_success_weight?: number;\n hacking_exp?: number;\n strength_exp?: number;\n defense_exp?: number;\n dexterity_exp?: number;\n agility_exp?: number;\n charisma_exp?: number;\n intelligence_exp?: number;\n\n kills?: number;\n}\n\nexport class Crime {\n // Number representing the difficulty of the crime. Used for success chance calculations\n difficulty = 0;\n\n // Amount of karma lost for SUCCESSFULLY committing this crime\n karma = 0;\n\n // How many people die as a result of this crime\n kills = 0;\n\n // How much money is given by the\n money = 0;\n\n // Name of crime\n name = \"\";\n\n // Name of crime as it appears on work screen: \"You are attempting...\"\n workName = \"\";\n\n // Milliseconds it takes to attempt the crime\n time = 0;\n\n // Corresponding type in CONSTANTS. Contains a description for the crime activity\n type: CrimeType;\n\n // Weighting factors that determine how stats affect the success rate of this crime\n hacking_success_weight = 0;\n strength_success_weight = 0;\n defense_success_weight = 0;\n dexterity_success_weight = 0;\n agility_success_weight = 0;\n charisma_success_weight = 0;\n\n // How much stat experience is granted by this crime\n hacking_exp = 0;\n strength_exp = 0;\n defense_exp = 0;\n dexterity_exp = 0;\n agility_exp = 0;\n charisma_exp = 0;\n intelligence_exp = 0;\n\n constructor(\n name = \"\",\n workName = \"\",\n type: CrimeType,\n time = 0,\n money = 0,\n difficulty = 0,\n karma = 0,\n params: IConstructorParams = {},\n ) {\n this.name = name;\n this.workName = workName;\n this.type = type;\n this.time = time;\n this.money = money;\n this.difficulty = difficulty;\n this.karma = karma;\n\n this.hacking_success_weight = params.hacking_success_weight ? params.hacking_success_weight : 0;\n this.strength_success_weight = params.strength_success_weight ? params.strength_success_weight : 0;\n this.defense_success_weight = params.defense_success_weight ? params.defense_success_weight : 0;\n this.dexterity_success_weight = params.dexterity_success_weight ? params.dexterity_success_weight : 0;\n this.agility_success_weight = params.agility_success_weight ? params.agility_success_weight : 0;\n this.charisma_success_weight = params.charisma_success_weight ? params.charisma_success_weight : 0;\n\n this.hacking_exp = params.hacking_exp ? params.hacking_exp : 0;\n this.strength_exp = params.strength_exp ? params.strength_exp : 0;\n this.defense_exp = params.defense_exp ? params.defense_exp : 0;\n this.dexterity_exp = params.dexterity_exp ? params.dexterity_exp : 0;\n this.agility_exp = params.agility_exp ? params.agility_exp : 0;\n this.charisma_exp = params.charisma_exp ? params.charisma_exp : 0;\n this.intelligence_exp = params.intelligence_exp ? params.intelligence_exp : 0;\n\n this.kills = params.kills ? params.kills : 0;\n }\n\n commit(p: IPlayer, div = 1, workerScript: WorkerScript | null = null): number {\n if (div <= 0) {\n div = 1;\n }\n p.startWork(\n new CrimeWork({\n crimeType: this.type,\n singularity: workerScript !== null,\n }),\n );\n\n return this.time;\n }\n\n successRate(p: IPerson): number {\n let chance: number =\n this.hacking_success_weight * p.skills.hacking +\n this.strength_success_weight * p.skills.strength +\n this.defense_success_weight * p.skills.defense +\n this.dexterity_success_weight * p.skills.dexterity +\n this.agility_success_weight * p.skills.agility +\n this.charisma_success_weight * p.skills.charisma +\n CONSTANTS.IntelligenceCrimeWeight * p.skills.intelligence;\n chance /= CONSTANTS.MaxSkillLevel;\n chance /= this.difficulty;\n chance *= p.mults.crime_success;\n chance *= p.getIntelligenceBonus(1);\n\n return Math.min(chance, 1);\n }\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Hashes } from \"./Hashes\";\n\nexport function HashRate({ hashes }: { hashes: number }): React.ReactElement {\n return ;\n}\n","import { MessageFilenames } from \"./MessageHelpers\";\n\nexport class Message {\n // Name of Message file\n filename: MessageFilenames;\n\n // The text contains in the Message\n msg: string;\n\n constructor(filename: MessageFilenames, msg: string) {\n this.filename = filename;\n this.msg = msg;\n }\n}\n","/**\n * React Component for a button that's used to apply for a job\n */\nimport * as React from \"react\";\n\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { getJobRequirementText } from \"../../Company/GetJobRequirementText\";\n\nimport { use } from \"../../ui/Context\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ntype IProps = {\n company: Company;\n entryPosType: CompanyPosition;\n onClick: (e: React.MouseEvent) => void;\n text: string;\n};\n\nexport function ApplyToJobButton(props: IProps): React.ReactElement {\n const player = use.Player();\n\n function getJobRequirementTooltip(): string {\n const pos = player.getNextCompanyPosition(props.company, props.entryPosType);\n if (pos == null) {\n return \"\";\n }\n\n if (!props.company.hasPosition(pos)) {\n return \"\";\n }\n\n return getJobRequirementText(props.company, pos, true);\n }\n\n return (\n <>\n }>\n \n \n \n );\n}\n","// The Research Map is an object that holds all Corporation Research objects\n// as values. They are identified by their names\nimport { Research, IConstructorParams } from \"./Research\";\nimport { researchMetadata } from \"./data/ResearchMetadata\";\nimport { IMap } from \"../types\";\n\nexport const ResearchMap: IMap = {};\n\nfunction addResearch(p: IConstructorParams): void {\n if (ResearchMap[p.name] != null) {\n console.warn(`Duplicate Research being defined: ${p.name}`);\n }\n ResearchMap[p.name] = new Research(p);\n}\n\nfor (const metadata of researchMetadata) {\n addResearch(metadata);\n}\n","/**\n * Event emitter that triggers when scripts are started/stopped\n */\nimport { EventEmitter } from \"../utils/EventEmitter\";\n\nexport const WorkerScriptStartStopEventEmitter = new EventEmitter<[]>();\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { calculateFactionExp } from \"../../../Work/formulas/Faction\";\nimport { Faction } from \"../../../Faction/Faction\";\nimport {\n getFactionFieldWorkRepGain,\n getFactionSecurityWorkRepGain,\n getHackingWorkRepGain,\n} from \"../../../PersonObjects/formulas/reputation\";\nimport { scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\nimport { BitNodeMultipliers } from \"../../../BitNode/BitNodeMultipliers\";\n\ninterface SleeveFactionWorkParams {\n factionWorkType: FactionWorkType;\n factionName: string;\n}\n\nexport const isSleeveFactionWork = (w: Work | null): w is SleeveFactionWork =>\n w !== null && w.type === WorkType.FACTION;\n\nexport class SleeveFactionWork extends Work {\n factionWorkType: FactionWorkType;\n factionName: string;\n\n constructor(params?: SleeveFactionWorkParams) {\n super(WorkType.FACTION);\n this.factionWorkType = params?.factionWorkType ?? FactionWorkType.HACKING;\n this.factionName = params?.factionName ?? FactionNames.Sector12;\n }\n\n getExpRates(sleeve: Sleeve): WorkStats {\n return scaleWorkStats(calculateFactionExp(sleeve, this.factionWorkType), sleeve.shockBonus());\n }\n\n getReputationRate(sleeve: Sleeve): number {\n const faction = this.getFaction();\n const repFormulas = {\n [FactionWorkType.HACKING]: getHackingWorkRepGain,\n [FactionWorkType.FIELD]: getFactionFieldWorkRepGain,\n [FactionWorkType.SECURITY]: getFactionSecurityWorkRepGain,\n };\n return (\n repFormulas[this.factionWorkType](sleeve, faction.favor) *\n sleeve.shockBonus() *\n BitNodeMultipliers.FactionWorkRepGain\n );\n }\n\n getFaction(): Faction {\n const f = Factions[this.factionName];\n if (!f) throw new Error(`Faction work started with invalid / unknown faction: '${this.factionName}'`);\n return f;\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n if (player.gang) {\n if (this.factionName === player.gang.facName) {\n sleeve.stopWork(player);\n return 0;\n }\n }\n\n const exp = this.getExpRates(sleeve);\n applySleeveGains(player, sleeve, exp, cycles);\n const rep = this.getReputationRate(sleeve);\n this.getFaction().playerReputation += rep;\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n factionWorkType: this.factionWorkType,\n factionName: this.factionName,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveFactionWork\", this);\n }\n\n /**\n * Initiatizes a FactionWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveFactionWork {\n return Generic_fromJSON(SleeveFactionWork, value.data);\n }\n}\n\nReviver.constructors.SleeveFactionWork = SleeveFactionWork;\n","import { Player } from \"./Player\";\nimport { Router } from \"./ui/GameRoot\";\nimport { removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { Terminal } from \"./Terminal\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\nimport { IMap, IReturnStatus } from \"./types\";\nimport { GetServer } from \"./Server/AllServers\";\nimport { ImportPlayerData, SaveData, saveObject } from \"./SaveObject\";\nimport { Settings } from \"./Settings/Settings\";\nimport { exportScripts } from \"./Terminal/commands/download\";\nimport { CONSTANTS } from \"./Constants\";\nimport { hash } from \"./hash/hash\";\n\ninterface IReturnWebStatus extends IReturnStatus {\n data?: Record;\n}\n\ndeclare global {\n interface Window {\n appNotifier: {\n terminal: (message: string, type?: string) => void;\n toast: (message: string, type: ToastVariant, duration?: number) => void;\n };\n appSaveFns: {\n triggerSave: () => Promise;\n triggerGameExport: () => void;\n triggerScriptsExport: () => void;\n getSaveData: () => { save: string; fileName: string };\n getSaveInfo: (base64save: string) => Promise;\n pushSaveData: (base64save: string, automatic?: boolean) => void;\n };\n electronBridge: {\n send: (channel: string, data?: unknown) => void;\n receive: (channel: string, func: (...args: unknown[]) => void) => void;\n };\n }\n interface Document {\n getFiles: () => IReturnWebStatus;\n deleteFile: (filename: string) => IReturnWebStatus;\n saveFile: (filename: string, code: string) => IReturnWebStatus;\n }\n}\n\nexport function initElectron(): void {\n const userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.indexOf(\" electron/\") > -1) {\n // Electron-specific code\n document.achievements = [];\n initWebserver();\n initAppNotifier();\n initSaveFunctions();\n initElectronBridge();\n }\n}\n\nfunction initWebserver(): void {\n function normalizeFileName(filename: string): string {\n filename = filename.replace(/\\/\\/+/g, \"/\");\n filename = removeLeadingSlash(filename);\n if (filename.includes(\"/\")) {\n filename = \"/\" + removeLeadingSlash(filename);\n }\n return filename;\n }\n\n document.getFiles = function (): IReturnWebStatus {\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n return {\n res: true,\n data: {\n files: home.scripts.map((script) => ({\n filename: script.filename,\n code: script.code,\n ramUsage: script.ramUsage,\n })),\n },\n };\n };\n\n document.deleteFile = function (filename: string): IReturnWebStatus {\n filename = normalizeFileName(filename);\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n return home.removeFile(filename);\n };\n\n document.saveFile = function (filename: string, code: string): IReturnWebStatus {\n filename = normalizeFileName(filename);\n\n code = Buffer.from(code, \"base64\").toString();\n const home = GetServer(\"home\");\n if (home === null) {\n return {\n res: false,\n msg: \"Home server does not exist.\",\n };\n }\n const { success, overwritten } = home.writeToScriptFile(Player, filename, code);\n let script;\n if (success) {\n script = home.getScript(filename);\n }\n return {\n res: success,\n data: {\n overwritten,\n ramUsage: script?.ramUsage,\n },\n };\n };\n}\n\n// Expose certain alert functions to allow the wrapper to sends message to the game\nfunction initAppNotifier(): void {\n const funcs = {\n terminal: (message: string, type?: string) => {\n const typesFn: IMap<(s: string) => void> = {\n info: Terminal.info,\n warn: Terminal.warn,\n error: Terminal.error,\n success: Terminal.success,\n };\n let fn;\n if (type) fn = typesFn[type];\n if (!fn) fn = Terminal.print;\n fn.bind(Terminal)(message);\n },\n toast: (message: string, type: ToastVariant, duration = 2000) => SnackbarEvents.emit(message, type, duration),\n };\n\n // Will be consumed by the electron wrapper.\n window.appNotifier = funcs;\n}\n\nfunction initSaveFunctions(): void {\n const funcs = {\n triggerSave: (): Promise => saveObject.saveGame(true),\n triggerGameExport: (): void => {\n try {\n saveObject.exportGame();\n } catch (error) {\n console.error(error);\n SnackbarEvents.emit(\"Could not export game.\", ToastVariant.ERROR, 2000);\n }\n },\n triggerScriptsExport: (): void => exportScripts(\"*\", Player.getHomeComputer()),\n getSaveData: (): { save: string; fileName: string } => {\n return {\n save: saveObject.getSaveString(Settings.ExcludeRunningScriptsFromSave),\n fileName: saveObject.getSaveFileName(),\n };\n },\n getSaveInfo: async (base64save: string): Promise => {\n try {\n const data = await saveObject.getImportDataFromString(base64save);\n return data.playerData;\n } catch (error) {\n console.error(error);\n return;\n }\n },\n pushSaveData: (base64save: string, automatic = false): void => Router.toImportSave(base64save, automatic),\n };\n\n // Will be consumed by the electron wrapper.\n window.appSaveFns = funcs;\n}\n\nfunction initElectronBridge(): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.receive(\"get-save-data-request\", () => {\n const data = window.appSaveFns.getSaveData();\n bridge.send(\"get-save-data-response\", data);\n });\n bridge.receive(\"get-save-info-request\", async (save: unknown) => {\n if (typeof save !== \"string\") throw new Error(\"Error while trying to get save info\");\n const data = await window.appSaveFns.getSaveInfo(save);\n bridge.send(\"get-save-info-response\", data);\n });\n bridge.receive(\"push-save-request\", (params: unknown) => {\n if (typeof params !== \"object\") throw new Error(\"Error trying to push save request\");\n const { save, automatic = false } = params as { save: string; automatic: boolean };\n window.appSaveFns.pushSaveData(save, automatic);\n });\n bridge.receive(\"trigger-save\", () => {\n return window.appSaveFns\n .triggerSave()\n .then(() => {\n bridge.send(\"save-completed\");\n })\n .catch((error: unknown) => {\n console.error(error);\n SnackbarEvents.emit(\"Could not save game.\", ToastVariant.ERROR, 2000);\n });\n });\n bridge.receive(\"trigger-game-export\", () => {\n try {\n window.appSaveFns.triggerGameExport();\n } catch (error) {\n console.error(error);\n SnackbarEvents.emit(\"Could not export game.\", ToastVariant.ERROR, 2000);\n }\n });\n bridge.receive(\"trigger-scripts-export\", () => {\n try {\n window.appSaveFns.triggerScriptsExport();\n } catch (error) {\n console.error(error);\n SnackbarEvents.emit(\"Could not export scripts.\", ToastVariant.ERROR, 2000);\n }\n });\n}\n\nexport function pushGameSaved(data: SaveData): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-game-saved\", data);\n}\n\nexport function pushGameReady(): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n // Send basic information to the electron wrapper\n bridge.send(\"push-game-ready\", {\n player: {\n identifier: Player.identifier,\n playtime: Player.totalPlaytime,\n lastSave: Player.lastSave,\n },\n game: {\n version: CONSTANTS.VersionString,\n hash: hash(),\n },\n });\n}\n\nexport function pushImportResult(wasImported: boolean): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-import-result\", { wasImported });\n pushDisableRestore();\n}\n\nexport function pushDisableRestore(): void {\n const bridge = window.electronBridge;\n if (!bridge) return;\n\n bridge.send(\"push-disable-restore\", { duration: 1000 * 60 });\n}\n","import { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { CONSTANTS } from \"../Constants\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Work, WorkType } from \"./Work\";\nimport { Program } from \"../Programs/Program\";\n\nexport const isCreateProgramWork = (w: Work | null): w is CreateProgramWork =>\n w !== null && w.type === WorkType.CREATE_PROGRAM;\n\ninterface CreateProgramWorkParams {\n programName: string;\n singularity: boolean;\n player: IPlayer;\n}\n\nexport class CreateProgramWork extends Work {\n programName: string;\n // amount of effective work completed on the program (time boosted by skills).\n unitCompleted: number;\n\n constructor(params?: CreateProgramWorkParams) {\n super(WorkType.CREATE_PROGRAM, params?.singularity ?? true);\n this.unitCompleted = 0;\n this.programName = params?.programName ?? \"\";\n\n if (params?.player) {\n const player = params.player;\n for (let i = 0; i < player.getHomeComputer().programs.length; ++i) {\n const programFile = player.getHomeComputer().programs[i];\n if (programFile.startsWith(this.programName) && programFile.endsWith(\"%-INC\")) {\n const res = programFile.split(\"-\");\n if (res.length != 3) {\n break;\n }\n const percComplete = Number(res[1].slice(0, -1));\n if (isNaN(percComplete) || percComplete < 0 || percComplete >= 100) {\n break;\n }\n this.unitCompleted = (percComplete / 100) * this.unitNeeded();\n player.getHomeComputer().programs.splice(i, 1);\n }\n }\n }\n }\n\n unitNeeded(): number {\n return this.getProgram().create?.time ?? 0;\n }\n\n getProgram(): Program {\n const p = Object.values(Programs).find((p) => p.name.toLowerCase() === this.programName.toLowerCase());\n if (!p) throw new Error(\"Create program work started with invalid program \" + this.programName);\n return p;\n }\n\n process(player: IPlayer, cycles: number): boolean {\n let focusBonus = 1;\n if (!player.hasAugmentation(AugmentationNames[\"NeuroreceptorManager\"])) {\n focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n //Higher hacking skill will allow you to create programs faster\n const reqLvl = this.getProgram().create?.level ?? 0;\n let skillMult = (player.skills.hacking / reqLvl) * player.getIntelligenceBonus(3); //This should always be greater than 1;\n skillMult = 1 + (skillMult - 1) / 5; //The divider constant can be adjusted as necessary\n skillMult *= focusBonus;\n //Skill multiplier directly applied to \"time worked\"\n this.cyclesWorked += cycles;\n this.unitCompleted += CONSTANTS._idleSpeed * cycles * skillMult;\n\n if (this.unitCompleted >= this.unitNeeded()) {\n return true;\n }\n return false;\n }\n finish(player: IPlayer, cancelled: boolean): void {\n const programName = this.programName;\n if (!cancelled) {\n //Complete case\n player.gainIntelligenceExp(\n (CONSTANTS.IntelligenceProgramBaseExpGain * this.cyclesWorked * CONSTANTS._idleSpeed) / 1000,\n );\n if (!this.singularity) {\n const lines = [\n `You've finished creating ${programName}!`,\n \"The new program can be found on your home computer.\",\n ];\n dialogBoxCreate(lines.join(\"
\"));\n }\n\n if (!player.getHomeComputer().programs.includes(programName)) {\n player.getHomeComputer().programs.push(programName);\n }\n } else if (!player.getHomeComputer().programs.includes(programName)) {\n //Incomplete case\n const perc = ((100 * this.unitCompleted) / this.unitNeeded()).toFixed(2);\n const incompleteName = programName + \"-\" + perc + \"%-INC\";\n player.getHomeComputer().programs.push(incompleteName);\n }\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n programName: this.programName,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CreateProgramWork\", this);\n }\n\n /**\n * Initiatizes a CreateProgramWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): CreateProgramWork {\n return Generic_fromJSON(CreateProgramWork, value.data);\n }\n}\n\nReviver.constructors.CreateProgramWork = CreateProgramWork;\n","// Root React Component for the Corporation UI\nimport React, { useState, useEffect } from \"react\";\n\nimport { Theme, useTheme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Reputation } from \"./Reputation\";\nimport { KillScriptsModal } from \"./KillScriptsModal\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport SaveIcon from \"@mui/icons-material/Save\";\nimport ClearAllIcon from \"@mui/icons-material/ClearAll\";\n\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../Context\";\nimport { StatsProgressOverviewCell } from \"./StatsProgressBar\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nimport { Box, Tooltip } from \"@mui/material\";\n\nimport { isClassWork } from \"../../Work/ClassWork\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { isCreateProgramWork } from \"../../Work/CreateProgramWork\";\nimport { isGraftingWork } from \"../../Work/GraftingWork\";\nimport { isFactionWork } from \"../../Work/FactionWork\";\nimport { ReputationRate } from \"./ReputationRate\";\nimport { isCompanyWork } from \"../../Work/CompanyWork\";\nimport { isCrimeWork } from \"../../Work/CrimeWork\";\n\ninterface IProps {\n save: () => void;\n killScripts: () => void;\n}\n\nfunction Intelligence(): React.ReactElement {\n const theme = useTheme();\n const player = use.Player();\n const classes = useStyles();\n if (player.skills.intelligence === 0) return <>;\n const progress = player.calculateSkillProgress(player.exp.intelligence);\n\n return (\n <>\n \n \n Int \n \n \n \n {numeralWrapper.formatSkill(player.skills.intelligence)}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n\n \n {!Settings.DisableOverviewProgressBars && (\n \n )}\n \n \n );\n}\n\nfunction Bladeburner(): React.ReactElement {\n const player = use.Player();\n const classes = useStyles();\n const bladeburner = player.bladeburner;\n if (bladeburner === null) return <>;\n const action = bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n if (action.type === \"Idle\") return <>;\n return (\n <>\n \n \n Bladeburner:\n \n \n \n \n \n {action.type}: {action.name}\n \n \n \n \n );\n}\n\ninterface WorkInProgressOverviewProps {\n tooltip: React.ReactNode;\n header: React.ReactNode;\n children: React.ReactNode;\n onClickFocus: () => void;\n}\n\nfunction WorkInProgressOverview({\n tooltip,\n children,\n onClickFocus,\n header,\n}: WorkInProgressOverviewProps): React.ReactElement {\n const classes = useStyles();\n return (\n <>\n \n \n {tooltip}}>\n \n {header}\n \n \n \n \n \n \n {children}\n \n \n \n \n \n \n \n \n );\n}\n\nfunction Work(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const onClickFocus = (): void => {\n player.startFocusing();\n router.toWork();\n };\n if (player.currentWork === null || player.focus) return <>;\n\n let details = <>;\n let header = <>;\n let innerText = <>;\n if (isCrimeWork(player.currentWork)) {\n const crime = player.currentWork.getCrime();\n const perc = (player.currentWork.unitCompleted / crime.time) * 100;\n\n details = <>{player.currentWork.crimeType};\n header = <>You are attempting to {player.currentWork.crimeType};\n innerText = <>{perc.toFixed(2)}%;\n }\n if (isClassWork(player.currentWork)) {\n details = <>{player.currentWork.getClass().youAreCurrently};\n header = <>You are {player.currentWork.getClass().youAreCurrently};\n innerText = <>{convertTimeMsToTimeElapsedString(player.currentWork.cyclesWorked * CONSTANTS._idleSpeed)};\n }\n if (isCreateProgramWork(player.currentWork)) {\n const create = player.currentWork;\n details = <>Coding {create.programName};\n header = <>Creating a program;\n innerText = (\n <>\n {create.programName} {((create.unitCompleted / create.unitNeeded()) * 100).toFixed(2)}%\n \n );\n }\n if (isGraftingWork(player.currentWork)) {\n const graft = player.currentWork;\n details = <>Grafting {graft.augmentation};\n header = <>Grafting an Augmentation;\n innerText = (\n <>\n {((graft.unitCompleted / graft.unitNeeded()) * 100).toFixed(2)}% done\n \n );\n }\n\n if (isFactionWork(player.currentWork)) {\n const factionWork = player.currentWork;\n header = (\n <>\n Working for {factionWork.factionName}\n \n );\n innerText = (\n <>\n rep\n
(\n )\n \n );\n }\n if (isCompanyWork(player.currentWork)) {\n const companyWork = player.currentWork;\n details = (\n <>\n {player.jobs[companyWork.companyName]} at {companyWork.companyName}\n \n );\n header = (\n <>\n Working at {companyWork.companyName}\n \n );\n innerText = (\n <>\n rep\n
(\n )\n \n );\n }\n\n return (\n \n {innerText}\n \n );\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n workCell: {\n textAlign: \"center\",\n maxWidth: \"200px\",\n borderBottom: \"none\",\n padding: 0,\n margin: 0,\n },\n\n workHeader: {\n fontSize: \"0.9rem\",\n },\n\n workSubtitles: {\n fontSize: \"0.8rem\",\n },\n\n cellNone: {\n borderBottom: \"none\",\n padding: 0,\n margin: 0,\n },\n cell: {\n padding: 0,\n margin: 0,\n },\n hp: {\n color: theme.colors.hp,\n },\n money: {\n color: theme.colors.money,\n },\n hack: {\n color: theme.colors.hack,\n },\n combat: {\n color: theme.colors.combat,\n },\n cha: {\n color: theme.colors.cha,\n },\n int: {\n color: theme.colors.int,\n },\n }),\n);\n\nexport { useStyles as characterOverviewStyles };\n\nexport function CharacterOverview({ save, killScripts }: IProps): React.ReactElement {\n const [killOpen, setKillOpen] = useState(false);\n const player = use.Player();\n\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 600);\n return () => clearInterval(id);\n }, []);\n\n const classes = useStyles();\n const theme = useTheme();\n\n const hackingProgress = player.calculateSkillProgress(\n player.exp.hacking,\n player.mults.hacking * BitNodeMultipliers.HackingLevelMultiplier,\n );\n const strengthProgress = player.calculateSkillProgress(\n player.exp.strength,\n player.mults.strength * BitNodeMultipliers.StrengthLevelMultiplier,\n );\n const defenseProgress = player.calculateSkillProgress(\n player.exp.defense,\n player.mults.defense * BitNodeMultipliers.DefenseLevelMultiplier,\n );\n const dexterityProgress = player.calculateSkillProgress(\n player.exp.dexterity,\n player.mults.dexterity * BitNodeMultipliers.DexterityLevelMultiplier,\n );\n const agilityProgress = player.calculateSkillProgress(\n player.exp.agility,\n player.mults.agility * BitNodeMultipliers.AgilityLevelMultiplier,\n );\n const charismaProgress = player.calculateSkillProgress(\n player.exp.charisma,\n player.mults.charisma * BitNodeMultipliers.CharismaLevelMultiplier,\n );\n\n return (\n <>\n \n \n \n \n HP \n \n \n \n {numeralWrapper.formatHp(player.hp.current)} / {numeralWrapper.formatHp(player.hp.max)}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n\n \n \n Money \n \n \n {numeralWrapper.formatMoney(player.money)}\n \n \n \n {/*Hook for player scripts*/}\n \n \n \n\n \n \n Hack \n \n \n \n {numeralWrapper.formatSkill(player.skills.hacking)}\n \n \n \n \n {!Settings.DisableOverviewProgressBars && (\n \n )}\n \n \n \n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n\n \n \n Str \n \n \n \n {numeralWrapper.formatSkill(player.skills.strength)}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n {!Settings.DisableOverviewProgressBars && (\n \n )}\n \n\n \n \n Def \n \n \n \n {numeralWrapper.formatSkill(player.skills.defense)}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n {!Settings.DisableOverviewProgressBars && (\n \n )}\n \n\n \n \n Dex \n \n \n \n {numeralWrapper.formatSkill(player.skills.dexterity)}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n {!Settings.DisableOverviewProgressBars && (\n \n )}\n \n\n \n \n Agi \n \n \n \n {numeralWrapper.formatSkill(player.skills.agility)}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n {!Settings.DisableOverviewProgressBars && (\n \n )}\n \n\n \n \n Cha \n \n \n \n {numeralWrapper.formatSkill(player.skills.charisma)}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n {!Settings.DisableOverviewProgressBars && (\n \n )}\n \n\n \n\n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n {/*Hook for player scripts*/}\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n setKillOpen(true)}>\n \n \n \n \n \n \n setKillOpen(false)} killScripts={killScripts} />\n \n );\n}\n","/**\n * Adds a random offset to a number within a certain percentage\n * @example\n * // Returns between 95-105\n * addOffset(100, 5);\n * @example\n * // Returns between 63-77\n * addOffSet(70, 10);\n * @param midpoint The number to be the midpoint of the offset range\n * @param percentage The percentage (in a range of 0-100) to offset\n */\nexport function addOffset(midpoint: number, percentage: number): number {\n const maxPercent = 100;\n if (percentage < 0 || percentage > maxPercent) {\n return midpoint;\n }\n\n const offset: number = midpoint * (percentage / maxPercent);\n\n // Double the range to account for both sides of the midpoint.\n // tslint:disable-next-line:no-magic-numbers\n return midpoint + (Math.random() * (offset * 2) - offset);\n}\n","export class DarkWebItem {\n program: string;\n price: number;\n description: string;\n\n constructor(program: string, price: number, description: string) {\n this.program = program;\n this.price = price;\n this.description = description;\n }\n}\n","export class PlayerOwnedAugmentation {\n level = 1;\n name = \"\";\n\n constructor(name = \"\") {\n this.name = name;\n }\n}\n\nexport interface IPlayerOwnedAugmentation {\n level: number;\n name: string;\n}\n","interface RNG {\n random(): number;\n}\n\n/*\n * very bad RNG, meant to be used as introduction to RNG manipulation. It has a\n * period of 1024.\n */\nclass RNG0 implements RNG {\n x: number;\n m = 1024;\n a = 341;\n c = 1;\n\n constructor() {\n this.x = 0;\n this.reset();\n }\n\n step(): void {\n this.x = (this.a * this.x + this.c) % this.m;\n }\n\n random(): number {\n this.step();\n return this.x / this.m;\n }\n\n reset(): void {\n this.x = new Date().getTime() % this.m;\n }\n}\n\nexport const BadRNG: RNG0 = new RNG0();\n\n/*\n * Wichmann–Hill PRNG\n * The period is 6e12.\n */\nexport class WHRNG implements RNG {\n s1 = 0;\n s2 = 0;\n s3 = 0;\n\n constructor(totalPlaytime: number) {\n // This one is seeded by the players total play time.\n const v: number = (totalPlaytime / 1000) % 30000;\n this.s1 = v;\n this.s2 = v;\n this.s3 = v;\n }\n\n step(): void {\n this.s1 = (171 * this.s1) % 30269;\n this.s2 = (172 * this.s2) % 30307;\n this.s3 = (170 * this.s3) % 30323;\n }\n\n random(): number {\n this.step();\n return (this.s1 / 30269.0 + this.s2 / 30307.0 + this.s3 / 30323.0) % 1.0;\n }\n}\n\nexport function SFC32RNG(seed: string): () => number {\n let h = 1779033703 ^ seed.length;\n for (let i = 0; i < seed.length; i++) {\n h = Math.imul(h ^ seed.charCodeAt(i), 3432918353);\n h = (h << 13) | (h >>> 19);\n }\n const genSeed = (): number => {\n h = Math.imul(h ^ (h >>> 16), 2246822507);\n h = Math.imul(h ^ (h >>> 13), 3266489909);\n return (h ^= h >>> 16) >>> 0;\n };\n\n let a = genSeed();\n let b = genSeed();\n let c = genSeed();\n let d = genSeed();\n return (): number => {\n a >>>= 0;\n b >>>= 0;\n c >>>= 0;\n d >>>= 0;\n let t = (a + b) | 0;\n a = b ^ (b >>> 9);\n b = (c + (c << 3)) | 0;\n c = (c << 21) | (c >>> 11);\n d = (d + 1) | 0;\n t = (t + d) | 0;\n c = (c + t) | 0;\n return (t >>> 0) / 4294967296;\n };\n}\n","import React from \"react\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { IPlayer } from \"src/PersonObjects/IPlayer\";\nimport { Work, WorkType } from \"./Work\";\nimport { influenceStockThroughCompanyWork } from \"../StockMarket/PlayerInfluencing\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { calculateCompanyWorkStats } from \"./formulas/Company\";\nimport { Companies } from \"../Company/Companies\";\nimport { applyWorkStats, scaleWorkStats, WorkStats } from \"./WorkStats\";\nimport { Company } from \"../Company/Company\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reputation } from \"../ui/React/Reputation\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { CONSTANTS } from \"../Constants\";\n\ninterface CompanyWorkParams {\n companyName: string;\n singularity: boolean;\n}\n\nexport const isCompanyWork = (w: Work | null): w is CompanyWork => w !== null && w.type === WorkType.COMPANY;\n\nexport class CompanyWork extends Work {\n companyName: string;\n constructor(params?: CompanyWorkParams) {\n super(WorkType.COMPANY, params?.singularity ?? false);\n this.companyName = params?.companyName ?? LocationName.NewTokyoNoodleBar;\n }\n\n getCompany(): Company {\n const c = Companies[this.companyName];\n if (!c) throw new Error(`Company not found: '${this.companyName}'`);\n return c;\n }\n\n getGainRates(player: IPlayer): WorkStats {\n let focusBonus = 1;\n if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {\n focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n return scaleWorkStats(calculateCompanyWorkStats(player, player, this.getCompany()), focusBonus);\n }\n\n process(player: IPlayer, cycles: number): boolean {\n this.cyclesWorked += cycles;\n const company = this.getCompany();\n const gains = this.getGainRates(player);\n applyWorkStats(player, player, gains, cycles, \"work\");\n company.playerReputation += gains.reputation * cycles;\n influenceStockThroughCompanyWork(company, gains.reputation, cycles);\n return false;\n }\n finish(): void {\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n You finished working for {this.companyName}\n
\n You have reputation with them.\n ,\n );\n }\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n companyName: this.companyName,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CompanyWork\", this);\n }\n\n /**\n * Initiatizes a CompanyWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): CompanyWork {\n return Generic_fromJSON(CompanyWork, value.data);\n }\n}\n\nReviver.constructors.CompanyWork = CompanyWork;\n","import { Paper, Typography } from \"@mui/material\";\nimport React from \"react\";\n\ninterface IProps {\n children: React.ReactNode;\n title: string;\n}\n\nexport const GameOptionsPage = (props: IProps): React.ReactElement => {\n return (\n \n {props.title}\n {props.children}\n \n );\n};\n","import * as React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n favor: {\n color: theme.colors.rep,\n },\n }),\n);\n\nexport function Favor({ favor }: { favor: number | string }): React.ReactElement {\n const classes = useStyles();\n return {typeof favor === \"number\" ? numeralWrapper.formatFavor(favor) : favor};\n}\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const TerminalEvents = new EventEmitter<[]>();\nexport const TerminalClearEvents = new EventEmitter<[]>();\n","/**\n * Helper functions for determine whether Limit and Stop orders should\n * be executed (and executing them)\n */\nimport { buyStock, sellStock, shortStock, sellShort } from \"./BuyingAndSelling\";\nimport { IOrderBook } from \"./IOrderBook\";\nimport { IStockMarket } from \"./IStockMarket\";\nimport { Order } from \"./Order\";\nimport { Stock } from \"./Stock\";\n\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { IMap } from \"../types\";\n\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Settings } from \"../Settings/Settings\";\n\nimport * as React from \"react\";\n\nexport interface IProcessOrderRefs {\n stockMarket: IStockMarket;\n symbolToStockMap: IMap;\n}\n\n/**\n * Search for all orders of a specific type and execute them if appropriate\n * @param {Stock} stock - Stock for which orders should be processed\n * @param {OrderTypes} orderType - Type of order to check (Limit/Stop buy/sell)\n * @param {PositionTypes} posType - Long or short\n * @param {IProcessOrderRefs} refs - References to objects/functions that are required for this function\n */\nexport function processOrders(\n stock: Stock,\n orderType: OrderTypes,\n posType: PositionTypes,\n refs: IProcessOrderRefs,\n): void {\n const orderBook = refs.stockMarket[\"Orders\"];\n if (orderBook == null) {\n const orders: IOrderBook = {};\n for (const name of Object.keys(refs.stockMarket)) {\n const stock = refs.stockMarket[name];\n if (!(stock instanceof Stock)) {\n continue;\n }\n orders[stock.symbol] = [];\n }\n refs.stockMarket[\"Orders\"] = orders;\n return; // Newly created, so no orders to process\n }\n let stockOrders = orderBook[stock.symbol];\n if (stockOrders == null || !(stockOrders.constructor === Array)) {\n console.error(`Invalid Order book for ${stock.symbol} in processOrders(): ${stockOrders}`);\n stockOrders = [];\n return;\n }\n\n for (const order of stockOrders) {\n if (order.type === orderType && order.pos === posType) {\n switch (order.type) {\n case OrderTypes.LimitBuy:\n if (order.pos === PositionTypes.Long && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.LimitSell:\n if (order.pos === PositionTypes.Long && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.StopBuy:\n if (order.pos === PositionTypes.Long && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n case OrderTypes.StopSell:\n if (order.pos === PositionTypes.Long && stock.price <= order.price) {\n executeOrder(/*66*/ order, refs);\n } else if (order.pos === PositionTypes.Short && stock.price >= order.price) {\n executeOrder(/*66*/ order, refs);\n }\n break;\n default:\n console.warn(`Invalid order type: ${order.type}`);\n return;\n }\n }\n }\n}\n\n/**\n * Execute a Stop or Limit Order.\n * @param {Order} order - Order being executed\n * @param {IProcessOrderRefs} refs - References to objects/functions that are required for this function\n */\nfunction executeOrder(order: Order, refs: IProcessOrderRefs): void {\n const stock = refs.symbolToStockMap[order.stockSymbol];\n if (!(stock instanceof Stock)) {\n console.error(`Could not find stock for this order: ${order.stockSymbol}`);\n return;\n }\n const stockMarket = refs.stockMarket;\n const orderBook = stockMarket[\"Orders\"];\n const stockOrders = orderBook[stock.symbol];\n\n // When orders are executed, the buying and selling functions shouldn't\n // emit popup dialog boxes. This options object configures the functions for that\n const opts = {\n suppressDialog: true,\n };\n\n let res = true;\n let isBuy = false;\n switch (order.type) {\n case OrderTypes.LimitBuy:\n case OrderTypes.StopBuy:\n isBuy = true;\n if (order.pos === PositionTypes.Long) {\n res = buyStock(stock, order.shares, null, opts) && res;\n } else if (order.pos === PositionTypes.Short) {\n res = shortStock(stock, order.shares, null, opts) && res;\n }\n break;\n case OrderTypes.LimitSell:\n case OrderTypes.StopSell:\n if (order.pos === PositionTypes.Long) {\n res = sellStock(stock, order.shares, null, opts) && res;\n } else if (order.pos === PositionTypes.Short) {\n res = sellShort(stock, order.shares, null, opts) && res;\n }\n break;\n default:\n console.warn(`Invalid order type: ${order.type}`);\n return;\n }\n\n // Position type, for logging/message purposes\n const pos = order.pos === PositionTypes.Long ? \"Long\" : \"Short\";\n\n if (res) {\n for (let i = 0; i < stockOrders.length; ++i) {\n if (order == stockOrders[i]) {\n stockOrders.splice(i, 1);\n if (!Settings.SuppressTIXPopup) {\n dialogBoxCreate(\n <>\n {order.type} for {stock.symbol} @ ({pos}) was filled (\n {numeralWrapper.formatShares(Math.round(order.shares))} shares)\n ,\n );\n }\n return;\n }\n }\n\n console.error(\"Could not find the following Order in Order Book: \");\n console.error(order);\n } else if (isBuy) {\n dialogBoxCreate(\n <>\n Failed to execute {order.type} for {stock.symbol} @ ({pos}). This is most likely\n because you do not have enough money or the order would exceed the stock's maximum number of shares\n ,\n );\n }\n}\n","import { IMap } from \"../types\";\nimport * as predefined from \"./data\";\n\nexport interface ITheme {\n [key: string]: string | undefined;\n primarylight: string;\n primary: string;\n primarydark: string;\n successlight: string;\n success: string;\n successdark: string;\n errorlight: string;\n error: string;\n errordark: string;\n secondarylight: string;\n secondary: string;\n secondarydark: string;\n warninglight: string;\n warning: string;\n warningdark: string;\n infolight: string;\n info: string;\n infodark: string;\n welllight: string;\n well: string;\n white: string;\n black: string;\n hp: string;\n money: string;\n hack: string;\n combat: string;\n cha: string;\n int: string;\n rep: string;\n disabled: string;\n backgroundprimary: string;\n backgroundsecondary: string;\n button: string;\n}\n\nexport interface IPredefinedTheme {\n colors: ITheme;\n name: string;\n credit: string;\n screenshot: string;\n description: string;\n reference?: string;\n}\n\nexport const defaultTheme: ITheme = {\n ...predefined.Default.colors,\n};\n\nexport const getPredefinedThemes = (): IMap => ({\n ...predefined,\n});\n","import React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport { sha256 } from \"js-sha256\";\n\nexport const AlertEvents = new EventEmitter<[string | JSX.Element]>();\n\ninterface Alert {\n id: string;\n text: string | JSX.Element;\n hash: string;\n}\n\nlet i = 0;\nexport function AlertManager(): React.ReactElement {\n const [alerts, setAlerts] = useState([]);\n useEffect(\n () =>\n AlertEvents.subscribe((text: string | JSX.Element) => {\n const id = i + \"\";\n i++;\n setAlerts((old) => {\n const hash = getMessageHash(text);\n if (old.some((a) => a.hash === hash)) {\n return old;\n }\n return [\n ...old,\n {\n id: id,\n text: text,\n hash: hash,\n },\n ];\n });\n }),\n [],\n );\n\n useEffect(() => {\n function handle(this: Document, event: KeyboardEvent): void {\n if (event.code === \"Escape\") {\n setAlerts([]);\n }\n }\n document.addEventListener(\"keydown\", handle);\n return () => document.removeEventListener(\"keydown\", handle);\n }, []);\n\n function getMessageHash(text: string | JSX.Element): string {\n if (typeof text === \"string\") return sha256(text);\n return sha256(JSON.stringify(text.props));\n }\n\n function close(): void {\n setAlerts((old) => {\n return old.slice(1, 1e99);\n });\n }\n\n return (\n <>\n {alerts.length > 0 && (\n \n \n {alerts[0].text}\n \n \n )}\n \n );\n}\n","import { getRandomByte } from \"./helpers/getRandomByte\";\n\n/**\n * Generate a random IP address\n * Does not check to see if the IP already exists in the game\n */\nexport const createRandomIp = (): string =>\n `${getRandomByte(99)}.${getRandomByte(9)}.${getRandomByte(9)}.${getRandomByte(9)}`;\n","import { IPlayer } from \"../../../PersonObjects/IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveSupportWork = (w: Work | null): w is SleeveSupportWork =>\n w !== null && w.type === WorkType.SUPPORT;\n\nexport class SleeveSupportWork extends Work {\n constructor(player?: IPlayer) {\n super(WorkType.SUPPORT);\n if (player) player.bladeburner?.sleeveSupport(true);\n }\n\n process(): number {\n return 0;\n }\n\n finish(player: IPlayer): void {\n player.bladeburner?.sleeveSupport(false);\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveSupportWork\", this);\n }\n\n /**\n * Initiatizes a BladeburnerWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveSupportWork {\n return Generic_fromJSON(SleeveSupportWork, value.data);\n }\n}\n\nReviver.constructors.SleeveSupportWork = SleeveSupportWork;\n","import { RunningScript } from \"src/Script/RunningScript\";\nimport { Settings } from \"../Settings/Settings\";\nimport { WorkerScript } from \"./WorkerScript\";\n\nexport const recentScripts: RecentScript[] = [];\n\nexport function AddRecentScript(workerScript: WorkerScript): void {\n if (recentScripts.find((r) => r.runningScript.pid === workerScript.pid)) return;\n\n const killedTime = new Date();\n recentScripts.unshift({\n timeOfDeath: killedTime,\n runningScript: workerScript.scriptRef,\n });\n\n while (recentScripts.length > Settings.MaxRecentScriptsCapacity) {\n recentScripts.pop();\n }\n}\n\nexport interface RecentScript {\n timeOfDeath: Date;\n runningScript: RunningScript;\n}\n","function getDB(): Promise {\n return new Promise((resolve, reject) => {\n if (!window.indexedDB) {\n reject(\"Indexed DB does not exists\");\n }\n /**\n * DB is called bitburnerSave\n * Object store is called savestring\n * key for the Object store is called save\n * Version `1` is important\n */\n const indexedDbRequest: IDBOpenDBRequest = window.indexedDB.open(\"bitburnerSave\", 1);\n\n // This is called when there's no db to begin with. It's important, don't remove it.\n indexedDbRequest.onupgradeneeded = function (this: IDBRequest) {\n const db = this.result;\n db.createObjectStore(\"savestring\");\n };\n\n indexedDbRequest.onerror = function (this: IDBRequest, ev: Event) {\n reject(`Failed to get IDB ${ev}`);\n };\n\n indexedDbRequest.onsuccess = function (this: IDBRequest) {\n const db = this.result;\n if (!db) {\n reject(\"database loading result was undefined\");\n return;\n }\n resolve(db.transaction([\"savestring\"], \"readwrite\").objectStore(\"savestring\"));\n };\n });\n}\n\nexport function load(): Promise {\n return new Promise((resolve, reject) => {\n getDB()\n .then((db) => {\n return new Promise((resolve, reject) => {\n const request: IDBRequest = db.get(\"save\");\n request.onerror = function (this: IDBRequest, ev: Event) {\n reject(\"Error in Database request to get savestring: \" + ev);\n };\n\n request.onsuccess = function (this: IDBRequest) {\n resolve(this.result);\n };\n }).then((saveString) => resolve(saveString));\n })\n .catch((r) => reject(r));\n });\n}\n\nexport function save(saveString: string): Promise {\n return getDB().then((db) => {\n return new Promise((resolve, reject) => {\n // We'll save to both localstorage and indexedDb\n const request = db.put(saveString, \"save\");\n\n request.onerror = function (e) {\n reject(\"Error saving game to IndexedDB: \" + e);\n };\n\n request.onsuccess = () => resolve();\n });\n });\n}\n\nexport function deleteGame(): Promise {\n return getDB().then((db) => {\n db.delete(\"save\");\n });\n}\n","import { Message } from \"./Message\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { Router } from \"../ui/GameRoot\";\nimport { Programs } from \"../Programs/Programs\";\nimport { Player } from \"../Player\";\nimport { Page } from \"../ui/Router\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Server } from \"../Server/Server\";\n\n//Sends message to player, including a pop up\nfunction sendMessage(msg: Message, forced = false): void {\n if (forced || !Settings.SuppressMessages) {\n showMessage(msg.filename);\n }\n addMessageToServer(msg);\n}\n\nfunction showMessage(name: MessageFilenames): void {\n const msg = Messages[name];\n if (!(msg instanceof Message)) throw new Error(\"trying to display unexistent message\");\n const txt =\n \"Message received from unknown sender:

\" +\n \"\" +\n msg.msg +\n \"

\" +\n \"This message was saved as \" +\n msg.filename +\n \" onto your home computer.\";\n dialogBoxCreate(txt);\n}\n\n//Adds a message to a server\nfunction addMessageToServer(msg: Message): void {\n //Short-circuit if the message has already been saved\n if (recvd(msg)) {\n return;\n }\n const server = GetServer(\"home\");\n if (server == null) {\n throw new Error(\"The home server doesn't exist. You done goofed.\");\n }\n server.messages.push(msg.filename);\n}\n\n//Returns whether the given message has already been received\nfunction recvd(msg: Message): boolean {\n const server = GetServer(\"home\");\n if (server == null) {\n throw new Error(\"The home server doesn't exist. You done goofed.\");\n }\n return server.messages.includes(msg.filename);\n}\n\n//Checks if any of the 'timed' messages should be sent\nfunction checkForMessagesToSend(): void {\n if (Router.page() === Page.BitVerse) return;\n const jumper0 = Messages[MessageFilenames.Jumper0];\n const jumper1 = Messages[MessageFilenames.Jumper1];\n const jumper2 = Messages[MessageFilenames.Jumper2];\n const jumper3 = Messages[MessageFilenames.Jumper3];\n const jumper4 = Messages[MessageFilenames.Jumper4];\n const cybersecTest = Messages[MessageFilenames.CyberSecTest];\n const nitesecTest = Messages[MessageFilenames.NiteSecTest];\n const bitrunnersTest = Messages[MessageFilenames.BitRunnersTest];\n const truthGazer = Messages[MessageFilenames.TruthGazer];\n const redpill = Messages[MessageFilenames.RedPill];\n\n if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {\n //Get the world daemon required hacking level\n const worldDaemon = GetServer(SpecialServers.WorldDaemon);\n if (!(worldDaemon instanceof Server)) {\n throw new Error(\"The world daemon is not a server???? Please un-break reality\");\n }\n //If the daemon can be hacked, send the player icarus.msg\n if (Player.skills.hacking >= worldDaemon.requiredHackingSkill) {\n sendMessage(redpill, Player.sourceFiles.length === 0);\n }\n //If the daemon cannot be hacked, send the player truthgazer.msg a single time.\n else if (!recvd(truthGazer)) {\n sendMessage(truthGazer);\n }\n } else if (!recvd(jumper0) && Player.skills.hacking >= 25) {\n sendMessage(jumper0);\n const flightName = Programs.Flight.name;\n const homeComp = Player.getHomeComputer();\n if (!homeComp.programs.includes(flightName)) {\n homeComp.programs.push(flightName);\n }\n } else if (!recvd(jumper1) && Player.skills.hacking >= 40) {\n sendMessage(jumper1);\n } else if (!recvd(cybersecTest) && Player.skills.hacking >= 50) {\n sendMessage(cybersecTest);\n } else if (!recvd(jumper2) && Player.skills.hacking >= 175) {\n sendMessage(jumper2);\n } else if (!recvd(nitesecTest) && Player.skills.hacking >= 200) {\n sendMessage(nitesecTest);\n } else if (!recvd(jumper3) && Player.skills.hacking >= 350) {\n sendMessage(jumper3);\n } else if (!recvd(jumper4) && Player.skills.hacking >= 490) {\n sendMessage(jumper4);\n } else if (!recvd(bitrunnersTest) && Player.skills.hacking >= 500) {\n sendMessage(bitrunnersTest);\n }\n}\n\nexport enum MessageFilenames {\n Jumper0 = \"j0.msg\",\n Jumper1 = \"j1.msg\",\n Jumper2 = \"j2.msg\",\n Jumper3 = \"j3.msg\",\n Jumper4 = \"j4.msg\",\n CyberSecTest = \"csec-test.msg\",\n NiteSecTest = \"nitesec-test.msg\",\n BitRunnersTest = \"19dfj3l1nd.msg\",\n TruthGazer = \"truthgazer.msg\",\n RedPill = \"icarus.msg\",\n}\n\n//Reset\nconst Messages: Record = {\n //jump3R Messages\n [MessageFilenames.Jumper0]: new Message(\n MessageFilenames.Jumper0,\n \"I know you can sense it. I know you're searching for it. \" +\n \"It's why you spend night after \" +\n \"night at your computer.

It's real, I've seen it. And I can \" +\n \"help you find it. But not right now. You're not ready yet.

\" +\n \"Use this program to track your progress

\" +\n \"The fl1ght.exe program was added to your home computer

\" +\n \"-jump3R\",\n ),\n\n [MessageFilenames.Jumper1]: new Message(\n MessageFilenames.Jumper1,\n `Soon you will be contacted by a hacking group known as ${FactionNames.NiteSec}. ` +\n \"They can help you with your search.

\" +\n \"You should join them, garner their favor, and \" +\n \"exploit them for their Augmentations. But do not trust them. \" +\n \"They are not what they seem. No one is.

\" +\n \"-jump3R\",\n ),\n\n [MessageFilenames.Jumper2]: new Message(\n MessageFilenames.Jumper2,\n \"Do not try to save the world. There is no world to save. If \" +\n \"you want to find the truth, worry only about yourself. Ethics and \" +\n `morals will get you killed.

Watch out for a hacking group known as ${FactionNames.NiteSec}.` +\n \"

-jump3R\",\n ),\n\n [MessageFilenames.Jumper3]: new Message(\n MessageFilenames.Jumper3,\n \"You must learn to walk before you can run. And you must \" +\n `run before you can fly. Look for ${FactionNames.TheBlackHand}.

` +\n \"I.I.I.I

-jump3R\",\n ),\n\n [MessageFilenames.Jumper4]: new Message(\n MessageFilenames.Jumper4,\n \"To find what you are searching for, you must understand the bits. \" +\n \"The bits are all around us. The runners will help you.

\" +\n \"-jump3R\",\n ),\n\n //Messages from hacking factions\n [MessageFilenames.CyberSecTest]: new Message(\n MessageFilenames.CyberSecTest,\n \"We've been watching you. Your skills are very impressive. But you're wasting \" +\n \"your talents. If you join us, you can put your skills to good use and change \" +\n \"the world for the better. If you join us, we can unlock your full potential.

\" +\n \"But first, you must pass our test. Find and install the backdoor on our server.

\" +\n `-${FactionNames.CyberSec}`,\n ),\n\n [MessageFilenames.NiteSecTest]: new Message(\n MessageFilenames.NiteSecTest,\n \"People say that the corrupted governments and corporations rule the world. \" +\n \"Yes, maybe they do. But do you know who everyone really fears? People \" +\n \"like us. Because they can't hide from us. Because they can't fight shadows \" +\n \"and ideas with bullets.

\" +\n \"Join us, and people will fear you, too.

\" +\n \"Find and install the backdoor on our server, avmnite-02h. Then, we will contact you again.\" +\n `

-${FactionNames.NiteSec}`,\n ),\n\n [MessageFilenames.BitRunnersTest]: new Message(\n MessageFilenames.BitRunnersTest,\n \"We know what you are doing. We know what drives you. We know \" +\n \"what you are looking for.

\" +\n \"We can help you find the answers.

\" +\n \"run4theh111z\",\n ),\n\n //Messages to guide players to the daemon\n [MessageFilenames.TruthGazer]: new Message(\n MessageFilenames.TruthGazer,\n //\"THE TRUTH CAN NO LONGER ESCAPE YOUR GAZE\"\n \"@&*($#@&__TH3__#@A&#@*)__TRU1H__(*)&*)($#@&()E&R)W&
\" +\n \"%@*$^$()@&$)$*@__CAN__()(@^#)@&@)#__N0__(#@&#)@&@&(
\" +\n \"*(__LON6ER__^#)@)(()*#@)@__ESCAP3__)#(@(#@*@()@(#*$
\" +\n \"()@)#$*%)$#()$#__Y0UR__(*)$#()%(&(%)*!)($__GAZ3__#(\",\n ),\n\n [MessageFilenames.RedPill]: new Message(\n MessageFilenames.RedPill,\n //\"FIND THE-CAVE\"\n \"@)(#V%*N)@(#*)*C)@#%*)*V)@#(*%V@)(#VN%*)@#(*%
\" +\n \")@B(*#%)@)M#B*%V)____FIND___#$@)#%(B*)@#(*%B)
\" +\n \"@_#(%_@#M(BDSPOMB__THE-CAVE_#)$(*@#$)@#BNBEGB
\" +\n \"DFLSMFVMV)#@($*)@#*$MV)@#(*$V)M#(*$)M@(#*VM$)\",\n ),\n};\n\nexport { Messages, checkForMessagesToSend, showMessage };\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { ClassType } from \"../../../Work/ClassWork\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { calculateClassEarnings } from \"../../../Work/formulas/Class\";\nimport { Sleeve } from \"../Sleeve\";\nimport { scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\n\nexport const isSleeveClassWork = (w: Work | null): w is SleeveClassWork => w !== null && w.type === WorkType.CLASS;\n\ninterface ClassWorkParams {\n classType: ClassType;\n location: LocationName;\n}\n\nexport class SleeveClassWork extends Work {\n classType: ClassType;\n location: LocationName;\n\n constructor(params?: ClassWorkParams) {\n super(WorkType.CLASS);\n this.classType = params?.classType ?? ClassType.StudyComputerScience;\n this.location = params?.location ?? LocationName.Sector12RothmanUniversity;\n }\n\n calculateRates(player: IPlayer, sleeve: Sleeve): WorkStats {\n return scaleWorkStats(\n calculateClassEarnings(player, sleeve, this.classType, this.location),\n sleeve.shockBonus(),\n false,\n );\n }\n\n isGym(): boolean {\n return [ClassType.GymAgility, ClassType.GymDefense, ClassType.GymDexterity, ClassType.GymStrength].includes(\n this.classType,\n );\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n const rate = this.calculateRates(player, sleeve);\n applySleeveGains(player, sleeve, rate, cycles);\n return 0;\n }\n APICopy(): Record {\n return {\n type: this.type,\n classType: this.classType,\n location: this.location,\n };\n }\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveClassWork\", this);\n }\n\n /**\n * Initiatizes a ClassWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveClassWork {\n return Generic_fromJSON(SleeveClassWork, value.data);\n }\n}\n\nReviver.constructors.SleeveClassWork = SleeveClassWork;\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { applySleeveGains, Work, WorkType } from \"./Work\";\nimport { CrimeType } from \"../../../utils/WorkType\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { Crime } from \"../../../Crime/Crime\";\nimport { newWorkStats, scaleWorkStats, WorkStats } from \"../../../Work/WorkStats\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { BitNodeMultipliers } from \"../../../BitNode/BitNodeMultipliers\";\n\nexport const isSleeveCrimeWork = (w: Work | null): w is SleeveCrimeWork => w !== null && w.type === WorkType.CRIME;\n\nexport class SleeveCrimeWork extends Work {\n crimeType: CrimeType;\n cyclesWorked = 0;\n constructor(crimeType?: CrimeType) {\n super(WorkType.CRIME);\n this.crimeType = crimeType ?? CrimeType.SHOPLIFT;\n }\n\n getCrime(): Crime {\n const crime = Object.values(Crimes).find((crime) => crime.type === this.crimeType);\n if (!crime) throw new Error(\"crime should not be undefined\");\n return crime;\n }\n\n getExp(): WorkStats {\n const crime = this.getCrime();\n return newWorkStats({\n money: crime.money * BitNodeMultipliers.CrimeMoney,\n hackExp: crime.hacking_exp * BitNodeMultipliers.CrimeExpGain,\n strExp: crime.strength_exp * BitNodeMultipliers.CrimeExpGain,\n defExp: crime.defense_exp * BitNodeMultipliers.CrimeExpGain,\n dexExp: crime.dexterity_exp * BitNodeMultipliers.CrimeExpGain,\n agiExp: crime.agility_exp * BitNodeMultipliers.CrimeExpGain,\n chaExp: crime.charisma_exp * BitNodeMultipliers.CrimeExpGain,\n intExp: crime.intelligence_exp * BitNodeMultipliers.CrimeExpGain,\n });\n }\n\n cyclesNeeded(): number {\n return this.getCrime().time / CONSTANTS._idleSpeed;\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n this.cyclesWorked += cycles;\n\n const crime = this.getCrime();\n let gains = this.getExp();\n if (this.cyclesWorked >= this.cyclesNeeded()) {\n if (Math.random() < crime.successRate(sleeve)) {\n player.karma -= crime.karma * sleeve.syncBonus();\n } else {\n gains.money = 0;\n gains = scaleWorkStats(gains, 0.25);\n }\n applySleeveGains(player, sleeve, gains, cycles);\n this.cyclesWorked -= this.cyclesNeeded();\n }\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n crimeType: this.crimeType,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveCrimeWork\", this);\n }\n\n /**\n * Initiatizes a RecoveryWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveCrimeWork {\n return Generic_fromJSON(SleeveCrimeWork, value.data);\n }\n}\n\nReviver.constructors.SleeveCrimeWork = SleeveCrimeWork;\n","import { format } from \"date-fns\";\n\nexport function formatTime(fmt: string): string {\n try {\n return format(new Date(), fmt);\n } catch (e: unknown) {\n return \"format error\";\n }\n}\n","// The initial formulas was sum 0 to f of 500*1.02^f.\n// see https://en.wikipedia.org/wiki/Geometric_series#Closed-form_formula\n// for information on how to calculate this\n\nexport function favorToRep(f: number): number {\n const raw = 25000 * (Math.pow(1.02, f) - 1);\n return Math.round(raw * 10000) / 10000; // round to make things easier.\n}\n\nexport function repToFavor(r: number): number {\n const raw = Math.log(r / 25000 + 1) / Math.log(1.02);\n return Math.round(raw * 10000) / 10000; // round to make things easier.\n}\n","import {\n CodingContract,\n CodingContractRewardType,\n CodingContractTypes,\n ICodingContractReward,\n} from \"./CodingContracts\";\nimport { Factions } from \"./Faction/Factions\";\nimport { Player } from \"./Player\";\nimport { GetServer, GetAllServers } from \"./Server/AllServers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { Server } from \"./Server/Server\";\nimport { BaseServer } from \"./Server/BaseServer\";\n\nimport { getRandomInt } from \"./utils/helpers/getRandomInt\";\n\nexport function generateRandomContract(): void {\n // First select a random problem type\n const problemType = getRandomProblemType();\n\n // Then select a random reward type. 'Money' will always be the last reward type\n const reward = getRandomReward();\n\n // Choose random server\n const randServer = getRandomServer();\n\n const contractFn = getRandomFilename(randServer, reward);\n const contract = new CodingContract(contractFn, problemType, reward);\n\n randServer.addContract(contract);\n}\n\nexport function generateRandomContractOnHome(): void {\n // First select a random problem type\n const problemType = getRandomProblemType();\n\n // Then select a random reward type. 'Money' will always be the last reward type\n const reward = getRandomReward();\n\n // Choose random server\n const serv = Player.getHomeComputer();\n\n const contractFn = getRandomFilename(serv, reward);\n const contract = new CodingContract(contractFn, problemType, reward);\n\n serv.addContract(contract);\n}\n\ninterface IGenerateContractParams {\n problemType?: string;\n server?: string;\n fn?: string;\n}\n\nexport function generateContract(params: IGenerateContractParams): void {\n // Problem Type\n let problemType;\n const problemTypes = Object.keys(CodingContractTypes);\n if (params.problemType != null && problemTypes.includes(params.problemType)) {\n problemType = params.problemType;\n } else {\n problemType = getRandomProblemType();\n }\n\n // Reward Type - This is always random for now\n const reward = getRandomReward();\n\n // Server\n let server;\n if (params.server != null) {\n server = GetServer(params.server);\n if (server == null) {\n server = getRandomServer();\n }\n } else {\n server = getRandomServer();\n }\n\n // Filename\n let fn;\n if (params.fn != null) {\n fn = params.fn;\n } else {\n fn = getRandomFilename(server, reward);\n }\n\n const contract = new CodingContract(fn, problemType, reward);\n server.addContract(contract);\n}\n\n// Ensures that a contract's reward type is valid\nfunction sanitizeRewardType(rewardType: CodingContractRewardType): CodingContractRewardType {\n let type = rewardType; // Create copy\n\n const factionsThatAllowHacking = Player.factions.filter((fac) => {\n try {\n return Factions[fac].getInfo().offerHackingWork;\n } catch (e) {\n console.error(`Error when trying to filter Hacking Factions for Coding Contract Generation: ${e}`);\n return false;\n }\n });\n if (type === CodingContractRewardType.FactionReputation && factionsThatAllowHacking.length === 0) {\n type = CodingContractRewardType.CompanyReputation;\n }\n if (type === CodingContractRewardType.FactionReputationAll && factionsThatAllowHacking.length === 0) {\n type = CodingContractRewardType.CompanyReputation;\n }\n if (type === CodingContractRewardType.CompanyReputation && Object.keys(Player.jobs).length === 0) {\n type = CodingContractRewardType.Money;\n }\n\n return type;\n}\n\nfunction getRandomProblemType(): string {\n const problemTypes = Object.keys(CodingContractTypes);\n const randIndex = getRandomInt(0, problemTypes.length - 1);\n\n return problemTypes[randIndex];\n}\n\nfunction getRandomReward(): ICodingContractReward {\n const reward: ICodingContractReward = {\n name: \"\",\n type: getRandomInt(0, CodingContractRewardType.Money),\n };\n reward.type = sanitizeRewardType(reward.type);\n\n // Add additional information based on the reward type\n const factionsThatAllowHacking = Player.factions.filter((fac) => Factions[fac].getInfo().offerHackingWork);\n\n switch (reward.type) {\n case CodingContractRewardType.FactionReputation: {\n // Get a random faction that player is a part of. That\n // faction must allow hacking contracts\n const numFactions = factionsThatAllowHacking.length;\n const randFaction = factionsThatAllowHacking[getRandomInt(0, numFactions - 1)];\n reward.name = randFaction;\n break;\n }\n case CodingContractRewardType.CompanyReputation: {\n const allJobs = Object.keys(Player.jobs);\n if (allJobs.length > 0) {\n reward.name = allJobs[getRandomInt(0, allJobs.length - 1)];\n } else {\n reward.type = CodingContractRewardType.Money;\n }\n break;\n }\n default:\n break;\n }\n\n return reward;\n}\n\nfunction getRandomServer(): BaseServer {\n const servers = GetAllServers().filter((server: BaseServer) => server.serversOnNetwork.length !== 0);\n let randIndex = getRandomInt(0, servers.length - 1);\n let randServer = servers[randIndex];\n\n // An infinite loop shouldn't ever happen, but to be safe we'll use\n // a for loop with a limited number of tries\n for (let i = 0; i < 200; ++i) {\n if (\n randServer instanceof Server &&\n !randServer.purchasedByPlayer &&\n randServer.hostname !== SpecialServers.WorldDaemon\n ) {\n break;\n }\n randIndex = getRandomInt(0, servers.length - 1);\n randServer = servers[randIndex];\n }\n\n return randServer;\n}\n\nfunction getRandomFilename(server: BaseServer, reward: ICodingContractReward): string {\n let contractFn = `contract-${getRandomInt(0, 1e6)}`;\n\n for (let i = 0; i < 1000; ++i) {\n if (\n server.contracts.filter((c: CodingContract) => {\n return c.fn === contractFn;\n }).length <= 0\n ) {\n break;\n }\n contractFn = `contract-${getRandomInt(0, 1e6)}`;\n }\n\n if (reward.name) {\n contractFn += `-${reward.name.replace(/\\s/g, \"\")}`;\n }\n\n return contractFn;\n}\n","import { Factions } from \"./Faction/Factions\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\n\nexport let LastExportBonus = 0;\n\nconst bonusTimer = 24 * 60 * 60 * 1000; // 24h\nexport function canGetBonus(): boolean {\n const now = new Date().getTime();\n return now - LastExportBonus > bonusTimer;\n}\n\nexport function onExport(p: IPlayer): void {\n if (!canGetBonus()) return;\n for (const facName of p.factions) {\n Factions[facName].favor++;\n }\n LastExportBonus = new Date().getTime();\n}\n\nexport function setLastExportBonus(unixTime: number): void {\n LastExportBonus = unixTime;\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../numeralFormat\";\nimport { Reputation } from \"./Reputation\";\n\nexport function ReputationRate({ reputation }: { reputation: number }): React.ReactElement {\n return ;\n}\n","/**\n * React component for a selectable option on the Faction UI. These\n * options including working for the faction, hacking missions, purchasing\n * augmentations, etc.\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\n\ntype IProps = {\n buttonText: string;\n infoText: string;\n onClick: (e: React.MouseEvent) => void;\n};\n\nexport function Option(props: IProps): React.ReactElement {\n return (\n \n \n \n {props.infoText}\n \n \n );\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport interface IOperationParams extends IActionParams {\n reqdRank?: number;\n teamCount?: number;\n}\n\nexport class Operation extends Action {\n reqdRank = 100;\n teamCount = 0;\n\n constructor(params: IOperationParams | null = null) {\n super(params);\n if (params && params.reqdRank) this.reqdRank = params.reqdRank;\n if (params && params.teamCount) this.teamCount = params.teamCount;\n }\n\n // For actions that have teams. To be implemented by subtypes.\n getTeamSuccessBonus(inst: IBladeburner): number {\n if (this.teamCount && this.teamCount > 0) {\n this.teamCount = Math.min(this.teamCount, inst.teamSize);\n const teamMultiplier = Math.pow(this.teamCount, 0.05);\n return teamMultiplier;\n }\n\n return 1;\n }\n\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return inst.skillMultipliers.successChanceOperation;\n }\n\n getChaosDifficultyBonus(inst: IBladeburner /*, params: ISuccessChanceParams*/): number {\n const city = inst.getCurrentCity();\n if (city.chaos > BladeburnerConstants.ChaosThreshold) {\n const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold);\n const mult = Math.pow(diff, 0.5);\n return mult;\n }\n\n return 1;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Operation\", this);\n }\n\n static fromJSON(value: IReviverValue): Operation {\n return Generic_fromJSON(Operation, value.data);\n }\n}\n\nReviver.constructors.Operation = Operation;\n","import { Augmentation, IConstructorParams } from \"../Augmentation\";\nimport { AugmentationNames } from \"./AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Programs } from \"../../Programs/Programs\";\nimport { WHRNG } from \"../../Casino/RNG\";\nimport React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { CONSTANTS } from \"../../Constants\";\n\ninterface CircadianBonus {\n bonuses: {\n [key: string]: number | undefined;\n agility?: number;\n agility_exp?: number;\n charisma?: number;\n charisma_exp?: number;\n company_rep?: number;\n crime_money?: number;\n crime_success?: number;\n defense?: number;\n defense_exp?: number;\n dexterity?: number;\n dexterity_exp?: number;\n faction_rep?: number;\n hacking?: number;\n hacking_chance?: number;\n hacking_exp?: number;\n hacking_grow?: number;\n hacking_money?: number;\n hacking_speed?: number;\n hacknet_node_core_cost?: number;\n hacknet_node_level_cost?: number;\n hacknet_node_money?: number;\n hacknet_node_purchase_cost?: number;\n hacknet_node_ram_cost?: number;\n strength?: number;\n strength_exp?: number;\n work_money?: number;\n };\n description: string;\n}\n\nfunction getRandomBonus(): CircadianBonus {\n const bonuses = [\n {\n bonuses: {\n hacking_chance: 1.25,\n hacking_speed: 1.1,\n hacking_money: 1.25,\n hacking_grow: 1.1,\n },\n description:\n \"Increases the player's hacking chance by 25%.
\" +\n \"Increases the player's hacking speed by 10%.
\" +\n \"Increases the amount of money the player's gains from hacking by 25%.
\" +\n \"Improves grow() by 10%.\",\n },\n {\n bonuses: {\n hacking: 1.15,\n hacking_exp: 2,\n },\n description:\n \"Increases the player's hacking skill by 15%.
\" +\n \"Increases the player's hacking experience gain rate by 100%.\",\n },\n {\n bonuses: {\n strength: 1.25,\n strength_exp: 2,\n defense: 1.25,\n defense_exp: 2,\n dexterity: 1.25,\n dexterity_exp: 2,\n agility: 1.25,\n agility_exp: 2,\n },\n description:\n \"Increases all of the player's combat stats by 25%.
\" +\n \"Increases all of the player's combat stat experience gain rate by 100%.\",\n },\n {\n bonuses: {\n charisma: 1.5,\n charisma_exp: 2,\n },\n description:\n \"This augmentation increases the player's charisma by 50%.
\" +\n \"Increases the player's charisma experience gain rate by 100%.\",\n },\n {\n bonuses: {\n hacknet_node_money: 1.2,\n hacknet_node_purchase_cost: 0.85,\n hacknet_node_ram_cost: 0.85,\n hacknet_node_core_cost: 0.85,\n hacknet_node_level_cost: 0.85,\n },\n description:\n \"Increases the amount of money produced by Hacknet Nodes by 20%.
\" +\n \"Decreases all costs related to Hacknet Node by 15%.\",\n },\n {\n bonuses: {\n company_rep: 1.25,\n faction_rep: 1.15,\n work_money: 1.7,\n },\n description:\n \"Increases the amount of money the player gains from working by 70%.
\" +\n \"Increases the amount of reputation the player gains when working for a company by 25%.
\" +\n \"Increases the amount of reputation the player gains for a faction by 15%.\",\n },\n {\n bonuses: {\n crime_success: 2,\n crime_money: 2,\n },\n description:\n \"Increases the player's crime success rate by 100%.
\" +\n \"Increases the amount of money the player gains from crimes by 100%.\",\n },\n ];\n\n const randomNumber = new WHRNG(Math.floor(Player.lastUpdate / 3600000));\n for (let i = 0; i < 5; i++) randomNumber.step();\n\n return bonuses[Math.floor(bonuses.length * randomNumber.random())];\n}\n\nexport const initSoAAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.WKSharmonizer,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n `A copy of the WKS harmonizer from the MIA leader of the ${FactionNames.ShadowsOfAnarchy} ` +\n \"injects *Γ-based cells that provides general enhancement to the body.\",\n stats: (\n <>\n This augmentation makes many aspects of infiltration easier and more productive. Such as increased timer,\n rewards, reduced damage taken, etc.\n \n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.MightOfAres,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n \"Extra-occular neurons taken from old martial art master. Injecting them gives the user the ability to \" +\n \"predict the enemy's attack before they even know it themself.\",\n stats: (\n <>This augmentation makes the Slash minigame easier by showing you via an indicator when the slash in coming.\n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.WisdomOfAthena,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"A connective brain implant to SASHA that focuses on pattern recognition and predictive templating.\",\n stats: <>This augmentation makes the Bracket minigame easier by removing all '[' ']'.,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.ChaosOfDionysus,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Opto-occipito implant to process visual signals before brain interpretation.\",\n stats: <>This augmentation makes the Backwards minigame easier by flipping the words.,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.BeautyOfAphrodite,\n repCost: 1e4,\n moneyCost: 1e6,\n info:\n \"Pheromone extruder injected in the thoracodorsal nerve. Emits pleasing scent guaranteed to \" +\n \"make conversational partners more agreeable.\",\n stats: <>This augmentation makes the Bribe minigame easier by indicating the incorrect paths.,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.TrickeryOfHermes,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Penta-dynamo-neurovascular-valve inserted in the carpal ligament, enhances dexterity.\",\n stats: <>This augmentation makes the Cheat Code minigame easier by allowing the opposite character.,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.FloodOfPoseidon,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Transtinatium VVD reticulator used in optico-sterbing recognition.\",\n stats: <>This augmentation makes the Symbol matching minigame easier by indicating the correct choice.,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.HuntOfArtemis,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"magneto-turboencabulator based on technology by Micha Eike Siemon, increases the user's electro-magnetic sensitivity.\",\n stats: (\n <>\n This augmentation makes the Minesweeper minigame easier by showing the location of all mines and keeping their\n position.\n \n ),\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n new Augmentation({\n name: AugmentationNames.KnowledgeOfApollo,\n repCost: 1e4,\n moneyCost: 1e6,\n info: \"Neodynic retention fjengeln spoofer using -φ karmions, net positive effect on implantee's delta wave.\",\n stats: <>This augmentation makes the Wire Cutting minigame easier by indicating the incorrect wires.,\n isSpecial: true,\n factions: [FactionNames.ShadowsOfAnarchy],\n }),\n];\n\nexport const initGeneralAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.HemoRecirculator,\n moneyCost: 4.5e7,\n repCost: 1e4,\n info: \"A heart implant that greatly increases the body's ability to effectively use and pump blood.\",\n strength: 1.08,\n defense: 1.08,\n agility: 1.08,\n dexterity: 1.08,\n factions: [FactionNames.Tetrads, FactionNames.TheDarkArmy, FactionNames.TheSyndicate],\n }),\n new Augmentation({\n name: AugmentationNames.Targeting1,\n moneyCost: 1.5e7,\n repCost: 5e3,\n info:\n \"A cranial implant that is embedded within the inner ear structures and optic nerves. It regulates \" +\n \"and enhances balance and hand-eye coordination.\",\n dexterity: 1.1,\n factions: [\n FactionNames.SlumSnakes,\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Sector12,\n FactionNames.Ishima,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.Targeting2,\n moneyCost: 4.25e7,\n repCost: 8.75e3,\n info:\n \"This upgraded version of the 'Augmented Targeting' implant is capable of augmenting \" +\n \"reality by digitally displaying weaknesses and vital signs of threats.\",\n prereqs: [AugmentationNames.Targeting1],\n dexterity: 1.2,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Sector12,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.Targeting3,\n moneyCost: 1.15e8,\n repCost: 2.75e4,\n info: \"The latest version of the 'Augmented Targeting' implant adds the ability to lock-on and track threats.\",\n prereqs: [AugmentationNames.Targeting2, AugmentationNames.Targeting1],\n dexterity: 1.3,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n FactionNames.TheCovenant,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SyntheticHeart,\n moneyCost: 2.875e9,\n repCost: 7.5e5,\n info:\n \"This advanced artificial heart, created from plasteel and graphene, is capable of pumping blood \" +\n \"more efficiently than an organic heart.\",\n agility: 1.5,\n strength: 1.5,\n factions: [\n FactionNames.KuaiGongInternational,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.SpeakersForTheDead,\n FactionNames.NWO,\n FactionNames.TheCovenant,\n FactionNames.Daedalus,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SynfibrilMuscle,\n repCost: 4.375e5,\n moneyCost: 1.125e9,\n info:\n \"The myofibrils in human muscles are injected with special chemicals that react with the proteins inside \" +\n \"the myofibrils, altering their underlying structure. The end result is muscles that are stronger and more elastic. \" +\n \"Scientists have named these artificially enhanced units 'synfibrils'.\",\n strength: 1.3,\n defense: 1.3,\n factions: [\n FactionNames.KuaiGongInternational,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.SpeakersForTheDead,\n FactionNames.NWO,\n FactionNames.TheCovenant,\n FactionNames.Daedalus,\n FactionNames.Illuminati,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.CombatRib1,\n repCost: 7.5e3,\n moneyCost: 2.375e7,\n info:\n \"The rib cage is augmented to continuously release boosters into the bloodstream \" +\n \"which increase the oxygen-carrying capacity of blood.\",\n strength: 1.1,\n defense: 1.1,\n factions: [\n FactionNames.SlumSnakes,\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Volhaven,\n FactionNames.Ishima,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.CombatRib2,\n repCost: 1.875e4,\n moneyCost: 6.5e7,\n info:\n \"An upgraded version of the 'Combat Rib' augmentation that adds potent stimulants which \" +\n \"improve focus and endurance while decreasing reaction time and fatigue.\",\n prereqs: [AugmentationNames.CombatRib1],\n strength: 1.14,\n defense: 1.14,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.Volhaven,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.CombatRib3,\n repCost: 3.5e4,\n moneyCost: 1.2e8,\n info:\n \"The latest version of the 'Combat Rib' augmentation releases advanced anabolic steroids that \" +\n \"improve muscle mass and physical performance while being safe and free of side effects.\",\n prereqs: [AugmentationNames.CombatRib2, AugmentationNames.CombatRib1],\n strength: 1.18,\n defense: 1.18,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n FactionNames.BladeIndustries,\n FactionNames.TheCovenant,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.NanofiberWeave,\n repCost: 3.75e4,\n moneyCost: 1.25e8,\n info:\n \"Synthetic nanofibers are woven into the skin's extracellular matrix using electrospinning, \" +\n \"which improves its regenerative and extracellular homeostasis abilities.\",\n strength: 1.2,\n defense: 1.2,\n factions: [\n FactionNames.TheDarkArmy,\n FactionNames.TheSyndicate,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n FactionNames.TianDiHui,\n FactionNames.SpeakersForTheDead,\n FactionNames.FulcrumSecretTechnologies,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SubdermalArmor,\n repCost: 8.75e5,\n moneyCost: 3.25e9,\n info:\n \"The NEMEAN Subdermal Weave is a thin, light-weight, graphene plating that houses a dilatant fluid. \" +\n \"The material is implanted underneath the skin, and is the most advanced form of defensive enhancement \" +\n \"that has ever been created. The dilatant fluid, despite being thin and light, is extremely effective \" +\n \"at stopping piercing blows and reducing blunt trauma. The properties of graphene allow the plating to \" +\n \"mitigate damage from any fire or electrical traumas.\",\n defense: 2.2,\n factions: [\n FactionNames.TheSyndicate,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.Illuminati,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.WiredReflexes,\n repCost: 1.25e3,\n moneyCost: 2.5e6,\n info:\n \"Synthetic nerve-enhancements are injected into all major parts of the somatic nervous system, \" +\n \"supercharging the spread of neural signals and increasing reflex speed.\",\n agility: 1.05,\n dexterity: 1.05,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.SlumSnakes,\n FactionNames.Sector12,\n FactionNames.Volhaven,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.TheSyndicate,\n FactionNames.TheDarkArmy,\n FactionNames.SpeakersForTheDead,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBoneLacings,\n repCost: 1.125e6,\n moneyCost: 4.25e9,\n info: \"Graphene is grafted and fused into the skeletal structure, enhancing bone density and tensile strength.\",\n strength: 1.7,\n defense: 1.7,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.TheCovenant],\n }),\n new Augmentation({\n name: AugmentationNames.BionicSpine,\n repCost: 4.5e4,\n moneyCost: 1.25e8,\n info:\n \"The spine is reconstructed using plasteel and carbon fibers. \" +\n \"It is now capable of stimulating and regulating neural signals \" +\n \"passing through the spinal cord, improving senses and reaction speed. \" +\n \"The 'Bionic Spine' also interfaces with all other 'Bionic' implants.\",\n strength: 1.15,\n defense: 1.15,\n agility: 1.15,\n dexterity: 1.15,\n factions: [\n FactionNames.SpeakersForTheDead,\n FactionNames.TheSyndicate,\n FactionNames.KuaiGongInternational,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBionicSpine,\n repCost: 1.625e6,\n moneyCost: 6e9,\n info:\n \"An upgrade to the 'Bionic Spine' augmentation. The spine is fused with graphene \" +\n \"which enhances durability and supercharges all body functions.\",\n prereqs: [AugmentationNames.BionicSpine],\n strength: 1.6,\n defense: 1.6,\n agility: 1.6,\n dexterity: 1.6,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp],\n }),\n new Augmentation({\n name: AugmentationNames.BionicLegs,\n repCost: 1.5e5,\n moneyCost: 3.75e8,\n info: \"Cybernetic legs, created from plasteel and carbon fibers, enhance running speed.\",\n agility: 1.6,\n factions: [\n FactionNames.SpeakersForTheDead,\n FactionNames.TheSyndicate,\n FactionNames.KuaiGongInternational,\n FactionNames.OmniTekIncorporated,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBionicLegs,\n repCost: 7.5e5,\n moneyCost: 4.5e9,\n info:\n \"An upgrade to the 'Bionic Legs' augmentation. The legs are fused \" +\n \"with graphene, greatly enhancing jumping ability.\",\n prereqs: [AugmentationNames.BionicLegs],\n agility: 2.5,\n factions: [FactionNames.MegaCorp, FactionNames.ECorp, FactionNames.FulcrumSecretTechnologies],\n }),\n new Augmentation({\n name: AugmentationNames.SpeechProcessor,\n repCost: 7.5e3,\n moneyCost: 5e7,\n info:\n \"A cochlear implant with an embedded computer that analyzes incoming speech. \" +\n \"The embedded computer processes characteristics of incoming speech, such as tone \" +\n \"and inflection, to pick up on subtle cues and aid in social interactions.\",\n charisma: 1.2,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.Volhaven,\n FactionNames.Silhouette,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.TITN41Injection,\n repCost: 2.5e4,\n moneyCost: 1.9e8,\n info:\n \"TITN is a series of viruses that targets and alters the sequences of human DNA in genes that \" +\n \"control personality. The TITN-41 strain alters these genes so that the subject becomes more \" +\n \"outgoing and sociable.\",\n charisma: 1.15,\n charisma_exp: 1.15,\n factions: [FactionNames.Silhouette],\n }),\n new Augmentation({\n name: AugmentationNames.EnhancedSocialInteractionImplant,\n repCost: 3.75e5,\n moneyCost: 1.375e9,\n info:\n \"A cranial implant that greatly assists in the user's ability to analyze social situations \" +\n \"and interactions. The system uses a wide variety of factors such as facial expression, body \" +\n \"language, voice tone, and inflection to determine the best course of action during social \" +\n \"situations. The implant also uses deep learning software to continuously learn new behavior \" +\n \"patterns and how to best respond.\",\n charisma: 1.6,\n charisma_exp: 1.6,\n factions: [\n FactionNames.BachmanAssociates,\n FactionNames.NWO,\n FactionNames.ClarkeIncorporated,\n FactionNames.OmniTekIncorporated,\n FactionNames.FourSigma,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.BitWire,\n repCost: 3.75e3,\n moneyCost: 1e7,\n info:\n \"A small brain implant embedded in the cerebrum. This regulates and improves the brain's computing \" +\n \"capabilities.\",\n hacking: 1.05,\n factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.ArtificialBioNeuralNetwork,\n repCost: 2.75e5,\n moneyCost: 3e9,\n info:\n \"A network consisting of millions of nanoprocessors is embedded into the brain. \" +\n \"The network is meant to mimic the way a biological brain solves a problem, with each \" +\n \"nanoprocessor acting similar to the way a neuron would in a neural network. However, these \" +\n \"nanoprocessors are programmed to perform computations much faster than organic neurons, \" +\n \"allowing the user to solve much more complex problems at a much faster rate.\",\n hacking_speed: 1.03,\n hacking_money: 1.15,\n hacking: 1.12,\n factions: [FactionNames.BitRunners, FactionNames.FulcrumSecretTechnologies],\n }),\n new Augmentation({\n name: AugmentationNames.ArtificialSynapticPotentiation,\n repCost: 6.25e3,\n moneyCost: 8e7,\n info:\n \"The body is injected with a chemical that artificially induces synaptic potentiation, \" +\n \"otherwise known as the strengthening of synapses. This results in enhanced cognitive abilities.\",\n hacking_speed: 1.02,\n hacking_chance: 1.05,\n hacking_exp: 1.05,\n factions: [FactionNames.TheBlackHand, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.EnhancedMyelinSheathing,\n repCost: 1e5,\n moneyCost: 1.375e9,\n info:\n \"Electrical signals are used to induce a new, artificial form of myelinogenesis in the human body. \" +\n \"This process results in the proliferation of new, synthetic myelin sheaths in the nervous \" +\n \"system. These myelin sheaths can propogate neuro-signals much faster than their organic \" +\n \"counterparts, leading to greater processing speeds and better brain function.\",\n hacking_speed: 1.03,\n hacking_exp: 1.1,\n hacking: 1.08,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.BitRunners, FactionNames.TheBlackHand],\n }),\n new Augmentation({\n name: AugmentationNames.SynapticEnhancement,\n repCost: 2e3,\n moneyCost: 7.5e6,\n info:\n \"A small cranial implant that continuously uses weak electrical signals to stimulate the brain and \" +\n \"induce stronger synaptic activity. This improves the user's cognitive abilities.\",\n hacking_speed: 1.03,\n factions: [FactionNames.CyberSec, FactionNames.Aevum],\n }),\n new Augmentation({\n name: AugmentationNames.NeuralRetentionEnhancement,\n repCost: 2e4,\n moneyCost: 2.5e8,\n info:\n \"Chemical injections are used to permanently alter and strengthen the brain's neuronal \" +\n \"circuits, strengthening the ability to retain information.\",\n hacking_exp: 1.25,\n factions: [FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.DataJack,\n repCost: 1.125e5,\n moneyCost: 4.5e8,\n info:\n \"A brain implant that provides an interface for direct, wireless communication between a computer's main \" +\n \"memory and the mind. This implant allows the user to not only access a computer's memory, but also alter \" +\n \"and delete it.\",\n hacking_money: 1.25,\n factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.NiteSec,\n FactionNames.Chongqing,\n FactionNames.NewTokyo,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENM,\n repCost: 1.5e4,\n moneyCost: 2.5e8,\n info:\n \"A thin device embedded inside the arm containing a wireless module capable of connecting \" +\n \"to nearby networks. Once connected, the Netburner Module is capable of capturing and \" +\n \"processing all of the traffic on that network. By itself, the Embedded Netburner Module does \" +\n \"not do much, but a variety of very powerful upgrades can be installed that allow you to fully \" +\n \"control the traffic on a network.\",\n hacking: 1.08,\n factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.NiteSec,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMCore,\n repCost: 175e3,\n moneyCost: 2.5e9,\n info:\n \"The Core library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgrade allows the Embedded Netburner Module to generate its own data on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed: 1.03,\n hacking_money: 1.1,\n hacking_chance: 1.03,\n hacking_exp: 1.07,\n hacking: 1.07,\n factions: [\n FactionNames.BitRunners,\n FactionNames.TheBlackHand,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMCoreV2,\n repCost: 1e6,\n moneyCost: 4.5e9,\n info:\n \"The Core V2 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to control information on \" +\n \"a network by re-routing traffic, spoofing IP addresses, and altering the data inside network \" +\n \"packets.\",\n prereqs: [AugmentationNames.ENMCore, AugmentationNames.ENM],\n hacking_speed: 1.05,\n hacking_money: 1.3,\n hacking_chance: 1.05,\n hacking_exp: 1.15,\n hacking: 1.08,\n factions: [\n FactionNames.BitRunners,\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.BladeIndustries,\n FactionNames.OmniTekIncorporated,\n FactionNames.KuaiGongInternational,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMCoreV3,\n repCost: 1.75e6,\n moneyCost: 7.5e9,\n info:\n \"The Core V3 library is an implant that upgrades the firmware of the Embedded Netburner Module. \" +\n \"This upgraded firmware allows the Embedded Netburner Module to seamlessly inject code into \" +\n \"any device on a network.\",\n prereqs: [AugmentationNames.ENMCoreV2, AugmentationNames.ENMCore, AugmentationNames.ENM],\n hacking_speed: 1.05,\n hacking_money: 1.4,\n hacking_chance: 1.1,\n hacking_exp: 1.25,\n hacking: 1.1,\n factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMAnalyzeEngine,\n repCost: 6.25e5,\n moneyCost: 6e9,\n info:\n \"Installs the Analyze Engine for the Embedded Netburner Module, which is a CPU cluster \" +\n \"that vastly outperforms the Netburner Module's native single-core processor.\",\n prereqs: [AugmentationNames.ENM],\n hacking_speed: 1.1,\n factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ENMDMA,\n repCost: 1e6,\n moneyCost: 7e9,\n info:\n \"This implant installs a Direct Memory Access (DMA) controller into the \" +\n \"Embedded Netburner Module. This allows the Module to send and receive data \" +\n \"directly to and from the main memory of devices on a network.\",\n prereqs: [AugmentationNames.ENM],\n hacking_money: 1.4,\n hacking_chance: 1.2,\n factions: [\n FactionNames.ECorp,\n FactionNames.MegaCorp,\n FactionNames.FulcrumSecretTechnologies,\n FactionNames.NWO,\n FactionNames.Daedalus,\n FactionNames.TheCovenant,\n FactionNames.Illuminati,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.Neuralstimulator,\n repCost: 5e4,\n moneyCost: 3e9,\n info:\n \"A cranial implant that intelligently stimulates certain areas of the brain \" +\n \"in order to improve cognitive functions.\",\n hacking_speed: 1.02,\n hacking_chance: 1.1,\n hacking_exp: 1.12,\n factions: [\n FactionNames.TheBlackHand,\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n FactionNames.Volhaven,\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.NeuralAccelerator,\n repCost: 2e5,\n moneyCost: 1.75e9,\n info:\n \"A microprocessor that accelerates the processing \" +\n \"speed of biological neural networks. This is a cranial implant that is embedded inside the brain.\",\n hacking: 1.1,\n hacking_exp: 1.15,\n hacking_money: 1.2,\n factions: [FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG1,\n repCost: 1e4,\n moneyCost: 7e7,\n info:\n \"The first generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n hacking_speed: 1.01,\n hacking: 1.05,\n factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG2,\n repCost: 1.875e4,\n moneyCost: 1.25e8,\n info:\n \"The second generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG1],\n hacking_speed: 1.02,\n hacking_chance: 1.05,\n hacking: 1.07,\n factions: [FactionNames.CyberSec, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG3,\n repCost: 5e4,\n moneyCost: 5.5e8,\n info:\n \"The third generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [AugmentationNames.CranialSignalProcessorsG2, AugmentationNames.CranialSignalProcessorsG1],\n hacking_speed: 1.02,\n hacking_money: 1.15,\n hacking: 1.09,\n factions: [FactionNames.NiteSec, FactionNames.TheBlackHand, FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG4,\n repCost: 1.25e5,\n moneyCost: 1.1e9,\n info:\n \"The fourth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [\n AugmentationNames.CranialSignalProcessorsG3,\n AugmentationNames.CranialSignalProcessorsG2,\n AugmentationNames.CranialSignalProcessorsG1,\n ],\n hacking_speed: 1.02,\n hacking_money: 1.2,\n hacking_grow: 1.25,\n factions: [FactionNames.TheBlackHand, FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.CranialSignalProcessorsG5,\n repCost: 2.5e5,\n moneyCost: 2.25e9,\n info:\n \"The fifth generation of Cranial Signal Processors. Cranial Signal Processors \" +\n \"are a set of specialized microprocessors that are attached to \" +\n \"neurons in the brain. These chips process neural signals to quickly and automatically perform specific computations \" +\n \"so that the brain doesn't have to.\",\n prereqs: [\n AugmentationNames.CranialSignalProcessorsG4,\n AugmentationNames.CranialSignalProcessorsG3,\n AugmentationNames.CranialSignalProcessorsG2,\n AugmentationNames.CranialSignalProcessorsG1,\n ],\n hacking: 1.3,\n hacking_money: 1.25,\n hacking_grow: 1.75,\n factions: [FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.NeuronalDensification,\n repCost: 1.875e5,\n moneyCost: 1.375e9,\n info:\n \"The brain is surgically re-engineered to have increased neuronal density \" +\n \"by decreasing the neuron gap junction. Then, the body is genetically modified \" +\n \"to enhance the production and capabilities of its neural stem cells.\",\n hacking: 1.15,\n hacking_exp: 1.1,\n hacking_speed: 1.03,\n factions: [FactionNames.ClarkeIncorporated],\n }),\n new Augmentation({\n name: AugmentationNames.NuoptimalInjectorImplant,\n repCost: 5e3,\n moneyCost: 2e7,\n info:\n \"This torso implant automatically injects nootropic supplements into \" +\n \"the bloodstream to improve memory, increase focus, and provide other \" +\n \"cognitive enhancements.\",\n company_rep: 1.2,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.Volhaven,\n FactionNames.NewTokyo,\n FactionNames.Chongqing,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n FactionNames.BachmanAssociates,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.SpeechEnhancement,\n repCost: 2.5e3,\n moneyCost: 1.25e7,\n info:\n \"An advanced neural implant that improves your speaking abilities, making \" +\n \"you more convincing and likable in conversations and overall improving your \" +\n \"social interactions.\",\n company_rep: 1.1,\n charisma: 1.1,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.SpeakersForTheDead,\n FactionNames.FourSigma,\n FactionNames.KuaiGongInternational,\n FactionNames.ClarkeIncorporated,\n FactionNames.BachmanAssociates,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.FocusWire,\n repCost: 7.5e4,\n moneyCost: 9e8,\n info: \"A cranial implant that stops procrastination by blocking specific neural pathways in the brain.\",\n hacking_exp: 1.05,\n strength_exp: 1.05,\n defense_exp: 1.05,\n dexterity_exp: 1.05,\n agility_exp: 1.05,\n charisma_exp: 1.05,\n company_rep: 1.1,\n work_money: 1.2,\n factions: [\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n FactionNames.FourSigma,\n FactionNames.KuaiGongInternational,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.PCDNI,\n repCost: 3.75e5,\n moneyCost: 3.75e9,\n info:\n \"Installs a Direct-Neural Interface jack into your arm that is compatible with most \" +\n \"computers. Connecting to a computer through this jack allows you to interface with \" +\n \"it using the brain's electrochemical signals.\",\n company_rep: 1.3,\n hacking: 1.08,\n factions: [\n FactionNames.FourSigma,\n FactionNames.OmniTekIncorporated,\n FactionNames.ECorp,\n FactionNames.BladeIndustries,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.PCDNIOptimizer,\n repCost: 5e5,\n moneyCost: 4.5e9,\n info:\n \"This is a submodule upgrade to the PC Direct-Neural Interface augmentation. It \" +\n \"improves the performance of the interface and gives the user more control options \" +\n \"to a connected computer.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep: 1.75,\n hacking: 1.1,\n factions: [FactionNames.FulcrumSecretTechnologies, FactionNames.ECorp, FactionNames.BladeIndustries],\n }),\n new Augmentation({\n name: AugmentationNames.PCDNINeuralNetwork,\n repCost: 1.5e6,\n moneyCost: 7.5e9,\n info:\n \"This is an additional installation that upgrades the functionality of the \" +\n \"PC Direct-Neural Interface augmentation. When connected to a computer, \" +\n \"the Neural Network upgrade allows the user to use their own brain's \" +\n \"processing power to aid the computer in computational tasks.\",\n prereqs: [AugmentationNames.PCDNI],\n company_rep: 2,\n hacking: 1.1,\n hacking_speed: 1.05,\n factions: [FactionNames.FulcrumSecretTechnologies],\n }),\n new Augmentation({\n name: AugmentationNames.ADRPheromone1,\n repCost: 3.75e3,\n moneyCost: 1.75e7,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V1 pheromone, \" +\n \"an artificial pheromone discovered by scientists. The ADR-V1 pheromone, when excreted, \" +\n \"triggers feelings of admiration and approval in other people.\",\n company_rep: 1.1,\n faction_rep: 1.1,\n factions: [\n FactionNames.TianDiHui,\n FactionNames.TheSyndicate,\n FactionNames.NWO,\n FactionNames.MegaCorp,\n FactionNames.FourSigma,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ADRPheromone2,\n repCost: 6.25e4,\n moneyCost: 5.5e8,\n info:\n \"The body is genetically re-engineered so that it produces the ADR-V2 pheromone, \" +\n \"which is similar to but more potent than ADR-V1. This pheromone, when excreted, \" +\n \"triggers feelings of admiration, approval, and respect in others.\",\n company_rep: 1.2,\n faction_rep: 1.2,\n factions: [\n FactionNames.Silhouette,\n FactionNames.FourSigma,\n FactionNames.BachmanAssociates,\n FactionNames.ClarkeIncorporated,\n ],\n }),\n new Augmentation({\n name: AugmentationNames.ShadowsSimulacrum,\n repCost: 3.75e4,\n moneyCost: 4e8,\n info:\n \"A crude but functional matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation was developed by \" +\n \"criminal organizations and allows the user to project and control holographic \" +\n \"simulacrums within a large radius. These simulacrums are commonly used for \" +\n \"espionage and surveillance work.\",\n company_rep: 1.15,\n faction_rep: 1.15,\n factions: [FactionNames.TheSyndicate, FactionNames.TheDarkArmy, FactionNames.SpeakersForTheDead],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeCPUUpload,\n repCost: 3.75e3,\n moneyCost: 1.1e7,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's CPU into \" +\n \"the brain. This allows the user to engineer custom hardware and software \" +\n \"for the Hacknet Node that provides better performance.\",\n hacknet_node_money: 1.15,\n hacknet_node_purchase_cost: 0.85,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeCacheUpload,\n repCost: 2.5e3,\n moneyCost: 5.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's main-memory cache \" +\n \"into the brain. This allows the user to engineer custom cache hardware for the \" +\n \"Hacknet Node that offers better performance.\",\n hacknet_node_money: 1.1,\n hacknet_node_level_cost: 0.85,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeNICUpload,\n repCost: 1.875e3,\n moneyCost: 4.5e6,\n info:\n \"Uploads the architecture and design details of a Hacknet Node's Network Interface Card (NIC) \" +\n \"into the brain. This allows the user to engineer a custom NIC for the Hacknet Node that \" +\n \"offers better performance.\",\n hacknet_node_money: 1.1,\n hacknet_node_purchase_cost: 0.9,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeKernelDNI,\n repCost: 7.5e3,\n moneyCost: 4e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting to a \" +\n \"Hacknet Node. This lets the user access and manipulate the Node's kernel using \" +\n \"electrochemical signals.\",\n hacknet_node_money: 1.25,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.HacknetNodeCoreDNI,\n repCost: 1.25e4,\n moneyCost: 6e7,\n info:\n \"Installs a Direct-Neural Interface jack into the arm that is capable of connecting \" +\n \"to a Hacknet Node. This lets the user access and manipulate the Node's processing logic using \" +\n \"electrochemical signals.\",\n hacknet_node_money: 1.45,\n factions: [FactionNames.Netburners],\n }),\n new Augmentation({\n name: AugmentationNames.Neurotrainer1,\n repCost: 1e3,\n moneyCost: 4e6,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. It is \" +\n \"installed by releasing millions of nanobots into the human brain, each of which \" +\n \"attaches to a different neural pathway to enhance the brain's ability to retain \" +\n \"and retrieve information.\",\n hacking_exp: 1.1,\n strength_exp: 1.1,\n defense_exp: 1.1,\n dexterity_exp: 1.1,\n agility_exp: 1.1,\n charisma_exp: 1.1,\n factions: [FactionNames.CyberSec, FactionNames.Aevum],\n }),\n new Augmentation({\n name: AugmentationNames.Neurotrainer2,\n repCost: 1e4,\n moneyCost: 4.5e7,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I augmentation, but it does not \" +\n \"require Neurotrainer I to be installed as a prerequisite.\",\n hacking_exp: 1.15,\n strength_exp: 1.15,\n defense_exp: 1.15,\n dexterity_exp: 1.15,\n agility_exp: 1.15,\n charisma_exp: 1.15,\n factions: [FactionNames.BitRunners, FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.Neurotrainer3,\n repCost: 2.5e4,\n moneyCost: 1.3e8,\n info:\n \"A decentralized cranial implant that improves the brain's ability to learn. This \" +\n \"is a more powerful version of the Neurotrainer I and Neurotrainer II augmentation, \" +\n \"but it does not require either of them to be installed as a prerequisite.\",\n hacking_exp: 1.2,\n strength_exp: 1.2,\n defense_exp: 1.2,\n dexterity_exp: 1.2,\n agility_exp: 1.2,\n charisma_exp: 1.2,\n factions: [FactionNames.NWO, FactionNames.FourSigma],\n }),\n new Augmentation({\n name: AugmentationNames.Hypersight,\n repCost: 1.5e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic eye implant that grants sight capabilities far beyond those of a natural human. \" +\n \"Embedded circuitry within the implant provides the ability to detect heat and movement \" +\n \"through solid objects such as walls, thus providing 'x-ray vision'-like capabilities.\",\n dexterity: 1.4,\n hacking_speed: 1.03,\n hacking_money: 1.1,\n factions: [FactionNames.BladeIndustries, FactionNames.KuaiGongInternational],\n }),\n new Augmentation({\n name: AugmentationNames.LuminCloaking1,\n repCost: 1.5e3,\n moneyCost: 5e6,\n info:\n \"A skin implant that reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, have a negative refractive index. As a result, they bend light \" +\n \"around the skin, making the user much harder to see with the naked eye.\",\n agility: 1.05,\n crime_money: 1.1,\n factions: [FactionNames.SlumSnakes, FactionNames.Tetrads],\n }),\n new Augmentation({\n name: AugmentationNames.LuminCloaking2,\n repCost: 5e3,\n moneyCost: 3e7,\n info:\n \"This is a more advanced version of the LuminCloaking-V1 augmentation. This skin implant \" +\n \"reinforces the skin with highly-advanced synthetic cells. These \" +\n \"cells, when powered, are capable of not only bending light but also of bending heat, \" +\n \"making the user more resilient as well as stealthy.\",\n prereqs: [AugmentationNames.LuminCloaking1],\n agility: 1.1,\n defense: 1.1,\n crime_money: 1.25,\n factions: [FactionNames.SlumSnakes, FactionNames.Tetrads],\n }),\n new Augmentation({\n name: AugmentationNames.SmartSonar,\n repCost: 2.25e4,\n moneyCost: 7.5e7,\n info: \"A cochlear implant that helps the player detect and locate enemies using sound propagation.\",\n dexterity: 1.1,\n dexterity_exp: 1.15,\n crime_money: 1.25,\n factions: [FactionNames.SlumSnakes],\n }),\n new Augmentation({\n name: AugmentationNames.PowerRecirculator,\n repCost: 2.5e4,\n moneyCost: 1.8e8,\n info:\n \"The body's nerves are attached with polypyrrole nanocircuits that \" +\n \"are capable of capturing wasted energy, in the form of heat, \" +\n \"and converting it back into usable power.\",\n hacking: 1.05,\n strength: 1.05,\n defense: 1.05,\n dexterity: 1.05,\n agility: 1.05,\n charisma: 1.05,\n hacking_exp: 1.1,\n strength_exp: 1.1,\n defense_exp: 1.1,\n dexterity_exp: 1.1,\n agility_exp: 1.1,\n charisma_exp: 1.1,\n factions: [FactionNames.Tetrads, FactionNames.TheDarkArmy, FactionNames.TheSyndicate, FactionNames.NWO],\n }),\n new Augmentation({\n name: AugmentationNames.QLink,\n repCost: 1.875e6,\n moneyCost: 2.5e13,\n info:\n `A brain implant that wirelessly connects you to the ${FactionNames.Illuminati}'s ` +\n \"quantum supercomputer, allowing you to access and use its incredible \" +\n \"computing power.\",\n hacking: 1.75,\n hacking_speed: 2,\n hacking_chance: 2.5,\n hacking_money: 4,\n factions: [FactionNames.Illuminati],\n }),\n new Augmentation({\n name: AugmentationNames.SPTN97,\n repCost: 1.25e6,\n moneyCost: 4.875e9,\n info:\n \"The SPTN-97 gene is injected into the genome. The SPTN-97 gene is an \" +\n \"artificially-synthesized gene that was developed by DARPA to create \" +\n \"super-soldiers through genetic modification. The gene was outlawed in \" +\n \"2056.\",\n strength: 1.75,\n defense: 1.75,\n dexterity: 1.75,\n agility: 1.75,\n hacking: 1.15,\n factions: [FactionNames.TheCovenant],\n }),\n new Augmentation({\n name: AugmentationNames.HiveMind,\n repCost: 1.5e6,\n moneyCost: 5.5e9,\n info:\n `A brain implant developed by ${FactionNames.ECorp}. They do not reveal what ` +\n \"exactly the implant does, but they promise that it will greatly \" +\n \"enhance your abilities.\",\n hacking_grow: 3,\n stats: null,\n factions: [FactionNames.ECorp],\n }),\n new Augmentation({\n name: AugmentationNames.TheRedPill,\n repCost: 2.5e6,\n moneyCost: 0,\n info: \"It's time to leave the cave.\",\n stats: null,\n isSpecial: true,\n factions: [FactionNames.Daedalus],\n }),\n new Augmentation({\n name: AugmentationNames.CordiARCReactor,\n repCost: 1.125e6,\n moneyCost: 5e9,\n info:\n \"The thoracic cavity is equipped with a small chamber designed \" +\n \"to hold and sustain hydrogen plasma. The plasma is used to generate \" +\n \"fusion power through nuclear fusion, providing limitless amounts of clean \" +\n \"energy for the body.\",\n strength: 1.35,\n defense: 1.35,\n dexterity: 1.35,\n agility: 1.35,\n strength_exp: 1.35,\n defense_exp: 1.35,\n dexterity_exp: 1.35,\n agility_exp: 1.35,\n factions: [FactionNames.MegaCorp],\n }),\n new Augmentation({\n name: AugmentationNames.SmartJaw,\n repCost: 3.75e5,\n moneyCost: 2.75e9,\n info:\n \"A bionic jaw that contains advanced hardware and software \" +\n \"capable of psychoanalyzing and profiling the personality of \" +\n \"others using optical imaging software.\",\n charisma: 1.5,\n charisma_exp: 1.5,\n company_rep: 1.25,\n faction_rep: 1.25,\n factions: [FactionNames.BachmanAssociates],\n }),\n new Augmentation({\n name: AugmentationNames.Neotra,\n repCost: 5.625e5,\n moneyCost: 2.875e9,\n info:\n \"A highly-advanced techno-organic drug that is injected into the skeletal \" +\n \"and integumentary system. The drug permanently modifies the DNA of the \" +\n \"body's skin and bone cells, granting them the ability to repair \" +\n \"and restructure themselves.\",\n strength: 1.55,\n defense: 1.55,\n factions: [FactionNames.BladeIndustries],\n }),\n new Augmentation({\n name: AugmentationNames.Xanipher,\n repCost: 8.75e5,\n moneyCost: 4.25e9,\n info:\n \"A concoction of advanced nanobots that is orally ingested into the \" +\n \"body. These nanobots induce physiological changes and significantly \" +\n \"improve the body's functioning in all aspects.\",\n hacking: 1.2,\n strength: 1.2,\n defense: 1.2,\n dexterity: 1.2,\n agility: 1.2,\n charisma: 1.2,\n hacking_exp: 1.15,\n strength_exp: 1.15,\n defense_exp: 1.15,\n dexterity_exp: 1.15,\n agility_exp: 1.15,\n charisma_exp: 1.15,\n factions: [FactionNames.NWO],\n }),\n new Augmentation({\n name: AugmentationNames.HydroflameLeftArm,\n repCost: 1.25e6,\n moneyCost: 2.5e12,\n info:\n \"The left arm of a legendary BitRunner who ascended beyond this world. \" +\n \"It projects a light blue energy shield that protects the exposed inner parts. \" +\n \"Even though it contains no weapons, the advanced tungsten titanium \" +\n \"alloy increases the user's strength to unbelievable levels. The augmentation \" +\n \"gets more powerful over time for seemingly no reason.\",\n strength: 2.7,\n factions: [FactionNames.NWO],\n }),\n new Augmentation({\n name: AugmentationNames.nextSENS,\n repCost: 4.375e5,\n moneyCost: 1.925e9,\n info:\n \"The body is genetically re-engineered to maintain a state \" +\n \"of negligible senescence, preventing the body from \" +\n \"deteriorating with age.\",\n hacking: 1.2,\n strength: 1.2,\n defense: 1.2,\n dexterity: 1.2,\n agility: 1.2,\n charisma: 1.2,\n factions: [FactionNames.ClarkeIncorporated],\n }),\n new Augmentation({\n name: AugmentationNames.OmniTekInfoLoad,\n repCost: 6.25e5,\n moneyCost: 2.875e9,\n info:\n \"OmniTek's data and information repository is uploaded \" +\n \"into your brain, enhancing your programming and \" +\n \"hacking abilities.\",\n hacking: 1.2,\n hacking_exp: 1.25,\n factions: [FactionNames.OmniTekIncorporated],\n }),\n new Augmentation({\n name: AugmentationNames.PhotosyntheticCells,\n repCost: 5.625e5,\n moneyCost: 2.75e9,\n info:\n \"Chloroplasts are added to epidermal stem cells and are applied \" +\n \"to the body using a skin graft. The result is photosynthetic \" +\n \"skin cells, allowing users to generate their own energy \" +\n \"and nutrition using solar power.\",\n strength: 1.4,\n defense: 1.4,\n agility: 1.4,\n factions: [FactionNames.KuaiGongInternational],\n }),\n new Augmentation({\n name: AugmentationNames.Neurolink,\n repCost: 8.75e5,\n moneyCost: 4.375e9,\n info:\n \"A brain implant that provides a high-bandwidth, direct neural link between your \" +\n `mind and the ${FactionNames.BitRunners}' data servers, which reportedly contain ` +\n \"the largest database of hacking tools and information in the world.\",\n hacking: 1.15,\n hacking_exp: 1.2,\n hacking_chance: 1.1,\n hacking_speed: 1.05,\n programs: [Programs.FTPCrackProgram.name, Programs.RelaySMTPProgram.name],\n factions: [FactionNames.BitRunners],\n }),\n new Augmentation({\n name: AugmentationNames.TheBlackHand,\n repCost: 1e5,\n moneyCost: 5.5e8,\n info:\n \"A highly advanced bionic hand. This prosthetic not only \" +\n \"enhances strength and dexterity but it is also embedded \" +\n \"with hardware and firmware that lets the user connect to, access, and hack \" +\n \"devices and machines by just touching them.\",\n strength: 1.15,\n dexterity: 1.15,\n hacking: 1.1,\n hacking_speed: 1.02,\n hacking_money: 1.1,\n factions: [FactionNames.TheBlackHand],\n }),\n new Augmentation({\n name: AugmentationNames.CRTX42AA,\n repCost: 4.5e4,\n moneyCost: 2.25e8,\n info:\n \"The CRTX42-AA gene is injected into the genome. \" +\n \"The CRTX42-AA is an artificially-synthesized gene that targets the visual and prefrontal \" +\n \"cortex and improves cognitive abilities.\",\n hacking: 1.08,\n hacking_exp: 1.15,\n factions: [FactionNames.NiteSec],\n }),\n new Augmentation({\n name: AugmentationNames.Neuregen,\n repCost: 3.75e4,\n moneyCost: 3.75e8,\n info:\n \"A drug that genetically modifies the neurons in the brain \" +\n \"resulting in neurons that never die, continuously \" +\n \"regenerate, and strengthen themselves.\",\n hacking_exp: 1.4,\n factions: [FactionNames.Chongqing],\n }),\n new Augmentation({\n name: AugmentationNames.CashRoot,\n repCost: 1.25e4,\n moneyCost: 1.25e8,\n info: (\n <>\n A collection of digital assets saved on a small chip. The chip is implanted into your wrist. A small jack in the\n chip allows you to connect it to a computer and upload the assets.\n \n ),\n startingMoney: 1e6,\n programs: [Programs.BruteSSHProgram.name],\n factions: [FactionNames.Sector12],\n }),\n new Augmentation({\n name: AugmentationNames.NutriGen,\n repCost: 6.25e3,\n moneyCost: 2.5e6,\n info:\n \"A thermo-powered artificial nutrition generator. Endogenously \" +\n \"synthesizes glucose, amino acids, and vitamins and redistributes them \" +\n \"across the body. The device is powered by the body's naturally wasted \" +\n \"energy in the form of heat.\",\n strength_exp: 1.2,\n defense_exp: 1.2,\n dexterity_exp: 1.2,\n agility_exp: 1.2,\n factions: [FactionNames.NewTokyo],\n }),\n new Augmentation({\n name: AugmentationNames.PCMatrix,\n repCost: 100e3,\n moneyCost: 2e9,\n info:\n \"A 'Probability Computation Matrix' is installed in the frontal cortex. This implant \" +\n \"uses advanced mathematical algorithims to rapidly identify and compute statistical \" +\n \"outcomes of nearly every situation.\",\n charisma: 1.0777,\n charisma_exp: 1.0777,\n work_money: 1.777,\n faction_rep: 1.0777,\n company_rep: 1.0777,\n crime_success: 1.0777,\n crime_money: 1.0777,\n programs: [Programs.DeepscanV1.name, Programs.AutoLink.name],\n factions: [FactionNames.Aevum],\n }),\n new Augmentation({\n name: AugmentationNames.INFRARet,\n repCost: 7.5e3,\n moneyCost: 3e7,\n info: \"A tiny chip that sits behind the retinae. This implant lets the user visually detect infrared radiation.\",\n crime_success: 1.25,\n crime_money: 1.1,\n dexterity: 1.1,\n factions: [FactionNames.Ishima],\n }),\n new Augmentation({\n name: AugmentationNames.DermaForce,\n repCost: 1.5e4,\n moneyCost: 5e7,\n info:\n \"Synthetic skin that is grafted onto the body. This skin consists of \" +\n \"millions of nanobots capable of projecting high-density muon beams, \" +\n \"creating an energy barrier around the user.\",\n defense: 1.4,\n factions: [FactionNames.Volhaven],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBrachiBlades,\n repCost: 2.25e5,\n moneyCost: 2.5e9,\n info:\n \"An upgrade to the BrachiBlades augmentation. It infuses \" +\n \"the retractable blades with an advanced graphene material \" +\n \"making them stronger and lighter.\",\n prereqs: [AugmentationNames.BrachiBlades],\n strength: 1.4,\n defense: 1.4,\n crime_success: 1.1,\n crime_money: 1.3,\n factions: [FactionNames.SpeakersForTheDead],\n }),\n new Augmentation({\n name: AugmentationNames.GrapheneBionicArms,\n repCost: 5e5,\n moneyCost: 3.75e9,\n info:\n \"An upgrade to the Bionic Arms augmentation. It infuses the \" +\n \"prosthetic arms with an advanced graphene material \" +\n \"to make them stronger and lighter.\",\n prereqs: [AugmentationNames.BionicArms],\n strength: 1.85,\n dexterity: 1.85,\n factions: [FactionNames.TheDarkArmy],\n }),\n new Augmentation({\n name: AugmentationNames.BrachiBlades,\n repCost: 1.25e4,\n moneyCost: 9e7,\n info: \"A set of retractable plasteel blades that are implanted in the arm, underneath the skin.\",\n strength: 1.15,\n defense: 1.15,\n crime_success: 1.1,\n crime_money: 1.15,\n factions: [FactionNames.TheSyndicate],\n }),\n new Augmentation({\n name: AugmentationNames.BionicArms,\n repCost: 6.25e4,\n moneyCost: 2.75e8,\n info: \"Cybernetic arms created from plasteel and carbon fibers that completely replace the user's organic arms.\",\n strength: 1.3,\n dexterity: 1.3,\n factions: [FactionNames.Tetrads],\n }),\n new Augmentation({\n name: AugmentationNames.SNA,\n repCost: 6.25e3,\n moneyCost: 3e7,\n info:\n \"A cranial implant that affects the user's personality, making them better \" +\n \"at negotiation in social situations.\",\n work_money: 1.1,\n company_rep: 1.15,\n faction_rep: 1.15,\n factions: [FactionNames.TianDiHui],\n }),\n new Augmentation({\n name: AugmentationNames.NeuroreceptorManager,\n repCost: 0.75e5,\n moneyCost: 5.5e8,\n info:\n \"A brain implant carefully assembled around the synapses, which \" +\n \"micromanages the activity and levels of various neuroreceptor \" +\n \"chemicals and modulates electrical activity to optimize concentration, \" +\n \"allowing the user to multitask much more effectively.\",\n stats: (\n <>\n This augmentation removes the penalty for not focusing on actions such as working in a job or working for a\n faction.\n \n ),\n factions: [FactionNames.TianDiHui],\n }),\n\n // Grafting-exclusive Augmentation\n new Augmentation({\n name: AugmentationNames.CongruityImplant,\n repCost: Infinity,\n moneyCost: 50e12,\n info: (\n <>\n Developed by a pioneer in Grafting research, this implant generates pulses of stability which seem to have a\n nullifying effect versus the Entropy virus.\n
\n
\n Note: For unknown reasons, the lowercase n appears to be an integral component to its\n functionality.\n \n ),\n stats: <>This Augmentation removes the Entropy virus, and prevents it from affecting you again.,\n factions: [],\n }),\n];\n\nexport const initBladeburnerAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.EsperEyewear,\n repCost: 1.25e3,\n moneyCost: 1.65e8,\n info:\n \"Ballistic-grade protective and retractable eyewear that was designed specifically \" +\n \"for Bladeburner units. This \" +\n \"is implanted by installing a mechanical frame in the skull's orbit. \" +\n \"This frame interfaces with the brain and allows the user to \" +\n \"automatically extrude and extract the eyewear. The eyewear protects \" +\n \"against debris, shrapnel, lasers, blinding flashes, and gas. It is also \" +\n \"embedded with a data processing chip that can be programmed to display an \" +\n \"AR HUD to assist the user in field missions.\",\n bladeburner_success_chance: 1.03,\n dexterity: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.EMS4Recombination,\n repCost: 2.5e3,\n moneyCost: 2.75e8,\n info:\n \"A DNA recombination of the EMS-4 Gene. This genetic engineering \" +\n \"technique was originally used on Bladeburners during the Synthoid uprising \" +\n \"to induce wakefulness and concentration, suppress fear, reduce empathy, \" +\n \"improve reflexes, and improve memory among other things.\",\n bladeburner_success_chance: 1.03,\n bladeburner_analysis: 1.05,\n bladeburner_stamina_gain: 1.02,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.OrionShoulder,\n repCost: 6.25e3,\n moneyCost: 5.5e8,\n info:\n \"A bionic shoulder augmentation for the right shoulder. Using cybernetics, \" +\n \"the ORION-MKIV shoulder enhances the strength and dexterity \" +\n \"of the user's right arm. It also provides protection due to its \" +\n \"crystallized graphene plating.\",\n defense: 1.05,\n strength: 1.05,\n dexterity: 1.05,\n bladeburner_success_chance: 1.04,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.HyperionV1,\n repCost: 1.25e4,\n moneyCost: 2.75e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. The Hyperion is capable \" +\n \"of rapidly firing bolts of high-density plasma. The weapon is meant to \" +\n \"be used against augmented enemies as the ionized \" +\n \"nature of the plasma disrupts the electrical systems of Augmentations. However, \" +\n \"it can also be effective against non-augmented enemies due to its high temperature \" +\n \"and concussive force.\",\n bladeburner_success_chance: 1.06,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.HyperionV2,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"A pair of mini plasma cannons embedded into the hands. This augmentation \" +\n \"is more advanced and powerful than the original V1 model. This V2 model is \" +\n \"more power-efficient, more accurate, and can fire plasma bolts at a much \" +\n \"higher velocity than the V1 model.\",\n prereqs: [AugmentationNames.HyperionV1],\n bladeburner_success_chance: 1.08,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.GolemSerum,\n repCost: 3.125e4,\n moneyCost: 1.1e10,\n info:\n \"A serum that permanently enhances many aspects of human capabilities, \" +\n \"including strength, speed, immune system enhancements, and mitochondrial efficiency. The \" +\n \"serum was originally developed by the Chinese military in an attempt to \" +\n \"create super soldiers.\",\n strength: 1.07,\n defense: 1.07,\n dexterity: 1.07,\n agility: 1.07,\n bladeburner_stamina_gain: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.VangelisVirus,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"A synthetic symbiotic virus that is injected into human brain tissue. The Vangelis virus \" +\n \"heightens the senses and focus of its host, and also enhances its intuition.\",\n dexterity_exp: 1.1,\n bladeburner_analysis: 1.1,\n bladeburner_success_chance: 1.04,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.VangelisVirus3,\n repCost: 3.75e4,\n moneyCost: 1.1e10,\n info:\n \"An improved version of Vangelis, a synthetic symbiotic virus that is \" +\n \"injected into human brain tissue. On top of the benefits of the original \" +\n \"virus, this also grants accelerated healing and enhanced \" +\n \"reflexes.\",\n prereqs: [AugmentationNames.VangelisVirus],\n defense_exp: 1.1,\n dexterity_exp: 1.1,\n bladeburner_analysis: 1.15,\n bladeburner_success_chance: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.INTERLINKED,\n repCost: 2.5e4,\n moneyCost: 5.5e9,\n info:\n \"The DNA is genetically modified to enhance the human's body \" +\n \"extracellular matrix (ECM). This improves the ECM's ability to \" +\n \"structurally support the body and grants heightened strength and \" +\n \"durability.\",\n strength_exp: 1.05,\n defense_exp: 1.05,\n dexterity_exp: 1.05,\n agility_exp: 1.05,\n bladeburner_max_stamina: 1.1,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeRunner,\n repCost: 2e4,\n moneyCost: 8.25e9,\n info:\n `A cybernetic foot augmentation that was specifically created for ${FactionNames.Bladeburners} ` +\n \"during the Synthoid Uprising. The organic musculature of the human foot \" +\n \"is enhanced with flexible carbon nanotube matrices that are controlled by \" +\n \"intelligent servo-motors.\",\n agility: 1.05,\n bladeburner_max_stamina: 1.05,\n bladeburner_stamina_gain: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmor,\n repCost: 1.25e4,\n moneyCost: 1.375e9,\n info:\n `A powered exoskeleton suit designed as armor for ${FactionNames.Bladeburners} units. This ` +\n \"exoskeleton is incredibly adaptable and can protect the wearer from blunt, piercing, \" +\n \"concussive, thermal, chemical, and electric trauma. It also enhances the user's \" +\n \"physical abilities.\",\n strength: 1.04,\n defense: 1.04,\n dexterity: 1.04,\n agility: 1.04,\n bladeburner_stamina_gain: 1.02,\n bladeburner_success_chance: 1.03,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorPowerCells,\n repCost: 1.875e4,\n moneyCost: 2.75e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with Ion Power Cells, which are capable of \" +\n \"more efficiently storing and using power.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance: 1.05,\n bladeburner_stamina_gain: 1.02,\n bladeburner_max_stamina: 1.05,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorEnergyShielding,\n repCost: 2.125e4,\n moneyCost: 5.5e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a plasma energy propulsion system \" +\n \"that is capable of projecting an energy shielding force field.\",\n prereqs: [AugmentationNames.BladeArmor],\n defense: 1.05,\n bladeburner_success_chance: 1.06,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorUnibeam,\n repCost: 3.125e4,\n moneyCost: 1.65e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with a concentrated deuterium-fluoride laser \" +\n \"weapon. It's precision and accuracy makes it useful for quickly neutralizing \" +\n \"threats while keeping casualties to a minimum.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_success_chance: 1.08,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorOmnibeam,\n repCost: 6.25e4,\n moneyCost: 2.75e10,\n info:\n \"Upgrades the BLADE-51b Tesla Armor Unibeam augmentation to use a \" +\n \"multiple-fiber system. This upgraded weapon uses multiple fiber laser \" +\n \"modules that combine together to form a single, more powerful beam of up to \" +\n \"2000MW.\",\n prereqs: [AugmentationNames.BladeArmorUnibeam],\n bladeburner_success_chance: 1.1,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladeArmorIPU,\n repCost: 1.5e4,\n moneyCost: 1.1e9,\n info:\n \"Upgrades the BLADE-51b Tesla Armor with an AI Information Processing \" +\n \"Unit that was specially designed to analyze Synthoid related data and \" +\n \"information.\",\n prereqs: [AugmentationNames.BladeArmor],\n bladeburner_analysis: 1.15,\n bladeburner_success_chance: 1.02,\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n new Augmentation({\n name: AugmentationNames.BladesSimulacrum,\n repCost: 1.25e3,\n moneyCost: 1.5e11,\n info:\n \"A highly-advanced matter phase-shifter module that is embedded \" +\n \"in the brainstem and cerebellum. This augmentation allows \" +\n \"the user to project and control a holographic simulacrum within an \" +\n \"extremely large radius. These specially-modified holograms were specifically \" +\n \"weaponized by Bladeburner units to be used against Synthoids.\",\n stats: (\n <>\n This augmentation allows you to perform Bladeburner actions and other actions (such as working, commiting\n crimes, etc.) at the same time.\n \n ),\n isSpecial: true,\n factions: [FactionNames.Bladeburners],\n }),\n];\n\nexport const initChurchOfTheMachineGodAugmentations = (): Augmentation[] => [\n new Augmentation({\n name: AugmentationNames.StaneksGift1,\n repCost: 0,\n moneyCost: 0,\n info:\n 'Allison \"Mother\" Stanek imparts you with her gift. An ' +\n \"experimental Augmentation implanted at the base of the neck. \" +\n \"It allows you to overclock your entire system by carefully \" +\n \"changing the configuration.\",\n isSpecial: true,\n hacking_chance: 0.9,\n hacking_speed: 0.9,\n hacking_money: 0.9,\n hacking_grow: 0.9,\n hacking: 0.9,\n strength: 0.9,\n defense: 0.9,\n dexterity: 0.9,\n agility: 0.9,\n charisma: 0.9,\n hacking_exp: 0.9,\n strength_exp: 0.9,\n defense_exp: 0.9,\n dexterity_exp: 0.9,\n agility_exp: 0.9,\n charisma_exp: 0.9,\n company_rep: 0.9,\n faction_rep: 0.9,\n crime_money: 0.9,\n crime_success: 0.9,\n hacknet_node_money: 0.9,\n hacknet_node_purchase_cost: 1.1,\n hacknet_node_ram_cost: 1.1,\n hacknet_node_core_cost: 1.1,\n hacknet_node_level_cost: 1.1,\n work_money: 0.9,\n stats: <>Its unstable nature decreases all your stats by 10%,\n factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n new Augmentation({\n name: AugmentationNames.StaneksGift2,\n repCost: 1e6,\n moneyCost: 0,\n info:\n \"The next evolution is near, a coming together of man and machine. A synthesis greater than the birth of the human \" +\n \"organism. Time spent with the gift has allowed for acclimatization of the invasive augment and the toll it takes upon \" +\n \"your frame granting a 5% reduced penalty to all stats.\",\n prereqs: [AugmentationNames.StaneksGift1],\n isSpecial: true,\n hacking_chance: 0.95 / 0.9,\n hacking_speed: 0.95 / 0.9,\n hacking_money: 0.95 / 0.9,\n hacking_grow: 0.95 / 0.9,\n hacking: 0.95 / 0.9,\n strength: 0.95 / 0.9,\n defense: 0.95 / 0.9,\n dexterity: 0.95 / 0.9,\n agility: 0.95 / 0.9,\n charisma: 0.95 / 0.9,\n hacking_exp: 0.95 / 0.9,\n strength_exp: 0.95 / 0.9,\n defense_exp: 0.95 / 0.9,\n dexterity_exp: 0.95 / 0.9,\n agility_exp: 0.95 / 0.9,\n charisma_exp: 0.95 / 0.9,\n company_rep: 0.95 / 0.9,\n faction_rep: 0.95 / 0.9,\n crime_money: 0.95 / 0.9,\n crime_success: 0.95 / 0.9,\n hacknet_node_money: 0.95 / 0.9,\n hacknet_node_purchase_cost: 1.05 / 1.1,\n hacknet_node_ram_cost: 1.05 / 1.1,\n hacknet_node_core_cost: 1.05 / 1.1,\n hacknet_node_level_cost: 1.05 / 1.1,\n work_money: 0.95 / 0.9,\n stats: <>The penalty for the gift is reduced to 5%,\n factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n new Augmentation({\n name: AugmentationNames.StaneksGift3,\n repCost: 1e8,\n moneyCost: 0,\n info:\n \"The synthesis of human and machine is nothing to fear. It is our destiny. \" +\n \"You will become greater than the sum of our parts. As One. Embrace your gift \" +\n \"fully and wholly free of it's accursed toll. Serenity brings tranquility in the form \" +\n \"of no longer suffering a stat penalty. \",\n prereqs: [AugmentationNames.StaneksGift2, AugmentationNames.StaneksGift1],\n isSpecial: true,\n hacking_chance: 1 / 0.95,\n hacking_speed: 1 / 0.95,\n hacking_money: 1 / 0.95,\n hacking_grow: 1 / 0.95,\n hacking: 1 / 0.95,\n strength: 1 / 0.95,\n defense: 1 / 0.95,\n dexterity: 1 / 0.95,\n agility: 1 / 0.95,\n charisma: 1 / 0.95,\n hacking_exp: 1 / 0.95,\n strength_exp: 1 / 0.95,\n defense_exp: 1 / 0.95,\n dexterity_exp: 1 / 0.95,\n agility_exp: 1 / 0.95,\n charisma_exp: 1 / 0.95,\n company_rep: 1 / 0.95,\n faction_rep: 1 / 0.95,\n crime_money: 1 / 0.95,\n crime_success: 1 / 0.95,\n hacknet_node_money: 1 / 0.95,\n hacknet_node_purchase_cost: 1 / 1.05,\n hacknet_node_ram_cost: 1 / 1.05,\n hacknet_node_core_cost: 1 / 1.05,\n hacknet_node_level_cost: 1 / 1.05,\n work_money: 1 / 0.95,\n stats: <>Stanek's Gift has no penalty.,\n factions: [FactionNames.ChurchOfTheMachineGod],\n }),\n];\n\nexport function initNeuroFluxGovernor(): Augmentation {\n const donationBonus = CONSTANTS.Donations / 1e6 / 100; // 1 millionth of a percent per donation\n return new Augmentation({\n name: AugmentationNames.NeuroFluxGovernor,\n repCost: 500,\n moneyCost: 750e3,\n info:\n \"A device that is embedded in the back of the neck. The NeuroFlux Governor \" +\n \"monitors and regulates nervous impulses coming to and from the spinal column, \" +\n \"essentially 'governing' the body. By doing so, it improves the functionality of the \" +\n \"body's nervous system.\",\n stats: (\n <>\n This special augmentation can be leveled up infinitely. Each level of this augmentation increases MOST\n multipliers by 1% (+{(donationBonus * 100).toFixed(6)}% boosted by real life blood donations), stacking\n multiplicatively.\n \n ),\n isSpecial: true,\n hacking_chance: 1.01 + donationBonus,\n hacking_speed: 1.01 + donationBonus,\n hacking_money: 1.01 + donationBonus,\n hacking_grow: 1.01 + donationBonus,\n hacking: 1.01 + donationBonus,\n strength: 1.01 + donationBonus,\n defense: 1.01 + donationBonus,\n dexterity: 1.01 + donationBonus,\n agility: 1.01 + donationBonus,\n charisma: 1.01 + donationBonus,\n hacking_exp: 1.01 + donationBonus,\n strength_exp: 1.01 + donationBonus,\n defense_exp: 1.01 + donationBonus,\n dexterity_exp: 1.01 + donationBonus,\n agility_exp: 1.01 + donationBonus,\n charisma_exp: 1.01 + donationBonus,\n company_rep: 1.01 + donationBonus,\n faction_rep: 1.01 + donationBonus,\n crime_money: 1.01 + donationBonus,\n crime_success: 1.01 + donationBonus,\n hacknet_node_money: 1.01 + donationBonus,\n hacknet_node_purchase_cost: 1 / (1.01 + donationBonus),\n hacknet_node_ram_cost: 1 / (1.01 + donationBonus),\n hacknet_node_core_cost: 1 / (1.01 + donationBonus),\n hacknet_node_level_cost: 1 / (1.01 + donationBonus),\n work_money: 1.01 + donationBonus,\n factions: Object.values(FactionNames).filter(\n (factionName) =>\n ![FactionNames.ShadowsOfAnarchy, FactionNames.Bladeburners, FactionNames.ChurchOfTheMachineGod].includes(\n factionName,\n ),\n ),\n });\n}\n\nexport function initUnstableCircadianModulator(): Augmentation {\n //Time-Based Augment Test\n const randomBonuses = getRandomBonus();\n\n const UnstableCircadianModulatorParams: IConstructorParams = {\n name: AugmentationNames.UnstableCircadianModulator,\n moneyCost: 5e9,\n repCost: 3.625e5,\n info:\n \"An experimental nanobot injection. Its unstable nature leads to \" +\n \"unpredictable results based on your circadian rhythm.\",\n factions: [FactionNames.SpeakersForTheDead],\n };\n Object.keys(randomBonuses.bonuses).forEach(\n (key) => ((UnstableCircadianModulatorParams as any)[key] = randomBonuses.bonuses[key]),\n );\n\n return new Augmentation(UnstableCircadianModulatorParams);\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\n// tslint:disable:max-file-line-count\n\n// This could actually be a JSON file as it should be constant metadata to be imported...\nimport { IMinMaxRange } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { LiteratureNames } from \"../../Literature/data/LiteratureNames\";\nimport { SpecialServers } from \"./SpecialServers\";\n\n/**\n * The metadata describing the base state of servers on the network.\n * These values will be adjusted based on Bitnode multipliers when the Server objects are built out.\n */\ninterface IServerMetadata {\n /**\n * When populated, the base security level of the server.\n */\n hackDifficulty?: number | IMinMaxRange;\n\n /**\n * The DNS name of the server.\n */\n hostname: string;\n\n /**\n * When populated, the files will be added to the server when created.\n */\n literature?: string[];\n\n /**\n * When populated, the exponent of 2^x amount of RAM the server has.\n * This should be in the range of 1-20, to match the Player's max RAM.\n */\n maxRamExponent?: number | IMinMaxRange;\n\n /**\n * How much money the server starts out with.\n */\n moneyAvailable: number | IMinMaxRange;\n\n /**\n * The number of network layers away from the `home` server.\n * This value is between 1 and 15.\n * If this is not populated, @specialName should be.\n */\n networkLayer?: number | IMinMaxRange;\n\n /**\n * The number of ports that must be opened before the player can execute NUKE.\n */\n numOpenPortsRequired: number;\n\n /**\n * The organization that the server belongs to.\n */\n organizationName: string;\n\n /**\n * The minimum hacking level before the player can run NUKE.\n */\n requiredHackingSkill: number | IMinMaxRange;\n\n /**\n * The growth factor for the server.\n */\n serverGrowth?: number | IMinMaxRange;\n\n /**\n * A \"unique\" server that has special implications when the player manually hacks it.\n */\n specialName?: string;\n}\n\n/**\n * The metadata for building up the servers on the network.\n */\nexport const serverMetadata: IServerMetadata[] = [\n {\n hackDifficulty: 99,\n hostname: LocationName.AevumECorp.toLowerCase(),\n moneyAvailable: {\n max: 70e9,\n min: 30e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumECorp,\n requiredHackingSkill: {\n max: 1400,\n min: 1050,\n },\n serverGrowth: 99,\n specialName: LocationName.AevumECorp,\n },\n {\n hackDifficulty: 99,\n hostname: LocationName.Sector12MegaCorp.toLowerCase(),\n moneyAvailable: {\n max: 60e9,\n min: 40e9,\n },\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12MegaCorp,\n requiredHackingSkill: {\n max: 1350,\n min: 1100,\n },\n serverGrowth: 99,\n specialName: LocationName.Sector12MegaCorp,\n },\n {\n hackDifficulty: {\n max: 88,\n min: 72,\n },\n hostname: \"b-and-a\",\n moneyAvailable: {\n max: 30e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumBachmanAndAssociates,\n requiredHackingSkill: {\n max: 1150,\n min: 900,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.AevumBachmanAndAssociates,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 88,\n },\n hostname: \"blade\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: {\n max: 40e9,\n min: 10e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12BladeIndustries,\n requiredHackingSkill: {\n max: 1200,\n min: 900,\n },\n serverGrowth: {\n max: 85,\n min: 55,\n },\n specialName: LocationName.Sector12BladeIndustries,\n },\n {\n hackDifficulty: 99,\n hostname: LocationName.VolhavenNWO.toLowerCase(),\n literature: [LiteratureNames.TheHiddenWorld],\n moneyAvailable: {\n max: 40e9,\n min: 20e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenNWO,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 95,\n min: 65,\n },\n specialName: LocationName.VolhavenNWO,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"clarkinc\",\n literature: [LiteratureNames.BeyondMan, LiteratureNames.CostOfImmortality],\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumClarkeIncorporated,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumClarkeIncorporated,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 90,\n },\n hostname: \"omnitek\",\n literature: [LiteratureNames.CodedIntelligence, LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 9,\n min: 7,\n },\n moneyAvailable: {\n max: 22e9,\n min: 13e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniTekIncorporated,\n requiredHackingSkill: {\n max: 1100,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 95,\n },\n specialName: LocationName.VolhavenOmniTekIncorporated,\n },\n {\n hackDifficulty: {\n max: 75,\n min: 55,\n },\n hostname: \"4sigma\",\n moneyAvailable: {\n max: 25e9,\n min: 15e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12FourSigma,\n requiredHackingSkill: {\n max: 1250,\n min: 900,\n },\n serverGrowth: {\n max: 99,\n min: 75,\n },\n specialName: LocationName.Sector12FourSigma,\n },\n {\n hackDifficulty: {\n max: 99,\n min: 95,\n },\n hostname: \"kuai-gong\",\n moneyAvailable: {\n max: 30e9,\n min: 20e9,\n },\n networkLayer: 13,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingKuaiGongInternational,\n requiredHackingSkill: {\n max: 1300,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 90,\n },\n specialName: LocationName.ChongqingKuaiGongInternational,\n },\n {\n hackDifficulty: {\n max: 97,\n min: 83,\n },\n hostname: \"fulcrumtech\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 11,\n min: 7,\n },\n moneyAvailable: {\n max: 1800e6,\n min: 1400e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1250,\n min: 950,\n },\n serverGrowth: {\n max: 99,\n min: 80,\n },\n specialName: LocationName.AevumFulcrumTechnologies,\n },\n {\n hackDifficulty: 99,\n hostname: \"fulcrumassets\",\n moneyAvailable: 1e6,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumFulcrumTechnologies,\n requiredHackingSkill: {\n max: 1600,\n min: 1100,\n },\n serverGrowth: 1,\n specialName: SpecialServers.FulcrumSecretTechnologies,\n },\n {\n hackDifficulty: {\n max: 92,\n min: 78,\n },\n hostname: \"stormtech\",\n moneyAvailable: {\n max: 1200e6,\n min: 1000e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.IshimaStormTechnologies,\n requiredHackingSkill: {\n max: 1075,\n min: 875,\n },\n serverGrowth: {\n max: 92,\n min: 68,\n },\n specialName: LocationName.IshimaStormTechnologies,\n },\n {\n hackDifficulty: {\n max: 96,\n min: 84,\n },\n hostname: \"defcomm\",\n moneyAvailable: {\n max: 950e6,\n min: 800e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoDefComm,\n requiredHackingSkill: {\n max: 1050,\n min: 850,\n },\n serverGrowth: {\n max: 73,\n min: 47,\n },\n specialName: LocationName.NewTokyoDefComm,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"infocomm\",\n moneyAvailable: {\n max: 900e6,\n min: 600e6,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"InfoComm\",\n requiredHackingSkill: {\n max: 950,\n min: 875,\n },\n serverGrowth: {\n max: 75,\n min: 35,\n },\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"helios\",\n literature: [LiteratureNames.BeyondMan],\n maxRamExponent: {\n max: 8,\n min: 5,\n },\n moneyAvailable: {\n max: 750e6,\n min: 550e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenHeliosLabs,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.VolhavenHeliosLabs,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: LocationName.NewTokyoVitaLife.toLowerCase(),\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800e6,\n min: 700e6,\n },\n networkLayer: 12,\n numOpenPortsRequired: 5,\n organizationName: LocationName.NewTokyoVitaLife,\n requiredHackingSkill: {\n max: 900,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n specialName: LocationName.NewTokyoVitaLife,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"icarus\",\n moneyAvailable: {\n max: 1000e6,\n min: 900e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12IcarusMicrosystems,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 95,\n min: 85,\n },\n specialName: LocationName.Sector12IcarusMicrosystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: \"univ-energy\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1200e6,\n min: 1100e6,\n },\n networkLayer: 9,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12UniversalEnergy,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.Sector12UniversalEnergy,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"titan-labs\",\n literature: [LiteratureNames.CodedIntelligence],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 750000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Titan Laboratories\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 60,\n },\n },\n {\n hackDifficulty: {\n max: 75,\n min: 65,\n },\n hostname: \"microdyne\",\n literature: [LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 5,\n organizationName: \"Microdyne Technologies\",\n requiredHackingSkill: {\n max: 875,\n min: 800,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"taiyang-digital\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.BrighterThanTheSun],\n moneyAvailable: {\n max: 900000000,\n min: 800000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 5,\n organizationName: \"Taiyang Digital\",\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"galactic-cyber\",\n moneyAvailable: {\n max: 850000000,\n min: 750000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumGalacticCybersystems,\n requiredHackingSkill: {\n max: 875,\n min: 825,\n },\n serverGrowth: {\n max: 90,\n min: 70,\n },\n specialName: LocationName.AevumGalacticCybersystems,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 80,\n },\n hostname: LocationName.AevumAeroCorp.toLowerCase(),\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 1200000000,\n min: 1000000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 5,\n organizationName: LocationName.AevumAeroCorp,\n requiredHackingSkill: {\n max: 925,\n min: 850,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.AevumAeroCorp,\n },\n {\n hackDifficulty: {\n max: 95,\n min: 85,\n },\n hostname: \"omnia\",\n literature: [LiteratureNames.HistoryOfSynthoids],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1000000000,\n min: 900000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenOmniaCybersystems,\n requiredHackingSkill: {\n max: 950,\n min: 850,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenOmniaCybersystems,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"zb-def\",\n literature: [LiteratureNames.SyntheticMuscles],\n moneyAvailable: {\n max: 1100000000,\n min: 900000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: \"ZB Defense Industries\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 65,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"applied-energetics\",\n moneyAvailable: {\n max: 1000000000,\n min: 700000000,\n },\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"Applied Energetics\",\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 75,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"solaris\",\n literature: [LiteratureNames.AGreenTomorrow, LiteratureNames.TheFailedFrontier],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 900000000,\n min: 700000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: LocationName.ChongqingSolarisSpaceSystems,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n specialName: LocationName.ChongqingSolarisSpaceSystems,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: LocationName.Sector12DeltaOne.toLowerCase(),\n moneyAvailable: {\n max: 1700000000,\n min: 1300000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 5,\n organizationName: LocationName.Sector12DeltaOne,\n requiredHackingSkill: {\n max: 900,\n min: 800,\n },\n serverGrowth: {\n max: 70,\n min: 50,\n },\n specialName: LocationName.Sector12DeltaOne,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 75,\n },\n hostname: \"global-pharm\",\n literature: [LiteratureNames.AGreenTomorrow],\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 1750000000,\n min: 1500000000,\n },\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: LocationName.NewTokyoGlobalPharmaceuticals,\n requiredHackingSkill: {\n max: 850,\n min: 750,\n },\n serverGrowth: {\n max: 90,\n min: 80,\n },\n specialName: LocationName.NewTokyoGlobalPharmaceuticals,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"nova-med\",\n moneyAvailable: {\n max: 1250000000,\n min: 1100000000,\n },\n networkLayer: 10,\n numOpenPortsRequired: 4,\n organizationName: LocationName.IshimaNovaMedical,\n requiredHackingSkill: {\n max: 850,\n min: 775,\n },\n serverGrowth: {\n max: 85,\n min: 65,\n },\n specialName: LocationName.IshimaNovaMedical,\n },\n {\n hackDifficulty: {\n max: 90,\n min: 70,\n },\n hostname: \"zeus-med\",\n moneyAvailable: {\n max: 1500000000,\n min: 1300000000,\n },\n networkLayer: 9,\n numOpenPortsRequired: 5,\n organizationName: \"Zeus Medical\",\n requiredHackingSkill: {\n max: 850,\n min: 800,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"unitalife\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 1000000000,\n },\n networkLayer: 8,\n numOpenPortsRequired: 4,\n organizationName: \"UnitaLife Group\",\n requiredHackingSkill: {\n max: 825,\n min: 775,\n },\n serverGrowth: {\n max: 80,\n min: 70,\n },\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"lexo-corp\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 800000000,\n min: 700000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenLexoCorp,\n requiredHackingSkill: {\n max: 750,\n min: 650,\n },\n serverGrowth: {\n max: 65,\n min: 55,\n },\n specialName: LocationName.VolhavenLexoCorp,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"rho-construction\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 700000000,\n min: 500000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumRhoConstruction,\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumRhoConstruction,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 50,\n },\n hostname: \"alpha-ent\",\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 750000000,\n min: 600000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.Sector12AlphaEnterprises,\n requiredHackingSkill: {\n max: 600,\n min: 500,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12AlphaEnterprises,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 70,\n },\n hostname: \"aevum-police\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 400000000,\n min: 200000000,\n },\n networkLayer: 6,\n numOpenPortsRequired: 4,\n organizationName: LocationName.AevumPolice,\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 50,\n min: 30,\n },\n specialName: LocationName.AevumPolice,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"rothman-uni\",\n literature: [\n LiteratureNames.SecretSocieties,\n LiteratureNames.TheFailedFrontier,\n LiteratureNames.TensionsInTechRace,\n ],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 250000000,\n min: 175000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.Sector12RothmanUniversity,\n requiredHackingSkill: {\n max: 430,\n min: 370,\n },\n serverGrowth: {\n max: 45,\n min: 35,\n },\n specialName: LocationName.Sector12RothmanUniversity,\n },\n {\n hackDifficulty: {\n max: 85,\n min: 65,\n },\n hostname: \"zb-institute\",\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 1100000000,\n min: 800000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 5,\n organizationName: LocationName.VolhavenZBInstituteOfTechnology,\n requiredHackingSkill: {\n max: 775,\n min: 725,\n },\n serverGrowth: {\n max: 85,\n min: 75,\n },\n specialName: LocationName.VolhavenZBInstituteOfTechnology,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 45,\n },\n hostname: \"summit-uni\",\n literature: [LiteratureNames.SecretSocieties, LiteratureNames.TheFailedFrontier, LiteratureNames.SyntheticMuscles],\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: {\n max: 350000000,\n min: 200000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumSummitUniversity,\n requiredHackingSkill: {\n max: 475,\n min: 425,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSummitUniversity,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"syscore\",\n moneyAvailable: {\n max: 600000000,\n min: 400000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 4,\n organizationName: LocationName.VolhavenSysCoreSecurities,\n requiredHackingSkill: {\n max: 650,\n min: 550,\n },\n serverGrowth: {\n max: 70,\n min: 60,\n },\n specialName: LocationName.VolhavenSysCoreSecurities,\n },\n {\n hackDifficulty: {\n max: 70,\n min: 60,\n },\n hostname: \"catalyst\",\n literature: [LiteratureNames.TensionsInTechRace],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: {\n max: 550000000,\n min: 300000000,\n },\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"Catalyst Ventures\",\n requiredHackingSkill: {\n max: 450,\n min: 400,\n },\n serverGrowth: {\n max: 55,\n min: 25,\n },\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"the-hub\",\n maxRamExponent: {\n max: 6,\n min: 3,\n },\n moneyAvailable: {\n max: 200000000,\n min: 150000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"The Hub\",\n requiredHackingSkill: {\n max: 325,\n min: 275,\n },\n serverGrowth: {\n max: 55,\n min: 45,\n },\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: LocationName.VolhavenCompuTek.toLowerCase(),\n literature: [LiteratureNames.ManAndMachine],\n moneyAvailable: {\n max: 250000000,\n min: 220000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.VolhavenCompuTek,\n requiredHackingSkill: {\n max: 400,\n min: 300,\n },\n serverGrowth: {\n max: 65,\n min: 45,\n },\n specialName: LocationName.VolhavenCompuTek,\n },\n {\n hackDifficulty: {\n max: 80,\n min: 60,\n },\n hostname: \"netlink\",\n literature: [LiteratureNames.SimulatedReality],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 275000000,\n networkLayer: 4,\n numOpenPortsRequired: 3,\n organizationName: LocationName.AevumNetLinkTechnologies,\n requiredHackingSkill: {\n max: 425,\n min: 375,\n },\n serverGrowth: {\n max: 75,\n min: 45,\n },\n specialName: LocationName.AevumNetLinkTechnologies,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 35,\n },\n hostname: \"johnson-ortho\",\n moneyAvailable: {\n max: 85000000,\n min: 70000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Johnson Orthopedics\",\n requiredHackingSkill: {\n max: 300,\n min: 250,\n },\n serverGrowth: {\n max: 65,\n min: 35,\n },\n },\n {\n hackDifficulty: 1,\n hostname: \"n00dles\",\n literature: [],\n maxRamExponent: 2,\n moneyAvailable: 70000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.NewTokyoNoodleBar,\n requiredHackingSkill: 1,\n serverGrowth: 3000,\n specialName: LocationName.NewTokyoNoodleBar,\n },\n {\n hackDifficulty: 10,\n hostname: LocationName.Sector12FoodNStuff.toLowerCase(),\n literature: [LiteratureNames.Sector12Crime],\n maxRamExponent: 4,\n moneyAvailable: 2000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12FoodNStuff,\n requiredHackingSkill: 1,\n serverGrowth: 5,\n specialName: LocationName.Sector12FoodNStuff,\n },\n {\n hackDifficulty: 10,\n hostname: \"sigma-cosmetics\",\n maxRamExponent: 4,\n moneyAvailable: 2300000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"Sigma Cosmetics\",\n requiredHackingSkill: 5,\n serverGrowth: 10,\n },\n {\n hackDifficulty: 15,\n hostname: \"joesguns\",\n maxRamExponent: 4,\n moneyAvailable: 2500000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: LocationName.Sector12JoesGuns,\n requiredHackingSkill: 10,\n serverGrowth: 20,\n specialName: LocationName.Sector12JoesGuns,\n },\n {\n hackDifficulty: 25,\n hostname: \"zer0\",\n maxRamExponent: 5,\n moneyAvailable: 7500000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"ZER0 Nightclub\",\n requiredHackingSkill: 75,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"nectar-net\",\n maxRamExponent: 4,\n moneyAvailable: 2750000,\n networkLayer: 2,\n numOpenPortsRequired: 0,\n organizationName: \"Nectar Nightclub Network\",\n requiredHackingSkill: 20,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 25,\n hostname: \"neo-net\",\n literature: [LiteratureNames.TheHiddenWorld],\n maxRamExponent: 5,\n moneyAvailable: 5000000,\n networkLayer: 3,\n numOpenPortsRequired: 1,\n organizationName: \"Neo Nightclub Network\",\n requiredHackingSkill: 50,\n serverGrowth: 25,\n },\n {\n hackDifficulty: 30,\n hostname: \"silver-helix\",\n literature: [LiteratureNames.NewTriads],\n maxRamExponent: 6,\n moneyAvailable: 45000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Silver Helix\",\n requiredHackingSkill: 150,\n serverGrowth: 30,\n },\n {\n hackDifficulty: 15,\n hostname: \"hong-fang-tea\",\n literature: [LiteratureNames.BrighterThanTheSun],\n maxRamExponent: 4,\n moneyAvailable: 3000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HongFang Teahouse\",\n requiredHackingSkill: 30,\n serverGrowth: 20,\n },\n {\n hackDifficulty: 15,\n hostname: \"harakiri-sushi\",\n maxRamExponent: 4,\n moneyAvailable: 4000000,\n networkLayer: 1,\n numOpenPortsRequired: 0,\n organizationName: \"HaraKiri Sushi Bar Network\",\n requiredHackingSkill: 40,\n serverGrowth: 40,\n },\n {\n hackDifficulty: 20,\n hostname: \"phantasy\",\n maxRamExponent: 5,\n moneyAvailable: 24000000,\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: \"Phantasy Club\",\n requiredHackingSkill: 100,\n serverGrowth: 35,\n },\n {\n hackDifficulty: 15,\n hostname: \"max-hardware\",\n maxRamExponent: 5,\n moneyAvailable: 10000000,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: \"Max Hardware Store\",\n requiredHackingSkill: 80,\n serverGrowth: 30,\n },\n {\n hackDifficulty: {\n max: 35,\n min: 25,\n },\n hostname: \"omega-net\",\n literature: [LiteratureNames.TheNewGod],\n maxRamExponent: 5,\n moneyAvailable: {\n max: 70000000,\n min: 60000000,\n },\n networkLayer: 3,\n numOpenPortsRequired: 2,\n organizationName: LocationName.IshimaOmegaSoftware,\n requiredHackingSkill: {\n max: 220,\n min: 180,\n },\n serverGrowth: {\n max: 40,\n min: 30,\n },\n specialName: LocationName.IshimaOmegaSoftware,\n },\n {\n hackDifficulty: {\n max: 45,\n min: 35,\n },\n hostname: \"crush-fitness\",\n moneyAvailable: {\n max: 60000000,\n min: 40000000,\n },\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: \"Crush Fitness\",\n requiredHackingSkill: {\n max: 275,\n min: 225,\n },\n serverGrowth: {\n max: 33,\n min: 27,\n },\n specialName: LocationName.AevumCrushFitnessGym,\n },\n {\n hackDifficulty: 30,\n hostname: \"iron-gym\",\n maxRamExponent: 5,\n moneyAvailable: 20000000,\n networkLayer: 1,\n numOpenPortsRequired: 1,\n organizationName: `${LocationName.Sector12IronGym} Network`,\n requiredHackingSkill: 100,\n serverGrowth: 20,\n specialName: LocationName.Sector12IronGym,\n },\n {\n hackDifficulty: {\n max: 55,\n min: 45,\n },\n hostname: \"millenium-fitness\",\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 250000000,\n networkLayer: 6,\n numOpenPortsRequired: 3,\n organizationName: \"Millenium Fitness Network\",\n requiredHackingSkill: {\n max: 525,\n min: 475,\n },\n serverGrowth: {\n max: 45,\n min: 25,\n },\n specialName: LocationName.VolhavenMilleniumFitnessGym,\n },\n {\n hackDifficulty: {\n max: 65,\n min: 55,\n },\n hostname: \"powerhouse-fitness\",\n maxRamExponent: {\n max: 6,\n min: 4,\n },\n moneyAvailable: 900000000,\n networkLayer: 14,\n numOpenPortsRequired: 5,\n organizationName: \"Powerhouse Fitness\",\n requiredHackingSkill: {\n max: 1100,\n min: 950,\n },\n serverGrowth: {\n max: 60,\n min: 50,\n },\n specialName: LocationName.Sector12PowerhouseGym,\n },\n {\n hackDifficulty: {\n max: 60,\n min: 40,\n },\n hostname: \"snap-fitness\",\n moneyAvailable: 450000000,\n networkLayer: 7,\n numOpenPortsRequired: 4,\n organizationName: \"Snap Fitness\",\n requiredHackingSkill: {\n max: 800,\n min: 675,\n },\n serverGrowth: {\n max: 60,\n min: 40,\n },\n specialName: LocationName.AevumSnapFitnessGym,\n },\n {\n hackDifficulty: 0,\n hostname: \"run4theh111z\",\n literature: [LiteratureNames.SimulatedReality, LiteratureNames.TheNewGod],\n maxRamExponent: {\n max: 9,\n min: 5,\n },\n moneyAvailable: 0,\n networkLayer: 11,\n numOpenPortsRequired: 4,\n organizationName: \"The Runners\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.BitRunnersServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"I.I.I.I\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 8,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 5,\n numOpenPortsRequired: 3,\n organizationName: \"I.I.I.I\",\n requiredHackingSkill: {\n max: 365,\n min: 340,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheBlackHandServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"avmnite-02h\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: {\n max: 7,\n min: 4,\n },\n moneyAvailable: 0,\n networkLayer: 4,\n numOpenPortsRequired: 2,\n organizationName: FactionNames.NiteSec,\n requiredHackingSkill: {\n max: 220,\n min: 202,\n },\n serverGrowth: 0,\n specialName: SpecialServers.NiteSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \".\",\n maxRamExponent: 4,\n moneyAvailable: 0,\n networkLayer: 13,\n numOpenPortsRequired: 4,\n organizationName: \".\",\n requiredHackingSkill: {\n max: 550,\n min: 505,\n },\n serverGrowth: 0,\n specialName: SpecialServers.TheDarkArmyServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"CSEC\",\n literature: [LiteratureNames.DemocracyIsDead],\n maxRamExponent: 3,\n moneyAvailable: 0,\n networkLayer: 2,\n numOpenPortsRequired: 1,\n organizationName: FactionNames.CyberSec,\n requiredHackingSkill: {\n max: 60,\n min: 51,\n },\n serverGrowth: 0,\n specialName: SpecialServers.CyberSecServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"The-Cave\",\n literature: [LiteratureNames.AlphaOmega],\n moneyAvailable: 0,\n networkLayer: 15,\n numOpenPortsRequired: 5,\n organizationName: \"Helios\",\n requiredHackingSkill: 925,\n serverGrowth: 0,\n specialName: SpecialServers.DaedalusServer,\n },\n {\n hackDifficulty: 0,\n hostname: \"w0r1d_d43m0n\",\n moneyAvailable: 0,\n numOpenPortsRequired: 5,\n organizationName: \"w0r1d_d43m0n\",\n requiredHackingSkill: 3000,\n serverGrowth: 0,\n specialName: SpecialServers.WorldDaemon,\n },\n {\n hostname: SpecialServers.DarkWeb,\n moneyAvailable: 0,\n numOpenPortsRequired: 5,\n organizationName: SpecialServers.DarkWeb,\n requiredHackingSkill: 1,\n specialName: SpecialServers.DarkWeb,\n },\n];\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\nimport { CONSTANTS } from \"../../../Constants\";\n\nconst infiltrateCycles = 60000 / CONSTANTS._idleSpeed;\n\nexport const isSleeveInfiltrateWork = (w: Work | null): w is SleeveInfiltrateWork =>\n w !== null && w.type === WorkType.INFILTRATE;\n\nexport class SleeveInfiltrateWork extends Work {\n cyclesWorked = 0;\n\n constructor() {\n super(WorkType.INFILTRATE);\n }\n\n cyclesNeeded(): number {\n return infiltrateCycles;\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n if (!player.bladeburner) throw new Error(\"sleeve doing blade work without being a member\");\n this.cyclesWorked += cycles;\n if (this.cyclesWorked > this.cyclesNeeded()) {\n this.cyclesWorked -= this.cyclesNeeded();\n player.bladeburner.infiltrateSynthoidCommunities(player);\n }\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveInfiltrateWork\", this);\n }\n\n /**\n * Initiatizes a BladeburnerWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveInfiltrateWork {\n return Generic_fromJSON(SleeveInfiltrateWork, value.data);\n }\n}\n\nReviver.constructors.SleeveInfiltrateWork = SleeveInfiltrateWork;\n","import { CONSTANTS } from \"../Constants\";\nimport * as names from \"./data/companypositionnames\";\n\n/* tslint:disable:completed-docs */\n\nexport interface IConstructorParams {\n name: string;\n nextPosition: string | null;\n baseSalary: number;\n repMultiplier: number;\n\n reqdHacking?: number;\n reqdStrength?: number;\n reqdDefense?: number;\n reqdDexterity?: number;\n reqdAgility?: number;\n reqdCharisma?: number;\n reqdReputation?: number;\n\n hackingEffectiveness?: number;\n strengthEffectiveness?: number;\n defenseEffectiveness?: number;\n dexterityEffectiveness?: number;\n agilityEffectiveness?: number;\n charismaEffectiveness?: number;\n\n hackingExpGain?: number;\n strengthExpGain?: number;\n defenseExpGain?: number;\n dexterityExpGain?: number;\n agilityExpGain?: number;\n charismaExpGain?: number;\n}\n\nexport class CompanyPosition {\n /**\n * Position title\n */\n name: string;\n\n /**\n * Title of next position to be promoted to\n */\n nextPosition: string | null;\n\n /**\n * Base salary for this position ($ per 200ms game cycle)\n * Will be multiplier by a company-specific multiplier for final salary\n */\n baseSalary: number;\n\n /**\n * Reputation multiplier\n */\n repMultiplier: number;\n\n /**\n * Required stats to earn this position\n */\n requiredAgility: number;\n requiredCharisma: number;\n requiredDefense: number;\n requiredDexterity: number;\n requiredHacking: number;\n requiredStrength: number;\n\n /**\n * Required company reputation to earn this position\n */\n requiredReputation: number;\n\n /**\n * Effectiveness of each stat time for job performance\n */\n hackingEffectiveness: number;\n strengthEffectiveness: number;\n defenseEffectiveness: number;\n dexterityEffectiveness: number;\n agilityEffectiveness: number;\n charismaEffectiveness: number;\n\n /**\n * Experience gain for performing job (per 200ms game cycle)\n */\n hackingExpGain: number;\n strengthExpGain: number;\n defenseExpGain: number;\n dexterityExpGain: number;\n agilityExpGain: number;\n charismaExpGain: number;\n\n constructor(p: IConstructorParams) {\n this.name = p.name;\n this.nextPosition = p.nextPosition;\n this.baseSalary = p.baseSalary;\n this.repMultiplier = p.repMultiplier;\n\n this.requiredHacking = p.reqdHacking != null ? p.reqdHacking : 0;\n this.requiredStrength = p.reqdStrength != null ? p.reqdStrength : 0;\n this.requiredDefense = p.reqdDefense != null ? p.reqdDefense : 0;\n this.requiredDexterity = p.reqdDexterity != null ? p.reqdDexterity : 0;\n this.requiredAgility = p.reqdAgility != null ? p.reqdAgility : 0;\n this.requiredCharisma = p.reqdCharisma != null ? p.reqdCharisma : 0;\n this.requiredReputation = p.reqdReputation != null ? p.reqdReputation : 0;\n\n this.hackingEffectiveness = p.hackingEffectiveness != null ? p.hackingEffectiveness : 0;\n this.strengthEffectiveness = p.strengthEffectiveness != null ? p.strengthEffectiveness : 0;\n this.defenseEffectiveness = p.defenseEffectiveness != null ? p.defenseEffectiveness : 0;\n this.dexterityEffectiveness = p.dexterityEffectiveness != null ? p.dexterityEffectiveness : 0;\n this.agilityEffectiveness = p.agilityEffectiveness != null ? p.agilityEffectiveness : 0;\n this.charismaEffectiveness = p.charismaEffectiveness != null ? p.charismaEffectiveness : 0;\n\n if (\n Math.round(\n this.hackingEffectiveness +\n this.strengthEffectiveness +\n this.defenseEffectiveness +\n this.dexterityEffectiveness +\n this.agilityEffectiveness +\n this.charismaEffectiveness,\n ) !== 100\n ) {\n console.error(`CompanyPosition ${this.name} parameters do not sum to 100`);\n }\n\n this.hackingExpGain = p.hackingExpGain != null ? p.hackingExpGain : 0;\n this.strengthExpGain = p.strengthExpGain != null ? p.strengthExpGain : 0;\n this.defenseExpGain = p.defenseExpGain != null ? p.defenseExpGain : 0;\n this.dexterityExpGain = p.dexterityExpGain != null ? p.dexterityExpGain : 0;\n this.agilityExpGain = p.agilityExpGain != null ? p.agilityExpGain : 0;\n this.charismaExpGain = p.charismaExpGain != null ? p.charismaExpGain : 0;\n }\n\n calculateJobPerformance(hack: number, str: number, def: number, dex: number, agi: number, cha: number): number {\n const hackRatio: number = (this.hackingEffectiveness * hack) / CONSTANTS.MaxSkillLevel;\n const strRatio: number = (this.strengthEffectiveness * str) / CONSTANTS.MaxSkillLevel;\n const defRatio: number = (this.defenseEffectiveness * def) / CONSTANTS.MaxSkillLevel;\n const dexRatio: number = (this.dexterityEffectiveness * dex) / CONSTANTS.MaxSkillLevel;\n const agiRatio: number = (this.agilityEffectiveness * agi) / CONSTANTS.MaxSkillLevel;\n const chaRatio: number = (this.charismaEffectiveness * cha) / CONSTANTS.MaxSkillLevel;\n\n let reputationGain: number =\n (this.repMultiplier * (hackRatio + strRatio + defRatio + dexRatio + agiRatio + chaRatio)) / 100;\n if (isNaN(reputationGain)) {\n console.error(\"Company reputation gain calculated to be NaN\");\n reputationGain = 0;\n }\n\n return reputationGain;\n }\n\n isSoftwareJob(): boolean {\n return names.SoftwareCompanyPositions.includes(this.name);\n }\n\n isITJob(): boolean {\n return names.ITCompanyPositions.includes(this.name);\n }\n\n isSecurityEngineerJob(): boolean {\n return names.SecurityEngineerCompanyPositions.includes(this.name);\n }\n\n isNetworkEngineerJob(): boolean {\n return names.NetworkEngineerCompanyPositions.includes(this.name);\n }\n\n isBusinessJob(): boolean {\n return names.BusinessCompanyPositions.includes(this.name);\n }\n\n isSecurityJob(): boolean {\n return names.SecurityCompanyPositions.includes(this.name);\n }\n\n isAgentJob(): boolean {\n return names.AgentCompanyPositions.includes(this.name);\n }\n\n isSoftwareConsultantJob(): boolean {\n return names.SoftwareConsultantCompanyPositions.includes(this.name);\n }\n\n isBusinessConsultantJob(): boolean {\n return names.BusinessConsultantCompanyPositions.includes(this.name);\n }\n\n isPartTimeJob(): boolean {\n return names.PartTimeCompanyPositions.includes(this.name);\n }\n}\n","/**\n * Implementation of the mechanisms that allow the player to affect the\n * Stock Market\n */\nimport { Stock } from \"./Stock\";\nimport { StockMarket } from \"./StockMarket\";\n\nimport { Company } from \"../Company/Company\";\nimport { Server } from \"../Server/Server\";\n\n// Change in second-order forecast due to hacks/grows\nexport const forecastForecastChangeFromHack = 0.1;\n\n// Change in second-order forecast due to company work\nexport const forecastForecastChangeFromCompanyWork = 0.001;\n\n/**\n * Potentially decreases a stock's second-order forecast when its corresponding\n * server is hacked. The chance of the hack decreasing the stock's second-order\n * forecast is dependent on what percentage of the server's money is hacked\n * @param {Server} server - Server being hack()ed\n * @param {number} moneyHacked - Amount of money stolen from the server\n */\nexport function influenceStockThroughServerHack(server: Server, moneyHacked: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyHacked = moneyHacked / server.moneyMax;\n if (Math.random() < percTotalMoneyHacked) {\n stock.changeForecastForecast(stock.otlkMagForecast - forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when its corresponding\n * server is grown (grow()). The chance of the grow() to increase the stock's\n * second-order forecast is dependent on how much money is added to the server\n * @param {Server} server - Server being grow()n\n * @param {number} moneyHacked - Amount of money added to the server\n */\nexport function influenceStockThroughServerGrow(server: Server, moneyGrown: number): void {\n const orgName = server.organizationName;\n let stock: Stock | null = null;\n if (typeof orgName === \"string\" && orgName !== \"\") {\n stock = StockMarket[orgName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n const percTotalMoneyGrown = moneyGrown / server.moneyMax;\n if (Math.random() < percTotalMoneyGrown) {\n stock.changeForecastForecast(stock.otlkMagForecast + forecastForecastChangeFromHack);\n }\n}\n\n/**\n * Potentially increases a stock's second-order forecast when the player works for\n * its corresponding company.\n * @param {Company} company - Company being worked for\n * @param {number} performanceMult - Effectiveness of player's work. Affects influence\n * @param {number} cyclesOfWork - # game cycles of work being processed\n */\nexport function influenceStockThroughCompanyWork(\n company: Company,\n performanceMult: number,\n cyclesOfWork: number,\n): void {\n const compName = company.name;\n let stock: Stock | null = null;\n if (typeof compName === \"string\" && compName !== \"\") {\n stock = StockMarket[compName];\n }\n if (!(stock instanceof Stock)) {\n return;\n }\n\n if (Math.random() < 0.002 * cyclesOfWork) {\n const change = forecastForecastChangeFromCompanyWork * performanceMult;\n stock.changeForecastForecast(stock.otlkMagForecast + change);\n }\n}\n","export function checkEnum(\n enumVariable: { [key in T]: TEnumValue },\n value: string,\n): value is TEnumValue {\n return Object.values(enumVariable).includes(value);\n}\n","import React from \"react\";\nimport { SourceFile } from \"./SourceFile\";\nimport { IMap } from \"../types\";\n\nexport const SourceFiles: IMap = {};\n\nSourceFiles[\"SourceFile1\"] = new SourceFile(\n 1,\n (\n <>\n This Source-File lets the player start with 32GB of RAM on his/her home computer. It also increases all of the\n player's multipliers by:\n
\n
\n Level 1: 16%\n
\n Level 2: 24%\n
\n Level 3: 28%\n \n ),\n);\nSourceFiles[\"SourceFile2\"] = new SourceFile(\n 2,\n (\n <>\n This Source-File allows you to form gangs in other BitNodes once your karma decreases to a certain value. It also\n increases the player's crime success rate, crime money, and charisma multipliers by:\n
\n
\n Level 1: 24%\n
\n Level 2: 36%\n
\n Level 3: 42%\n \n ),\n);\nSourceFiles[\"SourceFile3\"] = new SourceFile(\n 3,\n (\n <>\n This Source-File lets you create corporations on other BitNodes (although some BitNodes will disable this\n mechanic) and level 3 permanently unlocks the full API. This Source-File also increases your charisma and company\n salary multipliers by:\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nSourceFiles[\"SourceFile4\"] = new SourceFile(\n 4,\n (\n <>\n This Source-File lets you access and use the Singularity Functions in every BitNode. Every level of this\n Source-File reduces the RAM cost of Singularity functions:\n
\n Level 1: 16x\n
\n Level 2: 4x\n
\n Level 3: 1x\n \n ),\n);\nSourceFiles[\"SourceFile5\"] = new SourceFile(\n 5,\n (\n <>\n This Source-File grants a special new stat called Intelligence. Intelligence is unique because it is permanent and\n persistent (it never gets reset back to 1). However, gaining Intelligence experience is much slower than other\n stats. Higher Intelligence levels will boost your production for many actions in the game. In addition, this\n Source-File will unlock:\n
\n
    \n
  • \n The getBitNodeMultipliers() Netscript function\n
  • \n
  • Permanent access to Formulas.exe
  • \n
  • \n Access to BitNode multiplier information on the Stats page\n
  • \n
\n It will also raise all of your hacking-related multipliers by:\n
\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nSourceFiles[\"SourceFile6\"] = new SourceFile(\n 6,\n (\n <>\n This Source-File allows you to access the NSA's Bladeburner Division in other BitNodes. In addition, this\n Source-File will raise both the level and experience gain rate of all your combat stats by:\n
\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nSourceFiles[\"SourceFile7\"] = new SourceFile(\n 7,\n (\n <>\n This Source-File allows you to access the Bladeburner Netscript API in other BitNodes. In addition, this\n Source-File will increase all of your Bladeburner multipliers by:\n
\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nSourceFiles[\"SourceFile8\"] = new SourceFile(\n 8,\n (\n <>\n This Source-File grants the following benefits:\n
\n
\n Level 1: Permanent access to WSE and TIX API\n
\n Level 2: Ability to short stocks in other BitNodes\n
\n Level 3: Ability to use limit/stop orders in other BitNodes\n
\n
\n This Source-File also increases your hacking growth multipliers by:\n
\n Level 1: 12%\n
\n Level 2: 18%\n
\n Level 3: 21%\n \n ),\n);\nSourceFiles[\"SourceFile9\"] = new SourceFile(\n 9,\n (\n <>\n This Source-File grants the following benefits:\n
\n
\n Level 1: Permanently unlocks the Hacknet Server in other BitNodes\n
\n Level 2: You start with 128GB of RAM on your home computer when entering a new BitNode\n
\n Level 3: Grants a highly-upgraded Hacknet Server when entering a new BitNode\n
\n
\n (Note that the Level 3 effect of this Source-File only applies when entering a new BitNode, NOT when installing\n Augmentations)\n
\n
\n This Source-File also increases your hacknet multipliers by:\n
\n Level 1: 8%\n
\n Level 2: 12%\n
\n Level 3: 14%\n \n ),\n);\nSourceFiles[\"SourceFile10\"] = new SourceFile(\n 10,\n (\n <>\n This Source-File unlocks Sleeve technology, and the Grafting API in other BitNodes. Each level of this Source-File\n also grants you a Duplicate Sleeve\n \n ),\n);\nSourceFiles[\"SourceFile11\"] = new SourceFile(\n 11,\n (\n <>\n This Source-File makes it so that company favor increases BOTH the player's salary and reputation gain rate at\n that company by 1% per favor (rather than just the reputation gain). This Source-File also increases the player's\n company salary and reputation gain multipliers by:\n
\n
\n Level 1: 32%\n
\n Level 2: 48%\n
\n Level 3: 56%\n
\n
\n It also reduces the price increase for every aug bought by:\n
\n
\n Level 1: 4%\n
\n Level 2: 6%\n
\n Level 3: 7%\n \n ),\n);\nSourceFiles[\"SourceFile12\"] = new SourceFile(\n 12,\n <>This Source-File lets the player start with Neuroflux Governor equal to the level of this Source-File.,\n);\nSourceFiles[\"SourceFile13\"] = new SourceFile(\n 13,\n <>Each level of this Source-File increases the size of Stanek's Gift.,\n);\n","import React from \"react\";\n\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { use } from \"../../ui/Context\";\nimport Button from \"@mui/material/Button\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n type: number;\n name: string;\n rerender: () => void;\n}\nexport function StartButton(props: IProps): React.ReactElement {\n const player = use.Player();\n const action = props.bladeburner.getActionObject({ name: props.name, type: props.type });\n if (action == null) {\n throw new Error(\"Failed to get Operation Object for: \" + props.name);\n }\n let disabled = false;\n if (action.count < 1) {\n disabled = true;\n }\n if (props.name === \"Raid\" && props.bladeburner.getCurrentCity().comms === 0) {\n disabled = true;\n }\n\n if (action instanceof BlackOperation && props.bladeburner.rank < action.reqdRank) {\n disabled = true;\n }\n function onStart(): void {\n if (disabled) return;\n props.bladeburner.action.type = props.type;\n props.bladeburner.action.name = props.name;\n if (!player.hasAugmentation(AugmentationNames.BladesSimulacrum, true)) player.finishWork(true);\n props.bladeburner.startAction(player, props.bladeburner.action);\n props.rerender();\n }\n\n return (\n \n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nfunction replace(str: string, i: number, char: string): string {\n return str.substring(0, i) + char + str.substring(i + 1);\n}\n\ninterface IProps {\n content: string;\n}\n\nfunction randomize(char: string): string {\n const randFrom = (str: string): string => str[Math.floor(Math.random() * str.length)];\n const classes = [\"abcdefghijklmnopqrstuvwxyz\", \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\", \"1234567890\", \" _\", \"()[]{}<>\"];\n const other = `!@#$%^&*()_+|\\\\';\"/.,?\\`~`;\n\n for (const c of classes) {\n if (c.includes(char)) return randFrom(c);\n }\n\n return randFrom(other);\n}\n\nexport function CorruptableText(props: IProps): JSX.Element {\n const [content, setContent] = useState(props.content);\n\n useEffect(() => {\n let counter = 5;\n const timers: number[] = [];\n const intervalId = setInterval(() => {\n counter--;\n if (counter > 0) return;\n counter = Math.random() * 5;\n const index = Math.random() * content.length;\n const letter = content.charAt(index);\n setContent((content) => replace(content, index, randomize(letter)));\n timers.push(\n window.setTimeout(() => {\n setContent((content) => replace(content, index, letter));\n }, 500),\n );\n }, 20);\n\n return () => {\n clearInterval(intervalId);\n timers.forEach((timerId) => clearTimeout(timerId));\n };\n }, []);\n\n return {content};\n}\n","import React from \"react\";\nimport { CONSTANTS } from \"../Constants\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { GraftableAugmentations } from \"../PersonObjects/Grafting/ui/GraftingRoot\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Work, WorkType } from \"./Work\";\nimport { graftingIntBonus } from \"../PersonObjects/Grafting/GraftingHelpers\";\nimport { applyAugmentation } from \"../Augmentation/AugmentationHelpers\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { GraftableAugmentation } from \"../PersonObjects/Grafting/GraftableAugmentation\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\n\nexport const isGraftingWork = (w: Work | null): w is GraftingWork => w !== null && w.type === WorkType.GRAFTING;\n\ninterface GraftingWorkParams {\n augmentation: string;\n player: IPlayer;\n singularity: boolean;\n}\n\nexport class GraftingWork extends Work {\n augmentation: string;\n unitCompleted: number;\n\n constructor(params?: GraftingWorkParams) {\n super(WorkType.GRAFTING, params?.singularity ?? true);\n this.unitCompleted = 0;\n this.augmentation = params?.augmentation ?? AugmentationNames.Targeting1;\n const gAugs = GraftableAugmentations();\n if (params?.player) params.player.loseMoney(gAugs[this.augmentation].cost, \"augmentations\");\n }\n\n unitNeeded(): number {\n return new GraftableAugmentation(StaticAugmentations[this.augmentation]).time;\n }\n\n process(player: IPlayer, cycles: number): boolean {\n let focusBonus = 1;\n if (!player.hasAugmentation(AugmentationNames.NeuroreceptorManager)) {\n focusBonus = player.focus ? 1 : CONSTANTS.BaseFocusBonus;\n }\n\n this.cyclesWorked += cycles;\n this.unitCompleted += CONSTANTS._idleSpeed * cycles * graftingIntBonus(player) * focusBonus;\n\n return this.unitCompleted >= this.unitNeeded();\n }\n\n finish(player: IPlayer, cancelled: boolean): void {\n const augName = this.augmentation;\n if (!cancelled) {\n applyAugmentation({ name: augName, level: 1 });\n\n if (!player.hasAugmentation(AugmentationNames.CongruityImplant)) {\n player.entropy += 1;\n player.applyEntropy(player.entropy);\n }\n\n if (!this.singularity) {\n dialogBoxCreate(\n <>\n You've finished grafting {augName}.
\n The augmentation has been applied to your body{\" \"}\n {player.hasAugmentation(AugmentationNames.CongruityImplant) ? \".\" : \", but you feel a bit off.\"}\n ,\n );\n }\n } else if (cancelled && !this.singularity) {\n dialogBoxCreate(\n <>\n You cancelled the grafting of {augName}.\n
\n Your money was not returned to you.\n ,\n );\n }\n\n // Intelligence gain\n if (!cancelled) {\n player.gainIntelligenceExp(\n (CONSTANTS.IntelligenceGraftBaseExpGain * this.cyclesWorked * CONSTANTS._idleSpeed) / 10000,\n );\n }\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n augmentation: this.augmentation,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"GraftingWork\", this);\n }\n\n /**\n * Initiatizes a GraftingWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): GraftingWork {\n return Generic_fromJSON(GraftingWork, value.data);\n }\n}\n\nReviver.constructors.GraftingWork = GraftingWork;\n","import React from \"react\";\nimport { IMap } from \"../types\";\nimport { FactionNames } from \"./data/FactionNames\";\nimport { use } from \"../ui/Context\";\nimport { Option } from \"./ui/Option\";\nimport { Typography } from \"@mui/material\";\n\ninterface FactionInfoParams {\n infoText?: JSX.Element;\n enemies?: string[];\n offerHackingWork?: boolean;\n offerFieldWork?: boolean;\n offerSecurityWork?: boolean;\n special?: boolean;\n keepOnInstall?: boolean;\n assignment?: () => React.ReactElement;\n}\n\n/**\n * Contains the \"information\" property for all the Factions, which is just a description of each faction\n */\nexport class FactionInfo {\n /**\n * The names of all other factions considered to be enemies to this faction.\n */\n enemies: string[];\n\n /**\n * The descriptive text to show on the faction's page.\n */\n infoText: JSX.Element;\n\n /**\n * A flag indicating if the faction supports field work to earn reputation.\n */\n offerFieldWork: boolean;\n\n /**\n * A flag indicating if the faction supports hacking work to earn reputation.\n */\n offerHackingWork: boolean;\n\n /**\n * A flag indicating if the faction supports security work to earn reputation.\n */\n offerSecurityWork: boolean;\n\n /**\n * Keep faction on install.\n */\n keep: boolean;\n\n /**\n * Special faction\n */\n special: boolean;\n\n /**\n * The data to display on the faction screen.\n */\n assignment?: () => React.ReactElement;\n\n constructor(params: FactionInfoParams) {\n this.infoText = params.infoText ?? <>;\n this.enemies = params.enemies ?? [];\n this.offerHackingWork = params.offerHackingWork ?? false;\n this.offerFieldWork = params.offerFieldWork ?? false;\n this.offerSecurityWork = params.offerSecurityWork ?? false;\n\n this.keep = params.keepOnInstall ?? false;\n this.special = params.special ?? false;\n this.assignment = params.assignment;\n }\n\n offersWork(): boolean {\n return this.offerFieldWork || this.offerHackingWork || this.offerSecurityWork;\n }\n}\n\n/**\n * A map of all factions and associated info to them.\n */\n// tslint:disable-next-line:variable-name\nexport const FactionInfos: IMap = {\n // Endgame\n [FactionNames.Illuminati]: new FactionInfo({\n infoText: (\n <>\n Humanity never changes. No matter how civilized society becomes, it will eventually fall back into chaos. And\n from this chaos, we are the invisible hand that guides them to order.{\" \"}\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.Daedalus]: new FactionInfo({\n infoText: <>Yesterday we obeyed kings and bent our necks to emperors. Today we kneel only to truth.,\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.TheCovenant]: new FactionInfo({\n infoText: (\n <>\n Surrender yourself. Give up your empty individuality to become part of something great, something eternal.\n Become a slave. Submit your mind, body, and soul. Only then can you set yourself free.\n
\n
\n Only then can you discover immortality.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n // Megacorporations, each forms its own faction\n [FactionNames.ECorp]: new FactionInfo({\n infoText: (\n <>\n {FactionNames.ECorp}'s mission is simple: to connect the world of today with the technology of tomorrow. With\n our wide range of Internet-related software and commercial hardware, {FactionNames.ECorp} makes the world's\n information universally accessible.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.MegaCorp]: new FactionInfo({\n infoText: (\n <>\n {FactionNames.MegaCorp} does what no other dares to do. We imagine. We create. We invent. We create what others\n have never even dreamed of. Our work fills the world's needs for food, water, power, and transportation on an\n unprecedented scale, in ways that no other company can.\n
\n
\n In our labs and factories and on the ground with customers, {FactionNames.MegaCorp} is ushering in a new era for\n the world.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.BachmanAssociates]: new FactionInfo({\n infoText: (\n <>\n Where Law and Business meet - that's where we are.\n
\n
\n Legal Insight - Business Instinct - Innovative Experience.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.BladeIndustries]: new FactionInfo({\n infoText: <>Augmentation is Salvation.,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.NWO]: new FactionInfo({\n infoText: (\n <>\n Humans don't truly desire freedom. They want to be observed, understood, and judged. They want to be given\n purpose and direction in life. That is why they created God. And that is why they created civilization - not\n because of willingness, but because of a need to be incorporated into higher orders of structure and meaning.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.ClarkeIncorporated]: new FactionInfo({\n infoText: <>The Power of the Genome - Unlocked.,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.OmniTekIncorporated]: new FactionInfo({\n infoText: <>Simply put, our mission is to design and build robots that make a difference.,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.FourSigma]: new FactionInfo({\n infoText: (\n <>\n The scientific method is the best way to approach investing. Big strategies backed up with big data. Driven by\n deep learning and innovative ideas. And improved by iteration. That's {FactionNames.FourSigma}.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n [FactionNames.KuaiGongInternational]: new FactionInfo({\n infoText: <>Dream big. Work hard. Make history.,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n // Other Corporations\n [FactionNames.FulcrumSecretTechnologies]: new FactionInfo({\n infoText: (\n <>\n The human organism has an innate desire to worship. That is why they created gods. If there were no gods, it\n would be necessary to create them. And now we can.\n \n ),\n offerHackingWork: true,\n offerSecurityWork: true,\n keepOnInstall: true,\n }),\n\n // Hacker groups\n [FactionNames.BitRunners]: new FactionInfo({\n infoText: (\n <>\n Our entire lives are controlled by bits. All of our actions, our thoughts, our personal information. It's all\n transformed into bits, stored in bits, communicated through bits. It’s impossible for any person to move, to\n live, to operate at any level without the use of bits. And when a person moves, lives, and operates, they leave\n behind their bits, mere traces of seemingly meaningless fragments of information. But these bits can be\n reconstructed. Transformed. Used.\n
\n
\n Those who run the bits, run the world.\n \n ),\n offerHackingWork: true,\n }),\n\n [FactionNames.TheBlackHand]: new FactionInfo({\n infoText: (\n <>\n The world, so afraid of strong government, now has no government. Only power - Digital power. Financial power.\n Technological power. And those at the top rule with an invisible hand. They built a society where the rich get\n richer, and everyone else suffers.\n
\n
\n So much pain. So many lives. Their darkness must end.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n // prettier-ignore\n [FactionNames.NiteSec]: new FactionInfo({\n infoText:(<>\n {\" __..__ \"}
\n {\" _.nITESECNIt. \"}
\n {\" .-'NITESECNITESEc. \"}
\n {\" .' NITESECNITESECn \"}
\n {\" / NITESECNITESEC; \"}
\n {\" : :NITESECNITESEC; \"}
\n {\" ; $ NITESECNITESECN \"}
\n {\" : _, ,N'ITESECNITESEC \"}
\n {\" : .+^^`, : `NITESECNIT \"}
\n {\" ) /), `-,-=,NITESECNI \"}
\n {\" / ^ ,-;|NITESECN; \"}
\n {\" / _.' '-';NITESECN \"}
\n {\" ( , ,-''`^NITE' \"}
\n {\" )` :`. .' \"}
\n {\" )-- ; `- / \"}
\n {\" ' _.-' : \"}
\n {\" ( _.-' . \"}
\n {\" ------. \"}
\n {\" . \"}
\n {\" _.nIt \"}
\n {\" _.nITESECNi \"}
\n {\" nITESECNIT^' \"}
\n {\" NITE^' ___ \"}
\n {\" / .gP''''Tp. \"}
\n {\" : d' . `b \"}
\n {\" ; d' o `b ; \"}
\n {\" / d; `b| \"}
\n {\" /, $; @ `: \"}
\n {\" /' $/ ; \"}
\n {\" .' $/b o | \"}
\n {\" .' d$/$; : \"}
\n {\" / .d/$/$; , ; \"}
\n {\" d .dNITESEC $ | \"}
\n {\" :bp.__.gNITESEC/$ :$ ; \"}
\n {\" NITESECNITESECNIT /$b : \"}
),\n offerHackingWork: true,\n offerFieldWork: false,\n offerSecurityWork: false,\n special: false,\n keepOnInstall: false,\n }),\n\n // City factions, essentially governments\n [FactionNames.Aevum]: new FactionInfo({\n infoText: <>The Silicon City.,\n enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Chongqing]: new FactionInfo({\n infoText: <>Serve the People.,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Ishima]: new FactionInfo({\n infoText: <>The East Asian Order of the Future.,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.NewTokyo]: new FactionInfo({\n infoText: <>Asia's World City.,\n enemies: [FactionNames.Sector12, FactionNames.Aevum, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Sector12]: new FactionInfo({\n infoText: <>The City of the Future.,\n enemies: [FactionNames.Chongqing, FactionNames.NewTokyo, FactionNames.Ishima, FactionNames.Volhaven],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n [FactionNames.Volhaven]: new FactionInfo({\n infoText: <>Benefit, Honor, and Glory.,\n enemies: [\n FactionNames.Chongqing,\n FactionNames.Sector12,\n FactionNames.NewTokyo,\n FactionNames.Aevum,\n FactionNames.Ishima,\n ],\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n // Criminal Organizations/Gangs\n [FactionNames.SpeakersForTheDead]: new FactionInfo({\n infoText: <>It is better to reign in Hell than to serve in Heaven.,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.TheDarkArmy]: new FactionInfo({\n infoText: <>The World doesn't care about right or wrong. It only cares about power.,\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.TheSyndicate]: new FactionInfo({\n infoText: <>Honor holds you back.,\n offerHackingWork: true,\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.Silhouette]: new FactionInfo({\n infoText: (\n <>\n Corporations have filled the void of power left behind by the collapse of Western government. The issue is\n they've become so big that you don't know who they're working for. And if you're employed at one of these\n corporations, you don't even know who you're working for.\n
\n
\n That's terror. Terror, fear, and corruption. All born into the system, all propagated by the system.\n \n ),\n offerHackingWork: true,\n offerFieldWork: true,\n }),\n\n [FactionNames.Tetrads]: new FactionInfo({\n infoText: <>Following the mandate of Heaven and carrying out the way.,\n\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n [FactionNames.SlumSnakes]: new FactionInfo({\n infoText: <>{FactionNames.SlumSnakes} rule!,\n\n offerFieldWork: true,\n offerSecurityWork: true,\n }),\n\n // Earlygame factions - factions the player will prestige with early on that don't belong in other categories.\n [FactionNames.Netburners]: new FactionInfo({\n infoText: <>{\"~~//*>H4CK||3T 8URN3R5**>?>\\\\~~\"},\n offerHackingWork: true,\n }),\n\n [FactionNames.TianDiHui]: new FactionInfo({\n infoText: <>Obey Heaven and work righteously.,\n offerHackingWork: true,\n\n offerSecurityWork: true,\n }),\n\n [FactionNames.CyberSec]: new FactionInfo({\n infoText: (\n <>\n The Internet is the first thing that was built that we don't fully understand, the largest experiment in anarchy\n that we have ever had. And as the world becomes increasingly dominated by it, society approaches the brink of\n total chaos. We serve only to protect society, to protect humanity, to protect the world from imminent collapse.\n \n ),\n offerHackingWork: true,\n }),\n\n // Special Factions\n [FactionNames.Bladeburners]: new FactionInfo({\n infoText: (\n <>\n It's too bad they won't live. But then again, who does?\n
\n
\n Note that for this faction, reputation can only be gained through {FactionNames.Bladeburners} actions.{\" \"}\n Completing {FactionNames.Bladeburners} contracts/operations will increase your reputation.\n \n ),\n\n special: true,\n assignment: (): React.ReactElement => {\n const router = use.Router();\n return (\n router.toBladeburner()}\n />\n );\n },\n }),\n\n [FactionNames.ChurchOfTheMachineGod]: new FactionInfo({\n // prettier-ignore\n infoText:(<>\n {\" `` \"}
\n {\" -odmmNmds: \"}
\n {\" `hNmo:..-omNh. \"}
\n {\" yMd` `hNh \"}
\n {\" mMd oNm \"}
\n {\" oMNo .mM/ \"}
\n {\" `dMN+ -mM+ \"}
\n {\" -mMNo -mN+ \"}
\n {\" .+- :mMNo/mN/ \"}
\n {\":yNMd. :NMNNN/ \"}
\n {\"-mMMMh. /NMMh` \"}
\n {\" .dMMMd. /NMMMy` \"}
\n {\" `yMMMd. /NNyNMMh` \"}
\n {\" `sMMMd. +Nm: +NMMh. \"}
\n {\" oMMMm- oNm: /NMMd. \"}
\n {\" +NMMmsMm- :mMMd. \"}
\n {\" /NMMMm- -mMMd. \"}
\n {\" /MMMm- -mMMd. \"}
\n {\" `sMNMMm- .mMmo \"}
\n {\" `sMd:hMMm. ./. \"}
\n {\" `yMy` `yNMd` \"}
\n {\" `hMs` oMMy \"}
\n {\" `hMh sMN- \"}
\n {\" /MM- .NMo \"}
\n {\" +MM: :MM+ \"}
\n {\" sNNo-.`.-omNy` \"}
\n {\" -smNNNNmdo- \"}
\n {\" `..` \"}

\n Many cultures predict an end to humanity in the near future, a final\n Armageddon that will end the world; but we disagree.),\n offerHackingWork: false,\n offerFieldWork: false,\n offerSecurityWork: false,\n special: true,\n keepOnInstall: true,\n assignment: (): React.ReactElement => {\n const router = use.Router();\n return (\n router.toStaneksGift()}\n />\n );\n },\n }),\n [FactionNames.ShadowsOfAnarchy]: new FactionInfo({\n infoText: (\n <>\n The government is ruled by the corporations that we have allowed to consume it. To release the world from its\n shackles, the gods grant us their strength.\n \n ),\n special: true,\n keepOnInstall: true,\n assignment: (): React.ReactElement => {\n return {FactionNames.ShadowsOfAnarchy} can only gain reputation by infiltrating.;\n },\n }),\n};\n","import { IPerson } from \"../../PersonObjects/IPerson\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { FactionWorkType } from \"../data/FactionWorkType\";\nimport { newWorkStats, WorkStats } from \"../WorkStats\";\nimport {\n getFactionFieldWorkRepGain,\n getFactionSecurityWorkRepGain,\n getHackingWorkRepGain,\n} from \"../../PersonObjects/formulas/reputation\";\n\nconst gameCPS = 1000 / CONSTANTS._idleSpeed; // 5 cycles per second\n\nexport const FactionWorkStats: Record = {\n [FactionWorkType.HACKING]: newWorkStats({ hackExp: 15 }),\n [FactionWorkType.FIELD]: newWorkStats({\n hackExp: 10,\n strExp: 10,\n defExp: 10,\n dexExp: 10,\n agiExp: 10,\n chaExp: 10,\n }),\n [FactionWorkType.SECURITY]: newWorkStats({\n hackExp: 5,\n strExp: 15,\n defExp: 15,\n dexExp: 15,\n agiExp: 15,\n }),\n};\n\nexport const calculateFactionRep = (person: IPerson, tpe: FactionWorkType, favor: number): number => {\n const repFormulas = {\n [FactionWorkType.HACKING]: getHackingWorkRepGain,\n [FactionWorkType.FIELD]: getFactionFieldWorkRepGain,\n [FactionWorkType.SECURITY]: getFactionSecurityWorkRepGain,\n };\n return repFormulas[tpe](person, favor);\n};\n\nexport function calculateFactionExp(person: IPerson, tpe: FactionWorkType): WorkStats {\n const baseStats = FactionWorkStats[tpe];\n return {\n money: 0,\n reputation: 0,\n hackExp: (baseStats.hackExp * person.mults.hacking_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n strExp: (baseStats.strExp * person.mults.strength_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n defExp: (baseStats.defExp * person.mults.defense_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n dexExp: (baseStats.dexExp * person.mults.dexterity_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n agiExp: (baseStats.agiExp * person.mults.agility_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n chaExp: (baseStats.chaExp * person.mults.charisma_exp * BitNodeMultipliers.FactionWorkExpGain) / gameCPS,\n intExp: 0,\n };\n}\n","/**\n * This is a central class for storing and managing the player's hashes,\n * which are generated by Hacknet Servers\n *\n * It is also used to keep track of what upgrades the player has bought with\n * his hashes, and contains method for grabbing the data/multipliers from\n * those upgrades\n */\nimport { HashUpgrades } from \"./HashUpgrades\";\nimport { HashUpgrade } from \"./HashUpgrade\";\n\nimport { IMap } from \"../types\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class HashManager {\n // Max number of hashes this can hold. Equal to the sum of capacities of\n // all Hacknet Servers\n capacity = 0;\n\n // Number of hashes currently in storage\n hashes = 0;\n\n // Map of Hash Upgrade Name -> levels in that upgrade\n upgrades: IMap = {};\n\n constructor() {\n for (const name of Object.keys(HashUpgrades)) {\n this.upgrades[name] = 0;\n }\n }\n\n /**\n * Generic helper function for getting a multiplier from a HashUpgrade\n */\n getMult(upgName: string): number {\n const upg = HashUpgrades[upgName];\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null) {\n console.error(`Could not find Hash Study upgrade`);\n return 1;\n }\n\n return 1 + (upg.value * currLevel) / 100;\n }\n\n /**\n * One of the Hash upgrades improves studying. This returns that multiplier\n */\n getStudyMult(): number {\n const upgName = \"Improve Studying\";\n\n return this.getMult(upgName);\n }\n\n /**\n * One of the Hash upgrades improves gym training. This returns that multiplier\n */\n getTrainingMult(): number {\n const upgName = \"Improve Gym Training\";\n\n return this.getMult(upgName);\n }\n\n getUpgrade(upgName: string): HashUpgrade | null {\n const upg = HashUpgrades[upgName];\n if (!upg) {\n console.error(`Invalid Upgrade Name given to HashManager.getUpgrade(): ${upgName}`);\n return null;\n }\n return upg;\n }\n\n /**\n * Get the cost (in hashes) of an upgrade\n */\n getUpgradeCost(upgName: string, count = 1): number {\n const upg = this.getUpgrade(upgName);\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null) {\n console.error(`Invalid Upgrade Name given to HashManager.getUpgradeCost(): ${upgName}`);\n return Infinity;\n }\n\n return upg.getCost(currLevel, count);\n }\n\n prestige(): void {\n for (const name of Object.keys(HashUpgrades)) {\n this.upgrades[name] = 0;\n }\n this.hashes = 0;\n\n // When prestiging, player's hacknet nodes are always reset. So capacity = 0\n this.updateCapacity(0);\n }\n\n /**\n * Reverts an upgrade and refunds the hashes used to buy it\n */\n refundUpgrade(upgName: string, count = 1): void {\n const upg = HashUpgrades[upgName];\n\n // Reduce the level first, so we get the right cost\n this.upgrades[upgName] -= count;\n\n const currLevel = this.upgrades[upgName];\n if (upg == null || currLevel == null || currLevel < 0) {\n console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${upgName}`);\n return;\n }\n\n const cost = upg.getCost(currLevel, count);\n this.hashes += cost;\n }\n\n /**\n * Stores the given hashes, capping at capacity\n * @param numHashes The number of hashes to increment\n * @returns The number of wasted hashes (over capacity)\n */\n storeHashes(numHashes: number): number {\n this.hashes += numHashes;\n let wastedHashes = this.hashes;\n this.hashes = Math.min(this.hashes, this.capacity);\n wastedHashes -= this.hashes;\n return wastedHashes;\n }\n\n updateCapacity(newCap: number): void {\n if (newCap < 0) {\n this.capacity = 0;\n }\n this.capacity = Math.max(newCap, 0);\n }\n\n /**\n * Returns boolean indicating whether or not the upgrade was successfully purchased\n * Note that this does NOT actually implement the effect\n */\n upgrade(upgName: string, count = 1): boolean {\n const upg = HashUpgrades[upgName];\n if (upg == null) {\n console.error(`Invalid Upgrade Name given to HashManager.upgrade(): ${upgName}`);\n return false;\n }\n\n const cost = this.getUpgradeCost(upgName, count);\n\n if (this.hashes < cost) {\n return false;\n }\n\n this.hashes -= cost;\n this.upgrades[upgName] += count;\n\n return true;\n }\n\n //Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"HashManager\", this);\n }\n\n // Initiatizes a HashManager object from a JSON save state.\n static fromJSON(value: IReviverValue): HashManager {\n return Generic_fromJSON(HashManager, value.data);\n }\n}\n\nReviver.constructors.HashManager = HashManager;\n","import { EventEmitter } from \"../../utils/EventEmitter\";\nexport const ITutorialEvents = new EventEmitter<[]>();\n","import { Crimes } from \"./Crimes\";\nimport { Crime } from \"./Crime\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nexport function determineCrimeSuccess(p: IPlayer, type: string): boolean {\n let chance = 0;\n let found = false;\n for (const i of Object.keys(Crimes)) {\n const crime = Crimes[i];\n if (crime.type === type) {\n chance = crime.successRate(p);\n found = true;\n break;\n }\n }\n\n if (!found) {\n dialogBoxCreate(`ERR: Unrecognized crime type: ${type} This is probably a bug please contact the developer`);\n return false;\n }\n return Math.random() <= chance;\n}\n\nexport function findCrime(roughName: string): Crime | null {\n roughName = roughName.toLowerCase();\n if (roughName.includes(\"shoplift\")) {\n return Crimes.Shoplift;\n } else if (roughName.includes(\"rob\") && roughName.includes(\"store\")) {\n return Crimes.RobStore;\n } else if (roughName.includes(\"mug\")) {\n return Crimes.Mug;\n } else if (roughName.includes(\"larceny\")) {\n return Crimes.Larceny;\n } else if (roughName.includes(\"drugs\")) {\n return Crimes.DealDrugs;\n } else if (roughName.includes(\"bond\") && roughName.includes(\"forge\")) {\n return Crimes.BondForgery;\n } else if ((roughName.includes(\"traffic\") || roughName.includes(\"illegal\")) && roughName.includes(\"arms\")) {\n return Crimes.TraffickArms;\n } else if (roughName.includes(\"homicide\")) {\n return Crimes.Homicide;\n } else if (roughName.includes(\"grand\") && roughName.includes(\"auto\")) {\n return Crimes.GrandTheftAuto;\n } else if (roughName.includes(\"kidnap\")) {\n return Crimes.Kidnap;\n } else if (roughName.includes(\"assassin\")) {\n return Crimes.Assassination;\n } else if (roughName.includes(\"heist\")) {\n return Crimes.Heist;\n }\n\n return null;\n}\n","import { EmployeePositions } from \"./EmployeePositions\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { generateRandomString } from \"../utils/StringHelperFunctions\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { Employee } from \"./Employee\";\nimport { IIndustry } from \"./IIndustry\";\nimport { ICorporation } from \"./ICorporation\";\n\ninterface IParams {\n loc?: string;\n size?: number;\n}\n\nexport class OfficeSpace {\n loc: string;\n size: number;\n\n minEne = 0;\n minHap = 0;\n minMor = 0;\n\n maxEne = 100;\n maxHap = 100;\n maxMor = 100;\n\n autoCoffee = false;\n autoParty = false;\n coffeeMult = 0;\n partyMult = 0;\n coffeeEmployees = 0;\n partyEmployees = 0;\n\n employees: Employee[] = [];\n employeeProd: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n total: 0,\n };\n employeeJobs: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n [EmployeePositions.Training]: 0,\n [EmployeePositions.Unassigned]: 0,\n };\n employeeNextJobs: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n [EmployeePositions.Training]: 0,\n [EmployeePositions.Unassigned]: 0,\n };\n\n constructor(params: IParams = {}) {\n this.loc = params.loc ? params.loc : \"\";\n this.size = params.size ? params.size : 1;\n }\n\n atCapacity(): boolean {\n return this.employees.length >= this.size;\n }\n\n process(marketCycles = 1, corporation: ICorporation, industry: IIndustry): number {\n // HRBuddy AutoRecruitment and training\n if (industry.hasResearch(\"HRBuddy-Recruitment\") && !this.atCapacity()) {\n const emp = this.hireRandomEmployee();\n if (industry.hasResearch(\"HRBuddy-Training\") && emp !== undefined) {\n emp.pos = EmployeePositions.Training;\n }\n }\n\n // Update employee jobs and job counts\n for (const employee of this.employees) {\n employee.pos = employee.nextPos;\n }\n this.calculateTotalEmployees();\n this.calculateNextEmployees();\n\n // Process Office properties\n this.maxEne = 100;\n this.maxHap = 100;\n this.maxMor = 100;\n\n if (industry.hasResearch(\"Go-Juice\")) {\n this.maxEne += 10;\n }\n if (industry.hasResearch(\"JoyWire\")) {\n this.maxHap += 10;\n }\n if (industry.hasResearch(\"Sti.mu\")) {\n this.maxMor += 10;\n }\n if (industry.hasResearch(\"AutoBrew\")) {\n this.autoCoffee = true;\n }\n if (industry.hasResearch(\"AutoPartyManager\")) {\n this.autoParty = true;\n }\n\n // Calculate changes in Morale/Happiness/Energy for Employees\n let perfMult = 1; //Multiplier for employee morale/happiness/energy based on company performance\n if (corporation.funds < 0 && industry.lastCycleRevenue < 0) {\n perfMult = Math.pow(0.99, marketCycles);\n } else if (corporation.funds > 0 && industry.lastCycleRevenue > 0) {\n perfMult = Math.pow(1.01, marketCycles);\n }\n\n let totalSalary = 0;\n for (const employee of this.employees) {\n const salary = employee.process(marketCycles);\n totalSalary += salary;\n\n if (this.autoCoffee) {\n employee.ene = this.maxEne;\n } else if (this.coffeeMult > 1) {\n const mult = 1 + ((this.coffeeMult - 1) * this.employees.length) / this.coffeeEmployees;\n employee.ene *= mult;\n } else {\n employee.ene *= perfMult;\n }\n\n if (this.autoParty) {\n employee.mor = this.maxMor;\n employee.hap = this.maxHap;\n } else if (this.partyMult > 1) {\n const mult = 1 + ((this.partyMult - 1) * this.employees.length) / this.partyEmployees;\n employee.mor *= mult;\n employee.hap *= mult;\n } else {\n employee.mor *= perfMult;\n employee.hap *= perfMult;\n }\n\n employee.ene = Math.max(Math.min(employee.ene, this.maxEne), this.minEne);\n employee.mor = Math.max(Math.min(employee.mor, this.maxMor), this.minMor);\n employee.hap = Math.max(Math.min(employee.hap, this.maxHap), this.minHap);\n }\n\n this.coffeeMult = 0;\n this.partyMult = 0;\n this.coffeeEmployees = 0;\n this.partyEmployees = 0;\n\n this.calculateEmployeeProductivity(corporation, industry);\n return totalSalary;\n }\n\n calculateNextEmployees(): void {\n //Reset\n for (const name of Object.keys(this.employeeNextJobs)) {\n this.employeeNextJobs[name] = 0;\n }\n\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n this.employeeNextJobs[employee.nextPos]++;\n }\n }\n\n calculateTotalEmployees(): void {\n //Reset\n for (const name of Object.keys(this.employeeJobs)) {\n this.employeeJobs[name] = 0;\n }\n\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n this.employeeJobs[employee.pos]++;\n }\n }\n\n calculateEmployeeProductivity(corporation: ICorporation, industry: IIndustry): void {\n //Reset\n for (const name of Object.keys(this.employeeProd)) {\n this.employeeProd[name] = 0;\n }\n\n let total = 0;\n for (let i = 0; i < this.employees.length; ++i) {\n const employee = this.employees[i];\n const prod = employee.calculateProductivity(corporation, industry);\n this.employeeProd[employee.pos] += prod;\n total += prod;\n }\n this.employeeProd.total = total;\n }\n\n hireRandomEmployee(): Employee | undefined {\n if (this.atCapacity()) return;\n if (document.getElementById(\"cmpy-mgmt-hire-employee-popup\") != null) return;\n\n //Generate three random employees (meh, decent, amazing)\n const int = getRandomInt(50, 100),\n cha = getRandomInt(50, 100),\n exp = getRandomInt(50, 100),\n cre = getRandomInt(50, 100),\n eff = getRandomInt(50, 100),\n sal = CorporationConstants.EmployeeSalaryMultiplier * (int + cha + exp + cre + eff);\n\n const emp = new Employee({\n intelligence: int,\n charisma: cha,\n experience: exp,\n creativity: cre,\n efficiency: eff,\n salary: sal,\n });\n\n const name = generateRandomString(7);\n\n for (let i = 0; i < this.employees.length; ++i) {\n if (this.employees[i].name === name) {\n return this.hireRandomEmployee();\n }\n }\n emp.name = name;\n this.employees.push(emp);\n\n this.calculateTotalEmployees();\n this.calculateNextEmployees();\n return emp;\n }\n\n assignSingleJob(employee: Employee, job: string): void {\n employee.nextPos = job;\n this.calculateNextEmployees();\n }\n\n autoAssignJob(job: string, target: number): boolean {\n let count = this.employeeNextJobs[job];\n\n for (const employee of this.employees) {\n if (count === target) {\n break;\n } else if (employee.nextPos === EmployeePositions.Unassigned && count <= target) {\n employee.nextPos = job;\n count++;\n } else if (employee.nextPos === job && count >= target) {\n employee.nextPos = EmployeePositions.Unassigned;\n count--;\n }\n }\n\n this.calculateNextEmployees();\n return count === target;\n }\n\n getCoffeeCost(): number {\n return 500e3 * this.employees.length;\n }\n\n setCoffee(mult = 1.05): boolean {\n if (mult > 1 && this.coffeeMult === 0 && !this.autoCoffee && this.employees.length > 0) {\n this.coffeeMult = mult;\n this.coffeeEmployees = this.employees.length;\n return true;\n }\n\n return false;\n }\n\n setParty(mult: number): boolean {\n if (mult > 1 && this.partyMult === 0 && !this.autoParty && this.employees.length > 0) {\n this.partyMult = mult;\n this.partyEmployees = this.employees.length;\n return true;\n }\n\n return false;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"OfficeSpace\", this);\n }\n\n static fromJSON(value: IReviverValue): OfficeSpace {\n return Generic_fromJSON(OfficeSpace, value.data);\n }\n}\n\nReviver.constructors.OfficeSpace = OfficeSpace;\n","export interface CorporationUpgrade {\n index: number;\n basePrice: number;\n priceMult: number;\n benefit: number;\n name: string;\n desc: string;\n}\n\nexport enum CorporationUpgradeIndex {\n SmartFactories = 0,\n SmartStorage = 1,\n DreamSense = 2,\n WilsonAnalytics = 3,\n NuoptimalNootropicInjectorImplants = 4,\n SpeechProcessorImplants = 5,\n NeuralAccelerators = 6,\n FocusWires = 7,\n ABCSalesBots = 8,\n ProjectInsight = 9,\n}\n\n// Corporation Upgrades\n// Upgrades for entire corporation, levelable upgrades\nexport const CorporationUpgrades: Record = {\n //Smart factories, increases production\n [CorporationUpgradeIndex.SmartFactories]: {\n index: CorporationUpgradeIndex.SmartFactories,\n basePrice: 2e9,\n priceMult: 1.06,\n benefit: 0.03,\n name: \"Smart Factories\",\n desc:\n \"Advanced AI automatically optimizes the operation and productivity \" +\n \"of factories. Each level of this upgrade increases your global production by 3% (additive).\",\n },\n\n //Smart warehouses, increases storage size\n [CorporationUpgradeIndex.SmartStorage]: {\n index: CorporationUpgradeIndex.SmartStorage,\n basePrice: 2e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Smart Storage\",\n desc:\n \"Advanced AI automatically optimizes your warehouse storage methods. \" +\n \"Each level of this upgrade increases your global warehouse storage size by 10% (additive).\",\n },\n\n //Advertise through dreams, passive popularity/ awareness gain\n [CorporationUpgradeIndex.DreamSense]: {\n index: CorporationUpgradeIndex.DreamSense,\n basePrice: 4e9,\n priceMult: 1.1,\n benefit: 0.001,\n name: \"DreamSense\",\n desc:\n \"Use DreamSense LCC Technologies to advertise your corporation \" +\n \"to consumers through their dreams. Each level of this upgrade provides a passive \" +\n \"increase in awareness of all of your companies (divisions) by 0.004 / market cycle,\" +\n \"and in popularity by 0.001 / market cycle. A market cycle is approximately \" +\n \"15 seconds.\",\n },\n\n //Makes advertising more effective\n [CorporationUpgradeIndex.WilsonAnalytics]: {\n index: CorporationUpgradeIndex.WilsonAnalytics,\n basePrice: 4e9,\n priceMult: 1.5,\n benefit: 0.005,\n name: \"Wilson Analytics\",\n desc:\n \"Purchase data and analysis from Wilson, a marketing research \" +\n \"firm. Each level of this upgrade increases the effectiveness of your \" +\n \"advertising by 0.5% (additive).\",\n },\n\n //Augmentation for employees, increases cre\n [CorporationUpgradeIndex.NuoptimalNootropicInjectorImplants]: {\n index: CorporationUpgradeIndex.NuoptimalNootropicInjectorImplants,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Nuoptimal Nootropic Injector Implants\",\n desc:\n \"Purchase the Nuoptimal Nootropic \" +\n \"Injector augmentation for your employees. Each level of this upgrade \" +\n \"globally increases the creativity of your employees by 10% (additive).\",\n },\n\n //Augmentation for employees, increases cha\n [CorporationUpgradeIndex.SpeechProcessorImplants]: {\n index: CorporationUpgradeIndex.SpeechProcessorImplants,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Speech Processor Implants\",\n desc:\n \"Purchase the Speech Processor augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the charisma of your employees by 10% (additive).\",\n },\n\n //Augmentation for employees, increases int\n [CorporationUpgradeIndex.NeuralAccelerators]: {\n index: CorporationUpgradeIndex.NeuralAccelerators,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"Neural Accelerators\",\n desc:\n \"Purchase the Neural Accelerator augmentation for your employees. \" +\n \"Each level of this upgrade globally increases the intelligence of your employees \" +\n \"by 10% (additive).\",\n },\n\n //Augmentation for employees, increases eff\n [CorporationUpgradeIndex.FocusWires]: {\n index: CorporationUpgradeIndex.FocusWires,\n basePrice: 1e9,\n priceMult: 1.06,\n benefit: 0.1,\n name: \"FocusWires\",\n desc:\n \"Purchase the FocusWire augmentation for your employees. Each level \" +\n \"of this upgrade globally increases the efficiency of your employees by 10% (additive).\",\n },\n\n //Improves sales of materials/products\n [CorporationUpgradeIndex.ABCSalesBots]: {\n index: CorporationUpgradeIndex.ABCSalesBots,\n basePrice: 1e9,\n priceMult: 1.07,\n benefit: 0.01,\n name: \"ABC SalesBots\",\n desc:\n \"Always Be Closing. Purchase these robotic salesmen to increase the amount of \" +\n \"materials and products you sell. Each level of this upgrade globally increases your sales \" +\n \"by 1% (additive).\",\n },\n\n //Improves scientific research rate\n [CorporationUpgradeIndex.ProjectInsight]: {\n index: CorporationUpgradeIndex.ProjectInsight,\n basePrice: 5e9,\n priceMult: 1.07,\n benefit: 0.05,\n name: \"Project Insight\",\n desc:\n \"Purchase 'Project Insight', a R&D service provided by the secretive \" +\n \"Fulcrum Technologies. Each level of this upgrade globally increases the amount of \" +\n \"Scientific Research you produce by 5% (additive).\",\n },\n};\n","import { sum } from \"lodash\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { CONSTANTS } from \"../../Constants\";\n\nexport interface IConstructorParams {\n augmentation: Augmentation;\n readonly cost: number;\n readonly time: number;\n}\n\nexport class GraftableAugmentation {\n // The augmentation that this craftable corresponds to\n augmentation: Augmentation;\n\n constructor(augmentation: Augmentation) {\n this.augmentation = augmentation;\n }\n\n get cost(): number {\n return this.augmentation.baseCost * CONSTANTS.AugmentationGraftingCostMult;\n }\n\n get time(): number {\n // Time = 1 hour * log_2(sum(aug multipliers) || 1) + 30 minutes\n const antiLog = Math.max(sum(Object.values(this.augmentation.mults).filter((x) => x !== 1)), 1);\n\n const mult = Math.log2(antiLog);\n return (CONSTANTS.AugmentationGraftingTimeBase * mult + CONSTANTS.MillisecondsPerHalfHour) / 2;\n }\n}\n","import LinearProgress from \"@mui/material/LinearProgress\";\nimport { Theme } from \"@mui/material/styles\";\nimport withStyles from \"@mui/styles/withStyles\";\n\nexport const ProgressBar = withStyles((theme: Theme) => ({\n root: {\n backgroundColor: theme.palette.background.paper,\n },\n bar: {\n transition: \"none\",\n backgroundColor: theme.palette.primary.main,\n },\n}))(LinearProgress);\n","export type ObjectValidator = {\n [key in keyof T]?: ParameterValidator;\n};\n\ninterface ParameterValidatorObject {\n default?: unknown;\n min?: number;\n max?: number;\n func?: (obj: Type, validator: ObjectValidator, key: Key) => void;\n}\ntype ParameterValidatorFunction = (obj: Type, key: Key) => void;\ntype ParameterValidator =\n | ParameterValidatorObject\n | ParameterValidatorFunction;\n\nexport function validateObject, Key extends keyof Type>(\n obj: Type,\n validator: ObjectValidator,\n): void {\n for (const key of Object.keys(validator) as Key[]) {\n const paramValidator = validator[key];\n if (paramValidator !== undefined) {\n if (typeof paramValidator === \"function\") {\n paramValidator(obj, key);\n } else if (paramValidator.func !== undefined) {\n paramValidator.func(obj, validator, key);\n } else {\n if (typeof obj[key] !== typeof paramValidator.default) {\n obj[key] = paramValidator.default as Type[Key];\n }\n if (typeof obj[key] === \"number\" && paramValidator.min !== undefined) {\n if (obj[key] < paramValidator.min) obj[key] = paramValidator.min as Type[Key];\n }\n if (typeof obj[key] === \"number\" && paramValidator.max !== undefined) {\n if (obj[key] > paramValidator.max) obj[key] = paramValidator.max as Type[Key];\n }\n }\n }\n }\n}\n\nexport function minMax(\n def: number,\n min: number,\n max: number,\n): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== \"number\") {\n obj[key] = def as unknown as Type[Key];\n return;\n }\n if ((obj[key] as unknown as number) < min) {\n obj[key] = min as unknown as Type[Key];\n }\n if ((obj[key] as unknown as number) > max) {\n obj[key] = max as unknown as Type[Key];\n }\n };\n}\n\nexport function oneOf(\n def: Value,\n options: Value[],\n): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== typeof def) {\n obj[key] = def as unknown as Type[Key];\n return;\n }\n if (!options.includes(obj[key] as unknown as Value)) {\n obj[key] = def as unknown as Type[Key];\n }\n };\n}\n\nexport function subsetOf(\n options: Value[],\n): (obj: Type, key: Key & keyof Type) => void {\n return (obj, key) => {\n if (typeof obj[key] !== \"object\" || !Array.isArray(obj[key])) {\n obj[key] = [] as unknown as Type[Key];\n return;\n }\n const validValues: Value[] = [];\n for (const value of obj[key] as unknown as Value[]) {\n if (options.includes(value)) validValues.push(value);\n }\n obj[key] = validValues as unknown as Type[Key];\n };\n}\n","import { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { LocationsMetadata } from \"../../Locations/data/LocationsMetadata\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Faction } from \"../../Faction/Faction\";\n\nexport function calculateSellInformationCashReward(\n player: IPlayer,\n reward: number,\n maxLevel: number,\n difficulty: number,\n): number {\n const levelBonus = maxLevel * Math.pow(1.01, maxLevel);\n\n return (\n Math.pow(reward + 1, 2) *\n Math.pow(difficulty, 3) *\n 3e3 *\n levelBonus *\n (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) *\n BitNodeMultipliers.InfiltrationMoney\n );\n}\n\nexport function calculateTradeInformationRepReward(\n player: IPlayer,\n reward: number,\n maxLevel: number,\n difficulty: number,\n): number {\n const levelBonus = maxLevel * Math.pow(1.01, maxLevel);\n\n return (\n Math.pow(reward + 1, 1.1) *\n Math.pow(difficulty, 1.2) *\n 30 *\n levelBonus *\n (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 1.5 : 1) *\n BitNodeMultipliers.InfiltrationRep\n );\n}\n\nexport function calculateInfiltratorsRepReward(player: IPlayer, faction: Faction, difficulty: number): number {\n const maxStartingSecurityLevel = LocationsMetadata.reduce((acc, data): number => {\n const startingSecurityLevel = data.infiltrationData?.startingSecurityLevel || 0;\n return acc > startingSecurityLevel ? acc : startingSecurityLevel;\n }, 0);\n const baseRepGain = (difficulty / maxStartingSecurityLevel) * 5000;\n\n return (\n baseRepGain * (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 2 : 1) * (1 + faction.favor / 100)\n );\n}\n","/**\n * This is an object that is used to keep track of where all of the player's\n * money is coming from (or going to)\n */\nimport { Generic_fromJSON, Generic_toJSON, Reviver, IReviverValue } from \"./JSONReviver\";\n\nexport class MoneySourceTracker {\n // eslint-disable-next-line @typescript-eslint/ban-types\n [key: string]: number | Function;\n\n bladeburner = 0;\n casino = 0;\n class = 0;\n codingcontract = 0;\n corporation = 0;\n crime = 0;\n gang = 0;\n hacking = 0;\n hacknet = 0;\n hacknet_expenses = 0;\n hospitalization = 0;\n infiltration = 0;\n sleeves = 0;\n stock = 0;\n total = 0;\n work = 0;\n servers = 0;\n other = 0;\n augmentations = 0;\n\n // Record money earned\n record(amt: number, source: string): void {\n const sanitizedSource = source.toLowerCase();\n if (typeof this[sanitizedSource] !== \"number\") {\n console.warn(`MoneySourceTracker.record() called with invalid source: ${source}`);\n return;\n }\n\n (this[sanitizedSource] as number) += amt;\n this.total += amt;\n }\n\n // Reset the money tracker by setting all stats to 0\n reset(): void {\n for (const prop in this) {\n if (typeof this[prop] === \"number\") {\n (this[prop] as number) = 0;\n }\n }\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"MoneySourceTracker\", this);\n }\n\n // Initiatizes a MoneySourceTracker object from a JSON save state.\n static fromJSON(value: IReviverValue): MoneySourceTracker {\n return Generic_fromJSON(MoneySourceTracker, value.data);\n }\n}\n\nReviver.constructors.MoneySourceTracker = MoneySourceTracker;\n","// choose random character for generating plaintexts to compress\nexport function comprGenChar(): string {\n const r = Math.random();\n if (r < 0.4) {\n return \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\"[Math.floor(26 * Math.random())];\n } else if (r < 0.8) {\n return \"abcdefghijklmnopqrstuvwxyz\"[Math.floor(26 * Math.random())];\n } else {\n return \"01234567689\"[Math.floor(10 * Math.random())];\n }\n}\n\n// generate plaintext which is amenable to LZ encoding\nexport function comprLZGenerate(): string {\n const length = 50 + Math.floor(25 * (Math.random() + Math.random()));\n let plain = \"\";\n\n while (plain.length < length) {\n if (Math.random() < 0.8) {\n plain += comprGenChar();\n } else {\n const length = 1 + Math.floor(9 * Math.random());\n const offset = 1 + Math.floor(9 * Math.random());\n if (offset > plain.length) {\n continue;\n }\n\n for (let i = 0; i < length; ++i) {\n plain += plain[plain.length - offset];\n }\n }\n }\n\n return plain.substring(0, length);\n}\n\n// compress plaintest string\nexport function comprLZEncode(plain: string): string {\n // for state[i][j]:\n // if i is 0, we're adding a literal of length j\n // else, we're adding a backreference of offset i and length j\n let cur_state: (string | null)[][] = Array.from(Array(10), () => Array(10).fill(null));\n let new_state: (string | null)[][] = Array.from(Array(10), () => Array(10));\n\n function set(state: (string | null)[][], i: number, j: number, str: string): void {\n const current = state[i][j];\n if (current == null || str.length < current.length) {\n state[i][j] = str;\n } else if (str.length === current.length && Math.random() < 0.5) {\n // if two strings are the same length, pick randomly so that\n // we generate more possible inputs to Compression II\n state[i][j] = str;\n }\n }\n\n // initial state is a literal of length 1\n cur_state[0][1] = \"\";\n\n for (let i = 1; i < plain.length; ++i) {\n for (const row of new_state) {\n row.fill(null);\n }\n const c = plain[i];\n\n // handle literals\n for (let length = 1; length <= 9; ++length) {\n const string = cur_state[0][length];\n if (string == null) {\n continue;\n }\n\n if (length < 9) {\n // extend current literal\n set(new_state, 0, length + 1, string);\n } else {\n // start new literal\n set(new_state, 0, 1, string + \"9\" + plain.substring(i - 9, i) + \"0\");\n }\n\n for (let offset = 1; offset <= Math.min(9, i); ++offset) {\n if (plain[i - offset] === c) {\n // start new backreference\n set(new_state, offset, 1, string + String(length) + plain.substring(i - length, i));\n }\n }\n }\n\n // handle backreferences\n for (let offset = 1; offset <= 9; ++offset) {\n for (let length = 1; length <= 9; ++length) {\n const string = cur_state[offset][length];\n if (string == null) {\n continue;\n }\n\n if (plain[i - offset] === c) {\n if (length < 9) {\n // extend current backreference\n set(new_state, offset, length + 1, string);\n } else {\n // start new backreference\n set(new_state, offset, 1, string + \"9\" + String(offset) + \"0\");\n }\n }\n\n // start new literal\n set(new_state, 0, 1, string + String(length) + String(offset));\n\n // end current backreference and start new backreference\n for (let new_offset = 1; new_offset <= Math.min(9, i); ++new_offset) {\n if (plain[i - new_offset] === c) {\n set(new_state, new_offset, 1, string + String(length) + String(offset) + \"0\");\n }\n }\n }\n }\n\n const tmp_state = new_state;\n new_state = cur_state;\n cur_state = tmp_state;\n }\n\n let result = null;\n\n for (let len = 1; len <= 9; ++len) {\n let string = cur_state[0][len];\n if (string == null) {\n continue;\n }\n\n string += String(len) + plain.substring(plain.length - len, plain.length);\n if (result == null || string.length < result.length) {\n result = string;\n } else if (string.length == result.length && Math.random() < 0.5) {\n result = string;\n }\n }\n\n for (let offset = 1; offset <= 9; ++offset) {\n for (let len = 1; len <= 9; ++len) {\n let string = cur_state[offset][len];\n if (string == null) {\n continue;\n }\n\n string += String(len) + \"\" + String(offset);\n if (result == null || string.length < result.length) {\n result = string;\n } else if (string.length == result.length && Math.random() < 0.5) {\n result = string;\n }\n }\n }\n\n return result ?? \"\";\n}\n\n// decompress LZ-compressed string, or return null if input is invalid\nexport function comprLZDecode(compr: string): string | null {\n let plain = \"\";\n\n for (let i = 0; i < compr.length; ) {\n const literal_length = compr.charCodeAt(i) - 0x30;\n\n if (literal_length < 0 || literal_length > 9 || i + 1 + literal_length > compr.length) {\n return null;\n }\n\n plain += compr.substring(i + 1, i + 1 + literal_length);\n i += 1 + literal_length;\n\n if (i >= compr.length) {\n break;\n }\n const backref_length = compr.charCodeAt(i) - 0x30;\n\n if (backref_length < 0 || backref_length > 9) {\n return null;\n } else if (backref_length === 0) {\n ++i;\n } else {\n if (i + 1 >= compr.length) {\n return null;\n }\n\n const backref_offset = compr.charCodeAt(i + 1) - 0x30;\n if ((backref_length > 0 && (backref_offset < 1 || backref_offset > 9)) || backref_offset > plain.length) {\n return null;\n }\n\n for (let j = 0; j < backref_length; ++j) {\n plain += plain[plain.length - backref_offset];\n }\n\n i += 2;\n }\n }\n\n return plain;\n}\n","import * as React from \"react\";\nimport LinearProgress from \"@mui/material/LinearProgress\";\nimport { TableCell, Tooltip, Typography } from \"@mui/material\";\nimport { characterOverviewStyles } from \"./CharacterOverview\";\nimport { ISkillProgress } from \"src/PersonObjects/formulas/skill\";\nimport { numeralWrapper } from \"../numeralFormat\";\n\ninterface IProgressProps {\n min: number;\n max: number;\n current: number;\n remaining: number;\n progress: number;\n color?: React.CSSProperties[\"color\"];\n}\n\ninterface IStatsOverviewCellProps {\n progress: ISkillProgress;\n color?: React.CSSProperties[\"color\"];\n}\n\nexport function StatsProgressBar({\n min,\n max,\n current,\n remaining,\n progress,\n color,\n}: IProgressProps): React.ReactElement {\n const tooltip = (\n \n Progress: \n {numeralWrapper.formatExp(current)} / {numeralWrapper.formatExp(max - min)}\n
\n Remaining: \n {numeralWrapper.formatExp(remaining)} ({progress.toFixed(2)}%)\n
\n );\n\n return (\n \n \n \n );\n}\n\nexport function StatsProgressOverviewCell({ progress: skill, color }: IStatsOverviewCellProps): React.ReactElement {\n const classes = characterOverviewStyles();\n return (\n \n \n \n );\n}\n","import { Factions } from \"../../Faction/Factions\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Gang } from \"../../Gang/Gang\";\nimport { IPlayer } from \"../IPlayer\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\n\nexport function canAccessGang(this: IPlayer): boolean {\n if (this.bitNodeN === 2) {\n return true;\n }\n if (this.sourceFileLvl(2) <= 0) {\n return false;\n }\n\n return this.karma <= GangConstants.GangKarmaRequirement;\n}\n\nexport function isAwareOfGang(this: IPlayer): boolean {\n return this.bitNodeN === 2 || this.sourceFileLvl(2) >= 1;\n}\n\nexport function getGangFaction(this: IPlayer): Faction {\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n const fac = Factions[gang.facName];\n if (fac == null) {\n throw new Error(`Gang has invalid faction name: ${gang.facName}`);\n }\n\n return fac;\n}\n\nexport function getGangName(this: IPlayer): string {\n if (!this.inGang()) return \"\";\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n return gang.facName;\n}\n\nexport function hasGangWith(this: IPlayer, facName: string): boolean {\n if (!this.inGang()) return false;\n const gang = this.gang;\n if (gang === null) {\n throw new Error(\"Cannot get gang faction because player is not in a gang.\");\n }\n return gang.facName === facName;\n}\n\nexport function inGang(this: IPlayer): boolean {\n if (this.gang == null || this.gang == undefined) {\n return false;\n }\n\n return this.gang instanceof Gang;\n}\n\nexport function startGang(this: IPlayer, factionName: string, hacking: boolean): void {\n this.gang = new Gang(factionName, hacking);\n\n const fac = Factions[factionName];\n if (fac == null) {\n throw new Error(`Invalid faction name when creating gang: ${factionName}`);\n }\n fac.playerReputation = 0;\n}\n","import { IStyleSettings } from \"../ScriptEditor/NetscriptDefinitions\";\n\nexport const defaultStyles: IStyleSettings = {\n lineHeight: 1.5,\n fontFamily:\n \"Lucida Console, Lucida Sans Unicode, Fira Mono, Consolas, Courier New, Courier, monospace, Times New Roman\",\n};\n","/**\n * Does a shallow compare of two arrays to determine if they are equal.\n * @param a1 The first array\n * @param a2 The second array\n */\nexport function compareArrays(a1: T[], a2: T[]): boolean {\n if (a1.length !== a2.length) {\n return false;\n }\n\n for (let i = 0; i < a1.length; ++i) {\n const v1 = a1[i];\n const v2 = a2[i];\n if (Array.isArray(v1)) {\n // If the other element is not an array, then these cannot be equal\n if (!Array.isArray(v2)) {\n return false;\n }\n\n if (!compareArrays(v1, v2)) {\n return false;\n }\n } else if (v1 !== v2 && !(Number.isNaN(v1) && Number.isNaN(v2))) {\n // strict (in)equality considers NaN not equal to itself\n return false;\n }\n }\n\n return true;\n}\n","import { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { CONSTANTS } from \"../Constants\";\n\nexport function getHospitalizationCost(p: IPlayer): number {\n if (p.money < 0) {\n return 0;\n }\n\n return Math.min(p.money * 0.1, (p.hp.max - p.hp.current) * CONSTANTS.HospitalCostPerHp);\n}\n\nexport function calculateHospitalizationCost(p: IPlayer, damage: number): number {\n const oldhp = p.hp.current;\n p.hp.current -= damage;\n const cost = getHospitalizationCost(p);\n p.hp.current = oldhp;\n return cost;\n}\n","/**\n * Functions used to determine whether the target can be hacked (or grown/weakened).\n * Meant to be used for Netscript implementation\n *\n * The returned status object's message should be used for logging in Netscript\n */\nimport { IReturnStatus } from \"../types\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Server } from \"../Server/Server\";\n\nfunction baseCheck(server: Server, fnName: string): IReturnStatus {\n const hostname = server.hostname;\n\n if (!(\"requiredHackingSkill\" in server)) {\n return {\n res: false,\n msg: `Cannot ${fnName} ${hostname} server because it is a Hacknet Node`,\n };\n }\n\n if (server.hasAdminRights === false) {\n return {\n res: false,\n msg: `Cannot ${fnName} ${hostname} server because you do not have root access`,\n };\n }\n\n return { res: true };\n}\n\nexport function netscriptCanHack(server: Server, p: IPlayer): IReturnStatus {\n const initialCheck = baseCheck(server, \"hack\");\n if (!initialCheck.res) {\n return initialCheck;\n }\n\n const s = server;\n if (s.requiredHackingSkill > p.skills.hacking) {\n return {\n res: false,\n msg: `Cannot hack ${server.hostname} server because your hacking skill is not high enough`,\n };\n }\n\n return { res: true };\n}\n\nexport function netscriptCanGrow(server: Server): IReturnStatus {\n return baseCheck(server, \"grow\");\n}\n\nexport function netscriptCanWeaken(server: Server): IReturnStatus {\n return baseCheck(server, \"weaken\");\n}\n","import React, { useState, useEffect } from \"react\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nexport const PromptEvent = new EventEmitter<[Prompt]>();\n\ninterface Prompt {\n txt: string;\n options?: { type?: string; choices?: string[] };\n resolve: (result: boolean | string) => void;\n}\n\nexport function PromptManager(): React.ReactElement {\n const [prompt, setPrompt] = useState(null);\n useEffect(() => {\n return PromptEvent.subscribe((p: Prompt) => {\n setPrompt(p);\n });\n }, []);\n\n if (prompt === null) {\n return <>;\n }\n\n function close(): void {\n if (prompt === null) return;\n if ([\"text\", \"select\"].includes(prompt?.options?.type ?? \"\")) {\n prompt.resolve(\"\");\n } else {\n prompt.resolve(false);\n }\n setPrompt(null);\n }\n\n const types: { [key: string]: (props: IContentProps) => React.ReactElement } = {\n text: PromptMenuText,\n select: PromptMenuSelect,\n };\n\n let PromptContent = PromptMenuBoolean;\n if (prompt?.options?.type && [\"text\", \"select\"].includes(prompt?.options?.type))\n PromptContent = types[prompt?.options?.type];\n const resolve = (value: boolean | string): void => {\n prompt.resolve(value);\n setPrompt(null);\n };\n\n return (\n \n
\n        {prompt.txt}\n      
\n \n
\n );\n}\n\ninterface IContentProps {\n prompt: Prompt;\n resolve: (value: boolean | string) => void;\n}\n\nfunction PromptMenuBoolean({ resolve }: IContentProps): React.ReactElement {\n const yes = (): void => resolve(true);\n const no = (): void => resolve(false);\n\n return (\n <>\n
\n \n \n
\n \n );\n}\n\nfunction PromptMenuText({ resolve }: IContentProps): React.ReactElement {\n const [value, setValue] = useState(\"\");\n\n const submit = (): void => resolve(value);\n\n const onInput = (event: React.ChangeEvent): void => {\n setValue(event.target.value);\n };\n\n const onKeyDown = (event: React.KeyboardEvent): void => {\n event.stopPropagation();\n\n if (event.key === KEY.ENTER) {\n event.preventDefault();\n submit();\n }\n };\n\n return (\n <>\n
\n Confirm,\n }}\n />\n
\n \n );\n}\n\nfunction PromptMenuSelect({ prompt, resolve }: IContentProps): React.ReactElement {\n const [value, setValue] = useState(\"\");\n\n const submit = (): void => resolve(value);\n\n const onChange = (event: SelectChangeEvent): void => {\n setValue(event.target.value);\n };\n\n const getItems = (choices: string[]): React.ReactElement[] => {\n const content: React.ReactElement[] = [];\n for (const i of choices) {\n content.push(\n \n {i}\n ,\n );\n }\n return content;\n };\n\n if (!Array.isArray(prompt?.options?.choices)) {\n return Error: Please provide an array of string choices;\n }\n\n return (\n <>\n
\n \n \n
\n \n );\n}\n","import { EmployeePositions } from \"./EmployeePositions\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { IIndustry } from \"./IIndustry\";\nimport { ProductRatingWeights, IProductRatingWeight } from \"./ProductRatingWeights\";\n\nimport { createCityMap } from \"../Locations/createCityMap\";\nimport { IMap } from \"../types\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\ninterface IConstructorParams {\n name?: string;\n demand?: number;\n competition?: number;\n markup?: number;\n createCity?: string;\n designCost?: number;\n advCost?: number;\n quality?: number;\n performance?: number;\n durability?: number;\n reliability?: number;\n aesthetics?: number;\n features?: number;\n loc?: string;\n size?: number;\n req?: IMap;\n}\n\nexport class Product {\n // Product name\n name = \"\";\n\n // The demand for this Product in the market. Gradually decreases\n dmd = 0;\n\n // How much competition there is in the market for this Product\n cmp = 0;\n\n // Markup. Affects how high of a price you can charge for this Product\n // without suffering a loss in the # of sales\n mku = 0;\n\n // Production cost - estimation of how much money it costs to make this Product\n pCost = 0;\n\n // Sell cost\n sCost: string | number = 0;\n\n // Variables for handling the creation process of this Product\n fin = false; // Whether this Product has finished being created\n prog = 0; // Creation progress - A number betwee 0-100 representing percentage\n createCity = \"\"; // City in which the product is/was being created\n designCost = 0; // How much money was invested into designing this Product\n advCost = 0; // How much money was invested into advertising this Product\n\n // The average employee productivity and scientific research across the creation of the Product\n creationProd: { [key: string]: number } = {\n [EmployeePositions.Operations]: 0,\n [EmployeePositions.Engineer]: 0,\n [EmployeePositions.Business]: 0,\n [EmployeePositions.Management]: 0,\n [EmployeePositions.RandD]: 0,\n total: 0,\n };\n\n // Aggregate score for this Product's 'rating'\n // This is based on the stats/properties below. The weighting of the\n // stats/properties below differs between different industries\n rat = 0;\n\n // Stats/properties of this Product\n qlt = 0;\n per = 0;\n dur = 0;\n rel = 0;\n aes = 0;\n fea = 0;\n\n // Data refers to the production, sale, and quantity of the products\n // These values are specific to a city\n // For each city, the data is [qty, prod, sell]\n data: IMap = createCityMap([0, 0, 0]);\n\n // Location of this Product\n // Only applies for location-based products like restaurants/hospitals\n loc = \"\";\n\n // How much space 1 unit of the Product takes (in the warehouse)\n // Not applicable for all Products\n siz = 0;\n\n // Material requirements. An object that maps the name of a material to how much it requires\n // to make 1 unit of the product.\n reqMats: IMap = {};\n\n // Data to keep track of whether production/sale of this Product is\n // manually limited. These values are specific to a city\n // [Whether production/sale is limited, limit amount]\n prdman: IMap = createCityMap([false, 0]);\n sllman: IMap = createCityMap([false, 0]);\n\n // Flags that signal whether automatic sale pricing through Market TA is enabled\n marketTa1 = false;\n marketTa2 = false;\n marketTa2Price: IMap = createCityMap(0);\n\n // Determines the maximum amount of this product that can be sold in one market cycle\n maxsll = 0;\n constructor(params: IConstructorParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.dmd = params.demand ? params.demand : 0;\n this.cmp = params.competition ? params.competition : 0;\n this.mku = params.markup ? params.markup : 0;\n this.createCity = params.createCity ? params.createCity : \"\";\n this.designCost = params.designCost ? params.designCost : 0;\n this.advCost = params.advCost ? params.advCost : 0;\n this.qlt = params.quality ? params.quality : 0;\n this.per = params.performance ? params.performance : 0;\n this.dur = params.durability ? params.durability : 0;\n this.rel = params.reliability ? params.reliability : 0;\n this.aes = params.aesthetics ? params.aesthetics : 0;\n this.fea = params.features ? params.features : 0;\n this.loc = params.loc ? params.loc : \"\";\n this.siz = params.size ? params.size : 0;\n this.reqMats = params.req ? params.req : {};\n }\n\n // Make progress on this product based on current employee productivity\n createProduct(marketCycles: number, employeeProd: typeof this[\"creationProd\"]): void {\n if (this.fin) {\n return;\n }\n\n // Designing/Creating a Product is based mostly off Engineers\n const opProd = employeeProd[EmployeePositions.Operations];\n const engrProd = employeeProd[EmployeePositions.Engineer];\n const mgmtProd = employeeProd[EmployeePositions.Management];\n const total = opProd + engrProd + mgmtProd;\n if (total <= 0) {\n return;\n }\n\n // Management is a multiplier for the production from Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n const prodMult = (Math.pow(engrProd, 0.34) + Math.pow(opProd, 0.2)) * mgmtFactor;\n const progress = Math.min(marketCycles * 0.01 * prodMult, 100 - this.prog);\n if (progress <= 0) {\n return;\n }\n\n this.prog += progress;\n for (const pos of Object.keys(employeeProd)) {\n this.creationProd[pos] += (employeeProd[pos] * progress) / 100;\n }\n }\n\n // @param industry - Industry object. Reference to industry that makes this Product\n finishProduct(industry: IIndustry): void {\n this.fin = true;\n\n // Calculate properties\n const totalProd = this.creationProd.total;\n const engrRatio = this.creationProd[EmployeePositions.Engineer] / totalProd;\n const mgmtRatio = this.creationProd[EmployeePositions.Management] / totalProd;\n const rndRatio = this.creationProd[EmployeePositions.RandD] / totalProd;\n const opsRatio = this.creationProd[EmployeePositions.Operations] / totalProd;\n const busRatio = this.creationProd[EmployeePositions.Business] / totalProd;\n\n const designMult = 1 + Math.pow(this.designCost, 0.1) / 100;\n const balanceMult = 1.2 * engrRatio + 0.9 * mgmtRatio + 1.3 * rndRatio + 1.5 * opsRatio + busRatio;\n const sciMult = 1 + Math.pow(industry.sciResearch.qty, industry.sciFac) / 800;\n const totalMult = balanceMult * designMult * sciMult;\n\n this.qlt =\n totalMult *\n (0.1 * this.creationProd[EmployeePositions.Engineer] +\n 0.05 * this.creationProd[EmployeePositions.Management] +\n 0.05 * this.creationProd[EmployeePositions.RandD] +\n 0.02 * this.creationProd[EmployeePositions.Operations] +\n 0.02 * this.creationProd[EmployeePositions.Business]);\n this.per =\n totalMult *\n (0.15 * this.creationProd[EmployeePositions.Engineer] +\n 0.02 * this.creationProd[EmployeePositions.Management] +\n 0.02 * this.creationProd[EmployeePositions.RandD] +\n 0.02 * this.creationProd[EmployeePositions.Operations] +\n 0.02 * this.creationProd[EmployeePositions.Business]);\n this.dur =\n totalMult *\n (0.05 * this.creationProd[EmployeePositions.Engineer] +\n 0.02 * this.creationProd[EmployeePositions.Management] +\n 0.08 * this.creationProd[EmployeePositions.RandD] +\n 0.05 * this.creationProd[EmployeePositions.Operations] +\n 0.05 * this.creationProd[EmployeePositions.Business]);\n this.rel =\n totalMult *\n (0.02 * this.creationProd[EmployeePositions.Engineer] +\n 0.08 * this.creationProd[EmployeePositions.Management] +\n 0.02 * this.creationProd[EmployeePositions.RandD] +\n 0.05 * this.creationProd[EmployeePositions.Operations] +\n 0.08 * this.creationProd[EmployeePositions.Business]);\n this.aes =\n totalMult *\n (0.0 * this.creationProd[EmployeePositions.Engineer] +\n 0.08 * this.creationProd[EmployeePositions.Management] +\n 0.05 * this.creationProd[EmployeePositions.RandD] +\n 0.02 * this.creationProd[EmployeePositions.Operations] +\n 0.1 * this.creationProd[EmployeePositions.Business]);\n this.fea =\n totalMult *\n (0.08 * this.creationProd[EmployeePositions.Engineer] +\n 0.05 * this.creationProd[EmployeePositions.Management] +\n 0.02 * this.creationProd[EmployeePositions.RandD] +\n 0.05 * this.creationProd[EmployeePositions.Operations] +\n 0.05 * this.creationProd[EmployeePositions.Business]);\n this.calculateRating(industry);\n const advMult = 1 + Math.pow(this.advCost, 0.1) / 100;\n const busmgtgRatio = Math.max(busRatio + mgmtRatio, 1 / totalProd);\n this.mku = 100 / (advMult * Math.pow(this.qlt + 0.001, 0.65) * busmgtgRatio);\n\n // I actually don't understand well enough to know if this is right.\n // I'm adding this to prevent a crash.\n if (this.mku === 0 || !isFinite(this.mku)) this.mku = 1;\n\n this.dmd =\n industry.awareness === 0 ? 20 : Math.min(100, advMult * (100 * (industry.popularity / industry.awareness)));\n this.cmp = getRandomInt(0, 70);\n\n //Calculate the product's required materials\n //For now, just set it to be the same as the requirements to make materials\n for (const matName of Object.keys(industry.reqMats)) {\n if (industry.reqMats.hasOwnProperty(matName)) {\n const reqMat = industry.reqMats[matName];\n if (reqMat === undefined) continue;\n this.reqMats[matName] = reqMat;\n }\n }\n\n //Calculate the product's size\n //For now, just set it to be the same size as the requirements to make materials\n this.siz = 0;\n for (const matName of Object.keys(industry.reqMats)) {\n const reqMat = industry.reqMats[matName];\n if (reqMat === undefined) continue;\n this.siz += MaterialSizes[matName] * reqMat;\n }\n }\n\n calculateRating(industry: IIndustry): void {\n const weights: IProductRatingWeight = ProductRatingWeights[industry.type];\n if (weights == null) {\n console.error(`Could not find product rating weights for: ${industry}`);\n return;\n }\n this.rat = 0;\n this.rat += weights.Quality ? this.qlt * weights.Quality : 0;\n this.rat += weights.Performance ? this.per * weights.Performance : 0;\n this.rat += weights.Durability ? this.dur * weights.Durability : 0;\n this.rat += weights.Reliability ? this.rel * weights.Reliability : 0;\n this.rat += weights.Aesthetics ? this.aes * weights.Aesthetics : 0;\n this.rat += weights.Features ? this.fea * weights.Features : 0;\n }\n\n // Serialize the current object to a JSON save state.\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Product\", this);\n }\n\n // Initiatizes a Product object from a JSON save state.\n static fromJSON(value: IReviverValue): Product {\n return Generic_fromJSON(Product, value.data);\n }\n}\n\nReviver.constructors.Product = Product;\n","import { IIndustry } from \"../IIndustry\";\n\n// Returns a boolean indicating whether the given material is relevant for the\n// current industry.\nexport function isRelevantMaterial(matName: string, division: IIndustry): boolean {\n // Materials that affect Production multiplier\n const prodMultiplierMats = [\"Hardware\", \"Robots\", \"AICores\", \"RealEstate\", \"AI Cores\", \"Real Estate\"];\n\n if (Object.keys(division.reqMats).includes(matName)) {\n return true;\n }\n if (division.prodMats.includes(matName)) {\n return true;\n }\n if (prodMultiplierMats.includes(matName)) {\n return true;\n }\n\n return false;\n}\n","import React, { useState, useEffect } from \"react\";\nimport { find } from \"lodash\";\n\nimport { Box, Typography, Button, Container, Paper } from \"@mui/material\";\nimport { Check, Lock, Create } from \"@mui/icons-material\";\n\nimport { use } from \"../../ui/Context\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { Programs } from \"../Programs\";\nimport { CreateProgramWork } from \"../../Work/CreateProgramWork\";\n\nexport const ProgramsSeen: string[] = [];\n\nexport function ProgramsRoot(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const programs = [...Object.values(Programs)]\n .filter((prog) => {\n const create = prog.create;\n if (create === null) return false;\n if (prog.name === \"b1t_flum3.exe\") {\n return create.req(player);\n }\n return true;\n })\n .sort((a, b) => {\n if (player.hasProgram(a.name)) return 1;\n if (player.hasProgram(b.name)) return -1;\n return (a.create?.level ?? 0) - (b.create?.level ?? 0);\n });\n\n useEffect(() => {\n programs.forEach((p) => {\n if (ProgramsSeen.includes(p.name)) return;\n ProgramsSeen.push(p.name);\n });\n }, []);\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const getHackingLevelRemaining = (lvl: number): number => {\n return Math.ceil(Math.max(lvl - (player.skills.hacking + player.skills.intelligence / 2), 0));\n };\n\n const getProgCompletion = (name: string): number => {\n const programFile = find(player.getHomeComputer().programs, (p) => {\n return p.startsWith(name) && p.endsWith(\"%-INC\");\n });\n if (!programFile) return -1;\n\n const res = programFile.split(\"-\");\n if (res.length != 3) return -1;\n const percComplete = Number(res[1].slice(0, -1));\n if (isNaN(percComplete) || percComplete < 0 || percComplete >= 100) {\n return -1;\n }\n return percComplete;\n };\n\n return (\n \n Create program\n \n This page displays any programs that you are able to create. Writing the code for a program takes time, which\n can vary based on how complex the program is. If you are working on creating a program you can cancel at any\n time. Your progress will be saved and you can continue later.\n \n\n \n {programs.map((program) => {\n const create = program.create;\n if (create === null) return <>;\n const curCompletion = getProgCompletion(program.name);\n\n return (\n \n <>\n \n {(player.hasProgram(program.name) && ) ||\n (create.req(player) && ) || }\n {program.name}\n \n {!player.hasProgram(program.name) && create.req(player) && (\n {\n if (!event.isTrusted) return;\n player.startWork(\n new CreateProgramWork({ player: player, singularity: false, programName: program.name }),\n );\n player.startFocusing();\n router.toWork();\n }}\n >\n Create program\n \n )}\n {player.hasProgram(program.name) || getHackingLevelRemaining(create.level) === 0 || (\n \n Unlocks in: {getHackingLevelRemaining(create.level)} hacking levels\n \n )}\n {curCompletion !== -1 && (\n \n Current completion: {curCompletion}%\n \n )}\n {create.tooltip}\n \n \n );\n })}\n \n \n );\n}\n","import { Explore, Info, LastPage, LocalPolice, NewReleases, Report, SportsMma } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography, useTheme } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { IRouter } from \"../../ui/Router\";\nimport { FactionNames } from \"../data/FactionNames\";\nimport { Faction } from \"../Faction\";\nimport { getFactionAugmentationsFiltered, joinFaction } from \"../FactionHelpers\";\nimport { Factions } from \"../Factions\";\n\nexport const InvitationsSeen: string[] = [];\n\nconst getAugsLeft = (faction: Faction, player: IPlayer): number => {\n const augs = getFactionAugmentationsFiltered(player, faction);\n\n return augs.filter((augmentation: string) => !player.hasAugmentation(augmentation)).length;\n};\n\ninterface IWorkTypeProps {\n faction: Faction;\n}\n\nconst fontSize = \"small\";\nconst marginRight = 0.5;\n\nconst WorkTypesOffered = (props: IWorkTypeProps): React.ReactElement => {\n const info = props.faction.getInfo();\n\n return (\n <>\n {info.offerFieldWork && (\n \n \n \n )}\n {info.offerHackingWork && (\n \n \n \n )}\n {info.offerSecurityWork && (\n \n \n \n )}\n \n );\n};\n\ninterface IFactionProps {\n player: IPlayer;\n router: IRouter;\n faction: Faction;\n\n joined: boolean;\n\n rerender: () => void;\n}\n\nconst FactionElement = (props: IFactionProps): React.ReactElement => {\n const facInfo = props.faction.getInfo();\n\n function openFaction(faction: Faction): void {\n props.router.toFaction(faction);\n }\n\n function openFactionAugPage(faction: Faction): void {\n props.router.toFaction(faction, true);\n }\n\n function acceptInvitation(event: React.MouseEvent, faction: string): void {\n if (!event.isTrusted) return;\n joinFaction(Factions[faction]);\n props.rerender();\n }\n\n return (\n \n \n {props.joined ? (\n \n \n \n \n ) : (\n \n )}\n\n \n \n \n {props.faction.name}\n \n\n \n {props.player.hasGangWith(props.faction.name) && (\n \n \n \n )}\n\n {facInfo.special && (\n \n \n \n )}\n\n {!props.joined && facInfo.enemies.length > 0 && (\n \n This Faction is enemies with:\n
    \n {facInfo.enemies.map((enemy) => (\n
  • {enemy}
  • \n ))}\n
\n Joining this Faction will prevent you from joining its enemies\n \n }\n >\n \n \n )}\n
\n \n\n \n {!props.player.hasGangWith(props.faction.name) && }\n\n {props.joined && (\n \n {getAugsLeft(props.faction, props.player)} Augmentations left\n \n )}\n \n \n \n\n {props.joined && (\n \n \n {numeralWrapper.formatFavor(Math.floor(props.faction.favor))} favor\n \n \n {numeralWrapper.formatReputation(props.faction.playerReputation)} rep\n \n \n )}\n \n );\n};\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function FactionsRoot(props: IProps): React.ReactElement {\n const theme = useTheme();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n useEffect(() => {\n props.player.factionInvitations.forEach((faction) => {\n if (InvitationsSeen.includes(faction)) return;\n InvitationsSeen.push(faction);\n });\n }, []);\n\n const allFactions = Object.values(FactionNames).map((faction) => faction as string);\n const allJoinedFactions = [...props.player.factions];\n allJoinedFactions.sort((a, b) => allFactions.indexOf(a) - allFactions.indexOf(b));\n const invitations = props.player.factionInvitations;\n\n return (\n \n \n Factions\n \n Throughout the game you may receive invitations from factions. There are many different factions, and each\n faction has different criteria for determining its potential members. Joining a faction and furthering its\n cause is crucial to progressing in the game and unlocking endgame content.\n \n }\n >\n \n \n \n\n 0 ? \"1fr \" : \"\") + \"2fr\",\n [theme.breakpoints.down(\"lg\")]: { gridTemplateColumns: \"1fr\", \"& > span:nth-of-type(1)\": { order: 1 } },\n gridTemplateRows: \"minmax(0, 1fr)\",\n \"& > span > .MuiBox-root\": {\n display: \"grid\",\n gridAutoRows: \"70px\",\n gap: 1,\n },\n }}\n >\n {invitations.length > 0 && (\n \n \n Faction Invitations\n \n \n {invitations.map((facName) => {\n if (!Factions.hasOwnProperty(facName)) return null;\n return (\n \n );\n })}\n \n \n )}\n\n \n \n Your Factions\n \n \n {allJoinedFactions.length > 0 ? (\n allJoinedFactions.map((facName) => {\n if (!Factions.hasOwnProperty(facName)) return null;\n return (\n \n );\n })\n ) : (\n You have not yet joined any Factions.\n )}\n \n \n \n \n );\n}\n","/**\n * Implementation for what happens when you destroy a BitNode\n */\nimport React from \"react\";\nimport { Player } from \"./Player\";\nimport { prestigeSourceFile } from \"./Prestige\";\nimport { PlayerOwnedSourceFile } from \"./SourceFile/PlayerOwnedSourceFile\";\nimport { SourceFiles } from \"./SourceFile/SourceFiles\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { IRouter } from \"./ui/Router\";\n\nfunction giveSourceFile(bitNodeNumber: number): void {\n const sourceFileKey = \"SourceFile\" + bitNodeNumber.toString();\n const sourceFile = SourceFiles[sourceFileKey];\n if (sourceFile == null) {\n console.error(`Could not find source file for Bit node: ${bitNodeNumber}`);\n return;\n }\n\n // Check if player already has this source file\n let alreadyOwned = false;\n let ownedSourceFile = null;\n for (let i = 0; i < Player.sourceFiles.length; ++i) {\n if (Player.sourceFiles[i].n === bitNodeNumber) {\n alreadyOwned = true;\n ownedSourceFile = Player.sourceFiles[i];\n break;\n }\n }\n\n if (alreadyOwned && ownedSourceFile) {\n if (ownedSourceFile.lvl >= 3 && ownedSourceFile.n !== 12) {\n dialogBoxCreate(\n `The Source-File for the BitNode you just destroyed, ${sourceFile.name}, is already at max level!`,\n );\n } else {\n ++ownedSourceFile.lvl;\n dialogBoxCreate(\n sourceFile.name +\n \" was upgraded to level \" +\n ownedSourceFile.lvl +\n \" for \" +\n \"destroying its corresponding BitNode!\",\n );\n }\n } else {\n const playerSrcFile = new PlayerOwnedSourceFile(bitNodeNumber, 1);\n Player.sourceFiles.push(playerSrcFile);\n if (bitNodeNumber === 5 && Player.skills.intelligence === 0) {\n // Artificial Intelligence\n Player.skills.intelligence = 1;\n }\n dialogBoxCreate(\n <>\n You received a Source-File for destroying a BitNode!\n
\n
\n {sourceFile.name}\n
\n
\n {sourceFile.info}\n ,\n );\n }\n}\n\nexport function enterBitNode(router: IRouter, flume: boolean, destroyedBitNode: number, newBitNode: number): void {\n if (!flume) {\n giveSourceFile(destroyedBitNode);\n } else if (Player.sourceFileLvl(5) === 0 && newBitNode !== 5) {\n Player.skills.intelligence = 0;\n Player.exp.intelligence = 0;\n }\n if (newBitNode === 5 && Player.skills.intelligence === 0) {\n Player.skills.intelligence = 1;\n }\n // Set new Bit Node\n Player.bitNodeN = newBitNode;\n\n if (newBitNode === 6) {\n router.toBladeburnerCinematic();\n } else {\n router.toTerminal();\n }\n prestigeSourceFile(flume);\n}\n","import React, { useEffect } from \"react\";\n\nimport { Typography, Link, Button, ButtonGroup, Tooltip, Box, Paper, TextField } from \"@mui/material\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { load } from \"../../db\";\nimport { IRouter } from \"../Router\";\nimport { download } from \"../../SaveObject\";\nimport { IErrorData, newIssueUrl } from \"../../utils/ErrorHelper\";\nimport { DeleteGameButton } from \"./DeleteGameButton\";\nimport { SoftResetButton } from \"./SoftResetButton\";\n\nimport DirectionsRunIcon from \"@mui/icons-material/DirectionsRun\";\nimport GitHubIcon from \"@mui/icons-material/GitHub\";\n\nexport let RecoveryMode = false;\n\nexport function ActivateRecoveryMode(): void {\n RecoveryMode = true;\n}\n\ninterface IProps {\n router: IRouter;\n softReset: () => void;\n errorData?: IErrorData;\n resetError?: () => void;\n}\n\nexport function RecoveryRoot({ router, softReset, errorData, resetError }: IProps): React.ReactElement {\n function recover(): void {\n if (resetError) resetError();\n RecoveryMode = false;\n router.toTerminal();\n }\n Settings.AutosaveInterval = 0;\n\n useEffect(() => {\n load()\n .then((content) => {\n const epochTime = Math.round(Date.now() / 1000);\n const filename = `RECOVERY_BITBURNER_${epochTime}.json`;\n download(filename, content);\n })\n .catch((err) => console.error(err));\n }, []);\n\n return (\n \n RECOVERY MODE ACTIVATED\n \n There was an error with your save file and the game went into recovery mode. In this mode saving is disabled and\n the game will automatically export your save file (to prevent corruption).\n \n At this point it is recommended to alert a developer.\n \n \n File an issue on github\n \n \n \n \n Make a reddit post\n \n \n \n \n Post in the #bug-report channel on Discord.\n \n \n Please include your save file.\n
\n
\n You can disable recovery mode now. But chances are the game will not work correctly.\n \n \n \n \n \n \n \n\n {errorData && (\n \n {errorData.title}\n \n \n \n \n }\n color=\"info\"\n sx={{ px: 2 }}\n href={errorData.issueUrl ?? newIssueUrl}\n target={\"_blank\"}\n >\n Submit Issue to GitHub\n \n \n \n )}\n
\n );\n}\n","export enum RamCalculationErrorCode {\n SyntaxError = -1,\n ImportError = -2,\n}\n","import { CalculateShareMult as CSM } from \"./formulas/share\";\n\nexport let sharePower = 1;\n\nexport function StartSharing(threads: number): () => void {\n sharePower += threads;\n return () => (sharePower -= threads);\n}\n\nexport function CalculateShareMult(): number {\n return CSM(sharePower);\n}\n","/**\n * The worker agent for running a script instance. Each running script instance\n * has its own underlying WorkerScript object.\n *\n * Note that these objects are not saved and re-loaded when the game is refreshed.\n * Instead, whenever the game is opened, WorkerScripts are re-created from\n * RunningScript objects\n */\nimport { Environment } from \"./Environment\";\nimport { RamCostConstants } from \"./RamCostGenerator\";\n\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { Script } from \"../Script/Script\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { IMap } from \"../types\";\nimport { NS } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { ScriptDeath } from \"./ScriptDeath\";\nimport { ScriptArg } from \"./ScriptArg\";\n\nexport class WorkerScript {\n /**\n * Script's arguments\n */\n args: ScriptArg[];\n\n /**\n * Copy of the script's code\n */\n code = \"\";\n\n /**\n * Holds the timeoutID (numeric value) for whenever this script is blocked by a\n * timed Netscript function. i.e. Holds the return value of setTimeout()\n */\n delay: number | null = null;\n\n /**\n * Holds the Promise reject() function while the script is \"blocked\" by an async op\n */\n delayReject?: (reason?: ScriptDeath) => void;\n\n /**\n * Stores names of all functions that have logging disabled\n */\n disableLogs: IMap = {};\n\n /**\n * Used for dynamic RAM calculation. Stores names of all functions that have\n * already been checked by this script.\n * TODO: Could probably just combine this with loadedFns?\n */\n dynamicLoadedFns: IMap = {};\n\n /**\n * Tracks dynamic RAM usage\n */\n dynamicRamUsage: number = RamCostConstants.ScriptBaseRamCost;\n\n /**\n * Netscript Environment for this script\n */\n env: Environment;\n\n /**\n * Status message in case of script error.\n */\n errorMessage = \"\";\n\n /**\n * Used for static RAM calculation. Stores names of all functions that have\n * already been checked by this script\n */\n loadedFns: IMap = {};\n\n /**\n * Filename of script\n */\n name: string;\n\n /**\n * Script's output/return value. Currently not used or implemented\n */\n output = \"\";\n\n /**\n * Process ID. Must be an integer. Used for efficient script\n * killing and removal.\n */\n pid: number;\n\n /**\n * Script's Static RAM usage. Equivalent to underlying script's RAM usage\n */\n ramUsage = 0;\n\n /**\n * Reference to underlying RunningScript object\n */\n scriptRef: RunningScript;\n\n /**\n * hostname on which this script is running\n */\n hostname: string;\n\n /**\n * Function called when the script ends.\n */\n atExit?: () => void;\n\n constructor(runningScriptObj: RunningScript, pid: number, nsFuncsGenerator?: (ws: WorkerScript) => NS) {\n this.name = runningScriptObj.filename;\n this.hostname = runningScriptObj.server;\n\n const sanitizedPid = Math.round(pid);\n if (typeof sanitizedPid !== \"number\" || isNaN(sanitizedPid)) {\n throw new Error(`Invalid PID when constructing WorkerScript: ${pid}`);\n }\n this.pid = sanitizedPid;\n runningScriptObj.pid = sanitizedPid;\n\n // Get the underlying script's code\n const server = GetServer(this.hostname);\n if (server == null) {\n throw new Error(`WorkerScript constructed with invalid server ip: ${this.hostname}`);\n }\n let found = false;\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === this.name) {\n found = true;\n this.code = server.scripts[i].code;\n }\n }\n if (!found) {\n throw new Error(`WorkerScript constructed with invalid script filename: ${this.name}`);\n }\n this.scriptRef = runningScriptObj;\n this.args = runningScriptObj.args.slice();\n this.env = new Environment();\n if (typeof nsFuncsGenerator === \"function\") {\n this.env.vars = nsFuncsGenerator(this);\n }\n }\n\n /**\n * Returns the Server on which this script is running\n */\n getServer(): BaseServer {\n const server = GetServer(this.hostname);\n if (server == null) throw new Error(`Script ${this.name} pid ${this.pid} is running on non-existent server?`);\n return server;\n }\n\n /**\n * Returns the Script object for the underlying script.\n * Returns null if it cannot be found (which would be a bug)\n */\n getScript(): Script | null {\n const server = this.getServer();\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === this.name) {\n return server.scripts[i];\n }\n }\n\n console.error(\n \"Failed to find underlying Script object in WorkerScript.getScript(). This probably means somethings wrong\",\n );\n return null;\n }\n\n /**\n * Returns the script with the specified filename on the specified server,\n * or null if it cannot be found\n */\n getScriptOnServer(fn: string, server: BaseServer): Script | null {\n if (server == null) {\n server = this.getServer();\n }\n\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === fn) {\n return server.scripts[i];\n }\n }\n\n return null;\n }\n\n shouldLog(fn: string): boolean {\n return this.disableLogs[fn] == null;\n }\n\n log(func: string, txt: () => string): void {\n if (this.shouldLog(func)) {\n if (func && txt) {\n this.scriptRef.log(`${func}: ${txt()}`);\n } else if (func) {\n this.scriptRef.log(func);\n } else {\n this.scriptRef.log(txt());\n }\n }\n }\n\n print(txt: string): void {\n this.scriptRef.log(txt);\n }\n}\n","/**\n * Sleeves are bodies that contain the player's cloned consciousness.\n * The player can use these bodies to perform different tasks synchronously.\n *\n * Each sleeve is its own individual, meaning it has its own stats/exp\n *\n * Sleeves are unlocked in BitNode-10.\n */\n\nimport { IPlayer } from \"../IPlayer\";\nimport { Person } from \"../Person\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { Crime } from \"../../Crime/Crime\";\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { Company } from \"../../Company/Company\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../utils/JSONReviver\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { FactionWorkType } from \"../../Work/data/FactionWorkType\";\nimport { Work } from \"./Work/Work\";\nimport { SleeveClassWork } from \"./Work/SleeveClassWork\";\nimport { ClassType } from \"../../Work/ClassWork\";\nimport { SleeveSynchroWork } from \"./Work/SleeveSynchroWork\";\nimport { SleeveRecoveryWork } from \"./Work/SleeveRecoveryWork\";\nimport { SleeveFactionWork } from \"./Work/SleeveFactionWork\";\nimport { SleeveCompanyWork } from \"./Work/SleeveCompanyWork\";\nimport { SleeveInfiltrateWork } from \"./Work/SleeveInfiltrateWork\";\nimport { SleeveSupportWork } from \"./Work/SleeveSupportWork\";\nimport { SleeveBladeburnerWork } from \"./Work/SleeveBladeburnerWork\";\nimport { SleeveCrimeWork } from \"./Work/SleeveCrimeWork\";\n\nexport class Sleeve extends Person {\n currentWork: Work | null = null;\n\n /**\n * Clone retains 'memory' synchronization (and maybe exp?) upon prestige/installing Augs\n */\n memory = 1;\n\n /**\n * Sleeve shock. Number between 0 and 100\n * Trauma/shock that comes with being in a sleeve. Experience earned\n * is multipled by shock%. This gets applied before synchronization\n *\n * Reputation earned is also multiplied by shock%\n */\n shock = 1;\n\n /**\n * Stored number of game \"loop\" cycles\n */\n storedCycles = 0;\n\n /**\n * Synchronization. Number between 0 and 100\n * When experience is earned by sleeve, both the player and the sleeve get\n * sync% of the experience earned.\n */\n sync = 1;\n\n constructor(p: IPlayer | null = null) {\n super();\n if (p != null) {\n this.shockRecovery(p);\n }\n }\n\n shockBonus(): number {\n return this.shock / 100;\n }\n\n syncBonus(): number {\n return this.sync / 100;\n }\n\n startWork(player: IPlayer, w: Work): void {\n if (this.currentWork) this.currentWork.finish(player);\n this.currentWork = w;\n }\n\n stopWork(player: IPlayer): void {\n if (this.currentWork) this.currentWork.finish(player);\n this.currentWork = null;\n }\n\n /**\n * Commit crimes\n */\n commitCrime(p: IPlayer, crimeKey: string): boolean {\n const crime: Crime | null = Crimes[crimeKey] || Object.values(Crimes).find((crime) => crime.name === crimeKey);\n if (!crime) {\n return false;\n }\n\n this.startWork(p, new SleeveCrimeWork(crime.type));\n return true;\n }\n\n /**\n * Returns the cost of upgrading this sleeve's memory by a certain amount\n */\n getMemoryUpgradeCost(n: number): number {\n const amt = Math.round(n);\n if (amt < 0) {\n return 0;\n }\n\n if (this.memory + amt > 100) {\n return this.getMemoryUpgradeCost(100 - this.memory);\n }\n\n const mult = 1.02;\n const baseCost = 1e12;\n let currCost = 0;\n let currMemory = this.memory - 1;\n for (let i = 0; i < n; ++i) {\n currCost += Math.pow(mult, currMemory);\n ++currMemory;\n }\n\n return currCost * baseCost;\n }\n\n installAugmentation(aug: Augmentation): void {\n this.exp.hacking = 0;\n this.exp.strength = 0;\n this.exp.defense = 0;\n this.exp.dexterity = 0;\n this.exp.agility = 0;\n this.exp.charisma = 0;\n this.applyAugmentation(aug);\n this.augmentations.push({ name: aug.name, level: 1 });\n this.updateStatLevels();\n }\n\n /**\n * Called on every sleeve for a Source File Prestige\n */\n prestige(p: IPlayer): void {\n // Reset exp\n this.exp.hacking = 0;\n this.exp.strength = 0;\n this.exp.defense = 0;\n this.exp.dexterity = 0;\n this.exp.agility = 0;\n this.exp.charisma = 0;\n this.updateStatLevels();\n\n // Reset task-related stuff\n this.stopWork(p);\n this.shockRecovery(p);\n\n // Reset augs and multipliers\n this.augmentations = [];\n this.resetMultipliers();\n\n // Reset Location\n\n this.city = CityName.Sector12;\n\n // Reset sleeve-related stats\n this.shock = 1;\n this.storedCycles = 0;\n this.sync = Math.max(this.memory, 1);\n }\n\n /**\n * Process loop\n * Returns an object containing the amount of experience that should be\n * transferred to all other sleeves\n */\n process(p: IPlayer, numCycles = 1): void {\n // Only process once every second (5 cycles)\n const CyclesPerSecond = 1000 / CONSTANTS.MilliPerCycle;\n this.storedCycles += numCycles;\n if (this.storedCycles < CyclesPerSecond) return;\n\n let cyclesUsed = this.storedCycles;\n cyclesUsed = Math.min(cyclesUsed, 15);\n this.shock = Math.min(100, this.shock + 0.0001 * cyclesUsed);\n if (!this.currentWork) return;\n this.currentWork.process(p, this, cyclesUsed);\n this.storedCycles -= cyclesUsed;\n }\n\n shockRecovery(p: IPlayer): boolean {\n this.startWork(p, new SleeveRecoveryWork());\n return true;\n }\n\n synchronize(p: IPlayer): boolean {\n this.startWork(p, new SleeveSynchroWork());\n return true;\n }\n\n /**\n * Take a course at a university\n */\n takeUniversityCourse(p: IPlayer, universityName: string, className: string): boolean {\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let loc: LocationName | undefined;\n switch (universityName.toLowerCase()) {\n case LocationName.AevumSummitUniversity.toLowerCase(): {\n if (this.city !== CityName.Aevum) return false;\n loc = LocationName.AevumSummitUniversity;\n break;\n }\n case LocationName.Sector12RothmanUniversity.toLowerCase(): {\n if (this.city !== CityName.Sector12) return false;\n loc = LocationName.Sector12RothmanUniversity;\n break;\n }\n case LocationName.VolhavenZBInstituteOfTechnology.toLowerCase(): {\n if (this.city !== CityName.Volhaven) return false;\n loc = LocationName.VolhavenZBInstituteOfTechnology;\n break;\n }\n }\n if (!loc) return false;\n\n // Set experience/money gains based on class\n let classType: ClassType | undefined;\n switch (className.toLowerCase()) {\n case \"study computer science\":\n classType = ClassType.StudyComputerScience;\n break;\n case \"data structures\":\n classType = ClassType.DataStructures;\n break;\n case \"networks\":\n classType = ClassType.Networks;\n break;\n case \"algorithms\":\n classType = ClassType.Algorithms;\n break;\n case \"management\":\n classType = ClassType.Management;\n break;\n case \"leadership\":\n classType = ClassType.Leadership;\n break;\n }\n if (!classType) return false;\n\n this.startWork(\n p,\n new SleeveClassWork({\n classType: classType,\n location: loc,\n }),\n );\n return true;\n }\n\n /**\n * Travel to another City. Costs money from player\n */\n travel(p: IPlayer, newCity: CityName): boolean {\n p.loseMoney(CONSTANTS.TravelCost, \"sleeves\");\n this.city = newCity;\n\n return true;\n }\n\n tryBuyAugmentation(p: IPlayer, aug: Augmentation): boolean {\n if (!p.canAfford(aug.baseCost)) {\n return false;\n }\n\n // Verify that this sleeve does not already have that augmentation.\n if (this.augmentations.some((a) => a.name === aug.name)) {\n return false;\n }\n\n p.loseMoney(aug.baseCost, \"sleeves\");\n this.installAugmentation(aug);\n return true;\n }\n\n upgradeMemory(n: number): void {\n if (n < 0) {\n console.warn(`Sleeve.upgradeMemory() called with negative value: ${n}`);\n return;\n }\n\n this.memory = Math.min(100, Math.round(this.memory + n));\n }\n\n /**\n * Start work for one of the player's companies\n * Returns boolean indicating success\n */\n workForCompany(p: IPlayer, companyName: string): boolean {\n if (!(Companies[companyName] instanceof Company) || p.jobs[companyName] == null) {\n return false;\n }\n\n const company: Company | null = Companies[companyName];\n const companyPosition: CompanyPosition | null = CompanyPositions[p.jobs[companyName]];\n if (company == null) return false;\n if (companyPosition == null) return false;\n\n this.startWork(p, new SleeveCompanyWork({ companyName: companyName }));\n\n return true;\n }\n\n /**\n * Start work for one of the player's factions\n * Returns boolean indicating success\n */\n workForFaction(p: IPlayer, factionName: string, workType: string): boolean {\n const faction = Factions[factionName];\n if (factionName === \"\" || !faction || !(faction instanceof Faction) || !p.factions.includes(factionName)) {\n return false;\n }\n\n const factionInfo = faction.getInfo();\n\n // Set type of work (hacking/field/security), and the experience gains\n const sanitizedWorkType = workType.toLowerCase();\n let factionWorkType: FactionWorkType;\n if (sanitizedWorkType.includes(\"hack\")) {\n if (!factionInfo.offerHackingWork) return false;\n factionWorkType = FactionWorkType.HACKING;\n } else if (sanitizedWorkType.includes(\"field\")) {\n if (!factionInfo.offerFieldWork) return false;\n factionWorkType = FactionWorkType.FIELD;\n } else if (sanitizedWorkType.includes(\"security\")) {\n if (!factionInfo.offerSecurityWork) return false;\n factionWorkType = FactionWorkType.SECURITY;\n } else {\n return false;\n }\n\n this.startWork(\n p,\n new SleeveFactionWork({\n factionWorkType: factionWorkType,\n factionName: faction.name,\n }),\n );\n\n return true;\n }\n\n /**\n * Begin a gym workout task\n */\n workoutAtGym(p: IPlayer, gymName: string, stat: string): boolean {\n // Set exp/money multipliers based on which university.\n // Also check that the sleeve is in the right city\n let loc: LocationName | undefined;\n switch (gymName.toLowerCase()) {\n case LocationName.AevumCrushFitnessGym.toLowerCase(): {\n if (this.city != CityName.Aevum) return false;\n loc = LocationName.AevumCrushFitnessGym;\n break;\n }\n case LocationName.AevumSnapFitnessGym.toLowerCase(): {\n if (this.city != CityName.Aevum) return false;\n loc = LocationName.AevumSnapFitnessGym;\n break;\n }\n case LocationName.Sector12IronGym.toLowerCase(): {\n if (this.city != CityName.Sector12) return false;\n loc = LocationName.Sector12IronGym;\n break;\n }\n case LocationName.Sector12PowerhouseGym.toLowerCase(): {\n if (this.city != CityName.Sector12) return false;\n loc = LocationName.Sector12PowerhouseGym;\n break;\n }\n case LocationName.VolhavenMilleniumFitnessGym.toLowerCase(): {\n if (this.city != CityName.Volhaven) return false;\n loc = LocationName.VolhavenMilleniumFitnessGym;\n break;\n }\n }\n if (!loc) return false;\n\n // Set experience/money gains based on class\n const sanitizedStat: string = stat.toLowerCase();\n\n // set stat to a default value.\n let classType: ClassType | undefined;\n if (sanitizedStat.includes(\"str\")) {\n classType = ClassType.GymStrength;\n }\n if (sanitizedStat.includes(\"def\")) {\n classType = ClassType.GymDefense;\n }\n if (sanitizedStat.includes(\"dex\")) {\n classType = ClassType.GymDexterity;\n }\n if (sanitizedStat.includes(\"agi\")) {\n classType = ClassType.GymAgility;\n }\n // if stat is still equals its default value, then validation has failed.\n if (!classType) return false;\n\n this.startWork(\n p,\n new SleeveClassWork({\n classType: classType,\n location: loc,\n }),\n );\n\n return true;\n }\n\n /**\n * Begin a bladeburner task\n */\n bladeburner(p: IPlayer, action: string, contract: string): boolean {\n switch (action) {\n case \"Field analysis\":\n this.startWork(p, new SleeveBladeburnerWork({ type: \"General\", name: \"Field Analysis\" }));\n return true;\n case \"Recruitment\":\n this.startWork(p, new SleeveBladeburnerWork({ type: \"General\", name: \"Recruitment\" }));\n return true;\n case \"Diplomacy\":\n this.startWork(p, new SleeveBladeburnerWork({ type: \"General\", name: \"Diplomacy\" }));\n return true;\n case \"Infiltrate synthoids\":\n this.startWork(p, new SleeveInfiltrateWork());\n return true;\n case \"Support main sleeve\":\n this.startWork(p, new SleeveSupportWork(p));\n return true;\n case \"Take on contracts\":\n this.startWork(p, new SleeveBladeburnerWork({ type: \"Contracts\", name: contract }));\n return true;\n }\n\n return true;\n }\n\n recruitmentSuccessChance(p: IPlayer): number {\n return Math.max(0, Math.min(1, p.bladeburner?.getRecruitmentSuccessChance(this) ?? 0));\n }\n\n contractSuccessChance(p: IPlayer, type: string, name: string): string {\n const bb = p.bladeburner;\n if (bb === null) {\n const errorLogText = `bladeburner is null`;\n console.error(`Function: sleeves.contractSuccessChance; Message: '${errorLogText}'`);\n return \"0%\";\n }\n const chances = bb.getActionEstimatedSuccessChanceNetscriptFn(this, type, name);\n if (typeof chances === \"string\") {\n console.error(`Function: sleeves.contractSuccessChance; Message: '${chances}'`);\n return \"0%\";\n }\n if (chances[0] >= 1) {\n return \"100%\";\n } else {\n return `${numeralWrapper.formatPercentage(chances[0])} - ${numeralWrapper.formatPercentage(chances[1])}`;\n }\n }\n\n takeDamage(amt: number): boolean {\n if (typeof amt !== \"number\") {\n console.warn(`Player.takeDamage() called without a numeric argument: ${amt}`);\n return false;\n }\n\n this.hp.current -= amt;\n if (this.hp.current <= 0) {\n this.shock = Math.max(0, this.shock - 0.5);\n this.hp.current = this.hp.max;\n return true;\n } else {\n return false;\n }\n }\n\n whoAmI(): string {\n return \"Sleeve\";\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Sleeve\", this);\n }\n\n /**\n * Initiatizes a Sleeve object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Sleeve {\n return Generic_fromJSON(Sleeve, value.data);\n }\n}\n\nReviver.constructors.Sleeve = Sleeve;\n","import { CorporationState } from \"./CorporationState\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"./data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgrades } from \"./data/CorporationUpgrades\";\nimport { Warehouse } from \"./Warehouse\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { Industry } from \"./Industry\";\n\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { showLiterature } from \"../Literature/LiteratureHelpers\";\nimport { LiteratureNames } from \"../Literature/data/LiteratureNames\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { isString } from \"../utils/helpers/isString\";\n\ninterface IParams {\n name?: string;\n}\n\nexport class Corporation {\n name = \"The Corporation\";\n\n //A division/business sector is represented by the object:\n divisions: Industry[] = [];\n\n //Financial stats\n funds = 150e9;\n revenue = 0;\n expenses = 0;\n fundingRound = 0;\n public = false; //Publicly traded\n totalShares = CorporationConstants.INITIALSHARES; // Total existing shares\n numShares = CorporationConstants.INITIALSHARES; // Total shares owned by player\n shareSalesUntilPriceUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n shareSaleCooldown = 0; // Game cycles until player can sell shares again\n issueNewSharesCooldown = 0; // Game cycles until player can issue shares again\n dividendRate = 0;\n dividendTax = 1 - BitNodeMultipliers.CorporationSoftcap + 0.15;\n issuedShares = 0;\n sharePrice = 0;\n storedCycles = 0;\n\n unlockUpgrades: number[];\n upgrades: number[];\n upgradeMultipliers: number[];\n\n avgProfit = 0;\n\n state = new CorporationState();\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"The Corporation\";\n const numUnlockUpgrades = Object.keys(CorporationUnlockUpgrades).length;\n const numUpgrades = Object.keys(CorporationUpgrades).length;\n this.unlockUpgrades = Array(numUnlockUpgrades).fill(0);\n this.upgrades = Array(numUpgrades).fill(0);\n this.upgradeMultipliers = Array(numUpgrades).fill(1);\n }\n\n addFunds(amt: number): void {\n if (!isFinite(amt)) {\n console.error(\"Trying to add invalid amount of funds. Report to a developper.\");\n return;\n }\n this.funds = this.funds + amt;\n }\n\n getState(): string {\n return this.state.getState();\n }\n\n storeCycles(numCycles = 1): void {\n this.storedCycles += numCycles;\n }\n\n process(player: IPlayer): void {\n if (this.storedCycles >= CorporationConstants.CyclesPerIndustryStateCycle) {\n const state = this.getState();\n const marketCycles = 1;\n const gameCycles = marketCycles * CorporationConstants.CyclesPerIndustryStateCycle;\n this.storedCycles -= gameCycles;\n\n this.divisions.forEach((ind) => {\n ind.process(marketCycles, state, this);\n });\n\n // Process cooldowns\n if (this.shareSaleCooldown > 0) {\n this.shareSaleCooldown -= gameCycles;\n }\n if (this.issueNewSharesCooldown > 0) {\n this.issueNewSharesCooldown -= gameCycles;\n }\n\n //At the start of a new cycle, calculate profits from previous cycle\n if (state === \"START\") {\n this.revenue = 0;\n this.expenses = 0;\n this.divisions.forEach((ind) => {\n if (ind.lastCycleRevenue === -Infinity || ind.lastCycleRevenue === Infinity) {\n return;\n }\n if (ind.lastCycleExpenses === -Infinity || ind.lastCycleExpenses === Infinity) {\n return;\n }\n this.revenue = this.revenue + ind.lastCycleRevenue;\n this.expenses = this.expenses + ind.lastCycleExpenses;\n });\n const profit = this.revenue - this.expenses;\n this.avgProfit =\n (this.avgProfit * (CorporationConstants.AvgProfitLength - 1) + profit) / CorporationConstants.AvgProfitLength;\n const cycleProfit = profit * (marketCycles * CorporationConstants.SecsPerMarketCycle);\n if (isNaN(this.funds) || this.funds === Infinity || this.funds === -Infinity) {\n dialogBoxCreate(\n \"There was an error calculating your Corporations funds and they got reset to 0. \" +\n \"This is a bug. Please report to game developer.

\" +\n \"(Your funds have been set to $150b for the inconvenience)\",\n );\n this.funds = 150e9;\n }\n\n // Process dividends\n this.updateDividendTax();\n if (this.dividendRate > 0 && cycleProfit > 0) {\n // Validate input again, just to be safe\n if (\n isNaN(this.dividendRate) ||\n this.dividendRate < 0 ||\n this.dividendRate > CorporationConstants.DividendMaxRate\n ) {\n console.error(`Invalid Corporation dividend rate: ${this.dividendRate}`);\n } else {\n const totalDividends = this.dividendRate * cycleProfit;\n const retainedEarnings = cycleProfit - totalDividends;\n player.gainMoney(this.getCycleDividends(), \"corporation\");\n this.addFunds(retainedEarnings);\n }\n } else {\n this.addFunds(cycleProfit);\n }\n\n this.updateSharePrice();\n }\n\n this.state.nextState();\n }\n }\n\n updateDividendTax(): void {\n this.dividendTax = 1 - BitNodeMultipliers.CorporationSoftcap + 0.15;\n if (this.unlockUpgrades[5] === 1) {\n this.dividendTax -= 0.05;\n }\n if (this.unlockUpgrades[6] === 1) {\n this.dividendTax -= 0.1;\n }\n }\n\n getCycleDividends(): number {\n const profit = this.revenue - this.expenses;\n const cycleProfit = profit * CorporationConstants.SecsPerMarketCycle;\n const totalDividends = this.dividendRate * cycleProfit;\n const dividendsPerShare = totalDividends / this.totalShares;\n const dividends = this.numShares * dividendsPerShare;\n return Math.pow(dividends, 1 - this.dividendTax);\n }\n\n determineValuation(): number {\n let val,\n profit = this.avgProfit;\n if (this.public) {\n // Account for dividends\n if (this.dividendRate > 0) {\n profit *= 1 - this.dividendRate;\n }\n\n val = this.funds + profit * 85e3;\n val *= Math.pow(1.1, this.divisions.length);\n val = Math.max(val, 0);\n } else {\n val = 10e9 + Math.max(this.funds, 0) / 3; //Base valuation\n if (profit > 0) {\n val += profit * 315e3;\n val *= Math.pow(1.1, this.divisions.length);\n } else {\n val = 10e9 * Math.pow(1.1, this.divisions.length);\n }\n val -= val % 1e6; //Round down to nearest millionth\n }\n return val * BitNodeMultipliers.CorporationValuation;\n }\n\n getTargetSharePrice(): number {\n // Note: totalShares - numShares is not the same as issuedShares because\n // issuedShares does not account for private investors\n return this.determineValuation() / (2 * (this.totalShares - this.numShares) + 1);\n }\n\n updateSharePrice(): void {\n const targetPrice = this.getTargetSharePrice();\n if (this.sharePrice <= targetPrice) {\n this.sharePrice *= 1 + Math.random() * 0.01;\n } else {\n this.sharePrice *= 1 - Math.random() * 0.01;\n }\n if (this.sharePrice <= 0.01) {\n this.sharePrice = 0.01;\n }\n }\n\n immediatelyUpdateSharePrice(): void {\n this.sharePrice = this.getTargetSharePrice();\n }\n\n // Calculates how much money will be made and what the resulting stock price\n // will be when the player sells his/her shares\n // @return - [Player profit, final stock price, end shareSalesUntilPriceUpdate property]\n calculateShareSale(numShares: number): [number, number, number] {\n let sharesTracker = numShares;\n let sharesUntilUpdate = this.shareSalesUntilPriceUpdate;\n let sharePrice = this.sharePrice;\n let sharesSold = 0;\n let profit = 0;\n\n const maxIterations = Math.ceil(numShares / CorporationConstants.SHARESPERPRICEUPDATE);\n if (isNaN(maxIterations) || maxIterations > 10e6) {\n console.error(\n `Something went wrong or unexpected when calculating share sale. Maxiterations calculated to be ${maxIterations}`,\n );\n return [0, 0, 0];\n }\n\n for (let i = 0; i < maxIterations; ++i) {\n if (sharesTracker < sharesUntilUpdate) {\n profit += sharePrice * sharesTracker;\n sharesUntilUpdate -= sharesTracker;\n break;\n } else {\n profit += sharePrice * sharesUntilUpdate;\n sharesUntilUpdate = CorporationConstants.SHARESPERPRICEUPDATE;\n sharesTracker -= sharesUntilUpdate;\n sharesSold += sharesUntilUpdate;\n\n // Calculate what new share price would be\n sharePrice = this.determineValuation() / (2 * (this.totalShares + sharesSold - this.numShares));\n }\n }\n\n return [profit, sharePrice, sharesUntilUpdate];\n }\n\n convertCooldownToString(cd: number): string {\n // The cooldown value is based on game cycles. Convert to a simple string\n const seconds = cd / 5;\n\n const SecondsPerMinute = 60;\n const SecondsPerHour = 3600;\n\n if (seconds > SecondsPerHour) {\n return `${Math.floor(seconds / SecondsPerHour)} hour(s)`;\n } else if (seconds > SecondsPerMinute) {\n return `${Math.floor(seconds / SecondsPerMinute)} minute(s)`;\n } else {\n return `${Math.floor(seconds)} second(s)`;\n }\n }\n\n //One time upgrades that unlock new features\n unlock(upgrade: CorporationUnlockUpgrade): void {\n const upgN = upgrade.index,\n price = upgrade.price;\n while (this.unlockUpgrades.length <= upgN) {\n this.unlockUpgrades.push(0);\n }\n if (this.funds < price) {\n dialogBoxCreate(\"You don't have enough funds to unlock this!\");\n return;\n }\n this.unlockUpgrades[upgN] = 1;\n this.funds = this.funds - price;\n\n // Apply effects for one-time upgrades\n this.updateDividendTax();\n }\n\n //Levelable upgrades\n upgrade(upgrade: CorporationUpgrade): void {\n const upgN = upgrade.index,\n basePrice = upgrade.basePrice,\n priceMult = upgrade.priceMult,\n upgradeAmt = upgrade.benefit; //Amount by which the upgrade multiplier gets increased (additive)\n while (this.upgrades.length <= upgN) {\n this.upgrades.push(0);\n }\n while (this.upgradeMultipliers.length <= upgN) {\n this.upgradeMultipliers.push(1);\n }\n const totalCost = basePrice * Math.pow(priceMult, this.upgrades[upgN]);\n if (this.funds < totalCost) {\n dialogBoxCreate(\"You don't have enough funds to purchase this!\");\n return;\n }\n ++this.upgrades[upgN];\n this.funds = this.funds - totalCost;\n\n //Increase upgrade multiplier\n this.upgradeMultipliers[upgN] = 1 + this.upgrades[upgN] * upgradeAmt;\n\n //If storage size is being updated, update values in Warehouse objects\n if (upgN === 1) {\n for (let i = 0; i < this.divisions.length; ++i) {\n const industry = this.divisions[i];\n for (const city of Object.keys(industry.warehouses)) {\n const warehouse = industry.warehouses[city];\n if (warehouse === 0) continue;\n if (industry.warehouses.hasOwnProperty(city) && warehouse instanceof Warehouse) {\n warehouse.updateSize(this, industry);\n }\n }\n }\n }\n }\n\n getProductionMultiplier(): number {\n const mult = this.upgradeMultipliers[0];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getStorageMultiplier(): number {\n const mult = this.upgradeMultipliers[1];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getDreamSenseGain(): number {\n const gain = this.upgradeMultipliers[2] - 1;\n return gain <= 0 ? 0 : gain;\n }\n\n getAdvertisingMultiplier(): number {\n const mult = this.upgradeMultipliers[3];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeCreMultiplier(): number {\n const mult = this.upgradeMultipliers[4];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeChaMultiplier(): number {\n const mult = this.upgradeMultipliers[5];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeIntMultiplier(): number {\n const mult = this.upgradeMultipliers[6];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getEmployeeEffMultiplier(): number {\n const mult = this.upgradeMultipliers[7];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getSalesMultiplier(): number {\n const mult = this.upgradeMultipliers[8];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n getScientificResearchMultiplier(): number {\n const mult = this.upgradeMultipliers[9];\n if (isNaN(mult) || mult < 1) {\n return 1;\n } else {\n return mult;\n }\n }\n\n // Adds the Corporation Handbook (Starter Guide) to the player's home computer.\n // This is a lit file that gives introductory info to the player\n // This occurs when the player clicks the \"Getting Started Guide\" button on the overview panel\n getStarterGuide(player: IPlayer): void {\n // Check if player already has Corporation Handbook\n const homeComp = player.getHomeComputer();\n let hasHandbook = false;\n const handbookFn = LiteratureNames.CorporationManagementHandbook;\n for (let i = 0; i < homeComp.messages.length; ++i) {\n if (isString(homeComp.messages[i]) && homeComp.messages[i] === handbookFn) {\n hasHandbook = true;\n break;\n }\n }\n\n if (!hasHandbook) {\n homeComp.messages.push(handbookFn);\n }\n showLiterature(handbookFn);\n return;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Corporation\", this);\n }\n\n /**\n * Initiatizes a Corporation object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Corporation {\n return Generic_fromJSON(Corporation, value.data);\n }\n}\n\nReviver.constructors.Corporation = Corporation;\n","import { BladeburnerConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\n\ninterface IChangePopulationByCountParams {\n estChange: number;\n estOffset: number;\n}\n\ninterface IChangePopulationByPercentageParams {\n nonZero: boolean;\n changeEstEqually: boolean;\n}\n\nexport class City {\n /**\n * Name of the city.\n */\n name = \"\";\n\n /**\n * Population of the city.\n */\n pop = 0;\n\n /**\n * Population estimation of the city.\n */\n popEst = 0;\n\n /**\n * Number of communities in the city.\n */\n comms = 0;\n\n /**\n * Chaos level of the city.\n */\n chaos = 0;\n\n constructor(name: string = BladeburnerConstants.CityNames[2]) {\n this.name = name;\n\n // Synthoid population and estimate\n this.pop = getRandomInt(BladeburnerConstants.PopulationThreshold, 1.5 * BladeburnerConstants.PopulationThreshold);\n this.popEst = this.pop * (Math.random() + 0.5);\n\n // Number of Synthoid communities population and estimate\n this.comms = getRandomInt(5, 150);\n this.chaos = 0;\n }\n\n /**\n * p is the percentage, not the multiplier (e.g. pass in p = 5 for 5%)\n */\n changeChaosByPercentage(p: number): void {\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.chaosChaosByPercentage()\");\n }\n if (p === 0) {\n return;\n }\n this.chaos += this.chaos * (p / 100);\n if (this.chaos < 0) {\n this.chaos = 0;\n }\n }\n\n improvePopulationEstimateByCount(n: number): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passeed into City.improvePopulationEstimateByCount()\");\n }\n if (this.popEst < this.pop) {\n this.popEst += n;\n if (this.popEst > this.pop) {\n this.popEst = this.pop;\n }\n } else if (this.popEst > this.pop) {\n this.popEst -= n;\n if (this.popEst < this.pop) {\n this.popEst = this.pop;\n }\n }\n }\n\n /**\n * p is the percentage, not the multiplier (e.g. pass in p = 5 for 5%)\n */\n improvePopulationEstimateByPercentage(p: number, skillMult = 1): void {\n p = p * skillMult;\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.improvePopulationEstimateByPercentage()\");\n }\n if (this.popEst < this.pop) {\n ++this.popEst; // In case estimate is 0\n this.popEst *= 1 + p / 100;\n if (this.popEst > this.pop) {\n this.popEst = this.pop;\n }\n } else if (this.popEst > this.pop) {\n this.popEst *= 1 - p / 100;\n if (this.popEst < this.pop) {\n this.popEst = this.pop;\n }\n }\n }\n\n /**\n * @params options:\n * estChange(int): How much the estimate should change by\n * estOffset(int): Add offset to estimate (offset by percentage)\n */\n changePopulationByCount(n: number, params: IChangePopulationByCountParams = { estChange: 0, estOffset: 0 }): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.changePopulationByCount()\");\n }\n this.pop += n;\n if (params.estChange && !isNaN(params.estChange)) {\n this.popEst += params.estChange;\n }\n if (params.estOffset) {\n this.popEst = addOffset(this.popEst, params.estOffset);\n }\n this.popEst = Math.max(this.popEst, 0);\n }\n\n /**\n * @p is the percentage, not the multiplier. e.g. pass in p = 5 for 5%\n * @params options:\n * changeEstEqually(bool) - Change the population estimate by an equal amount\n * nonZero (bool) - Set to true to ensure that population always changes by at least 1\n */\n changePopulationByPercentage(\n p: number,\n params: IChangePopulationByPercentageParams = {\n nonZero: false,\n changeEstEqually: false,\n },\n ): number {\n if (isNaN(p)) {\n throw new Error(\"NaN passed into City.changePopulationByPercentage()\");\n }\n if (p === 0) {\n return 0;\n }\n let change = Math.round(this.pop * (p / 100));\n\n // Population always changes by at least 1\n if (params.nonZero && change === 0) {\n p > 0 ? (change = 1) : (change = -1);\n }\n\n this.pop += change;\n if (params.changeEstEqually) {\n this.popEst += change;\n if (this.popEst < 0) {\n this.popEst = 0;\n }\n }\n return change;\n }\n\n changeChaosByCount(n: number): void {\n if (isNaN(n)) {\n throw new Error(\"NaN passed into City.changeChaosByCount()\");\n }\n if (n === 0) {\n return;\n }\n this.chaos += n;\n if (this.chaos < 0) {\n this.chaos = 0;\n }\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"City\", this);\n }\n\n /**\n * Initiatizes a City object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): City {\n return Generic_fromJSON(City, value.data);\n }\n}\n\nReviver.constructors.City = City;\n","/**\n * Class representing a City in the game\n */\nimport { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\n\nexport class City {\n /**\n * List of all locations in this city\n */\n locations: LocationName[];\n\n /**\n * Name of this city\n */\n name: CityName;\n\n /**\n * Metro map ascii art\n */\n asciiArt: string;\n\n constructor(name: CityName, locations: LocationName[] = [], asciiArt = \"\") {\n this.name = name;\n this.locations = locations;\n this.asciiArt = asciiArt;\n }\n\n addLocation(loc: LocationName): void {\n this.locations.push(loc);\n }\n}\n","import { Slider, Tooltip, Typography, Box } from \"@mui/material\";\nimport React, { useState } from \"react\";\n\ninterface IProps {\n initialValue: number;\n callback: (event: Event | React.SyntheticEvent, newValue: number | number[]) => void;\n step: number;\n min: number;\n max: number;\n tooltip: React.ReactElement;\n label: string;\n marks?: boolean;\n}\n\nexport const OptionsSlider = (props: IProps): React.ReactElement => {\n const [value, setValue] = useState(props.initialValue);\n\n const onChange = (_evt: Event, newValue: number | Array): void => {\n if (typeof newValue === \"number\") setValue(newValue);\n };\n\n return (\n \n {props.tooltip}}>\n {props.label}\n \n \n \n );\n};\n","/**\n * React component for the tickers configuration section of the Stock Market UI.\n * This config lets you change the way stock tickers are displayed (watchlist,\n * all/portoflio mode, etc)\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\nexport enum TickerDisplayMode {\n AllStocks,\n Portfolio,\n}\n\ntype IProps = {\n changeDisplayMode: () => void;\n changeWatchlistFilter: (e: React.ChangeEvent) => void;\n tickerDisplayMode: TickerDisplayMode;\n};\n\nfunction DisplayModeButton(props: IProps): React.ReactElement {\n let txt = \"\";\n let tooltip = \"\";\n if (props.tickerDisplayMode === TickerDisplayMode.Portfolio) {\n txt = \"Switch to 'All Stocks' Mode\";\n tooltip = \"Displays all stocks on the WSE\";\n } else {\n txt = \"Switch to 'Portfolio' Mode\";\n tooltip = \"Displays only the stocks for which you have shares or orders\";\n }\n\n return (\n {tooltip}}>\n \n \n );\n}\n\nexport function StockTickersConfig(props: IProps): React.ReactElement {\n return (\n <>\n \n
\n \n \n );\n}\n","/**\n * Server and HacknetServer-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { CONSTANTS } from \"../../Constants\";\n\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer, AddToAllServers, createUniqueRandomIp } from \"../../Server/AllServers\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\n\nexport function hasTorRouter(this: IPlayer): boolean {\n return this.getHomeComputer().serversOnNetwork.includes(SpecialServers.DarkWeb);\n}\n\nexport function getCurrentServer(this: IPlayer): BaseServer {\n const server = GetServer(this.currentServer);\n if (server === null) throw new Error(`somehow connected to a server that does not exist. ${this.currentServer}`);\n return server;\n}\n\nexport function getHomeComputer(this: IPlayer): Server {\n const home = GetServer(\"home\");\n if (home instanceof Server) return home;\n throw new Error(\"home computer was not a normal server\");\n}\n\nexport function getUpgradeHomeRamCost(this: IPlayer): number {\n //Calculate how many times ram has been upgraded (doubled)\n const currentRam = this.getHomeComputer().maxRam;\n const numUpgrades = Math.log2(currentRam);\n\n //Calculate cost\n //Have cost increase by some percentage each time RAM has been upgraded\n const mult = Math.pow(1.58, numUpgrades);\n const cost = currentRam * CONSTANTS.BaseCostFor1GBOfRamHome * mult * BitNodeMultipliers.HomeComputerRamCost;\n return cost;\n}\n\nexport function getUpgradeHomeCoresCost(this: IPlayer): number {\n return 1e9 * Math.pow(7.5, this.getHomeComputer().cpuCores);\n}\n\nexport function createHacknetServer(this: IPlayer): HacknetServer {\n const numOwned = this.hacknetNodes.length;\n const name = `hacknet-node-${numOwned}`;\n const server = new HacknetServer({\n adminRights: true,\n hostname: name,\n ip: createUniqueRandomIp(),\n // player: this,\n });\n this.hacknetNodes.push(server.hostname);\n\n // Configure the HacknetServer to actually act as a Server\n AddToAllServers(server);\n const homeComputer = this.getHomeComputer();\n homeComputer.serversOnNetwork.push(server.hostname);\n server.serversOnNetwork.push(SpecialServers.Home);\n\n return server;\n}\n","import { FactionNames } from \"./Faction/data/FactionNames\";\nimport { CityName } from \"./Locations/data/CityNames\";\nimport { StaticAugmentations } from \"./Augmentation/StaticAugmentations\";\nimport { augmentationExists, initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { Companies, initCompanies } from \"./Company/Companies\";\nimport { resetIndustryResearchTrees } from \"./Corporation/IndustryData\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Faction } from \"./Faction/Faction\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { joinFaction } from \"./Faction/FactionHelpers\";\nimport { updateHashManagerCapacity } from \"./Hacknet/HacknetHelpers\";\nimport { prestigeWorkerScripts } from \"./NetscriptWorker\";\nimport { Player } from \"./Player\";\nimport { Router } from \"./ui/GameRoot\";\nimport { recentScripts } from \"./Netscript/RecentScripts\";\nimport { resetPidCounter } from \"./Netscript/Pid\";\nimport { LiteratureNames } from \"./Literature/data/LiteratureNames\";\n\nimport { GetServer, AddToAllServers, initForeignServers, prestigeAllServers } from \"./Server/AllServers\";\nimport { prestigeHomeComputer } from \"./Server/ServerHelpers\";\nimport { SpecialServers } from \"./Server/data/SpecialServers\";\nimport { deleteStockMarket, initStockMarket, initSymbolToStockMap } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\n\nimport { staneksGift } from \"./CotMG/Helper\";\nimport { ProgramsSeen } from \"./Programs/ui/ProgramsRoot\";\nimport { InvitationsSeen } from \"./Faction/ui/FactionsRoot\";\nimport { CONSTANTS } from \"./Constants\";\nimport { LogBoxClearEvents } from \"./ui/React/LogBoxManager\";\n\nconst BitNode8StartingMoney = 250e6;\n\n// Prestige by purchasing augmentation\nexport function prestigeAugmentation(): void {\n initBitNodeMultipliers(Player);\n\n const maintainMembership = Player.factions.concat(Player.factionInvitations).filter(function (faction) {\n return Factions[faction].getInfo().keep;\n });\n Player.prestigeAugmentation();\n\n // Delete all Worker Scripts objects\n prestigeWorkerScripts();\n\n const homeComp = Player.getHomeComputer();\n // Delete all servers except home computer\n prestigeAllServers();\n\n // Reset home computer (only the programs) and add to AllServers\n AddToAllServers(homeComp);\n prestigeHomeComputer(Player, homeComp);\n\n if (augmentationExists(AugmentationNames.Neurolink) && Player.hasAugmentation(AugmentationNames.Neurolink)) {\n homeComp.programs.push(Programs.FTPCrackProgram.name);\n homeComp.programs.push(Programs.RelaySMTPProgram.name);\n }\n if (augmentationExists(AugmentationNames.CashRoot) && Player.hasAugmentation(AugmentationNames.CashRoot)) {\n Player.setMoney(1e6);\n homeComp.programs.push(Programs.BruteSSHProgram.name);\n }\n if (augmentationExists(AugmentationNames.PCMatrix) && Player.hasAugmentation(AugmentationNames.PCMatrix)) {\n homeComp.programs.push(Programs.DeepscanV1.name);\n homeComp.programs.push(Programs.AutoLink.name);\n }\n\n if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {\n homeComp.programs.push(Programs.Formulas.name);\n }\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n // Gain favor for Companies\n for (const member of Object.keys(Companies)) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].gainFavor();\n }\n }\n\n // Gain favor for factions\n for (const member of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].gainFavor();\n }\n }\n\n // Stop a Terminal action if there is one.\n if (Terminal.action !== null) {\n Terminal.finishAction(Router, Player, true);\n }\n Terminal.clear();\n LogBoxClearEvents.emit();\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n\n Player.factionInvitations = Player.factionInvitations.concat(maintainMembership);\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n // Apply entropy from grafting\n Player.applyEntropy(Player.entropy);\n\n // Gang\n const gang = Player.gang;\n if (Player.inGang() && gang !== null) {\n const faction = Factions[gang.facName];\n if (faction instanceof Faction) {\n joinFaction(faction);\n }\n const penalty = 0.95;\n for (const m of gang.members) {\n m.hack_asc_points *= penalty;\n m.str_asc_points *= penalty;\n m.def_asc_points *= penalty;\n m.dex_asc_points *= penalty;\n m.agi_asc_points *= penalty;\n m.cha_asc_points *= penalty;\n }\n }\n\n // BitNode 3: Corporatocracy\n if (Player.bitNodeN === 3) {\n homeComp.messages.push(LiteratureNames.CorporationManagementHandbook);\n }\n\n // Cancel Bladeburner action\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.prestige();\n }\n\n // BitNode 8: Ghost of Wall Street\n if (Player.bitNodeN === 8) {\n Player.money = BitNode8StartingMoney;\n }\n if (Player.bitNodeN === 8 || Player.sourceFileLvl(8) > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Reset Stock market\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n }\n\n // Red Pill\n if (augmentationExists(AugmentationNames.TheRedPill) && Player.hasAugmentation(AugmentationNames.TheRedPill)) {\n const WorldDaemon = GetServer(SpecialServers.WorldDaemon);\n const DaedalusServer = GetServer(SpecialServers.DaedalusServer);\n if (WorldDaemon && DaedalusServer) {\n WorldDaemon.serversOnNetwork.push(DaedalusServer.hostname);\n DaedalusServer.serversOnNetwork.push(WorldDaemon.hostname);\n }\n }\n\n if (augmentationExists(AugmentationNames.StaneksGift1) && Player.hasAugmentation(AugmentationNames.StaneksGift1)) {\n joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);\n }\n\n staneksGift.prestigeAugmentation();\n\n resetPidCounter();\n ProgramsSeen.splice(0, ProgramsSeen.length);\n InvitationsSeen.splice(0, InvitationsSeen.length);\n}\n\n// Prestige by destroying Bit Node and gaining a Source File\nexport function prestigeSourceFile(flume: boolean): void {\n initBitNodeMultipliers(Player);\n\n Player.prestigeSourceFile();\n prestigeWorkerScripts(); // Delete all Worker Scripts objects\n\n const homeComp = Player.getHomeComputer();\n\n // Stop a Terminal action if there is one.\n if (Terminal.action !== null) {\n Terminal.finishAction(Router, Player, true);\n }\n Terminal.clear();\n LogBoxClearEvents.emit();\n\n // Delete all servers except home computer\n prestigeAllServers(); // Must be done before initForeignServers()\n\n // Reset home computer (only the programs) and add to AllServers\n AddToAllServers(homeComp);\n prestigeHomeComputer(Player, homeComp);\n\n // Re-create foreign servers\n initForeignServers(Player.getHomeComputer());\n\n if (Player.sourceFileLvl(9) >= 2) {\n homeComp.setMaxRam(128);\n } else if (Player.sourceFileLvl(1) > 0) {\n homeComp.setMaxRam(32);\n } else {\n homeComp.setMaxRam(8);\n }\n homeComp.cpuCores = 1;\n\n // Reset favor for Companies\n for (const member of Object.keys(Companies)) {\n if (Companies.hasOwnProperty(member)) {\n Companies[member].favor = 0;\n }\n }\n\n // Reset favor for factions\n for (const member of Object.keys(Factions)) {\n if (Factions.hasOwnProperty(member)) {\n Factions[member].favor = 0;\n }\n }\n\n // Stop a Terminal action if there is one\n if (Terminal.action !== null) {\n Terminal.finishAction(Router, Player, true);\n }\n\n // Delete all Augmentations\n for (const name of Object.keys(StaticAugmentations)) {\n if (StaticAugmentations.hasOwnProperty(name)) {\n delete StaticAugmentations[name];\n }\n }\n\n // Give levels of NeuroFluxGoverner for Source-File 12. Must be done here before Augmentations are recalculated\n if (Player.sourceFileLvl(12) > 0) {\n Player.augmentations.push({\n name: AugmentationNames.NeuroFluxGovernor,\n level: Player.sourceFileLvl(12),\n });\n }\n\n // Re-initialize things - This will update any changes\n initFactions(); // Factions must be initialized before augmentations\n initAugmentations(); // Calls reapplyAllAugmentations() and resets Player multipliers\n Player.reapplyAllSourceFiles();\n initCompanies();\n\n if (Player.sourceFileLvl(5) > 0 || Player.bitNodeN === 5) {\n homeComp.programs.push(Programs.Formulas.name);\n }\n\n // BitNode 3: Corporatocracy\n if (Player.bitNodeN === 3) {\n homeComp.messages.push(LiteratureNames.CorporationManagementHandbook);\n dialogBoxCreate(\n \"You received a copy of the Corporation Management Handbook on your home computer. \" +\n \"Read it if you need help getting started with Corporations!\",\n );\n }\n\n // BitNode 8: Ghost of Wall Street\n if (Player.bitNodeN === 8) {\n Player.money = BitNode8StartingMoney;\n }\n if (Player.bitNodeN === 8 || Player.sourceFileLvl(8) > 0) {\n Player.hasWseAccount = true;\n Player.hasTixApiAccess = true;\n }\n\n // Bit Node 10: Digital Carbon\n if (Player.bitNodeN === 10) {\n dialogBoxCreate(\"Visit VitaLife in New Tokyo if you'd like to purchase a new sleeve!\");\n }\n\n if (Player.bitNodeN === 13) {\n dialogBoxCreate(`Trouble is brewing in ${CityName.Chongqing}`);\n }\n\n // Reset Stock market, gang, and corporation\n if (Player.hasWseAccount) {\n initStockMarket();\n initSymbolToStockMap();\n } else {\n deleteStockMarket();\n }\n\n Player.gang = null;\n Player.corporation = null;\n resetIndustryResearchTrees();\n Player.bladeburner = null;\n\n // Source-File 9 (level 3) effect\n if (Player.sourceFileLvl(9) >= 3) {\n const hserver = Player.createHacknetServer();\n\n hserver.level = 100;\n hserver.cores = 10;\n hserver.cache = 5;\n hserver.updateHashRate(Player.mults.hacknet_node_money);\n hserver.updateHashCapacity();\n updateHashManagerCapacity(Player);\n }\n\n if (Player.bitNodeN === 13) {\n Player.money = CONSTANTS.TravelCost;\n }\n staneksGift.prestigeSourceFile();\n\n // Gain int exp\n if (Player.sourceFileLvl(5) !== 0 && !flume) Player.gainIntelligenceExp(300);\n\n // Clear recent scripts\n recentScripts.splice(0, recentScripts.length);\n resetPidCounter();\n}\n","import { Player } from \"../Player\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { addOffset } from \"../utils/helpers/addOffset\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { BladeburnerConstants } from \"./data/Constants\";\nimport { IBladeburner } from \"./IBladeburner\";\nimport { IAction, ISuccessChanceParams } from \"./IAction\";\nimport { IPerson } from \"../PersonObjects/IPerson\";\n\nclass StatsMultiplier {\n [key: string]: number;\n\n hack = 0;\n str = 0;\n def = 0;\n dex = 0;\n agi = 0;\n cha = 0;\n int = 0;\n}\n\nexport interface IActionParams {\n name?: string;\n level?: number;\n maxLevel?: number;\n autoLevel?: boolean;\n baseDifficulty?: number;\n difficultyFac?: number;\n rewardFac?: number;\n successes?: number;\n failures?: number;\n rankGain?: number;\n rankLoss?: number;\n hpLoss?: number;\n hpLost?: number;\n isStealth?: boolean;\n isKill?: boolean;\n count?: number;\n weights?: StatsMultiplier;\n decays?: StatsMultiplier;\n teamCount?: number;\n}\n\nexport class Action implements IAction {\n name = \"\";\n\n // Difficulty scales with level. See getDifficulty() method\n level = 1;\n maxLevel = 1;\n autoLevel = true;\n baseDifficulty = 100;\n difficultyFac = 1.01;\n\n // Rank increase/decrease is affected by this exponent\n rewardFac = 1.02;\n\n successes = 0;\n failures = 0;\n\n // All of these scale with level/difficulty\n rankGain = 0;\n rankLoss = 0;\n hpLoss = 0;\n hpLost = 0;\n\n // Action Category. Current categories are stealth and kill\n isStealth = false;\n isKill = false;\n\n /**\n * Number of this contract remaining, and its growth rate\n * Growth rate is an integer and the count will increase by that integer every \"cycle\"\n */\n count: number = getRandomInt(1e3, 25e3);\n\n // Weighting of each stat in determining action success rate\n weights: StatsMultiplier = {\n hack: 1 / 7,\n str: 1 / 7,\n def: 1 / 7,\n dex: 1 / 7,\n agi: 1 / 7,\n cha: 1 / 7,\n int: 1 / 7,\n };\n // Diminishing returns of stats (stat ^ decay where 0 <= decay <= 1)\n decays: StatsMultiplier = {\n hack: 0.9,\n str: 0.9,\n def: 0.9,\n dex: 0.9,\n agi: 0.9,\n cha: 0.9,\n int: 0.9,\n };\n teamCount = 0;\n\n // Base Class for Contracts, Operations, and BlackOps\n constructor(params: IActionParams | null = null) {\n // | null = null\n if (params && params.name) this.name = params.name;\n\n if (params && params.baseDifficulty) this.baseDifficulty = addOffset(params.baseDifficulty, 10);\n if (params && params.difficultyFac) this.difficultyFac = params.difficultyFac;\n\n if (params && params.rewardFac) this.rewardFac = params.rewardFac;\n if (params && params.rankGain) this.rankGain = params.rankGain;\n if (params && params.rankLoss) this.rankLoss = params.rankLoss;\n if (params && params.hpLoss) this.hpLoss = params.hpLoss;\n\n if (params && params.isStealth) this.isStealth = params.isStealth;\n if (params && params.isKill) this.isKill = params.isKill;\n\n if (params && params.count) this.count = params.count;\n\n if (params && params.weights) this.weights = params.weights;\n if (params && params.decays) this.decays = params.decays;\n\n // Check to make sure weights are summed properly\n let sum = 0;\n for (const weight of Object.keys(this.weights)) {\n if (this.weights.hasOwnProperty(weight)) {\n sum += this.weights[weight];\n }\n }\n if (sum - 1 >= 10 * Number.EPSILON) {\n throw new Error(\n \"Invalid weights when constructing Action \" +\n this.name +\n \". The weights should sum up to 1. They sum up to :\" +\n 1,\n );\n }\n\n for (const decay of Object.keys(this.decays)) {\n if (this.decays.hasOwnProperty(decay)) {\n if (this.decays[decay] > 1) {\n throw new Error(`Invalid decays when constructing Action ${this.name}. Decay value cannot be greater than 1`);\n }\n }\n }\n }\n\n getDifficulty(): number {\n const difficulty = this.baseDifficulty * Math.pow(this.difficultyFac, this.level - 1);\n if (isNaN(difficulty)) {\n throw new Error(\"Calculated NaN in Action.getDifficulty()\");\n }\n return difficulty;\n }\n\n /**\n * Tests for success. Should be called when an action has completed\n * @param inst {Bladeburner} - Bladeburner instance\n */\n attempt(inst: IBladeburner, person: IPerson): boolean {\n return Math.random() < this.getSuccessChance(inst, person);\n }\n\n // To be implemented by subtypes\n getActionTimePenalty(): number {\n return 1;\n }\n\n getActionTime(inst: IBladeburner, person: IPerson): number {\n const difficulty = this.getDifficulty();\n let baseTime = difficulty / BladeburnerConstants.DifficultyToTimeFactor;\n const skillFac = inst.skillMultipliers.actionTime; // Always < 1\n\n const effAgility = person.skills.agility * inst.skillMultipliers.effAgi;\n const effDexterity = person.skills.dexterity * inst.skillMultipliers.effDex;\n const statFac =\n 0.5 *\n (Math.pow(effAgility, BladeburnerConstants.EffAgiExponentialFactor) +\n Math.pow(effDexterity, BladeburnerConstants.EffDexExponentialFactor) +\n effAgility / BladeburnerConstants.EffAgiLinearFactor +\n effDexterity / BladeburnerConstants.EffDexLinearFactor); // Always > 1\n\n baseTime = Math.max(1, (baseTime * skillFac) / statFac);\n\n return Math.ceil(baseTime * this.getActionTimePenalty());\n }\n\n // For actions that have teams. To be implemented by subtypes.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getTeamSuccessBonus(inst: IBladeburner): number {\n return 1;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return 1;\n }\n\n getChaosCompetencePenalty(inst: IBladeburner, params: ISuccessChanceParams): number {\n const city = inst.getCurrentCity();\n if (params.est) {\n return Math.pow(city.popEst / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n } else {\n return Math.pow(city.pop / BladeburnerConstants.PopulationThreshold, BladeburnerConstants.PopulationExponent);\n }\n }\n\n getChaosDifficultyBonus(inst: IBladeburner /*, params: ISuccessChanceParams*/): number {\n const city = inst.getCurrentCity();\n if (city.chaos > BladeburnerConstants.ChaosThreshold) {\n const diff = 1 + (city.chaos - BladeburnerConstants.ChaosThreshold);\n const mult = Math.pow(diff, 0.5);\n return mult;\n }\n\n return 1;\n }\n\n getEstSuccessChance(inst: IBladeburner, person: IPerson): [number, number] {\n function clamp(x: number): number {\n return Math.max(0, Math.min(x, 1));\n }\n const est = this.getSuccessChance(inst, person, { est: true });\n const real = this.getSuccessChance(inst, person);\n const diff = Math.abs(real - est);\n let low = real - diff;\n let high = real + diff;\n const city = inst.getCurrentCity();\n const r = city.pop / city.popEst;\n if (r < 1) low *= r;\n else high *= r;\n return [clamp(low), clamp(high)];\n }\n\n /**\n * @inst - Bladeburner Object\n * @params - options:\n * est (bool): Get success chance estimate instead of real success chance\n */\n getSuccessChance(inst: IBladeburner, person: IPerson, params: ISuccessChanceParams = { est: false }): number {\n if (inst == null) {\n throw new Error(\"Invalid Bladeburner instance passed into Action.getSuccessChance\");\n }\n let difficulty = this.getDifficulty();\n let competence = 0;\n for (const stat of Object.keys(this.weights)) {\n if (this.weights.hasOwnProperty(stat)) {\n const playerStatLvl = person.queryStatFromString(stat);\n const key = \"eff\" + stat.charAt(0).toUpperCase() + stat.slice(1);\n let effMultiplier = inst.skillMultipliers[key];\n if (effMultiplier == null) {\n console.error(`Failed to find Bladeburner Skill multiplier for: ${stat}`);\n effMultiplier = 1;\n }\n competence += this.weights[stat] * Math.pow(effMultiplier * playerStatLvl, this.decays[stat]);\n }\n }\n competence *= Player.getIntelligenceBonus(0.75);\n competence *= inst.calculateStaminaPenalty();\n\n competence *= this.getTeamSuccessBonus(inst);\n\n competence *= this.getChaosCompetencePenalty(inst, params);\n difficulty *= this.getChaosDifficultyBonus(inst);\n\n if (this.name == \"Raid\" && inst.getCurrentCity().comms <= 0) {\n return 0;\n }\n\n // Factor skill multipliers into success chance\n competence *= inst.skillMultipliers.successChanceAll;\n competence *= this.getActionTypeSkillSuccessBonus(inst);\n if (this.isStealth) {\n competence *= inst.skillMultipliers.successChanceStealth;\n }\n if (this.isKill) {\n competence *= inst.skillMultipliers.successChanceKill;\n }\n\n // Augmentation multiplier\n competence *= Player.mults.bladeburner_success_chance;\n\n if (isNaN(competence)) {\n throw new Error(\"Competence calculated as NaN in Action.getSuccessChance()\");\n }\n return Math.min(1, competence / difficulty);\n }\n\n getSuccessesNeededForNextLevel(baseSuccessesPerLevel: number): number {\n return Math.ceil(0.5 * this.maxLevel * (2 * baseSuccessesPerLevel + (this.maxLevel - 1)));\n }\n\n setMaxLevel(baseSuccessesPerLevel: number): void {\n if (this.successes >= this.getSuccessesNeededForNextLevel(baseSuccessesPerLevel)) {\n ++this.maxLevel;\n }\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Action\", this);\n }\n\n static fromJSON(value: IReviverValue): Action {\n return Generic_fromJSON(Action, value.data);\n }\n}\n\nReviver.constructors.Action = Action;\n","import { ITaskParams, ITerritory } from \"./ITaskParams\";\n\nexport class GangMemberTask {\n name: string;\n desc: string;\n\n isHacking: boolean;\n isCombat: boolean;\n\n baseRespect: number;\n baseWanted: number;\n baseMoney: number;\n\n hackWeight: number;\n strWeight: number;\n defWeight: number;\n dexWeight: number;\n agiWeight: number;\n chaWeight: number;\n\n difficulty: number;\n\n territory: ITerritory;\n\n // Defines tasks that Gang Members can work on\n constructor(name: string, desc: string, isHacking: boolean, isCombat: boolean, params: ITaskParams) {\n this.name = name;\n this.desc = desc;\n\n // Flags that describe whether this Task is applicable for Hacking/Combat gangs\n this.isHacking = isHacking;\n this.isCombat = isCombat;\n\n // Base gain rates for respect/wanted/money\n this.baseRespect = params.baseRespect ? params.baseRespect : 0;\n this.baseWanted = params.baseWanted ? params.baseWanted : 0;\n this.baseMoney = params.baseMoney ? params.baseMoney : 0;\n\n // Weighting for the effect that each stat has on the tasks effectiveness.\n // Weights must add up to 100\n this.hackWeight = params.hackWeight ? params.hackWeight : 0;\n this.strWeight = params.strWeight ? params.strWeight : 0;\n this.defWeight = params.defWeight ? params.defWeight : 0;\n this.dexWeight = params.dexWeight ? params.dexWeight : 0;\n this.agiWeight = params.agiWeight ? params.agiWeight : 0;\n this.chaWeight = params.chaWeight ? params.chaWeight : 0;\n\n if (\n Math.round(\n this.hackWeight + this.strWeight + this.defWeight + this.dexWeight + this.agiWeight + this.chaWeight,\n ) != 100\n ) {\n console.error(`GangMemberTask ${this.name} weights do not add up to 100`);\n }\n\n // 1 - 100\n this.difficulty = params.difficulty ? params.difficulty : 1;\n\n // Territory Factors. Exponential factors that dictate how territory affects gains\n // Formula: Territory Mutiplier = (Territory * 100) ^ factor / 100\n // So factor should be > 1 if something should scale exponentially with territory\n // and should be < 1 if it should have diminshing returns\n this.territory = params.territory ? params.territory : { money: 1, respect: 1, wanted: 1 };\n }\n}\n","import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { Crime } from \"../Crime/Crime\";\nimport { CONSTANTS } from \"../Constants\";\nimport { determineCrimeSuccess } from \"../Crime/CrimeHelpers\";\nimport { Crimes } from \"../Crime/Crimes\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { CrimeType } from \"../utils/WorkType\";\nimport { Work, WorkType } from \"./Work\";\nimport { scaleWorkStats, WorkStats } from \"./WorkStats\";\nimport { calculateCrimeWorkStats } from \"./formulas/Crime\";\n\nenum newCrimeType {\n SHOPLIFT = \"SHOPLIFT\",\n ROBSTORE = \"ROBSTORE\",\n MUG = \"MUG\",\n LARCENY = \"LARCENY\",\n DRUGS = \"DRUGS\",\n BONDFORGERY = \"BONDFORGERY\",\n TRAFFICKARMS = \"TRAFFICKARMS\",\n HOMICIDE = \"HOMICIDE\",\n GRANDTHEFTAUTO = \"GRANDTHEFTAUTO\",\n KIDNAP = \"KIDNAP\",\n ASSASSINATION = \"ASSASSINATION\",\n HEIST = \"HEIST\",\n}\n\nconst convertCrimeType = (crimeType: CrimeType): newCrimeType => {\n switch (crimeType) {\n case CrimeType.SHOPLIFT:\n return newCrimeType.SHOPLIFT;\n case CrimeType.ROB_STORE:\n return newCrimeType.ROBSTORE;\n case CrimeType.MUG:\n return newCrimeType.MUG;\n case CrimeType.LARCENY:\n return newCrimeType.LARCENY;\n case CrimeType.DRUGS:\n return newCrimeType.DRUGS;\n case CrimeType.BOND_FORGERY:\n return newCrimeType.BONDFORGERY;\n case CrimeType.TRAFFIC_ARMS:\n return newCrimeType.TRAFFICKARMS;\n case CrimeType.HOMICIDE:\n return newCrimeType.HOMICIDE;\n case CrimeType.GRAND_THEFT_AUTO:\n return newCrimeType.GRANDTHEFTAUTO;\n case CrimeType.KIDNAP:\n return newCrimeType.KIDNAP;\n case CrimeType.ASSASSINATION:\n return newCrimeType.ASSASSINATION;\n case CrimeType.HEIST:\n return newCrimeType.HEIST;\n }\n return newCrimeType.SHOPLIFT;\n};\n\ninterface CrimeWorkParams {\n crimeType: CrimeType;\n singularity: boolean;\n}\n\nexport const isCrimeWork = (w: Work | null): w is CrimeWork => w !== null && w.type === WorkType.CRIME;\n\nexport class CrimeWork extends Work {\n crimeType: CrimeType;\n unitCompleted: number;\n\n constructor(params?: CrimeWorkParams) {\n super(WorkType.CRIME, params?.singularity ?? true);\n this.crimeType = params?.crimeType ?? CrimeType.SHOPLIFT;\n this.unitCompleted = 0;\n }\n\n getCrime(): Crime {\n const crime = Object.values(Crimes).find((c) => c.type === this.crimeType);\n if (!crime) throw new Error(\"CrimeWork object constructed with invalid crime type\");\n return crime;\n }\n\n process(player: IPlayer, cycles = 1): boolean {\n this.cyclesWorked += cycles;\n const time = Object.values(Crimes).find((c) => c.type === this.crimeType)?.time ?? 0;\n this.unitCompleted += CONSTANTS._idleSpeed * cycles;\n while (this.unitCompleted >= time) {\n this.commit(player);\n this.unitCompleted -= time;\n }\n return false;\n }\n\n earnings(): WorkStats {\n return calculateCrimeWorkStats(this.getCrime());\n }\n\n commit(player: IPlayer): void {\n const crime = this.getCrime();\n if (crime == null) {\n dialogBoxCreate(\n `ERR: Unrecognized crime type (${this.crimeType}). This is probably a bug please contact the developer`,\n );\n return;\n }\n const focusPenalty = player.focusPenalty();\n // exp times 2 because were trying to maintain the same numbers as before the conversion\n // Technically the definition of Crimes should have the success numbers and failure should divide by 4\n let gains = scaleWorkStats(this.earnings(), focusPenalty, false);\n let karma = crime.karma;\n const success = determineCrimeSuccess(player, crime.type);\n if (success) {\n player.gainMoney(gains.money * player.mults.crime_money, \"crime\");\n player.numPeopleKilled += crime.kills;\n player.gainIntelligenceExp(gains.intExp);\n } else {\n gains = scaleWorkStats(gains, 0.25);\n karma /= 4;\n }\n player.gainHackingExp(gains.hackExp);\n player.gainStrengthExp(gains.strExp);\n player.gainDefenseExp(gains.defExp);\n player.gainDexterityExp(gains.dexExp);\n player.gainAgilityExp(gains.agiExp);\n player.gainCharismaExp(gains.chaExp);\n player.karma -= karma * focusPenalty;\n }\n\n finish(): void {\n /** nothing to do */\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n cyclesWorked: this.cyclesWorked,\n crimeType: convertCrimeType(this.crimeType),\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"CrimeWork\", this);\n }\n\n /**\n * Initiatizes a CrimeWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): CrimeWork {\n return Generic_fromJSON(CrimeWork, value.data);\n }\n}\n\nReviver.constructors.CrimeWork = CrimeWork;\n","import React, { useEffect, useState } from \"react\";\nimport { EventEmitter } from \"../utils/EventEmitter\";\nimport { Modal } from \"./React/Modal\";\n\nconst frames = [\n \"ttftfffttttttttttfffffffttftt1ttttttt111tttt1111111tttt1tt111tttt111111tttt1ttttttttttttttt111111111\\nttfttttttttttttttttfLLLftfffffffffftttt111tt11111ttffffftttt1111111111111111ttttttfttttttttt111111t1\\nttttttttttttttttffffLfftffffffffLLffttttttftt111ttfffffftttttttt111111ttttttffffttfffttttttt111111tt\\nttttttttttttttttfffLfttffffffLLffffttttttttttt1tfffffffffftttttt111111tffffffffftttfffftttt11111ttt1\\nttttttttttttffLfttfffttfffffffffttfftttttt1t1tt11tfffffftttttt111t111111ttffffLLffttfffftt111111tttt\\nttttttttttffLLLLfttttffLLLfttttftfLftttttttffffttttffffttttfftt11t111tt111ttfffLffttfftttttt1111tttt\\nttttttttffLLLLLLLffttfLLffttfffftfLfttttttffttt11111ttttffffffftt1111tft11111ttffffttt11tfftt11ttttt\\ntttttttfffLLLLLLLLfftffttttffLffftfftttttft1i;;::::;iitffffffffftt111tft1tttt1ttffLfttttfffffttttttt\\ntttttttfffLLLLLLLLfttttffftffffftfttttttff1:,,,,,,,,::itfffffffft11111111ttttttttttt1tfffffffffffttt\\ntttffttffLLLLLLLLLfttfftffffffffLLLftttttt;::,:::;;;;::1tfffftfft11111ttt1ttt1tfttt11ttffffffffLfttt\\ntffffffffLLLLLLLffftfLfffttfLLffLLLfttttti;;;iii11111;:i11ttffft111111tfft11t11tt1tttttfffLLLLLLfttf\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttfti:;;;iiiiiiii;it111tt111t1111tffttfftt11ttftttfffLLLLLLffff\\nttttfttttffffftttttttttttttfLLLffLLfttttt1;;;;;;iiiiii;1tft11tt1111111tfftfffftttttttttttfLLfffttfff\\ntfffffffffftttfffffffffttffttLLfffLfttttt11i;;;;iiiiiii1tt11tfftt11111ttt1fffttt1tttttttttfffftttttt\\nttffffffffftttfffffffffttffftffttftttttff1ii;;;;iii1iii111tt1ttttt1111t111ffttffttfffffLffttttffffff\\nttffffffffttttffffffffttttttttttffftttttft1ii;;;ii1iii111tfft11ttt111111t1tt1tfft1ttffffLLftttLLLLLL\\ntttffffffffttfffffffftttttttt11fffftttt1t111iiii;iiiii11ttffft11111111ttttttt1tt11ttffffLfftttfLLLLf\\ntttttttffffttfffttttttttffttt11tffttttttt11ttii;;;iiii11i1ffftt1111111tttt111tttt11ttttffffftffLLLff\\ntfttttttttttttttttttttfffftttt11tfftttttt111t1i;;;iiii1i,,:;i1111t1111ttt111t1tfftt11111ttfftffffftt\\nttttfffftttttttfffftttffffttffttttft111tt11111i;;;iiii1;,,....,:::;i11tt111tt11tffftttttttt1tttttttt\\nt11ttffffftttffffffttttfffttffttttft1111111111;;;;;;;it;,...........,:it111ttt1tffftttttfft11ttfffff\\ntt1ttfffftt1ttfffft111tffttfttttttt1111t1i;:;11i1i;;1t1:,,............,itt11tt1tfftt1tfffffft1tffLLf\\ntfttttfttttt11tttt1ttt11ttttttftt111111i:,..:1111iii11;,...............;tt111t11ttttttttffttt11ffLLf\\ntfftttttttfftttttttffftt111ttffftt11i;,.,...,iiii;;;;:,,...............:1ttt1111ttfffttttft1tt1ttfft\\nttttttttttttttt11ttttttttttfffffft1:,..........::::::,,,...............,1ttttt11ttfffffttttffftttttt\\ntfffttttffffftt11ttttttttttfffffft1:...........:;::;:..................,1tttttt1ttfffffttttttttftttf\\ntfffttttfffffft1ttftttfftttttffft11:...........,:::::..................,1tttft11tfffffffttfffffffttf\\ntfffttttffffff11tttttttttttttttttt1;...........,::::,...................;t1t1111tfffffLfttfffffffttf\\ntfffttttfftttt11tttttttt1tfftttttt1:...........,::::,...... ............,1111tt11fffffLftttffttffttf\\ntttttttttttttt11tttttttt1tffftttft1:...........,:::,,....................it1ttt11tfffffftttffttffttt\\nttttt1tttttttt11ttttttttttffttttttt:...........,::,,.....................:111tt11tttttttt1tttttttttt\\nttttt1tttttttt11tftttttftttttttttt1;,:;:.......,:,,,....................,,1111t11ttttttt11ttttttfttt\\n1tttt1ttfffttt11ttffffffttttfffft11ii1i:.......,:,,,.....................,1tt1111ttttttt111tttttfttt\\n1ttt11tttttttt11tttttttttttttttttti;;;;:.......,:,,,....... .............,itt1111tttt11t111ttttttt1t\\n111111tttttttt11111111ttttttttttt1i;;;;:.......,:,,,......................itt11111111111111111111111\\n1111111111111111111111ttttttttttt1;;;;;:...... ,:,,,,.....................itt11t11111111111111111111\\n1111111111111111111111tttttttttt1;:,::;,...... ,:...,.....................ittttt11111111111111111111\\n111111111111111111111111tttttttt1i,..... .... .:........................,i1tttt11111111111111111111\\n1111111111111111111111111t11t11111;,....,,.... ,:::,,,...................,11ttttt11t1111111t11111111\\n11111111111111111111111111111111111iiiiii. ... .::::::,..................,11t1ttt111t11111tttttt1111\\n1111111111111111111111111111111111111111:.,.....::::::,..................:111tttttt1tttt11tttttt1111\\n1111111111111111111111111111111111111111:::,...,::::;::,..,,.............:11tt1ttttttttttttttttt1111\\n\",\n \"ttftfffttttttttttffffffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftfLLLftfffffffffftt11111tt11111ttffffttttt1111111111111111ttttttfttttttttt111111tt\\nttftttttttttttttffffLftttfffffffLLLfttttttftt111ttfffffftttttttt111111tttttffffftfffftttttt1111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tffffffffffttttttt11111tffffffffftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt1tttt1ttftfffftt1ttt111t111111ttffffLLffttfffft1111111tttt\\nttttttttttffLLLLfttttffLLLfttttttfLftttttttfft11i;;:;;i11ttfftt11t111tt111tttffffftttttttttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLttttttfff1;,,,,,,,,:;tffffft11111tft11111ttffffttt11tffftt1ttttt\\ntttttttfffLLLLLLLLfftffttttffLffftfftttttfft1;:,,,,,::::,;tffftttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffffftfftttttfffti:;;;iiii11i;:tffffft11111111ttftttttttt1ttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLftfftfLLLftttttfft::i;iiiiii11i:1ffftft11111ttt1ttt1ttttt11ttfffffLLfLfttt\\nttfLfffffLLLLLLLLfftfLLfffffLfffLLLfttttt1tt;:;;;;;iiiiiii1tffft11111tffft11t11tt1tttttfffLLLLLLffff\\ntffftfttttfLLLffttttfffffttLLLLfLLLftttft111i;;;;;;iiiiii111tt111t1111tffttfftt11tfft1tfffLLLLLLLffL\\ntttfftttttffLftttttttttttttfLfLffLLfttttttt1iii;;;;;ii11i1t11t11111111tffttfffttttttt11ttfLLLLffftff\\nttfLffffffftttfffffffffttfftfLLfffLftttttfft1ii;;;;iii1i1tt1tfftt11111ttt1tffttt1ttt1tttttffffttffft\\nttffffffffftttffffffffttfffftffffftttttfffft111;;;;iiii1111t1ttttt1111tt11ffttfftttfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttttt11ttii;iiiiii11tft11ttt111111t11t1tfft1tfffffLLftttLLLLLL\\n1ttffffffffttfffffffftttttttt11ffffttttt1111tftiii;;iiii1;,;1111111111tttt11111111ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11tffftttttt11ttf1;;;i;iiii1:,,.,,::;ii11tttt111tttt11ttffffffftffLLLff\\ntfttttttttttttttttttttfffftttt11tfftttttt111tt1;;;i;;ii1t:,,........,:;1t111t1tfftt11111ttfftffffftt\\ntftttffffttttttfftftttffffttffttttftt11tt111i;;;;;;;;;it1,,............,;11tt11tffffttttttt1tttttttt\\ntttttffffftttfffffft1ttffftfffttttft111111;:,.;iii;;;i11,.,.............,1tttt1tffftttttfft111tfffff\\n1tttffffftt1ttfffftt11tffttfttttttt1111i;,....,1iii;ii;,................,111tt1tfft11tffffftt1tLffLf\\ntftttfftt1ttt1tttt1tttt1ttttttttt1111;:,.......i1;;;:::.................,it11t11ttttttttffftt11fffLf\\ntfftttttttfftt1111ttfftt11ttfffftt1ti..........:i;::;:,..................ittt111t1tffttttft1tt1tffft\\nttttttttttttttt11tttttttt1tffffffftti,.........,::::::,..................itttt11ttffffftttttfftttttt\\ntfffttttfffffft11ttttttttttffffffft1i,.........,:,:::,...................,1tttt11tfffffttttttttffttf\\ntfffttttfffffft11tftttfftttttffft1111:.........,:,:::,....................;tt111tfffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt111;.........,:,::,,....................,111111fffffLfttfffffffttf\\ntffftttttttffft11tttttttttffttttfft11i.........,:.:,,......................:1tt11fffffLftttffttffttf\\ntttttttttttttt111ttttttt1tffftttfft111:....... ,:.:,,.......................1tt11tfffffftttffftffttt\\nttttt1tttttttt11ttttttttttfttttttft111i,...... ,:,,,,......................,itt11ttttttt11ttttttfttt\\nttttt1tttttttt11tfttttfftttttffttt1111i,...... ,:.,,,......................:11111ttttttt11ttttttfttt\\n1tttt1ttftfttt11tfffffffttttfffft11111,....... ,,.,,....... ...............it1111ttttttt111tttttfttt\\n1tttt1tttttttt11ttttttttttttttttt1111;,....... ,,.,,......................:tt11111ttt11t111ttttttt1t\\n11t111tttttttt111t1111tttttttttt1iiii:,,...... ,,.........................;t111111111111111111111111\\n111111111tt11111111111ttttttttt1;;iiii:....... ,,............ ...........;tttt1111111111111111111111\\n1111111111111111111111ttttttttt1;;;iii;... ....,::::,....,:::,,.........;1ttttt111111111111111111111\\n111111111111111111111111tttttttt1i;;ii: .,....,:::::... .;;;;;:,.....,;1ttttttttt111111111111111111\\n1111111111111111111111111tt1111111i,,.,:;i: ...,:::::.....:;;;;;:.....,1ttttttttt11t1111111t11111111\\n11111111111111111111111111111111111:.:1tti,....,:::::.... ,;;;;;;,.....ittttttttt111t11111ttttt11111\\n1111111111111111111111111111111111111ttt;,,....,:::::,... .,;;;;:,.,,..:ttttttttttt1tttt11tttttt1111\\n11111111111111111111111111111111111111t1,,,....:;;::::,.....:;;;:......,1ttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt1tt111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttt11111tt11111ttfffft1ttt1111111111111111tttttffttttttttt111111tt\\nttftttttttttttttffffLffttfffffffLLLfttttttfttt11tffffffftttttttt111111tttttffffftfffftttttt1111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt1iiiii1tttttttt11111tffffffffftttfffffttt1111t1tt1\\nttttttttttttffffttffftffffffffffttffttttt11tttt1i::,,,,,,:;111111t111111ttffffLLffttfLfftt11111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfft1i;,,,,,,,,,:;ttt11t111tt111tttffffftttftttttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttffffti;::;;;;;iii::1ftt11111tft11111ttffffttt11tffftt1ttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttffffft;:;iiii11111i:iftttt111ttt1tttt11tffLfttttfffffttttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffft;:;;;;;iiiiii;1fftt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffffti;;;;;;;ii;iiitffft11111ttt1ttt1tfttt11ttfffffLLfLfttt\\nttfLfffffLLLLLLLLffffLLfffffLfffLLLLtttttttff1iii;;i;;iii111tfft111111ffft11t11tt1tttttfffLLLLLLffff\\ntffftftttffLLLffttttfffffttLLLLfLLLffttftt11t1iii;;;;;iiiii1tt111t1111tffttfftt11tfft1tfffLLLLLLLfff\\nttffftttttffLftttttttttttttfLLLffLLftttttttft111i;;;;iiii1111111111111tffttfffttttttt11ttfLLffffftff\\nttfLffffffftttfffffffffttfttfLLfffLftttttfffft11i;;;;iiii1t1ttttt11111ttt1tffttt11ttttttttfffftfttft\\nttffffffffftttffffffffttfffftffffftttttfffft11t1i;;;;;iii1ii1ttttt1111t111ffttfft1tfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttttt11tft1i;;;;iii1i,:;i1ttt11111t11t1tfft1ttffffLLfttfLLLLLL\\ntttffffffffttfffffffftttttttt11ffffttttt1111tfti;ii;;iiii1;,,...,:;ii1tttt1111tt11ttffffffftttffLLLf\\nttttttttfffttfffttttttttffttt11tffftttttt11t1iii;;ii;;;i1t:,.........,:;1t111ttt111ttffffffftffLLLLf\\ntfttttttttttttttttttttfffftttt11tfftt11tt1i:,.:;;;i;;;itti,,............,;1111ttttt11111ttfftffffftt\\ntfttfffftttttttfffftttffffttffttttft1111i:....,;;;ii;i11;.,,.............:1tt1ttffffttttttt1ttttttft\\ntttttffffftttffftffttttffftfffttttft1i:,.......:;;;;;;;:,................:tttt1tffftttttfft11ttfffff\\n1t1tffffftt1ttfffftt11tffttftttttttt1,.........,ii;;;;;,.................:11tt1tfft11tfffffft1fLLfLf\\ntftttfftt1ttt1tftt1ttt11ttttttttt111i,.........,11;:;;:,.................,1t1t11ttttttttfftt111fffLf\\ntfftttttttffttt111ttfftt11ttffffftt11,.........,i;::::,..................,1tt11111ffft1ttt11tt1tffft\\nttttttttttttttt11tttttttt1tffffffft11;..........::::::,...................;tt1111tfffftttttffftttttt\\ntfffttttfffffft11ttttttttttffffffft11:..........:::::,..,;:,...............ittt1tttttffttttttttffttf\\ntfffttttfffffft11tftttffttttfffft1111:..........:::::,..;1i;:,..............1t11tfffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt111;..........::,:,...;ii;;;,.............:1111tffffLfttfffffffttf\\ntffftttttttfft11ttttttttttfftttttft11i,.........::,,,...;;;;;i:..............;111tffffLfttfffttffttf\\ntttttttttttttt111tttttttttffftttfft11i,.........::,,,...;;;;;i:..............:111tfffffftttffttffttt\\ntttttttttttttt11ttttttttttfftttttft111:.........:,,,....::;;;;:.............,1t11ttttttt11tttttffttt\\nttttt1tttttttt11tfttttfftttttfftttt111:.........:,,,......,::::..,.........,i1111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttfffft1111i:,........:,,,..... .......,,...... .it1111ttttttt111tttttft1t\\n1tttt1tttttttt11ttttttttttttttttt1iiii;,........:........... ...........:itt11111ttt1t1111ttttttt1t\\n111111tttttttt111tt111tttttttttti;;;iii:... ....:,,...................:i1tttt11111111111111111111111\\n111111111tt11111111111tttttttttt1;;;;;;;. .,....::::..................:1tttttt1111111111111111111111\\n1111111111111111111111ttttttttttt1i;;::..:;1,...::::...................;ttttttt111111111111111111111\\n1111111111111111111111111tttttttt111i,.,it1;....::::,..................,1ttttttttt111111111111111111\\n1111111111111111111111111tttt11111111ii1t1i:...,::::,........,..........itttttttt11t1111111tt1t11111\\n11111111111111111111111111111111111111tt1;:....::::;:.......,...........:1ttttttt111t11111ttttt11111\\n111111111111111111111111111111111111111ti,,....:;:;::,..................,ittttttttt1tttt11tttttt1111\\n111111111111111111111111111111111111111t:,:.,.:;;;;:::,..................;111t1ttttttttttttttttt1111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt11t111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttttt1111t11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\\nttftttttttttttttffffLffttffffffffLLfttttttfttt11ttt1iiii;i11tttt111111tttttffffftffffttttttt111111tt\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1tt1::,,,,,,:;1ttt111111tfftfffffftttfffffttt1111t1tt1\\nttttttttttttffffttffftffffffffffttfftttttt1ttt11i;:,,,,,,,,,:1111t1111111tffffLLffttfLfftt11111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;:::;;;;;;;::it11t111tt111tttffffftttfttttt1111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLtttttfffffti:;;ii111111i:itt11111tft11111ttffffttt1ttffftt1ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffft;:;;;;;iiiiii;ittt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttffffffti;;;;;;;ii;iiitttt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttfffff1iii;;i;;i1i1i1tttt11111ttt1ttt1tfttt111tfffffLLfLfttt\\nttfLffffffLLLLLLLffffLLfffffLfffLLLftttttttfft1i;;;;;;;iiiiitfft111111ffft11t11tt1tttttffffLLLLLffft\\ntffftfttttfLLLffttttffffftfLLLLfLLLftttftt1111111i;;;;iiii111t111t1111tffttfftt11tfft1tffLLLLLLLLfff\\nttffftttttffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111111111111tffttffftttttttt1ttfLLLfffffff\\nttfLffffffftttfffffffffttfttfLLfffLftttttffft1111i;;;;;ii111tfttt11111ttt1tffttt11ttttttttfLfftfttft\\nttffffffffftttfffffffffttffftffffftttttfffft11t11i;;;;iii1i:;1ttft11111111ffttfftttfffffLfttttfffffL\\nttffffffffttttffffffffttttttttttffftttttft111tttiii;;iiii1;,,,:;i1111111111t1tfft1ttffffLLftttfLLLLL\\ntttffffffffttffffffffttttttttttfffftttt1111i;:;iiii;;;i;11:,,.....,:;i1tft1111tt111tffffLfftttffLLLf\\nttttttttfffttfffttttttttfftt111tfffttt11i;,,..:i;;;i;ii1t1,,..........,:i1111ttt1111tffffffftffLLLLf\\ntfttttttttttttttttttttffffttttt1tffti;:,,.....,;;;iiii1ti,,,.............;1111ttttt11111ttfftffffftt\\ntttttffffttttttfffftttffffttffttttf1:.........,;:;;;;;;;,.,,,............:1tt1ttffff11ttttt1ttttttft\\ntttttffffftttffftfft1ttffftfffttttf1,..........,;;;;;;;:.:ii;;:,.........:tttt1tfffttttffft111tfffff\\n1tttffffftt1ttfffftt11tffttfttttt1t1,...........ii;;;::,,;i;;ii:.........:tttt1tfft11tfffffft1fLLfLf\\ntftttffttttt11tftt1tttt1ttttttttt11i,..........,1i;;::,.:i;;;;i:.........,1t1t11ttttttttfftt111fffLf\\ntfftttttttffttt11tttffttt1tttffft11i,..........,ii;:::,.,:;;iii:..........it111111tfft1ttt11tt1tffft\\nttttttttttttttt11tttttttt1tfffffftti,...........:::::,....:;;ii:..........:tt111ttfffftttttffftttttt\\ntfffttttfffffft11ttttttttttfffffft1i,...........:::::,.....,:;;:.... ......,1t111ttttffttttttttffttf\\ntfffttttfffffft11tftttffttttfffft111:...........:::::,........,..,..........,1111tffffffttfffffffttf\\ntfffttttfffffft1tttttttftttttttttt11:...........::,:,........ ...:;,.........:111tffffLfttfffttffttf\\ntffftttttttfft11ttttttttttffttttttti,...........:::,,.............,...........,i1tffffLfttfffttffttf\\ntttttttttttttt111tttttttttffftttfft;,:;:........:::,.............. ...........:11tfffffftttffttffttt\\ntttttttttttttt11ttttttttttfftttttftii1i;:.......:::,.......... ..............:t111tttttt11tttttffttt\\nttttt1tttttttt11tfttttfftttttffttt1ii;ii;,......::,,........................:1111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttfffft11i;;ii;,......:,,,..........:........ .;t1111ttttttt111tttttft1t\\n1tttt1tttttttt11tttttttttttttttttt11;:;i:,,.....:,.................. .;i;;1tt1111tttt1t1111ttttttt1t\\n111111tttttttt111t111ttttttttttttt11i:,,:1;....,::....................:1ttttt11111111111111111111111\\n111111111tt1111111111tttttttttttttt11i;;1t:....:::::...................;tttttttt11111111111111111111\\n1111111111111111111111ttttttttttttt111ttt1,,,.,:::::,..................,1ttttttt11111111111111111111\\n111111111111111111111111tttttttttt1111111i,::.,;::;:,...................;ttttttttt111111111111111111\\n1111111111111111111111111ttttttt11111111t;.,,.,;;;;;,...................,1ttttttt11t1111111tttt11111\\n111111111111111111111111111111111111111t1:..,,:;;;;;:,...................;ttttttt111t11111ttttt11111\\n111111111111111111111111111111111111111ti,,,::;;;;;;;:,..................,1tttttttt1tttt11tttttt1111\\n111111111111111111111111111111111111111t;,,::,;;;ii;;::,..................it1tttttttttttttttttt11111\\n\",\n \"ttftffftttttttttffffffLftfftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftfffffffffttttt111tt11111ttffffftttt1111111111111111tttttfftttttttt1111111tt\\nttftttttttttttttffffLffttfffffffLLLftttttttttt11ttt1iiii;i11tttt111111ttttttfffftffffttttttt111111t1\\nttttttttttttttttfffLLttffffffLLffffttttttttttt1ttt;:,,,,,,,:itttt11111tfftfffffftttfffffttt1111t1ttt\\nttttttttttttffffttffftffffffffffttfftttttt1tttt11i:,,,,,,,,,:i111t1111111tffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1;::;;;;;;;;;,;t111111tt111tttffffftttftt1tt1111ttttt\\nttttttttffLLLLLLLffttfLLffttfffftfLLtttttffffff1,:iiii111111;:tt11111tft11111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftffttttfffffffi:;;;;;iiiii1;;ttt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLLftfftttttfffffff1;;;;;;;ii;;ii1ttt11111111ttftttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLffffftfLftffffLLLftttttfffff1iiiiii;;iiii1itttt11111ttt1ttt11tttt11ttfffffLLfLfttt\\ntffLLffffLLLLLLLLffffLLftffLLLffLLLftttttttffftiii;;;;;ii1ii1tft111111ffft11t11tt1tttttffffLLLLLffft\\ntfffffttftfLLLffttttfffffttLLLLfLLLftttft111tt111i;;;;iiiii1tt111t1111tffttfftt11tfft1tffLLLLLLLLfff\\nttttfttfffffLftttttttttttttfLLLffLLftttt1tttt11tti;;;iiiii111t11111111tffttffftttttttt1ttfLLLfffffff\\nttffffffffftttfffffffffttfftfLLfffLftttttffft11t1i;;;;;iii11ttttt11111ttt1tffttt11ttttttttfLfftftttt\\nttffffffffftttfffffffffttffftffftftttttffft111t11i;;;;iii1ii11tttt1111tt11ffttfftttfffffLfttttffffff\\nttffffffffttttffffffffttttttttttffftttttttt11111iii;;iiii1;,:;1tttt11111t11t1tfft1ttffffLLftttfLLLLL\\ntttffffffffttffffffffttttttttt1tffftttt11i;:,:i;;i;;;;;i11,,..,,:;i111tttt1111tt11ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11ttff1ii;:,....,;::;i;;i11ti,,.......,:;ittt111ttt1111ttffffffttfLLLLf\\ntfttttttttttttttttttttfffftttt11tff;,,........;;;;iii1tti,,,,:;;::,....,i11111ttttt11111ttfftffffftt\\ntfttfffffttttttfffft1tffffttfft1ttt:..........:;;;;;;;i;...,;i;iii:.....,i1tt1ttffff11ttt1t1ttttttft\\nttttfffffftttfffffft11tffftffftttti,..........,:;;;;;;;,...,;;iiii,......;tttt1tffftttttftt111tfffff\\n1tttffffftt1ttfffftt111ffttft11tt1;,...........;i;;;;;:,.....:;iii,......;tttt1tfft11tffffftt1fLLfLf\\ntttttffttttt11tftt1tttt1tttt1tttti,............;1;::;;,......,;iii,......;t11t11ttttttttfftt111fffLf\\ntfftttttttffttt111ttfftt111ttfffti.............;i;::::,.......,;;;,......;ttt11111tfft1tttt1tt1tffft\\nttttttttttttttt11ttttttt11tffffffi,............,::;:::,..........,.......:ttt1111tfffftt1tttfftttttt\\ntfffttttfffffft11tttttttttttffffti,............,:::::,..............,....,ittt11ttttttft1ttttttffttf\\ntfffttttfffffft11tffttff11t1tfff1;...... ....,.,:::::,.....................;11111tffffffttfffffffttf\\ntfffttttfffffft1tttttttfttttttti:,......:iiii;,,:::,:.......................,;111tffffffttfffttffttf\\ntffftttttttfft11ttftttttttfftti,,::,.,:;1i;;;;.,::::,.........................,i1tffffLfttfffttffttf\\ntttttttttttttt111ttttttt1ttfft1:::,,,:,:;;;;i:.,:::,,..........................;1tfffffftttffttffttt\\nttttt1tttttttt11ttttttttttfttt1;,...,...:;;;:, ,:::,..........................;11ttttttt11ttttttfttt\\nttttt1tttttttt11tfttttfftttttfti,..,....,,,....,:::,.........................:111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfffffffttttffft1;::::,,.......,:,:,.................. .:1111ttttttt111tttttfttt\\n1tttt1tttttttt11ttttttttttttttttttt11111:......,:,,,..................,::,:1tt1111ttt1t1111ttttttt1t\\n111111tttttttt111t1111tttttttttttt111111:......,,.....................,1tttttt1111111111111111111111\\n1111111111t11111111111ttttttttttttt11111:......,:,,....................:1t1ttttt11111111111111111111\\n1111111111111111111111ttttttttttttt1111t:......,;;::....................:1ttttttt1111111111111111111\\n111111111111111111111111ttttttttt1111111:......,::::,...................,itttttt11111111111111111111\\n111111111111111111111111111tttt111111111:......,;;::,....................:1ttttttt1tt11111ttttt11111\\n1111111111111111111111111111111111111111:......:;;;::,...................,ittttttt11t11111ttttt11111\\n11111111111111111111111111111111111111t1:......:;i;;::,...................:11tttttt1tttt11ttttt11111\\n1111111111111111111111111111111111111111,......:;;;;;::,..................,1tttttttttttttttttttt1111\\n\",\n \"ttftfffttttttttttfffffLftfftttttttttt111tttt1111111tttt111111ttttt11111tttttttttttttttttttt11111111t\\nttfttttttttttttttfffLLLftffffffffftttttt111111111ttfffftt1tt1111111111111111ttttttftttttttt1111111tt\\nttftttttttttttttffffLftttfffffffLLLft1tttttft111tfftttfttttttttt111111ttttttfffftffffttttttt11111tt1\\nttttttttttttttttfffLfttffffffLLffffttttttttttt1ttti;;;;::;i1tttt111111tffffffffftttfffffttt11111ttt1\\ntttttttttttfffffttffftffffffffffttfftttttt1ttt111i,,,,,,,,,;11111t1111111tffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttffft1i::,,,,,,,,,:1t11t111tt1111ttffffftttftt1tt1111ttttt\\nttttttttffLLLLLLLffttfLLLfttfLfftfLLtttttfffffti:;;iiiiiiii::1tt11111tftt1111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLffftfftttttffffft::;;iii1i111i:1ttt1111ttt1tttt11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffffft;;;;;;;iiiiii;tttt11111111ttftttttttt11tffffffffffttt\\ntttfftfffLLLLLLLLLfttfftfLfffffffLLftttttfffft1ii;;;;;iiiiiitfttt11111ttt1ttt11tttt11ttfffffLLfLfttt\\nttfLLfffffLLLLLLLfftfLLftfffLLffLLLftttttttfftiii;;i;;ii111itfft111111tfft11t11tt1tttttfffLLLLLLLfff\\ntfffffttftfLLLffttttffffftfLLLLfLLLftttft111tt1iii;;;;iiiii1tt111tt111tffttfftt11tfftttffLLLLLLLLfff\\nttttfttffttffftttttttttttttfLLLffLLftttt1tttt11t1i;;;iiii1111t11111111tffttffftttttttt1ttfLLLfffffff\\nttfLffffffftttfffffffffttftttfLfffLftttttfffft11i;;;;iiii111tfttt11111ttt1fffttt1ttt1tttttfLLffftttt\\nttffffffffftttfffffffffttfftttfttttttttffft11111i;;;;;iii1tt11tttt1111t111ffttffttfffffLLfttttfLffff\\nttffffffffttttffffffffttttttttttffftt11ttt1111t1i;;;iii1i1itt11ttt111111t11t1ttft1ttffffLLftttfLLLLL\\ntttffffffffttfffffffftttttt1111tffftttt11i;::i1iii;;;iii1i,:;i11t11111tttt1111tt11ttffffLfftttffLLLf\\nttttttttfffttfffttttttttffttt11ttft1ii;:,....;i;;;ii;;i1t:,...,:;i1111tttt111ttt1111tttffffftfLLLLLf\\ntfttttttttttttttttttttfffftttt11t1:,,........ii:;;iii1tt1,,,......,,;i1tt11111ttttt11111ttfftffffftt\\ntfttfffffttttttfffft1tffffttfft11;,..........:;::;ii11t1:,,,...,,:,...,it11tt11tffffttttttt1ttttffft\\nttttfffffftttfffffft11tfffttfttt1,....,,......,:;;;;;;i,.......:iii;;,.,1t1ttt1tffftttttfftt11tfffff\\n1tttffffftt1ttfffft1111tfttft11ti,.............;i;;;;;:........:iiiii:..it11tt1tfftt1tfffffft1fLffLf\\ntttttffttttt11tttt1tttt1tttt1tt;,..............i1;;;;;,........,;iii;,..it111t11ttttttttfftt111fffLf\\ntfftttttttfftt1111ttfft11111tft:...............;i;;;;:,.........:;ii:..,ittt111111tfftttttt1tt1tffft\\nttttttttttttttt11ttttttt11ttff1,...............,::::::......... ,;ii:...itttt111ttffffft1tttfttttttt\\ntfffttttffftttt11ttttttt111tft;,........... ..,:;:::,...........,:;:...;ttttt11ttfffffttttttttffttf\\ntfffttttfffffft11ttttttf11111;:,..... .....,:::::::::...............,...:1ttt1111fffffffttfffffffttf\\ntfffttttfffffft11ttttttt11ti,,...........,:;i;;;:::::..................,.:tt11111tffffffttfffffffttf\\ntffftttttttfff111ttttttt111,.,,,,...,,..,;;;;;i;:,::,....................,;i1t111tffffLfttfffftffttt\\ntttttttttttttt111ttttttt11t:.......,....,:;;;;;:::,:,.......................:1t11tfffffftttffttffttt\\nttttt11ttttttt11tttttttt11t1,............,,,...,::::.........................:111ttttttt11ttttttfttt\\nttttt1tttttttt11ttttttfft1t1:,............ .. ,:::,........................,i111ttttttt11ttttttfttt\\n1tttt1ttfttttt11tfftttfftttttt1;::,,::.........,:,,,........................i1111ttttttt111tttttfttt\\n1ttt11tttttttt11tttttttttttttttttt111i.........,::,,................. . .;t11111ttt1tt111ttttttt1t\\n11t111tttt1tt111111111tttttttttttt111i,........,:,,...................,..,itttt111111111111111111111\\n1111111111111111111111tttttttttttt111i,....... ,:....................i111ttttttt11111111111111111111\\n1111111111111111111111ttttttttttt1111i,....... ,:,::,................,i1t11tttttt1t11111111111111111\\n111111111111111111111111tttttttt11111i,........,::;:,..................;1ttttttt11111111111111111111\\n1111111111111111111111111tttt11111111i........ ,,:::,..................,1ttttttttttt1111111tt1t11111\\n1111111111111111111111111111111111111i,........,,:::,...................it111ttttt11t11111ttttt11111\\n111111111111111111111111111111111111t1,........,,,:::,..................,1t1ttttttt1tttt11ttttt11111\\n11111111111111111111111111111111111111,........,,,;;::,..................i111ttttttttttttttttttt1111\\n\",\n \"ttftffftttttttffffffffLfttftttttttttt111tttt1111111tttt111111tttt1111111ttttttttttttttttttt11111111t\\nttfttttttttttttttftfLLLftffftffffftttttt111111111ttfffftt1tt1111111111111111ttftttftttttttt1111111tt\\nttftttttttttttttffffLftttfffffffLLLft11tttfft111tfffffffttt1ttttt11111ttttttfffftffffttttttt11111tt1\\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tt111ii11tft1ttttt11111tfftfffffftttfffffttt11111ttt1\\nttttttttttttffffttfffttfffffffffttffftttt111ttt1:,,,,,,,:i1111111t111111ttffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttftt1;:,,,,,,,,,;1tt111t1111t111tttffffftttftt1ttt111ttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttffft1i;;;;;;;;;;::1tttt11111ttt11111ttffffttt11tffft11ttttt\\ntttttttfffLLLLLLLLLftffftttffLLfftfftttttffffi:;iii111111i:ittttt1111ttt1tttt11tfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttttfffff;:;;;;iiiiiii:ittttt11111111ttttttttttt11tffffffffffttt\\ntttffftffLLLLLLLLLfttfftfLftfffffLLftttttffff1i;;;;;ii;iiiittttft11111ttt1ttt1ttttt11ttfffffLLfLfttt\\nttfLLfffffLLLLLLLfftfLLftfffLfffLLLftttttttf1i1i;i;;iiii1i1tffft111111tfft11t11tt1tttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1111iii;;;;ii1i1i11tt111t1111tffttfftt11tfftttfffLLLLLLLfff\\ntttffttfftffLftttttttttttttfLLLffLLfttttttttt11i;;;;iiii11t11111111111tffttfffttttttt11ttfLLLfffffff\\nttfLffffffftttfffffffffttftttfLfffLftttttffft11i;;;iiiii1t11ttttt11111ttt1fffttt1tttttttttfLLftftttt\\nttffffffffftttfffffffffttffttfffttttttttfft1111i;;;;iii1111111tttt1111tt11ffttffttfffffLffttftffffff\\nttffffffffttttffffffffttttttttttffftt11tttt11t1ii;;;iii11tfft11ttt111111t11tttfft1ttffffLLfttffLLLLL\\ntttffffffffttfffffffftt1ttt1111fffft1tt11iiii1iiii;iiii1i:1tft11111111tttt111ttt11ttffffLfftttffLLLf\\nttttttttfffttfffttttt1ttfft11111tft11i;:,..,;ti;;;i;iii1;,,,:;i1111111tttt111ttt1111tffffffftfLLLLLf\\ntfttttttttttttttttttttfffftttt11i;::,,......iti::;i;iitt:,,....,:;i111ttt111t1ttttt11111ttfftffffftt\\ntfttfffffttttttfffftttffffttft11:...........;ii::;i11tti,,,,.......,:itt111tt1ttffff11ttt111ttttttft\\nttttfffffftttffftfft11tfffttftt;,............,:;;;;;11;,..............;1111ttt1tffftttttfftt1ttfffLf\\n1t1tffffft11ttfffft1111tfttft11:.............,:ii;;;;;,...............:11t11tt1tfft11tfffffft1ffffLf\\ntttttfftt1tt11tttt1ttt11t1111t;,..............:i1;;;;:,...............,111111t11ftttttttfftt11tfffLf\\ntfftttttttfftt1111tttft11111t1,...............:ii;;;;,............,,,.,1tttt11111ttfftttttt1tt1tffft\\nttttttttttttttt11ttttttt11ttfi................:;::;::,...........,;i;;:1tttttt11ttffffftttttfftttttf\\ntfffttttftttttt11ttttttt11ttfi................,;;:::,............,;iiii1tttttft1ttffftfttttttttftttf\\ntfffttttfffffft11ttttttt11111;........ .......:;:::,............:iiiii11ttftt11tfffffffttfffffffttf\\ntfffttttftffff111ttttttt11ti:,....... ,:::;;:,.,;:::,............:;;ii:i11tt1111tfffffffttfffffffttf\\ntffftttttfffft111ttttttt11i,.........,iii;;;,..,:::,.............::;;,.it1111tt11tffffffttfffftffttf\\ntttttttttttttt111ttttttt11,.,,,,..,,,:;;;;;;,..,:::,.............,::;..:i111ttt11tfffffftttffttffttt\\nttttt1tttttttt111ttttttt11;,,,...... .:;;;;:...,:,,,.....................:111tt11ttttttt11tttttffttt\\nttttt1tttttttt11tttttttt111,..........,,,,.....,:,,.......................:111111ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft11i:,.....,.... .....,::,......................,1t11111ttttttt111tttttft1t\\n1tttt1tttttttt11ttttttttttttt1ii;;;:...........,:,,.....................,it111111ttttttt111ttttttt1t\\n11t1111tttttt111111111tt1tttttttt11:...........,:,,.............. .;t11111111111111111111111111\\n1111111111111111111111ttttttttttt11,.......... ,,................,:,,,:i1tttt1t111111111111111111111\\n1111111111111111111111tttttttttt11i,...........,,,,..............:1t11ttttttttttt1111111111111111111\\n111111111111111111111111tttttt1111;........... ,,:;,..............:11ttttttttttttt111111111111111111\\n11111111111111111111111111tttt1111;........... ,,:;:...............:111tttttttttt11t1111111tttt11111\\n1111111111111111111111111111111111;....,,......,,,::................i1ttttttttttttt1t11111ttttt11111\\n1111111111111111111111111111111111;............:,,;:,...............;1tttttttttttttttttt11ttttt11111\\n1111111111111111111111111111111111:............,,:;;:...............,1t1tttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttfffffttfLfttftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffft1ttt1111111111111111ttttttftttttttt111111ttt\\nttftttttttttttttffffLftttfffffffLLLftt1tttttt111ttfffffftttttttt111111tttttffffftffffttttttt111tttt1\\nttttttttttttttttfffLfttffffffLLffffttt1tttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111tttt\\nttttttttttttffffttfffttfffffffffttffftttt11111111i;i11ttt11tt1111t111111ttffffLLffttfLfft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLLfttttttfti:::,,,,:;i1ttfttt11t111tt111tttffffftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLftttttft1;,,,,,,,,,,;tffffft11111tft11111ttffLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLfLftffttttfffti;:;;;;iii;::1fffffttt111ttt1tttt1ttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLfftfftttttfffi;;iiiii1111i:iffffftt11111111ttttttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttttffi:;;;;iiiiiii:1ftttfftt1111ttt1ttt1ttttt111tffffffLfLfttt\\ntffLLfffffLLLLLLLfftfLLftftfLfffLLLLttttt1t1i;;;;;ii;iiii1ttffft111111tfft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft11i1i;;;;i111iii111tt111t1111fffttfftt11tfftttfffLLLLLLLffL\\ntttffttfftffLftttttttttttttfLLLffLLftttt1tti1i;;;;ii1iii1tt11111111111tffttffftttttttttttfLLLLfffffL\\nttfLfffffffttffffffffffttftttfLfffLftttttfftt1;;;;iiii11ttt1ttftt11111tfttffftt111ttttttttfLLftftttt\\nttffffffffftttfffffffffttffttfftttttttttfft111i;;;iiii1t111t1ttttt1111tt11ffttffttfffffLLfttffffffff\\nttffffffffttttffffffffttttttttttfffttt1tft1111i;;;iiii111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt1111tffft11t111111iiii;;iii111fffft11111111ttft111ttt11tfffffLfftttfLLLLf\\ntttttttttffttfffttttt1ttfft1t11ttfftttt1iiii1i;;;iii1i1i,;i1ttt1111111tttt111tttt111tffffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tff11i;:,,,:11i;;iii;it;....,:;i111111ttt111t1ttftt11111ttfftffffftt\\ntfttfffffttttttfffftttffffttfft1ii;:,,.....:11;:;;;;1tt;,,,.....,,;i11tt111tt1ttfffftttttt11ttttttft\\nttttfffffftttffftfft11tfffttft1;,..........:1ii;;ii1tti,,,..........,it1111ttt1tfffttttffftt1ttfffLf\\n1tttffffftt1ttfffft1111tfttft1i,............,:;ii;;i1i,..............:111111tt1tfft11tfffffft1ffffLf\\ntftttffttttt11tttt1ttt11t1111t;..............,;1i;;;;,...............,1111111t11ftttttttfftt11tfffLf\\ntfftttttttfftt1111ttttt11111tt:............. ,;ii;;;:,...............,i111tt11111tffftttttt1tttttfft\\nttttttttttttttt11ttttttt11ttft,...............;;;;;:,.................ittttttt11ttffffftttttfffttttt\\ntfffftttftttttt11ttttttt11ttf1,...............:;;;::,.......,,,.......;tttttfftttfffftfttttttttffttf\\ntfffttttfffffft11ttttttt1111t1,...............:;;;::........,;i;:,....;t1ttfttt1tfffffffttfffffffttf\\ntfffttttftffft111ttttttt11t111,...............,::::,........:iiiii:...;t11tt1111tffffLffttfffffffttf\\ntffft1tttfffft111ttttttt11ttt1,..... ..........::::,.......,;iiii;,...it11111tt1tfffLfLfttfffftffttf\\ntttttttttttttt111ttttttt11tt1:... .,..........,:::.........:;;i;,...,1t1t11tft11tfffffftttffttffttt\\nttttt1tttttttt111ttttttt1tt1:,...:;ii:.........,::,.........,:;;:.....,it1111tt11ttttttt11tttttffttt\\nttttt1tttttttt11ttttttttt1t;::,;iiii;,.........,:,,...........,,,......,;11111111ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft1ti:,,;;;:;;,.........,:,,.......... ..........:tttt1111ttttttt111tttttfttt\\n11ttt1tttttttt11ttttttttttt1,.,::::;;:.........,:,,...............,....;ttttt1111ttttttt111ttttttt1t\\n11tt11tttt1tt111111111111ttti:,,,::;:..........,:,,............ ......;ttttt11111111111111111111t111\\n1111111111111111111111tttttttt1:,,,............,:,.............,. .,;11tttttt1111111111111111111111\\n1111111111111111111111tttttttttt1:.............,,............ .11ii1ttttttt1111111111111111111111111\\n111111111111111111111111tttttt111,.............,::,,...........ittttttttttttt11111111111111111111111\\n11111111111111111111111111111111;..............,;;;:,..........:11tttttttttttttt11111111111111t11111\\n11111111111111111111111111111111;..............,;;;:,...........:11tttttttttttttttt1111111ttttt11111\\n11111111111111111111111111111111:..............,;;;;:...........:1ttttttttttttttttttttttt1ttttt11111\\n11111111111111111111111111111111:..............,;i;::,..........,1tttttttttttttttttttttttttttttt1111\\n\",\n \"ttftffftttttttfffffttfffttftttttttttt111tttt1111111ttttt11111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttftffLLftffffffffttttttt111111111ttfffffttttt111111111111111ttffttftttttttt11111tttt\\ntfttttttttttttttffffLffttfffffffLLLft11tttttt111tfffffffttttttttt11111ttttfffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffLfttffffffLLffffttt1ttttttt1ttfffffffffttttttt1111ttfftffffLftttfffffttt11111tttt\\nttttttttttttffffttfffttffffffffftttfttttt111ttt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttfLLLfftttttffLftttttttt11ii11fffft1ttfftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLLfttttt1i:;:,,::;i1tttffffftt11111tft11111ttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttfti:,,,,,,,,,:;tfffffttttt111tftttttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftffttttttti:::::;;;;;,,1ffttffttt11111111ttttttttttt1ttffffffffffttt\\ntttfftfffLLLLLLLLLfftfftffftffffLLLfttttti;iiiii11111;:1ttfffffftt1111ttt1ttt1tftttt11tfffffLLfLfttt\\nttfLLffffLLLLLLLLfftfLLftttfffffLLLLttttt;;i;;iiiiii1;:i11tfffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttft1ii;;;ii;;iii;tt11ttt111t1111tffttfftt11tfftttffLLLLLLLLffL\\ntttffttfftffLftttttttttttttfLLLffLLftttt11ti;;;iiii1iii1ttt1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttftttfLfffLfttttt11i;;;iii1iii1tttt1tfftt11111tfttffftt11tttttttttfLLffftttt\\nttffffffffftttfffffffffttfftttfftffttttfft11;;;iiiii11tt111ttttttt1111tt1tffttffttfffffLLfttftfLffff\\nttffffffffttttffffffffttttttttttfffttt1tft11i;iii11i11111tfft11ttt11111tt11tttfft1tffffLLLfttfLLLLLL\\nttfffffffffttfffffffftt1ttt111tfffftttt11111i;i;iiii111ttfffft11111111tttt11tttt11tffffLLfftttfLLLLf\\nttttttttfffttfffttttt1ttfftt111tfffttt111111;;i;;iii11i1ttffft11111111tttt111tttt11ttfffffLftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tffttt1t1ii1;;i;;iiii1;,::i11tt1tt1111ttt11tt1tfftt11111ttfftfLffftt\\ntfttfffffttttttfffft1tffffttfft11tft11i::,,1ii;:;ii;it:,,...,,:;i11111tt111tt1ttfffftttttt11tttttfft\\nttttfffffftttffftfft11tfffttfttttt1i:,....,it1i;;;;i1t;,,,,.......,;111t111ttt1tfffttttffftt11tffLLf\\n1tttffffftt1ttfffft111ttfttft11i;:,........i1tt1ii1tt1:,,...........:1111111tt1tfftt1tfffffft1ffffLf\\ntftttffttttt11tttt1ttt11t1111t;,...........,;;;11;;;;:..............,1t111111t1tftttttttfftt11tfffLf\\ntfftttttttfftt1111ttttt11111tt:..............:;ii;;:,................it111tt11111tffftttttt1tttttfft\\nttttttttttttttt11ttttttt11ttf1,..............,;;;;::,................it1tttttt1ttfffffftttttfffttttt\\ntfffttttffttttt11ttttttt11ttfi................;;;:::,,:;:,...........;tttttttftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt1111ti................:;:::,.:;iii;,.........:111ttfftt1tfffffffttfffffffttf\\ntfffttttftffff111ttttttt11t11;................,;:::,.;iiiii:.........:tt11ttt111tfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt1tttt;................,::::,.:;;ii;,.........;ttt1111tt1tfffLLLfttfffftffttf\\ntttttttttttttt111tttt1tt11ttti.................:::,...,;;i;,.........itttt11ttt11ffffffftttfftfffttt\\ntttttttttttttt111ttttttt11tt1;.................:::,....,:;:,.........,1tt1111tt11ttttttt11tttttffttt\\nttttt1tttttttt11ttttttttt1t11:.................:::,.... ..............:1111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfft11ti;,................,::,.........,......... :ttttt1111ttttttt111tttttfttt\\n11tt11tttttttt11tttttttt1tt1iiii:..............::,,...................:1tttt111111tttttt111ttttttt1t\\n11t1111tttttt1111111111t111iiiiii:.............,:,,,.................:1ttttt11111111111111111111t111\\n11111111111111111111111t11i;;iiii;.............,:,,,........... .,;ttttttttt1111111111111111111111\\n1111111111111111111111tt1t1i;;ii;,.............,,........... :i;;i1tttttttt1111111111111111111111111\\n1111111111111111111111111ttti:,,...............,,,.......... :ttttttttttttttt1t111111111111111111111\\n11111111111111111111111111111;::...............:;;::,........,i11ttttttttttttttt1111111111111tt11111\\n111111111111111111111111111111t;...............:ii;;:,........;t1tttttttttttttttt1t1111111ttttt11111\\n1111111111111111111111111111111:...............:;i;:::........:tttttttttttttttttttt1ttttt1ttttt11111\\n1111111111111111111111111111111:............. ,;ii;;;:,..,,...:ttttttttttttttttttttttttttttttttt1111\\n\",\n \"ttfttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt11111111t\\nttfttttttttttttttttffLLttffffffftttttt1t111111111tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttffttttt1111tt1ttffffffttttt1111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffttttffffftttffftt11t111tt111ttfffLLftttftt1tt111tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttt11i;;;;i1tftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLLfftffttttti:::,,,,::;i1tffffffffttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffLfftfftttt11;,,,,,,,:,,,;tffffffffttt1111t11ttttttttttt1ttffffffLfffttt\\ntttfftfffLLLLLLLLLftffftfLftffffLLLftttt1i;;;;iiiii:,:1tttfffffftt1111ttt1ttt1tfttt111tfffffLLfLfttt\\nttfLfffffLLLLLLLLfftfLLftttfLfffLLLLttt1i1iiiii1111i::1111ttffft111111ffft1tt11tt1tt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt11;;;iiiiiii:;ttt111tt111tt111tffttfftt11tfftttffLLLLLLLLffL\\ntttffttffttfLftttttttttttttfLLLffLLftttt1i;;;iii;iii;ittfft11tt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttfttfLLfffLfttt111;;;i111111iitfttt1tfftt11111tfttfffttt1tttttttttfLLftfttft\\nttffffffffftttfffffffffttffttffftfftttttt1i;;iiiii1i1tft11tttttttt1111tt1tffttffttfffffLLfttftffffff\\nttffffffffftttffffffffttttttttttfffttt1ttti;;;i111iitt111tfft11ttt111111t1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111tfffftttt111ii;iii;ii11111tfffft11111111tfft11tttt11tffffLLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111tffftttt1111;;;i;;;i111ttttffftt1111111tttt111tttt11ttfffffLftfLLLLLf\\ntfttttttttttttttttt1ttfffftttt11tfft111tt1i;;;i;;i1i1;i11tffftt11t1111ttt11tt1tfftt11111ttfftfLffftt\\ntfttffffftt11ttfffftttffffttfft11tft11ii;ii;;;;:;iii1,.,,,:;iii1ttt111tt111tt1ttfffftttttt11ttttfftt\\nttttfffffftttffftfft11tfffttftttttt1;:,..:11;;i;;;;11:,,,.....,,:i1111tt111ttt1tffftttttfftt1ttffLLf\\ntt1tffffftt1ttfffft1111tfttft1111i:,.....,i11iiiii1tt:.,..........:111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11tttt1ttt11t11111;:,.........;i11i1111t;..............;t11111111t1tfttttttfffftt1tfffLf\\ntfftttttttfftt1111ttfft111111:.............,::;ii;;:...............:111111ttt111ttffftttfft1tttttfft\\nttttttttttttttt11ttttttt11tt1,..............::;;;;;,...............,1111tttttt11tffLffftttttfftttttt\\ntfffftttffttttt11ttttttt11tfi,..............,::;;::,,...............i111ttttfftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt111ti................::::::,:;;::,..........it111ttffttttfffLfLfttfffffffttf\\ntfffttttftffff111ttttttt1tt1;................,;::::.:iiiii,.........;11111ttt11ttfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt11tti,................::::,.:ii;ii:.........;tttt1111ttttfffLLLfttfffftffttf\\ntttttttttttttt111ttttttt1ttf1.................,:::,.,:;iii:.. ......:ttttt11tft11tfffffftttfftfffttt\\ntttttttttttttt111ttttttt1ttt;::...............,:::,. .:;ii:..........;ttt1111tt11tttttft11tttttffttt\\nttttt1tttttttt11ttttttttt1t111i;,..............:::,....,::,...........;1111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttfftt1iiiiii:.............:::,.... ............. :ttttt1111ttttttt111ttttffttt\\nt1ttt1tttttttt111ttttttttt1i;iiii;,............,:,,,................. ,1tttt111111tttttt111ttttttt1t\\n11t1111tt1ttt11111111111111i;iii1i,............,::,,.................:1tttt11111111111111111111tt111\\n11111111111111111111111111t1;;;;;,.............,:,,,.......... .:1tttttt111111111111111111111111\\n1111111111111111111111111t11;,.................,:,,..........,;:::;1ttttttt1111111111111111111111111\\n11111111111111111111111111111:..,..............,,............:ttttttttttttttttt111111111111111111111\\n111111111111111111111111111111ii;..............,::,...........i111ttttttttttt11111t11111111111111111\\n111111111111111111111111111111t;...............,;ii;::,.......:1ttttttttttttt11t1tt1111111ttttt11111\\n111111111111111111111111111111i,...............:;ii;;;:,......,1ttttttttttttttttttt111111tttttt11111\\n11111111111111111111111111111ti,...............:;ii;;;;:,..:..,1ttttttttttttttttttttttttttttttt11111\\n\",\n \"ttfttfffttttttffffttfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLttffffffffftttttt111111111tfffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLftttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttffftttt1111tt1ttffffffttttt1111t111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffftttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffftfLftttttfttttttttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttffLffftffttttt1ii::::;111tttffffffffttt111tft1tttt1ttffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLfftffttttt1:,,,,,,,,:;ittffffffffttt1111t11ttttttttttt1ttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLftffffLLLftttti::,::::::,,,;ttttfffffftt1111tft1ttt1tffttt11tfffffLLfLfttt\\nttfLffffffLLLLLLLfftfLLftttfLfffLLLfftt11iiiii111i;,,;t111tfffft111111ffft1tt11ttttt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiii1111i:,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLftttti;;;ii;iiii::1ttttt11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLfffffffttffffffffffttfttfLLfffLfttt1i;;i1i;iiii:;tftttt1tfftt11111tfttfffttt1tttttttttfLLftftttt\\nttffffffffftttffffffffftfffttffftffttttti;;iii111i1iitft11tttttttt1111tt11ffttffttfffffLLfttftfffffL\\nttffffffffftttffffffffttttttttttfffttttti;;;ii1111ii1t111tfft11ttt111111t11tttfft1tfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111tfffftttt1i;;;iiiiii11111ttfffft11111111tfftt1tttt11tfffffLfftttfLLLLf\\nttttttttfffttfffttttt1ttfft1111ttffttt111i;;ii;;;itt11ttttfffft1111111tttt111tttt11tttfffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfft1t1t1i;;;ii;;it111ttttffftt11t1111ttt111t1tfftt11111ttfftfLffftt\\ntfttffffftt11ttfffftttffffttfft1ttft11ii1;;;;i;:;i1;;i11tttft111tt1111tt111tt1tffffftttttt11ttttfftt\\nttttfffffftttffftfft11tfffttftttt1i;:,,:1i;;;;i;;;1;.,,,;;i11111111111tt111ttt1tffftttttfftt1ttffLLf\\n1tttffffftt1ttfffft111tffttft1ii:,.....,11iiiiiii1t:,,,.....,:;i111111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11tttt1ttt11t11i;:,........,i1tt1ii11tt:,,,,........:t11111111111t1tfftttttfffftt1tfffLf\\ntfftttttttfftt1111ttfftt11i,............::;;iiiii1;,,............it1111111ttt111ttffftttfft1tttttfft\\nttttttttttttttt11ttttttt11;...............:;;;;:;;...............:111111tttttttttffLffftttttfftttttt\\ntfffftttffttttt11ttttttt11:...............,;;;;;;:,..............,111111ttttfftttffffffttttttttffttf\\ntfffttttfffffft11ttttttt11,...............,:;;;;:,...............,1111111ttffttttfffLfLfttfffffffttf\\ntfffttttftffff111ttttttt11:...... ........:;;;;:,...............,11111111ttt1tttfffLfLfttfffffffttf\\ntffft1tttfffft111ttttttt11:.......:;;;:....,;;::::.......,::,....,1tt11tt1111tt1tfffLLLfttfffftffttf\\ntttttttttttttt111ttttttt11:.....:;;;;;:.....:;:::,.......,:iii;,.,1t1t11tt11tft1tffffffftttfftfffttt\\ntttttttttttttt111ttttttt1i,.....:;:;;;:.....,::::,........;;iii;..;t1111t1111tt11tttttftt1tttttffttt\\nttttt1tttttttt11tttttttt1i,.....:::;;;,......::::,.......,;;ii;:..,;1t11111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttttttti....,,,,:;;,.......,:::,,.......,;;;;,....,it11tttt1111ttttttt111ttttffttt\\n11tt11tttttttt111ttttttt1:,,.,,,..,,,.........::::,........,:;,..... ,1tttttt11111ttttt1111ttttttt1t\\n1111111tttttt11111111111i,,..,,,.... .........::::,..................itttt111111111111111111111tt111\\n1111111111111111111111111,...,,...............,::,,,...........,,...;tttttt1111111111111111111111111\\n11111111111111111111111111,..... .............,::,,,......... . .:1tttttt1111111111111111111111111\\n1111111111111111111111111ti,,,.,,..............::,,..........,,,::i1tttttttttt1111111111111111111111\\n11111111111111111111111111111i11;..............:,............,1tttttttttttttt11111111111111111111111\\n1111111111111111111111111111111i...............:;:::::,.......;tttttttttttttt11t1ttt111111ttttt11111\\n1111111111111111111111111111111:...............:iiii;;::,......ittttttttttttttttttttt1111tttttt11111\\n1111111111111111111111111111111,...............:iiiii;;:,......,1tttttttttttttttttttttttttttttt11111\\n\",\n \"tttttfftttttttffffftfffftfftttttttttt111tttt1111111tttt111111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffffttt1tt111111111tfffffftttt1111111111111111ttftttftttttttt11111tttt\\nttttttttttttttttfffffftttfffffffLLLftt1tttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttffffffLLffffttttttttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1tffffftttffftt11t111tt111ttfffLLffttfft1tt111tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttftttffffffftt1111tftt1111tffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLftffttttfLLffftfftttttftttttttffttttffffffffftt111tftttttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftffttttttiii;::::i1ttttffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffttffLLLLLLLLLftffftfLfttfffLLLfttt11:,,,,,,,:::itttttfffffft11111tft1ttt1tffttt11tfffffLLfLfttt\\ntffLffffffLLLLLLLfftfLLftttfLfffLLLLfttt1i::::,,::,,,itt11tfffft111111ffft1tt11tt1tt1ttffLLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttttiiiiii1i;:,,:ttt111ttt11tt111tffttfftt1ttfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLftttti;iiii111i;:,iftftt11ttt11111tffftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttfttfLLfffLfttt1;;;ii;iiii;::1ffttt1tffft11111ffttfffttt11ttttttttfLfftftttt\\nttffffffffftttffffffffftfffttffftfftttt1;;i1i;;iii;:itft11tttttfttt111tt1tffttffttfffffLLftfftfffffL\\nttffffffffftttffffffffttttttttttffftttt1;;iiii111iii1t111tfft1tttt111111t1ttttfftttfffffLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttffftttti;;iiiiiiiii1111ttfffft11111111tffttttttt11tfffffLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111ttfftttt1;;;iiii;;itt11tffffffft1111111tttt111tftt11tttfffffftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfftttt1i;;;;ii;;it1111tftfffft11t1111ttt111t1tfftt11111ttfftfLffftt\\ntfttfffffttt1ttfffftttffftttfft11tft111i;;;;;ii;;i111111tttft111tt1111ttt11tt1tffffftttttt11ttttffft\\nttttfffffftttffftfft11tfffttfttt11i;;:ii;;;;iiiii1;11tt111t11111tt1111tt111tft1tffffttfffftt11tffLLf\\n1tttffffft11ttfffft1111tfttftii;:,....;1i;;;;ii111,,:;i1tt11tt11111111111t11tt1tffft1tfffffft1fLffLf\\ntftttffttttt11ttt11ttt1111i;:,.......,i1tiiii;;11i,,,..,:;i1t1t111t1111111111t1tfftttttfffftt1tfffLf\\ntfftttttttffttt111ttttt1i:...........,ii111iii11i:.,,......,:;1t111111111tttt111ttfLftttfftttttttfft\\nttttttttttttttt11tttt11t;..............,::;;i1ti:,............,1t1111111tttffttttffLfffttttffffttttt\\ntfffttttfftfttt11tttttt1,...............:;:;;;;;:..............;tt111111tttffftttffffffftttttttffttf\\ntfffttttfffffft11tttttt1................,;;;;;;;:..............:t11111111ttffttttffLLfLfttfffffffttf\\ntfffttttfttftt111tttttti............... .:;;;;;:,..............:1111111111tttttttffLLfLfttfffffffttf\\ntffft1ttttttft111tttttt;............. .:;;;;;;:::..............:111tt11tt111ttt1tfffLLLfttfffftffttf\\ntttttttttttttt111ttttt1,..............:;i;;i;::::..............:1ttt1111tt11tff1tffffffftttfftfffttt\\nttttttttttt1tt111ttttt;..............:;;;;;i:::::..............;1111111111111tt11tttttftt1tttttffttt\\nttttt1tttttttt11tttttt:..............:;;;::;:::::..............;t1111111111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11ttttt1,........... .,,:,...,:::::..............,11i;;i111tttt1111ttttttt111ttttffttt\\n11tt11ttttttt1111tttt;............,..... ...,::::...............:i;:;;i1ttttt11111tttttt111ttttttt1t\\n11111111t1tt111111111,............,.........,::::,..............,:::;ii1tt111111111111111111111tt111\\n111111111111111111111,............ .........,,,::,..............::::;i11tt11111111111111111111111111\\n1111111111111111111111:....... .............,,:,,..............,::::i111t11111111111111111111111111\\n11111111111111111111111:....,,,,.............,:::,,..................,1t1111111111111111111111111111\\n111111111111111111111111iiii11t; .............,:,..,........ ..:1tttttt11111111111111111111111\\n111111111111111111111111111111t:...............:,,,:,,......,,,,,:;;1tttttttt1t111tt1111111tttt11111\\n111111111111111111111111111111t: .............::;ii;::,.....,i111ttttttttttttttt11ttt111111tttt11111\\n111111111111111111111111111111t:..............:;;iiii;:,.....,i1ttttttttttttttttttttttttttttttt11111\\n\",\n \"tttttfttttttttffffffffffffftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffffttt1tt111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\\nttttttttttttttttffffLftttfffffffLLLfttttttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\\nttttttttttttttttfffffttffffffLLffffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\\nttttttttttttffffttfffttfffffffffttfftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfLftttttttfffft1ttfffffttffftt11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffttttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftfftttttfftffffffftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftttttt1iii::;i1ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\\nttttfttfLLLLLLLLLLfftfftfLfttfffLLLfttt11:,::,,,,,:;1tttttfffffftt1111tft1ttt1tffttt11tfffffLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLffttt1;:,,,,,,,,,;ttt11tfffft111111ffft1tt11ttttt1ttffLLLLLLLLfff\\ntfffffttttfLLLffttttfffffttLLLLfLLLftttt1iiiiiiii;:,,iftt111ttt11tt111tffttfftt11tfftttffLLLLLLLLffL\\nttttftttttffLftttttttttttttfLLLffLLfttt1i;iii1111i:,:1ftfft11ttt111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLfffLfttt1;;;i;iii1i:,;tffttt1tffft11111tfttfffttt11ttttttttfLLftfttft\\nttffffffffftttffffffffftffftttfffffttt11;;;ii;;iii::1fft11tttttfttt111tt1tffttffttfffffLLffffffffffL\\nttffffffffftttffffffffttttttttttfffttt1i;;iiiii11i;itt111tfft1tttt111111t1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttfffttt1i;;iiiiiiiii1111ttfffft11t11111tffttttttt11ttffffLfftttfLLLLL\\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;;1t11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\\ntfttttttttttttttttt11tfffftttt11tfftt111;;iiiii;;;1111ttftfffft11t1111tttt1tt1tffttt1111ttfftfLffftt\\ntfttfffffttt1ttftfftttffftttfft11tft1i1i;;;;iii;;;111111tttft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfftttfttt11i;;;1;;;;;iiii;i1t11t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\\n1t1tffffft11ttffttt1111tftttti;:,,...:1i;;;;iiii1i:;i1ttt111tt11111111111t11tt1tffft1tffffffttfLffLf\\ntftttfftt11t11ttt11ttt111i;:,,.......:11ii;;ii;11i,.,,:;11tt11tt11t1111111111t1tffttttffffftt1tfffLf\\ntffttttttttftt1111ttttt1:............:1111iiii1ti;,,....,,;i1tttt11111111tttt111ttfLffttfftttttttfft\\nttttttttttttttt111ttt1t;...............,:;;i1tt1;,..........,itttt111111tttttttttffLfffttttffffttttf\\ntfffttttfftfttt11ttttt1,................:::::;i;:,...........,1ttt111111ttttfftttffffffftttttttffttf\\ntffft1ttffffff111ttttti.................,;;;;;;;:,...........,1t111111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttttti................,,;;;;;;::,............it1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt;.............:;iii;;:;;:::,............it1111111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttti,............,;;iiii::;::::,...........,1ttttt111ttt11tft1tfffffLftttfftfffttt\\nttttt1tttt11tt111ttt1:.............:;;;iii;::::::............,1tttt1111111111tt1tttfttftt1tttttffttt\\nttttt1tttttttt11tttti..............,;;;;:,,:::,,:............:tt11t11111111111t11ttttttt11tttttffttt\\n1tttt1tttttttt11tttt:............. ,::,. .::,,,:........... :t1111111t111ttt1111ttttttt111ttttffttt\\n11tt11tttttt111111ti.......................,:::::.............it111t11111tttt1111tttttt1111ttttttt1t\\n1111111111111111111,.............,.........,:::::.............:1t11ii;:;11111111111111111111111tt111\\n1111111111111111111:........................,,:::..............;ii;:;:;ii111111111111111111111111111\\n11111111111111111111:....... ..............,,,:,...............,:::::;i1111111111111111111111111111\\n111111111111111111111:......,,..............,,,:,...............:::;::;i11t1111111111111111111111111\\n1111111111111111111111iiiiii1;...............,,,,.,..............,::::;11111111111111111111111111111\\n11111111111111111111111111111;................,,:,,,...... .it1111111111111111111111111111\\n1111111111111111111111111111t;...............;i;;;::,.....,,.....,,,;i1ttttttttt11tt111111ttttt11111\\n1111111111111111111111111111t;...............:i;;i;::,....:i111111tttttttttttttttttttttttttttttt1111\\n\",\n \"tttttfttttttttffffftfffftfftttttttttt111tttt1111111ttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLLftfffffffftttt1t1111111t11tfffffftttt1111111111111111ttftttftttttttt111111ttt\\nttttttttttttttttffffLftttfffffffLLfftt1tttttt111tfffffffftttttttt11111tttttffffftffLfttttttt11111ttt\\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt11111tfffffffLffttfffffttt1111ttttt\\nttttttttttttffffttfffttffffffffftttftttttt11ttt1ttfffffftttttt11tt111111ttffffLLLfttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttfffttttt1tfffft1ttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLftttttttfffffftttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftffttttt111i;iitfftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftttt1;:,::,,,:;ittttffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttfffLLLftt1i:,,,,,,,,,,:1tttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLftt1i;;;;;;;i;:,:tftt11tfffft11111tffft1tt11ttttt1ttfffLLLLLLLfff\\ntfffffttttfLLLffttttfffffttLLLLfLLLft1;iiiii11111i::tffft11tttt11t111tfffttfftt1ttfftttffLLLLLLLLffL\\ntttfftttttffLftttttttttttttfLLLffLLftt11;;;iiiiiii:;tffffft11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttLLfffLft11i;;;;i;;iii;tffffttt1tffft11111tfttfffttt1tttttttttfLLftffttt\\nttffffffffftttffffffffftffffttfftfttt11i;;;i1iii1iitffft11tttttfft1111tt1tffttffttfffffLLfffftfLffLL\\nttffffffffftttffffffffttttttttttffftt11i;;;iii111ii1tt111tfft1ttft111111t1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt111ttffftttti;;;;iiiiii11111ttfffft11t11111tfftttttttt1tfffffLLftttfLLLLf\\nttttttttfffttfffttttt1ttfft1111ttffttt1i;;;iiii;;itt11tffffffft1111111ttttt1ttfft11ttffffLfftfLLLLLf\\ntftttttttttttt1tttt11tfffft1tt11tfft111;;;;;iii;;it111ttfffffft11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttffffftt11ttftfftttffftttfft11tti;;1;;;:;iii::i111111ttfft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfftttft1i;:,..,1i;;;;iii;i;:;;1t111t11111tt1111tt111tft1fffffttfffftt11tffLLf\\n1tttffffft11ttffftt1111tt1ii:,,......,i1i;;;ii;11;...,:;i111tt11111111111t11tf1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt11ttt11;,,..........,11t1iiii1t1:,,.....,:i111111t1111111111t1tffttttffffttt1tfffLf\\ntffttttttttfttt111ttttti,.............:;;iii11t1i,,.........,ittt11111111tttt11tttfLffttffttttttffft\\nttttttttttttttt111tttt1:................:;;;;;i;:,...........:ttt1111111tttffttttffLLffttttffftttttf\\ntfffttttftttttt11ttttti.................,;;;ii;;:............,1ttt11111ttttffftttffffffttttttttffttf\\ntffft1ttfffftf111ttttti..................:;;;i;;:,...........,1tt11111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttttt;..................,;;;;;::,...........,1t1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt;...........,,.....,;;:;:::............,111111111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttti,........,;ii:......:;:::::............,ittttt111ttt11tft1tfffffLftttfftfffttt\\nttttt1tttt111t111tttt;........:;;;;:,.....,;:::::.............ittttt1111t1111tt1ttfttttttttttttffttt\\nttttt1tttttttt11tttt1,.......,:::;;;,......::::::.............;tt1t1111111ttt1tttfttttttt1tttttffttt\\n1tttt1tttttttt11tttti.........,:::;:.......,:::::..........,,:;1t11111111ttff1111ttttttt111ttttffttt\\n111111tttttt111111t1,..........,:::........,:::::..........,:;;i1111t111ttttt11111ttttt1111ttttttt1t\\n1111111111111111111;............,,.........,::::,.........,:;;;i1111111111111111111111111111111tt111\\n11111111111111111111:.......................,:::,.. ......,:;;ii111111111111111111111111111111111111\\n111111111111111111111:.......,..............,:::,..........,::i11t1111111111111111111111111111111111\\n1111111111111111111111:,,..,, ..............,,,::,............,1111111111111111111111111111111111111\\n1111111111111111111111111i11:...............,..,:,,..... ..:1t11111111111111111111111111111111111\\n111111111111111111111111111;................,::::,,.....::::;i11tttt111111t1111111111111111111111111\\n111111111111111111111111111,.................ii;;::,....:1tttt1ttttttttttttttttt11tt111111ttttt11111\\n1111111111111111111111111ti..................;i;;;:,.....;t1ttttttttttttttttttttt1ttttttttttttt11111\\n\",\n \"ttffftfffttttttttftttfffttftttttttttt111tttt111111tttttttt111tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLLftfffffffftttt1t111t111t11tfffffftttt111111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttffffLftttfffffffLLffttttttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111tttt1\\nttttttttttttttftfffffttffffffLLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttffffttfffttffffffffftttfttttt1111tt1ttffffffttttt1111tt11111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttffftttt11tttffttttfffffttfffft11t111tt111ttfffLLftttftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLftt11ii;i;;ii1tttffttffffffftt1111tftt111ttffLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfLLffftfftt1:,,,,,,,,:iftttfffffffffftt111tft1tttttttfLLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftff1i;;:,,,,,,,,:;ttttfffffffffftt1111t11ttttttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttfffLLLt;,,:;;;;;iiii:ittttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLLffLLLfi,:iiii111111;1ffftt11tfffft11111tffftt1t1tttttt1ttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttLLLLfffffi:;;;;;iiiiiiitffffft11tttt11t111tfffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttfffftttttttttttttfLLLffLLti;;;;;i;;iiii1ftffffftt11tt1111111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLfffLtii;;;ii;;i1111tfffffttt1tffft11111tfttffftttttttttttttfLLfffffft\\nttffffffffftttffffffffftffffttfftftt1ii;;;;;;iii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffftttffffffffttttttttttffftt11i;;;;;i111111tt111tfft1ttft11111tt1ttttfftttffffLLLfttfLLLLLL\\ntttffffffffttfffffffftt1ttt1111tfffttti;;;;;;iiiii11111ttfffft11t11111tfftttttttt1ttfffLLLftttfLLLLf\\nttttttttfffttfffttttt1ttfft11111tfft11i;;;:;;ii;;itt11ttfffffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntftttttttttttt1tttt11ttffft1tt11ttti::i;;;:;iii;;;i;i1ttftfffft1tt1111tttt1tt1tffftt1111tffftfLffftt\\ntfttffffftt11ttftfft1tffftttff1i;:,...;1;;;;;i;:;i,..,:;i1tft111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffftttt11tfft11i;:,......,11;iii;;iii,,,....,:;i1111t1111tt111tft1fffffttfffftt11tffLLf\\n1tttffffft11ttffftt1111t1;;,..........,i1t11ii11i:.,........,111111111111t11tt1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt11ttt11:..............;iiiiiii11,,,......,,,itt11t1111111111t1tffttttffffftt1tfffLf\\ntffttttttttfttt111ttttt;................,;;;i;;ii,...........;ttt11111111ttt111tttfLffttfft1ttttffft\\nttttttttttttttt111ttt11:.................:;;;i;::............;ttt1111111tttftttttffLLffttttffffttttf\\ntfffttttftttttt11ttttt1,.................,;;;;;;:............:ttttt11111tttffftttffffffftttttttffttf\\ntffft1ttfffftf111ttttt1,..................:;;;:::............:1tt11111111ttffttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttti...................,;;::::............,111111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttttt:...................,::::::,:::,.......,1t1t11111tt111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111tttt1,....................,::::::;;;ii:......ittt11111ttt1ttff1tfffffLftttfftfffttt\\nttttt1ttttt11t111tttti.....................,:::::,;;;ii;,.....itttt1111tt111tttttttttttttttttttffttt\\nttttt1tttttttt11ttttt;........ .............:::::,;;;ii;,.....:1t1t1111111tttttttfttttttt1tttttffttt\\n1tttt1tttttttt11ttttt:.... :i;:.............:::::..,;;i:.......it11111111ttff1111tfttttt11tttttffttt\\n11tt11tttttt1111111t1,...,;iiii;, ..........::::,. .,:,......;111111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111i..,.,;;;iii;...........:::::.......,....itt1111111111111111111111111111111tt111\\n11t111111111111111111;....::;;ii;...........::::,..........,;111111111111111111111111111111111111111\\n1111111111111111111111, ...,:;;;,............,,:,.....,,:;11tt11111111111111111111111111111111111111\\n1111111111111111111111i:,....... ............,,:,.....:1tttttt11111111111111111111111111111111111111\\n1111111111111111111111111;.,. ..............;;;:,,....,it11ttt11111111111t11111111111111111111111111\\n111111111111111111111111i,..................;ii;:,.....,1t1ttttt1111111111t1111111111111111111111111\\n111111111111111111111111:...................;ii;;:......;ttttttttttt11tttt1t111111tt11111111ttt11111\\n111111111111111111111111:...................:i;:;;,.....:t1tttttttttttttttttttttt1tttttttttttttt1111\\n\",\n \"ttffftfffttttttttttttfffttftt111ttttt111tttt111111ttttttttt11tttt111111ttttttttttttttttttttt111111tt\\nttfftttttttttttttttffLLftfffffffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttffffLftttfffffffLLfft111ttttt111tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttffffffLLLfffttt1ttttttt1tffffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\\nttttttttttttfffftttffttffffffffftttftt1t1iii11111tfffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttffft11i:,,,::::;1tfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfft1;:,,,,,,,,,:tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfftt1::,,,,,:::::;itfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\\ntttttttfLLLLLLLLLLfttttffftffffttf1,,,,:;iii1111itftttfffffffffftt1111t11ttffttttttttttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttffffft:,,,:;iii111ii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfLLftttfLfffLft:,,:;;;;iiiiii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttfLLfffft;:::;;;iii;iii1tffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttfffftttttttttttttfLLLffffti;;;i;;iii;iitfffffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\\nttfLffffffftttfffffffffttffttfLftfft1i;;;;;iiiii11ffffftttt1tffft11111tfttffftttttttttttttfLLffffftt\\nttffffffffftttfffffffftttfftttftttttt1;;;;;iiiii11ttffft11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffftttffffffffttttttttttfftt11i;;;;;;ii1111ttt111tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\\ntttffffffffttfffffffft11ttt1111ttff1;i;;;;;;;ii;iiii111ttfffft11t11111tfftttttttt1tffffLLLftttfLLLLf\\nttttttttfffttffftt1tt1tttft1111tt1;,.:i;;;;;iii::;;,,:;i1tfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntfttttttttttttttttt11ttffft1tti;:,...,ii;;;;ii;::;;.....,:itftt1tt1111tttt1tt1tffftt1111tffftfLffftt\\ntfttffffftt11ttftfft1tttft1i;:,.......:11iiii;;;:;:,,,,,,..;t111tt1111ttt11tf1tffffftttttttttttttfft\\n111tfffffftttffttttt11tti;:,..........,1tt1ii11i;;,,.,.,,,,,1111t11111tt111tft1tffffttfffftt11tffLLf\\n1tttffffft11ttttttt1111;...............:11iiii;;1;.,.,,.,..,1t11111111111t11tf1tfffttfffffffttfLffLf\\ntfttttftt11t11ttt111tt1,................,;;;ii;i1:.........,111t1111111111111t1tffttttffffftt1tfffLf\\ntffttttttttftt11111ttt;..................:;;;;:;i:..........itttt11111111ttt111tttfLffttfft1tttttfft\\ntttttttttttttt1111ttt1:..................,;;;;:::,..,.......;tttt1111111tttffttttffLLffttttffftttttf\\ntfffttttftttttt11tttt;....................:;;::::,,.........:ttttt111111ttttfftttffffffftttttttffttf\\ntffft1ttfftttt111tttt:....................,;:::,:;;;;:,.....:1ttt11111111ttffttttffLLfLfttfffffffttf\\ntffft1ttfttttt111ttt1,.....................:::,,::;iii;,.....itt1111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt111ttt;......................,::,,::;;;i;,.....:111111111tt111tttttfffLLLfttfffftffttf\\nttttt11ttttttt111tt1:......................,:,..:,:;;i;.......:tttt1111ttt1ttffttffffffftttfftfffttt\\nttttt1ttttt111111tt1:......................,:,..:. .:;:......,itttt1111tt111ttttttfttffft1tftttffttt\\nttttt1tttttttt111tt1:........... .........,,,.,:...........,1tt11tt111111ttt1ttttffftttt1tftttffttt\\nttttt1tttttttt11ttti,......... .,..........,,,.,:..........,it11111111111ttft1111ttttttt11tttttffttt\\n11tt11ttttt111111tt:..........,::;,........,,,.,:......,:i11t11111111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111:........:;;ii;.........,,.,,.....i1ttt11t11t111111111111111111111111111111tt111\\n1111111111111111111ti........,:;;i;,...........,,.....;t11111111111111111111111111111111111111111111\\n11111111111111111111ti;,......,:;;;. ......,:,.,:.....,1t1t11111111111111111111111111111111111111111\\n11111111111111111111111;........,,,........:;::,,......;t1tttt11111111111111111111111111111111111111\\n1111111111111111111111i......... ........:;;::,......,1ttttt11111111111t11111111111111111111111111\\n1111111111111111111111:........ ...........:;;;::.......it1ttttt1111111111t1111111111111111111111111\\n111111111111111111111i,........,......... ,ii;;::,......:ttttttttttt11ttt1tt11t111tt111111t1tttt1111\\n11111111111111111111t;.........,..........:iiii;::,.....,1ttttttttttttttt1ttt1ttt1tttttttttttttt1111\\n\",\n \"ttttftfffttttttttttttfffttttt111ttttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11tffffffttttt11111111111111tttftttfttttttttt1111tttt\\nttttttttttttttttfffffftttfffffffLLLft111tttttt11tfffffffftttttttt11111ttttfffffftfLLfttttttt111ttttt\\nttttttttttttttttfffffttfffffffffffft11111;:::;;i1tffffffffttttttt1111ttffffffLffttffffffttt1111tttt1\\nttttttttttttfffftttffttffffffffftttft1;::,,,,,,,,ifffffftttttt11tt111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLfttttffLLLfftttttff1;:,,,,,,,,,,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLLfttfffttt1:,,,,:::;;i;;1tttftttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfftt;,,,,,:;ii11t11tfttttffffffffftt111tft1ttfttttfLLfttttfffffftttttt\\ntttttttfLLLLLLLLLLfttttffffffffttt;,,,,:;;;iii1111ttttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\\ntttffftfLLLLLLLLLLfttfftfffttttfft:,,,,:;;;iiiiii1tttttttffffffftt1111tft1ttt1tftttt11tffffLLLLLfttt\\nttffffffffLLLLLLLfftfffftttfLftfLfi;;;;;;;iii1iii1tffftt11tfffft111111ffftt1t1tttttttttfffLLLLLLffff\\ntfffffttttfLLLffttttfffffttfLLftfffi;;;i;;;;iiiii1fffffft11tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttfftttttffffttttttttttttttffftffft;;;;;;;;iiii1tttfffffft1tttt1t1111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttftttffftfft1;;;;;;;;iii1ttfffffttt1tffft11111tfttfLftttttttttttttfLLftffftt\\nttffffffffftttfffffffftttfftttftttt1i;;;;;;;;ii111tffftt11tttttfftt111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tt1111ttt1::i;;;;;;;i1i;i111ttt11tfft1ttft11111tt1ttttfftttffffLLLfttffLLLLL\\ntttffffffffttffffffftt111tt111i;:,..;i;;i;iii11;;;;,::;1tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\nttttttttfffttffttttt111ttt1;:,......,ii;;iii;11;:;;,...,:1fffft1111111ttftt1ttfft11ttffffffftfLLLLLf\\ntftttttttttttt11tt111tt1;:,..........;11iii;1t1;:;;,,,,,.:tfttt1tt1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttffffftt11tttttt111:..............:1tt1ii11i::;:,,,,,,,if1111tt1111ttt11tf1tfffffttttttttttttffft\\n111tfffffft1tfftttt11;................:ii;;i;:,,;;,.,,.,..it1111111111tt111tft1tffffttfffftt1ttffLLf\\n1tttffffft111tttttt1i,............,....:;;;;;;:,1i,..,,,..;ttt11111111111t11tt1tfffttfffffffttfLfLLL\\ntfttttftt1t111ttt111;..................,;;;;;:,:1i,.......it111t11t1111111111t1tffttttffffftt1tffLLf\\ntffttttttttft1111111,...................:;;;::,,;;,.......it1tttt11111111ttt111tttfLffttfft1tttttfft\\ntttttttttttttt1111t;....................,;;:::,.:,..,.....:tttttt1111111tttffttttffLLffttttffffttttf\\ntfffttttfttttt111t1,.....................;;:::..:,........,1tttttt111111ttttfftttffffffftttttttffttf\\ntffft1ttfftttt111ti......................::::,..:,.....,:::i1ttt111111111ttffttttffLLfLfttfffffffttf\\nttfft1tttttttt111t:......................,:::,..:,....,:;iiiitt11111111111tttttttffLLfLfttfffffffttf\\ntffft1tttttttt1111;.......................,:,...:,....:;;iiii1111111111tt111tftttfffLLLfttfffftffttf\\nttttt11ttttttt111t;...................,,,,,,,...,......,;;ii1111ttt1111ttt1tfffttffffffftttfftfffttt\\nttttt11tt11111111i,.................,::::::,....:........,,:i1111tt1111tt111ttttttfffffft1tftttffttt\\nttttt11ttttttt11t;.................,:;;;;;;,....:.... .. .,1t11ttt1111111ttt1ttttffffttt1tftttffttt\\nttttt11ttttttt1111:................,::::;i:.....:.,..,,,:;i11tttt111111111tft1111ttttttt11tttttffttt\\n111tt11ttt1111111t1:. ............::::;:.....,:....it11111tt1tt1111111ttttt1111ttttttt111ttttttt1t\\n11111111111111111111i:,..............,,,,......,:....:1tt111111t1111111111111111111111111111111tt111\\n11111111111111111111t11:........,.... . ..,....:.....it1t111t11111111111111111111111111111111111111\\n11111111111111111111111:,..................:....:.....:1ttt11t11t11111111111111111111111111111111111\\n1111111111111111111111i,...................:....:......it1ttttt1tt11111111111t1111111111111111111111\\n1111111111111111111111;....................,,..,:,.....:tttttttt111111111111111111111111111111111111\\n1111111111111111111111:.................. .::..,:......,1t1ttttt11t1t11111t1111111111111111111111111\\n11111111111111111111ti,.................. ,;::,,:.......itttttttttttt111t1tt11t111tt111tttt1tttt1111\\n11111111111111111111t;....................,;;;:,:.......:tttttttttttttttt1ttt1ttt1tttttttttttttt1111\\n\",\n \"tttttttttttttttttttttffftttt1111111tt1111tt1111111ttttttttt11tttt1111111ttttttttttttttttttt1111111tt\\nttfttttttttttttttttffLfttffttfffttttt1111111111111tffffftttt111111111111111tttffttftttttttt11111tttt\\nttttttttttttttttffffLftttfffffffffftt11111iii1i11ffffffffttttttt111111tttttffffftfLLfttttttt111ttttt\\nttttttttttttttttffffftttffffffffffttt11;::,,,,,:;1ffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffttttt1;:,,,,,,,,,,:tffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLfttttttft;,,,,,,,,:::,:itfffftttfffft11t111tt111ttfffLLfttfftt1ttt11tttttt\\nttttttttffLLLLLLLffttfLLLfttfffttt;,,,,,,:;ii1111tttttttffffffftt1111tftt111tttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffffft1:,,,,,:;iii11111fttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLLLLLLLLLffttttffftfffftt1:,,,,,:;;;iiiii1ftttfffffffffftt1111t11ttffttttttt1ttffffffffffttt\\ntttffttfLLLLLLLLLLfttfttffftttttft::;;::;;iiiiiii1ttttttttfffffftt1111tft1ttt1tffttt11tffffLLLLLfttt\\nttffffffffLLLLLLffftfffttttffftfLfi:;i;;;;;iiiiii1tffftt11tfffft111111ffftt1tt1tt1tttttfffLLLLLLffff\\ntffftfttttfLLLfftttttffffttfLLftfff;:;;;;;;;iiiii1tffffftt1tttt11tt111fffttffft1ttfftttffLLLLLLLLffL\\ntttttttttttfffttttttttttttttffffffft;;;;;;;;iiii1ttffffffft1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttfffffffffttft1tfffttt1i;;;;;;;;iii1ttfffftttt1tffft11111tfttffftttttttttttttfLLfffffft\\nttffffffffftttfffffffftttffttttti::i;;;i;;;;ii1111tttttt11tttttfftt111tt1tffttffttfffffLLffffffLLfLL\\nttffffffffttttfffffffft1ttt11i;:,.,ii;;iiiii11:i1111tt111tfft1ttft11111tt1ttttffttttfffLLLfttfLLLLLL\\ntttffffffffttffffffftt111i;:,......:11;;iiiii1::;;;::;i1ttffft11t11111tfftttttttt1ttffffLfftttLLLLLf\\nttttttttfffttfttt1111ii;:,.........,it1iii;;1ti::;;,..,:1tfffft1111111ttttt11tfft11ttffffffftfLLLLLf\\ntfttttttttt1tt111111;,..............;1111ii1ti:;:;;,,,,.:tffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttfffftt1111ttttti,................:;;;i;;;,,:;;:,,,,,,itt1111tt1111ttt11tf1tffffftttttt1tttttffft\\n111tfffffft1ttttttt:..........,,......:;;;;;;,.,i;,,,,,,.;t111111111111t111tft1tffffttfffftt1ttffLLf\\n111ttfffft111ttttt1,............,.....,;;;;;:,.:1i,......;11t111111111111t11tt1tfffttfffffffttfLfLLL\\ntttt1tftt11111tt11;....................:;;;;:,.:1i,......:tt11111111111111111t1tffttttffffftt1tffLLf\\nttft11ttttttt1111i,....................,:;:;:.,,;:,......:111tttt11111111tttt11tttfLffttfft1tttttfft\\ntttttt1ttttttt111;......................,;:;:..,:,.......:11tttttt111111tttffttttffLLffttttffffttttf\\ntffft11ttttttt11i,.......................:::,..,:,.......,1tttttttt11111ttttfftttffffffftttftttffttf\\ntffft11ttttttt11;........................,:::,..:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt11;......................,:;;;;;;,:,........,111tt1111111111tttttttffLLfLfttfffffffttf\\ntfttt11ttttttt11i.....................:::;;;;;:.:,....... ,1t11111111111t111tftttfffLLLfttfffftffttf\\ntttt111ttttttt11:....................,:::;;;;;.,:,..........,:;iii11111ttt11tffttffffffftttfftfffttt\\nttttt11tt1111111,....................,:::;;;;,.,:.......... .::;;;;ii11111ttftttftfffft1tftttffttt\\nttttt11ttttttt11i................. ....,,,,.....:.... ........,:::;;;;ii111tt1tttfffffttt1tftttffttt\\nttttt11ttttttt11ti,. .........,... .. ....,..:,.. ....,:::;;;iii1ttt1111ttttttt11tttttffttt\\n11111111ttt111111t1ii;;;,.......................:..,.:1;:,,.. ..,;i1i1t1ttt1111ttttttt111ttttttt1t\\n1111111111111111111ttttt:,......................:.. ,tttt111i;;;;i1tt1111111111111111111111111tt111\\n111111111111111111111111:,..................,...:.....it1t1ttttttttt11111111111111111111111111111111\\n111111111111111111111111;,..................,...:.... ;tttt11t11t11111111111111111111111111111111111\\n111111111111111111111111:...................,..,:.....:ttttttttttt1111111111111111111111111111111111\\n11111111111111111111111i,...................:,.,:.....,1ttttttttt11111111111111111111111111111111111\\n11111111111111111111111;...................,::..:.....,1ttttttttt1t11t1111t1111111111111111111111111\\n11111111111111111111111:.................. :;:,,:......itttttttttttttt111ttt11t1111t111t1ttttttt1111\\n111111111111111111111t1:.................. :;;:::......;ttttttttttttttttt1ttt1ttt11ttttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft111tt111111ttffffffttttttttt11111tttttffffftfLLftttttt11111ttt1\\nttttttttttttttttffffftttffffffLffftt111i;;:::::;1tffffffffttttttt11111tfffffffLfftfffffftttt111ttttt\\nttttttttttttfffftttffttffffffffttttt1i;,,,,,,,,,,;fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttti:,,,,,,,,,,,,;tfffftttfffft11t111tt111tttffLLfttfftt1tt111tttttt\\nttttttttffLLLLLLLffttfLLffttfffttti,,,,,,:;;;ii;itttttttffffffftt1111tftt1tttttfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffffft1:,,,,::;i111tt1tfttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLfLLLLLLLLfttttffftfffftti,,,,,,:;;iiii1i1ftttfffffffffft11111t11ttftttttttttttfffffLLfLfttt\\ntttffttfLLLLLLLLLLfttfttffftttttf1,,::,:;iiiiiiii1ttttttttfffffftt1111tft1ttt1ttfttt11tffffLLLLLfttt\\nttfffftfffLLLLLfffftfffttttffftfLf;:ii;;;;iii11ii1tfffft11tfffft111111ffft11t1ttt1tt1tffffLLLLLLLfff\\ntffftfttttfLLLfttttttffffttfLLftff1:;ii;;;;iiiiii1ffffftt11tttt1ttt111fffttfffttttfft1tffLLLLLLLLffL\\ntttttttttttfffttttttttttttttfffffff1;;;;;;;iiiii1tffffffftt1ttt1111111tfftfffftttttttttttfLLLLffffff\\nttffffffffftttffffffffftttt1tffftft1i;;;;;;;iiii1ttfffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\\nttffffffffttttfffffffft1tftt1tft1;ii;;;;;;;;ii1111ttftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tttt1ii;,.:i;;;i;iii111t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffftfttt111ii;:,....,i1;;iiiii1i:;;;i11111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\ntttttttttffttfttt1111ii;:,.........;11iiii;;11;::;;,:;1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntft1ttttttt1t1111111:,.............:1tt1iii1t1;;:;:,,.,:1tffftt11t1111ttt11tt1tffftt1111ttfftfLLfftt\\ntttttffttt1111ttttt;................:iiiiii11,:;:;:,,,,.:tttt111tt1111ttt11tf1tffffftttttt1ttttttfft\\n1tttfffffft1tftttt1,.................,;;;;:;:.,:i:,,,,,,,it11111111111tt111tft1tffffttfffftt11tffLLf\\n111ttfffft111ttttti...................:;;;;;:,,:1;.......;t1tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt11111ttt1:...................,;:;;;:..;1;.......:tt111t11t1111111111t1tffttttffffftt11ffLLf\\nttft1111ttttt1111;.....................:;:;;,..,;:.......,111tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt111,.....................,::;;,..,:,.......,1ttttttt111111tttffttttffLLffttttffffttttf\\ntfftt11ttttttt11;.......................:::;,..,:,........itttttttt1111tttttfftttffffffftttftttffttf\\nttfft11ttttttt11,.......................,;;;;:,,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt1i,.....................,::;i;;;,,:.........:111tt1111111111tttttttffLLfLfttfffffffttf\\nttttt11ttttttt1i.....................,:::;i;i:.,:,........,1t1111t111111t111ttfttffLLLLfttfffttffttf\\ntttt111ttt11t11;.....................,:::;;;;,.,:..........1tt111tt11111ttt1tffttffffffftttffftffttt\\nttttt11t1111111:......................:::::,...,:..........:i1tttt1tt111t1111tttttfttffft1tttttffttt\\nttttt11tttt11t1i.......................... ....,,.......... .,,:i11iii11111tt1t1ttffffttt1ttttttfttt\\nttttt11tttttt111;... ......................,:............ .,:::;iiii1111111tfttttt11ttttttfttt\\n11111111t1111111t1i;;::::......................,:..,:.. .......,::;;;;;;iii11111tttttt111ttttttt1t\\n11111111111111111ttttttt1,.....................,:......:,.. ..,:;;;:;;;iiii11111111111111111tt111\\n111111111111111111111111i,.................,::..,.... ,tt1ii;,,.. ..,:i;;iii111111111111111111111111\\n111111111111111111111111i,.................,;:,,,......1tttttt11i;;::itt11t1111111111111111111111111\\n111111111111111111111111i,................ ,;:::,......it1t1tttttttttt11tt11t111111111111111111t1111\\n111111111111111111111111;................. ,;;::,......it1tttttttt1111111t11111111111111111111111111\\n111111111111111111111111:................. .;;:::......;t1ttttttt1ttttt111t1111111111111111111111111\\n111111111111111111111111,...................;i;::,.....;tt1ttttttttttt11tttttttt111t111111tttttt1111\\n111111111111111111111111:...................:i;:::.....ittttttttttttttttttttt1ttt111tttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttt1111111tt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfftttffttttt111111111111ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft1111tttt111ttffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLffftt11111i;iiii1tfffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffttttt11;::,,,,,,::1fffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttf1;:,,,,,,,,,,,itfffftttfffft11t111tt111tttffLLfttfftt1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttt1,,,,,,,::::::itttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffLfft1:,,,,,:;ii11111ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLfLLLLLLLLfttttffftfffftt1:,,,,:;;iii1111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfttffftttttf1,,,,,:;iiii;iii1ttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\\nttfffftfffLLLLLfffftfffttttffftfLt:;;;:;;iiiiiii11tfffft11tfffft111111ffft1tt1ttt1tt1tfffLLLLLLLffff\\ntffftfttttfLLLfttttttffftttfLLftff1;;;i;;;iii1iiitfffffft11tttt1ttt111fffttfffttttfftttffLLLLLLLLffL\\ntttttttttttfffttttttttttttttffftfffi;;;;;;iiiiii1tffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttffffffffftttt1tffftffti;;;;;;iiiii1tttffffttt1tffft11111tfttfffttt1tttttttttfLLftfffft\\nttffffffffftttfffffffftttftt1tftt111i;;;;;;;;ii111tfftft11tttttfft1111tt1tffttffttfffffLLffffffLffLL\\ntttfffffffttttfffffffft1tt111111i::i;;;i;;;;i11t111ttt111tffttttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffftfftt111111i;:,..,ii;;iiiii11:;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\ntttttttttffttfttt1111111i;:,.......:11;iiii;11;::;;,:i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1t1111111i;:,...........:1t1iii;itt;;;;:.,,,:itffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\ntttttffftt1111ttttt1:..............,i111ii1tti:;;;:,,,,.,1tft111tt1111ttt11tf1tffffftttttt1ttttttftt\\n111tfffffft1tfttttt;.................:;;;;;;;,.:i:.,,,,,.;t11111111111tt111tft1tffffttfffftt11tfffLf\\n111ttfffft111ttttt1,..................:;;;;;:,.:1;.....,.:11tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt111111tt11,..................,;;;;;:,.;1;.......,1t111t11t1111111111tttffttttffffftt11fffLf\\ntttt111tttttt11111;....................::;;;,..,;:.......,i11tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt111i.....................,::;;,..,:.........ittttttt111111tttffttttffLLffttttffffttttf\\ntfftt11ttttttt111,......................::::,..,:,........itttttttt11111ttttfftttffffffftttttttffttf\\nttfft11ttttttt11;.......................,:::,..,:,........;11tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt11:........................,:,,..,:,........,111tt1111111111tftttttffLLfLfttfffffffttf\\nttttt11ttttttt11,.......................,,::,..,:..........it11111t11111t111tttttffLLLLfttffftfffttf\\ntttt111tttt1t11i......................::;;;;;:.,:..........;t11tttt11111tt11tffttffffffftttffftffttt\\nttttt11tt111111:....................,:::;i;;i,.,:..........;ttttttt1111111111tttttfttffft1tttttffttt\\nttttt11ttttttt1;....................,:::;i;;:..,,...........:;iii1111111111tt1t1ttfffttt11ttttttfttt\\nttttt11tttttt111:...................,:::;;;;...,,........... .,:;;;:;i1111ttt1111ttttttt11ttttttfttt\\n11111111t11t11111;,.. ...............,,,....,:.... .......,:::::;;11tt11111111tt1tt1111ttttttt1t\\n11111111111111111t11i;;;:.......,..... ......,,....,,. ...,::;::;i1111111111111111111111111tt111\\n11111111111111111111tttti,...................,.,,... :1i:,. .,,;;i1111111111111111111111111111111\\n111111111111111111111111i,...................:,,,.....ittt1i:,.. ,1tttt111111111111111111111111t1111\\n111111111111111111111111;,...................,,::.... .111tttt1ii1ttt11111111t11111111111111111t1111\\n111111111111111111111111;....................,:::......it1t11ttttt1111111111111111111111111111111111\\n111111111111111111111111;....................,::,......;t1tttttt11tt1tt111t1111111111111111111111111\\n11111111111111111111111t:....................::::......:1111ttttttttttt1tt11ttt11111111111tttttt1111\\n11111111111111111111111t:....................:;::,.....,1tttttttttttttttttttttttt111tttttttttttt1111\\n\",\n \"tttftttttttttttttttttffftttttt11ttttt1111tt11111111tttt1ttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfftfffttffttttt111111111t11ttffffftttt1111111111111111ttffttfttttttttt1111tttt\\ntttttttttttttttttffffftttffffffffffft1111tttt111tfffffffttttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLfffttt1111ttttt1tffffffffffttttttt11111tfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttftttffffffffttttft1i;:;;;;;i11tfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLfttttttfft1;:,,,,,,,,:1ttfffftttfffft11t111tt111tttffLLfttffft1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttti::,,,,,,,,,,;ttttftttffffffftt1111tftt11t11tfLLfttt11tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttfffffti,,,,::;;;iiiii1ffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttfLLLLLLLLLLftttttfftfffftt1:,,,;iii1111111fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfttffftttttff:,,:;;;iiii1ii1tttttttttfffffftt1111ttt1ttt1ttfttt11tfffffLLLLfttt\\nttfffftfffLLLLLfffttfffttttffftfLt;:,:;;;;iiiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffftfttttfLLffttttttffftttfLLftff1;;;;;iiiii;i11ttfffftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLtfffii;;;;;ii;;iittffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttft1tffftffti;;;;;iiiii1ttttffffttt1tffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfttttfttttti;;;;;iiii1111tfftft11ttttffff1111tt1tffttffttfffffLLffffffLffLL\\nttffffffffttttfffffffft1tt11111tft11i;;;;;;;iit11111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffftttfffftfftt1111111111i:,;i;;;;;;ii1i;;;111111tfffft11t11111tfftttttttt1tfffffLfftttfLLLLf\\nttttt1tttffttfttt11t111tttt1i;:,...:1i;ii;ii;1i:;;i;;i1tftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1tt1111111ttt1;:,,.......;ti;iii;it1;;;;,..,:i1fffft11t1111ttt11tt1tffftt1111ttfftfLffftt\\nttttfffftt1111ttttt111;:,...........;tt11iii1t1::;;,,,,,.,1ft111tt1111ttt11tf1tffffftttttt1ttttttftt\\n111tfffffft1ttttttt11,..............:i11iii111:,;;,,,,,,,.;t1111t11111tt111tft1tffffttfffftt11tfffLf\\n111ttfffft111ttttttt;.................:;;;;;;:.,ii,....,,.:1tt11111111111t11tf1tfffttfffffffttfLfLLf\\ntttt1tftt11111ttt111:.................,;;i;;;,.,1i,.......:t111111t1111111111tttffttttffffftt11fffLf\\ntttt11ttttttt1111111,..................:;;;;;,,,;;,.......:11tttt11111111tttt11tttfLffttfft1tt1tffft\\n1tttt11ttttttt11111i...................,;;;;:,..:,........:1tttttt111111tttffttttfLLLLfttttffffttttf\\ntfftt11ttttttt11111:....................:i;;:,.,:,........,1ttttttt1111ttttffftttffffffftttttttffttf\\nttfft11ttftttt111ti,.....................;;::,..:,........,i1tttt11111111ttffttttffLLfLfttfffffffttf\\ntttft11ttttttt111t;......................,::,...:,.........;11t11111111111ttt1tttffLLLLfttfffffffttf\\nttttt11ttttttt111t:......................,::,...:,...,,....it11111111111t111tttttfffLLLfttfffftffttf\\ntttt11tttt11tt1111,.......................,,,...:,...,:;;;;itt11ttt1111ttt1ttftttffffffftttffftffttt\\nttttt11t111111111i.........................,,...:,...,:;iiii11111t111111t111tttttttttffft1tftttffttt\\nttttt11ttttttt111,.........................,,...:....,:;;iii11111111111111ttttt1ttfffttt11ttttttfttt\\nttttt11ttttttt111;...................,,,,..,....,......,:;ii1ttt1111111111ttt1111tfttttt11ttttttfttt\\n11111111t11t11111t;...............,:::::::..,...:.........,,it11tt1111111tttt1111ttt1tt1111ttttttt1t\\n1111111111111111111,.............:::::;;i:......:..... :1ttttt111111111111111111111111111111t111\\n11111111111111111111;,.. ........,::::;;:.......,... ,i;;;i1tttt111111111111111111111111111111111111\\n11111111111111111111t11i,.........,:::;;. ..,:,.:.....itttttttt1111111t111111111111111111111111t1111\\n11111111111111111111111t;...........,,,.... ,:,,:......it1111ttt1111111111111111111111111111111t1111\\n111111111111111111111111;.......... .... .:,,:,. ...:tttt11tt111111111111111111111111111111111111\\n111111111111111111111111;....................::::..,,..,1tttttttt1tttt1111t1111111111111111111111111\\n11111111111111111111111t;....................::::..,,...;t1tttttttttttt1t11ttttt111t111111tttttt1111\\n11111111111111111111111ti....................:;::,......:11tttttttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftftttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt1111111tt\\nttfftttttttttttttttffLfttfffttffttttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttfffffftttffffffffffftt11ttttt111tffffffftttttttt11111ttttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttffffftttffffffLfffttttt11tttt11tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffftttft1tttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLft111111ttttt\\nttttttttttffLLLLftttttffLLftttttttfft11iiiiiittt1ttfffffttfffft11t111tt111tttffLLfttffft1ttt11tttttt\\nttttttttfffLLLLLLffttfLLffttfffttfft;::,,,,,,:itttttffttffffffftt1111tftt11t11tfLLftttt1tffftttttttt\\ntttttttfffLLLLLLLLLfttfttttffffft11i:,,,,,,,,:,;fffttttffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttfffttffftt1;:::::;;;iii;:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfttfLfttttfft;:;iii111111i;1ttttttttffffffftt1111ttt1ttt1ttftt11ttfffffLLLLfttt\\nttfffftfffLLLLLLffftfffttttfffffLf;:;;;;ii1iiiii11tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLffftttttffffttfLLffffi:i;;;;;ii;ii11ttffffft11tttt1ttt11tfffttffft1ttfftttffLLLLLLLLffL\\ntttttttttttffftttttttttttttfLfftffi;ii;ii;i11111tfffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttftttfLftf1;;;;;;;;i1111tttffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfftttftttt1i;;;;;iiii1111ttftft11ttttffff1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffft1ttt1111tfftt1i;;;;iii1tt111ttt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttffffttftt111t11111ttfft1;;;;;;ii1ti;;i11111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\nttttt1tttffttfttt111111tttt11111tti:i;;;;;;iii1;:;i1i1ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntfttttttttt1tt11t1111ttfftt1tt1i;:..;i;;;;;iii1i:;;:,,:;i1ffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\ntfttfffftt1111tttttt1tttttt1i;,.....:11;ii;;;iti:;;,,,...,:1t111tt1111ttt11tf1tffffftttttt1tttttfftt\\n1t1tfffffft1tttttttt111tti:,....,...,i11iii;i1ti;i,,,,,,,,.,i111t11111tt111tft1tffffttfffftt11tffLLf\\n1t1ttfffft111tttttt1111:,...........,i1t1iii11i,;1,....,,...;t11111111111t11tf1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11ttt111tt;..............,:;i;;;;;,.i1,.........:11111t1111111111tttffttttffffftt1tffLLf\\ntfftttttttttt111111ttt:................,;;i;;:,,:;,.........:tttt11111111tttt11tttfLffttfft1tt1tffft\\ntttttt1ttttttt1111ttti,................,:;;;;:,.,:..........,ttttt111111tttffttttfLLLLfttttffffttttf\\ntffft11ttttttt1111ttt;..................,;;;::,.,,..........,1tttt111111tttffftttffffffftttttttffttf\\ntffft11ttftttt111tttt:...................:;;::..::,,.........ittt11111111ttffttttffLLfLfttfffffffttf\\ntffft11ttttttt111ttt1:...................,;::,,::;;;i;,......;t11111111111ttt1tttffLLLLfttfffffffttf\\ntttft11ttttttt111ttt1,....................,::,,::;;iii;. ...,it11tt11111t111tttttfffLLLfttfffftffttf\\nttttt1tttttttt111t1ti.....................,:,,,,::;iii;.....,it11tt1111ttt1ttftttffffffftttffftffttt\\nttttt11tt11111111t1ti......................,:,. ,,,:;i:.......;11tt11111t111tttttttttffft1tttttffttt\\nttttt11tttt11t11tttt;......................,,,..,, .,,.......,;11111111111ttttt1ttfffttt11ttttttfttt\\nttttt1tttttttt111ttt:.......................,,..,,.....,....:1ttt111111111ttt1111tfttttt11ttttttfttt\\n1111111ttt1t11111tt1,.......................,,..:,.........:1t11111111111tttt1111ttt1ttt111ttttttt1t\\n11111111111111111111;....... ............,,..:,.....,;ii1t1t111111111111111111111111111111111t111\\n111111111111111111111,.... .,::,................:....,11ttt11tt11t1111111111111111111111111111111111\\n111111111111111111111;.....;i;;;,...............:,....it1111ttt1tt1111t111111111111111111111111t1111\\n1111111111111111111111i:.,iii;;i:.......... ,::,:......itttttttt1111111111111111111111111111111t1111\\n111111111111111111111111i,:;;;ii;,......... ,;;::,.....:1ttttttt11111111111t111111111111111111111111\\n111111111111111111111111i,.,::;;:.......... ,;;;::......itttttttt1tttt11t1tt111111111111111111111111\\n111111111111111111111111i..,.................;;;::,.,,..:1tt1tttttttttttt11ttttt11111111tttttttt1111\\n111111111111111111111111i..... .............;i;:::,.....itttttttttttttt1tttttttt11t11t1111ttttt1111\\n\",\n \"tttfttfttttttttttttttfffttttt1111tttt111tttt111111ttttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLfftfftttffftttt111111111111tfffffftttt111111111111111tttffttfttttttttt11111ttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tffffffffttttttt111111ttttffffLfffLLfttttttt1111t1t1\\nttttttttttttttttffffftttffffffLffffttttttttttt1tffffffffffttttttt1111ttfffffffLfttffffffttt1111ttttt\\nttttttttttttfffftttffttffffffffftttftttttt11ttt1ttfffffftttttt111t111111ttffffLLffttfLLfft111111tttt\\nttttttttttffLLLLftttttfLLLftttttttfftttttttfffft1tffffftttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftffft11i;ii1ttffttttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffLfLftti;:;:,,,:;;itffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffftffffftt1;,,,,,,,,::,:tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfftfLftttffff1;::::;;iii;,:1ttttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfffftfffLLLLLfffftfffftttfLfffLfi;iiii11111i;:i1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLfffttttfffffttfLLffLf;;;;iiiiiiii;:1tfffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttffLLffLt;;:;;ii;;iii;ttffffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttftttfLftf11i;;;i1ii11ii1tfffffftttttffft11111tfttfffttt1tttttttttfLLfffffft\\nttffffffffftttfffffffftttfftttfttt11i;;;;i1111i111ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tfft11;;;;iiiii1t1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\ntttffffffffttfffffffft111tt1111ttfft1i;;;iiiii1;;;111111ttffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\nttttt1tttffttfftttttt11ttttt111tttft1i;;;;iiiii;;;1t11ttftfffft1111111tttt11ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tffftt1tt11tff1ii;;;;;iiii:;;i;;i1tttffftt11t1111ttt11tt1tffftt1111ttfftfLffftt\\nttttffffttt11tttttft1tttttt1ttt11i;,:i;;;;;iii;;;;:...,,,:;i1111tt1111ttt11tt1tffffftttttt1ttttttftt\\n111tfffffft1ttfftttt11tttt1tfti;,...,i1i;;ii;;i1i;,.........,i11111111tt111tft1tffffttfffftt11tffLLf\\n1t1ttfffft111tftttt1111ttt11;:,......;11iii;;1t11;......,.,,.,i1111111111t11tt1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11ttt11ttt11i;:,.........:1tt1i;i1111;............;t11t1111111111tttffttttffffftt1tffLLf\\ntfftttttttttt111111tttt1,.............:;;;;;;;;:;:............:tt11111111tttt11tttffftttfft1tt1tffft\\n1ttttt1ttttttt1111tt11ti................:;;;;;:,:,............,1tt111111tttffttttfLLLLfttttffffttttf\\ntffftttttttttt111tttt1ti................,;;;;::,:,.............ittt11111tttffftttffffffftttttttffttf\\ntfffttttfftttt111tttttt;.................:;;:::,:,.............:tt1111111ttffttttffLLfLfttfffffffttf\\ntffftttttttttt111tttttt;.................,:;:::,:.,:,,.........,it11111111ttt1tttffLLLLfttfffffffttf\\ntttft11ttttttt111tttttt:..................,::::,:,,;;;;;:,......itt11111t111tttttffLLLLfttfffftffttf\\nttttt1tttttttt1111t1ttt;...................,::,,:,:;;;iii;.....,1tt1111ttt11tftttffffffftttffftffttt\\nttttt11tt1111t111tt1ttt:...................,::,,:::;;iiii;,.....:i1t1111t111tttttttttffft1tftttffttt\\nttttt11ttttttt11ttttttt:....................::,,:..,,:;ii:...... .1t111111ttttt1ttffffft11ttttttfttt\\nttttt1tttttttt111tttttt:....................,::,:. ..::,......,1t1111111ttt1111tfttttt11ttttttfttt\\n1111111tttttt1111ttt1tt:.... ...............,:,,:..............,1t1111111tttt1111ttt1ttt111ttttttt1t\\n11111111111111111111111;;;;:,...............,:,,:....... ...,,:1ttt11111111111111111111111111111t111\\n11111111111111111111111iiiiii:...............,,,:........,:i11tt1tt111111111111111111111111111111111\\n11111111111111111111111iiiiiii...............,,,:.......,1tttt11tt1111t111111111111111111111111t1111\\n1111111111111111111111i;iiiiii,..............,.,:........ittt11t111111111111111111111111111111111111\\n111111111111111111111111iiii;,...............::::,,......:1ttttt11t111111111111111111111111111111111\\n1111111111111111111111111i:,. ...............:i;:::,......itttttt1ttt111t1tt111111111111111111111111\\n11111111111111111111111111:................. :i;;;::,.....;ttttttttttttttt1ttttt111111111ttttttt1111\\n11111111111111111111111111:................. :i;;;;::,....:tttttttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11tfffffftttt1111111111111111ttffttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttfffffffLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLffffttttttttttt1tffffffffffttttttt1111ttffffffLLfttffffffttt1111tttt1\\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1tffffftttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLffttfffftfffttttttfffffftfttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffffffttft111i;ii1ttfffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftft1i:::,,,,::;;1fftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfffLLLLLLLLfttfftfLffftfffLf1;,,,,,,,::,,:1tttttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfLfftfffLLLLLfffftfLfftttfffffLLf1;;;;;iiiii:,:1tfffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntffffftttffLLfffttttfffffttfLLLffLfiiiii111111i::1tffffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttftttttttffftttttttttttttfffLffLfii;;;iiiiiii;:1ftffffftt1ttt1111111ffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttfttffLfffLti;:;;ii;ii1;;ttffffftttttffft11111tfttffftttttttttttttfLLfffftft\\nttffffffffftttfffffffftttfftttftttt1i;;;ii11111ii1ttffft11ttttffft1111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tfff1ii;;;iiiiiii1111tt111tffttttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\n1tfffffffffttfffffffftt1ttt1111tffft1i;;;iiiiii;;i111111tfffft11t11111tfft1tttttt1tfffffLfftttfLLLLL\\ntttttttttffttfftttttt1ttfft1111tttftt1;;;iiiiii;:;tt11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffft1tt11ttft11;;;;;iiii;;;1t11ttttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\\nttttffffttt11tttttft1ttfffttfft11tftiii;;;;iiii;;;;:;ii1tttft111tt1111ttt11tt1tffffftttttttttttttftt\\n111tfffffft1ttfttttt11tfftttfttt11i:,ii;;;;;iii;i:.....,,::;i111t11111tt111tft1fffffttfffftt11tffLLf\\n1t1ttfffft111tffttt1111tft1ft1i;:,...;1i;;;;;;i11:...........,;1111111111t11tt1tfffttfffffffttfLLLLf\\ntftt1tftt1tt11tft11ttt111111;:,......,111ii;;i1t1:........,,...;11t1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttttt11;:,.........,i111i;i1t1;,.............,1t1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111ttt11ti,............,::::;;;i;:,..............it111111tttffttttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttti...............,;;;;;;;:...............:t111111tttffftttffffffftttttttffttf\\ntfffttttfffttft11ttttttt;...............,:;;;;:::...............,1t111111ttffttttffLLfLfttfffffffttf\\ntffft1ttttttttt11ttttttt:................,;;;;:::................it1111111ttt1tttffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt:................,:;;::::................:t1111tt111tttttffLLLLfttfffftffttf\\nttttt1tttttttt111111tt1t;.................,::::::................,1t111ttt11tftttfffffffttfffftffttt\\nttttt1tttt11tt111ttttttt:.,:;:............,::::::................,itt111t111ttt1tttttfft11tftttffttt\\nttttt1tttttttt11tttttttt;:;iii:............,:::::...........,:,....:1t11111tttt11tfffttt11ttttttfttt\\nttttt1tttttttt111ttttttt;;iiiii:. ..........:::::...........,;;;;:..it1111tft1111ttttttt11ttttttfttt\\n1111111tttttt1111ttttttt:;iiiii;............,::::,........,::;;iii;it111ttttt11111tt1ttt111ttttttt1t\\n111111111111111111111111:;;iiii;,...........,:,::,.........,;;iiii;it111111111111111111111111111tt11\\n111111111111111111111111;:;:;;;,............,::::,...........:;;ii;it1111111111111111111111111111111\\n111111111111111111111111;::.... .............,:::,,......... .,,:i1t1111111111111111111111111111111\\n111111111111111111111111i;,..................,,,:,,....... .;,..,;11111111111111111111111111111t1111\\n1111111111111111111111111i;:;i;,..............,,:,,,........1tii11t111111111111111111111111111111111\\n111111111111111111111111111111:..............,:::;;:,.......;ttttttttt11t1tt111111111111111111111111\\n11111111111111111111111111111;,..............:i;;ii;;:,.....,1ttt1tttttttt1ttttt1111111111tttttt1111\\n1111111111111111111111111111i,...............,i;;iiii;:......ittttttttttttttttttt11t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1t1ttttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt1111ttfffffffLftttfffffttt1111tttt1\\nttttttttttttfffftttftttffffffffftttfttttt111ttt1ttfffffftttttt111tt11111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLftttttttffttttttttffft1ttfffffttfffft11tt11tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftffftttttfffffffffttffttffffffftt1111tftt11t11tfLLfftt11tffftttttttt\\ntttttttfffLLLLLLLLffttfttttffLffftfftttttfftffffffftttffffffffffft111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffffftfftt11iii;:;;i1tfftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfftfLffttfffLLft1;:::,,,,::;;1ttttttffffffftt1111ttt1ttt1ttfttt1ttffffLLLLLfttt\\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLfti;,,,,:::::,,;fffft11tfffft11111tffft1tt11tt1ttttfffLLLLLLLffff\\ntfffffttttfLLfffttttfffffttLLLLffLLf1ii;;iiii11i:,;tfffft11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLffLLf1iiiiiii1111;:;tffffftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttffffffffftttfffffffffttfttffLfffLf111;;;ii;;i1i:itfffftttttffft11111tfttffftttttttttttttfLLfffftft\\nttffffffffftttffffffffttffftttftttttt1i;;;iii;iii;ifftft11tttttffft111tt1tffttffttfffffLLfffffffffLL\\ntttfffffffttttfffffffftttttt111tffft11i;;;ii11111111tt111tffftttft11111tt1ttttfft1tffffLLLfttfLLLLLL\\n1tfffffffffttfffffffftt1ttt1111fffft111i;;;iiiiiii11111ttfffft11111111tfft1tttttt1tfffffLfftttfLLLLL\\ntttttttttffttfftttttt1ttftt1111ttffttt1i;;;iiii;;;1t11ttttfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt1ttfffftttt11ttft1t1i;;iiiii;:;1t111tttffftt11t1111tftt1tt1tffftt1111ttfftfLffftt\\nttttfffftttt1ttttfft1tffffttfft11tft111i;;;;;ii;:;i11111ttttt1111t1111ttt11tt1tfffffttttttttttttffft\\n111tfffffftttffftttt11tfftttfttt1ttt1i1i;;;;iiiiii::;i111tt11111t11111tt111tft1fffffttfffftt1ttfLLLf\\n1t1ttfffft111tffttt1111tfttft11tti;::,i1;;;;;iii11:...,,::;i1tt1111111111t11tt1tfffttfffffffttfLLLLf\\ntttt1tftt1tt11ttt11ttt1111tt11i;,,....;1i;;;;;;i11:.,.......,,:i11t1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttttt111i;:,........;1t1ii;;i1ii,.............;t1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111tttttt11:...........:iiiiii1tti,..............,1t11111tttttttttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttt1i,.............,:::;;ii;,...............;t11111ttttfftttffffffftttttttffttf\\ntfffttttfffffft11ttttttt1;..............,:;;;;;;:,...............,1111111ttffttttffLLfLfttfffffffttf\\ntffftttttttttt111ttttttt1:.......... ....:;;;;;;:,................it111111tttttttffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt1,........,,:;:,.,;;;;;:;,................;t1111t111tttttffffLLfttfffffffttf\\nttttt1tttttttt1111t1tttt1,.......;;;;;:,..:;;::::,................,1t11ttt11tftttfffffffttfffftffttt\\nttttt1tttt11tt111ttttttt1:......;;;;;;;:,.:;;::::,................,it111t1111tt11ttttfft11tftttffttt\\nttttt1tttttttt11tttttttti,......:;:;;;:...,:;::::,.................:1t11111tt1t11tfffttt11ttttttfttt\\nttttt1tttttttt11tttttttti,......:;:;;:.....,:::::,..................:11111ttt1111ttttttt11ttttttfttt\\n1t1t111tttttt111111ttttt;...,,,.,:::. ......:::::,...................,111tttt11111ttttt1111ttttttt1t\\n111111111111111111111111,,,,,,,.............,:::::,..................,1t111111111111111111111111tt11\\n11111111111111111111111i,,..:,..............,,::::,,.................,11tt11111111111111111111111111\\n111111111111111111111111;...................,:,,::,,.................,;ii11t111111111111111111111111\\n111111111111111111111111i,..................,:::::,,................:::;;;i111t111111111111111111111\\n1111111111111111111111111i;;;;i1:............::,:,,,,........... ..::;;;;i1111111111111111111111111\\n111111111111111111111111111111t1,............,.,:,,,:,,........:,,..,:;;;i11t11111111111111111111111\\n1111111111111111111111111111111i.............,,::;;;i;:,...... :111i;::;;;1ttttt11t1111111tttttt1111\\n111111111111111111111111111111ti.............:1;;1iiii;:,.......i1tttt11111tt1tt111111t1111ttttt1111\\n\",\n \"tttttttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt111111ttt\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttttttttttttttttffffLffttfffffffffffttttttttt111tfffffffftttttttt11111tttttffffftfLLfttttttt1111ttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tffffffffftttfffffttt11111ttt1\\nttttttttttttfffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLff111111ttttt\\nttttttttttffLLLLftttttfLLLfttttttffffttttttfffft1tffffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfffttttttfffffftfttfftffffffffttt111tftt11t11tfLLLftt11tffft1tttttt\\ntttttttfLfLLLLLLLLffttfttttffLLfftffttttffffffffffftttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLLftffttttttt11i;ii1tftttfffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttffttfLLLLLLLLLLfttfftfffffffffLLfttt1i;::,,,,:;;1tttttffffffftt1111ttt1ttt1ttfttt1ttfffffLLLLfttt\\nttfLLftfffLLLLLLLfftfLfftttfLfffLLLLttt1;,,,,,,,::,:iftt11tfffft11111tffft1tt11tt1ttttfffLLLLLLLLfff\\ntfffffttttfLLfffttttfffffttLLLLfLLLftt1i;;;;;;iiii:,;fftt11tttt1ttt11tfffttffft1ttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttffLLffLLftt1;iiiii11111i::tfffft1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttfLffffffftttfffffffffttfttffLfffLftt1;i;;;iiiiiii;;tfftttttffft11111tfttffftttttttttttttfLLftfffft\\nttffffffffftttffffffffftffftttfttftttttii;;;;ii;;ii;iftt11tttttfft1111tt1tffttffttfffffLLfffffffffLL\\nttffffffffttttfffffffftttttt11ttfffttt11ii;;ii1111ii11111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\n1ttffffffffttfffffffftt1ttt111tffffttt1i1i;;;iiiiii1111ttfffft11t11111tfft1tttttt1ttffffLfftttfLLLLf\\ntttttttttffttfftttttt1ttfff1111ttffttttt1i;;;;i;:;it11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffftttt11tfftt11tt1;;;ii;;;1t111tttffftt11t1111tttt1tt1tffftt1111ttfftfLffftt\\ntfttfffftttt1ttttfft1tffffttfftt1tft1111t1;;;;i;:;i11111tttft111tt1111ttt11tt1tfffffttttttttttttffft\\n1tttfffffftttffftfft11tfffttfttttttt11111i;;:;iiii1i;i1t1tt11111t11111tt111tft1fffffttfffftt1ttffLLf\\n1t1tffffft111tffttt1111tfttft11tt1t1i;;;1i;;;;ii1ii1,.,:;ii1tt11111111111t11tt1tfffttfffffffttfLfLLf\\ntfttttftt1tt11ttt11ttt11t1t11tt11i:,...,11;;;;;it111,,.....,:;i11tt1111111111tttffttttffffftt1tffLLf\\ntffttttttttttt1111ttftt111111i;:,......:1t1i;;;;i1t1,..........,:i1111111tttt11t1tfLftttfft1tt1tffft\\n1ttttttttttttt1111ttttt111tt;..........:1111iii1;11:.............,it1111tttttt1ttfLLLffttttffffttttf\\ntfffttttffttttt11ttttttt11t1,...........,,:::;;i;;:...............:t1111ttttfft1tffffffftttttttffttf\\ntfffttttfffffft11ttttttt111i..............:;:::;;::...............,1t1111ttffttttffLLfLfttfffffffttf\\ntfffttttttttttt11ttttttt111:..............,;;;;;;:,................;t11111ttt1t1tffLLLLfttfffffffttf\\ntffft1tttttttt111ttttttt11i,..........,::::;;;;;;:,................,1t11t111tttttffffLLfttfffffffttf\\nttttt1tttttttt111tt1tttt11i.........:;;;;:,;;::::::.................;t1ttt11tftttffffffftttffftffttt\\nttttt1tttt11tt111ttttttt111,.......;;;;;;:,:;::::::,................:tttt1111tt11ttfttft11tftttffttt\\nttttt1tttttttt11tttttttt11;,......,;;;;;;:::;::::::,................,itt111t11t11ttftttt11ttttttfttt\\nttttt1tttttttt11tttttttt11;,......:;;;;i;...,:::::,,.................:tt1tttt1111ttttttt11ttttttfttt\\n1t1t111tttttt111tttttttt1;,.,.....,:;:......,:::::,,..................it1tttt11111tttt11111ttttttt1t\\n1111111111111111111111111:,,,......,,. .....,,::::,,..................,1t11111111111111111111111tt11\\n1111111111111111111111111,,....,,...........,,,:::::,..................itt11111111111111111111111111\\n1111111111111111111111111;,.................,:::::::,,................:1tt11111111111111111111111111\\n11111111111111111111111111:.... ............,:::,:,,.................,1tt11111111111111111111111111\\n11111111111111111111111111ii;;;;;i, .........,,::,,,,,................,:;;1tt11111111111111111111111\\n11111111111111111111111111111111t1,..........,,,:,,:,:,,. ...........,:::;;i11tt11111111111111111111\\n11111111111111111111111111111111t;.............,:::;;;;:,........ .,:::;;:;i1t111111111ttttttt11111\\n111111111111111111111111111111111:...........,;;;i1iiii;:,.......::,,::::;;i1ttt111t11t1111ttttt1111\\n\",\n \"tttftttttttttttttttttfffttttt1111tttt111tttt1111111tttttttt11tttt111111tttttttttttttttttttt11111111t\\nttfftttttttttttttttffLLftffftfffftttt111111111t11ttffffftttt1111111111111111ttftttfttttttttt1111tttt\\nttftttttttttttttffffLffttfffffffLfffttttttttt111tfffffffftttttttt11111ttttttfffftfLLfttttttt111tttt1\\nttttttttttttttttfffffttfffffffLfffftttttttttt11tffffffffffttttttt11111tfffffffffttffffffttt11111ttt1\\ntttttttttttffffftttffttffffffffftttfttttt111ttt1ttfffffftttttt11tt111111ttffffLLffttfLLfft11111ttttt\\nttttttttttffLLLLftttttfLLLfttttttffLftttttttffft1ttfffffttfffft11t111tt111tttffLLfttfftt1ttt111ttttt\\nttttttttfffLLLLLLffttfLLLfttfffftfLfttttttffffffffftftttfffffffttt111tftt11t11tfLLfftt11tffft11ttttt\\ntttttttfffLLLLLLLLffttfttttfLLLfftffttttffftt1iii11tttfffffffffftt111tft1ttft11tffLfttttfffffftttttt\\ntttttttffLLLLLLLLLfttttffffffLffffftttttfti;;::,,,:;i1tffffffffftt1111111ttftttttttttttfffffLLfffttt\\ntttfffffLLLLLLLLLLfttfftfLfffffffLLfttttt1;,,,,,,,::,:ittffffffftt1111ttt1ttt1tftttt1ttffffLLLLLfttt\\nttfLLffffLLLLLLLLfftfLfftttfLfffLLLLfttt1i;:::;;iiii;,;t11tfffft11111tffft1tt1ttt1ttttfffLLLLLLLLfff\\ntffffftttffLLLffttttfffffttLLLLfLLLffttf1;;iiii11111i::1t11tttt1ttt11tfffttfftttttfft1tffLLLLLLLLffL\\ntttttttttttffftttttttttttttfffLffLLftttti:;;;;iiiiiii;;tftt1ttt111111tffftfffftttttttt1ttfLLLLffffff\\nttfLffffffftttfffffffffttfttffLfffLfttttti;;;;;iii;i1iiftttttffft11111tfttffftttttttttttttfLLftfffft\\nttffffffffftttffffffffftfffftffffftttttft11i;;;iiii1iiit11tttttfft1111tt11ffttffttfffffLLfffffffffLL\\nttffffffffttttfffffffftttttt1tttffftttttti1i;;;ii11iii111tffftttftt1111tt1ttttfft1tffffLLLfttfLLLLLL\\n1ttffffffffttfffffffftt1ttt1111tfffftttt111i;;iiiiii111ttfffft11t11111tfftttttttt1ttffffLfftttfLLLLf\\ntttttttttffttfftttttt1ttfftttt1ttfftttttt111i;i;:;ii11ttftfffft1111111ttttt1ttfft11ttffffffftfLLLLLf\\ntft1ttttttttttttttt11tfffftttt11tfftt1ttt111;;i;;;iii1ttttffftt11t1111ttt11tt1tffttt1111ttfftfLffftt\\ntfttffffttt11tttttft1tffffttffttttft111ttt11;;;;:;i1i1;;11tft111tt1111tt111tt1tfffffttttt11tttttffft\\n1tttfffffftttffftfft11tfftttffttttft1111iii1;;;i;iiii1i,,,:;;i11tt1111tt111tft1fffffttfffftt11tffLLf\\n111ttfffftt1ttffttt1111tfttft11tt1t1i;:,,,;1i;;i1ii;iti,,.....,:;i1t11111t11tt1tfffttffffffft1fffLLf\\ntfttttftt1tt11tft11ttt11tttt1tt11i;:,.....;11i;i1i;1tt;,,.........,:i11111111t1tffttttffffftt1tfffLf\\ntffttttttttftt1111ttttt11111tft;,.........;11111i1ttti,.............,1111tttt1111tffftttfft1tt1tffft\\n1ttttttttttttt1111tttttt11tfff1,...........,:;;;;;11i:...............itttttttt1ttfffLffttttffffttttf\\ntfffttttffttttt11ttttttt11tfffi............ ,:;;;;;;;,...............;t1ttttfft1tffffffftttttttffttf\\ntfffttttfffffft11tttttttttt1tf;..............:;;;;;;;,...............:111ttttttttfffLfLfttfffffffttf\\ntfffttttftftft111ttttttt11t111:..............:;;;;;::,...............,1t11ttt1t1tffLLLLfttfffffffttf\\ntfffttttfttttt111ttttttt11ttt1:..............,;;;::;::................itt111tttttffffLLfttfffffffttf\\ntttttttttttttt111ttttttt1ttfft:..............,;;;;::::................:1tt11tft1tffffffftttffttffttt\\nttttt1tttt11tt11tttttttt1tttt1;.,::,..........:;:::;::,...............,1t1111tt11tttttft11tfttttfttt\\nttttt1tttttttt11ttttttttt1ttt1;,:;;:..........,::::::,,................it11111111ttftttt11ttttttfttt\\nttttt1tttttttt11tttttttttttttiiiiii;,.........,:::::::,................:ttttt1111ttttttt11ttttttfttt\\n1t1111tttttttt11tttttttt1ttt1;;;;ii;,.........,:::::::,.................ittttt1111tttt11111ttttttt1t\\n11111111111111111111111111tt1;;;;ii;...........::::::::................ :1t111111111111111111111t111\\n11111111111111111111111111tt1;::;;i:...........,:::::::,...............,itttt11111111111111111111111\\n11111111111111111111111tttttt;,,,::............,::::::,,...............ittttt11111111111111111111111\\n1111111111111111111111111tttt1:,,..............,:::::,,,,.......,:;::,:1t1111111111111111111111t1111\\n11111111111111111111111111111111i;;i:..........,:,,,.,,.,.......::;;i;it1ttt111111111111111111111111\\n1111111111111111111111111111111111ti...........,,.,:,:;::,......,:;;ii1ttttt11111111111111111t111111\\n1111111111111111111111111111111111t;...........,;iiiiiii;:,......:;;;i1ttttt111t1111111111tttttt1111\\n11111111111111111111111111111111111:...........,;i11iiii;:,.......,:i1tttttt1ttttt1t11t1111ttttt1111\\n\",\n];\n\nfunction isApr1(): boolean {\n const d = new Date();\n // Months are 0 indexed\n return d.getMonth() === 3 && d.getDate() === 1;\n}\n\nexport const Apr1Events = new EventEmitter();\n\nexport function Apr1(): React.ReactElement {\n const [open, setOpen] = useState(isApr1());\n const [n, setN] = useState(0);\n\n useEffect(() => {\n const id = setInterval(() => setN((n) => (n + 1) % frames.length), 100);\n return () => clearInterval(id);\n }, []);\n\n useEffect(\n () =>\n Apr1Events.subscribe(() => {\n setOpen(true);\n }),\n [],\n );\n\n if (!open) return <>;\n\n return (\n setOpen(false)}>\n
{frames[n]}
\n
\n \n
\n
\n );\n}\n","import React from \"react\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ICityProps {\n currentCity: CityName;\n city: CityName;\n onTravel: (city: CityName) => void;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n travel: {\n color: theme.colors.white,\n lineHeight: \"1em\",\n whiteSpace: \"pre\",\n cursor: \"pointer\",\n },\n }),\n);\n\nfunction City(props: ICityProps): React.ReactElement {\n const classes = useStyles();\n if (props.city !== props.currentCity) {\n return (\n {props.city}}>\n props.onTravel(props.city)} className={classes.travel}>\n {props.city[0]}\n \n \n );\n }\n return {props.city[0]};\n}\n\ninterface IProps {\n currentCity: CityName;\n onTravel: (city: CityName) => void;\n}\n\nexport function WorldMap(props: IProps): React.ReactElement {\n // prettier-ignore\n return (\n <>\n ,_ . ._. _. .\n , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-\n /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_\n / ,/'-/~ '\\ ,' _ , ','|~ ._/-, /~\n ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~\n .-~ '| '',\\~|\\ _\\~ ,_ , /,\n '\\ /'~ |_/~\\\\,-,~ \\ \" ,_,/ |\n | / ._-~'\\_ _~| \\ ) \n \\ __-\\ '/ ~ |\\ \\_ / ~\n ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,\n ~-_' _; '\\ '-, \\,' /\\/ |\n '\\_,~'\\_ \\_ _, /' ' |, /|'\n / \\_ ~ | / \\ ~'; -,_.\n | ~\\ | | , '-_, ,; ~ ~\\\n \\, / \\ / /| ,-, , -,\n | ,/ | |' |/ ,- ~ \\ '.\n ,| ,/ \\ ,/ \\ |\n / | ~ -~~-, / _\n | ,-' ~ /\n / ,' ~\n ',| ~\n ~'\n \n );\n}\n","import React from \"react\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { StealthIcon } from \"./StealthIcon\";\nimport { KillIcon } from \"./KillIcon\";\nimport { IAction } from \"../IAction\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { Player } from \"../../Player\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: IAction;\n}\n\nexport function SuccessChance(props: IProps): React.ReactElement {\n const estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner, Player);\n\n let chance = <>;\n if (estimatedSuccessChance[0] === estimatedSuccessChance[1]) {\n chance = <>{formatNumber(estimatedSuccessChance[0] * 100, 1)}%;\n } else {\n chance = (\n <>\n {formatNumber(estimatedSuccessChance[0] * 100, 1)}% ~ {formatNumber(estimatedSuccessChance[1] * 100, 1)}%\n \n );\n }\n\n return (\n <>\n Estimated success chance: {chance} {props.action.isStealth ? : <>}\n {props.action.isKill ? : <>}\n \n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n}\n\nexport function StaticModal(props: IProps): React.ReactElement {\n return (\n \n {props.children}\n \n );\n}\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveRecoveryWork = (w: Work | null): w is SleeveRecoveryWork =>\n w !== null && w.type === WorkType.RECOVERY;\n\nexport class SleeveRecoveryWork extends Work {\n constructor() {\n super(WorkType.RECOVERY);\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n sleeve.shock = Math.min(100, sleeve.shock + 0.0002 * cycles);\n if (sleeve.shock >= 100) sleeve.stopWork(player);\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveRecoveryWork\", this);\n }\n\n /**\n * Initiatizes a RecoveryWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveRecoveryWork {\n return Generic_fromJSON(SleeveRecoveryWork, value.data);\n }\n}\n\nReviver.constructors.SleeveRecoveryWork = SleeveRecoveryWork;\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveSynchroWork = (w: Work | null): w is SleeveSynchroWork =>\n w !== null && w.type === WorkType.SYNCHRO;\n\nexport class SleeveSynchroWork extends Work {\n constructor() {\n super(WorkType.SYNCHRO);\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n sleeve.sync = Math.min(100, sleeve.sync + player.getIntelligenceBonus(0.5) * 0.0002 * cycles);\n if (sleeve.sync >= 100) sleeve.stopWork(player);\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveSynchroWork\", this);\n }\n\n /**\n * Initiatizes a SynchroWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveSynchroWork {\n return Generic_fromJSON(SleeveSynchroWork, value.data);\n }\n}\n\nReviver.constructors.SleeveSynchroWork = SleeveSynchroWork;\n","/**\n * Class representing a Script instance that is actively running.\n * A Script can have multiple active instances\n */\nimport { Script } from \"./Script\";\nimport { ScriptUrl } from \"./ScriptUrl\";\nimport { Settings } from \"../Settings/Settings\";\nimport { IMap } from \"../types\";\nimport { Terminal } from \"../Terminal\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\n\nexport class RunningScript {\n // Script arguments\n args: ScriptArg[] = [];\n\n // Map of [key: hostname] -> Hacking data. Used for offline progress calculations.\n // Hacking data format: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n dataMap: IMap = {};\n\n // Script filename\n filename = \"\";\n\n // This script's logs. An array of log entries\n logs: string[] = [];\n\n // Flag indicating whether the logs have been updated since\n // the last time the UI was updated\n logUpd = false;\n\n // Total amount of hacking experience earned from this script when offline\n offlineExpGained = 0;\n\n // Total amount of money made by this script when offline\n offlineMoneyMade = 0;\n\n // Number of seconds that the script has been running offline\n offlineRunningTime = 0.01;\n\n // Total amount of hacking experience earned from this script when online\n onlineExpGained = 0;\n\n // Total amount of money made by this script when online\n onlineMoneyMade = 0;\n\n // Number of seconds that this script has been running online\n onlineRunningTime = 0.01;\n\n // Process ID. Must be an integer and equals the PID of corresponding WorkerScript\n pid = -1;\n\n // How much RAM this script uses for ONE thread\n ramUsage = 0;\n\n // hostname of the server on which this script is running\n server = \"\";\n\n // Number of threads that this script is running with\n threads = 1;\n\n // Script urls for the current running script for translating urls back to file names in errors\n dependencies: ScriptUrl[] = [];\n\n constructor(script: Script | null = null, args: ScriptArg[] = []) {\n if (script == null) {\n return;\n }\n this.filename = script.filename;\n this.args = args;\n this.server = script.server;\n this.ramUsage = script.ramUsage;\n this.dependencies = script.dependencies;\n }\n\n log(txt: string): void {\n if (this.logs.length > Settings.MaxLogCapacity) {\n this.logs.shift();\n }\n\n let logEntry = txt;\n if (Settings.TimestampsFormat) {\n logEntry = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + logEntry;\n }\n\n this.logs.push(logEntry);\n this.logUpd = true;\n }\n\n displayLog(): void {\n for (let i = 0; i < this.logs.length; ++i) {\n Terminal.print(this.logs[i]);\n }\n }\n\n clearLog(): void {\n this.logs.length = 0;\n }\n\n // Update the moneyStolen and numTimesHack maps when hacking\n recordHack(hostname: string, moneyGained: number, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][0] += moneyGained;\n this.dataMap[hostname][1] += n;\n }\n\n // Update the grow map when calling grow()\n recordGrow(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][2] += n;\n }\n\n // Update the weaken map when calling weaken() {\n recordWeaken(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][3] += n;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): IReviverValue {\n return Generic_toJSON(\"RunningScript\", this);\n }\n\n // Initializes a RunningScript Object from a JSON save state\n static fromJSON(value: IReviverValue): RunningScript {\n return Generic_fromJSON(RunningScript, value.data);\n }\n}\n\nReviver.constructors.RunningScript = RunningScript;\n","import { Literatures } from \"./Literatures\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nexport function showLiterature(fn: string): void {\n const litObj = Literatures[fn];\n if (litObj == null) {\n return;\n }\n const txt = `${litObj.title}

${litObj.txt}`;\n dialogBoxCreate(txt);\n}\n","import React from \"react\";\nimport { DarkWebItems } from \"./DarkWebItems\";\n\nimport { Player } from \"../Player\";\nimport { Terminal } from \"../Terminal\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\nimport { DarkWebItem } from \"./DarkWebItem\";\nimport { isCreateProgramWork } from \"../Work/CreateProgramWork\";\n\n//Posts a \"help\" message if connected to DarkWeb\nexport function checkIfConnectedToDarkweb(): void {\n const server = Player.getCurrentServer();\n if (server !== null && SpecialServers.DarkWeb == server.hostname) {\n Terminal.print(\n \"You are now connected to the dark web. From the dark web you can purchase illegal items. \" +\n \"Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name]' \" +\n \"to purchase an item. Use 'buy -a' to purchase all unowned items.\",\n );\n }\n}\n\nexport function listAllDarkwebItems(): void {\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n\n const cost = Player.getHomeComputer().programs.includes(item.program) ? (\n [OWNED]\n ) : (\n \n );\n\n Terminal.printRaw(\n <>\n {item.program} - {cost} - {item.description}\n ,\n );\n }\n}\n\nexport function buyDarkwebItem(itemName: string): void {\n itemName = itemName.toLowerCase();\n\n // find the program that matches, if any\n let item: DarkWebItem | null = null;\n\n for (const key of Object.keys(DarkWebItems)) {\n const i = DarkWebItems[key];\n if (i.program.toLowerCase() == itemName) {\n item = i;\n }\n }\n\n // return if invalid\n if (item === null) {\n Terminal.error(\"Unrecognized item: \" + itemName);\n return;\n }\n\n // return if the player already has it.\n if (Player.hasProgram(item.program)) {\n Terminal.print(\"You already have the \" + item.program + \" program\");\n return;\n }\n\n // return if the player doesn't have enough money\n if (Player.money < item.price) {\n Terminal.error(\"Not enough money to purchase \" + item.program);\n return;\n }\n\n // buy and push\n Player.loseMoney(item.price, \"other\");\n\n Player.getHomeComputer().pushProgram(item.program);\n // Cancel if the program is in progress of writing\n if (isCreateProgramWork(Player.currentWork) && Player.currentWork.programName === item.program) {\n Player.finishWork(true);\n }\n\n Terminal.print(\n \"You have purchased the \" + item.program + \" program. The new program can be found on your home computer.\",\n );\n}\n\nexport function buyAllDarkwebItems(): void {\n const itemsToBuy: DarkWebItem[] = [];\n let cost = 0;\n\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n if (!Player.hasProgram(item.program)) {\n itemsToBuy.push(item);\n cost += item.price;\n }\n }\n\n if (itemsToBuy.length === 0) {\n Terminal.print(\"All available programs have been purchased already.\");\n return;\n }\n\n if (cost > Player.money) {\n Terminal.error(\n \"Not enough money to purchase remaining programs, \" + numeralWrapper.formatMoney(cost) + \" required\",\n );\n return;\n }\n\n for (const item of itemsToBuy) {\n buyDarkwebItem(item.program);\n }\n}\n","import { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { calculateSkill } from \"../../PersonObjects/formulas/skill\";\n\nfunction calculateRawDiff(player: IPlayer, stats: number, startingDifficulty: number): number {\n const difficulty = startingDifficulty - Math.pow(stats, 0.9) / 250 - player.skills.intelligence / 1600;\n if (difficulty < 0) return 0;\n if (difficulty > 3) return 3;\n return difficulty;\n}\n\nexport function calculateDifficulty(player: IPlayer, startingSecurityLevel: number): number {\n const totalStats =\n player.skills.strength +\n player.skills.defense +\n player.skills.dexterity +\n player.skills.agility +\n player.skills.charisma;\n return calculateRawDiff(player, totalStats, startingSecurityLevel);\n}\n\nexport function calculateReward(player: IPlayer, startingSecurityLevel: number): number {\n const xpMult = 10 * 60 * 15;\n const total =\n calculateSkill(player.mults.strength_exp * xpMult, player.mults.strength) +\n calculateSkill(player.mults.defense_exp * xpMult, player.mults.defense) +\n calculateSkill(player.mults.agility_exp * xpMult, player.mults.agility) +\n calculateSkill(player.mults.dexterity_exp * xpMult, player.mults.dexterity) +\n calculateSkill(player.mults.charisma_exp * xpMult, player.mults.charisma);\n return calculateRawDiff(player, total, startingSecurityLevel);\n}\n","import { KEY } from \"../utils/helpers/keyCodes\";\nimport { substituteAliases } from \"../Alias\";\n// Helper function to parse individual arguments into number/boolean/string as appropriate\nfunction parseArg(arg: string): string | number | boolean {\n // Handles all numbers including hexadecimal, octal, and binary representations, returning NaN on an unparseable string\n const asNumber = Number(arg);\n if (!isNaN(asNumber)) {\n return asNumber;\n }\n\n if (arg === \"true\" || arg === \"false\") {\n return arg === \"true\";\n }\n\n return arg;\n}\n\nexport function ParseCommands(commands: string): string[] {\n // Sanitize input\n commands = commands.trim();\n // Replace all extra whitespace in command with a single space\n commands = commands.replace(/\\s\\s+/g, \" \");\n\n const match = commands.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g);\n if (!match) return [];\n // Split commands and execute sequentially\n const allCommands = match\n .map(substituteAliases)\n .map((c) => c.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g))\n .flat();\n\n const out: string[] = [];\n for (const c of allCommands) {\n if (c === null) continue;\n if (c.match(/^\\s*$/)) {\n continue;\n } // Don't run commands that only have whitespace\n out.push(c.trim());\n }\n return out;\n}\n\nexport function ParseCommand(command: string): (string | number | boolean)[] {\n let idx = 0;\n const args = [];\n\n let lastQuote = \"\";\n\n let arg = \"\";\n while (idx < command.length) {\n const c = command.charAt(idx);\n\n // If the current character is a backslash, add the next character verbatim to the argument\n if (c === \"\\\\\") {\n arg += command.charAt(++idx);\n // If the current character is a single- or double-quote mark, add it to the current argument.\n } else if (c === KEY.DOUBLE_QUOTE || c === KEY.QUOTE) {\n // If we're currently in a quoted string argument and this quote mark is the same as the beginning,\n // the string is done\n if (lastQuote !== \"\" && c === lastQuote) {\n lastQuote = \"\";\n // Otherwise if we're not in a string argument, we've begun one\n } else if (lastQuote === \"\") {\n lastQuote = c;\n // Otherwise if we're in a string argument, add the current character to it\n } else {\n arg += c;\n }\n // If the current character is a space and we are not inside a string, parse the current argument\n // and start a new one\n } else if (c === KEY.SPACE && lastQuote === \"\") {\n args.push(parseArg(arg));\n\n arg = \"\";\n } else {\n // Add the current character to the current argument\n arg += c;\n }\n\n idx++;\n }\n\n // Add the last arg (if any)\n if (arg !== \"\") {\n args.push(parseArg(arg));\n }\n\n return args;\n}\n","import React, { useState } from \"react\";\n\nimport { CinematicLine } from \"./CinematicLine\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n lines: string[];\n auto?: boolean;\n onDone?: () => void;\n}\n\nexport function CinematicText(props: IProps): React.ReactElement {\n const [i, setI] = useState(0);\n const [done, setDone] = useState(false);\n\n function advance(): void {\n const newI = i + 1;\n setI(newI);\n if (newI >= props.lines.length) {\n if (props.onDone && props.auto) props.onDone();\n setDone(true);\n }\n }\n\n return (\n <>\n {props.lines.slice(0, i).map((line, i) => (\n {line}\n ))}\n {props.lines.length > i && }\n {!props.auto && props.onDone && done && }\n \n );\n}\n","/**\n * Implements the purchasing of extra Duplicate Sleeves from The Covenant,\n * as well as the purchasing of upgrades (memory)\n */\n\nexport const MaxSleevesFromCovenant = 5;\nexport const BaseCostPerSleeve = 10e12;\n","/**\n * Implements RAM Calculation functionality.\n *\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST, calculating RAM usage along\n * the way\n */\nimport * as walk from \"acorn-walk\";\nimport acorn, { parse } from \"acorn\";\n\nimport { RamCalculationErrorCode } from \"./RamCalculationErrorCodes\";\n\nimport { RamCosts, RamCostConstants } from \"../Netscript/RamCostGenerator\";\nimport { Script } from \"./Script\";\nimport { areImportsEquals } from \"../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Node } from \"../NetscriptJSEvaluator\";\n\nexport interface RamUsageEntry {\n type: \"ns\" | \"dom\" | \"fn\" | \"misc\";\n name: string;\n cost: number;\n}\n\nexport interface RamCalculation {\n cost: number;\n entries?: RamUsageEntry[];\n}\n\n// These special strings are used to reference the presence of a given logical\n// construct within a user script.\nconst specialReferenceIF = \"__SPECIAL_referenceIf\";\nconst specialReferenceFOR = \"__SPECIAL_referenceFor\";\nconst specialReferenceWHILE = \"__SPECIAL_referenceWhile\";\n\n// The global scope of a script is registered under this key during parsing.\nconst memCheckGlobalKey = \".__GLOBAL__\";\n\n/**\n * Parses code into an AST and walks through it recursively to calculate\n * RAM usage. Also accounts for imported modules.\n * @param {Script[]} otherScripts - All other scripts on the server. Used to account for imported scripts\n * @param {string} codeCopy - The code being parsed\n * @param {WorkerScript} workerScript - Object containing RAM costs of Netscript functions. Also used to\n * keep track of what functions have/havent been accounted for\n */\nfunction parseOnlyRamCalculate(player: IPlayer, otherScripts: Script[], code: string): RamCalculation {\n try {\n /**\n * Maps dependent identifiers to their dependencies.\n *\n * The initial identifier is __SPECIAL_INITIAL_MODULE__.__GLOBAL__.\n * It depends on all the functions declared in the module, all the global scopes\n * of its imports, and any identifiers referenced in this global scope. Each\n * function depends on all the identifiers referenced internally.\n * We walk the dependency graph to calculate RAM usage, given that some identifiers\n * reference Netscript functions which have a RAM cost.\n */\n let dependencyMap: { [key: string]: string[] } = {};\n\n // Scripts we've parsed.\n const completedParses = new Set();\n\n // Scripts we've discovered that need to be parsed.\n const parseQueue: string[] = [];\n\n // Parses a chunk of code with a given module name, and updates parseQueue and dependencyMap.\n function parseCode(code: string, moduleName: string): void {\n const result = parseOnlyCalculateDeps(code, moduleName);\n completedParses.add(moduleName);\n\n // Add any additional modules to the parse queue;\n for (let i = 0; i < result.additionalModules.length; ++i) {\n if (!completedParses.has(result.additionalModules[i])) {\n parseQueue.push(result.additionalModules[i]);\n }\n }\n\n // Splice all the references in\n dependencyMap = Object.assign(dependencyMap, result.dependencyMap);\n }\n\n // Parse the initial module, which is the \"main\" script that is being run\n const initialModule = \"__SPECIAL_INITIAL_MODULE__\";\n parseCode(code, initialModule);\n\n // Process additional modules, which occurs if the \"main\" script has any imports\n while (parseQueue.length > 0) {\n const nextModule = parseQueue.shift();\n if (nextModule === undefined) throw new Error(\"nextModule should not be undefined\");\n if (nextModule.startsWith(\"https://\") || nextModule.startsWith(\"http://\")) continue;\n\n let script = null;\n const fn = nextModule.startsWith(\"./\") ? nextModule.slice(2) : nextModule;\n for (const s of otherScripts) {\n if (areImportsEquals(s.filename, fn)) {\n script = s;\n break;\n }\n }\n\n if (script == null) {\n return { cost: RamCalculationErrorCode.ImportError }; // No such script on the server\n }\n\n parseCode(script.code, nextModule);\n }\n\n // Finally, walk the reference map and generate a ram cost. The initial set of keys to scan\n // are those that start with __SPECIAL_INITIAL_MODULE__.\n let ram = RamCostConstants.ScriptBaseRamCost;\n const detailedCosts: RamUsageEntry[] = [\n { type: \"misc\", name: \"baseCost\", cost: RamCostConstants.ScriptBaseRamCost },\n ];\n const unresolvedRefs = Object.keys(dependencyMap).filter((s) => s.startsWith(initialModule));\n const resolvedRefs = new Set();\n const loadedFns: Record = {};\n while (unresolvedRefs.length > 0) {\n const ref = unresolvedRefs.shift();\n if (ref === undefined) throw new Error(\"ref should not be undefined\");\n\n // Check if this is one of the special keys, and add the appropriate ram cost if so.\n if (ref === \"hacknet\" && !resolvedRefs.has(\"hacknet\")) {\n ram += RamCostConstants.ScriptHacknetNodesRamCost;\n detailedCosts.push({ type: \"ns\", name: \"hacknet\", cost: RamCostConstants.ScriptHacknetNodesRamCost });\n }\n if (ref === \"document\" && !resolvedRefs.has(\"document\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: \"dom\", name: \"document\", cost: RamCostConstants.ScriptDomRamCost });\n }\n if (ref === \"window\" && !resolvedRefs.has(\"window\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: \"dom\", name: \"window\", cost: RamCostConstants.ScriptDomRamCost });\n }\n if (ref === \"corporation\" && !resolvedRefs.has(\"corporation\")) {\n ram += RamCostConstants.ScriptCorporationRamCost;\n detailedCosts.push({ type: \"ns\", name: \"corporation\", cost: RamCostConstants.ScriptCorporationRamCost });\n }\n\n resolvedRefs.add(ref);\n\n if (ref.endsWith(\".*\")) {\n // A prefix reference. We need to find all matching identifiers.\n const prefix = ref.slice(0, ref.length - 2);\n for (const ident of Object.keys(dependencyMap).filter((k) => k.startsWith(prefix))) {\n for (const dep of dependencyMap[ident] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n } else {\n // An exact reference. Add all dependencies of this ref.\n for (const dep of dependencyMap[ref] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n\n // Check if this identifier is a function in the workerScript environment.\n // If it is, then we need to get its RAM cost.\n try {\n function applyFuncRam(cost: number | ((p: IPlayer) => number)): number {\n if (typeof cost === \"number\") {\n return cost;\n } else if (typeof cost === \"function\") {\n return cost(player);\n } else {\n return 0;\n }\n }\n\n // Only count each function once\n if (loadedFns[ref]) {\n continue;\n }\n loadedFns[ref] = true;\n\n // This accounts for namespaces (Bladeburner, CodingContract, etc.)\n const findFunc = (\n prefix: string,\n obj: object,\n ref: string,\n ): { func: (p: IPlayer) => number | number; refDetail: string } | undefined => {\n if (!obj) return;\n const elem = Object.entries(obj).find(([key]) => key === ref);\n if (elem !== undefined && (typeof elem[1] === \"function\" || typeof elem[1] === \"number\")) {\n return { func: elem[1], refDetail: `${prefix}${ref}` };\n }\n for (const [key, value] of Object.entries(obj)) {\n const found = findFunc(`${key}.`, value, ref);\n if (found) return found;\n }\n return undefined;\n };\n\n const details = findFunc(\"\", RamCosts, ref);\n const fnRam = applyFuncRam(details?.func ?? 0);\n ram += fnRam;\n detailedCosts.push({ type: \"fn\", name: details?.refDetail ?? \"\", cost: fnRam });\n } catch (error) {\n console.log(error);\n continue;\n }\n }\n return { cost: ram, entries: detailedCosts.filter((e) => e.cost > 0) };\n } catch (error) {\n // console.info(\"parse or eval error: \", error);\n // This is not unexpected. The user may be editing a script, and it may be in\n // a transitory invalid state.\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n}\n\nexport function checkInfiniteLoop(code: string): number {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n\n function nodeHasTrueTest(node: acorn.Node): boolean {\n return node.type === \"Literal\" && (node as any).raw === \"true\";\n }\n\n function hasAwait(ast: acorn.Node): boolean {\n let hasAwait = false;\n walk.recursive(\n ast,\n {},\n {\n AwaitExpression: () => {\n hasAwait = true;\n },\n },\n );\n return hasAwait;\n }\n\n let missingAwaitLine = -1;\n walk.recursive(\n ast,\n {},\n {\n WhileStatement: (node: Node, st: unknown, walkDeeper: walk.WalkerCallback) => {\n if (nodeHasTrueTest(node.test) && !hasAwait(node)) {\n missingAwaitLine = (code.slice(0, node.start).match(/\\n/g) || []).length + 1;\n } else {\n node.body && walkDeeper(node.body, st);\n }\n },\n },\n );\n\n return missingAwaitLine;\n}\n\ninterface ParseDepsResult {\n dependencyMap: {\n [key: string]: Set | undefined;\n };\n additionalModules: string[];\n}\n\n/**\n * Helper function that parses a single script. It returns a map of all dependencies,\n * which are items in the code's AST that potentially need to be evaluated\n * for RAM usage calculations. It also returns an array of additional modules\n * that need to be parsed (i.e. are 'import'ed scripts).\n */\nfunction parseOnlyCalculateDeps(code: string, currentModule: string): ParseDepsResult {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n // Everything from the global scope goes in \".\". Everything else goes in \".function\", where only\n // the outermost layer of functions counts.\n const globalKey = currentModule + memCheckGlobalKey;\n const dependencyMap: { [key: string]: Set | undefined } = {};\n dependencyMap[globalKey] = new Set();\n\n // If we reference this internal name, we're really referencing that external name.\n // Filled when we import names from other modules.\n const internalToExternal: { [key: string]: string | undefined } = {};\n\n const additionalModules: string[] = [];\n\n // References get added pessimistically. They are added for thisModule.name, name, and for\n // any aliases.\n function addRef(key: string, name: string): void {\n const s = dependencyMap[key] || (dependencyMap[key] = new Set());\n const external = internalToExternal[name];\n if (external !== undefined) {\n s.add(external);\n }\n s.add(currentModule + \".\" + name);\n s.add(name); // For builtins like hack.\n }\n\n //A list of identifiers that resolve to \"native Javascript code\"\n const objectPrototypeProperties = Object.getOwnPropertyNames(Object.prototype);\n\n interface State {\n key: string;\n }\n\n // If we discover a dependency identifier, state.key is the dependent identifier.\n // walkDeeper is for doing recursive walks of expressions in composites that we handle.\n function commonVisitors(): walk.RecursiveVisitors {\n return {\n Identifier: (node: Node, st: State) => {\n if (objectPrototypeProperties.includes(node.name)) {\n return;\n }\n addRef(st.key, node.name);\n },\n WhileStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n DoWhileStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n ForStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceFOR);\n node.init && walkDeeper(node.init, st);\n node.test && walkDeeper(node.test, st);\n node.update && walkDeeper(node.update, st);\n node.body && walkDeeper(node.body, st);\n },\n IfStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceIF);\n node.test && walkDeeper(node.test, st);\n node.consequent && walkDeeper(node.consequent, st);\n node.alternate && walkDeeper(node.alternate, st);\n },\n MemberExpression: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n node.object && walkDeeper(node.object, st);\n node.property && walkDeeper(node.property, st);\n },\n };\n }\n\n walk.recursive(\n ast,\n { key: globalKey },\n Object.assign(\n {\n ImportDeclaration: (node: Node, st: State) => {\n const importModuleName = node.source.value;\n additionalModules.push(importModuleName);\n\n // This module's global scope refers to that module's global scope, no matter how we\n // import it.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + memCheckGlobalKey);\n\n for (let i = 0; i < node.specifiers.length; ++i) {\n const spec = node.specifiers[i];\n if (spec.imported !== undefined && spec.local !== undefined) {\n // We depend on specific things.\n internalToExternal[spec.local.name] = importModuleName + \".\" + spec.imported.name;\n } else {\n // We depend on everything.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + \".*\");\n }\n }\n },\n FunctionDeclaration: (node: Node) => {\n // node.id will be null when using 'export default'. Add a module name indicating the default export.\n const key = currentModule + \".\" + (node.id === null ? \"__SPECIAL_DEFAULT_EXPORT__\" : node.id.name);\n walk.recursive(node, { key: key }, commonVisitors());\n },\n },\n commonVisitors(),\n ),\n );\n\n return { dependencyMap: dependencyMap, additionalModules: additionalModules };\n}\n\n/**\n * Calculate's a scripts RAM Usage\n * @param {string} codeCopy - The script's code\n * @param {Script[]} otherScripts - All other scripts on the server.\n * Used to account for imported scripts\n */\nexport function calculateRamUsage(player: IPlayer, codeCopy: string, otherScripts: Script[]): RamCalculation {\n try {\n return parseOnlyRamCalculate(player, otherScripts, codeCopy);\n } catch (e) {\n console.error(`Failed to parse script for RAM calculations:`);\n console.error(e);\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n}\n","/**\n * Rounds a number to two decimal places.\n * @param decimal A decimal value to trim to two places.\n */\nexport function roundToTwo(decimal: number): number {\n const leftShift: number = Math.round(parseFloat(`${decimal}e+2`));\n\n return +`${leftShift}e-2`;\n}\n","import { workerScripts } from \"./WorkerScripts\";\n\nlet pidCounter = 1;\n\n/**\n * Find and return the next availble PID for a script\n */\nexport function generateNextPid(): number {\n let tempCounter = pidCounter;\n\n // Cap the number of search iterations at some arbitrary value to avoid\n // infinite loops. We'll assume that players wont have 1mil+ running scripts\n let found = false;\n for (let i = 0; i < 1e6; ) {\n if (!workerScripts.has(tempCounter + i)) {\n found = true;\n tempCounter = tempCounter + i;\n break;\n }\n\n if (i === Number.MAX_SAFE_INTEGER - 1) {\n i = 1;\n } else {\n ++i;\n }\n }\n\n if (found) {\n pidCounter = tempCounter + 1;\n if (pidCounter >= Number.MAX_SAFE_INTEGER) {\n pidCounter = 1;\n }\n\n return tempCounter;\n } else {\n return -1;\n }\n}\n\nexport function resetPidCounter(): void {\n pidCounter = 1;\n}\n","/**\n * TODO\n * Add police clashes\n * balance point to keep them from running out of control\n */\n\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions } from \"../Faction/Factions\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\n\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangConstants } from \"./data/Constants\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { IAscensionResult } from \"./IAscensionResult\";\n\nimport { AllGangs } from \"./AllGangs\";\nimport { GangMember } from \"./GangMember\";\n\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { PowerMultiplier } from \"./data/power\";\nimport { IGang } from \"./IGang\";\n\nexport class Gang implements IGang {\n facName: string;\n members: GangMember[];\n wanted: number;\n respect: number;\n\n isHackingGang: boolean;\n\n respectGainRate: number;\n wantedGainRate: number;\n moneyGainRate: number;\n\n storedCycles: number;\n\n storedTerritoryAndPowerCycles: number;\n\n territoryClashChance: number;\n territoryWarfareEngaged: boolean;\n\n notifyMemberDeath: boolean;\n\n constructor(facName = \"\", hacking = false) {\n this.facName = facName;\n this.members = [];\n this.wanted = 1;\n this.respect = 1;\n\n this.isHackingGang = hacking;\n\n this.respectGainRate = 0;\n this.wantedGainRate = 0;\n this.moneyGainRate = 0;\n\n // When processing gains, this stores the number of cycles until some\n // limit is reached, and then calculates and applies the gains only at that limit\n this.storedCycles = 0;\n\n // Separate variable to keep track of cycles for Territry + Power gang, which\n // happens on a slower \"clock\" than normal processing\n this.storedTerritoryAndPowerCycles = 0;\n\n this.territoryClashChance = 0;\n this.territoryWarfareEngaged = false;\n\n this.notifyMemberDeath = true;\n }\n\n getPower(): number {\n return AllGangs[this.facName].power;\n }\n\n getTerritory(): number {\n return AllGangs[this.facName].territory;\n }\n\n process(numCycles = 1, player: IPlayer): void {\n const CyclesPerSecond = 1000 / CONSTANTS._idleSpeed;\n\n if (isNaN(numCycles)) {\n console.error(`NaN passed into Gang.process(): ${numCycles}`);\n }\n this.storedCycles += numCycles;\n\n // Only process if there are at least 2 seconds, and at most 5 seconds\n if (this.storedCycles < 2 * CyclesPerSecond) return;\n const cycles = Math.min(this.storedCycles, 5 * CyclesPerSecond);\n\n try {\n this.processGains(cycles, player);\n this.processExperienceGains(cycles);\n this.processTerritoryAndPowerGains(cycles);\n this.storedCycles -= cycles;\n } catch (e: unknown) {\n console.error(`Exception caught when processing Gang: ${e}`);\n }\n }\n\n processGains(numCycles = 1, player: IPlayer): void {\n // Get gains per cycle\n let moneyGains = 0;\n let respectGains = 0;\n let wantedLevelGains = 0;\n let justice = 0;\n for (let i = 0; i < this.members.length; ++i) {\n respectGains += this.members[i].calculateRespectGain(this);\n moneyGains += this.members[i].calculateMoneyGain(this);\n const wantedLevelGain = this.members[i].calculateWantedLevelGain(this);\n wantedLevelGains += wantedLevelGain;\n if (this.members[i].getTask().baseWanted < 0) justice++; // this member is lowering wanted.\n }\n this.respectGainRate = respectGains;\n this.wantedGainRate = wantedLevelGains;\n this.moneyGainRate = moneyGains;\n const gain = respectGains * numCycles;\n this.respect += gain;\n // Faction reputation gains is respect gain divided by some constant\n const fac = Factions[this.facName];\n if (!(fac instanceof Faction)) {\n dialogBoxCreate(\n \"ERROR: Could not get Faction associates with your gang. This is a bug, please report to game dev\",\n );\n throw new Error(\"Could not find the faction associated with this gang.\");\n }\n const favorMult = 1 + fac.favor / 100;\n\n fac.playerReputation += (player.mults.faction_rep * gain * favorMult) / GangConstants.GangRespectToReputationRatio;\n\n // Keep track of respect gained per member\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].recordEarnedRespect(numCycles, this);\n }\n if (!(this.wanted === 1 && wantedLevelGains < 0)) {\n const oldWanted = this.wanted;\n let newWanted = oldWanted + wantedLevelGains * numCycles;\n newWanted = newWanted * (1 - justice * 0.001); // safeguard\n // Prevent overflow\n if (wantedLevelGains <= 0 && newWanted > oldWanted) newWanted = 1;\n\n this.wanted = newWanted;\n if (this.wanted < 1) this.wanted = 1;\n }\n player.gainMoney(moneyGains * numCycles, \"gang\");\n }\n\n processTerritoryAndPowerGains(numCycles = 1): void {\n this.storedTerritoryAndPowerCycles += numCycles;\n if (this.storedTerritoryAndPowerCycles < GangConstants.CyclesPerTerritoryAndPowerUpdate) return;\n this.storedTerritoryAndPowerCycles -= GangConstants.CyclesPerTerritoryAndPowerUpdate;\n\n // Process power first\n const gangName = this.facName;\n for (const name of Object.keys(AllGangs)) {\n if (AllGangs.hasOwnProperty(name)) {\n if (name == gangName) {\n AllGangs[name].power += this.calculatePower();\n } else {\n // All NPC gangs get random power gains\n const gainRoll = Math.random();\n if (gainRoll < 0.5) {\n // Multiplicative gain (50% chance)\n // This is capped per cycle, to prevent it from getting out of control\n const multiplicativeGain = AllGangs[name].power * 0.005;\n AllGangs[name].power += Math.min(0.85, multiplicativeGain);\n } else {\n // Additive gain (50% chance)\n const powerMult = PowerMultiplier[name];\n if (powerMult === undefined) throw new Error(\"Should not be undefined\");\n const additiveGain = 0.75 * gainRoll * AllGangs[name].territory * powerMult;\n AllGangs[name].power += additiveGain;\n }\n }\n }\n }\n\n // Determine if territory should be processed\n if (this.territoryWarfareEngaged) {\n this.territoryClashChance = 1;\n } else if (this.territoryClashChance > 0) {\n // Engagement turned off, but still a positive clash chance. So there's\n // still a chance of clashing but it slowly goes down over time\n this.territoryClashChance = Math.max(0, this.territoryClashChance - 0.01);\n }\n\n // Then process territory\n const gangs = GangConstants.Names.filter((g) => AllGangs[g].territory > 0 || g === gangName);\n if (gangs.length > 1) {\n for (let i = 0; i < gangs.length; ++i) {\n const others = gangs.filter((e) => {\n return e !== gangs[i];\n });\n const other = getRandomInt(0, others.length - 1);\n\n const thisGang = gangs[i];\n const otherGang = others[other];\n\n // If either of the gangs involved in this clash is the player, determine\n // whether to skip or process it using the clash chance\n if (thisGang === gangName || otherGang === gangName) {\n if (!(Math.random() < this.territoryClashChance)) continue;\n }\n\n const thisPwr = AllGangs[thisGang].power;\n const otherPwr = AllGangs[otherGang].power;\n const thisChance = thisPwr / (thisPwr + otherPwr);\n\n function calculateTerritoryGain(winGang: string, loseGang: string): number {\n const powerBonus = Math.max(\n 1,\n 1 + Math.log(AllGangs[winGang].power / AllGangs[loseGang].power) / Math.log(50),\n );\n const gains = Math.min(AllGangs[loseGang].territory, powerBonus * 0.0001 * (Math.random() + 0.5));\n return gains;\n }\n\n if (Math.random() < thisChance) {\n if (AllGangs[otherGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(thisGang, otherGang);\n AllGangs[thisGang].territory += territoryGain;\n AllGangs[otherGang].territory -= territoryGain;\n if (thisGang === gangName) {\n this.clash(true); // Player won\n AllGangs[otherGang].power *= 1 / 1.01;\n } else if (otherGang === gangName) {\n this.clash(false); // Player lost\n } else {\n AllGangs[otherGang].power *= 1 / 1.01;\n }\n } else {\n if (AllGangs[thisGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(otherGang, thisGang);\n AllGangs[thisGang].territory -= territoryGain;\n AllGangs[otherGang].territory += territoryGain;\n if (thisGang === gangName) {\n this.clash(false); // Player lost\n } else if (otherGang === gangName) {\n this.clash(true); // Player won\n AllGangs[thisGang].power *= 1 / 1.01;\n } else {\n AllGangs[thisGang].power *= 1 / 1.01;\n }\n }\n\n const total = Object.values(AllGangs)\n .map((g) => g.territory)\n .reduce((p, c) => p + c, 0);\n Object.values(AllGangs).forEach((g) => (g.territory /= total));\n }\n }\n }\n\n processExperienceGains(numCycles = 1): void {\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].gainExperience(numCycles);\n this.members[i].updateSkillLevels();\n }\n }\n\n clash(won = false): void {\n // Determine if a gang member should die\n let baseDeathChance = 0.01;\n if (won) baseDeathChance /= 2;\n // If the clash was lost, the player loses a small percentage of power\n else AllGangs[this.facName].power *= 1 / 1.008;\n\n // Deaths can only occur during X% of clashes\n if (Math.random() < 0.65) return;\n\n for (let i = this.members.length - 1; i >= 0; --i) {\n const member = this.members[i];\n\n // Only members assigned to Territory Warfare can die\n if (member.task !== \"Territory Warfare\") continue;\n\n // Chance to die is decreased based on defense\n const modifiedDeathChance = baseDeathChance / Math.pow(member.def, 0.6);\n if (Math.random() < modifiedDeathChance) {\n this.killMember(member);\n }\n }\n }\n\n canRecruitMember(): boolean {\n if (this.members.length >= GangConstants.MaximumGangMembers) return false;\n return this.respect >= this.getRespectNeededToRecruitMember();\n }\n\n getRespectNeededToRecruitMember(): number {\n // First N gang members are free (can be recruited at 0 respect)\n const numFreeMembers = 3;\n if (this.members.length < numFreeMembers) return 0;\n\n const i = this.members.length - (numFreeMembers - 1);\n return Math.pow(5, i);\n }\n\n recruitMember(name: string): boolean {\n name = String(name);\n if (name === \"\" || !this.canRecruitMember()) return false;\n\n // Check for already-existing names\n const sameNames = this.members.filter((m) => m.name === name);\n if (sameNames.length >= 1) return false;\n\n const member = new GangMember(name);\n this.members.push(member);\n return true;\n }\n\n // Money and Respect gains multiplied by this number (< 1)\n getWantedPenalty(): number {\n return this.respect / (this.respect + this.wanted);\n }\n\n //Calculates power GAIN, which is added onto the Gang's existing power\n calculatePower(): number {\n let memberTotal = 0;\n for (let i = 0; i < this.members.length; ++i) {\n if (!GangMemberTasks.hasOwnProperty(this.members[i].task) || this.members[i].task !== \"Territory Warfare\")\n continue;\n memberTotal += this.members[i].calculatePower();\n }\n return 0.015 * Math.max(0.002, this.getTerritory()) * memberTotal;\n }\n\n killMember(member: GangMember): void {\n // Player loses a percentage of total respect, plus whatever respect that member has earned\n const totalRespect = this.respect;\n const lostRespect = 0.05 * totalRespect + member.earnedRespect;\n this.respect = Math.max(0, totalRespect - lostRespect);\n\n for (let i = 0; i < this.members.length; ++i) {\n if (member.name === this.members[i].name) {\n this.members.splice(i, 1);\n break;\n }\n }\n\n // Notify of death\n if (this.notifyMemberDeath) {\n dialogBoxCreate(`${member.name} was killed in a gang clash! You lost ${lostRespect} respect`);\n }\n }\n\n ascendMember(member: GangMember, workerScript?: WorkerScript): IAscensionResult {\n try {\n const res = member.ascend();\n this.respect = Math.max(1, this.respect - res.respect);\n if (workerScript) {\n workerScript.log(\"gang.ascendMember\", () => `Ascended Gang member ${member.name}`);\n }\n return res;\n } catch (e: unknown) {\n if (workerScript == null) {\n exceptionAlert(e);\n }\n throw e; // Re-throw, will be caught in the Netscript Function\n }\n }\n\n // Cost of upgrade gets cheaper as gang increases in respect + power\n getDiscount(): number {\n const power = this.getPower();\n const respect = this.respect;\n\n const respectLinearFac = 5e6;\n const powerLinearFac = 1e6;\n const discount =\n Math.pow(respect, 0.01) + respect / respectLinearFac + Math.pow(power, 0.01) + power / powerLinearFac - 1;\n return Math.max(1, discount);\n }\n\n // Returns only valid tasks for this gang. Excludes 'Unassigned'\n getAllTaskNames(): string[] {\n return Object.keys(GangMemberTasks).filter((taskName: string) => {\n const task = GangMemberTasks[taskName];\n if (task == null) return false;\n if (task.name === \"Unassigned\") return false;\n // yes you need both checks\n return this.isHackingGang === task.isHacking || !this.isHackingGang === task.isCombat;\n });\n }\n\n getUpgradeCost(upg: GangMemberUpgrade | null): number {\n if (upg == null) {\n return Infinity;\n }\n return upg.cost / this.getDiscount();\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Gang\", this);\n }\n\n /**\n * Initiatizes a Gang object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Gang {\n return Generic_fromJSON(Gang, value.data);\n }\n}\n\nReviver.constructors.Gang = Gang;\n","import { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function repFromDonation(amt: number, player: IPlayer): number {\n return (amt / CONSTANTS.DonateMoneyToRepDivisor) * player.mults.faction_rep;\n}\n","import { Settings } from \"../Settings/Settings\";\nimport { Remote } from \"./Remote\";\n\nlet server: Remote;\n\nexport function newRemoteFileApiConnection(): void {\n if (server) server.stopConnection();\n if (Settings.RemoteFileApiPort === 0) return;\n server = new Remote(\"localhost\", Settings.RemoteFileApiPort);\n server.startConnection();\n}\n\nexport function isRemoteFileApiConnectionLive(): boolean {\n return server && server.connection != undefined && server.connection.readyState == 1;\n}\n","import { Company } from \"./Company\";\nimport { CompanyPosition } from \"./CompanyPosition\";\n\n/**\n * Returns a string with the given CompanyPosition's stat requirements\n */\n\nexport function getJobRequirementText(company: Company, pos: CompanyPosition, tooltiptext = false): string {\n let reqText = \"\";\n const offset: number = company.jobStatReqOffset;\n const reqHacking: number = pos.requiredHacking > 0 ? pos.requiredHacking + offset : 0;\n const reqStrength: number = pos.requiredStrength > 0 ? pos.requiredStrength + offset : 0;\n const reqDefense: number = pos.requiredDefense > 0 ? pos.requiredDefense + offset : 0;\n const reqDexterity: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqAgility: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqCharisma: number = pos.requiredCharisma > 0 ? pos.requiredCharisma + offset : 0;\n const reqRep: number = pos.requiredReputation;\n if (tooltiptext) {\n reqText = \"Requires:
\";\n reqText += reqHacking.toString() + \" hacking
\";\n reqText += reqStrength.toString() + \" strength
\";\n reqText += reqDefense.toString() + \" defense
\";\n reqText += reqDexterity.toString() + \" dexterity
\";\n reqText += reqAgility.toString() + \" agility
\";\n reqText += reqCharisma.toString() + \" charisma
\";\n reqText += reqRep.toString() + \" reputation\";\n } else {\n reqText = \"(Requires \";\n if (reqHacking > 0) {\n reqText += reqHacking + \" hacking, \";\n }\n if (reqStrength > 0) {\n reqText += reqStrength + \" strength, \";\n }\n if (reqDefense > 0) {\n reqText += reqDefense + \" defense, \";\n }\n if (reqDexterity > 0) {\n reqText += reqDexterity + \" dexterity, \";\n }\n if (reqAgility > 0) {\n reqText += reqAgility + \" agility, \";\n }\n if (reqCharisma > 0) {\n reqText += reqCharisma + \" charisma, \";\n }\n if (reqRep > 1) {\n reqText += reqRep + \" reputation, \";\n }\n reqText = reqText.substring(0, reqText.length - 2);\n reqText += \")\";\n }\n return reqText;\n}\n","/* tslint:disable:max-line-length completed-docs variable-name*/\nimport { IMap } from \"../types\";\n\nexport const TerminalHelpText: string[] = [\n \"Type 'help name' to learn more about the command \",\n \" \",\n ' alias [-g] [name=\"value\"] Create or display Terminal aliases',\n \" analyze Get information about the current machine \",\n \" backdoor Install a backdoor on the current machine \",\n \" buy [-l/-a/program] Purchase a program through the Dark Web\",\n \" cat [file] Display a .msg, .lit, or .txt file\",\n \" cd [dir] Change to a new directory\",\n \" check [script] [args...] Print a script's logs to Terminal\",\n \" clear Clear all text on the terminal \",\n \" cls See 'clear' command \",\n \" connect [hostname] Connects to a remote server\",\n \" cp [src] [dst] Copy a file\",\n \" download [script/text file] Downloads scripts or text files to your computer\",\n \" expr [math expression] Evaluate a mathematical expression\",\n \" free Check the machine's memory (RAM) usage\",\n \" grow Spoof money in a servers bank account, increasing the amount available.\",\n \" hack Hack the current machine\",\n \" help [command] Display this help text, or the help text for a command\",\n \" history [-c] Display the terminal history\",\n \" home Connect to home computer\",\n \" hostname Displays the hostname of the machine\",\n \" kill [script/pid] [args...] Stops the specified script on the current server \",\n \" killall Stops all running scripts on the current machine\",\n \" ls [dir] [--grep pattern] Displays all files on the machine\",\n \" lscpu Displays the number of CPU cores on the machine\",\n \" mem [script] [-t n] Displays the amount of RAM required to run the script\",\n \" mv [src] [dest] Move/rename a text or script file\",\n \" nano [file ...] Text editor - Open up and edit one or more scripts or text files\",\n \" ps Display all scripts that are currently running\",\n \" rm [file] Delete a file from the server\",\n \" run [name] [-t n] [--tail] [args...] Execute a program or script\",\n \" scan Prints all immediately-available network connections\",\n \" scan-analyze [d] [-a] Prints info for all servers up to d nodes away\",\n \" scp [file ...] [server] Copies a file to a destination server\",\n \" sudov Shows whether you have root access on this computer\",\n \" tail [script] [args...] Displays dynamic logs for the specified script\",\n \" top Displays all running scripts and their RAM usage\",\n \" unalias [alias name] Deletes the specified alias\",\n \" vim [file ...] Text editor - Open up and edit one or more scripts or text files in vim mode\",\n \" weaken Reduce the security of the current machine\",\n \" wget [url] [target file] Retrieves code/text from a web server\",\n \" \",\n];\n\nconst TemplatedHelpTexts: IMap<(command: string) => string[]> = {\n scriptEditor: (command) => {\n return [\n `Usage: ${command} [file ...] | [glob]`,\n ` `,\n `Opens up the specified file(s) in the Script Editor. Only scripts (.js, or .script) or text files (.txt) `,\n `can be edited using the Script Editor. If a file does not exist a new one will be created`,\n ` `,\n `If provided a glob as the only argument, ${command} can spider directories and open all matching `,\n `files at once. ${command} cannot create files using globs, so your scripts must already exist.`,\n ` `,\n `Examples:`,\n ` `,\n ` ${command} test.js`,\n ` ${command} test.js test2.js`,\n ` `,\n ` ${command} test.*`,\n ` ${command} /my-dir/*.js`,\n ` `,\n ];\n },\n};\n\nexport const HelpTexts: IMap = {\n alias: [\n 'Usage: alias [-g] [name=\"value\"] ',\n \" \",\n \"Create or display aliases. An alias enables a replacement of a word with another string. \",\n \"It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME \",\n \"of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, \",\n \"you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: \",\n \" \",\n ' alias nuke=\"run NUKE.exe\"',\n \" \",\n \"Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. \",\n \"It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For \",\n \"example, if the following alias was set: \",\n \" \",\n ' alias worm=\"HTTPWorm.exe\"',\n \" \",\n \"and then you tried to run the following terminal command: \",\n \" \",\n \" run worm\",\n \" \",\n \"This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted \",\n \"anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: \",\n \" \",\n ' alias -g worm=\"HTTPWorm.exe\"',\n \" \",\n \"Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. \",\n \" \",\n \"Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form \",\n \"'alias NAME=VALUE' on the Terminal. \",\n \" \",\n \"The 'unalias' command can be used to remove aliases.\",\n \" \",\n ],\n analyze: [\n \"Usage: analyze\",\n \" \",\n \"Prints details and statistics about the current server. The information that is printed includes basic \",\n \"server details such as the hostname, whether the player has root access, what ports are opened/closed, and also \",\n \"hacking-related information such as an estimated chance to successfully hack, an estimate of how much money is \",\n \"available on the server, etc.\",\n \" \",\n ],\n backdoor: [\n \"Usage: backdoor\",\n \" \",\n \"Install a backdoor on the current machine, grants a secret bonus depending on the machine.\",\n \" \",\n \"Requires root access to run.\",\n \" \",\n ],\n buy: [\n \"Usage: buy [-l / -a / program]\",\n \" \",\n \"Purchase a program through the Dark Web. Requires a TOR router to use.\",\n \" \",\n \"If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the \",\n \"dark web to the Terminal, as well as their costs.\",\n \" \",\n \"If this command is ran with the '-a' flag, it will attempt to purchase all unowned programs.\",\n \" \",\n \"Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive.\",\n \" \",\n ],\n cat: [\n \"Usage: cat [file]\",\n \" \",\n \"Display message (.msg), literature (.lit), or text (.txt) files. Examples:\",\n \" \",\n \" cat j1.msg\",\n \" \",\n \" cat foo.lit\",\n \" \",\n \" cat servers.txt\",\n \" \",\n ],\n cd: [\n \"Usage: cd [dir]\",\n \" \",\n \"Change to the specified directory. Note that this works even for directories that don't exist. If you \",\n \"change to a directory that does not exist, it will not be 'created'. Examples:\",\n \" \",\n \" cd scripts/hacking\",\n \" \",\n \" cd /logs\",\n \" \",\n \" cd ../\",\n \" \",\n ],\n check: [\n \"Usage: check [script name] [args...]\",\n \" \",\n \"Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by \",\n \"a space. Remember that a running script is uniquely \",\n \"identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 1 2 foodnstuff\",\n \" \",\n \"Then to run the 'check' command on this script you would have to pass the same arguments in: \",\n \" \",\n \" check foo.script 1 2 foodnstuff\",\n \" \",\n ],\n clear: [\n \"Usage: clear\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'cls' command\",\n \" \",\n ],\n cls: [\n \"Usage: cls\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'clear' command\",\n \" \",\n ],\n connect: [\n \"Usage: connect [hostname]\",\n \" \",\n \"Connect to a remote server. The hostname of the remote server must be given as the argument \",\n \"to this command. Note that only servers that are immediately adjacent to the current server in the network and the ones that have\",\n \"a backdoor installed can be connected to. To see which servers can be connected to, use the 'scan' command.\",\n \" \",\n ],\n cp: [\"Usage: cp [src] [dst]\", \" \", \"Copy a file on this server. To copy a file to another server use scp.\", \" \"],\n download: [\n \"Usage: download [script/text file]\",\n \" \",\n \"Downloads a script or text file to your computer (like your real life computer).\",\n \" \",\n \"You can also download all of your scripts/text files as a zip file using the following Terminal commands:\",\n \" \",\n \"Download all scripts and text files: download *\",\n \" \",\n \"Download all scripts: download *.script\",\n \" \",\n \"Download all text files: download *.txt\",\n \" \",\n ],\n expr: [\n \"Usage: expr [mathematical expression]\",\n \" \",\n \"Evaluate a simple mathematical expression. Supports native JavaScript operators:\",\n \" \",\n \"+, -, /, *, **, %\",\n \" \",\n \"Example:\",\n \" \",\n \" expr 25 * 2 ** 10\",\n \" \",\n \"Note that letters (non-digits) are not allowed and will be removed from the input.\",\n \" \",\n ],\n free: [\n \"Usage: free\",\n \" \",\n \"Displays the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as \",\n \"how much of it is being used.\",\n \" \",\n ],\n grow: [\n \"Usage: grow\",\n \" \",\n \"Spoof transactions in the current server. Increasing the money available by hacking. Requires root access.\",\n \"See the wiki page for hacking mechanics.\",\n \" \",\n ],\n hack: [\n \"Usage: hack\",\n \" \",\n \"Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics\",\n \" \",\n ],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief \",\n \"description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print \",\n \"more detailed information about the Terminal command. Examples: \",\n \" \",\n \" help alias\",\n \" \",\n \" help scan-analyze\",\n \" \",\n ],\n history: [\n \"Usage: history [-c]\",\n \" \",\n \"Without arguments, displays the terminal command history. To clear the history, pass in the '-c' argument.\",\n \" \",\n ],\n home: [\n \"Usage: home\",\n \" \",\n \"Connect to your home computer. This will work no matter what server you are currently connected to.\",\n \" \",\n ],\n hostname: [\"Usage: hostname\", \" \", \"Prints the hostname of the current server\", \" \"],\n kill: [\n \"Usage: kill [script name] [args...] or kill [pid\",\n \" \",\n \"Kill the script specified by the script name and arguments OR by its PID.\",\n \" \",\n \"If you are killing the script using its filename and arguments, then each \",\n \"argument must be separated by a space. Remember that a running script is \",\n \"uniquely identified by both its name and the arguments that are used to start \",\n \"it. So, if a script was ran with the following arguments:\",\n \" \",\n \" run foo.script 1 sigma-cosmetics\",\n \" \",\n \"Then to kill this script the same arguments would have to be used:\",\n \" \",\n \" kill foo.script 1 sigma-cosmetics\",\n \" \",\n \"If you are killing the script using its PID, then the PID argument must be numeric\",\n \" \",\n ],\n killall: [\n \"Usage: killall\",\n \" \",\n \"Kills all scripts on the current server. \",\n \"Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. \",\n \"This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. \",\n \"The script will not be stopped/killed until after that time has elapsed.\",\n \" \",\n ],\n ls: [\n \"Usage: ls [dir] [-l] [--grep pattern]\",\n \" \",\n \"The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. \",\n \"The files will be displayed in alphabetical order. \",\n \" \",\n \"The 'dir' optional parameter can be used to display files/directories in another directory.\",\n \" \",\n \"The '-l' optional parameter allows you to force each item onto a single line.\",\n \" \",\n \"The '--grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern.\",\n \" \",\n \"Examples:\",\n \" \",\n \"List all files with the '.script' extension in the current directory:\",\n \" \",\n \" ls -l --grep .script\",\n \" \",\n \"List all files with the '.js' extension in the root directory:\",\n \" \",\n \" ls / -l --grep .js\",\n \" \",\n \"List all files with the word 'purchase' in the filename, in the 'scripts' directory:\",\n \" \",\n \" ls scripts -l --grep purchase\",\n \" \",\n ],\n lscpu: [\"Usage: lscpu\", \" \", \"Prints the number of CPU Cores the current server has\", \" \"],\n\n mem: [\n \"Usage: mem [script name] [-t num_threads]\",\n \" \",\n \"Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print \",\n \"the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then \",\n \"an argument for the number of threads must be passed in afterwards. Examples:\",\n \" \",\n \" mem foo.script\",\n \" \",\n \" mem foo.script -t 50\",\n \" \",\n \"The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example \",\n \"above will print the amount of RAM needed to run 'foo.script' with 50 threads.\",\n \" \",\n ],\n mv: [\n \"Usage: mv [src] [dest]\",\n \" \",\n \"Move the source file to the specified destination. This can also be used to rename files. \",\n \"This command only works for scripts and text files (.txt). This command CANNOT be used to \",\n \"convert to different file types\",\n \" \",\n \"Note that, unlike the Linux 'mv' command, the destination argument must be the \",\n \"full filepath. \",\n \"Examples: \",\n \" \",\n \" mv hacking-controller.script scripts/hacking-controller.script\",\n \" \",\n \" mv myScript.js myOldScript.js\",\n \" \",\n ],\n nano: TemplatedHelpTexts.scriptEditor(\"nano\"),\n ps: [\"Usage: ps\", \" \", \"Prints all scripts that are running on the current server\", \" \"],\n rm: [\n \"Usage: rm [file]\",\n \" \",\n \"Removes the specified file from the current server. A file can be a script, a program, or a message file. \",\n \" \",\n \"WARNING: This is permanent and cannot be undone\",\n \" \",\n ],\n run: [\n \"Usage: run [file name] [-t] [num threads] [args...]\",\n \" \",\n \"Execute a program, script or coding contract.\",\n \" \",\n \"The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used \",\n \"to indicate that the script should be run with the specified number of threads. If the flag is omitted, \",\n \"then the script will be run with a single thread by default. \",\n \"If the '-t' flag is used, then it MUST come immediately \",\n \"after the script name, and the [num threads] argument MUST come immediately afterwards. \",\n \" \",\n \"[args...] represents a variable number of arguments that will be passed into the script. See the documentation \",\n \"about script arguments. Each specified argument must be separated by a space. \",\n \" \",\n ],\n scan: [\n \"Usage: scan\",\n \" \",\n \"Prints all immediately-available network connection. This will print a list of all servers that you can currently connect \",\n \"to using the 'connect' Terminal command.\",\n \" \",\n ],\n \"scan-analyze\": [\n \"Usage: scan-analyze [depth] [-a]\",\n \" \",\n \"Prints detailed information about all servers up to [depth] nodes away on the network. Calling \",\n \"'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal \",\n \"command. This command also shows the relative paths to reach each server.\",\n \" \",\n \"By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have \",\n \"the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to \",\n \"5 and 10, respectively.\",\n \" \",\n \"The information 'scan-analyze' displays about each server includes whether or not you have root access to it, \",\n \"its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM \",\n \"it has.\",\n \" \",\n \"By default, this command will not display servers that you have purchased. However, you can pass in the \",\n \"-a flag at the end of the command if you would like to enable that.\",\n \" \",\n ],\n scp: [\n \"Usage: scp [filename ...] [target server]\",\n \" \",\n \"Copies the specified file(s) from the current server to the target server. \",\n \"This command only works for script files (.script or .js extension), literature files (.lit extension), \",\n \"and text files (.txt extension). \",\n \"The second argument passed in must be the hostname or IP of the target server. Examples:\",\n \" \",\n \" scp foo.script n00dles\",\n \" \",\n \" scp foo.script bar.script n00dles\",\n \" \",\n ],\n sudov: [\"Usage: sudov\", \" \", \"Prints whether or not you have root access to the current machine\", \" \"],\n\n tail: [\n \"Usage: tail [script name] [args...]\",\n \" \",\n \"Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated \",\n \"by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used \",\n \"to run it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 10 50000\",\n \" \",\n \"Then in order to check its logs with 'tail' the same arguments must be used: \",\n \" \",\n \" tail foo.script 10 50000\",\n \" \",\n ],\n top: [\n \"Usage: top\",\n \" \",\n \"Prints a list of all scripts running on the current server as well as their thread count and how much \",\n \"RAM they are using in total.\",\n \" \",\n ],\n unalias: [\n \"Usage: unalias [alias name]\",\n \" \",\n \"Deletes the specified alias. Note that the double quotation marks are required. \",\n \" \",\n \"As an example, if an alias was declared using:\",\n \" \",\n ' alias r=\"run\"',\n \" \",\n \"Then it could be removed using:\",\n \" \",\n \" unalias r\",\n \" \",\n \"It is not necessary to differentiate between global and non-global aliases when using 'unalias'\",\n \" \",\n ],\n vim: TemplatedHelpTexts.scriptEditor(\"vim\"),\n weaken: [\n \"Usage: weaken\",\n \" \",\n \"Reduces the security level of the current server. Decreasing the time it takes for all operations on this server.\",\n \"Requires root access. See the wiki page for hacking mechanics.\",\n \" \",\n ],\n wget: [\n \"Usage: wget [url] [target file]\",\n \" \",\n \"Retrieves data from a URL and downloads it to a file on the current server. The data can only \",\n \"be downloaded to a script (.script or .js) or a text file (.txt). If the file already exists, \",\n \"it will be overwritten by this command.\",\n \" \",\n \"Note that it will not be possible to download data from many websites because they do not allow \",\n \"cross-origin resource sharing (CORS). Example:\",\n \" \",\n \" wget https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md game_readme.txt\",\n \" \",\n ],\n};\n","import React from \"react\";\n\nimport { Page } from \"../ui/Router\";\nimport { hash } from \"../hash/hash\";\nimport { CONSTANTS } from \"../Constants\";\n\nenum GameEnv {\n Production,\n Development,\n}\n\nenum Platform {\n Browser,\n Steam,\n}\n\ninterface GameVersion {\n version: string;\n hash: string;\n\n toDisplay: () => string;\n}\n\ninterface BrowserFeatures {\n userAgent: string;\n language: string;\n cookiesEnabled: boolean;\n doNotTrack: string | null;\n indexedDb: boolean;\n}\n\ninterface IErrorMetadata {\n error: Error;\n errorInfo?: React.ErrorInfo;\n page?: Page;\n\n environment: GameEnv;\n platform: Platform;\n version: GameVersion;\n features: BrowserFeatures;\n}\n\nexport interface IErrorData {\n metadata: IErrorMetadata;\n\n title: string;\n body: string;\n\n features: string;\n fileName?: string;\n\n issueUrl: string;\n}\n\nexport const newIssueUrl = `https://github.com/danielyxie/bitburner/issues/new`;\n\nfunction getErrorMetadata(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorMetadata {\n const isElectron = navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1;\n const env = process.env.NODE_ENV === \"development\" ? GameEnv.Development : GameEnv.Production;\n const version: GameVersion = {\n version: CONSTANTS.VersionString,\n hash: hash(),\n toDisplay: () => `v${CONSTANTS.VersionString} (${hash()})`,\n };\n const features: BrowserFeatures = {\n userAgent: navigator.userAgent,\n\n language: navigator.language,\n cookiesEnabled: navigator.cookieEnabled,\n doNotTrack: navigator.doNotTrack,\n indexedDb: !!window.indexedDB,\n };\n const metadata: IErrorMetadata = {\n platform: isElectron ? Platform.Steam : Platform.Browser,\n environment: env,\n version,\n features,\n error,\n errorInfo,\n page,\n };\n return metadata;\n}\n\nexport function getErrorForDisplay(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorData {\n const metadata = getErrorMetadata(error, errorInfo, page);\n const fileName = (metadata.error as any).fileName;\n const features =\n `lang=${metadata.features.language} cookiesEnabled=${metadata.features.cookiesEnabled.toString()}` +\n ` doNotTrack=${metadata.features.doNotTrack ?? \"null\"} indexedDb=${metadata.features.indexedDb.toString()}`;\n\n const title = `${metadata.error.name}: ${metadata.error.message}${metadata.page && ` (at \"${Page[metadata.page]}\")`}`;\n const body = `\n## ${title}\n\n### How did this happen?\n\nPlease fill this information with details if relevant.\n\n- [ ] Save file\n- [ ] Minimal scripts to reproduce the issue\n- [ ] Steps to reproduce\n\n### Environment\n\n* Error: ${metadata.error?.toString() ?? \"n/a\"}\n* Page: ${metadata.page ? Page[metadata.page] : \"n/a\"}\n* Version: ${metadata.version.toDisplay()}\n* Environment: ${GameEnv[metadata.environment]}\n* Platform: ${Platform[metadata.platform]}\n* UserAgent: ${navigator.userAgent}\n* Features: ${features}\n* Source: ${fileName ?? \"n/a\"}\n\n${\n metadata.environment === GameEnv.Development\n ? `\n### Stack Trace\n\\`\\`\\`\n${metadata.errorInfo?.componentStack.toString().trim()}\n\\`\\`\\`\n`\n : \"\"\n}\n### Save\n\\`\\`\\`\nCopy your save here if possible\n\\`\\`\\`\n`.trim();\n\n const issueUrl = `${newIssueUrl}?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`;\n\n const data: IErrorData = {\n metadata,\n fileName,\n features,\n title,\n body,\n issueUrl,\n };\n return data;\n}\n","import { getRandomInt } from \"./getRandomInt\";\n\n/**\n * Gets a random value in the range of a byte (0 - 255), or up to the maximum.\n * @param max The maximum value (up to 255).\n */\nexport function getRandomByte(max: number): number {\n // Technically 2^8 is 256, but the values are 0-255, not 1-256.\n const byteMaximum = 255;\n const upper: number = Math.max(Math.min(max, byteMaximum), 0);\n\n return getRandomInt(0, upper);\n}\n","import { getRandomInt } from \"../../utils/helpers/getRandomInt\";\n\nexport const Growths: {\n [key: string]: (() => number) | undefined;\n [\"Tracking\"]: () => number;\n [\"Bounty Hunter\"]: () => number;\n [\"Retirement\"]: () => number;\n [\"Investigation\"]: () => number;\n [\"Undercover Operation\"]: () => number;\n [\"Sting Operation\"]: () => number;\n [\"Raid\"]: () => number;\n [\"Stealth Retirement Operation\"]: () => number;\n [\"Assassination\"]: () => number;\n} = {\n Tracking: () => getRandomInt(5, 75) / 10,\n \"Bounty Hunter\": () => getRandomInt(5, 75) / 10,\n Retirement: () => getRandomInt(5, 75) / 10,\n Investigation: () => getRandomInt(10, 40) / 10,\n \"Undercover Operation\": () => getRandomInt(10, 40) / 10,\n \"Sting Operation\": () => getRandomInt(3, 40) / 10,\n Raid: () => getRandomInt(2, 40) / 10,\n \"Stealth Retirement Operation\": () => getRandomInt(1, 20) / 10,\n Assassination: () => getRandomInt(1, 20) / 10,\n};\n","/**\n * Utility function that creates a \"city map\", which is an object where\n * each city is a key (property).\n *\n * This map uses the official name of the city, NOT its key in the 'Cities' object\n */\nimport { Cities } from \"./Cities\";\nimport { IMap } from \"../types\";\n\nexport function createCityMap(initValue: T): IMap {\n const map: IMap = {};\n const cities = Object.keys(Cities);\n for (let i = 0; i < cities.length; ++i) {\n map[cities[i]] = initValue;\n }\n\n // round try JSON so to make sure none of the initial values have the same references.\n return JSON.parse(JSON.stringify(map));\n}\n","/**\n * Represents a Hand of cards.\n *\n * This class is IMMUTABLE\n */\n\nimport { Card } from \"./Card\";\n\nexport class Hand {\n constructor(readonly cards: readonly Card[]) {}\n\n addCards(...cards: Card[]): Hand {\n return new Hand([...this.cards, ...cards]);\n }\n\n removeByIndex(i: number): Hand {\n if (i >= this.cards.length) {\n throw new Error(`Tried to remove invalid card from Hand by index: ${i}`);\n }\n\n return new Hand([...this.cards.slice().splice(i, 1)]);\n }\n}\n","/**\n * React Component for a button that initiates a transaction on the Stock Market UI\n * (Buy, Sell, Buy Max, etc.)\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\ntype IProps = {\n onClick: () => void;\n text: string;\n tooltip?: JSX.Element | null;\n};\n\nexport function StockTickerTxButton(props: IProps): React.ReactElement {\n return (\n {props.tooltip} : \"\"}>\n \n \n );\n}\n","import { Box, Table } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { DummyGift } from \"../DummyGift\";\nimport { Grid } from \"./Grid\";\nimport { zeros } from \"../Helper\";\n\ninterface IProps {\n width: number;\n height: number;\n fragments: ActiveFragment[];\n}\n\nexport function DummyGrid(props: IProps): React.ReactElement {\n const gift = new DummyGift(props.width, props.height, props.fragments);\n const ghostGrid = zeros(props.width, props.height);\n return (\n \n \n undefined}\n click={() => undefined}\n />\n
\n
\n );\n}\n","/**\n * Abstract Base Class for any Server object\n */\nimport { CodingContract } from \"../CodingContracts\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { Script } from \"../Script/Script\";\nimport { isValidFilePath } from \"../Terminal/DirectoryHelpers\";\nimport { TextFile } from \"../TextFile\";\nimport { IReturnStatus } from \"../types\";\n\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\n\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\n\ninterface IConstructorParams {\n adminRights?: boolean;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n organizationName?: string;\n}\n\ninterface writeResult {\n success: boolean;\n overwritten: boolean;\n}\n\nexport class BaseServer {\n // Coding Contract files on this server\n contracts: CodingContract[] = [];\n\n // How many CPU cores this server has. Maximum of 8.\n // Currently, this only affects hacking missions\n cpuCores = 1;\n\n // Flag indicating whether the FTP port is open\n ftpPortOpen = false;\n\n // Flag indicating whether player has admin/root access to this server\n hasAdminRights = false;\n\n // Hostname. Must be unique\n hostname = \"\";\n\n // Flag indicating whether HTTP Port is open\n httpPortOpen = false;\n\n // IP Address. Must be unique\n ip = \"\";\n\n // Flag indicating whether player is curently connected to this server\n isConnectedTo = false;\n\n // RAM (GB) available on this server\n maxRam = 0;\n\n // Message files AND Literature files on this Server\n messages: string[] = [];\n\n // Name of company/faction/etc. that this server belongs to.\n // Optional, not applicable to all Servers\n organizationName = \"\";\n\n // Programs on this servers. Contains only the names of the programs\n programs: string[] = [];\n\n // RAM (GB) used. i.e. unavailable RAM\n ramUsed = 0;\n\n // RunningScript files on this server\n runningScripts: RunningScript[] = [];\n\n // Script files on this Server\n scripts: Script[] = [];\n\n // Contains the hostnames of all servers that are immediately\n // reachable from this one\n serversOnNetwork: string[] = [];\n\n // Flag indicating whether SMTP Port is open\n smtpPortOpen = false;\n\n // Flag indicating whether SQL Port is open\n sqlPortOpen = false;\n\n // Flag indicating whether the SSH Port is open\n sshPortOpen = false;\n\n // Text files on this server\n textFiles: TextFile[] = [];\n\n // Flag indicating wehther this is a purchased server\n purchasedByPlayer = false;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n this.ip = params.ip ? params.ip : createRandomIp();\n\n this.hostname = params.hostname;\n this.organizationName = params.organizationName != null ? params.organizationName : \"\";\n this.isConnectedTo = params.isConnectedTo != null ? params.isConnectedTo : false;\n\n //Access information\n this.hasAdminRights = params.adminRights != null ? params.adminRights : false;\n }\n\n addContract(contract: CodingContract): void {\n this.contracts.push(contract);\n }\n\n getContract(contractName: string): CodingContract | null {\n for (const contract of this.contracts) {\n if (contract.fn === contractName) {\n return contract;\n }\n }\n return null;\n }\n\n /**\n * Find an actively running script on this server\n * @param scriptName - Filename of script to search for\n * @param scriptArgs - Arguments that script is being run with\n * @returns RunningScript for the specified active script\n * Returns null if no such script can be found\n */\n getRunningScript(scriptName: string, scriptArgs: ScriptArg[]): RunningScript | null {\n for (const rs of this.runningScripts) {\n if (rs.filename === scriptName && compareArrays(rs.args, scriptArgs)) {\n return rs;\n }\n }\n\n return null;\n }\n\n /**\n * Given the name of the script, returns the corresponding\n * Script object on the server (if it exists)\n */\n getScript(scriptName: string): Script | null {\n for (let i = 0; i < this.scripts.length; i++) {\n if (this.scripts[i].filename === scriptName) {\n return this.scripts[i];\n }\n }\n\n return null;\n }\n\n /**\n * Returns boolean indicating whether the given script is running on this server\n */\n isRunning(fn: string): boolean {\n for (const runningScriptObj of this.runningScripts) {\n if (runningScriptObj.filename === fn) {\n return true;\n }\n }\n\n return false;\n }\n\n removeContract(contract: CodingContract | string): void {\n if (contract instanceof CodingContract) {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract.fn;\n });\n } else {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract;\n });\n }\n }\n\n /**\n * Remove a file from the server\n * @param fn {string} Name of file to be deleted\n * @returns {IReturnStatus} Return status object indicating whether or not file was deleted\n */\n removeFile(fn: string): IReturnStatus {\n if (fn.endsWith(\".exe\") || fn.match(/^.+\\.exe-\\d+(?:\\.\\d*)?%-INC$/) != null) {\n for (let i = 0; i < this.programs.length; ++i) {\n if (this.programs[i] === fn) {\n this.programs.splice(i, 1);\n return { res: true };\n }\n }\n } else if (isScriptFilename(fn)) {\n for (let i = 0; i < this.scripts.length; ++i) {\n if (this.scripts[i].filename === fn) {\n if (this.isRunning(fn)) {\n return {\n res: false,\n msg: \"Cannot delete a script that is currently running!\",\n };\n }\n\n this.scripts.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".lit\")) {\n for (let i = 0; i < this.messages.length; ++i) {\n const f = this.messages[i];\n if (typeof f === \"string\" && f === fn) {\n this.messages.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".txt\")) {\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n this.textFiles.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".cct\")) {\n for (let i = 0; i < this.contracts.length; ++i) {\n if (this.contracts[i].fn === fn) {\n this.contracts.splice(i, 1);\n return { res: true };\n }\n }\n }\n\n return { res: false, msg: \"No such file exists\" };\n }\n\n /**\n * Called when a script is run on this server.\n * All this function does is add a RunningScript object to the\n * `runningScripts` array. It does NOT check whether the script actually can\n * be run.\n */\n runScript(script: RunningScript): void {\n this.runningScripts.push(script);\n }\n\n setMaxRam(ram: number): void {\n this.maxRam = ram;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateRamUsed(ram: number, player: IPlayer): void {\n this.ramUsed = ram;\n }\n\n pushProgram(program: string): void {\n if (this.programs.includes(program)) return;\n\n // Remove partially created program if there is one\n const existingPartialExeIndex = this.programs.findIndex((p) => p.startsWith(program));\n // findIndex returns -1 if there is no match, we only want to splice on a match\n if (existingPartialExeIndex > -1) {\n this.programs.splice(existingPartialExeIndex, 1);\n }\n\n this.programs.push(program);\n }\n\n /**\n * Write to a script file\n * Overwrites existing files. Creates new files if the script does not eixst\n */\n writeToScriptFile(player: IPlayer, fn: string, code: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !isScriptFilename(fn)) {\n return ret;\n }\n\n // Check if the script already exists, and overwrite it if it does\n for (let i = 0; i < this.scripts.length; ++i) {\n if (fn === this.scripts[i].filename) {\n const script = this.scripts[i];\n script.code = code;\n script.updateRamUsage(player, this.scripts);\n script.markUpdated();\n ret.overwritten = true;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise, create a new script\n const newScript = new Script(player, fn, code, this.hostname, this.scripts);\n this.scripts.push(newScript);\n ret.success = true;\n return ret;\n }\n\n // Write to a text file\n // Overwrites existing files. Creates new files if the text file does not exist\n writeToTextFile(fn: string, txt: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !fn.endsWith(\"txt\")) {\n return ret;\n }\n\n // Check if the text file already exists, and overwrite if it does\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n ret.overwritten = true;\n this.textFiles[i].text = txt;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise create a new text file\n const newFile = new TextFile(fn, txt);\n this.textFiles.push(newFile);\n ret.success = true;\n return ret;\n }\n}\n","import React, { useState, useEffect } from \"react\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nimport { CodingContract, CodingContractTypes } from \"../../CodingContracts\";\nimport { CopyableText } from \"./CopyableText\";\nimport { Modal } from \"./Modal\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n c: CodingContract;\n onClose: () => void;\n onAttempt: (answer: string) => void;\n}\n\nexport const CodingContractEvent = new EventEmitter<[IProps]>();\n\nexport function CodingContractModal(): React.ReactElement {\n const [props, setProps] = useState(null);\n const [answer, setAnswer] = useState(\"\");\n\n useEffect(() => {\n CodingContractEvent.subscribe((props) => setProps(props));\n });\n if (props === null) return <>;\n\n function onChange(event: React.ChangeEvent): void {\n setAnswer(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (props === null) return;\n // React just won't cooperate on this one.\n // \"React.KeyboardEvent\" seems like the right type but\n // whatever ...\n const value = (event.target as any).value;\n\n if (event.key === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }\n }\n\n function close(): void {\n if (props === null) return;\n props.onClose();\n setProps(null);\n }\n\n const contractType = CodingContractTypes[props.c.type];\n const description = [];\n for (const [i, value] of contractType.desc(props.c.data).split(\"\\n\").entries())\n description.push(\" }}>);\n return (\n \n \n \n You are attempting to solve a Coding Contract. You have {props.c.getMaxNumTries() - props.c.tries} tries\n remaining, after which the contract will self-destruct.\n \n
\n {description}\n
\n {\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }}\n >\n Solve\n \n ),\n }}\n />\n
\n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const BitFlumeEvent = new EventEmitter<[]>();\n\nexport function BitFlumeModal(): React.ReactElement {\n const router = use.Router();\n const [open, setOpen] = useState(false);\n function flume(): void {\n router.toBitVerse(true, false);\n setOpen(false);\n }\n\n useEffect(() => BitFlumeEvent.subscribe(() => setOpen(true)), []);\n\n return (\n setOpen(false)}>\n \n WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.\n
\n
\n Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one.\n
\n
\n
\n \n
\n );\n}\n","import * as augmentationMethods from \"./PlayerObjectAugmentationMethods\";\nimport * as bladeburnerMethods from \"./PlayerObjectBladeburnerMethods\";\nimport * as corporationMethods from \"./PlayerObjectCorporationMethods\";\nimport * as gangMethods from \"./PlayerObjectGangMethods\";\nimport * as generalMethods from \"./PlayerObjectGeneralMethods\";\nimport * as serverMethods from \"./PlayerObjectServerMethods\";\nimport * as workMethods from \"./PlayerObjectWorkMethods\";\n\nimport { IMap } from \"../../types\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { IPlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Company } from \"../../Company/Company\";\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { ICodingContractReward } from \"../../CodingContracts\";\n\nimport { IPlayer } from \"../IPlayer\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { IPlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { ICorporation } from \"../../Corporation/ICorporation\";\nimport { IGang } from \"../../Gang/IGang\";\nimport { IBladeburner } from \"../../Bladeburner/IBladeburner\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\n\nimport { HashManager } from \"../../Hacknet/HashManager\";\nimport { CityName } from \"../../Locations/data/CityNames\";\n\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../../utils/JSONReviver\";\nimport { ISkillProgress } from \"../formulas/skill\";\nimport { PlayerAchievement } from \"../../Achievements/Achievements\";\nimport { cyrb53 } from \"../../utils/StringHelperFunctions\";\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\nimport { ITaskTracker } from \"../ITaskTracker\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Work } from \"src/Work/Work\";\nimport { defaultMultipliers, Multipliers } from \"../Multipliers\";\nimport { HP } from \"../HP\";\nimport { Skills } from \"../Skills\";\n\nexport class PlayerObject implements IPlayer {\n // Class members\n augmentations: IPlayerOwnedAugmentation[];\n bitNodeN: number;\n city: CityName;\n corporation: ICorporation | null;\n gang: IGang | null;\n bladeburner: IBladeburner | null;\n currentServer: string;\n factions: string[];\n factionInvitations: string[];\n hacknetNodes: (HacknetNode | string)[]; // HacknetNode object or IP of Hacknet Server\n has4SData: boolean;\n has4SDataTixApi: boolean;\n hashManager: HashManager;\n hasTixApiAccess: boolean;\n hasWseAccount: boolean;\n jobs: IMap;\n init: () => void;\n karma: number;\n numPeopleKilled: number;\n location: LocationName;\n money: number;\n moneySourceA: MoneySourceTracker;\n moneySourceB: MoneySourceTracker;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n purchasedServers: string[];\n queuedAugmentations: IPlayerOwnedAugmentation[];\n scriptProdSinceLastAug: number;\n sleeves: Sleeve[];\n sleevesFromCovenant: number;\n sourceFiles: IPlayerOwnedSourceFile[];\n exploits: Exploit[];\n achievements: PlayerAchievement[];\n terminalCommandHistory: string[];\n identifier: string;\n lastUpdate: number;\n lastSave: number;\n totalPlaytime: number;\n\n hp: HP;\n skills: Skills;\n exp: Skills;\n\n mults: Multipliers;\n\n currentWork: Work | null;\n focus: boolean;\n\n entropy: number;\n\n // Methods\n startWork: (w: Work) => void;\n processWork: (cycles: number) => void;\n finishWork: (cancelled: boolean) => void;\n applyForAgentJob: (sing?: boolean) => boolean;\n applyForBusinessConsultantJob: (sing?: boolean) => boolean;\n applyForBusinessJob: (sing?: boolean) => boolean;\n applyForEmployeeJob: (sing?: boolean) => boolean;\n applyForItJob: (sing?: boolean) => boolean;\n applyForJob: (entryPosType: CompanyPosition, sing?: boolean) => boolean;\n applyForNetworkEngineerJob: (sing?: boolean) => boolean;\n applyForPartTimeEmployeeJob: (sing?: boolean) => boolean;\n applyForPartTimeWaiterJob: (sing?: boolean) => boolean;\n applyForSecurityEngineerJob: (sing?: boolean) => boolean;\n applyForSecurityJob: (sing?: boolean) => boolean;\n applyForSoftwareConsultantJob: (sing?: boolean) => boolean;\n applyForSoftwareJob: (sing?: boolean) => boolean;\n applyForWaiterJob: (sing?: boolean) => boolean;\n canAccessBladeburner: () => boolean;\n canAccessCorporation: () => boolean;\n canAccessGang: () => boolean;\n canAccessGrafting: () => boolean;\n canAfford: (cost: number) => boolean;\n gainHackingExp: (exp: number) => void;\n gainStrengthExp: (exp: number) => void;\n gainDefenseExp: (exp: number) => void;\n gainDexterityExp: (exp: number) => void;\n gainAgilityExp: (exp: number) => void;\n gainCharismaExp: (exp: number) => void;\n gainIntelligenceExp: (exp: number) => void;\n gainStats: (retValue: ITaskTracker) => void;\n gainMoney: (money: number, source: string) => void;\n getCurrentServer: () => BaseServer;\n getGangFaction: () => Faction;\n getGangName: () => string;\n getHomeComputer: () => Server;\n getNextCompanyPosition: (company: Company, entryPosType: CompanyPosition) => CompanyPosition | null;\n getUpgradeHomeRamCost: () => number;\n getUpgradeHomeCoresCost: () => number;\n gotoLocation: (to: LocationName) => boolean;\n hasAugmentation: (aug: string | Augmentation, installed?: boolean) => boolean;\n hasCorporation: () => boolean;\n hasGangWith: (facName: string) => boolean;\n hasTorRouter: () => boolean;\n hasProgram: (program: string) => boolean;\n inBladeburner: () => boolean;\n inGang: () => boolean;\n isAwareOfGang: () => boolean;\n isQualified: (company: Company, position: CompanyPosition) => boolean;\n loseMoney: (money: number, source: string) => void;\n reapplyAllAugmentations: (resetMultipliers?: boolean) => void;\n reapplyAllSourceFiles: () => void;\n regenerateHp: (amt: number) => void;\n recordMoneySource: (amt: number, source: string) => void;\n setMoney: (amt: number) => void;\n startBladeburner: () => void;\n startCorporation: (corpName: string, additionalShares?: number) => void;\n startFocusing: () => void;\n startGang: (facName: string, isHacking: boolean) => void;\n takeDamage: (amt: number) => boolean;\n travel: (to: CityName) => boolean;\n giveExploit: (exploit: Exploit) => void;\n giveAchievement: (achievementId: string) => void;\n queryStatFromString: (str: string) => number;\n getIntelligenceBonus: (weight: number) => number;\n getCasinoWinnings: () => number;\n quitJob: (company: string, sing?: boolean) => void;\n hasJob: () => boolean;\n createHacknetServer: () => HacknetServer;\n queueAugmentation: (augmentationName: string) => void;\n receiveInvite: (factionName: string) => void;\n updateSkillLevels: () => void;\n gainCodingContractReward: (reward: ICodingContractReward, difficulty?: number) => string;\n stopFocusing: () => void;\n resetMultipliers: () => void;\n prestigeAugmentation: () => void;\n prestigeSourceFile: () => void;\n calculateSkill: (exp: number, mult?: number) => number;\n calculateSkillProgress: (exp: number, mult?: number) => ISkillProgress;\n hospitalize: () => void;\n checkForFactionInvitations: () => Faction[];\n setBitNodeNumber: (n: number) => void;\n canAccessCotMG: () => boolean;\n sourceFileLvl: (n: number) => number;\n applyEntropy: (stacks?: number) => void;\n focusPenalty: () => number;\n\n constructor() {\n this.hp = { current: 10, max: 10 };\n this.skills = {\n hacking: 1,\n strength: 1,\n defense: 1,\n dexterity: 1,\n agility: 1,\n charisma: 1,\n intelligence: 0,\n };\n this.exp = {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n };\n\n this.mults = defaultMultipliers();\n\n //Money\n this.money = 1000 + CONSTANTS.Donations;\n\n //Location information\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n // Jobs that the player holds\n // Map of company name (key) -> name of company position (value. Just the name, not the CompanyPosition object)\n // The CompanyPosition name must match a key value in CompanyPositions\n this.jobs = {};\n\n // Servers\n this.currentServer = \"\"; //hostname of Server currently being accessed through termina;\n this.purchasedServers = []; //hostnames of purchased server;\n\n // Hacknet Nodes/Servers\n this.hacknetNodes = []; // Note= For Hacknet Servers, this array holds the hostnames of the server;\n this.hashManager = new HashManager();\n\n //Factions\n this.factions = []; //Names of all factions player has joine;\n this.factionInvitations = []; //Outstanding faction invitation;\n\n //Augmentations\n this.queuedAugmentations = [];\n this.augmentations = [];\n\n this.sourceFiles = [];\n\n //Crime statistics\n this.numPeopleKilled = 0;\n this.karma = 0;\n\n //Stock Market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n //Gang\n this.gang = null;\n\n //Corporation\n this.corporation = null;\n\n //Bladeburner\n this.bladeburner = null;\n\n // Sleeves & Re-sleeving\n this.sleeves = [];\n this.sleevesFromCovenant = 0; // # of Duplicate sleeves purchased from the covenant\n //bitnode\n this.bitNodeN = 1;\n\n this.entropy = 0;\n\n //Used to store the last update time.\n this.lastUpdate = 0;\n this.lastSave = 0;\n this.totalPlaytime = 0;\n\n this.playtimeSinceLastAug = 0;\n this.playtimeSinceLastBitnode = 0;\n\n // Keep track of where money comes from\n this.moneySourceA = new MoneySourceTracker(); // Where money comes from since last-installed Augmentation\n this.moneySourceB = new MoneySourceTracker(); // Where money comes from for this entire BitNode run\n // Production since last Augmentation installation\n this.scriptProdSinceLastAug = 0;\n\n this.exploits = [];\n this.achievements = [];\n this.terminalCommandHistory = [];\n\n this.focus = false;\n this.currentWork = null;\n\n // Let's get a hash of some semi-random stuff so we have something unique.\n this.identifier = cyrb53(\n \"I-\" +\n new Date().getTime() +\n navigator.userAgent +\n window.innerWidth +\n window.innerHeight +\n getRandomInt(100, 999),\n );\n\n this.init = generalMethods.init;\n this.prestigeAugmentation = generalMethods.prestigeAugmentation;\n this.prestigeSourceFile = generalMethods.prestigeSourceFile;\n this.receiveInvite = generalMethods.receiveInvite;\n this.calculateSkill = generalMethods.calculateSkill;\n this.calculateSkillProgress = generalMethods.calculateSkillProgress;\n this.updateSkillLevels = generalMethods.updateSkillLevels;\n this.resetMultipliers = generalMethods.resetMultipliers;\n this.hasProgram = generalMethods.hasProgram;\n this.setMoney = generalMethods.setMoney;\n this.gainMoney = generalMethods.gainMoney;\n this.loseMoney = generalMethods.loseMoney;\n this.canAfford = generalMethods.canAfford;\n this.recordMoneySource = generalMethods.recordMoneySource;\n this.gainHackingExp = generalMethods.gainHackingExp;\n this.gainStrengthExp = generalMethods.gainStrengthExp;\n this.gainDefenseExp = generalMethods.gainDefenseExp;\n this.gainDexterityExp = generalMethods.gainDexterityExp;\n this.gainAgilityExp = generalMethods.gainAgilityExp;\n this.gainCharismaExp = generalMethods.gainCharismaExp;\n this.gainIntelligenceExp = generalMethods.gainIntelligenceExp;\n this.gainStats = generalMethods.gainStats;\n this.queryStatFromString = generalMethods.queryStatFromString;\n this.startWork = workMethods.start;\n this.processWork = workMethods.process;\n this.finishWork = workMethods.finish;\n this.startFocusing = generalMethods.startFocusing;\n this.stopFocusing = generalMethods.stopFocusing;\n this.takeDamage = generalMethods.takeDamage;\n this.regenerateHp = generalMethods.regenerateHp;\n this.hospitalize = generalMethods.hospitalize;\n this.applyForJob = generalMethods.applyForJob;\n this.getNextCompanyPosition = generalMethods.getNextCompanyPosition;\n this.quitJob = generalMethods.quitJob;\n this.hasJob = generalMethods.hasJob;\n this.applyForSoftwareJob = generalMethods.applyForSoftwareJob;\n this.applyForSoftwareConsultantJob = generalMethods.applyForSoftwareConsultantJob;\n this.applyForItJob = generalMethods.applyForItJob;\n this.applyForSecurityEngineerJob = generalMethods.applyForSecurityEngineerJob;\n this.applyForNetworkEngineerJob = generalMethods.applyForNetworkEngineerJob;\n this.applyForBusinessJob = generalMethods.applyForBusinessJob;\n this.applyForBusinessConsultantJob = generalMethods.applyForBusinessConsultantJob;\n this.applyForSecurityJob = generalMethods.applyForSecurityJob;\n this.applyForAgentJob = generalMethods.applyForAgentJob;\n this.applyForEmployeeJob = generalMethods.applyForEmployeeJob;\n this.applyForPartTimeEmployeeJob = generalMethods.applyForPartTimeEmployeeJob;\n this.applyForWaiterJob = generalMethods.applyForWaiterJob;\n this.applyForPartTimeWaiterJob = generalMethods.applyForPartTimeWaiterJob;\n this.isQualified = generalMethods.isQualified;\n this.reapplyAllAugmentations = generalMethods.reapplyAllAugmentations;\n this.reapplyAllSourceFiles = generalMethods.reapplyAllSourceFiles;\n this.checkForFactionInvitations = generalMethods.checkForFactionInvitations;\n this.setBitNodeNumber = generalMethods.setBitNodeNumber;\n this.queueAugmentation = generalMethods.queueAugmentation;\n this.gainCodingContractReward = generalMethods.gainCodingContractReward;\n this.travel = generalMethods.travel;\n this.gotoLocation = generalMethods.gotoLocation;\n this.canAccessGrafting = generalMethods.canAccessGrafting;\n this.giveExploit = generalMethods.giveExploit;\n this.giveAchievement = generalMethods.giveAchievement;\n this.getIntelligenceBonus = generalMethods.getIntelligenceBonus;\n this.getCasinoWinnings = generalMethods.getCasinoWinnings;\n this.hasAugmentation = augmentationMethods.hasAugmentation;\n this.canAccessBladeburner = bladeburnerMethods.canAccessBladeburner;\n this.inBladeburner = bladeburnerMethods.inBladeburner;\n this.startBladeburner = bladeburnerMethods.startBladeburner;\n this.canAccessCorporation = corporationMethods.canAccessCorporation;\n this.hasCorporation = corporationMethods.hasCorporation;\n this.startCorporation = corporationMethods.startCorporation;\n this.canAccessGang = gangMethods.canAccessGang;\n this.isAwareOfGang = gangMethods.isAwareOfGang;\n this.getGangFaction = gangMethods.getGangFaction;\n this.getGangName = gangMethods.getGangName;\n this.hasGangWith = gangMethods.hasGangWith;\n this.inGang = gangMethods.inGang;\n this.startGang = gangMethods.startGang;\n\n this.hasTorRouter = serverMethods.hasTorRouter;\n this.getCurrentServer = serverMethods.getCurrentServer;\n this.getHomeComputer = serverMethods.getHomeComputer;\n this.getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost;\n this.getUpgradeHomeCoresCost = serverMethods.getUpgradeHomeCoresCost;\n this.createHacknetServer = serverMethods.createHacknetServer;\n\n this.canAccessCotMG = generalMethods.canAccessCotMG;\n this.sourceFileLvl = generalMethods.sourceFileLvl;\n\n this.applyEntropy = augmentationMethods.applyEntropy;\n this.focusPenalty = generalMethods.focusPenalty;\n }\n\n whoAmI(): string {\n return \"Player\";\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"PlayerObject\", this);\n }\n\n /**\n * Initiatizes a PlayerObject object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): PlayerObject {\n return Generic_fromJSON(PlayerObject, value.data);\n }\n}\n\nReviver.constructors.PlayerObject = PlayerObject;\n","import React, { useState, useEffect } from \"react\";\nimport { joinFaction } from \"../FactionHelpers\";\nimport { Faction } from \"../Faction\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const InvitationEvent = new EventEmitter<[Faction]>();\n\nexport function InvitationModal(): React.ReactElement {\n const [faction, setFaction] = useState(null);\n const player = use.Player();\n function join(): void {\n if (faction === null) return;\n //Remove from invited factions\n const i = player.factionInvitations.findIndex((facName) => facName === faction.name);\n if (i === -1) {\n console.error(\"Could not find faction in Player.factionInvitations\");\n }\n joinFaction(faction);\n setFaction(null);\n }\n\n useEffect(() => InvitationEvent.subscribe((faction) => setFaction(faction)), []);\n\n return (\n setFaction(null)}>\n You have received a faction invitation.\n \n Would you like to join {(faction || { name: \"\" }).name}?
\n
\n Warning: Joining this faction may prevent you from joining other factions during this run!\n
\n \n \n
\n );\n}\n","import * as acorn from \"acorn\";\n/**\n * @license\n * JavaScript Interpreter\n *\n * Copyright 2013 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Interpreting JavaScript in JavaScript.\n * @author fraser@google.com (Neil Fraser)\n */\n(\"use strict\");\n\n/**\n * Create a new interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n * @param {Function=} opt_initFunc Optional initialization function. Used to\n * define APIs. When called it is passed the interpreter object and the\n * global scope object.\n * @param {Number} Bitburner-specific number used for determining exception line numbers\n * @constructor\n */\nvar Interpreter = function (code, opt_initFunc, lineOffset = 0) {\n this.sourceCode = code;\n this.sourceCodeLineOffset = lineOffset;\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n this.ast = code;\n this.initFunc_ = opt_initFunc;\n this.paused_ = false;\n this.polyfills_ = [];\n // Unique identifier for native functions. Used in serialization.\n this.functionCounter_ = 0;\n // Map node types to our step function names; a property lookup is faster\n // than string concatenation with \"step\" prefix.\n this.stepFunctions_ = Object.create(null);\n var stepMatch = /^step([A-Z]\\w*)$/;\n var m;\n for (var methodName in this) {\n if (typeof this[methodName] === \"function\" && (m = methodName.match(stepMatch))) {\n this.stepFunctions_[m[1]] = this[methodName].bind(this);\n }\n }\n // Create and initialize the global scope.\n this.global = this.createScope(this.ast, null);\n // Run the polyfills.\n this.ast = acorn.parse(this.polyfills_.join(\"\\n\"), Interpreter.PARSE_OPTIONS);\n this.polyfills_ = undefined; // Allow polyfill strings to garbage collect.\n this.stripLocations_(this.ast, undefined, undefined);\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack = [state];\n this.run();\n this.value = undefined;\n // Point at the main program.\n this.ast = code;\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack.length = 0;\n this.stateStack[0] = state;\n // Get a handle on Acorn's node_t object. It's tricky to access.\n this.nodeConstructor = state.node.constructor;\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"stateStack\"] = this.stateStack;\n};\n\n/**\n * @const {!Object} Configuration used for all Acorn parsing.\n */\nInterpreter.PARSE_OPTIONS = {\n ecmaVersion: 5,\n locations: true,\n};\n\n/**\n * Property descriptor of readonly properties.\n */\nInterpreter.READONLY_DESCRIPTOR = {\n configurable: true,\n enumerable: true,\n writable: false,\n};\n\n/**\n * Property descriptor of non-enumerable properties.\n */\nInterpreter.NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: true,\n};\n\n/**\n * Property descriptor of readonly, non-enumerable properties.\n */\nInterpreter.READONLY_NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: false,\n};\n\n/**\n * Property descriptor of variables.\n */\nInterpreter.VARIABLE_DESCRIPTOR = {\n configurable: false,\n enumerable: true,\n writable: true,\n};\n\n/**\n * Unique symbol for indicating that a step has encountered an error, has\n * added it to the stack, and will be thrown within the user's program.\n * When STEP_ERROR is thrown in the JS-Interpreter, the error can be ignored.\n */\nInterpreter.STEP_ERROR = {};\n\n/**\n * Unique symbol for indicating that a reference is a variable on the scope,\n * not an object property.\n */\nInterpreter.SCOPE_REFERENCE = {};\n\n/**\n * Unique symbol for indicating, when used as the value of the value\n * parameter in calls to setProperty and friends, that the value\n * should be taken from the property descriptor instead.\n */\nInterpreter.VALUE_IN_DESCRIPTOR = {};\n\n/**\n * For cycle detection in array to string and error conversion;\n * see spec bug github.com/tc39/ecma262/issues/289\n * Since this is for atomic actions only, it can be a class property.\n */\nInterpreter.toStringCycles_ = [];\n\n/**\n * Determine error/exception line number in Bitburner source code\n * @param {Object} AST Node that causes Error/Exception\n */\nInterpreter.prototype.getErrorLineNumber = function (node) {\n var code = this.sourceCode;\n if (node == null || node.start == null) {\n return NaN;\n }\n try {\n code = code.substring(0, node.start);\n return (code.match(/\\n/g) || []).length + 1 - this.sourceCodeLineOffset;\n } catch (e) {\n return NaN;\n }\n};\n\n/**\n * Generate the appropriate line number error message for Bitburner\n * @param {Number} lineNumber\n */\nInterpreter.prototype.getErrorLineNumberMessage = function (lineNumber) {\n if (isNaN(lineNumber)) {\n return \" (Unknown line number)\";\n } else if (lineNumber <= 0) {\n return \" (Error occurred in an imported function)\";\n } else {\n return (\n \" (Line Number \" +\n lineNumber +\n \". This line number is probably incorrect \" +\n \"if your script is importing any functions. This is being worked on)\"\n );\n }\n};\n\n/**\n * Add more code to the interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n */\nInterpreter.prototype.appendCode = function (code) {\n var state = this.stateStack[0];\n if (!state || state.node[\"type\"] !== \"Program\") {\n throw Error(\"Expecting original AST to start with a Program node.\");\n }\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n if (!code || code[\"type\"] !== \"Program\") {\n throw Error(\"Expecting new AST to start with a Program node.\");\n }\n this.populateScope_(code, state.scope);\n // Append the new program to the old one.\n for (var i = 0, node; (node = code[\"body\"][i]); i++) {\n state.node[\"body\"].push(node);\n }\n state.done = false;\n};\n\n/**\n * Execute one step of the interpreter.\n * @return {boolean} True if a step was executed, false if no more instructions.\n */\nInterpreter.prototype.step = function () {\n var stack = this.stateStack;\n var state = stack[stack.length - 1];\n if (!state) {\n return false;\n }\n var node = state.node,\n type = node[\"type\"];\n if (type === \"Program\" && state.done) {\n return false;\n } else if (this.paused_) {\n return true;\n }\n try {\n var nextState = this.stepFunctions_[type](stack, state, node);\n } catch (e) {\n // Eat any step errors. They have been thrown on the stack.\n if (e !== Interpreter.STEP_ERROR) {\n // Uh oh. This is a real error in the JS-Interpreter. Rethrow.\n throw e;\n }\n }\n if (nextState) {\n stack.push(nextState);\n }\n if (!node[\"end\"]) {\n // This is polyfill code. Keep executing until we arrive at user code.\n return this.step();\n }\n return true;\n};\n\n/**\n * Execute the interpreter to program completion. Vulnerable to infinite loops.\n * @return {boolean} True if a execution is asynchronously blocked,\n * false if no more instructions.\n */\nInterpreter.prototype.run = function () {\n while (!this.paused_ && this.step()) {}\n return this.paused_;\n};\n\n/**\n * Initialize the global scope with buitin properties and functions.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initGlobalScope = function (scope) {\n // Initialize uneditable global properties.\n this.setProperty(scope, \"NaN\", NaN, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"Infinity\", Infinity, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"undefined\", undefined, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"window\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"this\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"self\", scope); // Editable.\n\n // Create the objects which will become Object.prototype and\n // Function.prototype, which are needed to bootstrap everything else.\n this.OBJECT_PROTO = new Interpreter.Object(null);\n this.FUNCTION_PROTO = new Interpreter.Object(this.OBJECT_PROTO);\n // Initialize global objects.\n this.initFunction(scope);\n this.initObject(scope);\n // Unable to set scope's parent prior (OBJECT did not exist).\n // Note that in a browser this would be 'Window', whereas in Node.js it would\n // be 'Object'. This interpreter is closer to Node in that it has no DOM.\n scope.proto = this.OBJECT_PROTO;\n this.setProperty(scope, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.initArray(scope);\n this.initString(scope);\n this.initBoolean(scope);\n this.initNumber(scope);\n this.initDate(scope);\n this.initRegExp(scope);\n this.initError(scope);\n this.initMath(scope);\n this.initJSON(scope);\n\n // Initialize global functions.\n var thisInterpreter = this;\n var func = this.createNativeFunction(function (x) {\n throw EvalError(\"Can't happen\");\n }, false);\n func.eval = true;\n this.setProperty(scope, \"eval\", func);\n\n this.setProperty(scope, \"parseInt\", this.createNativeFunction(parseInt, false));\n this.setProperty(scope, \"parseFloat\", this.createNativeFunction(parseFloat, false));\n\n this.setProperty(scope, \"isNaN\", this.createNativeFunction(isNaN, false));\n\n this.setProperty(scope, \"isFinite\", this.createNativeFunction(isFinite, false));\n\n var strFunctions = [\n [escape, \"escape\"],\n [unescape, \"unescape\"],\n [decodeURI, \"decodeURI\"],\n [decodeURIComponent, \"decodeURIComponent\"],\n [encodeURI, \"encodeURI\"],\n [encodeURIComponent, \"encodeURIComponent\"],\n ];\n for (var i = 0; i < strFunctions.length; i++) {\n var wrapper = (function (nativeFunc) {\n return function (str) {\n try {\n return nativeFunc(str);\n } catch (e) {\n // decodeURI('%xy') will throw an error. Catch and rethrow.\n thisInterpreter.throwException(thisInterpreter.URI_ERROR, e.message);\n }\n };\n })(strFunctions[i][0]);\n this.setProperty(\n scope,\n strFunctions[i][1],\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"OBJECT\"] = this.OBJECT;\n this[\"OBJECT_PROTO\"] = this.OBJECT_PROTO;\n this[\"FUNCTION\"] = this.FUNCTION;\n this[\"FUNCTION_PROTO\"] = this.FUNCTION_PROTO;\n this[\"ARRAY\"] = this.ARRAY;\n this[\"ARRAY_PROTO\"] = this.ARRAY_PROTO;\n this[\"REGEXP\"] = this.REGEXP;\n this[\"REGEXP_PROTO\"] = this.REGEXP_PROTO;\n this[\"DATE\"] = this.DATE;\n this[\"DATE_PROTO\"] = this.DATE_PROTO;\n // The following properties are obsolete. Do not use.\n this[\"UNDEFINED\"] = undefined;\n this[\"NULL\"] = null;\n this[\"NAN\"] = NaN;\n this[\"TRUE\"] = true;\n this[\"FALSE\"] = false;\n this[\"STRING_EMPTY\"] = \"\";\n this[\"NUMBER_ZERO\"] = 0;\n this[\"NUMBER_ONE\"] = 1;\n\n // Run any user-provided initialization.\n if (this.initFunc_) {\n this.initFunc_(this, scope);\n }\n};\n\n/**\n * Initialize the Function class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initFunction = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n var identifierRegexp = /^[A-Za-z_$][\\w$]*$/;\n // Function constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Function().\n var newFunc = this;\n } else {\n // Called as Function().\n var newFunc = thisInterpreter.createObjectProto(thisInterpreter.FUNCTION_PROTO);\n }\n if (arguments.length) {\n var code = String(arguments[arguments.length - 1]);\n } else {\n var code = \"\";\n }\n var argsStr = Array.prototype.slice.call(arguments, 0, -1).join(\",\").trim();\n if (argsStr) {\n var args = argsStr.split(/\\s*,\\s*/);\n for (var i = 0; i < args.length; i++) {\n var name = args[i];\n if (!identifierRegexp.test(name)) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid function argument: \" + name);\n }\n }\n argsStr = args.join(\", \");\n }\n // Interestingly, the scope for constructed functions is the global scope,\n // even if they were constructed in some other scope.\n newFunc.parentScope = thisInterpreter.global;\n // Acorn needs to parse code in the context of a function or else 'return'\n // statements will be syntax errors.\n try {\n var ast = acorn.parse(\"(function(\" + argsStr + \") {\" + code + \"})\", Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code: \" + e.message);\n }\n if (ast[\"body\"].length !== 1) {\n // Function('a', 'return a + 6;}; {alert(1);');\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code in function body.\");\n }\n newFunc.node = ast[\"body\"][0][\"expression\"];\n thisInterpreter.setProperty(newFunc, \"length\", newFunc.node[\"length\"], Interpreter.READONLY_DESCRIPTOR);\n return newFunc;\n };\n wrapper.id = this.functionCounter_++;\n this.FUNCTION = this.createObjectProto(this.FUNCTION_PROTO);\n\n this.setProperty(scope, \"Function\", this.FUNCTION);\n // Manually setup type and prototype because createObj doesn't recognize\n // this object as a function (this.FUNCTION did not exist).\n this.setProperty(this.FUNCTION, \"prototype\", this.FUNCTION_PROTO);\n this.FUNCTION.nativeFunc = wrapper;\n\n // Configure Function.prototype.\n this.setProperty(this.FUNCTION_PROTO, \"constructor\", this.FUNCTION, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.FUNCTION_PROTO.nativeFunc = function () {};\n this.FUNCTION_PROTO.nativeFunc.id = this.functionCounter_++;\n this.setProperty(this.FUNCTION_PROTO, \"length\", 0, Interpreter.READONLY_DESCRIPTOR);\n\n var boxThis = function (value) {\n // In non-strict mode 'this' must be an object.\n if ((!value || !value.isObject) && !thisInterpreter.getScope().strict) {\n if (value === undefined || value === null) {\n // 'Undefined' and 'null' are changed to global object.\n value = thisInterpreter.global;\n } else {\n // Primitives must be boxed in non-strict mode.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n value = box;\n }\n }\n return value;\n };\n\n wrapper = function (thisArg, args) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to apply a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n if (args !== null && args !== undefined) {\n if (args.isObject) {\n state.arguments_ = thisInterpreter.arrayPseudoToNative(args);\n } else {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"CreateListFromArrayLike called on non-object\");\n }\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"apply\", wrapper);\n\n wrapper = function (thisArg /*, var_args */) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to call a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n for (var i = 1; i < arguments.length; i++) {\n state.arguments_.push(arguments[i]);\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"call\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind\n \"Object.defineProperty(Function.prototype, 'bind',\",\n \"{configurable: true, writable: true, value:\",\n \"function(oThis) {\",\n \"if (typeof this !== 'function') {\",\n \"throw TypeError('What is trying to be bound is not callable');\",\n \"}\",\n \"var aArgs = Array.prototype.slice.call(arguments, 1),\",\n \"fToBind = this,\",\n \"fNOP = function() {},\",\n \"fBound = function() {\",\n \"return fToBind.apply(this instanceof fNOP\",\n \"? this\",\n \": oThis,\",\n \"aArgs.concat(Array.prototype.slice.call(arguments)));\",\n \"};\",\n \"if (this.prototype) {\",\n \"fNOP.prototype = this.prototype;\",\n \"}\",\n \"fBound.prototype = new fNOP();\",\n \"return fBound;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n // Function has no parent to inherit from, so it needs its own mandatory\n // toString and valueOf functions.\n wrapper = function () {\n return this.toString();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"toString\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"toString\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n wrapper = function () {\n return this.valueOf();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"valueOf\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"valueOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Initialize the Object class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initObject = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Object constructor.\n wrapper = function (value) {\n if (value === undefined || value === null) {\n // Create a new object.\n if (thisInterpreter.calledWithNew()) {\n // Called as new Object().\n return this;\n } else {\n // Called as Object().\n return thisInterpreter.createObjectProto(thisInterpreter.OBJECT_PROTO);\n }\n }\n if (!value.isObject) {\n // Wrap the value as an object.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n return box;\n }\n // Return the provided object.\n return value;\n };\n this.OBJECT = this.createNativeFunction(wrapper, true);\n // Throw away the created prototype and use the root prototype.\n this.setProperty(this.OBJECT, \"prototype\", this.OBJECT_PROTO);\n this.setProperty(this.OBJECT_PROTO, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(scope, \"Object\", this.OBJECT);\n\n /**\n * Checks if the provided value is null or undefined.\n * If so, then throw an error in the call stack.\n * @param {Interpreter.Value} value Value to check.\n */\n var throwIfNullUndefined = function (value) {\n if (value === undefined || value === null) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Cannot convert '\" + value + \"' to object\");\n }\n };\n\n // Static methods on Object.\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n var props = obj.isObject ? obj.properties : obj;\n return thisInterpreter.arrayNativeToPseudo(Object.getOwnPropertyNames(props));\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyNames\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n if (obj.isObject) {\n obj = obj.properties;\n }\n return thisInterpreter.arrayNativeToPseudo(Object.keys(obj));\n };\n this.setProperty(\n this.OBJECT,\n \"keys\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (proto) {\n // Support for the second argument is the responsibility of a polyfill.\n if (proto === null) {\n return thisInterpreter.createObjectProto(null);\n }\n if (proto === undefined || !proto.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object prototype may only be an Object or null\");\n }\n return thisInterpreter.createObjectProto(proto);\n };\n this.setProperty(\n this.OBJECT,\n \"create\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Add a polyfill to handle create's second argument.\n this.polyfills_.push(\n \"(function() {\",\n \"var create_ = Object.create;\",\n \"Object.create = function(proto, props) {\",\n \"var obj = create_(proto);\",\n \"props && Object.defineProperties(obj, props);\",\n \"return obj;\",\n \"};\",\n \"})();\",\n \"\",\n );\n\n wrapper = function (obj, prop, descriptor) {\n prop = String(prop);\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object.defineProperty called on non-object\");\n }\n if (!descriptor || !descriptor.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Property description must be an object\");\n }\n if (!obj.properties[prop] && obj.preventExtensions) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Can't define property '\" + prop + \"', object is not extensible\",\n );\n }\n // The polyfill guarantees no inheritance and no getter functions.\n // Therefore the descriptor properties map is the native object needed.\n thisInterpreter.setProperty(obj, prop, Interpreter.VALUE_IN_DESCRIPTOR, descriptor.properties);\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"defineProperty\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.polyfills_.push(\n // Flatten the descriptor to remove any inheritance or getter functions.\n \"(function() {\",\n \"var defineProperty_ = Object.defineProperty;\",\n \"Object.defineProperty = function(obj, prop, d1) {\",\n \"var d2 = {};\",\n \"if ('configurable' in d1) d2.configurable = d1.configurable;\",\n \"if ('enumerable' in d1) d2.enumerable = d1.enumerable;\",\n \"if ('writable' in d1) d2.writable = d1.writable;\",\n \"if ('value' in d1) d2.value = d1.value;\",\n \"if ('get' in d1) d2.get = d1.get;\",\n \"if ('set' in d1) d2.set = d1.set;\",\n \"return defineProperty_(obj, prop, d2);\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Object, 'defineProperties',\",\n \"{configurable: true, writable: true, value:\",\n \"function(obj, props) {\",\n \"var keys = Object.keys(props);\",\n \"for (var i = 0; i < keys.length; i++) {\",\n \"Object.defineProperty(obj, keys[i], props[keys[i]]);\",\n \"}\",\n \"return obj;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n wrapper = function (obj, prop) {\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Object.getOwnPropertyDescriptor called on non-object\",\n );\n }\n prop = String(prop);\n if (!(prop in obj.properties)) {\n return undefined;\n }\n var descriptor = Object.getOwnPropertyDescriptor(obj.properties, prop);\n var getter = obj.getter[prop];\n var setter = obj.setter[prop];\n\n if (getter || setter) {\n descriptor.get = getter;\n descriptor.set = setter;\n delete descriptor.value;\n delete descriptor.writable;\n }\n // Preserve value, but remove it for the nativeToPseudo call.\n var value = descriptor.value;\n var hasValue = \"value\" in descriptor;\n delete descriptor.value;\n var pseudoDescriptor = thisInterpreter.nativeToPseudo(descriptor);\n if (hasValue) {\n thisInterpreter.setProperty(pseudoDescriptor, \"value\", value);\n }\n return pseudoDescriptor;\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyDescriptor\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n return thisInterpreter.getPrototype(obj);\n };\n this.setProperty(\n this.OBJECT,\n \"getPrototypeOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n return Boolean(obj) && !obj.preventExtensions;\n };\n this.setProperty(\n this.OBJECT,\n \"isExtensible\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n if (obj && obj.isObject) {\n obj.preventExtensions = true;\n }\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"preventExtensions\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Object.\n this.setNativeFunctionPrototype(this.OBJECT, \"toString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"toLocaleString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"valueOf\", Interpreter.Object.prototype.valueOf);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.hasOwnProperty(prop);\n }\n return String(prop) in this.properties;\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"hasOwnProperty\", wrapper);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.propertyIsEnumerable(prop);\n }\n return Object.prototype.propertyIsEnumerable.call(this.properties, prop);\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"propertyIsEnumerable\", wrapper);\n\n wrapper = function (obj) {\n while (true) {\n // Note, circular loops shouldn't be possible.\n obj = thisInterpreter.getPrototype(obj);\n if (!obj) {\n // No parent; reached the top.\n return false;\n }\n if (obj === this) {\n return true;\n }\n }\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"isPrototypeOf\", wrapper);\n};\n\n/**\n * Initialize the Array class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initArray = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Array constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Array().\n var newArray = this;\n } else {\n // Called as Array().\n var newArray = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n }\n var first = arguments[0];\n if (arguments.length === 1 && typeof first === \"number\") {\n if (isNaN(Interpreter.legalArrayLength(first))) {\n thisInterpreter.throwException(thisInterpreter.RANGE_ERROR, \"Invalid array length\");\n }\n newArray.properties.length = first;\n } else {\n for (var i = 0; i < arguments.length; i++) {\n newArray.properties[i] = arguments[i];\n }\n newArray.properties.length = i;\n }\n return newArray;\n };\n this.ARRAY = this.createNativeFunction(wrapper, true);\n this.ARRAY_PROTO = this.ARRAY.properties[\"prototype\"];\n this.setProperty(scope, \"Array\", this.ARRAY);\n\n // Static methods on Array.\n wrapper = function (obj) {\n return obj && obj.class === \"Array\";\n };\n this.setProperty(\n this.ARRAY,\n \"isArray\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Array.\n wrapper = function () {\n return Array.prototype.pop.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"pop\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.push.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"push\", wrapper);\n\n wrapper = function () {\n return Array.prototype.shift.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"shift\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.unshift.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"unshift\", wrapper);\n\n wrapper = function () {\n Array.prototype.reverse.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"reverse\", wrapper);\n\n wrapper = function (index, howmany /*, var_args*/) {\n var list = Array.prototype.splice.apply(this.properties, arguments);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"splice\", wrapper);\n\n wrapper = function (opt_begin, opt_end) {\n var list = Array.prototype.slice.call(this.properties, opt_begin, opt_end);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"slice\", wrapper);\n\n wrapper = function (opt_separator) {\n return Array.prototype.join.call(this.properties, opt_separator);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"join\", wrapper);\n\n wrapper = function (var_args) {\n var list = [];\n var length = 0;\n // Start by copying the current array.\n var iLength = thisInterpreter.getProperty(this, \"length\");\n for (var i = 0; i < iLength; i++) {\n if (thisInterpreter.hasProperty(this, i)) {\n var element = thisInterpreter.getProperty(this, i);\n list[length] = element;\n }\n length++;\n }\n // Loop through all arguments and copy them in.\n for (var i = 0; i < arguments.length; i++) {\n var value = arguments[i];\n if (thisInterpreter.isa(value, thisInterpreter.ARRAY)) {\n var jLength = thisInterpreter.getProperty(value, \"length\");\n for (var j = 0; j < jLength; j++) {\n if (thisInterpreter.hasProperty(value, j)) {\n list[length] = thisInterpreter.getProperty(value, j);\n }\n length++;\n }\n } else {\n list[length] = value;\n }\n }\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"concat\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.indexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"indexOf\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.lastIndexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"lastIndexOf\", wrapper);\n\n wrapper = function () {\n Array.prototype.sort.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"sort\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/every\n \"Object.defineProperty(Array.prototype, 'every',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callbackfn, thisArg) {\",\n \"if (!this || typeof callbackfn !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O && !callbackfn.call(T, O[k], k, O)) return false;\",\n \"k++;\",\n \"}\",\n \"return true;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\n \"Object.defineProperty(Array.prototype, 'filter',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var res = [];\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t) {\",\n \"var val = t[i];\",\n \"if (fun.call(thisArg, val, i, t)) res.push(val);\",\n \"}\",\n \"}\",\n \"return res;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n \"if (!Array.prototype.find) {\",\n \"Object.defineProperty(Array.prototype, 'find', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return kValue;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return undefined;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Poly fill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\n \"if (!Array.prototype.findIndex) {\",\n \"Object.defineProperty(Array.prototype, 'findIndex', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return k;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return -1;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\n \"Object.defineProperty(Array.prototype, 'forEach',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Polyfill\n \"Object.defineProperty(Array.prototype, 'includes', {\",\n \"value: function(searchElement, fromIndex) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"// 1. Let O be ? ToObject(this value).\",\n \"var o = Object(this);\",\n '// 2. Let len be ? ToLength(? Get(O, \"length\")).',\n \"var len = o.length >>> 0;\",\n \"// 3. If len is 0, return false.\",\n \"if (len === 0) {\",\n \"return false;\",\n \"}\",\n \"// 4. Let n be ? ToInteger(fromIndex).\",\n \"// (If fromIndex is undefined, this step produces the value 0.)\",\n \"var n = fromIndex | 0;\",\n \"// 5. If n ≥ 0, then\",\n \"// a. Let k be n.\",\n \"// 6. Else n < 0,\",\n \"// a. Let k be len + n.\",\n \"// b. If k < 0, let k be 0.\",\n \"var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\",\n \"function sameValueZero(x, y) {\",\n \"return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\",\n \"}\",\n \"// 7. Repeat, while k < len\",\n \"while (k < len) {\",\n \"// a. Let elementK be the result of ? Get(O, ! ToString(k)).\",\n \"// b. If SameValueZero(searchElement, elementK) is true, return true.\",\n \"if (sameValueZero(o[k], searchElement)) {\",\n \"return true;\",\n \"}\",\n \"// c. Increase k by 1. \",\n \"k++;\",\n \"}\",\n \"// 8. Return false\",\n \"return false;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map\n \"Object.defineProperty(Array.prototype, 'map',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') new TypeError;\",\n \"var T, A, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"A = new Array(len);\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) A[k] = callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"return A;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce\n \"Object.defineProperty(Array.prototype, 'reduce',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = 0, value;\",\n \"if (arguments.length === 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k < len && !(k in t)) k++;\",\n \"if (k >= len) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k++];\",\n \"}\",\n \"for (; k < len; k++) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight\n \"Object.defineProperty(Array.prototype, 'reduceRight',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = len - 1, value;\",\n \"if (arguments.length >= 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k >= 0 && !(k in t)) k--;\",\n \"if (k < 0) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k--];\",\n \"}\",\n \"for (; k >= 0; k--) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/some\n \"Object.defineProperty(Array.prototype, 'some',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (!this || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t && fun.call(thisArg, t[i], i, t)) {\",\n \"return true;\",\n \"}\",\n \"}\",\n \"return false;\",\n \"}\",\n \"});\",\n\n \"(function() {\",\n \"var sort_ = Array.prototype.sort;\",\n \"Array.prototype.sort = function(opt_comp) {\",\n // Fast native sort.\n \"if (typeof opt_comp !== 'function') {\",\n \"return sort_.call(this);\",\n \"}\",\n // Slow bubble sort.\n \"for (var i = 0; i < this.length; i++) {\",\n \"var changes = 0;\",\n \"for (var j = 0; j < this.length - i - 1; j++) {\",\n \"if (opt_comp(this[j], this[j + 1]) > 0) {\",\n \"var swap = this[j];\",\n \"this[j] = this[j + 1];\",\n \"this[j + 1] = swap;\",\n \"changes++;\",\n \"}\",\n \"}\",\n \"if (!changes) break;\",\n \"}\",\n \"return this;\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Array.prototype, 'toLocaleString',\",\n \"{configurable: true, writable: true, value:\",\n \"function() {\",\n \"var out = [];\",\n \"for (var i = 0; i < this.length; i++) {\",\n \"out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();\",\n \"}\",\n \"return out.join(',');\",\n \"}\",\n \"});\",\n \"\",\n );\n};\n\n/**\n * Initialize the String class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initString = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // String constructor.\n wrapper = function (value) {\n value = String(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new String().\n this.data = value;\n return this;\n } else {\n // Called as String().\n return value;\n }\n };\n this.STRING = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"String\", this.STRING);\n\n // Static methods on String.\n this.setProperty(\n this.STRING,\n \"fromCharCode\",\n this.createNativeFunction(String.fromCharCode, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on String.\n // Methods with exclusively primitive arguments.\n var functions = [\n \"charAt\",\n \"charCodeAt\",\n \"concat\",\n \"indexOf\",\n \"lastIndexOf\",\n \"slice\",\n \"substr\",\n \"substring\",\n \"toLocaleLowerCase\",\n \"toLocaleUpperCase\",\n \"toLowerCase\",\n \"toUpperCase\",\n \"trim\",\n ];\n for (var i = 0; i < functions.length; i++) {\n this.setNativeFunctionPrototype(this.STRING, functions[i], String.prototype[functions[i]]);\n }\n\n wrapper = function (compareString, locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return String(this).localeCompare(compareString, locales, options);\n };\n this.setNativeFunctionPrototype(this.STRING, \"localeCompare\", wrapper);\n\n wrapper = function (separator, limit) {\n if (thisInterpreter.isa(separator, thisInterpreter.REGEXP)) {\n separator = separator.data;\n }\n var jsList = String(this).split(separator, limit);\n return thisInterpreter.arrayNativeToPseudo(jsList);\n };\n this.setNativeFunctionPrototype(this.STRING, \"split\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n var m = String(this).match(regexp);\n return m && thisInterpreter.arrayNativeToPseudo(m);\n };\n this.setNativeFunctionPrototype(this.STRING, \"match\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n return String(this).search(regexp);\n };\n this.setNativeFunctionPrototype(this.STRING, \"search\", wrapper);\n\n wrapper = function (substr, newSubstr) {\n // Support for function replacements is the responsibility of a polyfill.\n if (thisInterpreter.isa(substr, thisInterpreter.REGEXP)) {\n substr = substr.data;\n }\n return String(this).replace(substr, newSubstr);\n };\n this.setNativeFunctionPrototype(this.STRING, \"replace\", wrapper);\n // Add a polyfill to handle replace's second argument being a function.\n this.polyfills_.push(\n \"(function() {\",\n \"var replace_ = String.prototype.replace;\",\n \"String.prototype.replace = function(substr, newSubstr) {\",\n \"if (typeof newSubstr !== 'function') {\",\n // string.replace(string|regexp, string)\n \"return replace_.call(this, substr, newSubstr);\",\n \"}\",\n \"var str = this;\",\n \"if (substr instanceof RegExp) {\", // string.replace(regexp, function)\n \"var subs = [];\",\n \"var m = substr.exec(str);\",\n \"while (m) {\",\n \"m.push(m.index, str);\",\n \"var inject = newSubstr.apply(null, m);\",\n \"subs.push([m.index, m[0].length, inject]);\",\n \"m = substr.global ? substr.exec(str) : null;\",\n \"}\",\n \"for (var i = subs.length - 1; i >= 0; i--) {\",\n \"str = str.substring(0, subs[i][0]) + subs[i][2] + \" + \"str.substring(subs[i][0] + subs[i][1]);\",\n \"}\",\n \"} else {\", // string.replace(string, function)\n \"var i = str.indexOf(substr);\",\n \"if (i !== -1) {\",\n \"var inject = newSubstr(str.substr(i, substr.length), i, str);\",\n \"str = str.substring(0, i) + inject + \" + \"str.substring(i + substr.length);\",\n \"}\",\n \"}\",\n \"return str;\",\n \"};\",\n \"})();\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n \"if (!String.prototype.endsWith) {\",\n \"String.prototype.endsWith = function(search, this_len) {\",\n \"if (this_len === undefined || this_len > this.length) {\",\n \"this_len = this.length;\",\n \"}\",\n \"return this.substring(this_len - search.length, this_len) === search;\",\n \"};\",\n \"}\",\n\n //Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n \"if (!String.prototype.includes) {\",\n \"String.prototype.includes = function(search, start) {\",\n \"'use strict';\",\n \"if (typeof start !== 'number') {\",\n \"start = 0;\",\n \"}\",\n \" \",\n \"if (start + search.length > this.length) {\",\n \"return false;\",\n \"} else {\",\n \"return this.indexOf(search, start) !== -1;\",\n \"}\",\n \"};\",\n \"}\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n \"if (!String.prototype.startsWith) {\",\n \"String.prototype.startsWith = function(search, pos) {\",\n \"return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\",\n \"};\",\n \"}\",\n\n \"\",\n );\n};\n\n/**\n * Initialize the Boolean class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initBoolean = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Boolean constructor.\n wrapper = function (value) {\n value = Boolean(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Boolean().\n this.data = value;\n return this;\n } else {\n // Called as Boolean().\n return value;\n }\n };\n this.BOOLEAN = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Boolean\", this.BOOLEAN);\n};\n\n/**\n * Initialize the Number class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initNumber = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Number constructor.\n wrapper = function (value) {\n value = Number(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Number().\n this.data = value;\n return this;\n } else {\n // Called as Number().\n return value;\n }\n };\n this.NUMBER = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Number\", this.NUMBER);\n\n var numConsts = [\"MAX_VALUE\", \"MIN_VALUE\", \"NaN\", \"NEGATIVE_INFINITY\", \"POSITIVE_INFINITY\"];\n for (var i = 0; i < numConsts.length; i++) {\n this.setProperty(this.NUMBER, numConsts[i], Number[numConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n\n // Instance methods on Number.\n wrapper = function (fractionDigits) {\n try {\n return Number(this).toExponential(fractionDigits);\n } catch (e) {\n // Throws if fractionDigits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toExponential\", wrapper);\n\n wrapper = function (digits) {\n try {\n return Number(this).toFixed(digits);\n } catch (e) {\n // Throws if digits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toFixed\", wrapper);\n\n wrapper = function (precision) {\n try {\n return Number(this).toPrecision(precision);\n } catch (e) {\n // Throws if precision isn't within range (depends on implementation).\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toPrecision\", wrapper);\n\n wrapper = function (radix) {\n try {\n return Number(this).toString(radix);\n } catch (e) {\n // Throws if radix isn't within 2-36.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toString\", wrapper);\n\n wrapper = function (locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return Number(this).toLocaleString(locales, options);\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toLocaleString\", wrapper);\n};\n\n/**\n * Initialize the Date class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initDate = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Date constructor.\n wrapper = function (value, var_args) {\n if (!thisInterpreter.calledWithNew()) {\n // Called as Date().\n // Calling Date() as a function returns a string, no arguments are heeded.\n return Date();\n }\n // Called as new Date().\n var args = [null].concat(Array.from(arguments));\n this.data = new (Function.prototype.bind.apply(Date, args))();\n return this;\n };\n this.DATE = this.createNativeFunction(wrapper, true);\n this.DATE_PROTO = this.DATE.properties[\"prototype\"];\n this.setProperty(scope, \"Date\", this.DATE);\n\n // Static methods on Date.\n this.setProperty(this.DATE, \"now\", this.createNativeFunction(Date.now, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n this.setProperty(\n this.DATE,\n \"parse\",\n this.createNativeFunction(Date.parse, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.setProperty(this.DATE, \"UTC\", this.createNativeFunction(Date.UTC, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n // Instance methods on Date.\n var functions = [\n \"getDate\",\n \"getDay\",\n \"getFullYear\",\n \"getHours\",\n \"getMilliseconds\",\n \"getMinutes\",\n \"getMonth\",\n \"getSeconds\",\n \"getTime\",\n \"getTimezoneOffset\",\n \"getUTCDate\",\n \"getUTCDay\",\n \"getUTCFullYear\",\n \"getUTCHours\",\n \"getUTCMilliseconds\",\n \"getUTCMinutes\",\n \"getUTCMonth\",\n \"getUTCSeconds\",\n \"getYear\",\n \"setDate\",\n \"setFullYear\",\n \"setHours\",\n \"setMilliseconds\",\n \"setMinutes\",\n \"setMonth\",\n \"setSeconds\",\n \"setTime\",\n \"setUTCDate\",\n \"setUTCFullYear\",\n \"setUTCHours\",\n \"setUTCMilliseconds\",\n \"setUTCMinutes\",\n \"setUTCMonth\",\n \"setUTCSeconds\",\n \"setYear\",\n \"toDateString\",\n \"toISOString\",\n \"toJSON\",\n \"toGMTString\",\n \"toLocaleDateString\",\n \"toLocaleString\",\n \"toLocaleTimeString\",\n \"toTimeString\",\n \"toUTCString\",\n ];\n for (var i = 0; i < functions.length; i++) {\n wrapper = (function (nativeFunc) {\n return function (var_args) {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = thisInterpreter.pseudoToNative(arguments[i]);\n }\n return this.data[nativeFunc].apply(this.data, args);\n };\n })(functions[i]);\n this.setNativeFunctionPrototype(this.DATE, functions[i], wrapper);\n }\n};\n\n/**\n * Initialize Regular Expression object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initRegExp = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // RegExp constructor.\n wrapper = function (pattern, flags) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new RegExp().\n var rgx = this;\n } else {\n // Called as RegExp().\n var rgx = thisInterpreter.createObjectProto(thisInterpreter.REGEXP_PROTO);\n }\n pattern = pattern ? pattern.toString() : \"\";\n flags = flags ? flags.toString() : \"\";\n thisInterpreter.populateRegExp(rgx, new RegExp(pattern, flags));\n return rgx;\n };\n this.REGEXP = this.createNativeFunction(wrapper, true);\n this.REGEXP_PROTO = this.REGEXP.properties[\"prototype\"];\n this.setProperty(scope, \"RegExp\", this.REGEXP);\n\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"global\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"ignoreCase\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"multiline\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"source\",\n \"(?:)\",\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (str) {\n return this.data.test(str);\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"test\", wrapper);\n\n wrapper = function (str) {\n str = str.toString();\n // Get lastIndex from wrapped regex, since this is settable.\n this.data.lastIndex = Number(thisInterpreter.getProperty(this, \"lastIndex\"));\n var match = this.data.exec(str);\n thisInterpreter.setProperty(this, \"lastIndex\", this.data.lastIndex);\n\n if (match) {\n var result = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n for (var i = 0; i < match.length; i++) {\n thisInterpreter.setProperty(result, i, match[i]);\n }\n // match has additional properties.\n thisInterpreter.setProperty(result, \"index\", match.index);\n thisInterpreter.setProperty(result, \"input\", match.input);\n return result;\n }\n return null;\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"exec\", wrapper);\n};\n\n/**\n * Initialize the Error class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initError = function (scope) {\n var thisInterpreter = this;\n // Error constructor.\n this.ERROR = this.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Error().\n var newError = this;\n } else {\n // Called as Error().\n var newError = thisInterpreter.createObject(thisInterpreter.ERROR);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n this.setProperty(scope, \"Error\", this.ERROR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"message\", \"\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"name\", \"Error\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n var createErrorSubclass = function (name) {\n var constructor = thisInterpreter.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new XyzError().\n var newError = this;\n } else {\n // Called as XyzError().\n var newError = thisInterpreter.createObject(constructor);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n thisInterpreter.setProperty(constructor, \"prototype\", thisInterpreter.createObject(thisInterpreter.ERROR));\n thisInterpreter.setProperty(\n constructor.properties[\"prototype\"],\n \"name\",\n name,\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n thisInterpreter.setProperty(scope, name, constructor);\n\n return constructor;\n };\n\n this.EVAL_ERROR = createErrorSubclass(\"EvalError\");\n this.RANGE_ERROR = createErrorSubclass(\"RangeError\");\n this.REFERENCE_ERROR = createErrorSubclass(\"ReferenceError\");\n this.SYNTAX_ERROR = createErrorSubclass(\"SyntaxError\");\n this.TYPE_ERROR = createErrorSubclass(\"TypeError\");\n this.URI_ERROR = createErrorSubclass(\"URIError\");\n};\n\n/**\n * Initialize Math object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initMath = function (scope) {\n var thisInterpreter = this;\n var myMath = this.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"Math\", myMath);\n var mathConsts = [\"E\", \"LN2\", \"LN10\", \"LOG2E\", \"LOG10E\", \"PI\", \"SQRT1_2\", \"SQRT2\"];\n for (var i = 0; i < mathConsts.length; i++) {\n this.setProperty(myMath, mathConsts[i], Math[mathConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n var numFunctions = [\n \"abs\",\n \"acos\",\n \"asin\",\n \"atan\",\n \"atan2\",\n \"ceil\",\n \"cos\",\n \"exp\",\n \"floor\",\n \"log\",\n \"max\",\n \"min\",\n \"pow\",\n \"random\",\n \"round\",\n \"sin\",\n \"sqrt\",\n \"tan\",\n ];\n for (var i = 0; i < numFunctions.length; i++) {\n this.setProperty(\n myMath,\n numFunctions[i],\n this.createNativeFunction(Math[numFunctions[i]], false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n};\n\n/**\n * Initialize JSON object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initJSON = function (scope) {\n var thisInterpreter = this;\n var myJSON = thisInterpreter.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"JSON\", myJSON);\n\n var wrapper = function (text) {\n try {\n var nativeObj = JSON.parse(text.toString());\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, e.message);\n }\n return thisInterpreter.nativeToPseudo(nativeObj);\n };\n this.setProperty(myJSON, \"parse\", this.createNativeFunction(wrapper, false));\n\n wrapper = function (value) {\n var nativeObj = thisInterpreter.pseudoToNative(value);\n try {\n var str = JSON.stringify(nativeObj);\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, e.message);\n }\n return str;\n };\n this.setProperty(myJSON, \"stringify\", this.createNativeFunction(wrapper, false));\n};\n\n/**\n * Is an object of a certain class?\n * @param {Interpreter.Value} child Object to check.\n * @param {Interpreter.Object} constructor Constructor of object.\n * @return {boolean} True if object is the class or inherits from it.\n * False otherwise.\n */\nInterpreter.prototype.isa = function (child, constructor) {\n if (child === null || child === undefined || !constructor) {\n return false;\n }\n var proto = constructor.properties[\"prototype\"];\n if (child === proto) {\n return true;\n }\n // The first step up the prototype chain is harder since the child might be\n // a primitive value. Subsequent steps can just follow the .proto property.\n child = this.getPrototype(child);\n while (child) {\n if (child === proto) {\n return true;\n }\n child = child.proto;\n }\n return false;\n};\n\n/**\n * Is a value a legal integer for an array length?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayLength = function (x) {\n var n = x >>> 0;\n // Array length must be between 0 and 2^32-1 (inclusive).\n return n === Number(x) ? n : NaN;\n};\n\n/**\n * Is a value a legal integer for an array index?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayIndex = function (x) {\n var n = x >>> 0;\n // Array index cannot be 2^32-1, otherwise length would be 2^32.\n // 0xffffffff is 2^32-1.\n return String(n) === String(x) && n !== 0xffffffff ? n : NaN;\n};\n\n/**\n * Typedef for JS values.\n * @typedef {!Interpreter.Object|boolean|number|string|undefined|null}\n */\nInterpreter.Value;\n\n/**\n * Class for an object.\n * @param {Interpreter.Object} proto Prototype object or null.\n * @constructor\n */\nInterpreter.Object = function (proto) {\n this.getter = Object.create(null);\n this.setter = Object.create(null);\n this.properties = Object.create(null);\n this.proto = proto;\n};\n\n/** @type {Interpreter.Object} */\nInterpreter.Object.prototype.proto = null;\n\n/** @type {boolean} */\nInterpreter.Object.prototype.isObject = true;\n\n/** @type {string} */\nInterpreter.Object.prototype.class = \"Object\";\n\n/** @type {Date|RegExp|boolean|number|string|undefined|null} */\nInterpreter.Object.prototype.data = null;\n\n/**\n * Convert this object into a string.\n * @return {string} String value.\n * @override\n */\nInterpreter.Object.prototype.toString = function () {\n if (this.class === \"Array\") {\n // Array\n var cycles = Interpreter.toStringCycles_;\n cycles.push(this);\n try {\n var strs = [];\n for (var i = 0; i < this.properties.length; i++) {\n var value = this.properties[i];\n strs[i] = value && value.isObject && cycles.indexOf(value) !== -1 ? \"...\" : value;\n }\n } finally {\n cycles.pop();\n }\n return strs.join(\",\");\n }\n if (this.class === \"Error\") {\n var cycles = Interpreter.toStringCycles_;\n if (cycles.indexOf(this) !== -1) {\n return \"[object Error]\";\n }\n var name, message;\n // Bug: Does not support getters and setters for name or message.\n var obj = this;\n do {\n if (\"name\" in obj.properties) {\n name = obj.properties[\"name\"];\n break;\n }\n } while ((obj = obj.proto));\n var obj = this;\n do {\n if (\"message\" in obj.properties) {\n message = obj.properties[\"message\"];\n break;\n }\n } while ((obj = obj.proto));\n cycles.push(this);\n try {\n name = name && name.toString();\n message = message && message.toString();\n } finally {\n cycles.pop();\n }\n return message ? name + \": \" + message : String(name);\n }\n\n // RegExp, Date, and boxed primitives.\n if (this.data !== null) {\n return String(this.data);\n }\n\n return \"[object \" + this.class + \"]\";\n};\n\n/**\n * Return the object's value.\n * @return {Interpreter.Value} Value.\n * @override\n */\nInterpreter.Object.prototype.valueOf = function () {\n if (this.data === undefined || this.data === null || this.data instanceof RegExp) {\n return this; // An Object.\n }\n if (this.data instanceof Date) {\n return this.data.valueOf(); // Milliseconds.\n }\n return /** @type {(boolean|number|string)} */ (this.data); // Boxed primitive.\n};\n\n/**\n * Create a new data object based on a constructor's prototype.\n * @param {Interpreter.Object} constructor Parent constructor function,\n * or null if scope object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObject = function (constructor) {\n return this.createObjectProto(constructor && constructor.properties[\"prototype\"]);\n};\n\n/**\n * Create a new data object based on a prototype.\n * @param {Interpreter.Object} proto Prototype object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObjectProto = function (proto) {\n if (typeof proto !== \"object\") {\n throw Error(\"Non object prototype\");\n }\n var obj = new Interpreter.Object(proto);\n // Functions have prototype objects.\n if (this.isa(obj, this.FUNCTION)) {\n this.setProperty(obj, \"prototype\", this.createObjectProto(this.OBJECT_PROTO || null));\n obj.class = \"Function\";\n }\n // Arrays have length.\n if (this.isa(obj, this.ARRAY)) {\n this.setProperty(obj, \"length\", 0, {\n configurable: false,\n enumerable: false,\n writable: true,\n });\n obj.class = \"Array\";\n }\n if (this.isa(obj, this.ERROR)) {\n obj.class = \"Error\";\n }\n return obj;\n};\n\n/**\n * Initialize a pseudo regular expression object based on a native regular\n * expression object.\n * @param {!Interpreter.Object} pseudoRegexp The existing object to set.\n * @param {!RegExp} nativeRegexp The native regular expression.\n */\nInterpreter.prototype.populateRegExp = function (pseudoRegexp, nativeRegexp) {\n pseudoRegexp.data = nativeRegexp;\n // lastIndex is settable, all others are read-only attributes\n this.setProperty(pseudoRegexp, \"lastIndex\", nativeRegexp.lastIndex, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"source\", nativeRegexp.source, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"global\", nativeRegexp.global, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"ignoreCase\", nativeRegexp.ignoreCase, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"multiline\", nativeRegexp.multiline, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n};\n\n/**\n * Create a new function.\n * @param {!Object} node AST node defining the function.\n * @param {!Object} scope Parent scope.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createFunction = function (node, scope) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.parentScope = scope;\n func.node = node;\n this.setProperty(func, \"length\", func.node[\"params\"].length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Create a new native function.\n * @param {!Function} nativeFunc JavaScript function.\n * @param {boolean=} opt_constructor If true, the function's\n * prototype will have its constructor property set to the function.\n * If false, the function cannot be called as a constructor (e.g. escape).\n * Defaults to undefined.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createNativeFunction = function (nativeFunc, opt_constructor) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.nativeFunc = nativeFunc;\n nativeFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", nativeFunc.length, Interpreter.READONLY_DESCRIPTOR);\n if (opt_constructor) {\n this.setProperty(func.properties[\"prototype\"], \"constructor\", func, Interpreter.NONENUMERABLE_DESCRIPTOR);\n } else if (opt_constructor === false) {\n func.illegalConstructor = true;\n this.setProperty(func, \"prototype\", undefined);\n }\n return func;\n};\n\n/**\n * Create a new native asynchronous function.\n * @param {!Function} asyncFunc JavaScript function.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createAsyncFunction = function (asyncFunc) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.asyncFunc = asyncFunc;\n asyncFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", asyncFunc.length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Converts from a native JS object or value to a JS interpreter object.\n * Can handle JSON-style values, does NOT handle cycles.\n * @param {*} nativeObj The native JS object to be converted.\n * @return {Interpreter.Value} The equivalent JS interpreter object.\n */\nInterpreter.prototype.nativeToPseudo = function (nativeObj) {\n if ((typeof nativeObj !== \"object\" && typeof nativeObj !== \"function\") || nativeObj === null) {\n return nativeObj;\n }\n\n if (nativeObj instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, nativeObj);\n return pseudoRegexp;\n }\n\n if (nativeObj instanceof Date) {\n var pseudoDate = this.createObjectProto(this.DATE_PROTO);\n pseudoDate.data = nativeObj;\n return pseudoDate;\n }\n\n if (nativeObj instanceof Function) {\n var interpreter = this;\n var wrapper = function () {\n return interpreter.nativeToPseudo(\n nativeObj.apply(\n interpreter,\n Array.prototype.slice.call(arguments).map(function (i) {\n return interpreter.pseudoToNative(i);\n }),\n ),\n );\n };\n return this.createNativeFunction(wrapper, undefined);\n }\n\n var pseudoObj;\n if (Array.isArray(nativeObj)) {\n // Array.\n pseudoObj = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < nativeObj.length; i++) {\n if (i in nativeObj) {\n this.setProperty(pseudoObj, i, this.nativeToPseudo(nativeObj[i]));\n }\n }\n } else {\n // Object.\n pseudoObj = this.createObjectProto(this.OBJECT_PROTO);\n for (var key in nativeObj) {\n this.setProperty(pseudoObj, key, this.nativeToPseudo(nativeObj[key]));\n }\n }\n return pseudoObj;\n};\n\n/**\n * Converts from a JS interpreter object to native JS object.\n * Can handle JSON-style values, plus cycles.\n * @param {Interpreter.Value} pseudoObj The JS interpreter object to be\n * converted.\n * @param {Object=} opt_cycles Cycle detection (used in recursive calls).\n * @return {*} The equivalent native JS object or value.\n */\nInterpreter.prototype.pseudoToNative = function (pseudoObj, opt_cycles) {\n if ((typeof pseudoObj !== \"object\" && typeof pseudoObj !== \"function\") || pseudoObj === null) {\n return pseudoObj;\n }\n\n if (this.isa(pseudoObj, this.REGEXP)) {\n // Regular expression.\n return pseudoObj.data;\n }\n\n if (this.isa(pseudoObj, this.DATE)) {\n // Date.\n return pseudoObj.data;\n }\n\n var cycles = opt_cycles || {\n pseudo: [],\n native: [],\n };\n var i = cycles.pseudo.indexOf(pseudoObj);\n if (i !== -1) {\n return cycles.native[i];\n }\n cycles.pseudo.push(pseudoObj);\n var nativeObj;\n if (this.isa(pseudoObj, this.ARRAY)) {\n // Array.\n nativeObj = [];\n cycles.native.push(nativeObj);\n var length = this.getProperty(pseudoObj, \"length\");\n for (var i = 0; i < length; i++) {\n if (this.hasProperty(pseudoObj, i)) {\n nativeObj[i] = this.pseudoToNative(this.getProperty(pseudoObj, i), cycles);\n }\n }\n } else {\n // Object.\n nativeObj = {};\n cycles.native.push(nativeObj);\n var val;\n for (var key in pseudoObj.properties) {\n val = pseudoObj.properties[key];\n nativeObj[key] = this.pseudoToNative(val, cycles);\n }\n }\n cycles.pseudo.pop();\n cycles.native.pop();\n return nativeObj;\n};\n\n/**\n * Converts from a native JS array to a JS interpreter array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Array} nativeArray The JS array to be converted.\n * @return {!Interpreter.Object} The equivalent JS interpreter array.\n */\nInterpreter.prototype.arrayNativeToPseudo = function (nativeArray) {\n var pseudoArray = this.createObjectProto(this.ARRAY_PROTO);\n var props = Object.getOwnPropertyNames(nativeArray);\n for (var i = 0; i < props.length; i++) {\n this.setProperty(pseudoArray, props[i], nativeArray[props[i]]);\n }\n return pseudoArray;\n};\n\n/**\n * Converts from a JS interpreter array to native JS array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Interpreter.Object} pseudoArray The JS interpreter array,\n * or JS interpreter object pretending to be an array.\n * @return {!Array} The equivalent native JS array.\n */\nInterpreter.prototype.arrayPseudoToNative = function (pseudoArray) {\n var nativeArray = [];\n for (var key in pseudoArray.properties) {\n nativeArray[key] = this.getProperty(pseudoArray, key);\n }\n // pseudoArray might be an object pretending to be an array. In this case\n // it's possible that length is non-existent, invalid, or smaller than the\n // largest defined numeric property. Set length explicitly here.\n nativeArray.length = Interpreter.legalArrayLength(this.getProperty(pseudoArray, \"length\")) || 0;\n return nativeArray;\n};\n\n/**\n * Look up the prototype for this value.\n * @param {Interpreter.Value} value Data object.\n * @return {Interpreter.Object} Prototype object, null if none.\n */\nInterpreter.prototype.getPrototype = function (value) {\n switch (typeof value) {\n case \"number\":\n return this.NUMBER.properties[\"prototype\"];\n case \"boolean\":\n return this.BOOLEAN.properties[\"prototype\"];\n case \"string\":\n return this.STRING.properties[\"prototype\"];\n }\n if (value) {\n return value.proto;\n }\n return null;\n};\n\n/**\n * Fetch a property value from a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line numbers\n * @return {Interpreter.Value} Property value (may be undefined).\n */\nInterpreter.prototype.getProperty = function (obj, name, node) {\n name = String(name);\n if (obj === undefined || obj === null) {\n let lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.TYPE_ERROR, \"Cannot read property '\" + name + \"' of \" + obj, lineNum);\n }\n if (name === \"length\") {\n // Special cases for magic length property.\n if (this.isa(obj, this.STRING)) {\n return String(obj).length;\n }\n } else if (name.charCodeAt(0) < 0x40) {\n // Might have numbers in there?\n // Special cases for string array indexing\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return String(obj)[n];\n }\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n var getter = obj.getter[name];\n if (getter) {\n // Flag this function as being a getter and thus needing immediate\n // execution (rather than being the value of the property).\n getter.isGetter = true;\n return getter;\n }\n return obj.properties[name];\n }\n } while ((obj = this.getPrototype(obj)));\n return undefined;\n};\n\n/**\n * Does the named property exist on a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @return {boolean} True if property exists.\n */\nInterpreter.prototype.hasProperty = function (obj, name) {\n if (!obj.isObject) {\n throw TypeError(\"Primitive data type has no properties\");\n }\n name = String(name);\n if (name === \"length\" && this.isa(obj, this.STRING)) {\n return true;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return true;\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n return true;\n }\n } while ((obj = this.getPrototype(obj)));\n return false;\n};\n\n/**\n * Set a property value on a data object.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Interpreter.Value} value New property value.\n * Use Interpreter.VALUE_IN_DESCRIPTOR if value is handled by\n * descriptor instead.\n * @param {Object=} opt_descriptor Optional descriptor object.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setProperty = function (obj, name, value, opt_descriptor) {\n name = String(name);\n if (obj === undefined || obj === null) {\n this.throwException(this.TYPE_ERROR, \"Cannot set property '\" + name + \"' of \" + obj);\n }\n if (\n opt_descriptor &&\n (\"get\" in opt_descriptor || \"set\" in opt_descriptor) &&\n (\"value\" in opt_descriptor || \"writable\" in opt_descriptor)\n ) {\n this.throwException(\n this.TYPE_ERROR,\n \"Invalid property descriptor. \" + \"Cannot both specify accessors and a value or writable attribute\",\n );\n }\n var strict = !this.stateStack || this.getScope().strict;\n if (!obj.isObject) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't create property '\" + name + \"' on '\" + obj + \"'\");\n }\n return;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (name === \"length\" || (!isNaN(n) && n < String(obj).length)) {\n // Can't set length or letters on String objects.\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of String '\" + obj.data + \"'\",\n );\n }\n return;\n }\n }\n if (obj.class === \"Array\") {\n // Arrays have a magic length variable that is bound to the elements.\n var length = obj.properties.length;\n var i;\n if (name === \"length\") {\n // Delete elements if length is smaller.\n if (opt_descriptor) {\n if (!(\"value\" in opt_descriptor)) {\n return;\n }\n value = opt_descriptor.value;\n }\n value = Interpreter.legalArrayLength(value);\n if (isNaN(value)) {\n this.throwException(this.RANGE_ERROR, \"Invalid array length\");\n }\n if (value < length) {\n for (i in obj.properties) {\n i = Interpreter.legalArrayIndex(i);\n if (!isNaN(i) && value <= i) {\n delete obj.properties[i];\n }\n }\n }\n } else if (!isNaN((i = Interpreter.legalArrayIndex(name)))) {\n // Increase length if this index is larger.\n obj.properties.length = Math.max(length, i + 1);\n }\n }\n if (obj.preventExtensions && !(name in obj.properties)) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't add property '\" + name + \"', object is not extensible\");\n }\n return;\n }\n if (opt_descriptor) {\n // Define the property.\n if (\"get\" in opt_descriptor) {\n if (opt_descriptor.get) {\n obj.getter[name] = opt_descriptor.get;\n } else {\n delete obj.getter[name];\n }\n }\n if (\"set\" in opt_descriptor) {\n if (opt_descriptor.set) {\n obj.setter[name] = opt_descriptor.set;\n } else {\n delete obj.setter[name];\n }\n }\n var descriptor = {};\n if (\"configurable\" in opt_descriptor) {\n descriptor.configurable = opt_descriptor.configurable;\n }\n if (\"enumerable\" in opt_descriptor) {\n descriptor.enumerable = opt_descriptor.enumerable;\n }\n if (\"writable\" in opt_descriptor) {\n descriptor.writable = opt_descriptor.writable;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n if (\"value\" in opt_descriptor) {\n descriptor.value = opt_descriptor.value;\n delete obj.getter[name];\n delete obj.setter[name];\n } else if (value !== Interpreter.VALUE_IN_DESCRIPTOR) {\n descriptor.value = value;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n try {\n Object.defineProperty(obj.properties, name, descriptor);\n } catch (e) {\n this.throwException(this.TYPE_ERROR, \"Cannot redefine property: \" + name);\n }\n } else {\n // Set the property.\n if (value === Interpreter.VALUE_IN_DESCRIPTOR) {\n throw ReferenceError(\"Value not specified.\");\n }\n // Determine the parent (possibly self) where the property is defined.\n var defObj = obj;\n while (!(name in defObj.properties)) {\n defObj = this.getPrototype(defObj);\n if (!defObj) {\n // This is a new property.\n defObj = obj;\n break;\n }\n }\n if (defObj.setter && defObj.setter[name]) {\n return defObj.setter[name];\n }\n if (defObj.getter && defObj.getter[name]) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot set property '\" + name + \"' of object '\" + obj + \"' which only has a getter\",\n );\n }\n } else {\n // No setter, simple assignment.\n try {\n obj.properties[name] = value;\n } catch (e) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of object '\" + obj + \"'\",\n );\n }\n }\n }\n }\n};\n\n/**\n * Convenience method for adding a native function as a non-enumerable property\n * onto an object's prototype.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {!Function} wrapper Function object.\n */\nInterpreter.prototype.setNativeFunctionPrototype = function (obj, name, wrapper) {\n this.setProperty(\n obj.properties[\"prototype\"],\n name,\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Returns the current scope from the stateStack.\n * @return {!Interpreter.Object} Current scope dictionary.\n */\nInterpreter.prototype.getScope = function () {\n var scope = this.stateStack[this.stateStack.length - 1].scope;\n if (!scope) {\n throw Error(\"No scope found.\");\n }\n return scope;\n};\n\n/**\n * Create a new scope dictionary.\n * @param {!Object} node AST node defining the scope container\n * (e.g. a function).\n * @param {Interpreter.Object} parentScope Scope to link to.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createScope = function (node, parentScope) {\n var scope = this.createObjectProto(null);\n scope.parentScope = parentScope;\n if (!parentScope) {\n this.initGlobalScope(scope);\n }\n this.populateScope_(node, scope);\n\n // Determine if this scope starts with 'use strict'.\n scope.strict = false;\n if (parentScope && parentScope.strict) {\n scope.strict = true;\n } else {\n var firstNode = node[\"body\"] && node[\"body\"][0];\n if (\n firstNode &&\n firstNode.expression &&\n firstNode.expression[\"type\"] === \"Literal\" &&\n firstNode.expression.value === \"use strict\"\n ) {\n scope.strict = true;\n }\n }\n return scope;\n};\n\n/**\n * Create a new special scope dictionary. Similar to createScope(), but\n * doesn't assume that the scope is for a function body.\n * This is used for 'catch' clauses and 'with' statements.\n * @param {!Interpreter.Object} parentScope Scope to link to.\n * @param {Interpreter.Object=} opt_scope Optional object to transform into\n * scope.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createSpecialScope = function (parentScope, opt_scope) {\n if (!parentScope) {\n throw Error(\"parentScope required\");\n }\n var scope = opt_scope || this.createObjectProto(null);\n scope.parentScope = parentScope;\n scope.strict = parentScope.strict;\n return scope;\n};\n\n/**\n * Retrieves a value from the scope chain.\n * @param {string} name Name of variable.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValueFromScope = function (name, node) {\n var scope = this.getScope();\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n return scope.properties[name];\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has inherited properties and\n // could also have getters.\n if (scope === this.global && this.hasProperty(scope, name)) {\n return this.getProperty(scope, name);\n }\n // Typeof operator is unique: it can safely look at non-defined variables.\n var prevNode = this.stateStack[this.stateStack.length - 1].node;\n if (prevNode[\"type\"] === \"UnaryExpression\" && prevNode[\"operator\"] === \"typeof\") {\n return undefined;\n }\n\n var lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\", lineNum);\n};\n\n/**\n * Sets a value to the current scope.\n * @param {string} name Name of variable.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValueToScope = function (name, value) {\n var scope = this.getScope();\n var strict = scope.strict;\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n scope.properties[name] = value;\n return undefined;\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has readonly properties and\n // could also have setters.\n if (scope === this.global && (!strict || this.hasProperty(scope, name))) {\n return this.setProperty(scope, name, value);\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\");\n};\n\n/**\n * Create a new scope for the given node.\n * @param {!Object} node AST node (program or function).\n * @param {!Interpreter.Object} scope Scope dictionary to populate.\n * @private\n */\nInterpreter.prototype.populateScope_ = function (node, scope) {\n if (node[\"type\"] === \"VariableDeclaration\") {\n for (var i = 0; i < node[\"declarations\"].length; i++) {\n this.setProperty(scope, node[\"declarations\"][i][\"id\"][\"name\"], undefined, Interpreter.VARIABLE_DESCRIPTOR);\n }\n } else if (node[\"type\"] === \"FunctionDeclaration\") {\n this.setProperty(scope, node[\"id\"][\"name\"], this.createFunction(node, scope), Interpreter.VARIABLE_DESCRIPTOR);\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"FunctionExpression\") {\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"ExpressionStatement\") {\n return; // Expressions can't contain variable/function declarations.\n }\n var nodeClass = node[\"constructor\"];\n for (var name in node) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n if (Array.isArray(prop)) {\n for (var i = 0; i < prop.length; i++) {\n if (prop[i] && prop[i].constructor === nodeClass) {\n this.populateScope_(prop[i], scope);\n }\n }\n } else {\n if (prop.constructor === nodeClass) {\n this.populateScope_(prop, scope);\n }\n }\n }\n }\n};\n\n/**\n * Remove start and end values from AST, or set start and end values to a\n * constant value. Used to remove highlighting from polyfills and to set\n * highlighting in an eval to cover the entire eval expression.\n * @param {!Object} node AST node.\n * @param {number=} start Starting character of all nodes, or undefined.\n * @param {number=} end Ending character of all nodes, or undefined.\n * @private\n */\nInterpreter.prototype.stripLocations_ = function (node, start, end) {\n if (start) {\n node[\"start\"] = start;\n } else {\n delete node[\"start\"];\n }\n if (end) {\n node[\"end\"] = end;\n } else {\n delete node[\"end\"];\n }\n for (var name in node) {\n if (node.hasOwnProperty(name)) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n this.stripLocations_(prop, start, end);\n }\n }\n }\n};\n\n/**\n * Is the current state directly being called with as a construction with 'new'.\n * @return {boolean} True if 'new foo()', false if 'foo()'.\n */\nInterpreter.prototype.calledWithNew = function () {\n return this.stateStack[this.stateStack.length - 1].isConstructor;\n};\n\n/**\n * Gets a value from the scope chain or from an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValue = function (ref, node) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.getValueFromScope(ref[1], node);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.getProperty(ref[0], ref[1], node);\n }\n};\n\n/**\n * Sets a value to the scope chain or to an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValue = function (ref, value) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.setValueToScope(ref[1], value);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.setProperty(ref[0], ref[1], value);\n }\n};\n\n/**\n * Completion Value Types.\n * @enum {number}\n */\nInterpreter.Completion = {\n NORMAL: 0,\n BREAK: 1,\n CONTINUE: 2,\n RETURN: 3,\n THROW: 4,\n};\n\n/**\n * Throw an exception in the interpreter that can be handled by an\n * interpreter try/catch statement. If unhandled, a real exception will\n * be thrown. Can be called with either an error class and a message, or\n * with an actual object to be thrown.\n * @param {!Interpreter.Object} errorClass Type of error (if message is\n * provided) or the value to throw (if no message).\n * @param {string=} opt_message Message being thrown.\n */\nInterpreter.prototype.throwException = function (errorClass, opt_message, lineNumber) {\n if (opt_message === undefined) {\n var error = errorClass; // This is a value to throw, not an error class.\n } else {\n var error = this.createObject(errorClass);\n this.setProperty(error, \"message\", opt_message, Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n var lineNumErrorMsg;\n if (lineNumber != null) {\n lineNumErrorMsg = this.getErrorLineNumberMessage(lineNumber);\n }\n this.unwind(Interpreter.Completion.THROW, error, undefined, lineNumErrorMsg);\n // Abort anything related to the current step.\n throw Interpreter.STEP_ERROR;\n};\n\n/**\n * Unwind the stack to the innermost relevant enclosing TryStatement,\n * For/ForIn/WhileStatement or Call/NewExpression. If this results in\n * the stack being completely unwound the thread will be terminated\n * and the appropriate error being thrown.\n * @param {Interpreter.Completion} type Completion type.\n * @param {Interpreter.Value=} value Value computed, returned or thrown.\n * @param {string=} label Target label for break or return.\n */\nInterpreter.prototype.unwind = function (type, value, label, lineNumberMsg = \"\") {\n if (type === Interpreter.Completion.NORMAL) {\n throw TypeError(\"Should not unwind for NORMAL completions\");\n }\n\n for (var stack = this.stateStack; stack.length > 0; stack.pop()) {\n var state = stack[stack.length - 1];\n switch (state.node[\"type\"]) {\n case \"TryStatement\":\n state.cv = { type: type, value: value, label: label };\n return;\n case \"CallExpression\":\n case \"NewExpression\":\n if (type === Interpreter.Completion.RETURN) {\n state.value = value;\n return;\n } else if (type !== Interpreter.Completion.THROW) {\n throw Error(\"Unsynatctic break/continue not rejected by Acorn\");\n }\n }\n if (type === Interpreter.Completion.BREAK) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop || state.isSwitch) {\n stack.pop();\n return;\n }\n } else if (type === Interpreter.Completion.CONTINUE) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop) {\n return;\n }\n }\n }\n\n // Unhandled completion. Throw a real error.\n var realError;\n if (this.isa(value, this.ERROR)) {\n var errorTable = {\n EvalError: EvalError,\n RangeError: RangeError,\n ReferenceError: ReferenceError,\n SyntaxError: SyntaxError,\n TypeError: TypeError,\n URIError: URIError,\n };\n var name = this.getProperty(value, \"name\").toString();\n var message = this.getProperty(value, \"message\").valueOf();\n var type = errorTable[name] || Error;\n realError = type(message + lineNumberMsg);\n } else {\n realError = String(value) + lineNumberMsg;\n }\n throw realError;\n};\n\n/**\n * Create a call to a getter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @private\n */\nInterpreter.prototype.createGetter_ = function (func, left) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is explicitly provided (o).\n var funcThis = Array.isArray(left) ? left[0] : left;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [];\n return state;\n};\n\n/**\n * Create a call to a setter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value to set.\n * @private\n */\nInterpreter.prototype.createSetter_ = function (func, left, value) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is implicitly the global object (x).\n var funcThis = Array.isArray(left) ? left[0] : this.global;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [value];\n return state;\n};\n\n/**\n * Class for a state.\n * @param {!Object} node AST node for the state.\n * @param {!Interpreter.Object} scope Scope object for the state.\n * @constructor\n */\nInterpreter.State = function (node, scope) {\n this.node = node;\n this.scope = scope;\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Functions to handle each node type.\n///////////////////////////////////////////////////////////////////////////////\n\nInterpreter.prototype[\"stepArrayExpression\"] = function (stack, state, node) {\n var elements = node[\"elements\"];\n var n = state.n_ || 0;\n if (!state.array_) {\n state.array_ = this.createObjectProto(this.ARRAY_PROTO);\n state.array_.properties.length = elements.length;\n } else {\n this.setProperty(state.array_, n, state.value);\n n++;\n }\n while (n < elements.length) {\n // Skip missing elements - they're not defined, not undefined.\n if (elements[n]) {\n state.n_ = n;\n return new Interpreter.State(elements[n], state.scope);\n }\n n++;\n }\n stack.pop();\n stack[stack.length - 1].value = state.array_;\n};\n\nInterpreter.prototype[\"stepAssignmentExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"left\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.doneRight_) {\n if (!state.leftReference_) {\n state.leftReference_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_ && node[\"operator\"] !== \"=\") {\n var leftValue = this.getValue(state.leftReference_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftReference_);\n }\n }\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var value = state.leftValue_;\n var rightValue = state.value;\n switch (node[\"operator\"]) {\n case \"=\":\n value = rightValue;\n break;\n case \"+=\":\n value += rightValue;\n break;\n case \"-=\":\n value -= rightValue;\n break;\n case \"*=\":\n value *= rightValue;\n break;\n case \"/=\":\n value /= rightValue;\n break;\n case \"%=\":\n value %= rightValue;\n break;\n case \"<<=\":\n value <<= rightValue;\n break;\n case \">>=\":\n value >>= rightValue;\n break;\n case \">>>=\":\n value >>>= rightValue;\n break;\n case \"&=\":\n value &= rightValue;\n break;\n case \"^=\":\n value ^= rightValue;\n break;\n case \"|=\":\n value |= rightValue;\n break;\n default:\n throw SyntaxError(\"Unknown assignment expression: \" + node[\"operator\"]);\n }\n var setter = this.setValue(state.leftReference_, value);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = value;\n return this.createSetter_(setter, state.leftReference_, value);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBinaryExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n state.doneRight_ = true;\n state.leftValue_ = state.value;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n stack.pop();\n var leftValue = state.leftValue_;\n var rightValue = state.value;\n var value;\n switch (node[\"operator\"]) {\n case \"==\":\n value = leftValue == rightValue;\n break;\n case \"!=\":\n value = leftValue != rightValue;\n break;\n case \"===\":\n value = leftValue === rightValue;\n break;\n case \"!==\":\n value = leftValue !== rightValue;\n break;\n case \">\":\n value = leftValue > rightValue;\n break;\n case \">=\":\n value = leftValue >= rightValue;\n break;\n case \"<\":\n value = leftValue < rightValue;\n break;\n case \"<=\":\n value = leftValue <= rightValue;\n break;\n case \"+\":\n value = leftValue + rightValue;\n break;\n case \"-\":\n value = leftValue - rightValue;\n break;\n case \"*\":\n value = leftValue * rightValue;\n break;\n case \"/\":\n value = leftValue / rightValue;\n break;\n case \"%\":\n value = leftValue % rightValue;\n break;\n case \"&\":\n value = leftValue & rightValue;\n break;\n case \"|\":\n value = leftValue | rightValue;\n break;\n case \"^\":\n value = leftValue ^ rightValue;\n break;\n case \"<<\":\n value = leftValue << rightValue;\n break;\n case \">>\":\n value = leftValue >> rightValue;\n break;\n case \">>>\":\n value = leftValue >>> rightValue;\n break;\n case \"in\":\n if (!rightValue || !rightValue.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"'in' expects an object, not '\" + rightValue + \"'\", lineNum);\n }\n value = this.hasProperty(rightValue, leftValue);\n break;\n case \"instanceof\":\n if (!this.isa(rightValue, this.FUNCTION)) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"Right-hand side of instanceof is not an object\", lineNum);\n }\n value = leftValue.isObject ? this.isa(leftValue, rightValue) : false;\n break;\n default:\n throw SyntaxError(\"Unknown binary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBlockStatement\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepBreakStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.BREAK, undefined, label);\n};\n\nInterpreter.prototype[\"stepCallExpression\"] = function (stack, state, node) {\n if (!state.doneCallee_) {\n state.doneCallee_ = 1;\n // Components needed to determine value of 'this'.\n var nextState = new Interpreter.State(node[\"callee\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (state.doneCallee_ === 1) {\n // Determine value of the function.\n state.doneCallee_ = 2;\n var func = state.value;\n if (Array.isArray(func)) {\n state.func_ = this.getValue(func, node);\n if (func[0] === Interpreter.SCOPE_REFERENCE) {\n // (Globally or locally) named function. Is it named 'eval'?\n state.directEval_ = func[1] === \"eval\";\n } else {\n // Method function, 'this' is object (ignored if invoked as 'new').\n state.funcThis_ = func[0];\n }\n func = state.func_;\n if (func && typeof func === \"object\" && func.isGetter) {\n // Clear the getter flag and call the getter function.\n func.isGetter = false;\n state.doneCallee_ = 1;\n return this.createGetter_(/** @type {!Interpreter.Object} */ (func), state.value);\n }\n } else {\n // Already evaluated function: (function(){...})();\n state.func_ = func;\n }\n state.arguments_ = [];\n state.n_ = 0;\n }\n var func = state.func_;\n if (!state.doneArgs_) {\n if (state.n_ !== 0) {\n state.arguments_.push(state.value);\n }\n if (node[\"arguments\"][state.n_]) {\n return new Interpreter.State(node[\"arguments\"][state.n_++], state.scope);\n }\n // Determine value of 'this' in function.\n if (node[\"type\"] === \"NewExpression\") {\n if (func.illegalConstructor) {\n // Illegal: new escape();\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a constructor\", lineNum);\n }\n // Constructor, 'this' is new object.\n var proto = func.properties[\"prototype\"];\n if (typeof proto !== \"object\" || proto === null) {\n // Non-object prototypes default to Object.prototype.\n proto = this.OBJECT_PROTO;\n }\n state.funcThis_ = this.createObjectProto(proto);\n state.isConstructor = true;\n } else if (state.funcThis_ === undefined) {\n // Global function, 'this' is global object (or 'undefined' if strict).\n state.funcThis_ = state.scope.strict ? undefined : this.global;\n }\n state.doneArgs_ = true;\n }\n if (!state.doneExec_) {\n state.doneExec_ = true;\n if (!func || !func.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a function\", lineNum);\n }\n var funcNode = func.node;\n if (funcNode) {\n var scope = this.createScope(funcNode[\"body\"], func.parentScope);\n // Add all arguments.\n for (var i = 0; i < funcNode[\"params\"].length; i++) {\n var paramName = funcNode[\"params\"][i][\"name\"];\n var paramValue = state.arguments_.length > i ? state.arguments_[i] : undefined;\n this.setProperty(scope, paramName, paramValue);\n }\n // Build arguments variable.\n var argsList = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < state.arguments_.length; i++) {\n this.setProperty(argsList, i, state.arguments_[i]);\n }\n this.setProperty(scope, \"arguments\", argsList);\n // Add the function's name (var x = function foo(){};)\n var name = funcNode[\"id\"] && funcNode[\"id\"][\"name\"];\n if (name) {\n this.setProperty(scope, name, func);\n }\n this.setProperty(scope, \"this\", state.funcThis_, Interpreter.READONLY_DESCRIPTOR);\n state.value = undefined; // Default value if no explicit return.\n return new Interpreter.State(funcNode[\"body\"], scope);\n } else if (func.eval) {\n var code = state.arguments_[0];\n if (typeof code !== \"string\") {\n // JS does not parse String objects:\n // eval(new String('1 + 1')) -> '1 + 1'\n state.value = code;\n } else {\n try {\n var ast = acorn.parse(code.toString(), Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.SYNTAX_ERROR, \"Invalid code: \" + e.message, lineNum);\n }\n var evalNode = new this.nodeConstructor();\n evalNode[\"type\"] = \"EvalProgram_\";\n evalNode[\"body\"] = ast[\"body\"];\n this.stripLocations_(evalNode, node[\"start\"], node[\"end\"]);\n // Create new scope and update it with definitions in eval().\n var scope = state.directEval_ ? state.scope : this.global;\n if (scope.strict) {\n // Strict mode get its own scope in eval.\n scope = this.createScope(ast, scope);\n } else {\n // Non-strict mode pollutes the current scope.\n this.populateScope_(ast, scope);\n }\n this.value = undefined; // Default value if no code.\n return new Interpreter.State(evalNode, scope);\n }\n } else if (func.nativeFunc) {\n state.value = func.nativeFunc.apply(state.funcThis_, state.arguments_);\n } else if (func.asyncFunc) {\n var thisInterpreter = this;\n var callback = function (value) {\n state.value = value;\n thisInterpreter.paused_ = false;\n };\n var argsWithCallback = state.arguments_.concat(callback);\n this.paused_ = true;\n func.asyncFunc.apply(state.funcThis_, argsWithCallback);\n return;\n } else {\n /* A child of a function is a function but is not callable. For example:\n var F = function() {};\n F.prototype = escape;\n var f = new F();\n f();\n */\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func.class + \" is not a function\", lineNum);\n }\n } else {\n // Execution complete. Put the return value on the stack.\n stack.pop();\n if (state.isConstructor && typeof state.value !== \"object\") {\n stack[stack.length - 1].value = state.funcThis_;\n } else {\n stack[stack.length - 1].value = state.value;\n }\n }\n};\n\nInterpreter.prototype[\"stepCatchClause\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n // Create an empty scope.\n var scope = this.createSpecialScope(state.scope);\n // Add the argument.\n this.setProperty(scope, node[\"param\"][\"name\"], state.throwValue);\n // Execute catch clause.\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepConditionalExpression\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (mode === 1) {\n state.mode_ = 2;\n var value = Boolean(state.value);\n if (value && node[\"consequent\"]) {\n // Execute 'if' block.\n return new Interpreter.State(node[\"consequent\"], state.scope);\n } else if (!value && node[\"alternate\"]) {\n // Execute 'else' block.\n return new Interpreter.State(node[\"alternate\"], state.scope);\n }\n // eval('1;if(false){2}') -> undefined\n this.value = undefined;\n }\n stack.pop();\n if (node[\"type\"] === \"ConditionalExpression\") {\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepContinueStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.CONTINUE, undefined, label);\n};\n\nInterpreter.prototype[\"stepDebuggerStatement\"] = function (stack, state, node) {\n // Do nothing. May be overridden by developers.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepDoWhileStatement\"] = function (stack, state, node) {\n if (node[\"type\"] === \"DoWhileStatement\" && state.test_ === undefined) {\n // First iteration of do/while executes without checking test.\n state.value = true;\n state.test_ = true;\n }\n if (!state.test_) {\n state.test_ = true;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (!state.value) {\n // Done, exit loop.\n stack.pop();\n } else if (node[\"body\"]) {\n // Execute the body.\n state.test_ = false;\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepEmptyStatement\"] = function (stack, state, node) {\n stack.pop();\n};\n\nInterpreter.prototype[\"stepEvalProgram_\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = this.value;\n};\n\nInterpreter.prototype[\"stepExpressionStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"expression\"], state.scope);\n }\n stack.pop();\n // Save this value to interpreter.value for use as a return value if\n // this code is inside an eval function.\n this.value = state.value;\n};\n\nInterpreter.prototype[\"stepForInStatement\"] = function (stack, state, node) {\n // First, initialize a variable if exists. Only do so once, ever.\n if (!state.doneInit_) {\n state.doneInit_ = true;\n if (node[\"left\"][\"declarations\"] && node[\"left\"][\"declarations\"][0][\"init\"]) {\n if (state.scope.strict) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(\n this.SYNTAX_ERROR,\n \"for-in loop variable declaration may not have an initializer.\",\n lineNum,\n );\n }\n // Variable initialization: for (var x = 4 in y)\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n }\n // Second, look up the object. Only do so once, ever.\n if (!state.doneObject_) {\n state.doneObject_ = true;\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (!state.isLoop) {\n // First iteration.\n state.isLoop = true;\n state.object_ = state.value;\n state.visited_ = Object.create(null);\n }\n // Third, find the property name for this iteration.\n if (state.name_ === undefined) {\n gotPropName: while (true) {\n if (state.object_ && state.object_.isObject) {\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_.properties);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this object's properties.\n }\n if (!Object.prototype.hasOwnProperty.call(state.object_.properties, prop)) {\n continue; // Property has been deleted in the loop.\n }\n if (state.visited_[prop]) {\n continue; // Already seen this property on a child.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_.properties, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n } else if (state.object_ !== null && state.object_ !== undefined) {\n // Primitive value (other than null or undefined).\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this value's properties.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n }\n state.object_ = this.getPrototype(state.object_);\n state.props_ = null;\n if (state.object_ === null) {\n // Done, exit loop.\n stack.pop();\n return;\n }\n }\n }\n // Fourth, find the variable\n if (!state.doneVariable_) {\n state.doneVariable_ = true;\n var left = node[\"left\"];\n if (left[\"type\"] === \"VariableDeclaration\") {\n // Inline variable declaration: for (var x in y)\n state.variable_ = [Interpreter.SCOPE_REFERENCE, left[\"declarations\"][0][\"id\"][\"name\"]];\n } else {\n // Arbitrary left side: for (foo().bar in y)\n state.variable_ = null;\n var nextState = new Interpreter.State(left, state.scope);\n nextState.components = true;\n return nextState;\n }\n }\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n // Fifth, set the variable.\n if (!state.doneSetter_) {\n state.doneSetter_ = true;\n var value = state.name_;\n var setter = this.setValue(state.variable_, value);\n if (setter) {\n return this.createSetter_(setter, state.variable_, value);\n }\n }\n // Next step will be step three.\n state.name_ = undefined;\n // Reevaluate the variable since it could be a setter on the global object.\n state.doneVariable_ = false;\n state.doneSetter_ = false;\n // Sixth and finally, execute the body if there was one. this.\n if (node[\"body\"]) {\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepForStatement\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n if (node[\"init\"]) {\n return new Interpreter.State(node[\"init\"], state.scope);\n }\n } else if (mode === 1) {\n state.mode_ = 2;\n if (node[\"test\"]) {\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n } else if (mode === 2) {\n state.mode_ = 3;\n if (node[\"test\"] && !state.value) {\n // Done, exit loop.\n stack.pop();\n } else {\n // Execute the body.\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n } else if (mode === 3) {\n state.mode_ = 1;\n if (node[\"update\"]) {\n return new Interpreter.State(node[\"update\"], state.scope);\n }\n }\n};\n\nInterpreter.prototype[\"stepFunctionDeclaration\"] = function (stack, state, node) {\n // This was found and handled when the scope was populated.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepFunctionExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.createFunction(node, state.scope);\n};\n\nInterpreter.prototype[\"stepIdentifier\"] = function (stack, state, node) {\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [Interpreter.SCOPE_REFERENCE, node[\"name\"]];\n return;\n }\n var value = this.getValueFromScope(node[\"name\"], node);\n // An identifier could be a getter if it's a property on the global object.\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var scope = state.scope;\n while (!this.hasProperty(scope, node[\"name\"])) {\n scope = scope.parentScope;\n }\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, this.global);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepIfStatement\"] = Interpreter.prototype[\"stepConditionalExpression\"];\n\nInterpreter.prototype[\"stepLabeledStatement\"] = function (stack, state, node) {\n // No need to hit this node again on the way back up the stack.\n stack.pop();\n // Note that a statement might have multiple labels.\n var labels = state.labels || [];\n labels.push(node[\"label\"][\"name\"]);\n var nextState = new Interpreter.State(node[\"body\"], state.scope);\n nextState.labels = labels;\n return nextState;\n};\n\nInterpreter.prototype[\"stepLiteral\"] = function (stack, state, node) {\n stack.pop();\n var value = node[\"value\"];\n if (value instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, value);\n value = pseudoRegexp;\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepLogicalExpression\"] = function (stack, state, node) {\n if (node[\"operator\"] !== \"&&\" && node[\"operator\"] !== \"||\") {\n throw SyntaxError(\"Unknown logical operator: \" + node[\"operator\"]);\n }\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n if ((node[\"operator\"] === \"&&\" && !state.value) || (node[\"operator\"] === \"||\" && state.value)) {\n // Shortcut evaluation.\n stack.pop();\n stack[stack.length - 1].value = state.value;\n } else {\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n } else {\n stack.pop();\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepMemberExpression\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n }\n var propName;\n if (!node[\"computed\"]) {\n state.object_ = state.value;\n // obj.foo -- Just access 'foo' directly.\n propName = node[\"property\"][\"name\"];\n } else if (!state.doneProperty_) {\n state.object_ = state.value;\n // obj[foo] -- Compute value of 'foo'.\n state.doneProperty_ = true;\n return new Interpreter.State(node[\"property\"], state.scope);\n } else {\n propName = state.value;\n }\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [state.object_, propName];\n } else {\n var value = this.getProperty(state.object_, propName);\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, state.object_);\n }\n stack[stack.length - 1].value = value;\n }\n};\n\nInterpreter.prototype[\"stepNewExpression\"] = Interpreter.prototype[\"stepCallExpression\"];\n\nInterpreter.prototype[\"stepObjectExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var property = node[\"properties\"][n];\n if (!state.object_) {\n // First execution.\n state.object_ = this.createObjectProto(this.OBJECT_PROTO);\n state.properties_ = Object.create(null);\n } else {\n // Determine property name.\n var key = property[\"key\"];\n if (key[\"type\"] === \"Identifier\") {\n var propName = key[\"name\"];\n } else if (key[\"type\"] === \"Literal\") {\n var propName = key[\"value\"];\n } else {\n throw SyntaxError(\"Unknown object structure: \" + key[\"type\"]);\n }\n // Set the property computed in the previous execution.\n if (!state.properties_[propName]) {\n // Create temp object to collect value, getter, and/or setter.\n state.properties_[propName] = {};\n }\n state.properties_[propName][property[\"kind\"]] = state.value;\n state.n_ = ++n;\n property = node[\"properties\"][n];\n }\n if (property) {\n return new Interpreter.State(property[\"value\"], state.scope);\n }\n for (var key in state.properties_) {\n var kinds = state.properties_[key];\n if (\"get\" in kinds || \"set\" in kinds) {\n // Set a property with a getter or setter.\n var descriptor = {\n configurable: true,\n enumerable: true,\n get: kinds[\"get\"],\n set: kinds[\"set\"],\n };\n this.setProperty(state.object_, key, null, descriptor);\n } else {\n // Set a normal property with a value.\n this.setProperty(state.object_, key, kinds[\"init\"]);\n }\n }\n stack.pop();\n stack[stack.length - 1].value = state.object_;\n};\n\nInterpreter.prototype[\"stepProgram\"] = function (stack, state, node) {\n var expression = node[\"body\"].shift();\n if (expression) {\n state.done = false;\n return new Interpreter.State(expression, state.scope);\n }\n state.done = true;\n // Don't pop the stateStack.\n // Leave the root scope on the tree in case the program is appended to.\n};\n\nInterpreter.prototype[\"stepReturnStatement\"] = function (stack, state, node) {\n if (node[\"argument\"] && !state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n }\n this.unwind(Interpreter.Completion.RETURN, state.value, undefined);\n};\n\nInterpreter.prototype[\"stepSequenceExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"expressions\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = state.value;\n};\n\nInterpreter.prototype[\"stepSwitchStatement\"] = function (stack, state, node) {\n if (!state.test_) {\n state.test_ = 1;\n return new Interpreter.State(node[\"discriminant\"], state.scope);\n }\n if (state.test_ === 1) {\n state.test_ = 2;\n // Preserve switch value between case tests.\n state.switchValue_ = state.value;\n state.defaultCase_ = -1;\n }\n\n while (true) {\n var index = state.index_ || 0;\n var switchCase = node[\"cases\"][index];\n if (!state.matched_ && switchCase && !switchCase[\"test\"]) {\n // Test on the default case is null.\n // Bypass (but store) the default case, and get back to it later.\n state.defaultCase_ = index;\n state.index_ = index + 1;\n continue;\n }\n if (!switchCase && !state.matched_ && state.defaultCase_ !== -1) {\n // Ran through all cases, no match. Jump to the default.\n state.matched_ = true;\n state.index_ = state.defaultCase_;\n continue;\n }\n if (switchCase) {\n if (!state.matched_ && !state.tested_ && switchCase[\"test\"]) {\n state.tested_ = true;\n return new Interpreter.State(switchCase[\"test\"], state.scope);\n }\n if (state.matched_ || state.value === state.switchValue_) {\n state.matched_ = true;\n var n = state.n_ || 0;\n if (switchCase[\"consequent\"][n]) {\n state.isSwitch = true;\n state.n_ = n + 1;\n return new Interpreter.State(switchCase[\"consequent\"][n], state.scope);\n }\n }\n // Move on to next case.\n state.tested_ = false;\n state.n_ = 0;\n state.index_ = index + 1;\n } else {\n stack.pop();\n return;\n }\n }\n};\n\nInterpreter.prototype[\"stepThisExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.getValueFromScope(\"this\", node);\n};\n\nInterpreter.prototype[\"stepThrowStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n } else {\n this.throwException(state.value);\n }\n};\n\nInterpreter.prototype[\"stepTryStatement\"] = function (stack, state, node) {\n if (!state.doneBlock_) {\n state.doneBlock_ = true;\n return new Interpreter.State(node[\"block\"], state.scope);\n }\n if (state.cv && state.cv.type === Interpreter.Completion.THROW && !state.doneHandler_ && node[\"handler\"]) {\n state.doneHandler_ = true;\n var nextState = new Interpreter.State(node[\"handler\"], state.scope);\n nextState.throwValue = state.cv.value;\n state.cv = undefined; // This error has been handled, don't rethrow.\n return nextState;\n }\n if (!state.doneFinalizer_ && node[\"finalizer\"]) {\n state.doneFinalizer_ = true;\n return new Interpreter.State(node[\"finalizer\"], state.scope);\n }\n stack.pop();\n if (state.cv) {\n // There was no catch handler, or the catch/finally threw an error.\n // Throw the error up to a higher try.\n this.unwind(state.cv.type, state.cv.value, state.cv.label);\n }\n};\n\nInterpreter.prototype[\"stepUnaryExpression\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = node[\"operator\"] === \"delete\";\n return nextState;\n }\n stack.pop();\n var value = state.value;\n if (node[\"operator\"] === \"-\") {\n value = -value;\n } else if (node[\"operator\"] === \"+\") {\n value = +value;\n } else if (node[\"operator\"] === \"!\") {\n value = !value;\n } else if (node[\"operator\"] === \"~\") {\n value = ~value;\n } else if (node[\"operator\"] === \"delete\") {\n var result = true;\n // If value is not an array, then it is a primitive, or some other value.\n // If so, skip the delete and return true.\n if (Array.isArray(value)) {\n var obj = value[0];\n if (obj === Interpreter.SCOPE_REFERENCE) {\n // 'delete foo;' is the same as 'delete window.foo'.\n obj = state.scope;\n }\n var name = String(value[1]);\n try {\n delete obj.properties[name];\n } catch (e) {\n if (state.scope.strict) {\n this.throwException(this.TYPE_ERROR, \"Cannot delete property '\" + name + \"' of '\" + obj + \"'\");\n } else {\n result = false;\n }\n }\n }\n value = result;\n } else if (node[\"operator\"] === \"typeof\") {\n value = value && value.class === \"Function\" ? \"function\" : typeof value;\n } else if (node[\"operator\"] === \"void\") {\n value = undefined;\n } else {\n throw SyntaxError(\"Unknown unary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepUpdateExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.leftSide_) {\n state.leftSide_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_) {\n var leftValue = this.getValue(state.leftSide_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftSide_);\n }\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var leftValue = Number(state.leftValue_);\n var changeValue;\n if (node[\"operator\"] === \"++\") {\n changeValue = leftValue + 1;\n } else if (node[\"operator\"] === \"--\") {\n changeValue = leftValue - 1;\n } else {\n throw SyntaxError(\"Unknown update expression: \" + node[\"operator\"]);\n }\n var returnValue = node[\"prefix\"] ? changeValue : leftValue;\n var setter = this.setValue(state.leftSide_, changeValue);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = returnValue;\n return this.createSetter_(setter, state.leftSide_, changeValue);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = returnValue;\n};\n\nInterpreter.prototype[\"stepVariableDeclaration\"] = function (stack, state, node) {\n var declarations = node[\"declarations\"];\n var n = state.n_ || 0;\n var declarationNode = declarations[n];\n if (state.init_ && declarationNode) {\n // This setValue call never needs to deal with calling a setter function.\n // Note that this is setting the init value, not defining the variable.\n // Variable definition is done when scope is populated.\n this.setValueToScope(declarationNode[\"id\"][\"name\"], state.value);\n state.init_ = false;\n declarationNode = declarations[++n];\n }\n while (declarationNode) {\n // Skip any declarations that are not initialized. They have already\n // been defined as undefined in populateScope_.\n if (declarationNode[\"init\"]) {\n state.n_ = n;\n state.init_ = true;\n return new Interpreter.State(declarationNode[\"init\"], state.scope);\n }\n declarationNode = declarations[++n];\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepWithStatement\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n } else if (!state.doneBody_) {\n state.doneBody_ = true;\n var scope = this.createSpecialScope(state.scope, state.value);\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepWhileStatement\"] = Interpreter.prototype[\"stepDoWhileStatement\"];\n\n// Preserve top-level API functions from being pruned/renamed by JS compilers.\n// Add others as needed.\n// The global object ('window' in a browser, 'global' in node.js) is 'this'.\n//this['Interpreter'] = Interpreter;\nInterpreter.prototype[\"step\"] = Interpreter.prototype.step;\nInterpreter.prototype[\"run\"] = Interpreter.prototype.run;\nInterpreter.prototype[\"appendCode\"] = Interpreter.prototype.appendCode;\nInterpreter.prototype[\"createObject\"] = Interpreter.prototype.createObject;\nInterpreter.prototype[\"createObjectProto\"] = Interpreter.prototype.createObjectProto;\nInterpreter.prototype[\"createAsyncFunction\"] = Interpreter.prototype.createAsyncFunction;\nInterpreter.prototype[\"createNativeFunction\"] = Interpreter.prototype.createNativeFunction;\nInterpreter.prototype[\"getProperty\"] = Interpreter.prototype.getProperty;\nInterpreter.prototype[\"setProperty\"] = Interpreter.prototype.setProperty;\nInterpreter.prototype[\"nativeToPseudo\"] = Interpreter.prototype.nativeToPseudo;\nInterpreter.prototype[\"pseudoToNative\"] = Interpreter.prototype.pseudoToNative;\n// Obsolete. Do not use.\nInterpreter.prototype[\"createPrimitive\"] = function (x) {\n return x;\n};\n\nexport { Interpreter };\n","import $ from \"jquery\";\nimport { vsprintf, sprintf } from \"sprintf-js\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\nimport { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"./Constants\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"./Hacking\";\nimport { netscriptCanGrow, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\nimport { Terminal } from \"./Terminal\";\nimport { Player } from \"./Player\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Script } from \"./Script/Script\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { PromptEvent } from \"./ui/React/PromptManager\";\nimport { GetServer, DeleteServer, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport {\n getServerOnNetwork,\n numCycleForGrowth,\n numCycleForGrowthCorrected,\n processSingleServerGrowth,\n safetlyCreateUniqueServer,\n} from \"./Server/ServerHelpers\";\nimport { getPurchaseServerCost, getPurchaseServerLimit, getPurchaseServerMaxRam } from \"./Server/ServerPurchases\";\nimport { Server } from \"./Server/Server\";\nimport { influenceStockThroughServerGrow } from \"./StockMarket/PlayerInfluencing\";\nimport { isValidFilePath, removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { TextFile, getTextFile, createTextFile } from \"./TextFile\";\nimport { NetscriptPorts, runScriptFromScript } from \"./NetscriptWorker\";\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { helpers } from \"./Netscript/NetscriptHelpers\";\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { LogBoxEvents, LogBoxCloserEvents, LogBoxPositionEvents, LogBoxSizeEvents } from \"./ui/React/LogBoxManager\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { isString } from \"./utils/helpers/isString\";\nimport { NetscriptGang } from \"./NetscriptFunctions/Gang\";\nimport { NetscriptSleeve } from \"./NetscriptFunctions/Sleeve\";\nimport { NetscriptExtra } from \"./NetscriptFunctions/Extra\";\nimport { NetscriptHacknet } from \"./NetscriptFunctions/Hacknet\";\nimport { NetscriptStanek } from \"./NetscriptFunctions/Stanek\";\nimport { NetscriptInfiltration } from \"./NetscriptFunctions/Infiltration\";\nimport { NetscriptUserInterface } from \"./NetscriptFunctions/UserInterface\";\nimport { NetscriptBladeburner } from \"./NetscriptFunctions/Bladeburner\";\nimport { NetscriptCodingContract } from \"./NetscriptFunctions/CodingContract\";\nimport { NetscriptCorporation } from \"./NetscriptFunctions/Corporation\";\nimport { NetscriptFormulas } from \"./NetscriptFunctions/Formulas\";\nimport { NetscriptStockMarket } from \"./NetscriptFunctions/StockMarket\";\nimport { NetscriptGrafting } from \"./NetscriptFunctions/Grafting\";\nimport { IPort } from \"./NetscriptPort\";\nimport {\n NS,\n Player as INetscriptPlayer,\n RecentScript as IRecentScript,\n BasicHGWOptions,\n ProcessInfo,\n HackingMultipliers,\n HacknetMultipliers,\n BitNodeMultipliers as IBNMults,\n Server as IServerDef,\n RunningScript as IRunningScriptDef,\n} from \"./ScriptEditor/NetscriptDefinitions\";\nimport { NetscriptSingularity } from \"./NetscriptFunctions/Singularity\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\nimport { checkEnum } from \"./utils/helpers/checkEnum\";\n\nimport { Flags } from \"./NetscriptFunctions/Flags\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { CalculateShareMult, StartSharing } from \"./NetworkShare/Share\";\nimport { recentScripts } from \"./Netscript/RecentScripts\";\nimport { InternalAPI, NetscriptContext, wrapAPI } from \"./Netscript/APIWrapper\";\nimport { INetscriptExtra } from \"./NetscriptFunctions/Extra\";\n\nexport type NSFull = NS & INetscriptExtra;\n\nexport function NetscriptFunctions(workerScript: WorkerScript): NSFull {\n return wrapAPI(workerScript, ns, workerScript.args.slice());\n}\n\nconst base: InternalAPI = {\n args: [],\n enums: {\n toast: ToastVariant,\n },\n\n singularity: NetscriptSingularity(),\n gang: NetscriptGang(),\n bladeburner: NetscriptBladeburner(),\n codingcontract: NetscriptCodingContract(),\n sleeve: NetscriptSleeve(),\n corporation: NetscriptCorporation(),\n stanek: NetscriptStanek(),\n infiltration: NetscriptInfiltration(),\n ui: NetscriptUserInterface(),\n formulas: NetscriptFormulas(),\n stock: NetscriptStockMarket(),\n grafting: NetscriptGrafting(),\n hacknet: NetscriptHacknet(),\n sprintf: () => sprintf,\n vsprintf: () => vsprintf,\n scan:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): string[] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const out = [];\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const s = getServerOnNetwork(server, i);\n if (s === null) continue;\n const entry = s.hostname;\n if (entry === null) continue;\n out.push(entry);\n }\n helpers.log(ctx, () => `returned ${server.serversOnNetwork.length} connections for ${server.hostname}`);\n return out;\n },\n hack:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, { threads: requestedThreads, stock }: BasicHGWOptions = {}): Promise => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n return helpers.hack(ctx, hostname, false, { threads: requestedThreads, stock: stock });\n },\n hackAnalyzeThreads:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _hackAmount: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const hackAmount = helpers.number(ctx, \"hackAmount\", _hackAmount);\n\n // Check argument validity\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return -1;\n }\n if (isNaN(hackAmount)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid hackAmount argument passed into hackAnalyzeThreads: ${hackAmount}. Must be numeric.`,\n );\n }\n\n if (hackAmount < 0 || hackAmount > server.moneyAvailable) {\n return -1;\n } else if (hackAmount === 0) {\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n if (percentHacked === 0 || server.moneyAvailable === 0) {\n return 0; // To prevent returning infinity below\n }\n\n return hackAmount / Math.floor(server.moneyAvailable * percentHacked);\n },\n hackAnalyze:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculatePercentMoneyHacked(server, Player);\n },\n hackAnalyzeSecurity:\n (ctx: NetscriptContext) =>\n (_threads: unknown, _hostname?: unknown): number => {\n let threads = helpers.number(ctx, \"threads\", _threads);\n if (_hostname) {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n if (percentHacked > 0) {\n // thread count is limited to the maximum number of threads needed\n threads = Math.min(threads, Math.ceil(1 / percentHacked));\n }\n }\n\n return CONSTANTS.ServerFortifyAmount * threads;\n },\n hackAnalyzeChance:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculateHackingChance(server, Player);\n },\n sleep:\n (ctx: NetscriptContext) =>\n async (_time: unknown = 0): Promise => {\n const time = helpers.number(ctx, \"time\", _time);\n if (time === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);\n return helpers.netscriptDelay(ctx, time).then(function () {\n return Promise.resolve(true);\n });\n },\n asleep: (ctx: NetscriptContext) =>\n function (_time: unknown = 0): Promise {\n const time = helpers.number(ctx, \"time\", _time);\n helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);\n return new Promise((resolve) => setTimeout(() => resolve(true), time));\n },\n grow:\n (ctx: NetscriptContext) =>\n async (_hostname: unknown, { threads: requestedThreads, stock }: BasicHGWOptions = {}): Promise => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const threads = helpers.resolveNetscriptRequestedThreads(\n ctx,\n requestedThreads ?? ctx.workerScript.scriptRef.threads,\n );\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n const host = GetServer(ctx.workerScript.hostname);\n if (host === null) {\n throw new Error(\"Workerscript host is null\");\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanGrow(server);\n if (!canHack.res) {\n throw helpers.makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n const growTime = calculateGrowTime(server, Player);\n helpers.log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n growTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n return helpers.netscriptDelay(ctx, growTime * 1000).then(function () {\n const moneyBefore = server.moneyAvailable <= 0 ? 1 : server.moneyAvailable;\n processSingleServerGrowth(server, threads, Player, host.cpuCores);\n const moneyAfter = server.moneyAvailable;\n ctx.workerScript.scriptRef.recordGrow(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n const logGrowPercent = moneyAfter / moneyBefore - 1;\n helpers.log(\n ctx,\n () =>\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n logGrowPercent,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n ctx.workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n if (stock) {\n influenceStockThroughServerGrow(server, moneyAfter - moneyBefore);\n }\n return Promise.resolve(moneyAfter / moneyBefore);\n });\n },\n growthAnalyze:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _growth: unknown, _cores: unknown = 1): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const growth = helpers.number(ctx, \"growth\", _growth);\n const cores = helpers.number(ctx, \"cores\", _cores);\n\n // Check argument validity\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (typeof growth !== \"number\" || isNaN(growth) || growth < 1 || !isFinite(growth)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: growth must be numeric and >= 1, is ${growth}.`);\n }\n\n return numCycleForGrowth(server, Number(growth), Player, cores);\n },\n growthAnalyzeSecurity:\n (ctx: NetscriptContext) =>\n (_threads: unknown, _hostname?: unknown, _cores?: unknown): number => {\n let threads = helpers.number(ctx, \"threads\", _threads);\n if (_hostname) {\n const cores = helpers.number(ctx, \"cores\", _cores) || 1;\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const maxThreadsNeeded = Math.ceil(\n numCycleForGrowthCorrected(server, server.moneyMax, server.moneyAvailable, Player, cores),\n );\n\n threads = Math.min(threads, maxThreadsNeeded);\n }\n\n return 2 * CONSTANTS.ServerFortifyAmount * threads;\n },\n weaken:\n (ctx: NetscriptContext) =>\n async (_hostname: unknown, { threads: requestedThreads }: BasicHGWOptions = {}): Promise => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const threads = helpers.resolveNetscriptRequestedThreads(\n ctx,\n requestedThreads ?? ctx.workerScript.scriptRef.threads,\n );\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanWeaken(server);\n if (!canHack.res) {\n throw helpers.makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n const weakenTime = calculateWeakenTime(server, Player);\n helpers.log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n weakenTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return helpers.netscriptDelay(ctx, weakenTime * 1000).then(function () {\n const host = GetServer(ctx.workerScript.hostname);\n if (host === null) {\n helpers.log(ctx, () => \"Server is null, did it die?\");\n return Promise.resolve(0);\n }\n const coreBonus = 1 + (host.cpuCores - 1) / 16;\n server.weaken(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n ctx.workerScript.scriptRef.recordWeaken(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n helpers.log(\n ctx,\n () =>\n `'${server.hostname}' security level weakened to ${\n server.hackDifficulty\n }. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n ctx.workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n return Promise.resolve(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n });\n },\n weakenAnalyze:\n (ctx: NetscriptContext) =>\n (_threads: unknown, _cores: unknown = 1): number => {\n const threads = helpers.number(ctx, \"threads\", _threads);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const coreBonus = 1 + (cores - 1) / 16;\n return CONSTANTS.ServerWeakenAmount * threads * coreBonus * BitNodeMultipliers.ServerWeakenRate;\n },\n share: (ctx: NetscriptContext) => async (): Promise => {\n helpers.log(ctx, () => \"Sharing this computer.\");\n const end = StartSharing(\n ctx.workerScript.scriptRef.threads * calculateIntelligenceBonus(Player.skills.intelligence, 2),\n );\n return helpers.netscriptDelay(ctx, 10000).finally(function () {\n helpers.log(ctx, () => \"Finished sharing this computer.\");\n end();\n });\n },\n getSharePower: () => (): number => {\n return CalculateShareMult();\n },\n print:\n (ctx: NetscriptContext) =>\n (...args: unknown[]): void => {\n if (args.length === 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes at least 1 argument.\");\n }\n ctx.workerScript.print(helpers.argsToString(args));\n },\n printf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: unknown[]): void => {\n const format = helpers.string(ctx, \"format\", _format);\n if (typeof format !== \"string\") {\n throw helpers.makeRuntimeErrorMsg(ctx, \"First argument must be string for the format.\");\n }\n ctx.workerScript.print(vsprintf(format, args));\n },\n tprint:\n (ctx: NetscriptContext) =>\n (...args: unknown[]): void => {\n if (args.length === 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes at least 1 argument.\");\n }\n const str = helpers.argsToString(args);\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n Terminal.print(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n },\n tprintf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: unknown[]): void => {\n const format = helpers.string(ctx, \"format\", _format);\n const str = vsprintf(format, args);\n\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${str}`);\n return;\n }\n Terminal.print(`${str}`);\n },\n clearLog: (ctx: NetscriptContext) => (): void => {\n ctx.workerScript.scriptRef.clearLog();\n },\n disableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n ctx.workerScript.disableLogs[fn] = true;\n }\n helpers.log(ctx, () => `Disabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n } else {\n ctx.workerScript.disableLogs[fn] = true;\n helpers.log(ctx, () => `Disabled logging for ${fn}`);\n }\n },\n enableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n delete ctx.workerScript.disableLogs[fn];\n }\n helpers.log(ctx, () => `Enabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n }\n delete ctx.workerScript.disableLogs[fn];\n helpers.log(ctx, () => `Enabled logging for ${fn}`);\n },\n isLogEnabled:\n (ctx: NetscriptContext) =>\n (_fn: unknown): boolean => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n }\n return !ctx.workerScript.disableLogs[fn];\n },\n getScriptLogs:\n (ctx: NetscriptContext) =>\n (scriptID: unknown, hostname: unknown, ...scriptArgs: unknown[]): string[] => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n const runningScriptObj = helpers.getRunningScript(ctx, ident);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return [];\n }\n\n return runningScriptObj.logs.slice();\n },\n tail:\n (ctx: NetscriptContext) =>\n (scriptID: unknown, hostname: unknown, ...scriptArgs: unknown[]): void => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n const runningScriptObj = helpers.getRunningScript(ctx, ident);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return;\n }\n\n LogBoxEvents.emit(runningScriptObj);\n },\n moveTail:\n (ctx: NetscriptContext) =>\n (_x: unknown, _y: unknown, _pid: unknown = ctx.workerScript.scriptRef.pid) => {\n const x = helpers.number(ctx, \"x\", _x);\n const y = helpers.number(ctx, \"y\", _y);\n const pid = helpers.number(ctx, \"pid\", _pid);\n LogBoxPositionEvents.emit({ pid, data: { x, y } });\n },\n resizeTail:\n (ctx: NetscriptContext) =>\n (_w: unknown, _h: unknown, _pid: unknown = ctx.workerScript.scriptRef.pid) => {\n const w = helpers.number(ctx, \"w\", _w);\n const h = helpers.number(ctx, \"h\", _h);\n const pid = helpers.number(ctx, \"pid\", _pid);\n LogBoxSizeEvents.emit({ pid, data: { w, h } });\n },\n closeTail:\n (ctx: NetscriptContext) =>\n (_pid: unknown = ctx.workerScript.scriptRef.pid): void => {\n const pid = helpers.number(ctx, \"pid\", _pid);\n //Emit an event to tell the game to close the tail window if it exists\n LogBoxCloserEvents.emit(pid);\n },\n nuke:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (server.hasAdminRights) {\n helpers.log(ctx, () => `Already have root access to '${server.hostname}'.`);\n return true;\n }\n if (!Player.hasProgram(Programs.NukeProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the NUKE.exe virus!\");\n }\n if (server.openPortCount < server.numOpenPortsRequired) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Not enough ports opened to use NUKE.exe virus.\");\n }\n server.hasAdminRights = true;\n helpers.log(ctx, () => `Executed NUKE.exe virus on '${server.hostname}' to gain root access.`);\n return true;\n },\n brutessh:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.BruteSSHProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the BruteSSH.exe program!\");\n }\n if (!server.sshPortOpen) {\n helpers.log(ctx, () => `Executed BruteSSH.exe on '${server.hostname}' to open SSH port (22).`);\n server.sshPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SSH Port (22) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n ftpcrack:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.FTPCrackProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the FTPCrack.exe program!\");\n }\n if (!server.ftpPortOpen) {\n helpers.log(ctx, () => `Executed FTPCrack.exe on '${server.hostname}' to open FTP port (21).`);\n server.ftpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `FTP Port (21) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n relaysmtp:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.RelaySMTPProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the relaySMTP.exe program!\");\n }\n if (!server.smtpPortOpen) {\n helpers.log(ctx, () => `Executed relaySMTP.exe on '${server.hostname}' to open SMTP port (25).`);\n server.smtpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SMTP Port (25) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n httpworm:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.HTTPWormProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the HTTPWorm.exe program!\");\n }\n if (!server.httpPortOpen) {\n helpers.log(ctx, () => `Executed HTTPWorm.exe on '${server.hostname}' to open HTTP port (80).`);\n server.httpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `HTTP Port (80) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n sqlinject:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.SQLInjectProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the SQLInject.exe program!\");\n }\n if (!server.sqlPortOpen) {\n helpers.log(ctx, () => `Executed SQLInject.exe on '${server.hostname}' to open SQL port (1433).`);\n server.sqlPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SQL Port (1433) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n run:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _threads: unknown = 1, ..._args: unknown[]): number => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (scriptname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: run(scriptname, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev.\");\n }\n\n return runScriptFromScript(\"run\", scriptServer, scriptname, args, ctx.workerScript, threads);\n },\n exec:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown, _threads: unknown = 1, ..._args: unknown[]): number => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (scriptname === undefined || hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const server = helpers.getServer(ctx, hostname);\n return runScriptFromScript(\"exec\", server, scriptname, args, ctx.workerScript, threads);\n },\n spawn:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _threads: unknown = 1, ..._args: unknown[]): void => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (!scriptname || !threads) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: spawn(scriptname, threads)\");\n }\n\n const spawnDelay = 10;\n setTimeout(() => {\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev\");\n }\n\n return runScriptFromScript(\"spawn\", scriptServer, scriptname, args, ctx.workerScript, threads);\n }, spawnDelay * 1e3);\n\n helpers.log(ctx, () => `Will execute '${scriptname}' in ${spawnDelay} seconds`);\n\n if (killWorkerScript(ctx.workerScript)) {\n helpers.log(ctx, () => \"Exiting...\");\n }\n },\n kill:\n (ctx: NetscriptContext) =>\n (scriptID: unknown, hostname: unknown, ...scriptArgs: unknown[]): boolean => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n let res;\n const killByPid = typeof ident === \"number\";\n if (killByPid) {\n // Kill by pid\n res = killWorkerScript(ident);\n } else {\n // Kill by filename/hostname\n if (scriptID === undefined || hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: kill(scriptname, server, [arg1], [arg2]...)\");\n }\n\n const server = helpers.getServer(ctx, ident.hostname);\n const runningScriptObj = helpers.getRunningScriptByArgs(ctx, ident.scriptname, ident.hostname, ident.args);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return false;\n }\n\n res = killWorkerScript({ runningScript: runningScriptObj, hostname: server.hostname });\n }\n\n if (res) {\n if (killByPid) {\n helpers.log(ctx, () => `Killing script with PID ${ident}`);\n } else {\n helpers.log(ctx, () => `Killing '${scriptID}' on '${hostname}' with args: ${arrayToString(scriptArgs)}.`);\n }\n return true;\n } else {\n if (killByPid) {\n helpers.log(ctx, () => `No script with PID ${ident}`);\n } else {\n helpers.log(\n ctx,\n () => `No such script '${scriptID}' on '${hostname}' with args: ${arrayToString(scriptArgs)}`,\n );\n }\n return false;\n }\n },\n killall:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname, _safetyguard: unknown = true): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const safetyguard = !!_safetyguard;\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: killall(hostname, [safetyguard boolean])\");\n }\n const server = helpers.getServer(ctx, hostname);\n\n let scriptsKilled = 0;\n\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n if (safetyguard === true && server.runningScripts[i].pid == ctx.workerScript.pid) continue;\n killWorkerScript({ runningScript: server.runningScripts[i], hostname: server.hostname });\n ++scriptsKilled;\n }\n WorkerScriptStartStopEventEmitter.emit();\n helpers.log(\n ctx,\n () => `Killing all scripts on '${server.hostname}'. May take a few minutes for the scripts to die.`,\n );\n\n return scriptsKilled > 0;\n },\n exit: (ctx: NetscriptContext) => (): void => {\n if (killWorkerScript(ctx.workerScript)) {\n helpers.log(ctx, () => \"Exiting...\");\n } else {\n helpers.log(ctx, () => \"Failed. This is a bug. Report to dev.\");\n }\n },\n scp:\n (ctx: NetscriptContext) =>\n (_files: unknown, _destination: unknown, _source: unknown = ctx.workerScript.hostname): boolean => {\n const destination = helpers.string(ctx, \"destination\", _destination);\n const source = helpers.string(ctx, \"source\", _source);\n const destServer = helpers.getServer(ctx, destination);\n const sourceServ = helpers.getServer(ctx, source);\n const files = Array.isArray(_files) ? _files : [_files];\n\n //First loop through filenames to find all errors before moving anything.\n for (const file of files) {\n // Not a string\n if (typeof file !== \"string\")\n throw helpers.makeRuntimeErrorMsg(ctx, \"files should be a string or an array of strings.\");\n\n // Invalid file name\n if (!isValidFilePath(file)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${file}'`);\n\n // Invalid file type\n if (!file.endsWith(\".lit\") && !isScriptFilename(file) && !file.endsWith(\"txt\")) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Only works for scripts, .lit and .txt files.\");\n }\n }\n\n let noFailures = true;\n //ts detects files as any[] here even though we would have thrown in the above loop if it wasn't string[]\n for (const file of files as string[]) {\n // Scp for lit files\n if (file.endsWith(\".lit\")) {\n const sourceMessage = sourceServ.messages.find((message) => message === file);\n if (!sourceMessage) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n const destMessage = destServer.messages.find((message) => message === file);\n if (destMessage) {\n helpers.log(ctx, () => `File '${file}' was already on '${destServer?.hostname}'.`);\n continue;\n }\n\n destServer.messages.push(file);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n continue;\n }\n\n // Scp for text files\n if (file.endsWith(\".txt\")) {\n const sourceTextFile = sourceServ.textFiles.find((textFile) => textFile.fn === file);\n if (!sourceTextFile) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n const destTextFile = destServer.textFiles.find((textFile) => textFile.fn === file);\n if (destTextFile) {\n destTextFile.text = sourceTextFile.text;\n helpers.log(ctx, () => `File '${file}' overwritten on '${destServer?.hostname}'.`);\n continue;\n }\n\n const newFile = new TextFile(sourceTextFile.fn, sourceTextFile.text);\n destServer.textFiles.push(newFile);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n continue;\n }\n\n // Scp for script files\n const sourceScript = sourceServ.scripts.find((script) => script.filename === file);\n if (!sourceScript) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n // Overwrite script if it already exists\n const destScript = destServer.scripts.find((script) => script.filename === file);\n if (destScript) {\n if (destScript.code === sourceScript.code) {\n helpers.log(ctx, () => `Identical file '${file}' was already on '${destServer?.hostname}'`);\n continue;\n }\n destScript.code = sourceScript.code;\n destScript.ramUsage = destScript.ramUsage;\n destScript.markUpdated();\n helpers.log(ctx, () => `WARNING: File '${file}' overwritten on '${destServer?.hostname}'`);\n continue;\n }\n\n // Create new script if it does not already exist\n const newScript = new Script(Player, file);\n newScript.code = sourceScript.code;\n newScript.ramUsage = sourceScript.ramUsage;\n newScript.server = destServer.hostname;\n destServer.scripts.push(newScript);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n newScript.updateRamUsage(Player, destServer.scripts);\n }\n\n return noFailures;\n },\n ls:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _grep: unknown = \"\"): string[] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const grep = helpers.string(ctx, \"grep\", _grep);\n\n const server = helpers.getServer(ctx, hostname);\n\n // Get the grep filter, if one exists\n let filter = \"\";\n if (_grep !== undefined) {\n filter = grep.toString();\n }\n\n const allFiles = [];\n for (let i = 0; i < server.programs.length; i++) {\n if (filter) {\n if (server.programs[i].includes(filter)) {\n allFiles.push(server.programs[i]);\n }\n } else {\n allFiles.push(server.programs[i]);\n }\n }\n for (let i = 0; i < server.scripts.length; i++) {\n if (filter) {\n if (server.scripts[i].filename.includes(filter)) {\n allFiles.push(server.scripts[i].filename);\n }\n } else {\n allFiles.push(server.scripts[i].filename);\n }\n }\n for (let i = 0; i < server.messages.length; i++) {\n if (filter) {\n const msg = server.messages[i];\n if (msg.includes(filter)) {\n allFiles.push(msg);\n }\n } else {\n allFiles.push(server.messages[i]);\n }\n }\n\n for (let i = 0; i < server.textFiles.length; i++) {\n if (filter) {\n if (server.textFiles[i].fn.includes(filter)) {\n allFiles.push(server.textFiles[i].fn);\n }\n } else {\n allFiles.push(server.textFiles[i].fn);\n }\n }\n\n for (let i = 0; i < server.contracts.length; ++i) {\n if (filter) {\n if (server.contracts[i].fn.includes(filter)) {\n allFiles.push(server.contracts[i].fn);\n }\n } else {\n allFiles.push(server.contracts[i].fn);\n }\n }\n\n // Sort the files alphabetically then print each\n allFiles.sort();\n return allFiles;\n },\n getRecentScripts: () => (): IRecentScript[] => {\n return recentScripts.map((rs) => ({\n timeOfDeath: rs.timeOfDeath,\n ...helpers.createPublicRunningScript(rs.runningScript),\n }));\n },\n ps:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): ProcessInfo[] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const processes = [];\n for (const script of server.runningScripts) {\n processes.push({\n filename: script.filename,\n threads: script.threads,\n args: script.args.slice(),\n pid: script.pid,\n });\n }\n return processes;\n },\n hasRootAccess:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n return server.hasAdminRights;\n },\n getHostname: (ctx: NetscriptContext) => (): string => {\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev.\");\n }\n return scriptServer.hostname;\n },\n getHackingLevel: (ctx: NetscriptContext) => (): number => {\n Player.updateSkillLevels();\n helpers.log(ctx, () => `returned ${Player.skills.hacking}`);\n return Player.skills.hacking;\n },\n getHackingMultipliers: () => (): HackingMultipliers => {\n return {\n chance: Player.mults.hacking_chance,\n speed: Player.mults.hacking_speed,\n money: Player.mults.hacking_money,\n growth: Player.mults.hacking_grow,\n };\n },\n getHacknetMultipliers: () => (): HacknetMultipliers => {\n return {\n production: Player.mults.hacknet_node_money,\n purchaseCost: Player.mults.hacknet_node_purchase_cost,\n ramCost: Player.mults.hacknet_node_ram_cost,\n coreCost: Player.mults.hacknet_node_core_cost,\n levelCost: Player.mults.hacknet_node_level_cost,\n };\n },\n getBitNodeMultipliers: (ctx: NetscriptContext) => (): IBNMults => {\n if (Player.sourceFileLvl(5) <= 0 && Player.bitNodeN !== 5) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Requires Source-File 5 to run.\");\n }\n const copy = Object.assign({}, BitNodeMultipliers);\n return copy;\n },\n getServer:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): IServerDef => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const copy = Object.assign({}, server) as Server;\n // These fields should be hidden.\n copy.contracts = [];\n copy.messages = [];\n copy.runningScripts = [];\n copy.scripts = [];\n copy.textFiles = [];\n copy.programs = [];\n copy.serversOnNetwork = [];\n if (!copy.baseDifficulty) copy.baseDifficulty = 0;\n if (!copy.hackDifficulty) copy.hackDifficulty = 0;\n if (!copy.minDifficulty) copy.minDifficulty = 0;\n if (!copy.moneyAvailable) copy.moneyAvailable = 0;\n if (!copy.moneyMax) copy.moneyMax = 0;\n if (!copy.numOpenPortsRequired) copy.numOpenPortsRequired = 0;\n if (!copy.openPortCount) copy.openPortCount = 0;\n if (!copy.requiredHackingSkill) copy.requiredHackingSkill = 0;\n if (!copy.serverGrowth) copy.serverGrowth = 0;\n return copy;\n },\n getServerMoneyAvailable:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerMoneyAvailable\")) {\n return 0;\n }\n if (server.hostname == \"home\") {\n // Return player's money\n helpers.log(ctx, () => `returned player's money: ${numeralWrapper.formatMoney(Player.money)}`);\n return Player.money;\n }\n helpers.log(ctx, () => `returned ${numeralWrapper.formatMoney(server.moneyAvailable)} for '${server.hostname}'`);\n return server.moneyAvailable;\n },\n getServerSecurityLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerSecurityLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.hackDifficulty)} for '${server.hostname}'`,\n );\n return server.hackDifficulty;\n },\n getServerBaseSecurityLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n helpers.log(ctx, () => `getServerBaseSecurityLevel is deprecated because it's not useful.`);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerBaseSecurityLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.baseDifficulty)} for '${server.hostname}'`,\n );\n return server.baseDifficulty;\n },\n getServerMinSecurityLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerMinSecurityLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.minDifficulty)} for ${server.hostname}`,\n );\n return server.minDifficulty;\n },\n getServerRequiredHackingLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerRequiredHackingLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatSkill(server.requiredHackingSkill)} for '${server.hostname}'`,\n );\n return server.requiredHackingSkill;\n },\n getServerMaxMoney:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerMaxMoney\")) {\n return 0;\n }\n helpers.log(ctx, () => `returned ${numeralWrapper.formatMoney(server.moneyMax)} for '${server.hostname}'`);\n return server.moneyMax;\n },\n getServerGrowth:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerGrowth\")) {\n return 1;\n }\n helpers.log(ctx, () => `returned ${server.serverGrowth} for '${server.hostname}'`);\n return server.serverGrowth;\n },\n getServerNumPortsRequired:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 5;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerNumPortsRequired\")) {\n return 5;\n }\n helpers.log(ctx, () => `returned ${server.numOpenPortsRequired} for '${server.hostname}'`);\n return server.numOpenPortsRequired;\n },\n getServerRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): [number, number] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n helpers.log(ctx, () => `getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam`);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(\n ctx,\n () => `returned [${numeralWrapper.formatRAM(server.maxRam)}, ${numeralWrapper.formatRAM(server.ramUsed)}]`,\n );\n return [server.maxRam, server.ramUsed];\n },\n getServerMaxRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(ctx, () => `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(ctx, () => `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n return GetServer(hostname) !== null;\n },\n fileExists:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): boolean => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (filename === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: fileExists(scriptname, [server])\");\n }\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.scripts.length; ++i) {\n if (filename == server.scripts[i].filename) {\n return true;\n }\n }\n for (let i = 0; i < server.programs.length; ++i) {\n if (filename.toLowerCase() == server.programs[i].toLowerCase()) {\n return true;\n }\n }\n for (let i = 0; i < server.messages.length; ++i) {\n if (filename.toLowerCase() === server.messages[i].toLowerCase()) {\n return true;\n }\n }\n const txtFile = getTextFile(filename, server);\n return txtFile != null;\n },\n isRunning:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...scriptArgs: unknown[]): boolean => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, scriptArgs);\n return helpers.getRunningScript(ctx, ident) !== null;\n },\n getPurchasedServerLimit: () => (): number => {\n return getPurchaseServerLimit();\n },\n getPurchasedServerMaxRam: () => (): number => {\n return getPurchaseServerMaxRam();\n },\n getPurchasedServerCost:\n (ctx: NetscriptContext) =>\n (_ram: unknown): number => {\n const ram = helpers.number(ctx, \"ram\", _ram);\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}'`);\n return Infinity;\n }\n\n return cost;\n },\n purchaseServer:\n (ctx: NetscriptContext) =>\n (_name: unknown, _ram: unknown): string => {\n const name = helpers.string(ctx, \"name\", _name);\n const ram = helpers.number(ctx, \"ram\", _ram);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s+/g, \"\");\n if (hostnameStr == \"\") {\n helpers.log(ctx, () => `Invalid argument: hostname='${hostnameStr}'`);\n return \"\";\n }\n\n if (Player.purchasedServers.length >= getPurchaseServerLimit()) {\n helpers.log(\n ctx,\n () =>\n `You have reached the maximum limit of ${getPurchaseServerLimit()} servers. You cannot purchase any more.`,\n );\n return \"\";\n }\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n if (ram > getPurchaseServerMaxRam()) {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`);\n } else {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}' must be a positive power of 2`);\n }\n\n return \"\";\n }\n\n if (Player.money < cost) {\n helpers.log(ctx, () => `Not enough money to purchase server. Need ${numeralWrapper.formatMoney(cost)}`);\n return \"\";\n }\n const newServ = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: hostnameStr,\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: true,\n purchasedByPlayer: true,\n maxRam: ram,\n });\n AddToAllServers(newServ);\n\n Player.purchasedServers.push(newServ.hostname);\n const homeComputer = Player.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.hostname);\n newServ.serversOnNetwork.push(homeComputer.hostname);\n Player.loseMoney(cost, \"servers\");\n helpers.log(\n ctx,\n () => `Purchased new server with hostname '${newServ.hostname}' for ${numeralWrapper.formatMoney(cost)}`,\n );\n return newServ.hostname;\n },\n deleteServer:\n (ctx: NetscriptContext) =>\n (_name: unknown): boolean => {\n const name = helpers.string(ctx, \"name\", _name);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s\\s+/g, \"\");\n const server = GetServer(hostnameStr);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => `Invalid argument: hostname='${hostnameStr}'`);\n return false;\n }\n\n if (!server.purchasedByPlayer || server.hostname === \"home\") {\n helpers.log(ctx, () => \"Cannot delete non-purchased server.\");\n return false;\n }\n\n const hostname = server.hostname;\n\n // Can't delete server you're currently connected to\n if (server.isConnectedTo) {\n helpers.log(ctx, () => \"You are currently connected to the server you are trying to delete.\");\n return false;\n }\n\n // A server cannot delete itself\n if (hostname === ctx.workerScript.hostname) {\n helpers.log(ctx, () => \"Cannot delete the server this script is running on.\");\n return false;\n }\n\n // Delete all scripts running on server\n if (server.runningScripts.length > 0) {\n helpers.log(ctx, () => `Cannot delete server '${hostname}' because it still has scripts running.`);\n return false;\n }\n\n // Delete from player's purchasedServers array\n let found = false;\n for (let i = 0; i < Player.purchasedServers.length; ++i) {\n if (hostname == Player.purchasedServers[i]) {\n found = true;\n Player.purchasedServers.splice(i, 1);\n break;\n }\n }\n\n if (!found) {\n helpers.log(\n ctx,\n () => `Could not identify server ${hostname} as a purchased server. This is a bug. Report to dev.`,\n );\n return false;\n }\n\n // Delete from all servers\n DeleteServer(hostname);\n\n // Delete from home computer\n found = false;\n const homeComputer = Player.getHomeComputer();\n for (let i = 0; i < homeComputer.serversOnNetwork.length; ++i) {\n if (hostname == homeComputer.serversOnNetwork[i]) {\n homeComputer.serversOnNetwork.splice(i, 1);\n helpers.log(ctx, () => `Deleted server '${hostnameStr}`);\n return true;\n }\n }\n // Wasn't found on home computer\n helpers.log(ctx, () => `Could not find server ${hostname} as a purchased server. This is a bug. Report to dev.`);\n return false;\n },\n getPurchasedServers: () => (): string[] => {\n const res: string[] = [];\n Player.purchasedServers.forEach(function (hostname) {\n res.push(hostname);\n });\n return res;\n },\n writePort:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: unknown = \"\"): Promise => {\n const port = helpers.number(ctx, \"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\n const iport = helpers.getValidPort(ctx, port);\n return Promise.resolve(iport.write(data));\n },\n write:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _data: unknown = \"\", _mode: unknown = \"a\"): void => {\n let fn = helpers.string(ctx, \"handle\", _filename);\n const data = helpers.string(ctx, \"data\", _data);\n const mode = helpers.string(ctx, \"mode\", _mode);\n if (!isValidFilePath(fn)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filepath: ${fn}`);\n\n if (fn.lastIndexOf(\"/\") === 0) fn = removeLeadingSlash(fn);\n\n const server = helpers.getServer(ctx, ctx.workerScript.hostname);\n\n if (isScriptFilename(fn)) {\n // Write to script\n let script = ctx.workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n // Create a new script\n script = new Script(Player, fn, String(data), server.hostname, server.scripts);\n server.scripts.push(script);\n return script.updateRamUsage(Player, server.scripts);\n }\n mode === \"w\" ? (script.code = String(data)) : (script.code += data);\n return script.updateRamUsage(Player, server.scripts);\n } else {\n // Write to text file\n if (!fn.endsWith(\".txt\")) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: ${fn}`);\n const txtFile = getTextFile(fn, server);\n if (txtFile == null) {\n createTextFile(fn, String(data), server);\n return;\n }\n if (mode === \"w\") {\n txtFile.write(String(data));\n } else {\n txtFile.append(String(data));\n }\n }\n return;\n },\n tryWritePort:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: unknown = \"\"): Promise => {\n let port = helpers.number(ctx, \"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\n if (!isNaN(port)) {\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid port: ${port}. Only ports 1-${CONSTANTS.NumNetscriptPorts} are valid.`,\n );\n }\n const iport = NetscriptPorts[port - 1];\n if (iport == null || !(iport instanceof Object)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return Promise.resolve(iport.tryWrite(data));\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${port}`);\n }\n },\n readPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): unknown => {\n const port = helpers.number(ctx, \"port\", _port);\n // Read from port\n const iport = helpers.getValidPort(ctx, port);\n const x = iport.read();\n return x;\n },\n read:\n (ctx: NetscriptContext) =>\n (_filename: unknown): string => {\n const fn = helpers.string(ctx, \"filename\", _filename);\n const server = GetServer(ctx.workerScript.hostname);\n if (server == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Read from script\n const script = ctx.workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n return \"\";\n }\n return script.code;\n } else {\n // Read from text file\n const txtFile = getTextFile(fn, server);\n if (txtFile !== null) {\n return txtFile.text;\n } else {\n return \"\";\n }\n }\n },\n peek:\n (ctx: NetscriptContext) =>\n (_port: unknown): unknown => {\n const port = helpers.number(ctx, \"port\", _port);\n const iport = helpers.getValidPort(ctx, port);\n const x = iport.peek();\n return x;\n },\n clear:\n (ctx: NetscriptContext) =>\n (_file: unknown): void => {\n const file = helpers.string(ctx, \"file\", _file);\n if (isString(file)) {\n // Clear text file\n const fn = file;\n const server = GetServer(ctx.workerScript.hostname);\n if (server == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Error getting Server. This is a bug. Report to dev.\");\n }\n const txtFile = getTextFile(fn, server);\n if (txtFile != null) {\n txtFile.write(\"\");\n }\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${file}`);\n }\n },\n clearPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): void => {\n const port = helpers.number(ctx, \"port\", _port);\n // Clear port\n const iport = helpers.getValidPort(ctx, port);\n iport.clear();\n },\n getPortHandle:\n (ctx: NetscriptContext) =>\n (_port: unknown): IPort => {\n const port = helpers.number(ctx, \"port\", _port);\n const iport = helpers.getValidPort(ctx, port);\n return iport;\n },\n rm:\n (ctx: NetscriptContext) =>\n (_fn: unknown, _hostname: unknown = ctx.workerScript.hostname): boolean => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const s = helpers.getServer(ctx, hostname);\n\n const status = s.removeFile(fn);\n if (!status.res) {\n helpers.log(ctx, () => status.msg + \"\");\n }\n\n return status.res;\n },\n scriptRunning:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown): boolean => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename == scriptname) {\n return true;\n }\n }\n return false;\n },\n scriptKill:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown): boolean => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n let suc = false;\n for (let i = 0; i < server.runningScripts.length; i++) {\n if (server.runningScripts[i].filename == scriptname) {\n killWorkerScript({ runningScript: server.runningScripts[i], hostname: server.hostname });\n suc = true;\n i--;\n }\n }\n return suc;\n },\n getScriptName: (ctx: NetscriptContext) => (): string => {\n return ctx.workerScript.name;\n },\n getScriptRam:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown = ctx.workerScript.hostname): number => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename == scriptname) {\n return server.scripts[i].ramUsage;\n }\n }\n return 0;\n },\n getRunningScript:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...args: unknown[]): IRunningScriptDef | null => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript === null) return null;\n return helpers.createPublicRunningScript(runningScript);\n },\n getHackTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getHackTime\")) {\n return Infinity;\n }\n\n return calculateHackingTime(server, Player) * 1000;\n },\n getGrowTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getGrowTime\")) {\n return Infinity;\n }\n\n return calculateGrowTime(server, Player) * 1000;\n },\n getWeakenTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getWeakenTime\")) {\n return Infinity;\n }\n\n return calculateWeakenTime(server, Player) * 1000;\n },\n getTotalScriptIncome: () => (): [number, number] => {\n // First element is total income of all currently running scripts\n let total = 0;\n for (const script of workerScripts.values()) {\n total += script.scriptRef.onlineMoneyMade / script.scriptRef.onlineRunningTime;\n }\n\n return [total, Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000)];\n },\n getScriptIncome:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...args: unknown[]): number => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return -1;\n }\n return runningScript.onlineMoneyMade / runningScript.onlineRunningTime;\n },\n getTotalScriptExpGain: () => (): number => {\n let total = 0;\n for (const ws of workerScripts.values()) {\n total += ws.scriptRef.onlineExpGained / ws.scriptRef.onlineRunningTime;\n }\n return total;\n },\n getScriptExpGain:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...args: unknown[]): number => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return -1;\n }\n return runningScript.onlineExpGained / runningScript.onlineRunningTime;\n },\n nFormat:\n (ctx: NetscriptContext) =>\n (_n: unknown, _format: unknown): string => {\n const n = helpers.number(ctx, \"n\", _n);\n const format = helpers.string(ctx, \"format\", _format);\n if (isNaN(n)) {\n return \"\";\n }\n\n return numeralWrapper.format(n, format);\n },\n tFormat:\n (ctx: NetscriptContext) =>\n (_milliseconds: unknown, _milliPrecision: unknown = false): string => {\n const milliseconds = helpers.number(ctx, \"milliseconds\", _milliseconds);\n const milliPrecision = !!_milliPrecision;\n return convertTimeMsToTimeElapsedString(milliseconds, milliPrecision);\n },\n getTimeSinceLastAug: () => (): number => {\n return Player.playtimeSinceLastAug;\n },\n alert:\n (ctx: NetscriptContext) =>\n (_message: unknown): void => {\n const message = helpers.string(ctx, \"message\", _message);\n dialogBoxCreate(message);\n },\n toast:\n (ctx: NetscriptContext) =>\n (_message: unknown, _variant: unknown = ToastVariant.SUCCESS, _duration: unknown = 2000): void => {\n const message = helpers.string(ctx, \"message\", _message);\n const variant = helpers.string(ctx, \"variant\", _variant);\n const duration = _duration === null ? null : helpers.number(ctx, \"duration\", _duration);\n if (!checkEnum(ToastVariant, variant))\n throw new Error(`variant must be one of ${Object.values(ToastVariant).join(\", \")}`);\n SnackbarEvents.emit(message, variant, duration);\n },\n prompt:\n (ctx: NetscriptContext) =>\n (_txt: unknown, options?: { type?: string; options?: string[] }): Promise => {\n const txt = helpers.string(ctx, \"txt\", _txt);\n\n return new Promise(function (resolve) {\n PromptEvent.emit({\n txt: txt,\n options,\n resolve: resolve,\n });\n });\n },\n wget:\n (ctx: NetscriptContext) =>\n async (_url: unknown, _target: unknown, _hostname: unknown = ctx.workerScript.hostname): Promise => {\n const url = helpers.string(ctx, \"url\", _url);\n const target = helpers.string(ctx, \"target\", _target);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n helpers.log(ctx, () => `Invalid target file: '${target}'. Must be a script or text file.`);\n return Promise.resolve(false);\n }\n const s = helpers.getServer(ctx, hostname);\n return new Promise(function (resolve) {\n $.get(\n url,\n function (data) {\n let res;\n if (isScriptFilename(target)) {\n res = s.writeToScriptFile(Player, target, data);\n } else {\n res = s.writeToTextFile(target, data);\n }\n if (!res.success) {\n helpers.log(ctx, () => \"Failed.\");\n return resolve(false);\n }\n if (res.overwritten) {\n helpers.log(ctx, () => `Successfully retrieved content and overwrote '${target}' on '${hostname}'`);\n return resolve(true);\n }\n helpers.log(ctx, () => `Successfully retrieved content to new file '${target}' on '${hostname}'`);\n return resolve(true);\n },\n \"text\",\n ).fail(function (e) {\n helpers.log(ctx, () => JSON.stringify(e));\n return resolve(false);\n });\n });\n },\n getFavorToDonate: () => (): number => {\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n getPlayer: () => (): INetscriptPlayer => {\n const data = {\n hp: JSON.parse(JSON.stringify(Player.hp)),\n skills: JSON.parse(JSON.stringify(Player.skills)),\n exp: JSON.parse(JSON.stringify(Player.exp)),\n mults: JSON.parse(JSON.stringify(Player.mults)),\n numPeopleKilled: Player.numPeopleKilled,\n money: Player.money,\n city: Player.city,\n location: Player.location,\n bitNodeN: Player.bitNodeN,\n totalPlaytime: Player.totalPlaytime,\n playtimeSinceLastAug: Player.playtimeSinceLastAug,\n playtimeSinceLastBitnode: Player.playtimeSinceLastBitnode,\n jobs: {},\n factions: Player.factions.slice(),\n tor: Player.hasTorRouter(),\n inBladeburner: Player.inBladeburner(),\n hasCorporation: Player.hasCorporation(),\n entropy: Player.entropy,\n };\n Object.assign(data.jobs, Player.jobs);\n return data;\n },\n atExit:\n (ctx: NetscriptContext) =>\n (f: unknown): void => {\n if (typeof f !== \"function\") {\n throw helpers.makeRuntimeErrorMsg(ctx, \"argument should be function\");\n }\n ctx.workerScript.atExit = () => {\n f();\n }; // Wrap the user function to prevent WorkerScript leaking as 'this'\n },\n mv:\n (ctx: NetscriptContext) =>\n (_host: unknown, _source: unknown, _destination: unknown): void => {\n const host = helpers.string(ctx, \"host\", _host);\n const source = helpers.string(ctx, \"source\", _source);\n const destination = helpers.string(ctx, \"destination\", _destination);\n\n if (!isValidFilePath(source)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${source}'`);\n if (!isValidFilePath(destination)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${destination}'`);\n\n const source_is_txt = source.endsWith(\".txt\");\n const dest_is_txt = destination.endsWith(\".txt\");\n\n if (!isScriptFilename(source) && !source_is_txt)\n throw helpers.makeRuntimeErrorMsg(ctx, `'mv' can only be used on scripts and text files (.txt)`);\n if (source_is_txt != dest_is_txt)\n throw helpers.makeRuntimeErrorMsg(ctx, `Source and destination files must have the same type`);\n\n if (source === destination) {\n return;\n }\n\n const destServer = helpers.getServer(ctx, host);\n\n if (!source_is_txt && destServer.isRunning(source))\n throw helpers.makeRuntimeErrorMsg(ctx, `Cannot use 'mv' on a script that is running`);\n\n interface File {\n filename: string;\n }\n\n const files = source_is_txt ? destServer.textFiles : destServer.scripts;\n let source_file: File | null = null;\n let dest_file: File | null = null;\n\n for (let i = 0; i < files.length; ++i) {\n const file = files[i];\n if (file.filename === source) {\n source_file = file;\n } else if (file.filename === destination) {\n dest_file = file;\n }\n }\n\n if (source_file == null) throw helpers.makeRuntimeErrorMsg(ctx, `Source file ${source} does not exist`);\n\n if (dest_file != null) {\n if (dest_file instanceof TextFile && source_file instanceof TextFile) {\n dest_file.text = source_file.text;\n } else if (dest_file instanceof Script && source_file instanceof Script) {\n dest_file.code = source_file.code;\n dest_file.markUpdated();\n }\n\n destServer.removeFile(source);\n } else {\n source_file.filename = destination;\n if (source_file instanceof Script) {\n source_file.markUpdated();\n }\n }\n },\n flags: Flags,\n};\n\n// add undocumented functions\nconst ns = {\n ...base,\n ...NetscriptExtra(),\n};\n\nconst possibleLogs = Object.fromEntries([...helpers.getFunctionNames(ns, \"\")].map((a) => [a, true]));\n","import { CONSTANTS } from \"../../Constants\";\nimport { Server } from \"../Server\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function calculateServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {\n const numServerGrowthCycles = Math.max(Math.floor(threads), 0);\n\n //Get adjusted growth rate, which accounts for server security\n const growthRate = CONSTANTS.ServerBaseGrowthRate;\n let adjGrowthRate = 1 + (growthRate - 1) / server.hackDifficulty;\n if (adjGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n adjGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n //Calculate adjusted server growth rate based on parameters\n const serverGrowthPercentage = server.serverGrowth / 100;\n const numServerGrowthCyclesAdjusted =\n numServerGrowthCycles * serverGrowthPercentage * BitNodeMultipliers.ServerGrowthRate;\n\n //Apply serverGrowth for the calculated number of growth cycles\n const coreBonus = 1 + (cores - 1) / 16;\n return Math.pow(adjGrowthRate, numServerGrowthCyclesAdjusted * p.mults.hacking_grow * coreBonus);\n}\n","import { GangMemberTask } from \"./GangMemberTask\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangMemberUpgrades } from \"./GangMemberUpgrades\";\nimport { IAscensionResult } from \"./IAscensionResult\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IGang } from \"./IGang\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport {\n calculateRespectGain,\n calculateMoneyGain,\n calculateWantedLevelGain,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"./formulas/formulas\";\n\ninterface IMults {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n}\n\nexport class GangMember {\n name: string;\n task = \"Unassigned\";\n\n earnedRespect = 0;\n\n hack = 1;\n str = 1;\n def = 1;\n dex = 1;\n agi = 1;\n cha = 1;\n\n hack_exp = 0;\n str_exp = 0;\n def_exp = 0;\n dex_exp = 0;\n agi_exp = 0;\n cha_exp = 0;\n\n hack_mult = 1;\n str_mult = 1;\n def_mult = 1;\n dex_mult = 1;\n agi_mult = 1;\n cha_mult = 1;\n\n hack_asc_points = 0;\n str_asc_points = 0;\n def_asc_points = 0;\n dex_asc_points = 0;\n agi_asc_points = 0;\n cha_asc_points = 0;\n\n upgrades: string[] = []; // Names of upgrades\n augmentations: string[] = []; // Names of augmentations only\n\n constructor(name = \"\") {\n this.name = name;\n }\n\n calculateSkill(exp: number, mult = 1): number {\n return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);\n }\n\n calculateAscensionMult(points: number): number {\n return calculateAscensionMult(points);\n }\n\n updateSkillLevels(): void {\n this.hack = this.calculateSkill(this.hack_exp, this.hack_mult * this.calculateAscensionMult(this.hack_asc_points));\n this.str = this.calculateSkill(this.str_exp, this.str_mult * this.calculateAscensionMult(this.str_asc_points));\n this.def = this.calculateSkill(this.def_exp, this.def_mult * this.calculateAscensionMult(this.def_asc_points));\n this.dex = this.calculateSkill(this.dex_exp, this.dex_mult * this.calculateAscensionMult(this.dex_asc_points));\n this.agi = this.calculateSkill(this.agi_exp, this.agi_mult * this.calculateAscensionMult(this.agi_asc_points));\n this.cha = this.calculateSkill(this.cha_exp, this.cha_mult * this.calculateAscensionMult(this.cha_asc_points));\n }\n\n calculatePower(): number {\n return (this.hack + this.str + this.def + this.dex + this.agi + this.cha) / 95;\n }\n\n assignToTask(taskName: string): boolean {\n if (!GangMemberTasks.hasOwnProperty(taskName)) {\n this.task = \"Unassigned\";\n return false;\n }\n this.task = taskName;\n return true;\n }\n\n unassignFromTask(): void {\n this.task = \"Unassigned\";\n }\n\n getTask(): GangMemberTask {\n // TODO(hydroflame): transfer that to a save file migration function\n // Backwards compatibility\n if ((this.task as any) instanceof GangMemberTask) {\n this.task = (this.task as any).name;\n }\n\n if (GangMemberTasks.hasOwnProperty(this.task)) {\n return GangMemberTasks[this.task];\n }\n return GangMemberTasks[\"Unassigned\"];\n }\n\n calculateRespectGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateRespectGain(g, this, task);\n }\n\n calculateWantedLevelGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateWantedLevelGain(g, this, task);\n }\n\n calculateMoneyGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateMoneyGain(g, this, task);\n }\n\n expMult(): IMults {\n return {\n hack: (this.hack_mult - 1) / 4 + 1,\n str: (this.str_mult - 1) / 4 + 1,\n def: (this.def_mult - 1) / 4 + 1,\n dex: (this.dex_mult - 1) / 4 + 1,\n agi: (this.agi_mult - 1) / 4 + 1,\n cha: (this.cha_mult - 1) / 4 + 1,\n };\n }\n\n gainExperience(numCycles = 1): void {\n const task = this.getTask();\n if (task === GangMemberTasks[\"Unassigned\"]) return;\n const difficultyMult = Math.pow(task.difficulty, 0.9);\n const difficultyPerCycles = difficultyMult * numCycles;\n const weightDivisor = 1500;\n const expMult = this.expMult();\n this.hack_exp +=\n (task.hackWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.hack *\n this.calculateAscensionMult(this.hack_asc_points);\n this.str_exp +=\n (task.strWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.str *\n this.calculateAscensionMult(this.str_asc_points);\n this.def_exp +=\n (task.defWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.def *\n this.calculateAscensionMult(this.def_asc_points);\n this.dex_exp +=\n (task.dexWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.dex *\n this.calculateAscensionMult(this.dex_asc_points);\n this.agi_exp +=\n (task.agiWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.agi *\n this.calculateAscensionMult(this.agi_asc_points);\n this.cha_exp +=\n (task.chaWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.cha *\n this.calculateAscensionMult(this.cha_asc_points);\n }\n\n recordEarnedRespect(numCycles = 1, gang: IGang): void {\n this.earnedRespect += this.calculateRespectGain(gang) * numCycles;\n }\n\n getGainedAscensionPoints(): IMults {\n return {\n hack: calculateAscensionPointsGain(this.hack_exp),\n str: calculateAscensionPointsGain(this.str_exp),\n def: calculateAscensionPointsGain(this.def_exp),\n dex: calculateAscensionPointsGain(this.dex_exp),\n agi: calculateAscensionPointsGain(this.agi_exp),\n cha: calculateAscensionPointsGain(this.cha_exp),\n };\n }\n\n canAscend(): boolean {\n const points = this.getGainedAscensionPoints();\n return points.hack > 0 || points.str > 0 || points.def > 0 || points.dex > 0 || points.agi > 0 || points.cha > 0;\n }\n\n getCurrentAscensionMults(): IMults {\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points),\n str: this.calculateAscensionMult(this.str_asc_points),\n def: this.calculateAscensionMult(this.def_asc_points),\n dex: this.calculateAscensionMult(this.dex_asc_points),\n agi: this.calculateAscensionMult(this.agi_asc_points),\n cha: this.calculateAscensionMult(this.cha_asc_points),\n };\n }\n\n getAscensionMultsAfterAscend(): IMults {\n const points = this.getGainedAscensionPoints();\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points + points.hack),\n str: this.calculateAscensionMult(this.str_asc_points + points.str),\n def: this.calculateAscensionMult(this.def_asc_points + points.def),\n dex: this.calculateAscensionMult(this.dex_asc_points + points.dex),\n agi: this.calculateAscensionMult(this.agi_asc_points + points.agi),\n cha: this.calculateAscensionMult(this.cha_asc_points + points.cha),\n };\n }\n\n getAscensionResults(): IMults {\n const postAscend = this.getAscensionMultsAfterAscend();\n const preAscend = this.getCurrentAscensionMults();\n\n return {\n hack: postAscend.hack / preAscend.hack,\n str: postAscend.str / preAscend.str,\n def: postAscend.def / preAscend.def,\n dex: postAscend.dex / preAscend.dex,\n agi: postAscend.agi / preAscend.agi,\n cha: postAscend.cha / preAscend.cha,\n };\n }\n\n ascend(): IAscensionResult {\n const res = this.getAscensionResults();\n const points = this.getGainedAscensionPoints();\n this.hack_asc_points += points.hack;\n this.str_asc_points += points.str;\n this.def_asc_points += points.def;\n this.dex_asc_points += points.dex;\n this.agi_asc_points += points.agi;\n this.cha_asc_points += points.cha;\n\n // Remove upgrades. Then re-calculate multipliers and stats\n this.upgrades.length = 0;\n this.hack_mult = 1;\n this.str_mult = 1;\n this.def_mult = 1;\n this.dex_mult = 1;\n this.agi_mult = 1;\n this.cha_mult = 1;\n for (let i = 0; i < this.augmentations.length; ++i) {\n const aug = GangMemberUpgrades[this.augmentations[i]];\n this.applyUpgrade(aug);\n }\n\n // Clear exp and recalculate stats\n this.hack_exp = 0;\n this.str_exp = 0;\n this.def_exp = 0;\n this.dex_exp = 0;\n this.agi_exp = 0;\n this.cha_exp = 0;\n this.updateSkillLevels();\n\n const respectToDeduct = this.earnedRespect;\n this.earnedRespect = 0;\n return {\n respect: respectToDeduct,\n hack: res.hack,\n str: res.str,\n def: res.def,\n dex: res.dex,\n agi: res.agi,\n cha: res.cha,\n };\n }\n\n applyUpgrade(upg: GangMemberUpgrade): void {\n if (upg.mults.str != null) this.str_mult *= upg.mults.str;\n if (upg.mults.def != null) this.def_mult *= upg.mults.def;\n if (upg.mults.dex != null) this.dex_mult *= upg.mults.dex;\n if (upg.mults.agi != null) this.agi_mult *= upg.mults.agi;\n if (upg.mults.cha != null) this.cha_mult *= upg.mults.cha;\n if (upg.mults.hack != null) this.hack_mult *= upg.mults.hack;\n }\n\n buyUpgrade(upg: GangMemberUpgrade, player: IPlayer, gang: IGang): boolean {\n // Prevent purchasing of already-owned upgrades\n if (this.augmentations.includes(upg.name) || this.upgrades.includes(upg.name)) return false;\n\n if (player.money < gang.getUpgradeCost(upg)) return false;\n player.loseMoney(gang.getUpgradeCost(upg), \"gang\");\n if (upg.type === \"g\") {\n this.augmentations.push(upg.name);\n } else {\n this.upgrades.push(upg.name);\n }\n this.applyUpgrade(upg);\n return true;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"GangMember\", this);\n }\n\n /**\n * Initiatizes a GangMember object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): GangMember {\n return Generic_fromJSON(GangMember, value.data);\n }\n}\n\nReviver.constructors.GangMember = GangMember;\n","import { Interpreter } from \"../ThirdParty/JSInterpreter\";\n\nconst defaultInterpreter = new Interpreter(\"\", () => undefined);\n\ninterface PseudoObject {\n properties: Record;\n class: string;\n}\n\nconst isPseudoObject = (v: unknown): v is PseudoObject =>\n !!v &&\n typeof v === \"object\" &&\n v.hasOwnProperty(\"properties\") &&\n v.hasOwnProperty(\"getter\") &&\n v.hasOwnProperty(\"setter\") &&\n v.hasOwnProperty(\"proto\");\n\n// the acorn interpreter has a bug where it doesn't convert arrays correctly.\n// so we have to more or less copy it here.\nexport function toNative(pseudoObj: unknown): unknown {\n if (pseudoObj == null) return null;\n if (!isPseudoObject(pseudoObj)) {\n return pseudoObj; // it wasn't a pseudo object anyway.\n }\n\n if (pseudoObj.hasOwnProperty(\"class\") && pseudoObj.class === \"Array\") {\n const arr: unknown[] = [];\n const length = defaultInterpreter.getProperty(pseudoObj, \"length\");\n if (typeof length === \"number\") {\n for (let i = 0; i < length; i++) {\n if (defaultInterpreter.hasProperty(pseudoObj, i)) {\n arr[i] = toNative(defaultInterpreter.getProperty(pseudoObj, i));\n }\n }\n }\n return arr;\n } else {\n // Object.\n const obj: Record = {};\n for (const key of Object.keys(pseudoObj.properties)) {\n const val = pseudoObj.properties[key];\n obj[key] = toNative(val);\n }\n return obj;\n }\n}\n","import { Typography } from \"@mui/material\";\nimport React from \"react\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\n// This particular eslint-disable is correct.\n// In this super specific weird case we in fact do want a regex on an ANSII character.\n// eslint-disable-next-line no-control-regex\nconst ANSI_ESCAPE = new RegExp(\"\\u{001b}\\\\[(?.*?)m\", \"ug\");\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n success: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.colors.success,\n },\n error: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.error.main,\n },\n primary: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.primary.main,\n },\n info: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.info.main,\n },\n warning: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.warning.main,\n },\n }),\n);\n\nconst lineClass = (classes: Record, s: string): string => {\n const lineClassMap: Record = {\n error: classes.error,\n success: classes.success,\n info: classes.info,\n warn: classes.warning,\n };\n return lineClassMap[s] || classes.primary;\n};\n\ninterface IProps {\n text: unknown;\n color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\";\n}\n\nexport const ANSIITypography = React.memo((props: IProps): React.ReactElement => {\n const text = String(props.text);\n const classes = useStyles();\n const parts = [];\n\n // Build a look-alike regex match to place at the front of the matches list\n const INITIAL = {\n 0: \"\",\n index: 0,\n groups: { code: null },\n };\n const matches = [INITIAL, ...text.matchAll(ANSI_ESCAPE), null];\n if (matches.length > 2) {\n matches.slice(0, -1).forEach((m, i) => {\n const n = matches[i + 1];\n if (!m || m.index === undefined || m.groups === undefined) {\n return;\n }\n const startIndex = m.index + m[0].length;\n const stopIndex = n ? n.index : text.length;\n const partText = text.slice(startIndex, stopIndex);\n if (startIndex !== stopIndex) {\n // Don't generate \"empty\" spans\n parts.push({ code: m.groups.code, text: partText });\n }\n });\n }\n if (parts.length === 0) {\n // For example, if the string was empty or there were no escape sequence matches\n parts.push({ code: null, text: text });\n }\n return (\n \n {parts.map((part, i) => (\n \n {part.text}\n \n ))}\n \n );\n});\n\nfunction ansiCodeStyle(code: string | null): Record {\n // The ANSI colors actually have the dark color set as default and require extra work to get\n // bright colors. But these are rarely used or, if they are, are often re-mapped by the\n // terminal emulator to brighter colors. So for foreground colors we use the bright color set\n // and for background colors we use the dark color set. Of course, all colors are available\n // via the longer ESC[n8;5;c] sequence (n={3,4}, c=color). Ideally, these 8-bit maps could\n // be managed in the user preferences/theme.\n const COLOR_MAP_BRIGHT: Record = {\n 0: \"#404040\",\n 1: \"#ff0000\",\n 2: \"#00ff00\",\n 3: \"#ffff00\",\n 4: \"#0000ff\",\n 5: \"#ff00ff\",\n 6: \"#00ffff\",\n 7: \"#ffffff\",\n };\n const COLOR_MAP_DARK: Record = {\n 8: \"#000000\",\n 9: \"#800000\",\n 10: \"#008000\",\n 11: \"#808000\",\n 12: \"#000080\",\n 13: \"#800080\",\n 14: \"#008080\",\n 15: \"#c0c0c0\",\n };\n\n const ansi2rgb = (code: number): string => {\n /* eslint-disable yoda */\n if (0 <= code && code < 8) {\n // x8 RGB\n return COLOR_MAP_BRIGHT[code];\n }\n if (8 <= code && code < 16) {\n // x8 RGB - \"High Intensity\" (but here, actually the dark set)\n return COLOR_MAP_DARK[code];\n }\n if (16 <= code && code < 232) {\n // x216 RGB\n const base = code - 16;\n const ir = Math.floor(base / 36);\n const ig = Math.floor((base % 36) / 6);\n const ib = Math.floor((base % 6) / 1);\n const r = ir <= 0 ? 0 : 55 + ir * 40;\n const g = ig <= 0 ? 0 : 55 + ig * 40;\n const b = ib <= 0 ? 0 : 55 + ib * 40;\n return `rgb(${r}, ${g}, ${b})`;\n }\n if (232 <= code && code < 256) {\n // x32 greyscale\n const base = code - 232;\n const grey = base * 10 + 8;\n return `rgb(${grey}, ${grey}, ${grey})`;\n }\n // shouldn't get here (under normal circumstances), but just in case\n return \"initial\";\n };\n\n type styleKey = \"fontWeight\" | \"textDecoration\" | \"color\" | \"backgroundColor\" | \"padding\";\n const style: {\n fontWeight?: string;\n textDecoration?: string;\n color?: string;\n backgroundColor?: string;\n padding?: string;\n } = {};\n\n if (code === null || code === \"0\") {\n return style;\n }\n\n const codeParts = code\n .split(\";\")\n .map((p) => parseInt(p))\n .filter(\n (p, i, arr) =>\n // If the sequence is 38;5 (x256 foreground color) or 48;5 (x256 background color),\n // filter out the 5 so the next codePart after {38,48} is the color code.\n p != 5 || i == 0 || (arr[i - 1] != 38 && arr[i - 1] != 48),\n );\n\n let nextStyleKey: styleKey | null = null;\n codeParts.forEach((codePart) => {\n /* eslint-disable yoda */\n if (nextStyleKey !== null) {\n style[nextStyleKey] = ansi2rgb(codePart);\n nextStyleKey = null;\n }\n // Decorations\n else if (codePart == 1) {\n style.fontWeight = \"bold\";\n } else if (codePart == 4) {\n style.textDecoration = \"underline\";\n }\n // Forground Color (x8)\n else if (30 <= codePart && codePart < 38) {\n if (COLOR_MAP_BRIGHT[codePart % 10]) {\n style.color = COLOR_MAP_BRIGHT[codePart % 10];\n }\n }\n // Background Color (x8)\n else if (40 <= codePart && codePart < 48) {\n if (COLOR_MAP_DARK[codePart % 10]) {\n style.backgroundColor = COLOR_MAP_DARK[codePart % 10];\n }\n }\n // Forground Color (x256)\n else if (codePart == 38) {\n nextStyleKey = \"color\";\n }\n // Background Color (x256)\n else if (codePart == 48) {\n nextStyleKey = \"backgroundColor\";\n }\n });\n // If a background color is set, add slight padding to increase the background fill area.\n // This was previously display:inline-block, but that has display errors when line breaks are used.\n if (style.backgroundColor) {\n style.padding = \"0px 1px\";\n }\n return style;\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { Sleeve } from \"./Sleeve\";\n\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { Multipliers } from \"../Multipliers\";\n\nexport function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentation[] {\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n\n const ownedAugNames: string[] = sleeve.augmentations.map((e) => {\n return e.name;\n });\n const availableAugs: Augmentation[] = [];\n\n // Helper function that helps filter out augs that are already owned\n // and augs that aren't allowed for sleeves\n function isAvailableForSleeve(aug: Augmentation): boolean {\n if (ownedAugNames.includes(aug.name)) {\n return false;\n }\n if (availableAugs.includes(aug)) {\n return false;\n }\n if (aug.isSpecial) {\n return false;\n }\n\n type MultKey = keyof Multipliers;\n const validMults: MultKey[] = [\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"company_rep\",\n \"faction_rep\",\n \"crime_money\",\n \"crime_success\",\n \"work_money\",\n ];\n for (const mult of validMults) {\n if (aug.mults[mult] !== 1) {\n return true;\n }\n }\n\n return false;\n }\n\n // If player is in a gang, then we return all augs that the player\n // has enough reputation for (since that gang offers all augs)\n if (p.inGang()) {\n const fac = p.getGangFaction();\n\n for (const augName of Object.keys(StaticAugmentations)) {\n const aug = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.getCost(p).repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n for (const facName of p.factions) {\n if (facName === FactionNames.Bladeburners) {\n continue;\n }\n if (facName === FactionNames.Netburners) {\n continue;\n }\n const fac: Faction | null = Factions[facName];\n if (fac == null) {\n continue;\n }\n\n for (const augName of fac.augmentations) {\n const aug: Augmentation = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.getCost(p).repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n return availableAugs;\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Crime } from \"src/Crime/Crime\";\nimport { newWorkStats, scaleWorkStats, WorkStats } from \"../WorkStats\";\n\nexport const calculateCrimeWorkStats = (crime: Crime): WorkStats => {\n const gains = scaleWorkStats(\n newWorkStats({\n money: crime.money,\n hackExp: crime.hacking_exp * 2,\n strExp: crime.strength_exp * 2,\n defExp: crime.defense_exp * 2,\n dexExp: crime.dexterity_exp * 2,\n agiExp: crime.agility_exp * 2,\n chaExp: crime.charisma_exp * 2,\n intExp: crime.intelligence_exp * 2,\n }),\n BitNodeMultipliers.CrimeExpGain,\n false,\n );\n gains.money *= BitNodeMultipliers.CrimeMoney;\n return gains;\n};\n","import React from \"react\";\nimport { newWorkStats, WorkStats } from \"../../Work/WorkStats\";\n\ninterface IGeneral {\n desc: JSX.Element;\n exp: WorkStats;\n}\n\nexport const GeneralActions: {\n [key: string]: IGeneral | undefined;\n} = {\n Training: {\n desc: (\n <>\n Improve your abilities at the Bladeburner unit's specialized training center. Doing this gives experience for\n all combat stats and also increases your max stamina.\n \n ),\n exp: newWorkStats({\n strExp: 30,\n defExp: 30,\n dexExp: 30,\n agiExp: 30,\n }),\n },\n\n \"Field Analysis\": {\n desc: (\n <>\n Mine and analyze Synthoid-related data. This improves the Bladeburner unit's intelligence on Synthoid locations\n and activities. Completing this action will improve the accuracy of your Synthoid population estimated in the\n current city.\n
\n
\n Does NOT require stamina.\n \n ),\n exp: newWorkStats({\n hackExp: 20,\n chaExp: 20,\n }),\n },\n\n Recruitment: {\n desc: (\n <>\n Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.\n
\n
\n Does NOT require stamina.\n \n ),\n exp: newWorkStats({\n chaExp: 120,\n }),\n },\n\n Diplomacy: {\n desc: (\n <>\n Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in\n your current city.\n
\n
\n Does NOT require stamina.\n \n ),\n exp: newWorkStats({\n chaExp: 120,\n }),\n },\n\n \"Hyperbolic Regeneration Chamber\": {\n desc: (\n <>\n Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your\n wounds and slightly increase your stamina.\n
\n
\n \n ),\n exp: newWorkStats(),\n },\n \"Incite Violence\": {\n desc: (\n <>\n Purposefully stir trouble in the synthoid community in order to gain a political edge. This will generate\n additional contracts and operations, at the cost of increased Chaos.\n \n ),\n exp: newWorkStats({\n strExp: 10,\n defExp: 10,\n dexExp: 10,\n agiExp: 10,\n chaExp: 10,\n }),\n },\n};\n","import { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport { Company } from \"../../Company/Company\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { WorkStats } from \"../WorkStats\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPerson } from \"src/PersonObjects/IPerson\";\n\nexport const calculateCompanyWorkStats = (player: IPlayer, worker: IPerson, company: Company): WorkStats => {\n const companyPositionName = player.jobs[company.name];\n const companyPosition = CompanyPositions[companyPositionName];\n\n // If player has SF-11, calculate salary multiplier from favor\n let favorMult = 1 + company.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n\n let bn11Mult = 1;\n if (player.sourceFileLvl(11) > 0) {\n bn11Mult = favorMult;\n }\n\n let jobPerformance = companyPosition.calculateJobPerformance(\n worker.skills.hacking,\n worker.skills.strength,\n worker.skills.defense,\n worker.skills.dexterity,\n worker.skills.agility,\n worker.skills.charisma,\n );\n\n jobPerformance += worker.skills.intelligence / CONSTANTS.MaxSkillLevel;\n\n return {\n money:\n companyPosition.baseSalary *\n company.salaryMultiplier *\n worker.mults.work_money *\n BitNodeMultipliers.CompanyWorkMoney *\n bn11Mult,\n reputation: jobPerformance * worker.mults.company_rep * favorMult,\n hackExp:\n companyPosition.hackingExpGain *\n company.expMultiplier *\n worker.mults.hacking_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n strExp:\n companyPosition.strengthExpGain *\n company.expMultiplier *\n worker.mults.strength_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n defExp:\n companyPosition.defenseExpGain *\n company.expMultiplier *\n worker.mults.defense_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n dexExp:\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n worker.mults.dexterity_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n agiExp:\n companyPosition.agilityExpGain *\n company.expMultiplier *\n worker.mults.agility_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n chaExp:\n companyPosition.charismaExpGain *\n company.expMultiplier *\n worker.mults.charisma_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n intExp: 0,\n };\n};\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const StaneksGiftEvents = new EventEmitter<[]>();\n","/**\n * Metadata for constructing Location objects for all Locations\n * in the game\n */\nimport { CityName } from \"./CityNames\";\nimport { LocationName } from \"./LocationNames\";\nimport { IConstructorParams } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nexport const LocationsMetadata: IConstructorParams[] = [\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.AevumAeroCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 8.19,\n },\n name: LocationName.AevumBachmanAndAssociates,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 9.55,\n },\n name: LocationName.AevumClarkeIncorporated,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 3,\n expMult: 2,\n name: LocationName.AevumCrushFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 37,\n startingSecurityLevel: 17.02,\n },\n name: LocationName.AevumECorp,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 15.54,\n },\n name: LocationName.AevumFulcrumTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 256,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 7.89,\n },\n name: LocationName.AevumGalacticCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 3.29,\n },\n name: LocationName.AevumNetLinkTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 64,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 5.35,\n },\n name: LocationName.AevumPolice,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.AevumRhoConstruction,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 10,\n expMult: 5,\n name: LocationName.AevumSnapFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n costMult: 4,\n expMult: 3,\n name: LocationName.AevumSummitUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 7,\n startingSecurityLevel: 5.85,\n },\n name: LocationName.AevumWatchdogSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n name: LocationName.AevumCasino,\n types: [LocationType.Casino],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 16.25,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n types: [LocationType.Company],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 12.59,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.IshimaNovaMedical,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.2,\n },\n name: LocationName.IshimaOmegaSoftware,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 128,\n techVendorMinRam: 4,\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.38,\n },\n name: LocationName.IshimaStormTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 32,\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 7.18,\n },\n name: LocationName.NewTokyoDefComm,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 20,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 2.5,\n },\n name: LocationName.NewTokyoNoodleBar,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.52,\n },\n name: LocationName.NewTokyoVitaLife,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n name: LocationName.NewTokyoArcade,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.62,\n },\n name: LocationName.Sector12AlphaEnterprises,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 8,\n techVendorMinRam: 2,\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 10.59,\n },\n name: LocationName.Sector12BladeIndustries,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CIA,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.66,\n },\n name: LocationName.Sector12CarmichaelSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CityHall,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12DeltaOne,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12FoodNStuff,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.Sector12FourSigma,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 6.02,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n expMult: 1,\n costMult: 1,\n name: LocationName.Sector12IronGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 3.13,\n },\n name: LocationName.Sector12JoesGuns,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 31,\n startingSecurityLevel: 16.36,\n },\n name: LocationName.Sector12MegaCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12NSA,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.Sector12,\n costMult: 20,\n expMult: 10,\n name: LocationName.Sector12PowerhouseGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n costMult: 3,\n expMult: 2,\n name: LocationName.Sector12RothmanUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12UniversalEnergy,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 3.59,\n },\n name: LocationName.VolhavenCompuTek,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 256,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 7.28,\n },\n name: LocationName.VolhavenHeliosLabs,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.35,\n },\n name: LocationName.VolhavenLexoCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 7,\n expMult: 4,\n name: LocationName.VolhavenMilleniumFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 50,\n startingSecurityLevel: 8.53,\n },\n name: LocationName.VolhavenNWO,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 7.74,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 22,\n startingSecurityLevel: 6,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 4.77,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 5,\n expMult: 4,\n name: LocationName.VolhavenZBInstituteOfTechnology,\n types: [LocationType.University],\n },\n {\n city: null,\n name: LocationName.Hospital,\n types: [LocationType.Hospital],\n },\n {\n city: null,\n name: LocationName.Slums,\n types: [LocationType.Slums],\n },\n {\n city: null,\n name: LocationName.TravelAgency,\n types: [LocationType.TravelAgency],\n },\n {\n city: null,\n name: LocationName.WorldStockExchange,\n types: [LocationType.StockMarket],\n },\n {\n city: CityName.Chongqing,\n name: LocationName.ChongqingChurchOfTheMachineGod,\n types: [LocationType.Special],\n },\n {\n city: CityName.Ishima,\n name: LocationName.IshimaGlitch,\n types: [LocationType.Special],\n },\n];\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport FileSaver from \"file-saver\";\nimport JSZip from \"jszip\";\n\nexport function exportScripts(pattern: string, server: BaseServer): void {\n const matchEnding = pattern.length == 1 || pattern === \"*.*\" ? null : pattern.slice(1); // Treat *.* the same as *\n const zip = new JSZip();\n // Helper function to zip any file contents whose name matches the pattern\n const zipFiles = (fileNames: string[], fileContents: string[]): void => {\n for (let i = 0; i < fileContents.length; ++i) {\n let name = fileNames[i];\n if (name.startsWith(\"/\")) name = name.slice(1);\n if (!matchEnding || name.endsWith(matchEnding))\n zip.file(name, new Blob([fileContents[i]], { type: \"text/plain\" }));\n }\n };\n // In the case of script files, we pull from the server.scripts array\n if (!matchEnding || isScriptFilename(matchEnding))\n zipFiles(\n server.scripts.map((s) => s.filename),\n server.scripts.map((s) => s.code),\n );\n // In the case of text files, we pull from the server.scripts array\n if (!matchEnding || matchEnding.endsWith(\".txt\"))\n zipFiles(\n server.textFiles.map((s) => s.fn),\n server.textFiles.map((s) => s.text),\n );\n\n // Return an error if no files matched, rather than an empty zip folder\n if (Object.keys(zip.files).length == 0) throw new Error(`No files match the pattern ${pattern}`);\n const zipFn = `bitburner${isScriptFilename(pattern) ? \"Scripts\" : pattern === \"*.txt\" ? \"Texts\" : \"Files\"}.zip`;\n zip.generateAsync({ type: \"blob\" }).then((content: Blob) => FileSaver.saveAs(content, zipFn));\n}\n\nexport function download(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n try {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of download command. Usage: download [script/text file]\");\n return;\n }\n const fn = args[0] + \"\";\n // If the parameter starts with *, download all files that match the wildcard pattern\n if (fn.startsWith(\"*\")) {\n try {\n exportScripts(fn, server);\n return;\n } catch (e: unknown) {\n let msg = String(e);\n if (e !== null && typeof e == \"object\" && e.hasOwnProperty(\"message\")) {\n msg = String((e as { message: unknown }).message);\n }\n return terminal.error(msg);\n }\n } else if (isScriptFilename(fn)) {\n // Download a single script\n const script = terminal.getScript(player, fn);\n if (script != null) {\n return script.download();\n }\n } else if (fn.endsWith(\".txt\")) {\n // Download a single text file\n const txt = terminal.getTextFile(player, fn);\n if (txt != null) {\n return txt.download();\n }\n } else {\n terminal.error(`Cannot download this filetype`);\n return;\n }\n terminal.error(`${fn} does not exist`);\n return;\n } catch (e) {\n terminal.error(e + \"\");\n return;\n }\n}\n","import { Button, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { Modal } from \"../ui/React/Modal\";\n\nlet v2ModalOpen = false;\n\nexport const openV2Modal = (): void => {\n v2ModalOpen = true;\n};\n\nexport const V2Modal = (): React.ReactElement => {\n const [open, setOpen] = useState(v2ModalOpen);\n return (\n undefined}>\n Welcome to bitburner v2.0.0!{\" \"}\n While this version does not change the game a lot, it does have quite a few API breaks.{\" \"}\n \n A file was added to your home computer called V2_0_0_API_BREAK.txt and it is highly recommended you take a look\n at this file. It explains where most of the API break have occured.\n {\" \"}\n \n You should also take a look at{\" \"}\n \n {\" \"}\n the migration guide\n {\" \"}\n as well as{\" \"}\n \n the changelog\n \n \n \n \n );\n};\n","export class PlayerOwnedSourceFile {\n // Source-File level\n lvl = 1;\n\n // Source-File number\n n = 1;\n\n constructor(n: number, level: number) {\n this.n = n;\n this.lvl = level;\n }\n}\n\nexport interface IPlayerOwnedSourceFile {\n lvl: number;\n n: number;\n}\n","import * as React from \"react\";\n\nexport const stealthIcon = (\n \n \n \n \n \n \n);\nexport const killIcon = (\n \n \n \n \n \n \n);\n","import React from \"react\";\nimport { IAction } from \"../IAction\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { use } from \"../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\n\ninterface IProps {\n action: IAction;\n isActive: boolean;\n bladeburner: IBladeburner;\n rerender: () => void;\n}\n\nexport function ActionLevel({ action, isActive, bladeburner, rerender }: IProps): React.ReactElement {\n const player = use.Player();\n\n const canIncrease = action.level < action.maxLevel;\n const canDecrease = action.level > 1;\n\n function increaseLevel(): void {\n if (!canIncrease) return;\n ++action.level;\n if (isActive) bladeburner.startAction(player, bladeburner.action);\n rerender();\n }\n\n function decreaseLevel(): void {\n if (!canDecrease) return;\n --action.level;\n if (isActive) bladeburner.startAction(player, bladeburner.action);\n rerender();\n }\n\n return (\n \n \n \n {action.getSuccessesNeededForNextLevel(BladeburnerConstants.ContractSuccessesPerLevel)} successes needed\n for next level\n \n }\n >\n \n Level: {action.level} / {action.maxLevel}\n \n \n \n WARNING: changing the level will restart the Operation : \"\"}>\n \n \n \n \n \n \n WARNING: changing the level will restart the Operation : \"\"}>\n \n \n \n \n \n \n \n );\n}\n","import React from \"react\";\nimport { IAction } from \"../IAction\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface IProps {\n action: IAction;\n rerender: () => void;\n}\n\nexport function Autolevel(props: IProps): React.ReactElement {\n function onAutolevel(event: React.ChangeEvent): void {\n props.action.autoLevel = event.target.checked;\n props.rerender();\n }\n return (\n \n Automatically increase operation level when possible}>\n Autolevel:\n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { Operation } from \"../Operation\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { TeamSizeModal } from \"./TeamSizeModal\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport Button from \"@mui/material/Button\";\ninterface IProps {\n action: Operation;\n bladeburner: IBladeburner;\n}\nexport function TeamSizeButton(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n \n setOpen(false)} action={props.action} bladeburner={props.bladeburner} />\n \n );\n}\n","import { CheckBox, CheckBoxOutlineBlank, Construction } from \"@mui/icons-material\";\nimport { Box, Button, Container, List, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { GraftingWork } from \"../../../Work/GraftingWork\";\nimport { Augmentation } from \"../../../Augmentation/Augmentation\";\nimport { AugmentationNames } from \"../../../Augmentation/data/AugmentationNames\";\nimport { StaticAugmentations } from \"../../../Augmentation/StaticAugmentations\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { hasAugmentationPrereqs } from \"../../../Faction/FactionHelpers\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { Locations } from \"../../../Locations/Locations\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../../Settings/SettingEnums\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { use } from \"../../../ui/Context\";\nimport { ConfirmationModal } from \"../../../ui/React/ConfirmationModal\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { convertTimeMsToTimeElapsedString, formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { GraftableAugmentation } from \"../GraftableAugmentation\";\nimport { calculateGraftingTimeWithBonus, getGraftingAvailableAugs } from \"../GraftingHelpers\";\n\nexport const GraftableAugmentations = (): Record => {\n const gAugs: Record = {};\n for (const aug of Object.values(StaticAugmentations)) {\n const name = aug.name;\n const graftableAug = new GraftableAugmentation(aug);\n gAugs[name] = graftableAug;\n }\n return gAugs;\n};\n\nconst canGraft = (player: IPlayer, aug: GraftableAugmentation): boolean => {\n if (player.money < aug.cost) {\n return false;\n }\n return hasAugmentationPrereqs(aug.augmentation);\n};\n\ninterface IProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst AugPreReqsChecklist = (props: IProps): React.ReactElement => {\n const aug = props.aug,\n player = props.player;\n\n return (\n \n Pre-Requisites:\n
\n {aug.prereqs.map((preAug) => (\n \n {player.hasAugmentation(preAug) ? : }\n {preAug}\n \n ))}\n
\n );\n};\n\nexport const GraftingRoot = (): React.ReactElement => {\n const player = use.Player();\n const router = use.Router();\n\n const graftableAugmentations = useState(GraftableAugmentations())[0];\n\n const [selectedAug, setSelectedAug] = useState(getGraftingAvailableAugs(player)[0]);\n const [graftOpen, setGraftOpen] = useState(false);\n const selectedAugmentation = StaticAugmentations[selectedAug];\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const getAugsSorted = (): string[] => {\n const augs = getGraftingAvailableAugs(player);\n switch (Settings.PurchaseAugmentationsOrder) {\n case PurchaseAugmentationsOrderSetting.Cost:\n return augs.sort((a, b) => graftableAugmentations[a].cost - graftableAugmentations[b].cost);\n default:\n return augs;\n }\n };\n\n const switchSortOrder = (newOrder: PurchaseAugmentationsOrderSetting): void => {\n Settings.PurchaseAugmentationsOrder = newOrder;\n rerender();\n };\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n \n \n Grafting Laboratory\n \n You find yourself in a secret laboratory, owned by a mysterious researcher.\n
\n The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations\n without requiring a body reset.\n
\n
\n Through legally questionable connections, the scientist has access to a vast array of Augmentation blueprints,\n even private designs. They offer to build and graft the Augmentations to you, in exchange for both a hefty sum\n of money, and being a lab rat.\n
\n\n \n \n Graft Augmentations\n \n \n \n \n \n {getGraftingAvailableAugs(player).length > 0 ? (\n \n \n {getAugsSorted().map((k, i) => (\n setSelectedAug(k)} selected={selectedAug === k}>\n \n {k}\n \n \n ))}\n \n \n \n {selectedAug}\n \n setGraftOpen(true)}\n sx={{ width: \"100%\" }}\n disabled={!canGraft(player, graftableAugmentations[selectedAug])}\n >\n Graft Augmentation (\n \n \n \n )\n \n setGraftOpen(false)}\n onConfirm={() => {\n player.startWork(\n new GraftingWork({\n augmentation: selectedAug,\n singularity: false,\n player: player,\n }),\n );\n player.startFocusing();\n router.toWork();\n }}\n confirmationText={\n <>\n Cancelling grafting will not save grafting progress, and the money you spend will not{\" \"}\n be returned.\n {!player.hasAugmentation(AugmentationNames.CongruityImplant) && (\n <>\n
\n
\n Additionally, grafting an Augmentation will increase the potency of the Entropy virus.\n \n )}\n \n }\n />\n \n \n Time to Graft:{\" \"}\n {convertTimeMsToTimeElapsedString(\n calculateGraftingTimeWithBonus(player, graftableAugmentations[selectedAug]),\n )}\n {/* Use formula so the displayed creation time is accurate to player bonus */}\n \n\n {selectedAugmentation.prereqs.length > 0 && (\n \n )}\n\n
\n\n \n {(() => {\n const info =\n typeof selectedAugmentation.info === \"string\" ? (\n {selectedAugmentation.info}\n ) : (\n selectedAugmentation.info\n );\n const tooltip = (\n <>\n {info}\n
\n
\n {selectedAugmentation.stats}\n \n );\n return tooltip;\n })()}\n
\n
\n
\n
\n ) : (\n All Augmentations owned\n )}\n
\n\n \n Entropy Virus\n\n \n \n Entropy strength: {player.entropy}\n
\n All multipliers decreased by:{\" \"}\n {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}% (multiplicative)\n
\n
\n\n \n When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating\n hidden malware. However, grafted Augmentations do not provide this security measure.\n
\n
\n Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they've dubbed\n \"Entropy\". This virus seems to grow more potent with each grafted Augmentation...\n
\n
\n
\n );\n};\n","import React, { useEffect, useState } from \"react\";\n\nexport function BlinkingCursor(): React.ReactElement {\n const [on, setOn] = useState(true);\n useEffect(() => {\n const i = setInterval(() => setOn((old) => !old), 1000);\n return () => clearInterval(i);\n });\n return <>{on ? \"|\" : <> };\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport TextFormatIcon from \"@mui/icons-material/TextFormat\";\nimport { StyleEditorModal } from \"./StyleEditorModal\";\n\nexport function StyleEditorButton(): React.ReactElement {\n const [styleEditorOpen, setStyleEditorOpen] = useState(false);\n return (\n <>\n \n \n \n setStyleEditorOpen(false)} />\n \n );\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { ThemeEditorModal } from \"./ThemeEditorModal\";\nimport { IRouter } from \"../../ui/Router\";\nimport ColorizeIcon from \"@mui/icons-material/Colorize\";\n\ninterface IProps {\n router: IRouter;\n}\n\nexport function ThemeEditorButton({ router }: IProps): React.ReactElement {\n const [themeEditorOpen, setThemeEditorOpen] = useState(false);\n return (\n <>\n \n \n \n setThemeEditorOpen(false)} router={router} />\n \n );\n}\n","import React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Link } from \"@mui/material\";\n\nexport function ThemeCollaborate(): React.ReactElement {\n return (\n <>\n \n If you've created a theme that you believe should be added in game's theme browser, feel free to{\" \"}\n \n create a pull request\n \n .\n \n \n Head over to the{\" \"}\n \n theme-sharing\n {\" \"}\n discord channel for more.\n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { deleteGame } from \"../../db\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from \"@mui/material\";\n\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport { pushDisableRestore } from \"../../Electron\";\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n}\n\nexport function DeleteGameButton({ color = \"primary\" }: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n return (\n <>\n \n \n \n {\n setModalOpened(false);\n deleteGame()\n .then(() => {\n pushDisableRestore();\n setTimeout(() => location.reload(), 1000);\n })\n .catch((r) => console.error(`Could not delete game: ${r}`));\n }}\n open={modalOpened}\n onClose={() => setModalOpened(false)}\n confirmationText={\"Really delete your game? (It's permanent!)\"}\n />\n \n );\n}\n","import React, { useState } from \"react\";\n\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from \"@mui/material\";\nimport RestartAltIcon from \"@mui/icons-material/RestartAlt\";\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n noConfirmation?: boolean;\n onTriggered: () => void;\n}\n\nexport function SoftResetButton({\n color = \"primary\",\n noConfirmation = false,\n onTriggered,\n}: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n function handleButtonClick(): void {\n if (noConfirmation) {\n onTriggered();\n } else {\n setModalOpened(true);\n }\n }\n\n return (\n <>\n \n \n \n setModalOpened(false)}\n confirmationText={\"This will perform the same action as installing Augmentations, are you sure?\"}\n />\n \n );\n}\n","export default \"/**\\n * @public\\n */\\nexport interface HP {\\n current: number;\\n max: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface Skills {\\n hacking: number;\\n strength: number;\\n defense: number;\\n dexterity: number;\\n agility: number;\\n charisma: number;\\n intelligence: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface PossibleInfiltrationLocation {\\n city: string;\\n name: string;\\n}\\n\\n/**\\n * Coding contract data will differ depending on coding contract.\\n * @public\\n */\\ntype CodingContractData = any;\\n\\n/**\\n * @public\\n */\\ntype PortData = string | number;\\n\\n/**\\n * @public\\n */\\ntype ScriptArg = string | number | boolean;\\n\\n/**\\n * @public\\n */\\ntype FilenameOrPID = number | string;\\n\\n/**\\n * @public\\n */\\ninterface Player {\\n hp: HP;\\n skills: Skills;\\n exp: Skills;\\n mults: Multipliers;\\n numPeopleKilled: number;\\n money: number;\\n city: string;\\n location: string;\\n bitNodeN: number;\\n totalPlaytime: number;\\n playtimeSinceLastAug: number;\\n playtimeSinceLastBitnode: number;\\n jobs: Record;\\n factions: string[];\\n tor: boolean;\\n hasCorporation: boolean;\\n inBladeburner: boolean;\\n entropy: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface Multipliers {\\n hacking_chance: number;\\n hacking_speed: number;\\n hacking_money: number;\\n hacking_grow: number;\\n hacking: number;\\n hacking_exp: number;\\n strength: number;\\n strength_exp: number;\\n defense: number;\\n defense_exp: number;\\n dexterity: number;\\n dexterity_exp: number;\\n agility: number;\\n agility_exp: number;\\n charisma: number;\\n charisma_exp: number;\\n hacknet_node_money: number;\\n hacknet_node_purchase_cost: number;\\n hacknet_node_ram_cost: number;\\n hacknet_node_core_cost: number;\\n hacknet_node_level_cost: number;\\n company_rep: number;\\n faction_rep: number;\\n work_money: number;\\n crime_success: number;\\n crime_money: number;\\n bladeburner_max_stamina: number;\\n bladeburner_stamina_gain: number;\\n bladeburner_analysis: number;\\n bladeburner_success_chance: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface RunningScript {\\n /** Arguments the script was called with */\\n args: (string | number | boolean)[];\\n /** Filename of the script */\\n filename: string;\\n /**\\n * Script logs as an array. The newest log entries are at the bottom.\\n * Timestamps, if enabled, are placed inside `[brackets]` at the start of each line.\\n **/\\n logs: string[];\\n /** Total amount of hacking experience earned from this script when offline */\\n offlineExpGained: number;\\n /** Total amount of money made by this script when offline */\\n offlineMoneyMade: number;\\n /** Number of seconds that the script has been running offline */\\n offlineRunningTime: number;\\n /** Total amount of hacking experience earned from this script when online */\\n onlineExpGained: number;\\n /** Total amount of money made by this script when online */\\n onlineMoneyMade: number;\\n /** Number of seconds that this script has been running online */\\n onlineRunningTime: number;\\n /** Process ID. Must be an integer */\\n pid: number;\\n /** How much RAM this script uses for ONE thread */\\n ramUsage: number;\\n /** Hostname of the server on which this script runs */\\n server: string;\\n /** Number of threads that this script runs with */\\n threads: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface RecentScript extends RunningScript {\\n /** Timestamp of when the script was killed */\\n timeOfDeath: Date;\\n}\\n\\n/**\\n * Data representing the internal values of a crime.\\n * @public\\n */\\nexport interface CrimeStats {\\n /** Number representing the difficulty of the crime. Used for success chance calculations */\\n difficulty: number;\\n /** Amount of karma lost for successfully committing this crime */\\n karma: number;\\n /** How many people die as a result of this crime */\\n kills: number;\\n /** How much money is given */\\n money: number;\\n /** Name of crime */\\n name: string;\\n /** Milliseconds it takes to attempt the crime */\\n time: number;\\n /** Description of the crime activity */\\n type: string;\\n /** hacking level impact on success change of the crime */\\n hacking_success_weight: number;\\n /** strength level impact on success change of the crime */\\n strength_success_weight: number;\\n /** defense level impact on success change of the crime */\\n defense_success_weight: number;\\n /** dexterity level impact on success change of the crime */\\n dexterity_success_weight: number;\\n /** agility level impact on success change of the crime */\\n agility_success_weight: number;\\n /** charisma level impact on success change of the crime */\\n charisma_success_weight: number;\\n /** hacking exp gained from crime */\\n hacking_exp: number;\\n /** strength exp gained from crime */\\n strength_exp: number;\\n /** defense exp gained from crime */\\n defense_exp: number;\\n /** dexterity exp gained from crime */\\n dexterity_exp: number;\\n /** agility exp gained from crime */\\n agility_exp: number;\\n /** charisma exp gained from crime */\\n charisma_exp: number;\\n /** intelligence exp gained from crime */\\n intelligence_exp: number;\\n}\\n\\n/**\\n * Data representing the internal values of an Augmentation.\\n * @public\\n */\\nexport interface AugmentationStats {\\n /** Multiplier to hacking skill */\\n hacking?: number;\\n /** Multiplier to strength skill */\\n strength?: number;\\n /** Multiplier to defense skill */\\n defense?: number;\\n /** Multiplier to dexterity skill */\\n dexterity?: number;\\n /** Multiplier to agility skill */\\n agility?: number;\\n /** Multiplier to charisma skill */\\n charisma?: number;\\n /** Multiplier to hacking experience gain rate */\\n hacking_exp?: number;\\n /** Multiplier to strength experience gain rate */\\n strength_exp?: number;\\n /** Multiplier to defense experience gain rate */\\n defense_exp?: number;\\n /** Multiplier to dexterity experience gain rate */\\n dexterity_exp?: number;\\n /** Multiplier to agility experience gain rate */\\n agility_exp?: number;\\n /** Multiplier to charisma experience gain rate */\\n charisma_exp?: number;\\n /** Multiplier to chance of successfully performing a hack */\\n hacking_chance?: number;\\n /** Multiplier to hacking speed */\\n hacking_speed?: number;\\n /** Multiplier to amount of money the player gains from hacking */\\n hacking_money?: number;\\n /** Multiplier to amount of money injected into servers using grow */\\n hacking_grow?: number;\\n /** Multiplier to amount of reputation gained when working */\\n company_rep?: number;\\n /** Multiplier to amount of reputation gained when working */\\n faction_rep?: number;\\n /** Multiplier to amount of money gained from crimes */\\n crime_money?: number;\\n /** Multiplier to crime success rate */\\n crime_success?: number;\\n /** Multiplier to amount of money gained from working */\\n work_money?: number;\\n /** Multiplier to amount of money produced by Hacknet Nodes */\\n hacknet_node_money?: number;\\n /** Multiplier to cost of purchasing a Hacknet Node */\\n hacknet_node_purchase_cost?: number;\\n /** Multiplier to cost of ram for a Hacknet Node */\\n hacknet_node_ram_cost?: number;\\n /** Multiplier to cost of core for a Hacknet Node */\\n hacknet_node_core_cost?: number;\\n /** Multiplier to cost of leveling up a Hacknet Node */\\n hacknet_node_level_cost?: number;\\n /** Multiplier to Bladeburner max stamina */\\n bladeburner_max_stamina?: number;\\n /** Multiplier to Bladeburner stamina gain rate */\\n bladeburner_stamina_gain?: number;\\n /** Multiplier to effectiveness in Bladeburner Field Analysis */\\n bladeburner_analysis?: number;\\n /** Multiplier to success chance in Bladeburner contracts/operations */\\n bladeburner_success_chance?: number;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link NS.hack | hack}, {@link NS.grow | grow}, and {@link NS.weaken | weaken}.\\n * @public\\n */\\nexport interface BasicHGWOptions {\\n /** Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with. */\\n threads?: number;\\n /** Set to true this action will affect the stock market. */\\n stock?: boolean;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link CodingContract} attempt.\\n * @public\\n */\\nexport interface CodingAttemptOptions {\\n /** If truthy, then the function will return a string that states the contract’s reward when it is successfully solved. */\\n returnReward: boolean;\\n}\\n\\n/**\\n * Return value of {@link Sleeve.getSleevePurchasableAugs | getSleevePurchasableAugs}\\n * @public\\n */\\nexport interface AugmentPair {\\n /** augmentation name */\\n name: string;\\n /** augmentation cost */\\n cost: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport enum PositionTypes {\\n Long = \\\"L\\\",\\n Short = \\\"S\\\",\\n}\\n\\n/**\\n * @public\\n */\\nexport enum OrderTypes {\\n LimitBuy = \\\"Limit Buy Order\\\",\\n LimitSell = \\\"Limit Sell Order\\\",\\n StopBuy = \\\"Stop Buy Order\\\",\\n StopSell = \\\"Stop Sell Order\\\",\\n}\\n\\n/**\\n * Value in map of {@link StockOrder}\\n * @public\\n */\\nexport interface StockOrderObject {\\n /** Number of shares */\\n shares: number;\\n /** Price per share */\\n price: number;\\n /** Order type */\\n type: OrderTypes;\\n /** Order position */\\n position: PositionTypes;\\n}\\n\\n/**\\n * Return value of {@link TIX.getOrders | getOrders}\\n *\\n * Keys are stock symbols, properties are arrays of {@link StockOrderObject}\\n * @public\\n */\\nexport interface StockOrder {\\n [key: string]: StockOrderObject[];\\n}\\n\\n/**\\n * A single process on a server.\\n * @public\\n */\\nexport interface ProcessInfo {\\n /** Script name. */\\n filename: string;\\n /** Number of threads script is running with */\\n threads: number;\\n /** Script's arguments */\\n args: (string | number | boolean)[];\\n /** Process ID */\\n pid: number;\\n}\\n\\n/**\\n * Hack related multipliers.\\n * @public\\n */\\nexport interface HackingMultipliers {\\n /** Player's hacking chance multiplier. */\\n chance: number;\\n /** Player's hacking speed multiplier. */\\n speed: number;\\n /** Player's hacking money stolen multiplier. */\\n money: number;\\n /** Player's hacking growth multiplier */\\n growth: number;\\n}\\n\\n/**\\n * Hacknet related multipliers.\\n * @public\\n */\\nexport interface HacknetMultipliers {\\n /** Player's hacknet production multiplier */\\n production: number;\\n /** Player's hacknet purchase cost multiplier */\\n purchaseCost: number;\\n /** Player's hacknet ram cost multiplier */\\n ramCost: number;\\n /** Player's hacknet core cost multiplier */\\n coreCost: number;\\n /** Player's hacknet level cost multiplier */\\n levelCost: number;\\n}\\n\\n/**\\n * Hacknet node related constants\\n * @public\\n */\\nexport interface HacknetNodeConstants {\\n /** Amount of money gained per level */\\n MoneyGainPerLevel: number;\\n /** Base cost for a new node */\\n BaseCost: number;\\n /** Base cost per level */\\n LevelBaseCost: number;\\n /** Base cost to incrase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Multiplier to purchase new node */\\n PurchaseNextMult: number;\\n /** Multiplier to increase node level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Max node level */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n}\\n\\n/**\\n * Hacknet server related constants\\n * @public\\n */\\nexport interface HacknetServerConstants {\\n /** Number of hashes calculated per level */\\n HashesPerLevel: number;\\n /** Base cost for a new server */\\n BaseCost: number;\\n /** Base cost to increase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Base cost to upgrade cache */\\n CacheBaseCost: number;\\n /** Multiplier to purchase a new server */\\n PurchaseMult: number;\\n /** Multiplier to increase server level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Multiplier to upgrade cache */\\n UpgradeCacheMult: number;\\n /** Max number of servers */\\n MaxServers: number;\\n /** Max level for a server */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n /** Max cache size */\\n MaxCache: number;\\n}\\n\\n/**\\n * A single server.\\n * @public\\n */\\nexport interface Server {\\n /**\\n * How many CPU cores this server has. Maximum of 8.\\n * Affects magnitude of grow and weaken.\\n */\\n cpuCores: number;\\n\\n /** Flag indicating whether the FTP port is open */\\n ftpPortOpen: boolean;\\n\\n /** Flag indicating whether player has admin/root access to this server */\\n hasAdminRights: boolean;\\n\\n /** Hostname. Must be unique */\\n hostname: string;\\n\\n /** Flag indicating whether HTTP Port is open */\\n httpPortOpen: boolean;\\n\\n /** IP Address. Must be unique */\\n ip: string;\\n\\n /** Flag indicating whether player is currently connected to this server */\\n isConnectedTo: boolean;\\n\\n /** RAM (GB) available on this server */\\n maxRam: number;\\n\\n /**\\n * Name of company/faction/etc. that this server belongs to.\\n * Optional, not applicable to all Servers\\n */\\n organizationName: string;\\n\\n /** RAM (GB) used. i.e. unavailable RAM */\\n ramUsed: number;\\n\\n /** Flag indicating whether SMTP Port is open */\\n smtpPortOpen: boolean;\\n\\n /** Flag indicating whether SQL Port is open */\\n sqlPortOpen: boolean;\\n\\n /** Flag indicating whether the SSH Port is open */\\n sshPortOpen: boolean;\\n\\n /** Flag indicating whether this is a purchased server */\\n purchasedByPlayer: boolean;\\n\\n /** Flag indicating whether this server has a backdoor installed by a player */\\n backdoorInstalled: boolean;\\n\\n /**\\n * Initial server security level\\n * (i.e. security level when the server was created)\\n */\\n baseDifficulty: number;\\n\\n /** Server Security Level */\\n hackDifficulty: number;\\n\\n /** Minimum server security level that this server can be weakened to */\\n minDifficulty: number;\\n\\n /** How much money currently resides on the server and can be hacked */\\n moneyAvailable: number;\\n\\n /** Maximum amount of money that this server can hold */\\n moneyMax: number;\\n\\n /** Number of open ports required in order to gain admin/root access */\\n numOpenPortsRequired: number;\\n\\n /** How many ports are currently opened on the server */\\n openPortCount: number;\\n\\n /** Hacking level required to hack this server */\\n requiredHackingSkill: number;\\n\\n /**\\n * Parameter that affects how effectively this server's money can\\n * be increased using the grow() Netscript function\\n */\\n serverGrowth: number;\\n}\\n\\n/**\\n * All multipliers affecting the difficulty of the current challenge.\\n * @public\\n */\\nexport interface BitNodeMultipliers {\\n /** Influences how quickly the player's agility level (not exp) scales */\\n AgilityLevelMultiplier: number;\\n /** Influences the base cost to purchase an augmentation. */\\n AugmentationMoneyCost: number;\\n /** Influences the base rep the player must have with a faction to purchase an augmentation. */\\n AugmentationRepCost: number;\\n /** Influences how quickly the player can gain rank within Bladeburner. */\\n BladeburnerRank: number;\\n /** Influences the cost of skill levels from Bladeburner. */\\n BladeburnerSkillCost: number;\\n /** Influences how quickly the player's charisma level (not exp) scales */\\n CharismaLevelMultiplier: number;\\n /** Influences the experience gained for each ability when a player completes a class. */\\n ClassGymExpGain: number;\\n /** Influences the amount of money gained from completing Coding Contracts */\\n CodingContractMoney: number;\\n /** Influences the experience gained for each ability when the player completes working their job. */\\n CompanyWorkExpGain: number;\\n /** Influences how much money the player earns when completing working their job. */\\n CompanyWorkMoney: number;\\n /** Influences the money gain from dividends of corporations created by the player. */\\n CorporationSoftcap: number;\\n /** Influences the valuation of corporations created by the player. */\\n CorporationValuation: number;\\n /** Influences the base experience gained for each ability when the player commits a crime. */\\n CrimeExpGain: number;\\n /** Influences the base money gained when the player commits a crime. */\\n CrimeMoney: number;\\n /** Influences how many Augmentations you need in order to get invited to the Daedalus faction */\\n DaedalusAugsRequirement: number;\\n /** Influences how quickly the player's defense level (not exp) scales */\\n DefenseLevelMultiplier: number;\\n /** Influences how quickly the player's dexterity level (not exp) scales */\\n DexterityLevelMultiplier: number;\\n /** Influences how much rep the player gains in each faction simply by being a member. */\\n FactionPassiveRepGain: number;\\n /** Influences the experience gained for each ability when the player completes work for a Faction. */\\n FactionWorkExpGain: number;\\n /** Influences how much rep the player gains when performing work for a faction. */\\n FactionWorkRepGain: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data API */\\n FourSigmaMarketDataApiCost: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) */\\n FourSigmaMarketDataCost: number;\\n /** Influences the respect gain and money gain of your gang. */\\n GangSoftcap: number;\\n /** Influences the experienced gained when hacking a server. */\\n HackExpGain: number;\\n /** Influences how quickly the player's hacking level (not experience) scales */\\n HackingLevelMultiplier: number;\\n /** Influences how much money is produced by Hacknet Nodes and the hash rate of Hacknet Servers (unlocked in BitNode-9) */\\n HacknetNodeMoney: number;\\n /** Influences how much money it costs to upgrade your home computer's RAM */\\n HomeComputerRamCost: number;\\n /** Influences how much money is gained when the player infiltrates a company. */\\n InfiltrationMoney: number;\\n /** Influences how much rep the player can gain from factions when selling stolen documents and secrets */\\n InfiltrationRep: number;\\n /** Influences how much money can be stolen from a server when the player performs a hack against it through the Terminal. */\\n ManualHackMoney: number;\\n /** Influence how much it costs to purchase a server */\\n PurchasedServerCost: number;\\n /** Influences the maximum number of purchased servers you can have */\\n PurchasedServerLimit: number;\\n /** Influences the maximum allowed RAM for a purchased server */\\n PurchasedServerMaxRam: number;\\n /** Influences cost of any purchased server at or above 128GB */\\n PurchasedServerSoftcap: number;\\n /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */\\n RepToDonateToFaction: number;\\n /** Influences how much the money on a server can be reduced when a script performs a hack against it. */\\n ScriptHackMoney: number;\\n /** Influences how much of the money stolen by a scripted hack will be added to the player's money. */\\n ScriptHackMoneyGain: number;\\n /** Influences the growth percentage per cycle against a server. */\\n ServerGrowthRate: number;\\n /** Influences the maximum money that a server can grow to. */\\n ServerMaxMoney: number;\\n /** Influences the initial money that a server starts with. */\\n ServerStartingMoney: number;\\n /** Influences the initial security level (hackDifficulty) of a server. */\\n ServerStartingSecurity: number;\\n /** Influences the weaken amount per invocation against a server. */\\n ServerWeakenRate: number;\\n /** Influences how quickly the player's strength level (not exp) scales */\\n StrengthLevelMultiplier: number;\\n /** Influences the power of the gift */\\n StaneksGiftPowerMultiplier: number;\\n /** Influences the size of the gift */\\n StaneksGiftExtraSize: number;\\n /** Influences the hacking skill required to backdoor the world daemon. */\\n WorldDaemonDifficulty: number;\\n}\\n\\n/**\\n * Object representing all the values related to a hacknet node.\\n * @public\\n */\\nexport interface NodeStats {\\n /** Node's name */\\n name: string;\\n /** Node's level */\\n level: number;\\n /** Node's RAM (GB) */\\n ram: number;\\n /** Node's used RAM (GB) */\\n ramUsed?: number;\\n /** Node's number of cores */\\n cores: number;\\n /** Cache level. Only applicable for Hacknet Servers */\\n cache?: number;\\n /** Hash Capacity provided by this Node. Only applicable for Hacknet Servers */\\n hashCapacity?: number;\\n /** Node's production per second */\\n production: number;\\n /** Number of seconds since Node has been purchased */\\n timeOnline: number;\\n /** Total number of money Node has produced */\\n totalProduction: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface CharacterMult {\\n /** Agility stat */\\n agility: number;\\n /** Agility exp */\\n agilityExp: number;\\n /** Charisma stat */\\n charisma: number;\\n /** Charisma exp */\\n charismaExp: number;\\n /** Company reputation */\\n companyRep: number;\\n /** Money earned from crimes */\\n crimeMoney: number;\\n /** Crime success chance */\\n crimeSuccess: number;\\n /** Defense stat */\\n defense: number;\\n /** Defense exp */\\n defenseExp: number;\\n /** Dexterity stat */\\n dexterity: number;\\n /** Dexterity exp */\\n dexterityExp: number;\\n /** Faction reputation */\\n factionRep: number;\\n /** Hacking stat */\\n hacking: number;\\n /** Hacking exp */\\n hackingExp: number;\\n /** Strength stat */\\n strength: number;\\n /** Strength exp */\\n strengthExp: number;\\n /** Money earned from jobs */\\n workMoney: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface SleeveWorkGains {\\n /** Hacking exp gained from work */\\n workHackExpGain: number;\\n /** Strength exp gained from work */\\n workStrExpGain: number;\\n /** Defense exp gained from work, */\\n workDefExpGain: number;\\n /** Dexterity exp gained from work */\\n workDexExpGain: number;\\n /** Agility exp gained from work */\\n workAgiExpGain: number;\\n /** Charisma exp gained from work */\\n workChaExpGain: number;\\n /** Money gained from work */\\n workMoneyGain: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface SourceFileLvl {\\n /** The number of the source file */\\n n: number;\\n /** The level of the source file */\\n lvl: number;\\n}\\n\\n/**\\n * Bladeburner current action.\\n * @public\\n */\\nexport interface BladeburnerCurAction {\\n /** Type of Action */\\n type: string;\\n /** Name of Action */\\n name: string;\\n}\\n\\n/**\\n * Gang general info.\\n * @public\\n */\\nexport interface GangGenInfo {\\n /** Name of faction that the gang belongs to (\\\"Slum Snakes\\\", etc.) */\\n faction: string;\\n /** Indicating whether or not it's a hacking gang */\\n isHacking: boolean;\\n /** Money earned per game cycle */\\n moneyGainRate: number;\\n /** Gang's power for territory warfare */\\n power: number;\\n /** Gang's respect */\\n respect: number;\\n /** Respect earned per game cycle */\\n respectGainRate: number;\\n /** Amount of territory held */\\n territory: number;\\n /** Clash chance */\\n territoryClashChance: number;\\n /** Gang's wanted level */\\n wantedLevel: number;\\n /** Wanted level gained/lost per game cycle (negative for losses) */\\n wantedLevelGainRate: number;\\n /** Indicating if territory warfare is enabled */\\n territoryWarfareEngaged: boolean;\\n /** Number indicating the current wanted penalty */\\n wantedPenalty: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangOtherInfoObject {\\n /** Gang power */\\n power: number;\\n /** Gang territory, in decimal form */\\n territory: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangOtherInfo {\\n [key: string]: GangOtherInfoObject;\\n}\\n\\n/**\\n * Object representing data representing a gang member task.\\n * @public\\n */\\nexport interface GangTaskStats {\\n /** Task name */\\n name: string;\\n /** Task Description */\\n desc: string;\\n /** Is a task of a hacking gang */\\n isHacking: boolean;\\n /** Is a task of a combat gang */\\n isCombat: boolean;\\n /** Base respect earned */\\n baseRespect: number;\\n /** Base wanted earned */\\n baseWanted: number;\\n /** Base money earned */\\n baseMoney: number;\\n /** Hacking skill impact on task scaling */\\n hackWeight: number;\\n /** Strength skill impact on task scaling */\\n strWeight: number;\\n /** Defense skill impact on task scaling */\\n defWeight: number;\\n /** Dexterity skill impact on task scaling */\\n dexWeight: number;\\n /** Agility skill impact on task scaling */\\n agiWeight: number;\\n /** Charisma skill impact on task scaling */\\n chaWeight: number;\\n /** Number representing the difficulty of the task */\\n difficulty: number;\\n /** Territory impact on task scaling */\\n territory: GangTerritory;\\n}\\n\\n/**\\n * Object representing data representing a gang member equipment.\\n * @public\\n */\\nexport interface EquipmentStats {\\n /** Strength multiplier */\\n str?: number;\\n /** Defense multiplier */\\n def?: number;\\n /** Dexterity multiplier */\\n dex?: number;\\n /** Agility multiplier */\\n agi?: number;\\n /** Charisma multiplier */\\n cha?: number;\\n /** Hacking multiplier */\\n hack?: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangTerritory {\\n /** Money gain impact on task scaling */\\n money: number;\\n /** Respect gain impact on task scaling */\\n respect: number;\\n /** Wanted gain impact on task scaling */\\n wanted: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangMemberInfo {\\n /** Name of the gang member */\\n name: string;\\n /** Currently assigned task */\\n task: string;\\n earnedRespect: number;\\n\\n /** Hack skill level */\\n hack: number;\\n /** Strength skill level */\\n str: number;\\n /** Defense skill level */\\n def: number;\\n /** Dexterity skill level */\\n dex: number;\\n /** Agility skill level */\\n agi: number;\\n /** Charisma skill level */\\n cha: number;\\n\\n /** Current hack experience */\\n hack_exp: number;\\n /** Current strength experience */\\n str_exp: number;\\n /** Current defense experience */\\n def_exp: number;\\n /** Current dexterity experience */\\n dex_exp: number;\\n /** Current agility experience */\\n agi_exp: number;\\n /** Current charisma experience */\\n cha_exp: number;\\n\\n /** Hack multiplier from equipment */\\n hack_mult: number;\\n /** Strength multiplier from equipment */\\n str_mult: number;\\n /** Defense multiplier from equipment */\\n def_mult: number;\\n /** Dexterity multiplier from equipment */\\n dex_mult: number;\\n /** Agility multiplier from equipment */\\n agi_mult: number;\\n /** Charisma multiplier from equipment */\\n cha_mult: number;\\n\\n /** Hack multiplier from ascensions */\\n hack_asc_mult: number;\\n /** Strength multiplier from ascensions */\\n str_asc_mult: number;\\n /** Defense multiplier from ascensions */\\n def_asc_mult: number;\\n /** Dexterity multiplier from ascensions */\\n dex_asc_mult: number;\\n /** Agility multiplier from ascensions */\\n agi_asc_mult: number;\\n /** Charisma multiplier from ascensions */\\n cha_asc_mult: number;\\n\\n /** Total earned hack experience */\\n hack_asc_points: number;\\n /** Total earned strength experience */\\n str_asc_points: number;\\n /** Total earned defense experience */\\n def_asc_points: number;\\n /** Total earned dexterity experience */\\n dex_asc_points: number;\\n /** Total earned agility experience */\\n agi_asc_points: number;\\n /** Total earned charisma experience */\\n cha_asc_points: number;\\n\\n upgrades: string[];\\n augmentations: string[];\\n\\n respectGain: number;\\n wantedLevelGain: number;\\n moneyGain: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangMemberAscension {\\n /** Amount of respect lost from ascending */\\n respect: number;\\n /** Hacking multiplier gained from ascending */\\n hack: number;\\n /** Strength multiplier gained from ascending */\\n str: number;\\n /** Defense multiplier gained from ascending */\\n def: number;\\n /** Dexterity multiplier gained from ascending */\\n dex: number;\\n /** Agility multiplier gained from ascending */\\n agi: number;\\n /** Charisma multiplier gained from ascending */\\n cha: number;\\n}\\n\\n/**\\n * Object representing a sleeve stats.\\n * @public\\n */\\nexport interface SleeveSkills {\\n /** Current shock of the sleeve [0-100] */\\n shock: number;\\n /** Current sync of the sleeve [0-100] */\\n sync: number;\\n /** Current memory of the sleeve [1-100] */\\n memory: number;\\n /** Current hacking skill of the sleeve */\\n hacking: number;\\n /** Current strength of the sleeve */\\n strength: number;\\n /** Current defense of the sleeve */\\n defense: number;\\n /** Current dexterity of the sleeve */\\n dexterity: number;\\n /** Current agility of the sleeve */\\n agility: number;\\n /** Current charisma of the sleeve */\\n charisma: number;\\n}\\n\\n/**\\n * Object representing sleeve information.\\n * @public\\n */\\nexport interface SleeveInformation {\\n /** Location of the sleeve */\\n city: string;\\n /** hp of the sleeve */\\n hp: HP;\\n /** Jobs available to the sleeve */\\n jobs: string[];\\n /** Job titles available to the sleeve */\\n jobTitle: string[];\\n /** Does this sleeve have access to the tor router */\\n tor: boolean;\\n /** Sleeve multipliers */\\n mult: CharacterMult;\\n}\\n\\n/**\\n * Object representing a sleeve current task.\\n * @public\\n */\\nexport type SleeveTask = any;\\n\\n/**\\n * Object representing a port. A port is a serialized queue.\\n * @public\\n */\\nexport interface NetscriptPort {\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns The data popped off the queue if it was full.\\n */\\n write(value: string | number): null | string | number;\\n\\n /**\\n * Attempt to write data to the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns True if the data was added to the port, false if the port was full\\n */\\n tryWrite(value: string | number): boolean;\\n\\n /**\\n * Shift an element out of the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function will remove the first element from the port and return it.\\n * If the port is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n read(): string | number;\\n\\n /**\\n * Retrieve the first element from the port without removing it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n * @returns the data read\\n */\\n peek(): string | number;\\n\\n /**\\n * Check if the port is full.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is full, otherwise false\\n */\\n full(): boolean;\\n\\n /**\\n * Check if the port is empty.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is empty, otherwise false\\n */\\n empty(): boolean;\\n\\n /**\\n * Empties all data from the port.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clear(): void;\\n}\\n\\n/**\\n * Stock market API\\n * @public\\n */\\nexport interface TIX {\\n /**\\n * Returns true if the player has access to a WSE Account\\n * @remarks RAM cost: 0.05 GB\\n */\\n hasWSEAccount(): boolean;\\n /**\\n * Returns true if the player has access to the TIX API\\n * @remarks RAM cost: 0.05 GB\\n */\\n hasTIXAPIAccess(): boolean;\\n /**\\n * Returns true if the player has access to the 4S Data\\n * @remarks RAM cost: 0.05 GB\\n */\\n has4SData(): boolean;\\n /**\\n * Returns true if the player has access to the 4SData TIX API\\n * @remarks RAM cost: 0.05 GB\\n */\\n has4SDataTIXAPI(): boolean;\\n /**\\n * Returns an array of the symbols of the tradable stocks\\n *\\n * @remarks RAM cost: 2 GB\\n * @returns Array of the symbols of the tradable stocks.\\n */\\n getSymbols(): string[];\\n\\n /**\\n * Returns the price of a stock\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n * The stock’s price is the average of its bid and ask price.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * stock.getPrice(\\\"FISG\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.stock.getPrice(\\\"FISG\\\");\\n * ```\\n * @param sym - Stock symbol.\\n * @returns The price of a stock.\\n */\\n getPrice(sym: string): number;\\n\\n /**\\n * Returns the ask price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The ask price of a stock.\\n */\\n getAskPrice(sym: string): number;\\n\\n /**\\n * Returns the bid price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The bid price of a stock.\\n */\\n getBidPrice(sym: string): number;\\n\\n /**\\n * Returns the player’s position in a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * Returns an array of four elements that represents the player’s position in a stock.\\n *\\n * The first element is the returned array is the number of shares the player owns of\\n * the stock in the Long position. The second element in the array is the average price\\n * of the player’s shares in the Long position.\\n *\\n * The third element in the array is the number of shares the player owns of the stock\\n * in the Short position. The fourth element in the array is the average price of the\\n * player’s Short position.\\n *\\n * All elements in the returned array are numeric.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * var pos = stock.getPosition(\\\"ECP\\\");\\n * var shares = pos[0];\\n * var avgPx = pos[1];\\n * var sharesShort = pos[2];\\n * var avgPxShort = pos[3];\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * const [shares, avgPx, sharesShort, avgPxShort] = ns.stock.getPosition(\\\"ECP\\\");\\n * ```\\n * @param sym - Stock symbol.\\n * @returns Array of four elements that represents the player’s position in a stock.\\n */\\n getPosition(sym: string): [number, number, number, number];\\n\\n /**\\n * Returns the maximum number of shares of a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * This is the maximum amount of the stock that can be purchased\\n * in both the Long and Short positions combined.\\n *\\n * @param sym - Stock symbol.\\n * @returns Maximum number of shares that the stock has.\\n */\\n getMaxShares(sym: string): number;\\n\\n /**\\n * Calculates cost of buying stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much it would cost to buy a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchase.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Cost to buy a given number of shares of a stock.\\n */\\n getPurchaseCost(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Calculate profit of selling stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much you would gain from selling a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Gain from selling a given number of shares of a stock.\\n */\\n getSaleGain(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Buy stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase shares of a stock using a Market Order.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If this function successfully purchases the shares, it will return the stock price at which\\n * each share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n buyStock(sym: string, shares: number): number;\\n\\n /**\\n * Sell stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell shares of a stock using a Market Order.\\n *\\n * If the specified number of shares in the function exceeds the amount that the player\\n * actually owns, then this function will sell all owned shares. Remember that every\\n * transaction on the stock exchange costs a certain commission fee.\\n *\\n * The net profit made from selling stocks with this function is reflected in the script’s\\n * statistics. This net profit is calculated as:\\n *\\n * shares * (sell_price - average_price_of_purchased_shares)\\n *\\n * If the sale is successful, this function will return the stock price at\\n * which each share was sold. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sellStock(sym: string, shares: number): number;\\n\\n /**\\n * Short stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If the purchase is successful, this function will return the stock price at which each\\n * share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n buyShort(sym: string, shares: number): number;\\n\\n /**\\n * Sell short stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the specified number of shares exceeds the amount that the player actually owns,\\n * then this function will sell all owned shares. Remember that every transaction on\\n * the stock exchange costs a certain commission fee.\\n *\\n * If the sale is successful, this function will return the stock price at which each\\n * share was sold. Otherwise it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sellShort(sym: string, shares: number): number;\\n\\n /**\\n * Place order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Places an order on the stock market. This function only works for Limit and Stop Orders.\\n *\\n * The ability to place limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * Returns true if the order is successfully placed, and false otherwise.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n * @returns True if the order is successfully placed, and false otherwise.\\n */\\n placeOrder(sym: string, shares: number, price: number, type: string, pos: string): boolean;\\n\\n /**\\n * Cancel order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Cancels an oustanding Limit or Stop order on the stock market.\\n *\\n * The ability to use limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n */\\n cancelOrder(sym: string, shares: number, price: number, type: string, pos: string): void;\\n\\n /**\\n * Returns your order book for the stock market.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * This is an object containing information for all the Limit and Stop Orders you have in the stock market.\\n * For each symbol you have a position in, the returned object will have a key with that symbol's name.\\n * The object's properties are each an array of {@link StockOrderObject}\\n * The object has the following structure:\\n *\\n * ```ts\\n * {\\n * string1: [ // Array of orders for this stock\\n * {\\n * shares: Order quantity\\n * price: Order price\\n * type: Order type\\n * position: Either \\\"L\\\" or \\\"S\\\" for Long or Short position\\n * },\\n * {\\n * ...\\n * },\\n * ...\\n * ],\\n * string2: [ // Array of orders for this stock\\n * ...\\n * ],\\n * ...\\n * }\\n * ```\\n * The “Order type” property can have one of the following four values: \\\"Limit Buy Order\\\", \\\"Limit Sell Order\\\", \\\"Stop Buy Order\\\", \\\"Stop Sell Order\\\".\\n * Note that the order book will only contain information for stocks that you actually have orders in.\\n *\\n * @example\\n * ```ts\\n * \\\"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\\\"\\n * {\\n * ECP: [\\n * {\\n * shares: 5,\\n * price: 100,000\\n * type: \\\"Stop Buy Order\\\",\\n * position: \\\"S\\\",\\n * },\\n * {\\n * shares: 25,\\n * price: 125,000\\n * type: \\\"Limit Sell Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * SYSC: [\\n * {\\n * shares: 100,\\n * price: 10,000\\n * type: \\\"Limit Buy Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * }\\n * ```\\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\\n */\\n getOrders(): StockOrder;\\n\\n /**\\n * Returns the volatility of the specified stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Volatility represents the maximum percentage by which a stock’s price can change every tick.\\n * The volatility is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a volatility of 3%, then this function will return 0.03, NOT 3).\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Volatility of the specified stock.\\n */\\n getVolatility(sym: string): number;\\n\\n /**\\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * The probability is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a 60% chance of increasing, then this function will return 0.6, NOT 60).\\n *\\n * In other words, if this function returned 0.30 for a stock, then this means that the stock’s price has a\\n * 30% chance of increasing and a 70% chance of decreasing during the next tick.\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n */\\n getForecast(sym: string): number;\\n\\n /**\\n * Purchase 4S Market Data Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketData(): boolean;\\n\\n /**\\n * Purchase 4S Market Data TIX API Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketDataTixApi(): boolean;\\n\\n /**\\n * Purchase WSE Account.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchaseWseAccount(): boolean;\\n\\n /**\\n * Purchase TIX API Access\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchaseTixApi(): boolean;\\n}\\n\\n/**\\n * Singularity API\\n * @remarks\\n * This API requires Source-File 4 to use. The RAM cost of all these functions is multiplied by 16/4/1 based on Source-File 4 levels.\\n * @public\\n */\\nexport interface Singularity {\\n /**\\n * Take university class.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start taking a course at a university.\\n * If you are already in the middle of some “working” action (such as working at a\\n * company, for a faction, or on a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these universities and classes are the same as\\n * if you were to manually visit and take these classes.\\n *\\n * @param universityName - Name of university. You must be in the correct city for whatever university you specify.\\n * @param courseName - Name of course.\\n * @param focus - Acquire player focus on this class. Optional. Defaults to true.\\n * @returns True if action is successfully started, false otherwise.\\n */\\n universityCourse(universityName: string, courseName: string, focus?: boolean): boolean;\\n\\n /**\\n * Workout at the gym.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n\\n * This function will automatically set you to start working out at a gym to train\\n * a particular stat. If you are already in the middle of some “working” action\\n * (such as working at a company, for a faction, or on a program), then running\\n * this function will automatically cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these gyms are the same as if you were\\n * to manually visit these gyms and train\\n *\\n * @param gymName - Name of gym. You must be in the correct city for whatever gym you specify.\\n * @param stat - The stat you want to train.\\n * @param focus - Acquire player focus on this gym workout. Optional. Defaults to true.\\n * @returns True if actions is successfully started, false otherwise.\\n */\\n gymWorkout(gymName: string, stat: string, focus?: boolean): boolean;\\n\\n /**\\n * Travel to another city.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows the player to travel to any city. The cost for using this\\n * function is the same as the cost for traveling through the Travel Agency.\\n *\\n * @param city - City to travel to.\\n * @returns True if action is successful, false otherwise.\\n */\\n travelToCity(city: string): boolean;\\n\\n /**\\n * Purchase the TOR router.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase a TOR router. The cost for\\n * purchasing a TOR router using this function is the same as if you were to\\n * manually purchase one.\\n *\\n * @returns True if actions is successful or you already own TOR router, false otherwise.\\n */\\n purchaseTor(): boolean;\\n\\n /**\\n * Purchase a program from the dark web.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase programs. You MUST have a\\n * TOR router in order to use this function. The cost of purchasing programs\\n * using this function is the same as if you were purchasing them through the Dark\\n * Web using the Terminal buy command.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to purchase.\\n * @returns True if the specified program is purchased, and false otherwise.\\n */\\n purchaseProgram(programName: string): boolean;\\n\\n /**\\n * Check if the player is busy.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * Returns a boolean indicating whether or not the player is currently performing an\\n * ‘action’. These actions include working for a company/faction, studying at a university,\\n * working out at a gym, creating a program, committing a crime, or carrying out a Hacking Mission.\\n *\\n * @returns True if the player is currently performing an ‘action’, false otherwise.\\n */\\n isBusy(): boolean;\\n\\n /**\\n * Stop the current action.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function is used to end whatever ‘action’ the player is currently performing.\\n * The player will receive whatever money/experience/etc. he has earned from that action.\\n *\\n * The actions that can be stopped with this function are:\\n *\\n * * Studying at a university\\n * * Working out at a gym\\n * * Working for a company/faction\\n * * Creating a program\\n * * Committing a crime\\n *\\n * This function will return true if the player’s action was ended.\\n * It will return false if the player was not performing an action when this function was called.\\n *\\n * @returns True if the player’s action was ended, false if the player was not performing an action.\\n */\\n stopAction(): boolean;\\n\\n /**\\n * Upgrade home computer RAM.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of RAM on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeRam(): boolean;\\n\\n /**\\n * Upgrade home computer cores.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of cores on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer cores is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer cores is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeCores(): boolean;\\n\\n /**\\n * Get the price of upgrading home RAM.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer RAM.\\n *\\n * @returns Cost of upgrading the player’s home computer RAM.\\n */\\n getUpgradeHomeRamCost(): number;\\n\\n /**\\n * Get the price of upgrading home cores.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer cores.\\n *\\n * @returns Cost of upgrading the player’s home computer cores.\\n */\\n getUpgradeHomeCoresCost(): number;\\n\\n /**\\n * Work for a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working at the company\\n * at which you are employed. If you are already in the middle of some “working”\\n * action (such as working for a faction, training at a gym, or creating a program),\\n * then running this function will automatically cancel that action and give you\\n * your earnings.\\n *\\n * This function will return true if the player starts working, and false otherwise.\\n *\\n * Note that when you are working for a company, you will not actually receive your earnings (reputation, money, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getCompanyRep(COMPANY HERE) < VALUE) {\\n * workForCompany();\\n * sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getCompanyRep(COMPANY HERE) < VALUE) {\\n * ns.workForCompany();\\n * await ns.sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @param companyName - Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForCompany(companyName: string, focus?: boolean): boolean;\\n\\n /**\\n * Quit jobs by company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will finish work with the company provided and quit any jobs.\\n *\\n * @param companyName - Name of the company.\\n */\\n quitJob(companyName?: string): void;\\n\\n /**\\n * Apply for a job at a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically try to apply to the specified company\\n * for a position in the specified field. This function can also be used to\\n * apply for promotions by specifying the company and field you are already\\n * employed at.\\n *\\n * This function will return true if you successfully get a job/promotion,\\n * and false otherwise. Note that if you are trying to use this function to\\n * apply for a promotion and you don’t get one, it will return false.\\n *\\n * @param companyName - Name of company to apply to.\\n * @param field - Field to which you want to apply.\\n * @returns True if the player successfully get a job/promotion, and false otherwise.\\n */\\n applyToCompany(companyName: string, field: string): boolean;\\n\\n /**\\n * Get company reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of reputation you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of reputation you have at the specified company.\\n */\\n getCompanyRep(companyName: string): number;\\n\\n /**\\n * Get company favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you have at the specified company.\\n */\\n getCompanyFavor(companyName: string): number;\\n\\n /**\\n * Get company favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you will gain for the specified\\n * company when you reset by installing Augmentations.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you gain at the specified company when you reset by installing Augmentations.\\n */\\n getCompanyFavorGain(companyName: string): number;\\n\\n /**\\n * List all current faction invitations.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * Returns an array with the name of all Factions you currently have oustanding invitations from.\\n *\\n * @returns Array with the name of all Factions you currently have oustanding invitations from.\\n */\\n checkFactionInvitations(): string[];\\n\\n /**\\n * Join a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically accept an invitation from a faction and join it.\\n *\\n * @param faction - Name of faction to join.\\n * @returns True if player joined the faction, and false otherwise.\\n */\\n joinFaction(faction: string): boolean;\\n\\n /**\\n * Work for a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working for the specified faction.\\n * Obviously, you must be a member of the faction or else this function will fail. If\\n * you are already in the middle of some “working” action (such as working for a company,\\n * training at a gym, or creating a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * This function will return true if you successfully start working for the specified faction, and false otherwise.\\n *\\n * Note that when you are working for a faction, you will not actually receive your earnings (reputation, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getFactionRep(FACTION NAME) < VALUE) {\\n * workForFaction(FACNAME, WORKTYPE);\\n * sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getFactionRep(FACTION NAME) < VALUE) {\\n * ns.workForFaction(FACNAME, WORKTYPE);\\n * await ns.sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @param faction - Name of faction to work for.\\n * @param workType - Type of work to perform for the faction.\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForFaction(faction: string, workType: string, focus?: boolean): boolean;\\n\\n /**\\n * Get faction reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of reputation you have for the specified faction.\\n *\\n * @param faction - Name of faction to work for.\\n * @returns Amount of reputation you have for the specified faction.\\n */\\n getFactionRep(faction: string): number;\\n\\n /**\\n * Get faction favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you have for the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you have for the specified faction.\\n */\\n getFactionFavor(faction: string): number;\\n\\n /**\\n * Get faction favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you will gain for the specified\\n * faction when you reset by installing Augmentations.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you will gain for the specified faction when you reset by installing Augmentations.\\n */\\n getFactionFavorGain(faction: string): number;\\n\\n /**\\n * Donate to a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Attempts to donate money to the specified faction in exchange for reputation.\\n * Returns true if you successfully donate the money, and false otherwise.\\n *\\n * @param faction - Name of faction to donate to.\\n * @param amount - Amount of money to donate.\\n * @returns True if the money was donated, and false otherwise.\\n */\\n donateToFaction(faction: string, amount: number): boolean;\\n\\n /**\\n * Create a program.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working on creating the\\n * specified program. If you are already in the middle of some “working” action\\n * (such as working for a company, training at a gym, or taking a course), then\\n * running this function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns true if you successfully start working on the specified program, and false otherwise.\\n *\\n * Note that creating a program using this function has the same hacking level requirements as it normally would. These level requirements are:\\n * * BruteSSH.exe: 50\\n * * FTPCrack.exe: 100\\n * * relaySMTP.exe: 250\\n * * HTTPWorm.exe: 500\\n * * SQLInject.exe: 750\\n * * DeepscanV1.exe: 75\\n * * DeepscanV2.exe: 400\\n * * ServerProfiler.exe: 75\\n * * AutoLink.exe: 25\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * createProgram(“relaysmtp.exe”);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.createProgram(“relaysmtp.exe”);\\n * ```\\n * @param program - Name of program to create.\\n * @param focus - Acquire player focus on this program creation. Optional. Defaults to true.\\n * @returns True if you successfully start working on the specified program, and false otherwise.\\n */\\n createProgram(program: string, focus?: boolean): boolean;\\n\\n /**\\n * Commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function is used to automatically attempt to commit crimes.\\n * If you are already in the middle of some ‘working’ action (such\\n * as working for a company or training at a gym), then running this\\n * function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns the number of milliseconds it takes to attempt the\\n * specified crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime,\\n * so running `commitCrime('rob store')` will return 60,000).\\n *\\n * Warning: I do not recommend using the time returned from this function to try\\n * and schedule your crime attempts. Instead, I would use the isBusy Singularity\\n * function to check whether you have finished attempting a crime. This is because\\n * although the game sets a certain crime to be X amount of seconds, there is no\\n * guarantee that your browser will follow that time limit.\\n *\\n * @param crime - Name of crime to attempt.\\n * @param focus - Acquire player focus on this program creation. Optional. Defaults to true.\\n * @returns The number of milliseconds it takes to attempt the specified crime.\\n */\\n commitCrime(crime: string, focus?: boolean): number;\\n\\n /**\\n * Get chance to successfully commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns your chance of success at commiting the specified crime.\\n *\\n * @param crime - Name of crime.\\n * @returns Chance of success at commiting the specified crime.\\n */\\n getCrimeChance(crime: string): number;\\n\\n /**\\n * Get stats related to a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns the stats of the crime.\\n *\\n * @param crime - Name of crime. Not case-sensitive\\n * @returns The stats of the crime.\\n */\\n getCrimeStats(crime: string): CrimeStats;\\n\\n /**\\n * Get a list of owned augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array containing the names (as strings) of all Augmentations you have.\\n *\\n * @param purchased - Specifies whether the returned array should include Augmentations you have purchased but not yet installed. By default, this argument is false which means that the return value will NOT have the purchased Augmentations.\\n * @returns Array containing the names (as strings) of all Augmentations you have.\\n */\\n getOwnedAugmentations(purchased?: boolean): string[];\\n\\n /**\\n * Get a list of acquired Source-Files.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns an array of source files\\n *\\n * @returns Array containing an object with number and level of the source file.\\n */\\n getOwnedSourceFiles(): SourceFileLvl[];\\n\\n /**\\n * Get a list of augmentation available from a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns an array containing the names (as strings) of all Augmentations\\n * that are available from the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Array containing the names of all Augmentations.\\n */\\n getAugmentationsFromFaction(faction: string): string[];\\n\\n /**\\n * Get the pre-requisite of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n * If there are no prerequisites, a blank array is returned.\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n */\\n getAugmentationPrereq(augName: string): string[];\\n\\n /**\\n * Get the price and reputation of an augmentation.\\n * @deprecated use getAugmentationPrice getAugmentationRepCost\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with two elements that gives the cost for\\n * the specified Augmentation. The first element in the returned array is the\\n * reputation requirement of the Augmentation, and the second element is the\\n * money cost.\\n *\\n * If an invalid Augmentation name is passed in for the augName argument, this\\n * function will return the array [-1, -1].\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with first element as a reputation requirement and second element as the money cost.\\n */\\n getAugmentationCost(augName: string): [number, number];\\n\\n /**\\n * Get price of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Price of the augmentation.\\n */\\n getAugmentationPrice(augName: string): number;\\n\\n /**\\n * Get base price of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Base price of the augmentation, before price multiplier.\\n */\\n getAugmentationBasePrice(augName: string): number;\\n\\n /**\\n * Get reputation requirement of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Reputation requirement of the augmentation.\\n */\\n getAugmentationRepReq(augName: string): number;\\n\\n /**\\n * Purchase an augmentation\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will try to purchase the specified Augmentation through the given Faction.\\n *\\n * This function will return true if the Augmentation is successfully purchased, and false otherwise.\\n *\\n * @param faction - Name of faction to purchase Augmentation from.\\n * @param augmentation - Name of Augmentation to purchase.\\n * @returns True if the Augmentation is successfully purchased, and false otherwise.\\n */\\n purchaseAugmentation(faction: string, augmentation: string): boolean;\\n\\n /**\\n * Get the stats of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns augmentation stats.\\n *\\n * @param name - Name of Augmentation. CASE-SENSITIVE.\\n * @returns Augmentation stats.\\n */\\n getAugmentationStats(name: string): AugmentationStats;\\n\\n /**\\n * Install your purchased augmentations.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically install your Augmentations, resetting the game as usual. If you do not own uninstalled Augmentations then the game will not reset.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n installAugmentations(cbScript?: string): void;\\n\\n /**\\n * Hospitalize the player.\\n * @remarks\\n * RAM cost: 0.25 GB * 16/4/1\\n */\\n hospitalize(): void;\\n\\n /**\\n * Soft reset the game.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will perform a reset even if you don’t have any augmentation installed.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n softReset(cbScript: string): void;\\n\\n /**\\n * Go to a location.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Move the player to a specific location.\\n *\\n * @param locationName - Name of the location.\\n * @returns True if the player was moved there, false otherwise.\\n */\\n goToLocation(locationName: string): boolean;\\n\\n /**\\n * Get the current server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Name of the current server.\\n */\\n getCurrentServer(): string;\\n\\n /**\\n * Connect to a server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * Run the connect HOSTNAME command in the terminal. Can only connect to neighbors.\\n *\\n * @returns True if the connect command was successful, false otherwise.\\n */\\n connect(hostname: string): boolean;\\n\\n /**\\n * Run the hack command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Amount of money stolen by manual hacking.\\n */\\n manualHack(): Promise;\\n\\n /**\\n * Run the backdoor command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Promise waiting for the installation to finish.\\n */\\n installBackdoor(): Promise;\\n\\n /**\\n * Check if the player is focused.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n *\\n * @returns True if the player is focused.\\n */\\n isFocused(): boolean;\\n\\n /**\\n * Set the players focus.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n * @returns True if the focus was changed.\\n */\\n setFocus(focus: boolean): boolean;\\n\\n /**\\n * Get a list of programs offered on the dark web.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function allows the player to get a list of programs available for purchase\\n * on the dark web. Players MUST have purchased Tor to get the list of programs\\n * available. If Tor has not been purchased yet, this function will return an\\n * empty list.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @returns - a list of programs available for purchase on the dark web, or [] if Tor has not\\n * been purchased\\n */\\n getDarkwebPrograms(): string[];\\n\\n /**\\n * Check the price of an exploit on the dark web\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * This function allows you to check the price of a darkweb exploit/program.\\n * You MUST have a TOR router in order to use this function. The price returned\\n * by this function is the same price you would see with buy -l from the terminal.\\n * Returns the cost of the program if it has not been purchased yet, 0 if it\\n * has already been purchased, or -1 if Tor has not been purchased (and thus\\n * the program/exploit is not available for purchase).\\n *\\n * If the program does not exist, an error is thrown.\\n *\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to check the price of\\n * @returns Price of the specified darkweb program\\n * (if not yet purchased), 0 if it has already been purchased, or -1 if Tor has not been\\n * purchased. Throws an error if the specified program/exploit does not exist\\n */\\n getDarkwebProgramCost(programName: string): number;\\n\\n /**\\n * b1t_flum3 into a different BN.\\n * @remarks\\n * RAM cost: 16 GB * 16/4/1\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n b1tflum3(nextBN: number, callbackScript?: string): void;\\n\\n /**\\n * Destroy the w0r1d_d43m0n and move on to the next BN.\\n * @remarks\\n * RAM cost: 32 GB * 16/4/1\\n *\\n * You must have the special augment installed and the required hacking level\\n * OR\\n * Completed the final black op.\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n destroyW0r1dD43m0n(nextBN: number, callbackScript?: string): void;\\n\\n /**\\n * Get the current work the player is doing.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n * @returns - An object representing the current work. Fields depend on the kind of work.\\n */\\n getCurrentWork(): any | null;\\n}\\n\\n/**\\n * Hacknet API\\n * @remarks\\n * Not all these functions are immediately available.\\n * @public\\n */\\nexport interface Hacknet {\\n /**\\n * Get the number of hacknet nodes you own.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the number of Hacknet Nodes you own.\\n *\\n * @returns Number of hacknet nodes.\\n */\\n numNodes(): number;\\n\\n /**\\n * Get the maximum number of hacknet nodes.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns Maximum number of hacknet nodes.\\n */\\n maxNumNodes(): number;\\n\\n /**\\n * Purchase a new hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Purchases a new Hacknet Node. Returns a number with the index of the\\n * Hacknet Node. This index is equivalent to the number at the end of\\n * the Hacknet Node’s name (e.g The Hacknet Node named `hacknet-node-4`\\n * will have an index of 4).\\n *\\n * If the player cannot afford to purchase a new Hacknet Node then the function will return -1.\\n *\\n * @returns The index of the Hacknet Node or if the player cannot afford to purchase a new Hacknet Node the function will return -1.\\n */\\n purchaseNode(): number;\\n\\n /**\\n * Get the price of the next hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of purchasing a new Hacknet Node.\\n *\\n * @returns Cost of purchasing a new Hacknet Node.\\n */\\n getPurchaseNodeCost(): number;\\n\\n /**\\n * Get the stats of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns an object containing a variety of stats about the specified Hacknet Node.\\n *\\n * Note that for Hacknet Nodes, production refers to the amount of money the node generates.\\n * For Hacknet Servers (the upgraded version of Hacknet Nodes), production refers to the\\n * amount of hashes the node generates.\\n *\\n * @param index - Index/Identifier of Hacknet Node\\n * @returns Object containing a variety of stats about the specified Hacknet Node.\\n */\\n getNodeStats(index: number): NodeStats;\\n\\n /**\\n * Upgrade the level of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the level of the specified Hacknet Node by n.\\n *\\n * Returns true if the Hacknet Node’s level is successfully upgraded by n\\n * or if it is upgraded by some positive amount and the Node reaches its max level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s level is successfully upgraded, false otherwise.\\n */\\n upgradeLevel(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the RAM of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the specified Hacknet Node’s RAM n times.\\n * Note that each upgrade doubles the Node’s RAM.\\n * So this is equivalent to multiplying the Node’s RAM by 2 n.\\n *\\n * Returns true if the Hacknet Node’s RAM is successfully upgraded n times\\n * or if it is upgraded some positive number of times and the Node reaches its max RAM.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s RAM is successfully upgraded, false otherwise.\\n */\\n upgradeRam(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the core of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to purchase n cores for the specified Hacknet Node.\\n *\\n * Returns true if it successfully purchases n cores for the Hacknet Node\\n * or if it purchases some positive amount and the Node reaches its max number of cores.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cores are successfully purchased, false otherwise.\\n */\\n upgradeCore(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the cache of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Tries to upgrade the specified Hacknet Server’s cache n times.\\n *\\n * Returns true if it successfully upgrades the Server’s cache n times,\\n * or if it purchases some positive amount and the Server reaches its max cache level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cache level is successfully upgraded, false otherwise.\\n */\\n upgradeCache(index: number, n: number): boolean;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node levels.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the specified Hacknet Node by n levels.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node.\\n */\\n getLevelUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node RAM.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the RAM of the specified Hacknet Node n times.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node already has max RAM, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's RAM.\\n */\\n getRamUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cores.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the number of cores of the specified Hacknet Node by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's number of cores.\\n */\\n getCoreUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cache.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the cost of upgrading the cache level of the specified Hacknet Server by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's cache.\\n */\\n getCacheUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Get the total number of hashes stored.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you have.\\n *\\n * @returns Number of hashes you have.\\n */\\n numHashes(): number;\\n\\n /**\\n * Get the maximum number of hashes you can store.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you can store.\\n *\\n * @returns Number of hashes you can store.\\n */\\n hashCapacity(): number;\\n\\n /**\\n * Get the cost of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes required for the specified upgrade. The name of the upgrade must be an exact match.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {\\n * hacknet.spendHashes(upgradeName);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) {\\n * ns.hacknet.spendHashes(upgradeName);\\n * }\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.\\n * @returns Number of hashes required for the specified upgrade.\\n */\\n hashCost(upgName: string, count?: number): number;\\n\\n /**\\n * Purchase a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Spend the hashes generated by your Hacknet Servers on an upgrade.\\n * Returns a boolean value - true if the upgrade is successfully purchased, and false otherwise.\\n *\\n * The name of the upgrade must be an exact match.\\n * The `upgTarget` argument is used for upgrades such as `Reduce Minimum Security`, which applies to a specific server.\\n * In this case, the `upgTarget` argument must be the hostname of the server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * NS2:\\n * ns.hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * ns.hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @param upgTarget - Object to which upgrade applies. Required for certain upgrades.\\n * @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.\\n * For compatability reasons, upgTarget must be specified, even if it is not used, in order to specify count.\\n * @returns True if the upgrade is successfully purchased, and false otherwise.\\n */\\n spendHashes(upgName: string, upgTarget?: string, count?: number): boolean;\\n\\n /**\\n * Get the list of hash upgrades\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the list of all available hash upgrades that can be used in the spendHashes function.\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgrades = hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgrades = ns.hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @returns An array containing the available upgrades\\n */\\n getHashUpgrades(): string[];\\n\\n /**\\n * Get the level of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Level of the upgrade.\\n */\\n getHashUpgradeLevel(upgName: string): number;\\n\\n /**\\n * Get the multiplier to study.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getStudyMult(): number;\\n\\n /**\\n * Get the multiplier to training.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getTrainingMult(): number;\\n}\\n\\n/**\\n * Bladeburner API\\n * @remarks\\n * You have to be employed in the Bladeburner division and be in BitNode-7\\n * or have Source-File 7 in order to use this API.\\n * @public\\n */\\nexport interface Bladeburner {\\n /**\\n * List all contracts.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner contracts.\\n *\\n * @returns Array of strings containing the names of all Bladeburner contracts.\\n */\\n getContractNames(): string[];\\n\\n /**\\n * List all operations.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner operations.\\n *\\n * @returns Array of strings containing the names of all Bladeburner operations.\\n */\\n getOperationNames(): string[];\\n\\n /**\\n * List all black ops.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner Black Ops.\\n *\\n * @returns Array of strings containing the names of all Bladeburner Black Ops.\\n */\\n getBlackOpNames(): string[];\\n\\n /**\\n * List all general actions.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner actions.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner actions.\\n */\\n getGeneralActionNames(): string[];\\n\\n /**\\n * List all skills.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner skills.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner skills.\\n */\\n getSkillNames(): string[];\\n\\n /**\\n * Start an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to start the specified Bladeburner action.\\n * Returns true if the action was started successfully, and false otherwise.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match\\n * @returns True if the action was started successfully, and false otherwise.\\n */\\n startAction(type: string, name: string): boolean;\\n\\n /**\\n * Stop current action.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Stops the current Bladeburner action.\\n *\\n */\\n stopBladeburnerAction(): void;\\n\\n /**\\n * Get current action.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns an object that represents the player’s current Bladeburner action.\\n * If the player is not performing an action, the function will return an object with the ‘type’ property set to “Idle”.\\n *\\n * @returns Object that represents the player’s current Bladeburner action.\\n */\\n getCurrentAction(): BladeburnerCurAction;\\n\\n /**\\n * Get the time to complete an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of milliseconds it takes to complete the specified action\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of milliseconds it takes to complete the specified action.\\n */\\n getActionTime(type: string, name: string): number;\\n\\n /**\\n * Get the time elapsed on current action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of milliseconds already spent on the current action.\\n *\\n * @returns Number of milliseconds already spent on the current action.\\n */\\n getActionCurrentTime(): number;\\n\\n /**\\n * Get estimate success chance of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated success chance for the specified action.\\n * This chance is returned as a decimal value, NOT a percentage\\n * (e.g. if you have an estimated success chance of 80%, then this function will return 0.80, NOT 80).\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Estimated success chance for the specified action.\\n */\\n getActionEstimatedSuccessChance(type: string, name: string): [number, number];\\n\\n /**\\n * Get the reputation gain of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the average Bladeburner reputation gain for successfully\\n * completing the specified action.\\n * Note that this value is an ‘average’ and the real reputation gain may vary slightly from this value.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Optional action level at which to calculate the gain\\n * @returns Average Bladeburner reputation gain for successfully completing the specified action.\\n */\\n getActionRepGain(type: string, name: string, level: number): number;\\n\\n /**\\n * Get action count remaining.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the remaining count of the specified action.\\n *\\n * Note that this is meant to be used for Contracts and Operations.\\n * This function will return ‘Infinity’ for actions such as Training and Field Analysis.\\n * This function will return 1 for BlackOps not yet completed regardless of whether\\n * the player has the required rank to attempt the mission or not.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Remaining count of the specified action.\\n */\\n getActionCountRemaining(type: string, name: string): number;\\n\\n /**\\n * Get the maximum level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the maximum level for this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Maximum level of the specified action.\\n */\\n getActionMaxLevel(type: string, name: string): number;\\n\\n /**\\n * Get the current level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the current level of this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Current level of the specified action.\\n */\\n getActionCurrentLevel(type: string, name: string): number;\\n\\n /**\\n * Get whether an action is set to autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action is currently set to autolevel.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns True if the action is set to autolevel, and false otherwise.\\n */\\n getActionAutolevel(type: string, name: string): boolean;\\n\\n /**\\n * Set an action autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Enable/disable autoleveling for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param autoLevel - Whether or not to autolevel this action\\n */\\n setActionAutolevel(type: string, name: string, autoLevel: boolean): void;\\n\\n /**\\n * Set the level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the level for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Level to set this action to.\\n */\\n setActionLevel(type: string, name: string, level: number): void;\\n\\n /**\\n * Get player bladeburner rank.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the player’s Bladeburner Rank.\\n *\\n * @returns Player’s Bladeburner Rank.\\n */\\n getRank(): number;\\n\\n /**\\n * Get black op required rank.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Returns the rank required to complete this BlackOp.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param name - Name of BlackOp. Must be an exact match.\\n * @returns Rank required to complete this BlackOp.\\n */\\n getBlackOpRank(name: string): number;\\n\\n /**\\n * Get bladeburner skill points.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner skill points you have.\\n *\\n * @returns Number of Bladeburner skill points you have.\\n */\\n getSkillPoints(): number;\\n\\n /**\\n * Get skill level.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns your level in the specified skill.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @returns Level in the specified skill.\\n */\\n getSkillLevel(name: string): number;\\n\\n /**\\n * Get cost to upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns the number of skill points needed to upgrade the specified skill the specified number of times.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.\\n * @returns Number of skill points needed to upgrade the specified skill.\\n */\\n getSkillUpgradeCost(name: string, count?: number): number;\\n\\n /**\\n * Upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to upgrade the specified Bladeburner skill the specified number of times.\\n *\\n * Returns true if the skill is successfully upgraded, and false otherwise.\\n *\\n * @param skillName - Name of skill to be upgraded. Case-sensitive and must be an exact match\\n * @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.\\n * @returns true if the skill is successfully upgraded, and false otherwise.\\n */\\n upgradeSkill(name: string, count?: number): boolean;\\n\\n /**\\n * Get team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner team members you have assigned to the specified action.\\n *\\n * Setting a team is only applicable for Operations and BlackOps. This function will return 0 for other action types.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of Bladeburner team members that were assigned to the specified action.\\n */\\n getTeamSize(type: string, name: string): number;\\n\\n /**\\n * Set team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the team size for the specified Bladeburner action.\\n *\\n * Returns the team size that was set, or -1 if the function failed.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param size - Number of team members to set. Will be converted using Math.round().\\n * @returns Number of Bladeburner team members you assigned to the specified action.\\n */\\n setTeamSize(type: string, name: string, size: number): number;\\n\\n /**\\n * Get estimated population in city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoids in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Estimated number of Synthoids in the specified city.\\n */\\n getCityEstimatedPopulation(name: string): number;\\n\\n /**\\n * Get number of communities in a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoid communities in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Number of Synthoids communities in the specified city.\\n */\\n getCityCommunities(name: string): number;\\n\\n /**\\n * Get chaos of a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chaos in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Chaos in the specified city.\\n */\\n getCityChaos(name: string): number;\\n\\n /**\\n * Get current city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the city that the player is currently in (for Bladeburner).\\n *\\n * @returns City that the player is currently in (for Bladeburner).\\n */\\n getCity(): string;\\n\\n /**\\n * Travel to another city in bladeburner.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to switch to the specified city (for Bladeburner only).\\n *\\n * Returns true if successful, and false otherwise\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns true if successful, and false otherwise\\n */\\n switchCity(name: string): boolean;\\n\\n /**\\n * Get bladeburner stamina.\\n * @remarks\\n * RAM cost: 4 GB\\n * Returns an array with two elements:\\n * * [Current stamina, Max stamina]\\n * @example\\n * ```ts\\n * // NS1:\\n * function getStaminaPercentage() {\\n * var res = bladeburner.getStamina();\\n * return res[0] / res[1];\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * function getStaminaPercentage() {\\n * const [current, max] = ns.bladeburner.getStamina();\\n * return current / max;\\n * }\\n * ```\\n * @returns Array containing current stamina and max stamina.\\n */\\n getStamina(): [number, number];\\n\\n /**\\n * Join the bladeburner faction.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to join the Bladeburner faction.\\n *\\n * Returns true if you successfully join the Bladeburner faction, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner faction, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerFaction(): boolean;\\n\\n /**\\n * Join the bladeburner division.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to join the Bladeburner division.\\n *\\n * Returns true if you successfully join the Bladeburner division, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner division, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerDivision(): boolean;\\n\\n /**\\n * Get bladeburner bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 5x the normal speed.\\n * For example, if an action takes 30 seconds to complete but you’ve accumulated over\\n * 30 seconds in bonus time, then the action will only take 6 seconds in real life to complete.\\n *\\n * @returns Amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Coding Contract API\\n * @public\\n */\\nexport interface CodingContract {\\n /**\\n * Attempts a coding contract.\\n * @remarks\\n * RAM cost: 10 GB\\n *\\n * Attempts to solve the Coding Contract with the provided solution.\\n *\\n * @param answer - Solution for the contract.\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns True if the solution was correct, false otherwise. If the returnReward option is configured, then the function will instead return a string. If the contract is successfully solved, the string will contain a description of the contract’s reward. Otherwise, it will be an empty string.\\n */\\n attempt(\\n answer: string | number | any[],\\n filename: string,\\n host?: string,\\n opts?: CodingAttemptOptions,\\n ): boolean | string;\\n\\n /**\\n * Get the type of a coding contract.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns a name describing the type of problem posed by the Coding Contract.\\n * (e.g. Find Largest Prime Factor, Total Ways to Sum, etc.)\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Name describing the type of problem posed by the Coding Contract.\\n */\\n getContractType(filename: string, host?: string): string;\\n\\n /**\\n * Get the description.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the full text description for the problem posed by the Coding Contract.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Contract’s text description.\\n */\\n getDescription(filename: string, host?: string): string;\\n\\n /**\\n * Get the input data.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the data associated with the specific Coding Contract.\\n * Note that this is not the same as the contract’s description.\\n * This is just the data that the contract wants you to act on in order to solve the contract.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns The specified contract’s data, data type depends on contract type.\\n */\\n getData(filename: string, host?: string): CodingContractData;\\n\\n /**\\n * Get the number of attempts remaining.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the number of tries remaining on the contract before it self-destructs.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns How many attempts are remaining for the contract.\\n */\\n getNumTriesRemaining(filename: string, host?: string): number;\\n}\\n\\n/**\\n * Gang API\\n * @remarks\\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this API.\\n * @public\\n */\\nexport interface Gang {\\n /**\\n * Create a gang.\\n * @remarks\\n * RAM cost: 1GB\\n *\\n * Create a gang with the specified faction.\\n * @returns True if the gang was created, false otherwise.\\n */\\n createGang(faction: string): boolean;\\n\\n /**\\n * Check if you're in a gang.\\n * @remarks\\n * RAM cost: 1GB\\n * @returns True if you're in a gang, false otherwise.\\n */\\n inGang(): boolean;\\n\\n /**\\n * List all gang members.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the names of all Gang members\\n *\\n * @returns Names of all Gang members.\\n */\\n getMemberNames(): string[];\\n\\n /**\\n * Get information about your gang.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get general information about the gang.\\n *\\n * @returns Object containing general information about the gang.\\n */\\n getGangInformation(): GangGenInfo;\\n\\n /**\\n * Get information about the other gangs.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get territory and power information about all gangs.\\n *\\n * @returns Object containing territory and power information about all gangs.\\n */\\n getOtherGangInformation(): GangOtherInfo;\\n\\n /**\\n * Get information about a specific gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get stat and equipment-related information about a Gang Member\\n *\\n * @param name - Name of member.\\n * @returns Object containing stat and equipment-related information about a Gang Member.\\n */\\n getMemberInformation(name: string): GangMemberInfo;\\n\\n /**\\n * Check if you can recruit a new gang member.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns boolean indicating whether a member can currently be recruited\\n *\\n * @returns True if a member can currently be recruited, false otherwise.\\n */\\n canRecruitMember(): boolean;\\n\\n /**\\n * Recruit a new gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempt to recruit a new gang member.\\n *\\n * Possible reasons for failure:\\n * * Cannot currently recruit a new member\\n * * There already exists a member with the specified name\\n *\\n * @param name - Name of member to recruit.\\n * @returns True if the member was successfully recruited, false otherwise.\\n */\\n recruitMember(name: string): boolean;\\n\\n /**\\n * List member task names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all valid tasks that Gang members can be assigned to.\\n *\\n * @returns All valid tasks that Gang members can be assigned to.\\n */\\n getTaskNames(): string[];\\n\\n /**\\n * Set gang member to task.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempts to assign the specified Gang Member to the specified task.\\n * If an invalid task is specified, the Gang member will be set to idle (“Unassigned”).\\n *\\n * @param memberName - Name of Gang member to assign.\\n * @param taskName - Task to assign.\\n * @returns True if the Gang Member was successfully assigned to the task, false otherwise.\\n */\\n setMemberTask(memberName: string, taskName: string): boolean;\\n\\n /**\\n * Get stats of a task.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the stats of a gang task stats. This is typically used to evaluate which action should be executed next.\\n *\\n * @param name - Name of the task.\\n * @returns Detailed stats of a task.\\n */\\n getTaskStats(name: string): GangTaskStats;\\n\\n /**\\n * List equipment names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all possible equipment/upgrades you can purchase for your Gang Members.\\n * This includes Augmentations.\\n *\\n * @returns Names of all Equipments/Augmentations.\\n */\\n getEquipmentNames(): string[];\\n\\n /**\\n * Get cost of equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the amount of money it takes to purchase a piece of Equipment or an Augmentation.\\n * If an invalid Equipment/Augmentation is specified, this function will return Infinity.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Cost to purchase the specified Equipment/Augmentation (number). Infinity for invalid arguments\\n */\\n getEquipmentCost(equipName: string): number;\\n\\n /**\\n * Get type of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment type.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Type of the equipment.\\n */\\n getEquipmentType(equipName: string): string;\\n\\n /**\\n * Get stats of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment stats.\\n *\\n * @param equipName - Name of equipment.\\n * @returns A dictionary containing the stats of the equipment.\\n */\\n getEquipmentStats(equipName: string): EquipmentStats;\\n\\n /**\\n * Purchase an equipment for a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempt to purchase the specified Equipment/Augmentation for the specified Gang member.\\n *\\n * @param memberName - Name of Gang member to purchase the equipment for.\\n * @param equipName - Name of Equipment/Augmentation to purchase.\\n * @returns True if the equipment was successfully purchased. False otherwise\\n */\\n purchaseEquipment(memberName: string, equipName: string): boolean;\\n\\n /**\\n * Ascend a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Ascend the specified Gang Member.\\n *\\n * @param memberName - Name of member to ascend.\\n * @returns Object with info about the ascension results. undefined if ascension did not occur.\\n */\\n ascendMember(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Get the result of an ascension without ascending.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the result of an ascension without ascending.\\n *\\n * @param memberName - Name of member.\\n * @returns Object with info about the ascension results. undefined if ascension is impossible.\\n */\\n getAscensionResult(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Enable/Disable territory warfare.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Set whether or not the gang should engage in territory warfare\\n *\\n * @param engage - Whether or not to engage in territory warfare.\\n */\\n setTerritoryWarfare(engage: boolean): void;\\n\\n /**\\n * Get chance to win clash with other gang.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chance you have to win a clash with the specified gang. The chance is returned in decimal form, not percentage\\n *\\n * @param gangName - Target gang\\n * @returns Chance you have to win a clash with the specified gang.\\n */\\n getChanceToWinClash(gangName: string): number;\\n\\n /**\\n * Get bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (milliseconds) for the Gang mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 10x the normal speed.\\n *\\n * @returns Bonus time for the Gang mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Sleeve API\\n * @remarks\\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this API.\\n * @public\\n */\\nexport interface Sleeve {\\n /**\\n * Get the number of sleeves you own.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the number of duplicate sleeves the player has.\\n *\\n * @returns number of duplicate sleeves the player has.\\n */\\n getNumSleeves(): number;\\n\\n /**\\n * Get the stats of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a structure containing the stats of the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to get stats of.\\n * @returns Object containing the stats of the sleeve.\\n */\\n getSleeveStats(sleeveNumber: number): SleeveSkills;\\n\\n /**\\n * Get information about a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a struct containing tons of information about this sleeve\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve information.\\n * @returns Object containing tons of information about this sleeve.\\n */\\n getInformation(sleeveNumber: number): SleeveInformation;\\n\\n /**\\n * Get task of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the current task that the sleeve is performing. type is set to “Idle” if the sleeve isn’t doing anything.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve task from.\\n * @returns Object containing information the current task that the sleeve is performing.\\n */\\n getTask(sleeveNumber: number): SleeveTask;\\n\\n /**\\n * Set a sleeve to shock recovery.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start recovery.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToShockRecovery(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to synchronize.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start synchronizing.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToSynchronize(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to commit crime.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * @param sleeveNumber - Index of the sleeve to start commiting crime.\\n * @param name - Name of the crime. Must be an exact match.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToCommitCrime(sleeveNumber: number, name: string): boolean;\\n\\n /**\\n * Set a sleeve to work for a faction.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this faction.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the faction.\\n * @param factionName - Name of the faction to work for.\\n * @param factionWorkType - Name of the action to perform for this faction.\\n * @returns True if the sleeve started working on this faction, false otherwise, can also throw on errors\\n */\\n setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean | undefined;\\n\\n /**\\n * Set a sleeve to work for a company.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this company.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the company.\\n * @param companyName - Name of the company to work for.\\n * @returns True if the sleeve started working on this company, false otherwise.\\n */\\n setToCompanyWork(sleeveNumber: number, companyName: string): boolean;\\n\\n /**\\n * Set a sleeve to take a class at a university.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start taking class.\\n * @param university - Name of the university to attend.\\n * @param className - Name of the class to follow.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToUniversityCourse(sleeveNumber: number, university: string, className: string): boolean;\\n\\n /**\\n * Set a sleeve to workout at the gym.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working out.\\n *\\n * @param sleeveNumber - Index of the sleeve to workout at the gym.\\n * @param gymName - Name of the gym.\\n * @param stat - Name of the stat to train.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToGymWorkout(sleeveNumber: number, gymName: string, stat: string): boolean;\\n\\n /**\\n * Make a sleeve travel to another city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve reached destination.\\n *\\n * @param sleeveNumber - Index of the sleeve to travel.\\n * @param cityName - Name of the destination city.\\n * @returns True if the sleeve reached destination, false otherwise.\\n */\\n travel(sleeveNumber: number, cityName: string): boolean;\\n\\n /**\\n * Get augmentations installed on a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentation names that this sleeve has installed.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve augmentations from.\\n * @returns List of augmentation names that this sleeve has installed.\\n */\\n getSleeveAugmentations(sleeveNumber: number): string[];\\n\\n /**\\n * Get price of an augmentation.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Price of the augmentation.\\n */\\n getSleeveAugmentationPrice(augName: string): number;\\n\\n /**\\n * Get reputation requirement of an augmentation.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Reputation requirement of the augmentation.\\n */\\n getSleeveAugmentationRepReq(augName: string): number;\\n\\n /**\\n * List purchasable augs for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentations that the player can buy for this sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve purchasable augmentations from.\\n * @returns List of augmentations that the player can buy for this sleeve.\\n */\\n getSleevePurchasableAugs(sleeveNumber: number): AugmentPair[];\\n\\n /**\\n * Purchase an aug for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return true if the aug was purchased and installed on the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to buy an aug for.\\n * @param augName - Name of the aug to buy. Must be an exact match.\\n * @returns True if the aug was purchased and installed on the sleeve, false otherwise.\\n */\\n purchaseSleeveAug(sleeveNumber: number, augName: string): boolean;\\n\\n /**\\n * Set a sleeve to perform bladeburner actions.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working out.\\n *\\n * @param sleeveNumber - Index of the sleeve to workout at the gym.\\n * @param action - Name of the action to be performed.\\n * @param contract - Name of the contract if applicable.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToBladeburnerAction(sleeveNumber: number, action: string, contract?: string): boolean;\\n}\\n\\n/**\\n * Grafting API\\n * @remarks\\n * This API requires Source-File 10 to use.\\n * @public\\n */\\nexport interface Grafting {\\n /**\\n * Retrieve the grafting cost of an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the price of. Must be an exact match.\\n * @returns The cost required to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftPrice(augName: string): number;\\n\\n /**\\n * Retrieves the time required to graft an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the grafting time of. Must be an exact match.\\n * @returns The time required, in millis, to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftTime(augName: string): number;\\n\\n /**\\n * Retrieves a list of Augmentations that can be grafted.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Note that this function returns a list of currently graftable Augmentations,\\n * based off of the Augmentations that you already own.\\n *\\n * @returns An array of graftable Augmentations.\\n */\\n getGraftableAugmentations(): string[];\\n\\n /**\\n * Begins grafting the named aug. You must be in New Tokyo to use this.\\n * @remarks\\n * RAM cost: 7.5 GB\\n *\\n * @param augName - The name of the aug to begin grafting. Must be an exact match.\\n * @param focus - Acquire player focus on this Augmentation grafting. Optional. Defaults to true.\\n * @returns True if the aug successfully began grafting, false otherwise (e.g. not enough money, or\\n * invalid Augmentation name provided).\\n * @throws Will error if called while you are not in New Tokyo.\\n */\\n graftAugmentation(augName: string, focus?: boolean): boolean;\\n}\\n\\n/**\\n * Skills formulas\\n * @public\\n */\\ninterface SkillsFormulas {\\n /**\\n * Calculate skill level.\\n * @param exp - experience for that skill\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated skill level.\\n */\\n calculateSkill(exp: number, skillMult?: number): number;\\n /**\\n * Calculate exp for skill level.\\n * @param skill - target skill level\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated exp required.\\n */\\n calculateExp(skill: number, skillMult?: number): number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface WorkStats {\\n money: number;\\n reputation: number;\\n hackExp: number;\\n strExp: number;\\n defExp: number;\\n dexExp: number;\\n agiExp: number;\\n chaExp: number;\\n intExp: number;\\n}\\n\\n/**\\n * Work formulas\\n * @public\\n */\\ninterface WorkFormulas {\\n crimeGains(crimeType: string): WorkStats;\\n classGains(player: Player, classType: string, locationName: string): WorkStats;\\n factionGains(player: Player, workType: string, favor: number): WorkStats;\\n}\\n\\n/**\\n * Reputation formulas\\n * @public\\n */\\ninterface ReputationFormulas {\\n /**\\n * Calculate the total required amount of faction reputation to reach a target favor.\\n * @param favor - target faction favor.\\n * @returns The calculated faction reputation required.\\n */\\n calculateFavorToRep(favor: number): number;\\n /**\\n * Calculate the resulting faction favor of a total amount of reputation.\\n * (Faction favor is gained whenever you install an Augmentation.)\\n * @param rep - amount of reputation.\\n * @returns The calculated faction favor.\\n */\\n calculateRepToFavor(rep: number): number;\\n\\n /**\\n * Calculate how much rep would be gained.\\n * @param amount - Amount of money donated\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n */\\n repFromDonation(amount: number, player: Player): number;\\n}\\n\\n/**\\n * Hacking formulas\\n * @public\\n */\\ninterface HackingFormulas {\\n /**\\n * Calculate hack chance.\\n * (Ex: 0.25 would indicate a 25% chance of success.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack chance.\\n */\\n hackChance(server: Server, player: Player): number;\\n /**\\n * Calculate hack exp for one thread.\\n * @remarks\\n * Multiply by thread to get total exp\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack exp.\\n */\\n hackExp(server: Server, player: Player): number;\\n /**\\n * Calculate hack percent for one thread.\\n * (Ex: 0.25 would steal 25% of the server's current value.)\\n * @remarks\\n * Multiply by thread to get total percent hacked.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack percent.\\n */\\n hackPercent(server: Server, player: Player): number;\\n /**\\n * Calculate the percent a server would grow to.\\n * (Ex: 3.0 would would grow the server to 300% of its current value.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param threads - Amount of thread.\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @param cores - Number of cores on the computer that will execute grow.\\n * @returns The calculated grow percent.\\n */\\n growPercent(server: Server, threads: number, player: Player, cores?: number): number;\\n /**\\n * Calculate hack time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack time.\\n */\\n hackTime(server: Server, player: Player): number;\\n /**\\n * Calculate grow time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated grow time.\\n */\\n growTime(server: Server, player: Player): number;\\n /**\\n * Calculate weaken time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated weaken time.\\n */\\n weakenTime(server: Server, player: Player): number;\\n}\\n\\n/**\\n * Hacknet Node formulas\\n * @public\\n */\\ninterface HacknetNodesFormulas {\\n /**\\n * Calculate money gain rate.\\n * @param level - level of the node.\\n * @param ram - ram of the node.\\n * @param cores - cores of the node.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated money gain rate.\\n */\\n moneyGainRate(level: number, ram: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate the cost of a hacknet node.\\n * @param n - number of the hacknet node\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetNodeCost(n: number, mult: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet node constants used by the game.\\n */\\n constants(): HacknetNodeConstants;\\n}\\n\\n/**\\n * Hacknet Server formulas\\n * @public\\n */\\ninterface HacknetServersFormulas {\\n /**\\n * Calculate hash gain rate.\\n * @param level - level of the server.\\n * @param ramUsed - ramUsed of the server.\\n * @param maxRam - maxRam of the server.\\n * @param cores - cores of the server.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated hash gain rate.\\n */\\n hashGainRate(level: number, ramUsed: number, maxRam: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cache.\\n * @param startingCache - starting cache level\\n * @param extraCache - amount of levels of cache to purchase (defaults to 1)\\n * @returns The calculated cost.\\n */\\n cacheUpgradeCost(startingCache: number, extraCache?: number): number;\\n /**\\n * Calculate hash cost of an upgrade.\\n * @param upgName - name of the upgrade\\n * @param level - level of the upgrade\\n * @returns The calculated hash cost.\\n */\\n hashUpgradeCost(upgName: number, level: number): number;\\n /**\\n * Calculate the cost of a hacknet server.\\n * @param n - number of the hacknet server\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetServerCost(n: number, mult?: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet server constants used by the game.\\n */\\n constants(): HacknetServerConstants;\\n}\\n\\n/**\\n * Gang formulas\\n * @public\\n */\\ninterface GangFormulas {\\n /**\\n * Calculate the wanted penalty.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @returns The calculated wanted penalty.\\n */\\n wantedPenalty(gang: GangGenInfo): number;\\n /**\\n * Calculate respect gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Gang info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Gang info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated respect gain.\\n */\\n respectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate wanted gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated wanted gain.\\n */\\n wantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate money gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated money gain.\\n */\\n moneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n\\n /**\\n * Calculate ascension point gain.\\n * @param exp - Experience point before ascension.\\n * @returns The calculated ascension point gain.\\n */\\n ascensionPointsGain(exp: number): number;\\n\\n /**\\n * Calculate ascension mult.\\n * @param points - Amount of ascension points.\\n * @returns The calculated ascension mult.\\n */\\n ascensionMultiplier(points: number): number;\\n}\\n\\n/**\\n * Formulas API\\n * @remarks\\n * You need Formulas.exe on your home computer to use this API.\\n * @public\\n */\\nexport interface Formulas {\\n mockServer(): Server;\\n mockPlayer(): Player;\\n /** Reputation formulas */\\n reputation: ReputationFormulas;\\n /** Skills formulas */\\n skills: SkillsFormulas;\\n /** Hacking formulas */\\n hacking: HackingFormulas;\\n /** Hacknet Nodes formulas */\\n hacknetNodes: HacknetNodesFormulas;\\n /** Hacknet Servers formulas */\\n hacknetServers: HacknetServersFormulas;\\n /** Gang formulas */\\n gang: GangFormulas;\\n /** Work formulas */\\n work: WorkFormulas;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface Fragment {\\n id: number;\\n shape: boolean[][];\\n type: number;\\n power: number;\\n limit: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface ActiveFragment {\\n id: number;\\n highestCharge: number;\\n numCharge: number;\\n rotation: number;\\n x: number;\\n y: number;\\n}\\n\\n/**\\n * Stanek's Gift API.\\n * @public\\n */\\ninterface Stanek {\\n /**\\n * Stanek's Gift width.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The width of the gift.\\n */\\n giftWidth(): number;\\n /**\\n * Stanek's Gift height.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The height of the gift.\\n */\\n giftHeight(): number;\\n\\n /**\\n * Charge a fragment, increasing its power.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @returns Promise that lasts until the charge action is over.\\n */\\n chargeFragment(rootX: number, rootY: number): Promise;\\n\\n /**\\n * List possible fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns List of possible fragments.\\n */\\n fragmentDefinitions(): Fragment[];\\n\\n /**\\n * List of fragments in Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns List of active fragments placed on Stanek's Gift.\\n */\\n activeFragments(): ActiveFragment[];\\n\\n /**\\n * Clear the board of all fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clearGift(): void;\\n\\n /**\\n * Check if fragment can be placed at specified location.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @param rotation - rotation A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - fragmentId ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n canPlaceFragment(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Place fragment on Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @param rotation - A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n placeFragment(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Get placed fragment at location.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n getFragment(rootX: number, rootY: number): ActiveFragment | undefined;\\n\\n /**\\n * Remove fragment at location.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n removeFragment(rootX: number, rootY: number): boolean;\\n\\n /**\\n * Accept Stanek's Gift by joining the Church of the Machine God\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * @returns true if the player is a member of the church and has the gift installed,\\n * false otherwise.\\n */\\n acceptGift(): boolean;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface InfiltrationReward {\\n tradeRep: number;\\n sellCash: number;\\n SoARep: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface ILocation {\\n city: string;\\n name: string;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface InfiltrationLocation {\\n location: ILocation;\\n reward: InfiltrationReward;\\n difficulty: number;\\n}\\n\\n/**\\n * Infiltration API.\\n * @public\\n */\\ninterface Infiltration {\\n /**\\n * Get all locations that can be infiltrated.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns all locations that can be infiltrated.\\n */\\n getPossibleLocations(): PossibleInfiltrationLocation[];\\n /**\\n * Get all infiltrations with difficulty, location and rewards.\\n * @remarks\\n * RAM cost: 15 GB\\n *\\n * @returns Infiltration data for given location.\\n */\\n getInfiltration(location: string): InfiltrationLocation;\\n}\\n\\n/**\\n * User Interface API.\\n * @public\\n */\\ninterface UserInterface {\\n /**\\n * Get the current window size\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An array of 2 value containing the window width and height.\\n */\\n windowSize(): [number, number];\\n\\n /**\\n * Get the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the theme's colors\\n */\\n getTheme(): UserInterfaceTheme;\\n\\n /**\\n * Sets the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const theme = ns.ui.getTheme();\\n * theme.primary = '#ff5500';\\n * ns.ui.setTheme(theme);\\n * ```\\n */\\n setTheme(newTheme: UserInterfaceTheme): void;\\n\\n /**\\n * Resets the player's theme to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetTheme(): void;\\n\\n /**\\n * Get the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the player's styles\\n */\\n getStyles(): IStyleSettings;\\n\\n /**\\n * Sets the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const styles = ns.ui.getStyles();\\n * styles.fontFamily = 'Comic Sans Ms';\\n * ns.ui.setStyles(styles);\\n * ```\\n */\\n setStyles(newStyles: IStyleSettings): void;\\n\\n /**\\n * Resets the player's styles to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetStyles(): void;\\n\\n /**\\n * Gets the current game information (version, commit, ...)\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n getGameInfo(): GameInfo;\\n\\n /**\\n * Clear the Terminal window, as if the player ran `clear` in the terminal\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n clearTerminal(): void;\\n}\\n\\n/**\\n * Collection of all functions passed to scripts\\n * @public\\n * @remarks\\n * Basic ns1 usage example:\\n * ```ts\\n * // Basic ns functions can be used directly\\n * getHostname();\\n * // Some related functions are gathered within a common namespace\\n * stock.getPrice();\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}\\n *
\\n * Basic ns2 usage example:\\n * ```ts\\n * export async function main(ns) {\\n * // Basic ns functions can be accessed on the ns object\\n * ns.getHostname();\\n * // Some related functions are gathered under a sub-property of the ns object\\n * ns.stock.getPrice();\\n * // Some functions need to be awaited\\n * await ns.hack('n00dles');\\n * }\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}\\n *
\\n */\\nexport interface NS {\\n /**\\n * Namespace for hacknet functions.\\n * @remarks RAM cost: 4 GB\\n */\\n readonly hacknet: Hacknet;\\n /**\\n *\\n * Namespace for bladeburner functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly bladeburner: Bladeburner;\\n /**\\n *\\n * Namespace for codingcontract functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly codingcontract: CodingContract;\\n /**\\n *\\n * Namespace for gang functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly gang: Gang;\\n /**\\n *\\n * Namespace for sleeve functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly sleeve: Sleeve;\\n /**\\n *\\n * Namespace for stock functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly stock: TIX;\\n /**\\n *\\n * Namespace for formulas functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly formulas: Formulas;\\n /**\\n * Namespace for stanek functions.\\n * RAM cost: 0 GB\\n */\\n readonly stanek: Stanek;\\n /**\\n * Namespace for infiltration functions.\\n * RAM cost: 0 GB\\n */\\n readonly infiltration: Infiltration;\\n /**\\n * Namespace for corporation functions.\\n * RAM cost: 1022.4 GB\\n */\\n readonly corporation: Corporation;\\n\\n /**\\n * Namespace for user interface functions.\\n * RAM cost: 0 GB\\n */\\n readonly ui: UserInterface;\\n\\n /**\\n * Namespace for singularity functions.\\n * RAM cost: 0 GB\\n */\\n readonly singularity: Singularity;\\n\\n /**\\n * Namespace for grafting functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly grafting: Grafting;\\n\\n /**\\n * Arguments passed into the script.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Arguments passed into a script can be accessed using a normal\\n * array using the [] operator (args[0], args[1], etc…).\\n *\\n * It is also possible to get the number of arguments that was passed into a script using: 'args.length'\\n * WARNING: Do not try to modify the args array. This will break the game.\\n */\\n readonly args: (string | number | boolean)[];\\n\\n /**\\n * Steal a servers money.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Function that is used to try and hack servers to steal money and gain hacking experience.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level when this function is called. In order to hack a server you must first gain root access to that server\\n * and also have the required hacking level.\\n *\\n * A script can hack a server from anywhere. It does not need to be running on the same\\n * server to hack that server. For example, you can create a script that hacks the `foodnstuff`\\n * server and run that script on any server in the game.\\n *\\n * A successful `hack()` on a server will raise that server’s security level by 0.002.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var earnedMoney = hack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let earnedMoney = await ns.hack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to hack.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount of money stolen if the hack is successful, and zero otherwise.\\n */\\n hack(host: string, opts?: BasicHGWOptions): Promise;\\n\\n /**\\n * Spoof money in a servers bank account, increasing the amount available.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to increase the amount of money available on a server.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level. When `grow` completes, the money available on a target server will\\n * be increased by a certain, fixed percentage. This percentage is determined by the\\n * target server’s growth rate (which varies between servers) and security level. Generally,\\n * higher-level servers have higher growth rates. The getServerGrowth() function can be used\\n * to obtain a server’s growth rate.\\n *\\n * Like hack, `grow` can be called on any server, regardless of where the script is running.\\n * The grow() command requires root access to the target server, but there is no required hacking\\n * level to run the command. It also raises the security level of the target server by 0.004.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentMoney = getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney = currentMoney * (1 + grow(\\\"foodnstuff\\\"));\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentMoney = ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney *= (1 + await ns.grow(\\\"foodnstuff\\\"));\\n * ```\\n * @param host - Hostname of the target server to grow.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The number by which the money on the server was multiplied for the growth.\\n */\\n grow(host: string, opts?: BasicHGWOptions): Promise;\\n\\n /**\\n * Reduce a server security level.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to attack a server’s security, lowering the server’s security level.\\n * The runtime for this command depends on your hacking level and the target server’s security\\n * level when this function is called. This function lowers the security level of the target server by 0.05.\\n *\\n * Like hack and grow, `weaken` can be called on any server, regardless of\\n * where the script is running. This command requires root access to the target server, but\\n * there is no required hacking level to run the command.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentSecurity = getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity = currentSecurity - weaken(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentSecurity = ns.getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity -= await ns.weaken(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to weaken.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount by which the target server’s security level was decreased. This is equivalent to 0.05 multiplied by the number of script threads.\\n */\\n weaken(host: string, opts?: BasicHGWOptions): Promise;\\n\\n /**\\n * Predict the effect of weaken.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security decrease that would occur if a weaken with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param cores - Optional. The number of cores of the server that would run weaken.\\n * @returns The security decrease.\\n */\\n weakenAnalyze(threads: number, cores?: number): number;\\n\\n /**\\n * Predict the effect of hack.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of script threads you need when running the hack command\\n * to steal the specified amount of money from the target server.\\n * If hackAmount is less than zero or greater than the amount of money available on the server,\\n * then this function returns -1.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * //For example, let’s say the foodnstuff server has $10m and you run:\\n * hackAnalyzeThreads(\\\"foodnstuff\\\", 1e6);\\n * //If this function returns 50, this means that if your next hack call is run on a script with 50 threads, it will steal $1m from the foodnstuff server.\\n * ```\\n * @param host - Hostname of the target server to analyze.\\n * @param hackAmount - Amount of money you want to hack from the server.\\n * @returns The number of threads needed to hack the server for hackAmount money.\\n */\\n hackAnalyzeThreads(host: string, hackAmount: number): number;\\n\\n /**\\n * Get the part of money stolen with a single thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the part of the specified server’s money you will steal with a single thread hack.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, assume the following returns 0.01:\\n * var hackAmount = hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, assume the following returns 0.01:\\n * const hackAmount = ns.hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @param host - Hostname of the target server.\\n * @returns The part of money you will steal from the target server with a single thread hack.\\n */\\n hackAnalyze(host: string): number;\\n\\n /**\\n * Get the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a hack with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param hostname - Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @returns The security increase.\\n */\\n hackAnalyzeSecurity(threads: number, hostname?: string): number;\\n\\n /**\\n * Get the chance of successfully hacking a server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the chance you have of successfully hacking the specified server.\\n *\\n * This returned value is in decimal form, not percentage.\\n *\\n * @param host - Hostname of the target server.\\n * @returns The chance you have of successfully hacking the target server.\\n */\\n hackAnalyzeChance(host: string): number;\\n\\n /**\\n * Calculate the number of grow thread needed to grow a server by a certain multiplier.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of “growths” needed in order to increase\\n * the amount of money available on the specified server by the specified amount.\\n * The specified amount is multiplicative and is in decimal form, not percentage.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * var growTimes = growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * const growTimes = ns.growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @param host - Hostname of the target server.\\n * @param growthAmount - Multiplicative factor by which the server is grown. Decimal form..\\n * @returns The amount of grow calls needed to grow the specified server by the specified amount\\n */\\n growthAnalyze(host: string, growthAmount: number, cores?: number): number;\\n\\n /**\\n * Calculate the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a grow with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param hostname - Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @param cores - Optional. The number of cores of the server that would run grow.\\n * @returns The security increase.\\n */\\n growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;\\n\\n /**\\n * Suspends the script for n milliseconds.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @example\\n * ```ts\\n * // NS1:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * tprint(i + 1);\\n * sleep(5000);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * ns.tprint(i + 1);\\n * await ns.sleep(5000);\\n * }\\n * ```\\n * @returns\\n */\\n sleep(millis: number): Promise;\\n\\n /**\\n * Suspends the script for n milliseconds. Doesn't block with concurrent calls.\\n * You should prefer 'sleep' over 'asleep' except when doing very complex UI work.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @returns\\n */\\n asleep(millis: number): Promise;\\n\\n /**\\n * Prints one or move values or variables to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param args - Value(s) to be printed.\\n */\\n print(...args: any[]): void;\\n\\n /**\\n * Prints a formatted string to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - format of the message\\n * @param args - Value(s) to be printed.\\n */\\n printf(format: string, ...args: any[]): void;\\n\\n /**\\n * Prints one or more values or variables to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param args - Value(s) to be printed.\\n */\\n tprint(...args: any[]): void;\\n\\n /**\\n * Prints a raw value or a variable to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - format of the message\\n * @param msg - Value to be printed.\\n */\\n tprintf(format: string, ...values: any[]): void;\\n\\n /**\\n * Clears the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clearLog(): void;\\n\\n /**\\n * Disables logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Logging can be disabled for all functions by passing `ALL` as the argument.\\n *\\n * Note that this does not completely remove all logging functionality.\\n * This only stops a function from logging when the function is successful.\\n * If the function fails, it will still log the reason for failure.\\n *\\n * @param fn - Name of function for which to disable logging.\\n */\\n disableLog(fn: string): void;\\n\\n /**\\n * Enable logging for a certain function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Re-enables logging for the given function. If `ALL` is passed into this\\n * function as an argument, then it will revert the effects of disableLog(`ALL`).\\n *\\n * @param fn - Name of function for which to enable logging.\\n */\\n enableLog(fn: string): void;\\n\\n /**\\n * Checks the status of the logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param fn - Name of function to check.\\n * @returns Returns a boolean indicating whether or not logging is enabled for that function (or `ALL`)\\n */\\n isLogEnabled(fn: string): boolean;\\n\\n /**\\n * Get all the logs of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns a script’s logs. The logs are returned as an array, where each line is an element in the array.\\n * The most recently logged line is at the end of the array.\\n * Note that there is a maximum number of lines that a script stores in its logs. This is configurable in the game’s options.\\n * If the function is called with no arguments, it will return the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Get logs from foo.script on the current server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Get logs from foo.script on the current server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename of script to get logs from.\\n * @param host - Optional. Hostname of the server that the script is on.\\n * @param args - Arguments to identify which scripts to get logs for.\\n * @returns Returns an string array, where each line is an element in the array. The most recently logged line is at the end of the array.\\n */\\n getScriptLogs(fn?: string, host?: string, ...args: (string | number | boolean)[]): string[];\\n\\n /**\\n * Get an array of recently killed scripts across all servers.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * The most recently killed script is the first element in the array.\\n * Note that there is a maximum number of recently killed scripts which are tracked.\\n * This is configurable in the game's options as `Recently killed scripts size`.\\n *\\n * @example\\n * ```ts\\n * let recentScripts = ns.getRecentScripts();\\n * let mostRecent = recentScripts.shift()\\n * if (mostRecent)\\n * ns.tprint(mostRecent.logs.join('\\\\n'))\\n * ```\\n *\\n * @returns Array with information about previously killed scripts.\\n */\\n getRecentScripts(): RecentScript[];\\n\\n /**\\n * Open the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Opens a script’s logs. This is functionally the same as the tail Terminal command.\\n *\\n * If the function is called with no arguments, it will open the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Open logs from foo.script on the current server that was run with no args\\n * tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Open logs from foo.script on the current server that was run with no args\\n * ns.tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed.\\n * @param host - Optional. Hostname of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional.\\n * @param args - Arguments for the script being tailed.\\n */\\n tail(fn?: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): void;\\n\\n /**\\n * Move a tail window\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Moves a tail window. Coordinates are in screenspace pixels (top left is 0,0)\\n *\\n * @param x - x coordinate.\\n * @param y - y coordinate.\\n * @param pid - Optional. PID of the script having its tail moved. If omitted, the current script is used.\\n */\\n moveTail(x: number, y: number, pid?: number): void;\\n\\n /**\\n * Resize a tail window\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Resize a tail window. Size are in pixel\\n *\\n * @param width - width of the window.\\n * @param height - height of the window.\\n * @param pid - Optional. PID of the script having its tail resized. If omitted, the current script is used.\\n */\\n resizeTail(width: number, height: number, pid?: number): void;\\n\\n /**\\n * Close the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Closes a script’s logs. This is functionally the same pressing the \\\"Close\\\" button on the tail window.\\n *\\n * If the function is called with no arguments, it will close the current script’s logs.\\n *\\n * Otherwise, the pid argument can be used to close the logs from another script.\\n *\\n * @param pid - Optional. PID of the script having its tail closed. If omitted, the current script is used.\\n */\\n closeTail(pid?: number): void;\\n\\n /**\\n * Get the list of servers connected to a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array containing the hostnames of all servers that are one\\n * node way from the specified target server. The hostnames in the returned\\n * array are strings.\\n *\\n * @param host - Optional, Hostname of the server to scan, default to current server.\\n * @returns Returns an string of hostnames.\\n */\\n scan(host?: string): string[];\\n\\n /**\\n * Runs NUKE.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Running NUKE.exe on a target server gives you root access which means you can executes scripts on said server. NUKE.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * nuke(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.nuke(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n nuke(host: string): void;\\n\\n /**\\n * Runs BruteSSH.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n brutessh(host: string): void;\\n\\n /**\\n * Runs FTPCrack.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n ftpcrack(host: string): void;\\n\\n /**\\n * Runs relaySMTP.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n relaysmtp(host: string): void;\\n\\n /**\\n * Runs HTTPWorm.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n httpworm(host: string): void;\\n\\n /**\\n * Runs SQLInject.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @remarks RAM cost: 0.05 GB\\n * @param host - Hostname of the target server.\\n */\\n sqlinject(host: string): void;\\n\\n /**\\n * Start another script on the current server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Run a script as a separate process. This function can only be used to run scripts located on the\\n * current server (the server running the script that calls this function). Requires a significant\\n * amount of RAM to run this command.\\n *\\n * If the script was successfully started, then this functions returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * ns.run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * ns.run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * ns.run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @param script - Filename of script to run.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n run(script: string, numThreads?: number, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Start another script on any server.\\n * @remarks\\n * RAM cost: 1.3 GB\\n *\\n * Run a script as a separate process on a specified server. This is similar to the run function\\n * except that it can be used to run a script on any server, instead of just the current server.\\n *\\n * If the script was successfully started, then this functions returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The simplest way to use the exec command is to call it with just the script name and the target server. The following example will try to run generic-hack.script on the foodnstuff server:\\n * exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following example will try to run the script generic-hack.script on the joesguns server with 10 threads:\\n * exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * //This last example will try to run the script foo.script on the foodnstuff server with 5 threads. It will also pass the number 1 and the string “test” in as arguments to the script:\\n * exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * //The simplest way to use the exec command is to call it with just the script name and the target server. The following example will try to run generic-hack.script on the foodnstuff server:\\n * ns.exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following example will try to run the script generic-hack.script on the joesguns server with 10 threads:\\n * ns.exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * //This last example will try to run the script foo.script on the foodnstuff server with 5 threads. It will also pass the number 1 and the string “test” in as arguments to the script:\\n * ns.exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * @param script - Filename of script to execute.\\n * @param host - Hostname of the `target server` on which to execute the script.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n exec(script: string, host: string, numThreads?: number, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Terminate current script and start another in 10s.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Terminates the current script, and then after a delay of about 10 seconds it will execute the\\n * newly-specified script. The purpose of this function is to execute a new script without being\\n * constrained by the RAM usage of the current one. This function can only be used to run scripts\\n * on the local server.\\n *\\n * Because this function immediately terminates the script, it does not have a return value.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * ns.spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @param script - Filename of script to execute.\\n * @param numThreads - Number of threads to spawn new script with. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run.\\n */\\n spawn(script: string, numThreads?: number, ...args: (string | number | boolean)[]): void;\\n\\n /**\\n * Terminate another script.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills the script on the target server specified by the script’s name and arguments.\\n * Remember that scripts are uniquely identified by both their name and arguments.\\n * For example, if `foo.script` is run with the argument 1, then this is not the same as\\n * `foo.script` run with the argument 2, even though they have the same code.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * ns.kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @param script - Filename or pid of the script to kill\\n * @param host - Hostname of the server on which to kill the script.\\n * @param args - Arguments to identify which script to kill.\\n * @returns True if the script is successfully killed, and false otherwise.\\n */\\n kill(script: number): boolean;\\n\\n /**\\n * {@inheritDoc NS.(kill:1)}\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * ns.kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n */\\n kill(script: string, host: string, ...args: (string | number | boolean)[]): boolean;\\n\\n /**\\n * Terminate all scripts on a server.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills all running scripts on the specified server. This function returns true\\n * if any scripts were killed, and false otherwise. In other words, it will return\\n * true if there are any scripts running on the target server.\\n * If no host is defined, it will kill all scripts, where the script is running.\\n *\\n * @param host - IP or hostname of the server on which to kill all scripts.\\n * @param safetyguard - Skips the script that calls this function\\n * @returns True if any scripts were killed, and false otherwise.\\n */\\n killall(host?: string, safetyguard?: boolean): boolean;\\n\\n /**\\n * Terminates the current script immediately.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n exit(): void;\\n\\n /**\\n * Copy file between servers.\\n * @remarks\\n * RAM cost: 0.6 GB\\n *\\n * Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string\\n * specifying a single file to copy, or an array of strings specifying multiple files to copy.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Copies foo.lit from the helios server to the home computer:\\n * scp(\\\"foo.lit\\\", \\\"home\\\", \\\"helios\\\");\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * scp(files, \\\"home\\\", \\\"rothman-uni\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Copies foo.lit from the helios server to the home computer:\\n * ns.scp(\\\"foo.lit\\\", \\\"home\\\", \\\"helios\\\" );\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * ns.scp(files, \\\"home\\\", \\\"rothman-uni\\\");\\n * ```\\n * @example\\n * ```ts\\n * //ns2, copies files from home to a target server\\n * const server = ns.args[0];\\n * const files = [\\\"hack.js\\\",\\\"weaken.js\\\",\\\"grow.js\\\"];\\n * ns.scp(files, server, \\\"home\\\");\\n * ```\\n * @param files - Filename or an array of filenames of script/literature files to copy.\\n * @param destination - Host of the destination server, which is the server to which the file will be copied.\\n * @param source - Host of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server.\\n * @returns True if the file is successfully copied over and false otherwise. If the files argument is an array then this function will return false if any of the operations failed.\\n */\\n scp(files: string | string[], destination: string, source?: string): boolean;\\n\\n /**\\n * List files on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with the filenames of all files on the specified server\\n * (as strings). The returned array is sorted in alphabetic order.\\n *\\n * @param host - Host of the target server.\\n * @param grep - A substring to search for in the filename.\\n * @returns Array with the filenames of all files on the specified server.\\n */\\n ls(host: string, grep?: string): string[];\\n\\n /**\\n * List running scripts on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with general information about all scripts running on the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var scripts = ps(\\\"home\\\");\\n * for (var i = 0; i < scripts.length; ++i) {\\n * tprint(scripts[i].filename + ' ' + scripts[i].threads);\\n * tprint(scripts[i].args);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ps = ns.ps(\\\"home\\\");\\n * for (let script of ps) {\\n * ns.tprint(`${script.filename} ${script.threads}`);\\n * ns.tprint(script.args);\\n * }\\n * ```\\n * @param host - Host address of the target server. If not specified, it will be the current server’s IP by default.\\n * @returns Array with general information about all scripts running on the specified target server.\\n */\\n ps(host?: string): ProcessInfo[];\\n\\n /**\\n * Check if your have root access on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns a boolean indicating whether or not the player has root access to the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * if (hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * if (ns.hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * ns.nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @param host - Host of the target server\\n * @returns True if player has root access to the specified target server, and false otherwise.\\n */\\n hasRootAccess(host: string): boolean;\\n\\n /**\\n * Returns a string with the hostname of the server that the script is running on.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Hostname of the server that the script is on.\\n */\\n getHostname(): string;\\n\\n /**\\n * Returns the player’s current hacking level.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Player’s current hacking level\\n */\\n getHackingLevel(): number;\\n\\n /**\\n * Get hacking related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacking related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHackingMultipliers();\\n * print(mults.chance);\\n * print(mults.growth);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {chance, growth} = ns.getHackingMultipliers();\\n * print(chance);\\n * print(growth);\\n * ```\\n * @returns Object containing the Player’s hacking related multipliers.\\n */\\n getHackingMultipliers(): HackingMultipliers;\\n\\n /**\\n * Get hacknet related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacknet related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHacknetMultipliers();\\n * print(mults.production);\\n * print(mults.purchaseCost);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {production, purchaseCost} = ns.getHacknetMultipliers();\\n * print(production);\\n * print(purchaseCost);\\n * ```\\n * @returns Object containing the Player’s hacknet related multipliers.\\n */\\n getHacknetMultipliers(): HacknetMultipliers;\\n\\n /**\\n * Returns a server object for the given server. Defaults to the running script's server if host is not specified.\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n * @param host - Optional. Hostname for the requested server object.\\n * @returns The requested server object.\\n */\\n getServer(host?: string): Server;\\n\\n /**\\n * Get money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of money available on a server.\\n * Running this function on the home computer will return the player’s money.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * getServerMoneyAvailable(\\\"home\\\"); //Returns player's money\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * ns.getServerMoneyAvailable(\\\"home\\\"); // Returns player's money\\n * ```\\n * @param host - Host of target server\\n * @returns Amount of money available on the server.\\n */\\n getServerMoneyAvailable(host: string): number;\\n\\n /**\\n * Get maximum money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the maximum amount of money that can be available on a server.\\n *\\n * @param host - Host of target server.\\n * @returns Maximum amount of money available on the server.\\n */\\n getServerMaxMoney(host: string): number;\\n\\n /**\\n * Get a server growth parameter.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the server’s intrinsic “growth parameter”. This growth\\n * parameter is a number typically between 0 and 100 that represents\\n * how quickly the server’s money grows. This parameter affects the\\n * percentage by which the server’s money is increased when using the\\n * grow function. A higher growth parameter will result in a\\n * higher percentage increase from grow.\\n *\\n * @param host - Host of target server.\\n * @returns Parameter that affects the percentage by which the server’s money is increased when using the grow function.\\n */\\n getServerGrowth(host: string): number;\\n\\n /**\\n * Get server security level.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the security level of the target server. A server’s security\\n * level is denoted by a number, typically between 1 and 100\\n * (but it can go above 100).\\n *\\n * @param host - Host of target server.\\n * @returns Security level of the target server.\\n */\\n getServerSecurityLevel(host: string): number;\\n\\n /**\\n * Returns the minimum security level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns Minimum security level of the target server.\\n */\\n getServerMinSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated useless\\n * @remarks\\n * RAM cost: 0.1 GB\\n * Returns the base security level of the target server. This is the security\\n * level that the server starts out with. This is different than\\n * getServerSecurityLevel because getServerSecurityLevel returns\\n * the current security level of a server, which can constantly change due to\\n * hack, grow, and weaken, calls on that server.\\n * The base security level will stay the same until you reset by\\n * installing an Augmentation(s).\\n *\\n * @param host - Host of target server.\\n * @returns Base security level of the target server.\\n */\\n getServerBaseSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated use getServerMaxRam / getServerUsedRam\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns an array with two elements that gives information about a server’s memory (RAM).\\n * The first element in the array is the amount of RAM that the server has total (in GB).\\n * The second element in the array is the amount of RAM that is currently being used on\\n * the server (in GB).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var serverRam = getServerRam(\\\"helios\\\");\\n * var totalRam = serverRam[0];\\n * var ramUsed = serverRam[1];\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const [totalRam, ramUsed] = ns.getServerRam(\\\"helios\\\");\\n * ```\\n * @param host - Host of target server.\\n * @returns Array with total and used memory on the specified server, in GB.\\n */\\n getServerRam(host: string): [number, number];\\n\\n /**\\n * Get the max RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns max ram (GB)\\n */\\n getServerMaxRam(host: string): number;\\n /**\\n * Get the used RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns used ram (GB)\\n */\\n getServerUsedRam(host: string): number;\\n\\n /**\\n * Returns the required hacking level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The required hacking level of the target server.\\n */\\n getServerRequiredHackingLevel(host: string): number;\\n\\n /**\\n * Returns the number of open ports required to successfully run NUKE.exe on the specified server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The number of open ports required to successfully run NUKE.exe on the specified server.\\n */\\n getServerNumPortsRequired(host: string): number;\\n\\n /**\\n * Returns a boolean denoting whether or not the specified server exists.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns True if specified server exists, and false otherwise.\\n */\\n serverExists(host: string): boolean;\\n\\n /**\\n * Check if a file exists.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified file exists on the target server.\\n * The filename for scripts is case-sensitive, but for other types of files it is not.\\n * For example, fileExists(“brutessh.exe”) will work fine, even though the actual program\\n * is named 'BruteSSH.exe'.\\n *\\n * If the hostname/ip argument is omitted, then the function will search through the current\\n * server (the server running the script that calls this function) for the file.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * // The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * ns.fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * // The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * ns.fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * @param filename - Filename of file to check.\\n * @param host - Host of target server. This is optional. If it is not specified then the function will use the current server as the target server.\\n * @returns True if specified file exists, and false otherwise.\\n */\\n fileExists(filename: string, host?: string): boolean;\\n\\n /**\\n * Check if a script is running.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified script is running on the target server.\\n * If you use a PID instead of a filename, the hostname and args parameters are unnecessary.\\n * Remember that a script is uniquely identified by both its name and its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", ns.getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @param script - Filename or PID of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @param args - Arguments to specify/identify which scripts to search for.\\n * @returns True if specified script is running on the target server, and false otherwise.\\n */\\n isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;\\n\\n /**\\n * Get general info about a running script.\\n * @remarks\\n * RAM cost: 0.3 GB\\n *\\n * Running with no args returns current script.\\n * If you use a PID as the first parameter, the hostname and args parameters are unnecessary.\\n *\\n * @param filename - Optional. Filename or PID of the script.\\n * @param hostname - Optional. Name of host server the script is running on.\\n * @param args - Arguments to identify the script\\n * @returns The info about the running script if found, and null otherwise.\\n */\\n getRunningScript(\\n filename?: FilenameOrPID,\\n hostname?: string,\\n ...args: (string | number | boolean)[]\\n ): RunningScript | null;\\n\\n /**\\n * Get cost of purchasing a server.\\n * @remarks\\n * RAM cost: 0.25 GB\\n *\\n * Returns the cost to purchase a server with the specified amount of ram.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * for (i = 1; i <= 20; i++) {\\n * tprint(i + \\\" -- \\\" + getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * for (i = 1; i <= 20; i++) {\\n * ns.tprint(i + \\\" -- \\\" + ns.getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @param ram - Amount of RAM of a potential purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The cost to purchase a server with the specified amount of ram.\\n */\\n getPurchasedServerCost(ram: number): number;\\n\\n /**\\n * Purchase a server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Purchased a server with the specified hostname and amount of RAM.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string\\n * and have whitespace removed. Anything that resolves to an empty string will cause\\n * the function to fail. If there is already a server with the specified hostname,\\n * then the function will automatically append a number at the end of the hostname\\n * argument value until it finds a unique hostname. For example, if the script calls\\n * `purchaseServer(“foo”, 4)` but a server named “foo” already exists, the it will\\n * automatically change the hostname to `foo-0`. If there is already a server with the\\n * hostname `foo-0`, then it will change the hostname to `foo-1`, and so on.\\n *\\n * Note that there is a maximum limit to the amount of servers you can purchase.\\n *\\n * Returns the hostname of the newly purchased server as a string. If the function\\n * fails to purchase a server, then it will return an empty string. The function will\\n * fail if the arguments passed in are invalid, if the player does not have enough\\n * money to purchase the specified server, or if the player has exceeded the maximum\\n * amount of servers.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var ram = 64;\\n * var prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ram = 64;\\n * const prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * ns.purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @param hostname - Host of the purchased server.\\n * @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The hostname of the newly purchased server.\\n */\\n purchaseServer(hostname: string, ram: number): string;\\n\\n /**\\n * Delete a purchased server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Deletes one of your purchased servers, which is specified by its hostname.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string.\\n * Whitespace is automatically removed from the string. This function will not delete a\\n * server that still has scripts running on it.\\n *\\n * @param host - Host of the server to delete.\\n * @returns True if successful, and false otherwise.\\n */\\n deleteServer(host: string): boolean;\\n\\n /**\\n * Returns an array with the hostnames of all of the servers you have purchased.\\n *\\n * @remarks 2.25 GB\\n * @returns Returns an array with the hostnames of all of the servers you have purchased.\\n */\\n getPurchasedServers(): string[];\\n\\n /**\\n * Returns the maximum number of servers you can purchase.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum number of servers you can purchase.\\n */\\n getPurchasedServerLimit(): number;\\n\\n /**\\n * Returns the maximum RAM that a purchased server can have.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum RAM (in GB) that a purchased server can have.\\n */\\n getPurchasedServerMaxRam(): number;\\n\\n /**\\n * Write data to a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function can be used to write data to a text file (.txt) or a script (.js or .script).\\n *\\n * This function will write data to that file. If the specified file does not exist,\\n * then it will be created. The third argument mode, defines how the data will be written to\\n * the file. If *mode is set to “w”, then the data is written in “write” mode which means\\n * that it will overwrite all existing data on the file. If mode is set to any other value\\n * then the data will be written in “append” mode which means that the data will be added at the\\n * end of the file.\\n *\\n * @param filename - Name of the file to be written to.\\n * @param data - Data to write.\\n * @param mode - Defines the write mode.\\n */\\n write(filename: string, data?: string[] | number | string, mode?: \\\"w\\\" | \\\"a\\\"): void;\\n\\n /**\\n * Attempt to write to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Attempts to write data to the specified Netscript Port.\\n * If the port is full, the data will not be written.\\n * Otherwise, the data will be written normally.\\n *\\n * @param port - Port or text file that will be written to.\\n * @param data - Data to write.\\n * @returns True if the data is successfully written to the port, and false otherwise.\\n */\\n tryWritePort(port: number, data: string | number): Promise;\\n\\n /**\\n * Read content of a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to read data from a text file (.txt) or script (.script, .js).\\n *\\n * This function will return the data in the specified file.\\n * If the file does not exist, an empty string will be returned.\\n *\\n * @param filename - Name of the file to be read.\\n * @returns Data in the specified text file.\\n */\\n read(filename: string): string;\\n\\n /**\\n * Get a copy of the data from a port without popping it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n *\\n * @param port - Port to peek. Must be an integer between 1 and 20.\\n * @returns Data in the specified port.\\n */\\n peek(port: number): PortData;\\n\\n /**\\n * Clear data from a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Delete all data from that text file.\\n *\\n * @param handle - Text file to clear.\\n */\\n clear(handle: string): void;\\n\\n /**\\n * Clear data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Deleta all data from the underlying queue.\\n *\\n * @param handle - Port to clear.\\n */\\n clearPort(handle: number): void;\\n\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Write data to that netscript port.\\n * @returns The data popped off the queue if it was full.\\n */\\n writePort(port: number, data: string | number): Promise;\\n /**\\n * Read data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Read data from that port. A port is a serialized queue.\\n * This function will remove the first element from that queue and return it.\\n * If the queue is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n readPort(port: number): PortData;\\n\\n /**\\n * Get all data on a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Get a handle to a Netscript Port.\\n *\\n * WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.\\n *\\n * @see https://bitburner.readthedocs.io/en/latest/netscript/netscriptmisc.html#netscript-ports\\n * @param port - Port number. Must be an integer between 1 and 20.\\n */\\n getPortHandle(port: number): NetscriptPort;\\n\\n /**\\n * Delete a file.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Removes the specified file from the current server. This function works for every file\\n * type except message (.msg) files.\\n *\\n * @param name - Filename of file to remove. Must include the extension.\\n * @param host - Host Address of the server on which to delete the file. Optional. Defaults to current server.\\n * @returns True if it successfully deletes the file, and false otherwise.\\n */\\n rm(name: string, host?: string): boolean;\\n\\n /**\\n * Check if any script with a filename is running.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns a boolean indicating whether any instance of the specified script is running\\n * on the target server, regardless of its arguments.\\n *\\n * This is different than the isRunning function because it does not try to\\n * identify a specific instance of a running script by its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", getHostname());\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", ns.getHostname());\\n * ```\\n * @param script - Filename of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns True if the specified script is running, and false otherwise.\\n */\\n scriptRunning(script: string, host: string): boolean;\\n\\n /**\\n * Kill all scripts with a filename.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Kills all scripts with the specified filename on the target server specified by hostname,\\n * regardless of arguments.\\n *\\n * @param script - Filename of script to kill. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns true if one or more scripts were successfully killed, and false if none were.\\n */\\n scriptKill(script: string, host: string): boolean;\\n\\n /**\\n * Returns the current script name.\\n *\\n * @remarks RAM cost: 0 GB\\n * @returns Current script name.\\n */\\n getScriptName(): string;\\n\\n /**\\n * Get the ram cost of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of RAM required to run the specified script on the target server.\\n * Returns 0 if the script does not exist.\\n *\\n * @param script - Filename of script. This is case-sensitive.\\n * @param host - Host of target server the script is located on. This is optional, if it is not specified then the function will use the current server as the target server.\\n * @returns Amount of RAM (in GB) required to run the specified script on the target server, and 0 if the script does not exist.\\n */\\n getScriptRam(script: string, host?: string): number;\\n\\n /**\\n * Get the execution time of a hack() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * When `hack` completes an amount of money is stolen depending on the player's skills.\\n * Returns the amount of time in milliseconds it takes to execute the hack Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the hack Netscript function.\\n */\\n getHackTime(host: string): number;\\n\\n /**\\n * Get the execution time of a grow() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the grow Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the grow Netscript function.\\n */\\n getGrowTime(host: string): number;\\n\\n /**\\n * Get the execution time of a weaken() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the weaken Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the weaken Netscript function.\\n */\\n getWeakenTime(host: string): number;\\n\\n /**\\n * Get the income of all script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * @returns an array of two values.\\n * The first value is the total income (dollar / second) of all of your active scripts\\n * (scripts that are currently running on any server).\\n * The second value is the total income (dollar / second) that you’ve earned from scripts\\n * since you last installed Augmentations.\\n */\\n getTotalScriptIncome(): [number, number];\\n\\n /**\\n * Get the income of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of income the specified script generates while online\\n * (when the game is open, does not apply for offline income). Remember that\\n * a script is uniquely identified by both its name and its arguments. So for\\n * example if you ran a script with the arguments “foodnstuff” and “5” then\\n * in order to use this function to get that script’s income you must specify\\n * those same arguments in the same order in this function call.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of income the specified script generates while online.\\n */\\n getScriptIncome(script: string, host: string, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Get the exp gain of all script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * @returns total experience gain rate of all of your active scripts.\\n */\\n getTotalScriptExpGain(): number;\\n\\n /**\\n * Get the exp gain of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of hacking experience the specified script generates while online\\n * (when the game is open, does not apply for offline experience gains). Remember that a\\n * script is uniquely identified by both its name and its arguments.\\n *\\n * This function can also return the total experience gain rate of all of your active\\n * scripts by running the function with no arguments.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of hacking experience the specified script generates while online.\\n */\\n getScriptExpGain(script: string, host: string, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Returns the amount of time in milliseconds that have passed since you last installed Augmentations.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Time in milliseconds that have passed since you last installed Augmentations.\\n */\\n getTimeSinceLastAug(): number;\\n\\n /**\\n * Format a string.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formating arguments.\\n * @returns Formated text.\\n */\\n sprintf(format: string, ...args: any[]): string;\\n\\n /**\\n * Format a string with an array of arguments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formating arguments.\\n * @returns Formated text.\\n */\\n vsprintf(format: string, args: any[]): string;\\n\\n /**\\n * Format a number\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Converts a number into a string with the specified formatter.\\n * This uses the numeraljs library, so the formatters must be compatible with that.\\n * This is the same function that the game itself uses to display numbers.\\n *\\n * see: http://numeraljs.com/\\n * @param n - Number to format.\\n * @param format - Formatter.\\n * @returns Formated number.\\n */\\n nFormat(n: number, format: string): string;\\n\\n /**\\n * Format time to readable string\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param milliseconds - Number of millisecond to format.\\n * @param milliPrecision - Format time with subsecond precision, defaults to false.\\n * @returns The formatted time.\\n */\\n tFormat(milliseconds: number, milliPrecision?: boolean): string;\\n\\n /**\\n * Prompt the player with an input modal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Prompts the player with a dialog box. If `options.type` is undefined or \\\"boolean\\\",\\n * the player is shown \\\"Yes\\\" and \\\"No\\\" prompts, which return true and false respectively.\\n * Passing a type of \\\"text\\\" will give the player a text field and a value of \\\"select\\\"\\n * will show a drop-down field. Choosing type \\\"select\\\" will require an array or object\\n * to be passed via the `options.choices` property.\\n * The script’s execution is halted until the player selects one of the options.\\n *\\n * @param txt - Text to appear in the prompt dialog box.\\n * @param options - Options to modify the prompt the player is shown.\\n * @returns True if the player click “Yes”; false if the player clicks “No”; or the value entered by the player.\\n */\\n prompt(\\n txt: string,\\n options?: { type?: \\\"boolean\\\" | \\\"text\\\" | \\\"select\\\" | undefined; choices?: string[] },\\n ): Promise;\\n\\n /**\\n * Open up a message box.\\n * @param msg - Message to alert.\\n */\\n alert(msg: string): void;\\n\\n /**\\n * Queue a toast (bottom-right notification).\\n * @param msg - Message in the toast.\\n * @param variant - Type of toast, must be one of success, info, warning, error. Defaults to success.\\n * @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000\\n */\\n toast(msg: string, variant?: ToastVariantValues, duration?: number | null): void;\\n\\n /**\\n * Download a file from the internet.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Retrieves data from a URL and downloads it to a file on the specified server.\\n * The data can only be downloaded to a script (.script, .js) or a text file (.txt).\\n * If the file already exists, it will be overwritten by this command.\\n * Note that it will not be possible to download data from many websites because they\\n * do not allow cross-origin resource sharing (CORS).\\n *\\n * IMPORTANT: This is an asynchronous function that returns a Promise.\\n * The Promise’s resolved value will be a boolean indicating whether or not the data was\\n * successfully retrieved from the URL. Because the function is async and returns a Promise,\\n * it is recommended you use wget in NetscriptJS (Netscript 2.0).\\n *\\n * In NetscriptJS, you must preface any call to wget with the await keyword (like you would hack or sleep).\\n * wget will still work in Netscript 1.0, but the functions execution will not be synchronous\\n * (i.e. it may not execute when you expect/want it to).\\n * Furthermore, since Promises are not supported in ES5,\\n * you will not be able to process the returned value of wget in Netscript 1.0.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * await ns.wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @param url - URL to pull data from.\\n * @param target - Filename to write data to. Must be script or text file.\\n * @param host - Optional hostname/ip of server for target file.\\n * @returns True if the data was successfully retrieved from the URL, false otherwise.\\n */\\n wget(url: string, target: string, host?: string): Promise;\\n\\n /**\\n * Returns the amount of Faction favor required to be able to donate to a faction.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @returns Amount of Faction favor required to be able to donate to a faction.\\n */\\n getFavorToDonate(): number;\\n\\n /**\\n * Get the current Bitnode multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the current BitNode multipliers.\\n * This function requires you to be in Bitnode 5 or have Source-File 5 in order to run.\\n * The multipliers are returned in decimal forms (e.g. 1.5 instead of 150%).\\n * The multipliers represent the difference between the current BitNode and\\n * the original BitNode (BitNode-1).\\n *\\n * For example, if the CrimeMoney multiplier has a value of 0.1, then that means\\n * that committing crimes in the current BitNode will only give 10% of the money\\n * you would have received in BitNode-1.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var mults = getBitNodeMultipliers();\\n * print(mults.ServerMaxMoney);\\n * print(mults.HackExpGain);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const {ServerMaxMoney, HackExpGain} = ns.getBitNodeMultipliers();\\n * print(ServerMaxMoney);\\n * print(HackExpGain);\\n * ```\\n * @returns Object containing the current BitNode multipliers.\\n */\\n getBitNodeMultipliers(): BitNodeMultipliers;\\n\\n /**\\n * Get information about the player.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Returns an object with information on the current player.\\n *\\n * @returns Player info\\n */\\n getPlayer(): Player;\\n\\n /**\\n * Add callback function when the script dies\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Add callback to be executed when the script dies.\\n */\\n atExit(f: () => void): void;\\n\\n /**\\n * Move a file on the target server.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Move the source file to the specified destination on the target server.\\n *\\n * This command only works for scripts and text files (.txt). It cannot, however, be used\\n * to convert from script to text file, or vice versa.\\n *\\n * This function can also be used to rename files.\\n *\\n * @param host - Host of target server.\\n * @param source - Filename of the source file.\\n * @param destination - Filename of the destination file.\\n */\\n mv(host: string, source: string, destination: string): void;\\n\\n /**\\n * Parse command line flags.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Allows unix like flag parsing.\\n * @example\\n * ```ts\\n * // example.script\\n * var data = flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * tprint(data);\\n *\\n * // example.js\\n * export async function main(ns) {\\n * const data = ns.flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * ns.tprint(data);\\n * }\\n *\\n * // [home ~/]> run example.script\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false}\\n * // [home ~/]> run example.script --delay 3000\\n * // {\\\"_\\\":[],\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi\\n * // {\\\"_\\\":[],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world --exclude a --exclude b\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\",\\\"exclude\\\":[\\\"a\\\",\\\"b\\\"]}\\n * // [home ~/]> run example.script --help\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":true}\\n * ```\\n */\\n flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };\\n\\n /**\\n * Share your computer with your factions.\\n * @remarks\\n * RAM cost: 2.4 GB\\n *\\n * Increases your rep gain of hacking contracts while share is called.\\n * Scales with thread count.\\n */\\n share(): Promise;\\n\\n /**\\n * Calculate your share power. Based on all the active share calls.\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n getSharePower(): number;\\n\\n enums: NSEnums;\\n}\\n\\n/** @public */\\nexport enum ToastVariant {\\n SUCCESS = \\\"success\\\",\\n WARNING = \\\"warning\\\",\\n ERROR = \\\"error\\\",\\n INFO = \\\"info\\\",\\n}\\n\\n/** @public */\\nexport type ToastVariantValues = `${ToastVariant}`;\\n\\n/** @public */\\nexport interface NSEnums {\\n toast: typeof ToastVariant;\\n}\\n\\n/**\\n * Corporation Office API\\n * @remarks\\n * Requires the Office API upgrade from your corporation.\\n * @public\\n */\\nexport interface OfficeAPI {\\n /**\\n * Assign an employee to a job.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - name of the employee\\n * @param job - Name of the job.\\n */\\n assignJob(divisionName: string, cityName: string, employeeName: string, job: string): void;\\n /**\\n * Hire an employee.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns The newly hired employee, if any\\n */\\n hireEmployee(divisionName: string, cityName: string): Employee | undefined;\\n /**\\n * Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n */\\n upgradeOfficeSize(divisionName: string, cityName: string, size: number): void;\\n /**\\n * Throw a party for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param costPerEmployee - Amount to spend per employee.\\n * @returns Multiplier for happiness and morale, or zero on failure\\n */\\n throwParty(divisionName: string, cityName: string, costPerEmployee: number): number;\\n /**\\n * Buy coffee for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns true if buying coffee was successful, false otherwise\\n */\\n buyCoffee(divisionName: string, cityName: string): boolean;\\n /**\\n * Hire AdVert.\\n * @param divisionName - Name of the division\\n */\\n hireAdVert(divisionName: string): void;\\n /**\\n * Purchase a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n */\\n research(divisionName: string, researchName: string): void;\\n /**\\n * Get data about an office\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns Office data\\n */\\n getOffice(divisionName: string, cityName: string): Office;\\n /**\\n * Get data about an employee\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - Name of the employee\\n * @returns Employee data\\n */\\n getEmployee(divisionName: string, cityName: string, employeeName: string): Employee;\\n /**\\n * Get the cost to Hire AdVert\\n * @param divisionName - Name of the division\\n * @returns Cost\\n */\\n getHireAdVertCost(divisionName: string): number;\\n /**\\n * Get the number of times you have Hired AdVert\\n * @param divisionName - Name of the division\\n * @returns Number of times you have Hired AdVert\\n */\\n getHireAdVertCount(adivisionName: string): number;\\n /**\\n * Get the cost to unlock research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns cost\\n */\\n getResearchCost(divisionName: string, researchName: string): number;\\n /**\\n * Gets if you have unlocked a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns true is unlocked, false if not\\n */\\n hasResearched(divisionName: string, researchName: string): boolean;\\n /**\\n * Set the auto job assignment for a job\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param job - Name of the job\\n * @param amount - Number of employees to assign to that job\\n * @returns true if the employee count reached the target amount, false if not\\n */\\n setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): boolean;\\n /**\\n * Cost to Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n * @returns Cost of upgrading the office\\n */\\n getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number;\\n}\\n\\n/**\\n * Corporation Warehouse API\\n * @remarks\\n * Requires the Warehouse API upgrade from your corporation.\\n * @public\\n */\\nexport interface WarehouseAPI {\\n /**\\n * Set material sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n */\\n sellMaterial(divisionName: string, cityName: string, materialName: string, amt: string, price: string): void;\\n /**\\n * Set product sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n * @param all - Sell in all city\\n */\\n sellProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n amt: string,\\n price: string,\\n all: boolean,\\n ): void;\\n /**\\n * Discontinue a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n */\\n discontinueProduct(divisionName: string, productName: string): void;\\n /**\\n * Set smart supply\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param enabled - smart supply enabled\\n */\\n setSmartSupply(divisionName: string, cityName: string, enabled: boolean): void;\\n /**\\n * Set whether smart supply uses leftovers before buying\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param enabled - smart supply use leftovers enabled\\n */\\n setSmartSupplyUseLeftovers(divisionName: string, cityName: string, materialName: string, enabled: boolean): void;\\n /**\\n * Set material buy data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to buy\\n */\\n buyMaterial(divisionName: string, cityName: string, materialName: string, amt: number): void;\\n /**\\n * Set material to bulk buy\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to buy\\n */\\n bulkPurchase(divisionName: string, cityName: string, materialName: string, amt: number): void;\\n /**\\n * Get warehouse data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns warehouse data\\n */\\n getWarehouse(divisionName: string, cityName: string): Warehouse;\\n /**\\n * Get product data\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @returns product data\\n */\\n getProduct(divisionName: string, productName: string): Product;\\n /**\\n * Get material data\\n * @param divisionName - Name of the division\\n * @param materialName - Name of the material\\n * @returns material data\\n */\\n getMaterial(divisionName: string, cityName: string, materialName: string): Material;\\n /**\\n * Set market TA 1 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA1(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA2(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 1 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA1(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA2(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set material export data\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n exportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Cancel material export\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n cancelExportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Purchase warehouse for a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n purchaseWarehouse(divisionName: string, cityName: string): void;\\n /**\\n * Upgrade warehouse\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param amt - amount of upgrades defaults to 1\\n */\\n upgradeWarehouse(divisionName: string, cityName: string, amt?: number): void;\\n /**\\n * Create a new product\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param designInvest - Amount to invest for the design of the product.\\n * @param marketingInvest - Amount to invest for the marketing of the product.\\n */\\n makeProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n designInvest: number,\\n marketingInvest: number,\\n ): void;\\n /**\\n * Limit Material Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param qty - Amount to limit to\\n */\\n limitMaterialProduction(divisionName: string, cityName: string, materialName: string, qty: number): void;\\n /**\\n * Limit Product Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param qty - Amount to limit to\\n */\\n limitProductProduction(divisionName: string, cityName: string, productName: string, qty: number): void;\\n /**\\n * Gets the cost to purchase a warehouse\\n * @returns cost\\n */\\n getPurchaseWarehouseCost(): number;\\n /**\\n * Gets the cost to upgrade a warehouse to the next level\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param amt - amount of upgrades defaults to 1\\n * @returns cost to upgrade\\n */\\n getUpgradeWarehouseCost(adivisionName: string, acityName: string, amt?: number): number;\\n /**\\n * Check if you have a warehouse in city\\n * @returns true if warehouse is present, false if not\\n */\\n hasWarehouse(adivisionName: string, acityName: string): boolean;\\n}\\n\\n/**\\n * Corporation API\\n * @public\\n */\\nexport interface Corporation extends WarehouseAPI, OfficeAPI {\\n /**\\n * Create a Corporation\\n * @param divisionName - Name of the division\\n * @param selfFund - If you should self fund, defaults to true, false will only work on Bitnode 3\\n * @returns true if created and false if not\\n */\\n createCorporation(corporationName: string, selfFund: boolean): boolean;\\n /**\\n * Check if you have a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns true if unlocked and false if not\\n */\\n hasUnlockUpgrade(upgradeName: string): boolean;\\n /**\\n * Gets the cost to unlock a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUnlockUpgradeCost(upgradeName: string): number;\\n /**\\n * Get the level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns the level of the upgrade\\n */\\n getUpgradeLevel(upgradeName: string): number;\\n /**\\n * Gets the cost to unlock the next level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUpgradeLevelCost(upgradeName: string): number;\\n /**\\n * Gets the cost to expand into a new industry\\n * @param industryName - Name of the industry\\n * @returns cost\\n */\\n getExpandIndustryCost(industryName: string): number;\\n /**\\n * Gets the cost to expand into a new city\\n * @returns cost\\n */\\n getExpandCityCost(): number;\\n /**\\n * Get an offer for investment based on you companies current valuation\\n * @returns An offer of investment\\n */\\n getInvestmentOffer(): InvestmentOffer;\\n /**\\n * Get list of materials\\n * @returns material names\\n */\\n getMaterialNames(): string[];\\n /**\\n * Get list of industry types\\n * @returns industry names\\n */\\n getIndustryTypes(): string[];\\n /**\\n * Get list of one-time unlockable upgrades\\n * @returns unlockable upgrades names\\n */\\n getUnlockables(): string[];\\n /**\\n * Get list of upgrade names\\n * @returns upgrade names\\n */\\n getUpgradeNames(): string[];\\n /**\\n * Get list of research names\\n * @returns research names\\n */\\n getResearchNames(): string[];\\n /**\\n * Accept investment based on you companies current valuation\\n * @remarks\\n * Is based on current valuation and will not honer a specific Offer\\n * @returns An offer of investment\\n */\\n acceptInvestmentOffer(): boolean;\\n /**\\n * Go public\\n * @param numShares - number of shares you would like to issue for your IPO\\n * @returns true if you successfully go public, false if not\\n */\\n goPublic(numShares: number): boolean;\\n /**\\n * Bribe a faction\\n * @param factionName - Faction name\\n * @param amountCash - Amount of money to bribe\\n * @returns True if successful, false if not\\n */\\n bribe(factionName: string, amountCash: number): boolean;\\n /**\\n * Get corporation data\\n * @returns Corporation data\\n */\\n getCorporation(): CorporationInfo;\\n /**\\n * Get division data\\n * @param divisionName - Name of the division\\n * @returns Division data\\n */\\n getDivision(divisionName: string): Division;\\n /**\\n * Expand to a new industry\\n * @param industryType - Name of the industry\\n * @param divisionName - Name of the division\\n */\\n expandIndustry(industryType: string, divisionName: string): void;\\n /**\\n * Expand to a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n expandCity(divisionName: string, cityName: string): void;\\n /**\\n * Unlock an upgrade\\n * @param upgradeName - Name of the upgrade\\n */\\n unlockUpgrade(upgradeName: string): void;\\n /**\\n * Level an upgrade.\\n * @param upgradeName - Name of the upgrade\\n */\\n levelUpgrade(upgradeName: string): void;\\n /**\\n * Issue dividends\\n * @param rate - Fraction of profit to issue as dividends.\\n */\\n issueDividends(rate: number): void;\\n /**\\n * Buyback Shares\\n * @param amount - Amount of shares to buy back.\\n *\\n */\\n buyBackShares(amount: number): void;\\n /**\\n * Sell Shares\\n * @param amount - Amount of shares to sell.\\n *\\n */\\n sellShares(amount: number): void;\\n /**\\n * Get bonus time.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster.\\n *\\n * @returns Bonus time for the Corporation mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * General info about a corporation\\n * @public\\n */\\ninterface CorporationInfo {\\n /** Name of the corporation */\\n name: string;\\n /** Funds available */\\n funds: number;\\n /** Revenue per second this cycle */\\n revenue: number;\\n /** Expenses per second this cycle */\\n expenses: number;\\n /** Indicating if the company is public */\\n public: boolean;\\n /** Total number of shares issues by this corporation */\\n totalShares: number;\\n /** Amount of share owned */\\n numShares: number;\\n /** Cooldown until shares can be sold again */\\n shareSaleCooldown: number;\\n /** Amount of shares issued */\\n issuedShares: number;\\n /** Price of the shares */\\n sharePrice: number;\\n /** Fraction of profits issued as dividends */\\n dividendRate: number;\\n /** Tax applied on your earnings as a shareholder */\\n dividendTax: number;\\n /** Your earnings as a shareholder per second this cycle */\\n dividendEarnings: number;\\n /** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */\\n state: string;\\n /** Array of all divisions */\\n divisions: Division[];\\n}\\n\\n/**\\n * Employee in an office\\n * @public\\n */\\nexport interface Employee {\\n /** Name of the employee */\\n name: string;\\n /** Morale of the employee */\\n mor: number;\\n /** Happiness of the employee */\\n hap: number;\\n /** Energy of the employee */\\n ene: number;\\n /** Intelligence of the employee */\\n int: number;\\n /** Charisma of the employee */\\n cha: number;\\n /** Experience of the employee */\\n exp: number;\\n /** Creativity of the employee */\\n cre: number;\\n /** Efficiency of the employee */\\n eff: number;\\n /** Salary of the employee */\\n sal: number;\\n /** Current Location (city) */\\n loc: string;\\n /** Current job position */\\n pos: string;\\n}\\n\\n/**\\n * Product in a warehouse\\n * @public\\n */\\ninterface Product {\\n /** Name of the product */\\n name: string;\\n /** Demand for the product, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the product, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Product Rating */\\n rat: number;\\n /** Product Properties. The data is \\\\{qlt, per, dur, rel, aes, fea\\\\} */\\n properties: { [key: string]: number };\\n /** Production cost */\\n pCost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | number;\\n /** Data refers to the production, sale, and quantity of the products\\n * These values are specific to a city\\n * For each city, the data is [qty, prod, sell] */\\n cityData: { [key: string]: number[] };\\n /** Creation progress - A number between 0-100 representing percentage */\\n developmentProgress: number;\\n}\\n\\n/**\\n * Material in a warehouse\\n * @public\\n */\\ninterface Material {\\n /** Name of the material */\\n name: string;\\n /** Amount of material */\\n qty: number;\\n /** Quality of the material */\\n qlt: number;\\n /** Demand for the material, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the material, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Amount of material produced */\\n prod: number;\\n /** Amount of material sold */\\n sell: number;\\n /** cost to buy material */\\n cost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | number;\\n}\\n\\n/**\\n * Warehouse for a division in a city\\n * @public\\n */\\ninterface Warehouse {\\n /** Amount of size upgrade bought */\\n level: number;\\n /** City in which the warehouse is located */\\n loc: string;\\n /** Total space in the warehouse */\\n size: number;\\n /** Used space in the warehouse */\\n sizeUsed: number;\\n /** Smart Supply status in the warehouse */\\n smartSupplyEnabled: boolean;\\n}\\n\\n/**\\n * Office for a division in a city.\\n * @public\\n */\\nexport interface Office {\\n /** City of the office */\\n loc: string;\\n /** Maximum number of employee */\\n size: number;\\n /** Minimum amount of energy of the employees */\\n minEne: number;\\n /** Maximum amount of energy of the employees */\\n maxEne: number;\\n /** Minimum happiness of the employees */\\n minHap: number;\\n /** Maximum happiness of the employees */\\n maxHap: number;\\n /** Minimum morale of the employees */\\n minMor: number;\\n /** Maximum morale of the employees */\\n maxMor: number;\\n /** Name of all the employees */\\n employees: string[];\\n /** Production of the employees */\\n employeeProd: EmployeeJobs;\\n /** Positions of the employees */\\n employeeJobs: EmployeeJobs;\\n}\\n\\n/**\\n * Object representing the number of employee in each job.\\n * @public\\n */\\ninterface EmployeeJobs {\\n Operations: number;\\n Engineer: number;\\n Business: number;\\n Management: number;\\n \\\"Research & Development\\\": number;\\n Training: number;\\n Unassigned: number;\\n}\\n\\n/**\\n * Corporation division\\n * @public\\n */\\ninterface Division {\\n /** Name of the division */\\n name: string;\\n /** Type of division, like Agriculture */\\n type: string;\\n /** Awareness of the division */\\n awareness: number;\\n /** Popularity of the division */\\n popularity: number;\\n /** Production multiplier */\\n prodMult: number;\\n /** Amount of research in that division */\\n research: number;\\n /** Revenue last cycle */\\n lastCycleRevenue: number;\\n /** Expenses last cycle */\\n lastCycleExpenses: number;\\n /** Revenue this cycle */\\n thisCycleRevenue: number;\\n /** Expenses this cycle */\\n thisCycleExpenses: number;\\n /** All research bought */\\n upgrades: number[];\\n /** Cities in which this division has expanded */\\n cities: string[];\\n /** Products developed by this division */\\n products: string[];\\n /** Whether the industry this division is in is capable of making products */\\n makesProducts: boolean;\\n}\\n\\n/**\\n * Corporation investment offer\\n * @public\\n */\\ninterface InvestmentOffer {\\n /** Amount of funds you will get from this investment */\\n funds: number;\\n /** Amount of share you will give in exchange for this investment */\\n shares: number;\\n /** Current round of funding (max 4) */\\n round: number;\\n}\\n\\n/**\\n * Interface Theme\\n * @internal\\n */\\ninterface UserInterfaceTheme {\\n [key: string]: string | undefined;\\n primarylight: string;\\n primary: string;\\n primarydark: string;\\n successlight: string;\\n success: string;\\n successdark: string;\\n errorlight: string;\\n error: string;\\n errordark: string;\\n secondarylight: string;\\n secondary: string;\\n secondarydark: string;\\n warninglight: string;\\n warning: string;\\n warningdark: string;\\n infolight: string;\\n info: string;\\n infodark: string;\\n welllight: string;\\n well: string;\\n white: string;\\n black: string;\\n hp: string;\\n money: string;\\n hack: string;\\n combat: string;\\n cha: string;\\n int: string;\\n rep: string;\\n disabled: string;\\n backgroundprimary: string;\\n backgroundsecondary: string;\\n button: string;\\n}\\n\\n/**\\n * Interface Styles\\n * @internal\\n */\\ninterface IStyleSettings {\\n fontFamily: string;\\n lineHeight: number;\\n}\\n\\n/**\\n * Game Information\\n * @internal\\n */\\ninterface GameInfo {\\n version: string;\\n commit: string;\\n platform: string;\\n}\\n\\n/**\\n * Used for autocompletion\\n * @public\\n */\\ninterface AutocompleteData {\\n servers: string[];\\n scripts: string[];\\n txts: string[];\\n flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };\\n}\\n\";","/**\n * React component for displaying a single augmentation for purchase through\n * the faction UI\n */\nimport { CheckBox, CheckBoxOutlineBlank, CheckCircle, NewReleases, Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Augmentation } from \"../Augmentation\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { PurchaseAugmentationModal } from \"./PurchaseAugmentationModal\";\n\ninterface IPreReqsProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst PreReqs = (props: IPreReqsProps): React.ReactElement => {\n const ownedPreReqs = props.aug.prereqs.filter((aug) => props.player.hasAugmentation(aug));\n const hasPreReqs = props.aug.prereqs.length > 0 && ownedPreReqs.length === props.aug.prereqs.length;\n\n return (\n \n \n This Augmentation has the following pre-requisite(s):\n \n {props.aug.prereqs.map((preAug) => (\n \n ))}\n \n }\n >\n \n {hasPreReqs ? (\n <>\n \n Pre-requisites Owned\n \n ) : (\n <>\n \n Missing {props.aug.prereqs.length - ownedPreReqs.length} pre-requisite(s)\n \n )}\n \n \n );\n};\n\ninterface IExclusiveProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst Exclusive = (props: IExclusiveProps): React.ReactElement => {\n return (\n \n \n This Augmentation can only be acquired from the following source(s):\n \n
    \n \n
  • \n {props.aug.factions[0]} faction\n
  • \n {props.player.isAwareOfGang() && !props.aug.isSpecial && (\n
  • \n Certain gangs\n
  • \n )}\n {props.player.canAccessGrafting() &&\n !props.aug.isSpecial &&\n props.aug.name !== AugmentationNames.TheRedPill && (\n
  • \n Grafting\n
  • \n )}\n
    \n
\n \n }\n >\n \n \n );\n};\n\ninterface IReqProps {\n value: string;\n color: string;\n fulfilled: boolean;\n}\n\nconst Requirement = (props: IReqProps): React.ReactElement => {\n return (\n \n {props.fulfilled ? : }\n {props.value}\n \n );\n};\n\ninterface IPurchasableAugsProps {\n augNames: string[];\n ownedAugNames: string[];\n player: IPlayer;\n\n canPurchase: (player: IPlayer, aug: Augmentation) => boolean;\n purchaseAugmentation: (player: IPlayer, aug: Augmentation, showModal: (open: boolean) => void) => void;\n\n rep?: number;\n sleeveAugs?: boolean;\n faction?: Faction;\n}\n\nexport const PurchasableAugmentations = (props: IPurchasableAugsProps): React.ReactElement => {\n return (\n \n {props.augNames.map((augName: string) => (\n \n ))}\n {props.ownedAugNames.map((augName: string) => (\n \n ))}\n \n );\n};\n\ninterface IPurchasableAugProps {\n parent: IPurchasableAugsProps;\n augName: string;\n owned: boolean;\n}\n\nexport function PurchasableAugmentation(props: IPurchasableAugProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const aug = StaticAugmentations[props.augName];\n const augCosts = aug.getCost(props.parent.player);\n const cost = props.parent.sleeveAugs ? aug.baseCost : augCosts.moneyCost;\n const repCost = augCosts.repCost;\n const info = typeof aug.info === \"string\" ? {aug.info} : aug.info;\n const description = (\n <>\n {info}\n
\n
\n {aug.stats}\n \n );\n\n return (\n \n <>\n \n \n props.parent.purchaseAugmentation(props.parent.player, aug, (open): void => {\n setOpen(open);\n })\n }\n disabled={!props.parent.canPurchase(props.parent.player, aug) || props.owned}\n sx={{ width: \"48px\", height: \"36px\", float: \"left\", clear: \"none\", mr: 1 }}\n >\n {props.owned ? \"Owned\" : \"Buy\"}\n \n\n \n \n \n \n {props.augName}\n {props.augName === AugmentationNames.NeuroFluxGovernor &&\n ` - Level ${aug.getLevel(props.parent.player)}`}\n \n {description}\n \n }\n >\n \n {aug.name}\n {aug.name === AugmentationNames.NeuroFluxGovernor && ` - Level ${aug.getLevel(props.parent.player)}`}\n \n \n\n {aug.factions.length === 1 && !props.parent.sleeveAugs && (\n \n )}\n {aug.prereqs.length > 0 && !props.parent.sleeveAugs && }\n \n \n \n\n {props.owned || (\n \n cost}\n value={numeralWrapper.formatMoney(cost)}\n color={Settings.theme.money}\n />\n {props.parent.rep !== undefined && (\n = repCost}\n value={`${numeralWrapper.formatReputation(repCost)} rep`}\n color={Settings.theme.rep}\n />\n )}\n \n )}\n\n {Settings.SuppressBuyAugmentationConfirmation || (\n setOpen(false)}\n faction={props.parent.faction}\n aug={aug}\n />\n )}\n \n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a Travel Agency\n *\n * TThis subcomponent renders all of the buttons for traveling to different cities\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { CityName } from \"../data/CityNames\";\nimport { TravelConfirmationModal } from \"./TravelConfirmationModal\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { use } from \"../../ui/Context\";\nimport { Money } from \"../../ui/React/Money\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\n\ntype IProps = {\n p: IPlayer;\n router: IRouter;\n};\n\nfunction travel(p: IPlayer, router: IRouter, to: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!p.canAfford(cost)) {\n return;\n }\n\n p.loseMoney(cost, \"other\");\n p.travel(to);\n dialogBoxCreate(<>You are now in {to}!);\n router.toCity();\n}\n\nexport function TravelAgencyRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n const [open, setOpen] = useState(false);\n const [destination, setDestination] = useState(CityName.Sector12);\n function rerender(): void {\n setRerender((o) => !o);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function startTravel(city: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!player.canAfford(cost)) {\n return;\n }\n if (Settings.SuppressTravelConfirmation) {\n travel(player, router, city);\n return;\n }\n setOpen(true);\n setDestination(city);\n }\n\n return (\n <>\n Travel Agency\n \n \n From here, you can travel to any other city! A ticket costs{\" \"}\n .\n \n {Settings.DisableASCIIArt ? (\n <>\n {Object.values(CityName)\n .filter((city: string) => city != props.p.city)\n .map((city: string) => {\n const match = Object.entries(CityName).find((entry) => entry[1] === city);\n if (match === undefined) throw new Error(`could not find key for city '${city}'`);\n return (\n \n \n
\n
\n );\n })}\n \n ) : (\n startTravel(city)} />\n )}\n
\n travel(player, router, destination)}\n open={open}\n onClose={() => setOpen(false)}\n />\n \n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Editor, { Monaco } from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\ntype ITextModel = monaco.editor.ITextModel;\nimport { OptionsModal } from \"./OptionsModal\";\nimport { Options } from \"./Options\";\nimport { isValidFilePath } from \"../../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { Script } from \"../../Script/Script\";\nimport { TextFile } from \"../../TextFile\";\nimport { calculateRamUsage, checkInfiniteLoop } from \"../../Script/RamCalculations\";\nimport { RamCalculationErrorCode } from \"../../Script/RamCalculationErrorCodes\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { DragDropContext, Droppable, Draggable } from \"react-beautiful-dnd\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { NetscriptFunctions } from \"../../NetscriptFunctions\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { iTutorialNextStep, ITutorial, iTutorialSteps } from \"../../InteractiveTutorial\";\nimport { debounce } from \"lodash\";\nimport { saveObject } from \"../../SaveObject\";\nimport { loadThemes, makeTheme, sanitizeTheme } from \"./themes\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Box from \"@mui/material/Box\";\nimport SettingsIcon from \"@mui/icons-material/Settings\";\nimport SyncIcon from \"@mui/icons-material/Sync\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { PromptEvent } from \"../../ui/React/PromptManager\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport libSource from \"!!raw-loader!../NetscriptDefinitions.d.ts\";\nimport { TextField, Tooltip } from \"@mui/material\";\n\ninterface IProps {\n // Map of filename -> code\n files: Record;\n hostname: string;\n player: IPlayer;\n router: IRouter;\n vim: boolean;\n}\n\n// TODO: try to remove global symbols\nlet symbolsLoaded = false;\nlet symbols: string[] = [];\nexport function SetupTextEditor(): void {\n const ns = NetscriptFunctions({ args: [] } as unknown as WorkerScript);\n\n // Populates symbols for text editor\n function populate(ns: any): string[] {\n let symbols: string[] = [];\n const keys = Object.keys(ns);\n for (const key of keys) {\n if (typeof ns[key] === \"object\") {\n symbols.push(key);\n symbols = symbols.concat(populate(ns[key]));\n }\n if (typeof ns[key] === \"function\") {\n symbols.push(key);\n }\n }\n\n return symbols;\n }\n\n symbols = populate(ns);\n\n const exclude = [\"heart\", \"break\", \"exploit\", \"bypass\", \"corporation\", \"alterReality\"];\n symbols = symbols.filter((symbol: string) => !exclude.includes(symbol)).sort();\n}\n\n// Holds all the data for a open script\nclass OpenScript {\n fileName: string;\n code: string;\n hostname: string;\n lastPosition: monaco.Position;\n model: ITextModel;\n isTxt: boolean;\n\n constructor(fileName: string, code: string, hostname: string, lastPosition: monaco.Position, model: ITextModel) {\n this.fileName = fileName;\n this.code = code;\n this.hostname = hostname;\n this.lastPosition = lastPosition;\n this.model = model;\n this.isTxt = fileName.endsWith(\".txt\");\n }\n}\n\nconst openScripts: OpenScript[] = [];\nlet currentScript: OpenScript | null = null;\n\n// Called every time script editor is opened\nexport function Root(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n const editorRef = useRef(null);\n const monacoRef = useRef(null);\n const vimStatusRef = useRef(null);\n const [vimEditor, setVimEditor] = useState(null);\n const [editor, setEditor] = useState(null);\n const [filter, setFilter] = useState(\"\");\n const [searchExpanded, setSearchExpanded] = useState(false);\n\n const [ram, setRAM] = useState(\"RAM: ???\");\n const [ramEntries, setRamEntries] = useState([[\"???\", \"\"]]);\n const [updatingRam, setUpdatingRam] = useState(false);\n const [decorations, setDecorations] = useState([]);\n\n const [optionsOpen, setOptionsOpen] = useState(false);\n const [options, setOptions] = useState({\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: props.vim || Settings.MonacoVim,\n });\n\n const [ramInfoOpen, setRamInfoOpen] = useState(false);\n\n // Prevent Crash if script is open on deleted server\n for (let i = openScripts.length - 1; i >= 0; i--) {\n GetServer(openScripts[i].hostname) === null && openScripts.splice(i, 1);\n }\n if (currentScript && GetServer(currentScript.hostname) === null) {\n currentScript = openScripts[0];\n if (currentScript === undefined) currentScript = null;\n }\n\n useEffect(() => {\n if (currentScript !== null) {\n updateRAM(currentScript.code);\n }\n }, []);\n\n useEffect(() => {\n function keydown(event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n //Ctrl + b\n if (event.code == \"KeyB\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n props.router.toTerminal();\n }\n\n // CTRL/CMD + S\n if (event.code == \"KeyS\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n event.stopPropagation();\n save();\n }\n }\n document.addEventListener(\"keydown\", keydown);\n return () => document.removeEventListener(\"keydown\", keydown);\n });\n\n useEffect(() => {\n // setup monaco-vim\n if (options.vim && editor && !vimEditor) {\n try {\n // This library is not typed\n // @ts-expect-error\n window.require([\"monaco-vim\"], function (MonacoVim: any) {\n setVimEditor(MonacoVim.initVimMode(editor, vimStatusRef.current));\n MonacoVim.VimMode.Vim.defineEx(\"write\", \"w\", function () {\n // your own implementation on what you want to do when :w is pressed\n save();\n });\n MonacoVim.VimMode.Vim.defineEx(\"quit\", \"q\", function () {\n props.router.toTerminal();\n });\n\n const saveNQuit = (): void => {\n save();\n props.router.toTerminal();\n };\n // \"wqriteandquit\" & \"xriteandquit\" are not typos, prefix must be found in full string\n MonacoVim.VimMode.Vim.defineEx(\"wqriteandquit\", \"wq\", saveNQuit);\n MonacoVim.VimMode.Vim.defineEx(\"xriteandquit\", \"x\", saveNQuit);\n\n // Setup \"go to next tab\" and \"go to previous tab\". This is a little more involved\n // since these aren't Ex commands (they run in normal mode, not after typing `:`)\n MonacoVim.VimMode.Vim.defineAction(\"nextTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the next tab (to the right). Wraps around when at the rightmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n const nextIndex = (currIndex + nTabs) % openScripts.length;\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.defineAction(\"prevTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the previous tab (to the left). Wraps around when at the leftmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n let nextIndex = currIndex - nTabs;\n while (nextIndex < 0) {\n nextIndex += openScripts.length;\n }\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.mapCommand(\"gt\", \"action\", \"nextTabs\", {}, { context: \"normal\" });\n MonacoVim.VimMode.Vim.mapCommand(\"gT\", \"action\", \"prevTabs\", {}, { context: \"normal\" });\n editor.focus();\n });\n } catch {}\n } else if (!options.vim) {\n // Whem vim mode is disabled\n vimEditor?.dispose();\n setVimEditor(null);\n }\n\n return () => {\n vimEditor?.dispose();\n };\n }, [options, editorRef, editor, vimEditor]);\n\n // Generates a new model for the script\n function regenerateModel(script: OpenScript): void {\n if (monacoRef.current !== null) {\n script.model = monacoRef.current.editor.createModel(script.code, script.isTxt ? \"plaintext\" : \"javascript\");\n }\n }\n\n const debouncedUpdateRAM = debounce((newCode: string) => {\n updateRAM(newCode);\n setUpdatingRam(false);\n }, 300);\n\n function updateRAM(newCode: string): void {\n if (currentScript != null && currentScript.isTxt) {\n setRAM(\"N/A\");\n setRamEntries([[\"N/A\", \"\"]]);\n return;\n }\n const codeCopy = newCode + \"\";\n const ramUsage = calculateRamUsage(props.player, codeCopy, props.player.getCurrentServer().scripts);\n if (ramUsage.cost > 0) {\n const entries = ramUsage.entries?.sort((a, b) => b.cost - a.cost) ?? [];\n const entriesDisp = [];\n for (const entry of entries) {\n entriesDisp.push([`${entry.name} (${entry.type})`, numeralWrapper.formatRAM(entry.cost)]);\n }\n\n setRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage.cost));\n setRamEntries(entriesDisp);\n return;\n }\n let RAM = \"\";\n const entriesDisp = [];\n switch (ramUsage.cost) {\n case RamCalculationErrorCode.ImportError: {\n RAM = \"RAM: Import Error\";\n entriesDisp.push([\"Import Error\", \"\"]);\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n RAM = \"RAM: Syntax Error\";\n entriesDisp.push([\"Syntax Error\", \"\"]);\n break;\n }\n }\n setRAM(RAM);\n setRamEntries(entriesDisp);\n return;\n }\n\n // Formats the code\n function beautify(): void {\n if (editorRef.current === null) return;\n editorRef.current.getAction(\"editor.action.formatDocument\").run();\n }\n\n // How to load function definition in monaco\n // https://github.com/Microsoft/monaco-editor/issues/1415\n // https://microsoft.github.io/monaco-editor/api/modules/monaco.languages.html\n // https://www.npmjs.com/package/@monaco-editor/react#development-playground\n // https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages\n // https://github.com/threehams/typescript-error-guide/blob/master/stories/components/Editor.tsx#L11-L39\n // https://blog.checklyhq.com/customizing-monaco/\n // Before the editor is mounted\n function beforeMount(monaco: any): void {\n if (symbolsLoaded) return;\n // Setup monaco auto completion\n symbolsLoaded = true;\n monaco.languages.registerCompletionItemProvider(\"javascript\", {\n provideCompletionItems: () => {\n const suggestions = [];\n for (const symbol of symbols) {\n suggestions.push({\n label: symbol,\n kind: monaco.languages.CompletionItemKind.Function,\n insertText: symbol,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n });\n }\n return { suggestions: suggestions };\n },\n });\n\n (async function () {\n // We have to improve the default js language otherwise theme sucks\n const l = await monaco.languages\n .getLanguages()\n .find((l: any) => l.id === \"javascript\")\n .loader();\n // replaced the bare tokens with regexes surrounded by \\b, e.g. \\b{token}\\b which matches a word-break on either side\n // this prevents the highlighter from highlighting pieces of variables that start with a reserved token name\n l.language.tokenizer.root.unshift([new RegExp(\"\\\\bns\\\\b\"), { token: \"ns\" }]);\n for (const symbol of symbols)\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${symbol}\\\\b`), { token: \"netscriptfunction\" }]);\n const otherKeywords = [\"let\", \"const\", \"var\", \"function\"];\n const otherKeyvars = [\"true\", \"false\", \"null\", \"undefined\"];\n otherKeywords.forEach((k) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeywords\" }]),\n );\n otherKeyvars.forEach((k) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeyvars\" }]),\n );\n l.language.tokenizer.root.unshift([new RegExp(\"\\\\bthis\\\\b\"), { token: \"this\" }]);\n })();\n\n const source = (libSource + \"\").replace(/export /g, \"\");\n monaco.languages.typescript.javascriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n monaco.languages.typescript.typescriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n loadThemes(monaco);\n sanitizeTheme(Settings.EditorTheme);\n monaco.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n }\n\n // When the editor is mounted\n function onMount(editor: IStandaloneCodeEditor, monaco: Monaco): void {\n // Required when switching between site navigation (e.g. from Script Editor -> Terminal and back)\n // the `useEffect()` for vim mode is called before editor is mounted.\n setEditor(editor);\n\n editorRef.current = editor;\n monacoRef.current = monaco;\n\n if (editorRef.current === null || monacoRef.current === null) return;\n\n if (!props.files && currentScript !== null) {\n // Open currentscript\n regenerateModel(currentScript);\n editorRef.current.setModel(currentScript.model);\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n updateRAM(currentScript.code);\n editorRef.current.focus();\n return;\n }\n if (props.files) {\n const files = Object.entries(props.files);\n\n if (!files.length) {\n editorRef.current.focus();\n return;\n }\n\n for (const [filename, code] of files) {\n // Check if file is already opened\n const openScript = openScripts.find(\n (script) => script.fileName === filename && script.hostname === props.hostname,\n );\n if (openScript) {\n // Script is already opened\n if (openScript.model === undefined || openScript.model === null || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n\n currentScript = openScript;\n editorRef.current.setModel(openScript.model);\n editorRef.current.setPosition(openScript.lastPosition);\n editorRef.current.revealLineInCenter(openScript.lastPosition.lineNumber);\n updateRAM(openScript.code);\n } else {\n // Open script\n const newScript = new OpenScript(\n filename,\n code,\n props.hostname,\n new monacoRef.current.Position(0, 0),\n monacoRef.current.editor.createModel(code, filename.endsWith(\".txt\") ? \"plaintext\" : \"javascript\"),\n );\n openScripts.push(newScript);\n currentScript = newScript;\n editorRef.current.setModel(newScript.model);\n updateRAM(newScript.code);\n }\n }\n }\n\n editorRef.current.focus();\n }\n\n function infLoop(newCode: string): void {\n if (editorRef.current === null || currentScript === null) return;\n if (!currentScript.fileName.endsWith(\".js\")) return;\n const awaitWarning = checkInfiniteLoop(newCode);\n if (awaitWarning !== -1) {\n const newDecorations = editorRef.current.deltaDecorations(decorations, [\n {\n range: {\n startLineNumber: awaitWarning,\n startColumn: 1,\n endLineNumber: awaitWarning,\n endColumn: 10,\n },\n options: {\n isWholeLine: true,\n glyphMarginClassName: \"myGlyphMarginClass\",\n glyphMarginHoverMessage: {\n value: \"Possible infinite loop, await something.\",\n },\n },\n },\n ]);\n setDecorations(newDecorations);\n } else {\n const newDecorations = editorRef.current.deltaDecorations(decorations, []);\n setDecorations(newDecorations);\n }\n }\n\n // When the code is updated within the editor\n function updateCode(newCode?: string): void {\n if (newCode === undefined) return;\n setUpdatingRam(true);\n debouncedUpdateRAM(newCode);\n if (editorRef.current === null) return;\n const newPos = editorRef.current.getPosition();\n if (newPos === null) return;\n if (currentScript !== null) {\n currentScript.code = newCode;\n currentScript.lastPosition = newPos;\n }\n try {\n infLoop(newCode);\n } catch (err) {}\n }\n\n function saveScript(scriptToSave: OpenScript): void {\n const server = GetServer(scriptToSave.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(scriptToSave.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (scriptToSave.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(\n props.player,\n scriptToSave.fileName,\n scriptToSave.code,\n props.player.currentServer,\n server.scripts,\n );\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(\n props.player,\n scriptToSave.fileName,\n scriptToSave.code,\n props.player.currentServer,\n server.scripts,\n );\n server.scripts.push(script);\n } else if (scriptToSave.isTxt) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === scriptToSave.fileName) {\n server.textFiles[i].write(scriptToSave.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n return;\n }\n }\n const textFile = new TextFile(scriptToSave.fileName, scriptToSave.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script or .js) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n }\n\n function save(): void {\n if (currentScript === null) {\n console.error(\"currentScript is null when it shouldn't be. Unable to save script\");\n return;\n }\n // this is duplicate code with saving later.\n if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalTypeScript) {\n //Make sure filename + code properly follow tutorial\n if (currentScript.fileName !== \"n00dles.script\" && currentScript.fileName !== \"n00dles.js\") {\n dialogBoxCreate(\"Don't change the script name for now.\");\n return;\n }\n const cleanCode = currentScript.code.replace(/\\s/g, \"\");\n const ns1 = \"while(true){hack('n00dles');}\";\n const ns2 = `exportasyncfunctionmain(ns){while(true){awaitns.hack('n00dles');}}`;\n if (cleanCode.indexOf(ns1) == -1 && cleanCode.indexOf(ns2) == -1) {\n dialogBoxCreate(\"Please copy and paste the code from the tutorial!\");\n return;\n }\n\n //Save the script\n saveScript(currentScript);\n\n iTutorialNextStep();\n\n return;\n }\n\n if (currentScript.fileName == \"\") {\n dialogBoxCreate(\"You must specify a filename!\");\n return;\n }\n\n if (!isValidFilePath(currentScript.fileName)) {\n dialogBoxCreate(\n \"Script filename can contain only alphanumerics, hyphens, and underscores, and must end with an extension.\",\n );\n return;\n }\n\n const server = GetServer(currentScript.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(currentScript.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (currentScript.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(\n props.player,\n currentScript.fileName,\n currentScript.code,\n props.player.currentServer,\n server.scripts,\n );\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(\n props.player,\n currentScript.fileName,\n currentScript.code,\n props.player.currentServer,\n server.scripts,\n );\n server.scripts.push(script);\n } else if (currentScript.isTxt) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === currentScript.fileName) {\n server.textFiles[i].write(currentScript.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n return;\n }\n }\n const textFile = new TextFile(currentScript.fileName, currentScript.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script or .js) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n }\n\n function reorder(list: OpenScript[], startIndex: number, endIndex: number): void {\n const [removed] = list.splice(startIndex, 1);\n list.splice(endIndex, 0, removed);\n }\n\n function onDragEnd(result: any): void {\n // Dropped outside of the list\n if (!result.destination) return;\n reorder(openScripts, result.source.index, result.destination.index);\n }\n\n function currentTabIndex(): number | undefined {\n if (currentScript !== null) {\n return openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n }\n\n return undefined;\n }\n\n function onTabClick(index: number): void {\n if (currentScript !== null) {\n // Save currentScript to openScripts\n const curIndex = currentTabIndex();\n if (curIndex !== undefined) {\n openScripts[curIndex] = currentScript;\n }\n }\n\n currentScript = openScripts[index];\n\n if (editorRef.current !== null && openScripts[index] !== null) {\n if (currentScript.model === undefined || currentScript.model.isDisposed()) {\n regenerateModel(currentScript);\n }\n editorRef.current.setModel(currentScript.model);\n\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n updateRAM(currentScript.code);\n editorRef.current.focus();\n }\n }\n\n function onTabClose(index: number): void {\n // See if the script on the server is up to date\n const closingScript = openScripts[index];\n const savedScriptCode = closingScript.code;\n const wasCurrentScript = openScripts[index] === currentScript;\n\n if (dirty(index)) {\n PromptEvent.emit({\n txt: `Do you want to save changes to ${closingScript.fileName} on ${closingScript.hostname}?`,\n resolve: (result: boolean | string) => {\n if (result) {\n // Save changes\n closingScript.code = savedScriptCode;\n saveScript(closingScript);\n }\n },\n });\n }\n\n openScripts.splice(index, 1);\n if (openScripts.length === 0) {\n currentScript = null;\n props.router.toTerminal();\n return;\n }\n\n // Change current script if we closed it\n if (wasCurrentScript) {\n //Keep the same index unless we were on the last script\n const indexOffset = openScripts.length === index ? -1 : 0;\n currentScript = openScripts[index + indexOffset];\n if (editorRef.current !== null) {\n if (currentScript.model.isDisposed() || !currentScript.model) {\n regenerateModel(currentScript);\n }\n editorRef.current.setModel(currentScript.model);\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n editorRef.current.focus();\n }\n }\n rerender();\n }\n\n function onTabUpdate(index: number): void {\n const openScript = openScripts[index];\n const serverScriptCode = getServerCode(index);\n if (serverScriptCode === null) return;\n\n if (openScript.code !== serverScriptCode) {\n PromptEvent.emit({\n txt:\n \"Do you want to overwrite the current editor content with the contents of \" +\n openScript.fileName +\n \" on the server? This cannot be undone.\",\n resolve: (result: boolean | string) => {\n if (result) {\n // Save changes\n openScript.code = serverScriptCode;\n\n // Switch to target tab\n onTabClick(index);\n\n if (editorRef.current !== null && openScript !== null) {\n if (openScript.model === undefined || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n editorRef.current.setModel(openScript.model);\n\n editorRef.current.setValue(openScript.code);\n updateRAM(openScript.code);\n editorRef.current.focus();\n }\n }\n },\n });\n }\n }\n\n function dirty(index: number): string {\n const openScript = openScripts[index];\n const serverData = getServerCode(index);\n if (serverData === null) return \" *\";\n // For scripts, server code is stored with its starting & trailing whitespace removed\n const code = openScript.isTxt ? openScript.code : Script.formatCode(openScript.code);\n return serverData !== code ? \" *\" : \"\";\n }\n function getServerCode(index: number): string | null {\n const openScript = openScripts[index];\n const server = GetServer(openScript.hostname);\n if (server === null) throw new Error(`Server '${openScript.hostname}' should not be null, but it is.`);\n const data = openScript.isTxt\n ? server.textFiles.find((t) => t.filename === openScript.fileName)?.text\n : server.scripts.find((s) => s.filename === openScript.fileName)?.code;\n return data ?? null;\n }\n function handleFilterChange(event: React.ChangeEvent): void {\n setFilter(event.target.value);\n }\n function handleExpandSearch(): void {\n setFilter(\"\");\n setSearchExpanded(!searchExpanded);\n }\n const filteredOpenScripts = Object.values(openScripts).filter(\n (script) => script.hostname.includes(filter) || script.fileName.includes(filter),\n );\n\n const tabsMaxWidth = 1640;\n const tabMargin = 5;\n const tabMaxWidth = filteredOpenScripts.length ? tabsMaxWidth / filteredOpenScripts.length - tabMargin : 0;\n const tabIconWidth = 25;\n const tabTextWidth = tabMaxWidth - tabIconWidth * 2;\n return (\n <>\n
\n \n \n {(provided, snapshot) => (\n \n \n {searchExpanded ? (\n ,\n spellCheck: false,\n endAdornment: ,\n }}\n />\n ) : (\n \n )}\n \n {filteredOpenScripts.map(({ fileName, hostname }, index) => {\n const editingCurrentScript =\n currentScript?.fileName === filteredOpenScripts[index].fileName &&\n currentScript?.hostname === filteredOpenScripts[index].hostname;\n const externalScript = hostname !== \"home\";\n const colorProps = editingCurrentScript\n ? {\n background: Settings.theme.button,\n borderColor: Settings.theme.button,\n color: Settings.theme.primary,\n }\n : {\n background: Settings.theme.backgroundsecondary,\n borderColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary,\n };\n\n if (externalScript) {\n colorProps.color = Settings.theme.info;\n }\n const iconButtonStyle = {\n maxWidth: `${tabIconWidth}px`,\n minWidth: `${tabIconWidth}px`,\n minHeight: \"38.5px\",\n maxHeight: \"38.5px\",\n ...colorProps,\n };\n\n const scriptTabText = `${hostname}:~/${fileName} ${dirty(index)}`;\n return (\n \n {(provided) => (\n \n \n onTabClick(index)}\n onMouseDown={(e) => {\n e.preventDefault();\n if (e.button === 1) onTabClose(index);\n }}\n style={{\n maxWidth: `${tabTextWidth}px`,\n minHeight: \"38.5px\",\n overflow: \"hidden\",\n ...colorProps,\n }}\n >\n \n {scriptTabText}\n \n \n \n \n \n \n \n
\n )}\n
\n );\n })}\n {provided.placeholder}\n \n )}\n \n \n
\n Loading script editor!}\n height={`calc(100vh - ${130 + (options.vim ? 34 : 0)}px)`}\n defaultLanguage=\"javascript\"\n defaultValue={\"\"}\n onChange={updateCode}\n theme={options.theme}\n options={{ ...options, glyphMargin: true }}\n />\n\n \n\n \n \n \n {\n setRamInfoOpen(true);\n }}\n >\n {ram}\n \n \n \n \n {\" \"}\n Documentation:{\" \"}\n \n Basic\n \n {\" | \"}\n \n Full\n \n \n \n {\n sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n setOptionsOpen(false);\n }}\n options={{\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: Settings.MonacoVim,\n }}\n save={(options: Options) => {\n sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n setOptions(options);\n Settings.MonacoTheme = options.theme;\n Settings.MonacoInsertSpaces = options.insertSpaces;\n Settings.MonacoFontSize = options.fontSize;\n Settings.MonacoWordWrap = options.wordWrap;\n Settings.MonacoVim = options.vim;\n }}\n />\n setRamInfoOpen(false)}>\n \n \n {ramEntries.map(([n, r]) => (\n \n \n {n}\n \n {r}\n \n \n \n ))}\n \n
\n
\n
\n \n \n No open files\n \n Use nano FILENAME in\n
\n the terminal to open files\n
\n
\n \n \n );\n}\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains function that deal with Server-related directory things.\n * Functions that deal with the string manipulation can be found in\n * ./DirectoryHelpers.ts\n */\nimport { isValidDirectoryPath, isInRootDirectory, getFirstParentDirectory } from \"./DirectoryHelpers\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\n/**\n * Given a directory (by the full directory path) and a server, returns all\n * subdirectories of that directory. This is only for FIRST-LEVEl/immediate subdirectories\n */\nexport function getSubdirectories(serv: BaseServer, dir: string): string[] {\n const res: string[] = [];\n\n if (!isValidDirectoryPath(dir)) {\n return res;\n }\n\n let t_dir = dir;\n if (!t_dir.endsWith(\"/\")) {\n t_dir += \"/\";\n }\n\n function processFile(fn: string): void {\n if (t_dir === \"/\" && isInRootDirectory(fn)) {\n const subdir = getFirstParentDirectory(fn);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n } else if (fn.startsWith(t_dir)) {\n const remaining = fn.slice(t_dir.length);\n const subdir = getFirstParentDirectory(remaining);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n }\n }\n\n for (const script of serv.scripts) {\n processFile(script.filename);\n }\n\n for (const txt of serv.textFiles) {\n processFile(txt.fn);\n }\n\n return res;\n}\n\n/**\n * Returns true, if the server's directory itself or one of its subdirectory contains files.\n */\nexport function containsFiles(server: BaseServer, dir: string): boolean {\n const dirWithTrailingSlash = dir + (dir.slice(-1) === \"/\" ? \"\" : \"/\");\n\n return [...server.scripts.map((s) => s.filename), ...server.textFiles.map((t) => t.fn)].some((filename) =>\n filename.startsWith(dirWithTrailingSlash),\n );\n}\n","/**\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST to replace import urls with blobs\n */\nimport * as walk from \"acorn-walk\";\nimport { parse } from \"acorn\";\n\nimport { helpers } from \"./Netscript/NetscriptHelpers\";\nimport { ScriptUrl } from \"./Script/ScriptUrl\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { Script } from \"./Script/Script\";\nimport { areImportsEquals } from \"./Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { ScriptModule } from \"./Script/ScriptModule\";\n\n// Acorn type def is straight up incomplete so we have to fill with our own.\nexport type Node = any;\n\n// Makes a blob that contains the code of a given script.\nfunction makeScriptBlob(code: string): Blob {\n return new Blob([code], { type: \"text/javascript\" });\n}\n\nexport async function compile(player: IPlayer, script: Script, scripts: Script[]): Promise {\n //!shouldCompile ensures that script.module is non-null, hence the \"as\".\n if (!shouldCompile(script, scripts)) return script.module as Promise;\n script.queueCompile = true;\n //If we're already in the middle of compiling (script.module has not resolved yet), wait for the previous compilation to finish\n //If script.module is null, this does nothing.\n await script.module;\n //If multiple compiles were called on the same script before a compilation could be completed this ensures only one complilation is actually performed.\n if (!script.queueCompile) return script.module as Promise;\n script.queueCompile = false;\n script.updateRamUsage(player, scripts);\n const uurls = _getScriptUrls(script, scripts, []);\n const url = uurls[uurls.length - 1].url;\n if (script.url && script.url !== url) URL.revokeObjectURL(script.url);\n\n if (script.dependencies.length > 0) script.dependencies.forEach((dep) => URL.revokeObjectURL(dep.url));\n script.url = uurls[uurls.length - 1].url;\n // The URL at the top is the one we want to import. It will\n // recursively import all the other modules in the urlStack.\n //\n // Webpack likes to turn the import into a require, which sort of\n // but not really behaves like import. Particularly, it cannot\n // load fully dynamic content. So we hide the import from webpack\n // by placing it inside an eval call.\n script.module = new Promise((resolve) => resolve(eval(\"import(uurls[uurls.length - 1].url)\")));\n script.dependencies = uurls;\n return script.module;\n}\n\n// Begin executing a user JS script, and return a promise that resolves\n// or rejects when the script finishes.\n// - script is a script to execute (see Script.js). We depend only on .filename and .code.\n// scripts is an array of other scripts on the server.\n// env is the global environment that should be visible to all the scripts\n// (i.e. hack, grow, etc.).\n// When the promise returned by this resolves, we'll have finished\n// running the main function of the script.\nexport async function executeJSScript(\n player: IPlayer,\n scripts: Script[] = [],\n workerScript: WorkerScript,\n): Promise {\n const script = workerScript.getScript();\n if (script === null) throw new Error(\"script is null\");\n const loadedModule = await compile(player, script, scripts);\n workerScript.ramUsage = script.ramUsage;\n\n const ns = workerScript.env.vars;\n\n if (!loadedModule) {\n throw helpers.makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because the script module won't load`,\n );\n }\n // TODO: putting await in a non-async function yields unhelpful\n // \"SyntaxError: unexpected reserved word\" with no line number information.\n if (!loadedModule.main) {\n throw helpers.makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because it does not have a main function.`,\n );\n }\n if (!ns) {\n throw helpers.makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because the NS object hasn't been constructed properly.`,\n );\n }\n return loadedModule.main(ns);\n}\n\nfunction isDependencyOutOfDate(filename: string, scripts: Script[], scriptModuleSequenceNumber: number): boolean {\n const depScript = scripts.find((s) => s.filename == filename);\n\n // If the script is not present on the server, we should recompile, if only to get any necessary\n // compilation errors.\n if (!depScript) return true;\n\n const depIsMoreRecent = depScript.moduleSequenceNumber > scriptModuleSequenceNumber;\n return depIsMoreRecent;\n}\n/** Returns whether we should compile the script parameter.\n *\n * @param {Script} script\n * @param {Script[]} scripts\n */\nfunction shouldCompile(script: Script, scripts: Script[]): boolean {\n if (!script.module) return true;\n if (script.dependencies.some((dep) => isDependencyOutOfDate(dep.filename, scripts, script.moduleSequenceNumber))) {\n script.module = null;\n return true;\n }\n return false;\n}\n\n// Gets a stack of blob urls, the top/right-most element being\n// the blob url for the named script on the named server.\n//\n// - script -- the script for whom we are getting a URL.\n// - scripts -- all the scripts available on this server\n// - seen -- The modules above this one -- to prevent mutual dependency.\n//\n// TODO We don't make any effort to cache a given module when it is imported at\n// different parts of the tree. That hasn't presented any problem with during\n// testing, but it might be an idea for the future. Would require a topo-sort\n// then url-izing from leaf-most to root-most.\n/**\n * @param {Script} script\n * @param {Script[]} scripts\n * @param {Script[]} seen\n * @returns {ScriptUrl[]} All of the compiled scripts, with the final one\n * in the list containing the blob corresponding to\n * the script parameter.\n */\n// BUG: apparently seen is never consulted. Oops.\nfunction _getScriptUrls(script: Script, scripts: Script[], seen: Script[]): ScriptUrl[] {\n // Inspired by: https://stackoverflow.com/a/43834063/91401\n const urlStack: ScriptUrl[] = [];\n // Seen contains the dependents of the current script. Make sure we include that in the script dependents.\n for (const dependent of seen) {\n if (!script.dependents.some((s) => s.server === dependent.server && s.filename == dependent.filename)) {\n script.dependents.push({ server: dependent.server, filename: dependent.filename });\n }\n }\n seen.push(script);\n try {\n // Replace every import statement with an import to a blob url containing\n // the corresponding script. E.g.\n //\n // import {foo} from \"bar.js\";\n //\n // becomes\n //\n // import {foo} from \"blob://\"\n //\n // Where the blob URL contains the script content.\n\n // Parse the code into an ast tree\n const ast = parse(script.code, { sourceType: \"module\", ecmaVersion: \"latest\", ranges: true });\n interface importNode {\n filename: string;\n start: number;\n end: number;\n }\n const importNodes: importNode[] = [];\n // Walk the nodes of this tree and find any import declaration statements.\n walk.simple(ast, {\n ImportDeclaration(node: Node) {\n // Push this import onto the stack to replace\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n ExportNamedDeclaration(node: Node) {\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n ExportAllDeclaration(node: Node) {\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n });\n // Sort the nodes from last start index to first. This replaces the last import with a blob first,\n // preventing the ranges for other imports from being shifted.\n importNodes.sort((a, b) => b.start - a.start);\n let transformedCode = script.code;\n // Loop through each node and replace the script name with a blob url.\n for (const node of importNodes) {\n const filename = node.filename.startsWith(\"./\") ? node.filename.substring(2) : node.filename;\n\n // Find the corresponding script.\n const matchingScripts = scripts.filter((s) => areImportsEquals(s.filename, filename));\n if (matchingScripts.length === 0) continue;\n\n const [importedScript] = matchingScripts;\n\n const urls = _getScriptUrls(importedScript, scripts, seen);\n\n // The top url in the stack is the replacement import file for this script.\n urlStack.push(...urls);\n const blob = urls[urls.length - 1].url;\n\n // Replace the blob inside the import statement.\n transformedCode = transformedCode.substring(0, node.start) + blob + transformedCode.substring(node.end);\n }\n\n // We automatically define a print function() in the NetscriptJS module so that\n // accidental calls to window.print() do not bring up the \"print screen\" dialog\n transformedCode += `\\n//# sourceURL=${script.server}/${script.filename}`;\n\n const blob = URL.createObjectURL(makeScriptBlob(transformedCode));\n // Push the blob URL onto the top of the stack.\n urlStack.push(new ScriptUrl(script.filename, blob, script.moduleSequenceNumber));\n return urlStack;\n } catch (err) {\n // If there is an error, we need to clean up the URLs.\n for (const url of urlStack) URL.revokeObjectURL(url.url);\n throw err;\n } finally {\n seen.pop();\n }\n}\n","import { toNative } from \"./toNative\";\nimport libarg from \"arg\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\nimport { NetscriptContext } from \"../Netscript/APIWrapper\";\n\ntype FlagType = StringConstructor | NumberConstructor | BooleanConstructor | StringConstructor[];\ntype FlagsRet = { [key: string]: ScriptArg | string[] };\nexport function Flags(ctx: NetscriptContext | string[]): (data: unknown) => FlagsRet {\n const vargs = Array.isArray(ctx) ? ctx : ctx.workerScript.args;\n return (schema: unknown): FlagsRet => {\n schema = toNative(schema);\n if (!Array.isArray(schema)) throw new Error(\"flags schema passed in is invalid.\");\n const args: {\n [key: string]: FlagType;\n } = {};\n\n for (const d of schema) {\n let t: FlagType = String;\n if (typeof d[1] === \"number\") {\n t = Number;\n } else if (typeof d[1] === \"boolean\") {\n t = Boolean;\n } else if (Array.isArray(d[1])) {\n t = [String];\n }\n const numDashes = d[0].length > 1 ? 2 : 1;\n args[\"-\".repeat(numDashes) + d[0]] = t;\n }\n const ret: FlagsRet = libarg(args, { argv: vargs });\n for (const d of schema) {\n if (!ret.hasOwnProperty(\"--\" + d[0]) || !ret.hasOwnProperty(\"-\" + d[0])) ret[d[0]] = d[1];\n }\n for (const key of Object.keys(ret)) {\n if (!key.startsWith(\"-\")) continue;\n const value = ret[key];\n delete ret[key];\n const numDashes = key.length === 2 ? 1 : 2;\n ret[key.slice(numDashes)] = value;\n }\n return ret;\n };\n}\n","import * as React from \"react\";\nimport { useTheme } from \"@mui/material/styles\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport FirstPageIcon from \"@mui/icons-material/FirstPage\";\nimport KeyboardArrowLeft from \"@mui/icons-material/KeyboardArrowLeft\";\nimport KeyboardArrowRight from \"@mui/icons-material/KeyboardArrowRight\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\n\ninterface TablePaginationActionsProps {\n count: number;\n page: number;\n rowsPerPage: number;\n onPageChange: (event: React.MouseEvent, newPage: number) => void;\n}\n\nexport function TablePaginationActionsAll(props: TablePaginationActionsProps): React.ReactElement {\n const theme = useTheme();\n const { count, page, rowsPerPage, onPageChange } = props;\n\n const handleFirstPageButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, 0);\n };\n\n const handleBackButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, page - 1);\n };\n\n const handleNextButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, page + 1);\n };\n\n const handleLastPageButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return (\n \n \n {theme.direction === \"rtl\" ? : }\n \n \n {theme.direction === \"rtl\" ? : }\n \n = Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? : }\n \n = Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? : }\n \n \n );\n}\n","import ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport { Box, Collapse, ListItemButton, ListItemText, Paper, Table, TableBody, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React from \"react\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { defaultMultipliers, getBitNodeMultipliers } from \"../BitNode\";\nimport { IBitNodeMultipliers } from \"../BitNodeMultipliers\";\n\ninterface IProps {\n n: number;\n level?: number;\n}\n\nexport function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactElement {\n const [open, setOpen] = React.useState(false);\n if (n === 1) return <>;\n\n return (\n \n setOpen((old) => !old)}>\n Bitnode Multipliers} />\n {open ? : }\n \n \n \n \n \n );\n}\n\nexport const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => {\n const player = use.Player();\n // If a level argument has been provided, use that as the multiplier level\n // If not, then we have to assume that we want the next level up from the\n // current node's source file, so we get the min of that, the SF's max level,\n // or if it's BN12, ∞\n const maxSfLevel = n === 12 ? Infinity : 3;\n const mults = getBitNodeMultipliers(n, level ?? Math.min(player.sourceFileLvl(n) + 1, maxSfLevel));\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\ninterface IBNMultRows {\n [mult: string]: {\n name: string;\n content?: string;\n color?: string;\n };\n}\n\ninterface IBNMultTableProps {\n sectionName: string;\n rowData: IBNMultRows;\n mults: IBitNodeMultipliers;\n}\n\nconst BNMultTable = (props: IBNMultTableProps): React.ReactElement => {\n const rowsArray = Object.entries(props.rowData)\n .filter(([key]) => props.mults[key] !== defaultMultipliers[key])\n .map(([key, value]) => (\n \n ));\n\n return rowsArray.length > 0 ? (\n \n {props.sectionName}\n \n {rowsArray}\n
\n
\n ) : (\n <>\n );\n};\n\ninterface IMultsProps {\n n: number;\n mults: IBitNodeMultipliers;\n}\n\nfunction GeneralMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n WorldDaemonDifficulty: { name: `${SpecialServers.WorldDaemon} Difficulty` },\n DaedalusAugsRequirement: {\n name: \"Daedalus Augs Requirement\",\n content: String(mults.DaedalusAugsRequirement),\n },\n HacknetNodeMoney: { name: \"Hacknet Production\" },\n CodingContractMoney: { name: \"Coding Contract Reward\" },\n ClassGymExpGain: { name: \"Class/Gym Exp\" },\n };\n\n return ;\n}\n\nfunction AugmentationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n AugmentationMoneyCost: { name: \"Money Cost\" },\n AugmentationRepCost: {\n name: \"Reputation Cost\",\n color: Settings.theme.rep,\n },\n };\n\n return ;\n}\n\nfunction CompanyMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CompanyWorkMoney: {\n name: \"Work Money\",\n color: Settings.theme.money,\n },\n CompanyWorkExpGain: { name: \"Work Exp\" },\n };\n\n return ;\n}\n\nfunction StockMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n FourSigmaMarketDataCost: { name: \"Market Data Cost\" },\n FourSigmaMarketDataApiCost: { name: \"Market Data API Cost\" },\n };\n\n return ;\n}\n\nfunction FactionMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n RepToDonateToFaction: { name: \"Favor to Donate\" },\n FactionWorkRepGain: {\n name: \"Work Reputation\",\n color: Settings.theme.rep,\n },\n FactionWorkExpGain: { name: \"Work Exp\" },\n FactionPassiveRepGain: {\n name: \"Passive Rep\",\n color: Settings.theme.rep,\n },\n };\n\n return ;\n}\n\nfunction CrimeMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CrimeExpGain: {\n name: \"Crime Exp\",\n color: Settings.theme.combat,\n },\n CrimeMoney: {\n name: \"Crime Money\",\n color: Settings.theme.combat,\n },\n };\n\n return ;\n}\n\nfunction SkillMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackingLevelMultiplier: {\n name: \"Hacking Level\",\n color: Settings.theme.hack,\n },\n StrengthLevelMultiplier: {\n name: \"Strength Level\",\n color: Settings.theme.combat,\n },\n DefenseLevelMultiplier: {\n name: \"Defense Level\",\n color: Settings.theme.combat,\n },\n DexterityLevelMultiplier: {\n name: \"Dexterity Level\",\n color: Settings.theme.combat,\n },\n AgilityLevelMultiplier: {\n name: \"Agility Level\",\n color: Settings.theme.combat,\n },\n CharismaLevelMultiplier: {\n name: \"Charisma Level\",\n color: Settings.theme.cha,\n },\n };\n\n return ;\n}\n\nfunction HackingMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackExpGain: {\n name: \"Hacking Exp\",\n color: Settings.theme.hack,\n },\n ServerGrowthRate: { name: \"Server Growth Rate\" },\n ServerMaxMoney: { name: \"Server Max Money\" },\n ServerStartingMoney: { name: \"Server Starting Money\" },\n ServerStartingSecurity: { name: \"Server Starting Security\" },\n ServerWeakenRate: { name: \"Server Weaken Rate\" },\n ManualHackMoney: {\n name: \"Manual Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoney: {\n name: \"Script Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoneyGain: {\n name: \"Money Gained From Hack\",\n color: Settings.theme.money,\n },\n };\n\n return ;\n}\n\nfunction PurchasedServersMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n PurchasedServerCost: {\n name: \"Base Cost\",\n content: mults.PurchasedServerCost.toFixed(3),\n },\n PurchasedServerSoftcap: {\n name: \"Softcap Cost\",\n content: mults.PurchasedServerSoftcap.toFixed(3),\n },\n PurchasedServerLimit: { name: \"Server Limit\" },\n PurchasedServerMaxRam: { name: \"Max RAM\" },\n HomeComputerRamCost: { name: \"Home RAM Cost\" },\n };\n\n return ;\n}\n\nfunction InfiltrationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n InfiltrationMoney: {\n name: \"Infiltration Money\",\n color: Settings.theme.money,\n },\n InfiltrationRep: {\n name: \"Infiltration Reputation\",\n color: Settings.theme.rep,\n },\n };\n\n return ;\n}\n\nfunction BladeburnerMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessBladeburner()) return <>;\n\n const rows: IBNMultRows = {\n BladeburnerRank: { name: \"Rank Gain\" },\n BladeburnerSkillCost: { name: \"Skill Cost\" },\n };\n\n return ;\n}\n\nfunction StanekMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessCotMG()) return <>;\n\n const extraSize = mults.StaneksGiftExtraSize.toFixed(3);\n const rows: IBNMultRows = {\n StnakesGiftPowerMultiplier: { name: \"Gift Power\" },\n StaneksGiftExtraSize: {\n name: \"Base Size Modifier\",\n content: `${mults.StaneksGiftExtraSize > defaultMultipliers.StaneksGiftExtraSize ? `+${extraSize}` : extraSize}`,\n },\n };\n\n return ;\n}\n\nfunction GangMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (player.bitNodeN !== 2 && player.sourceFileLvl(2) <= 0) return <>;\n\n const rows: IBNMultRows = {\n GangSoftcap: {\n name: \"Gang Softcap\",\n content: mults.GangSoftcap.toFixed(3),\n },\n GangUniqueAugs: { name: \"Unique Augmentations\" },\n };\n\n return ;\n}\n\nfunction CorporationMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessCorporation()) return <>;\n\n const rows: IBNMultRows = {\n CorporationSoftcap: {\n name: \"Corporation Softcap\",\n content: mults.CorporationSoftcap.toFixed(3),\n },\n CorporationValuation: { name: \"Valuation\" },\n };\n\n return ;\n}\n","import * as React from \"react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { TableCell as MuiTableCell, TableCellProps } from \"@mui/material\";\n\nconst useStyles = makeStyles({\n root: {\n border: \"1px solid white\",\n width: \"5px\",\n height: \"5px\",\n },\n});\n\nexport const TableCell: React.FC = (props: TableCellProps) => {\n return (\n \n );\n};\n\ntype IProps = {\n onMouseEnter?: () => void;\n onClick?: () => void;\n color: string;\n};\n\nexport function Cell(cellProps: IProps): React.ReactElement {\n return (\n \n );\n}\n","import { TableBody, TableRow } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { calculateGrid } from \"../Helper\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport { Cell } from \"./Cell\";\n\ninterface IProps {\n width: number;\n height: number;\n ghostGrid: number[][];\n gift: IStaneksGift;\n enter(i: number, j: number): void;\n click(i: number, j: number): void;\n}\n\nfunction randomColor(fragment: ActiveFragment): string {\n // Can't set Math.random seed so copy casino. TODO refactor both RNG later.\n let s1 = Math.pow((fragment.x + 1) * (fragment.y + 1), 10);\n let s2 = s1;\n let s3 = s1;\n\n const colors = [];\n for (let i = 0; i < 3; i++) {\n s1 = (171 * s1) % 30269;\n s2 = (172 * s2) % 30307;\n s3 = (170 * s3) % 30323;\n colors.push((s1 / 30269.0 + s2 / 30307.0 + s3 / 30323.0) % 1.0);\n }\n\n return `rgb(${colors[0] * 256}, ${colors[1] * 256}, ${colors[2] * 256})`;\n}\n\nexport function Grid(props: IProps): React.ReactElement {\n const activeGrid = calculateGrid(props.gift);\n\n function color(worldX: number, worldY: number): string {\n if (props.ghostGrid[worldX][worldY] && activeGrid[worldX][worldY]) return \"red\";\n if (props.ghostGrid[worldX][worldY]) return \"white\";\n\n if (activeGrid[worldX][worldY]) {\n const fragment = props.gift.fragmentAt(worldX, worldY);\n if (!fragment) throw new Error(\"ActiveFragment should not be null\");\n return randomColor(fragment);\n }\n return \"\";\n }\n\n // switch the width/length to make axis consistent.\n const elems = [];\n for (let j = 0; j < props.height; j++) {\n const cells = [];\n for (let i = 0; i < props.width; i++) {\n cells.push(\n props.enter(i, j)} onClick={() => props.click(i, j)} color={color(i, j)} />,\n );\n }\n elems.push({cells});\n }\n\n return {elems};\n}\n","import { GetServer } from \"../Server/AllServers\";\nimport { RunningScript } from \"./RunningScript\";\n\nexport function getRamUsageFromRunningScript(script: RunningScript): number {\n if (script.ramUsage != null && script.ramUsage > 0) {\n return script.ramUsage; // Use cached value\n }\n\n const server = GetServer(script.server);\n if (server == null) {\n return 0;\n }\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === script.filename) {\n // Cache the ram usage for the next call\n script.ramUsage = server.scripts[i].ramUsage;\n return script.ramUsage;\n }\n }\n\n return 0;\n}\n","import { ITerminal } from \"../../ITerminal\";\nimport { removeLeadingSlash, removeTrailingSlash } from \"../../DirectoryHelpers\";\nimport { IRouter, ScriptEditorRouteOptions } from \"../../../ui/Router\";\nimport { IPlayer } from \"../../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../../Script/isScriptFilename\";\nimport { CursorPositions } from \"../../../ScriptEditor/CursorPositions\";\nimport { Script } from \"../../../Script/Script\";\nimport { isEmpty } from \"lodash\";\n\ninterface EditorParameters {\n terminal: ITerminal;\n router: IRouter;\n player: IPlayer;\n server: BaseServer;\n args: (string | number | boolean)[];\n}\n\nfunction isNs2(filename: string): boolean {\n return filename.endsWith(\".js\");\n}\n\nconst newNs2Template = `/** @param {NS} ns */\nexport async function main(ns) {\n\n}`;\n\ninterface ISimpleScriptGlob {\n glob: string;\n preGlob: string;\n postGlob: string;\n globError: string;\n globMatches: string[];\n globAgainst: Script[];\n}\n\nfunction containsSimpleGlob(filename: string): boolean {\n return filename.includes(\"*\");\n}\n\nfunction detectSimpleScriptGlob(\n args: EditorParameters[\"args\"],\n player: IPlayer,\n terminal: ITerminal,\n): ISimpleScriptGlob | null {\n if (args.length == 1 && containsSimpleGlob(`${args[0]}`)) {\n const filename = `${args[0]}`;\n const scripts = player.getCurrentServer().scripts;\n const parsedGlob = parseSimpleScriptGlob(filename, scripts, terminal);\n return parsedGlob;\n }\n return null;\n}\n\nfunction parseSimpleScriptGlob(globString: string, globDatabase: Script[], terminal: ITerminal): ISimpleScriptGlob {\n const parsedGlob: ISimpleScriptGlob = {\n glob: globString,\n preGlob: \"\",\n postGlob: \"\",\n globError: \"\",\n globMatches: [],\n globAgainst: globDatabase,\n };\n\n // Ensure deep globs are minified to simple globs, which act as deep globs in this impl\n globString = globString.replace(\"**\", \"*\");\n\n // Ensure only a single glob is present\n if (globString.split(\"\").filter((c) => c == \"*\").length !== 1) {\n parsedGlob.globError = \"Only a single glob is supported per command.\\nexample: `nano my-dir/*.js`\";\n return parsedGlob;\n }\n\n // Split arg around glob, normalize preGlob path\n [parsedGlob.preGlob, parsedGlob.postGlob] = globString.split(\"*\");\n parsedGlob.preGlob = removeLeadingSlash(parsedGlob.preGlob);\n\n // Add CWD to preGlob path\n const cwd = removeTrailingSlash(terminal.cwd());\n parsedGlob.preGlob = `${cwd}/${parsedGlob.preGlob}`;\n\n // For every script on the current server, filter matched scripts per glob values & persist\n globDatabase.forEach((script) => {\n const filename = script.filename.startsWith(\"/\") ? script.filename : `/${script.filename}`;\n if (filename.startsWith(parsedGlob.preGlob) && filename.endsWith(parsedGlob.postGlob)) {\n parsedGlob.globMatches.push(filename);\n }\n });\n\n // Rebuild glob for potential error reporting\n parsedGlob.glob = `${parsedGlob.preGlob}*${parsedGlob.postGlob}`;\n\n return parsedGlob;\n}\n\nexport function commonEditor(\n command: string,\n { terminal, router, player, args }: EditorParameters,\n scriptEditorRouteOptions?: ScriptEditorRouteOptions,\n): void {\n if (args.length < 1) {\n terminal.error(`Incorrect usage of ${command} command. Usage: ${command} [scriptname]`);\n return;\n }\n\n let filesToLoadOrCreate = args;\n try {\n const globSearch = detectSimpleScriptGlob(args, player, terminal);\n if (globSearch) {\n if (isEmpty(globSearch.globError) === false) throw new Error(globSearch.globError);\n filesToLoadOrCreate = globSearch.globMatches;\n }\n\n const files = filesToLoadOrCreate.map((arg) => {\n const filename = `${arg}`;\n\n if (isScriptFilename(filename)) {\n const filepath = terminal.getFilepath(filename);\n const script = terminal.getScript(player, filename);\n const fileIsNs2 = isNs2(filename);\n const code = script !== null ? script.code : fileIsNs2 ? newNs2Template : \"\";\n\n if (code === newNs2Template) {\n CursorPositions.saveCursor(filename, {\n row: 3,\n column: 5,\n });\n }\n\n return [filepath, code];\n }\n\n if (filename.endsWith(\".txt\")) {\n const filepath = terminal.getFilepath(filename);\n const txt = terminal.getTextFile(player, filename);\n return [filepath, txt === null ? \"\" : txt.text];\n }\n\n throw new Error(\n `Invalid file. Only scripts (.script or .js), or text files (.txt) can be edited with ${command}`,\n );\n });\n\n if (globSearch && files.length === 0) {\n throw new Error(`Could not find any valid files to open with ${command} using glob: \\`${globSearch.glob}\\``);\n }\n\n router.toScriptEditor(Object.fromEntries(files), scriptEditorRouteOptions);\n } catch (e) {\n terminal.error(`${e}`);\n }\n}\n","export function HammingEncode(data: number): string {\n const enc: Array = [0];\n const data_bits: Array = data.toString(2).split(\"\").reverse();\n\n data_bits.forEach((e, i, a) => {\n a[i] = parseInt(e);\n });\n\n let k = data_bits.length;\n\n /* NOTE: writing the data like this flips the endianness, this is what the\n * original implementation by Hedrauta did so I'm keeping it like it was. */\n for (let i = 1; k > 0; i++) {\n if ((i & (i - 1)) != 0) {\n enc[i] = data_bits[--k];\n } else {\n enc[i] = 0;\n }\n }\n\n let parity: any = 0;\n\n /* Figure out the subsection parities */\n for (let i = 0; i < enc.length; i++) {\n if (enc[i]) {\n parity ^= i;\n }\n }\n\n parity = parity.toString(2).split(\"\").reverse();\n parity.forEach((e: any, i: any, a: any) => {\n a[i] = parseInt(e);\n });\n\n /* Set the parity bits accordingly */\n for (let i = 0; i < parity.length; i++) {\n enc[2 ** i] = parity[i] ? 1 : 0;\n }\n\n parity = 0;\n /* Figure out the overall parity for the entire block */\n for (let i = 0; i < enc.length; i++) {\n if (enc[i]) {\n parity++;\n }\n }\n\n /* Finally set the overall parity bit */\n enc[0] = parity % 2 == 0 ? 0 : 1;\n\n return enc.join(\"\");\n}\n\nexport function HammingEncodeProperly(data: number): string {\n /* How many bits do we need?\n * n = 2^m\n * k = 2^m - m - 1\n * where k is the number of data bits, m the number\n * of parity bits and n the number of total bits. */\n\n let m = 1;\n\n while (2 ** (2 ** m - m - 1) - 1 < data) {\n m++;\n }\n\n const n: number = 2 ** m;\n const k: number = 2 ** m - m - 1;\n\n const enc: Array = [0];\n const data_bits: Array = data.toString(2).split(\"\").reverse();\n\n data_bits.forEach((e, i, a) => {\n a[i] = parseInt(e);\n });\n\n /* Flip endianness as in the original implementation by Hedrauta\n * and write the data back to front\n * XXX why do we do this? */\n for (let i = 1, j = k; i < n; i++) {\n if ((i & (i - 1)) != 0) {\n enc[i] = data_bits[--j] ? data_bits[j] : 0;\n }\n }\n\n let parity: any = 0;\n\n /* Figure out the subsection parities */\n for (let i = 0; i < n; i++) {\n if (enc[i]) {\n parity ^= i;\n }\n }\n\n parity = parity.toString(2).split(\"\").reverse();\n parity.forEach((e: any, i: any, a: any) => {\n a[i] = parseInt(e);\n });\n\n /* Set the parity bits accordingly */\n for (let i = 0; i < m; i++) {\n enc[2 ** i] = parity[i] ? 1 : 0;\n }\n\n parity = 0;\n /* Figure out the overall parity for the entire block */\n for (let i = 0; i < n; i++) {\n if (enc[i]) {\n parity++;\n }\n }\n\n /* Finally set the overall parity bit */\n enc[0] = parity % 2 == 0 ? 0 : 1;\n\n return enc.join(\"\");\n}\n\nexport function HammingDecode(data: string): number {\n let err = 0;\n const bits: Array = [];\n\n /* TODO why not just work with an array of digits from the start? */\n for (const i in data.split(\"\")) {\n const bit = parseInt(data[i]);\n bits[i] = bit;\n\n if (bit) {\n err ^= +i;\n }\n }\n\n /* If err != 0 then it spells out the index of the bit that was flipped */\n if (err) {\n /* Flip to correct */\n bits[err] = bits[err] ? 0 : 1;\n }\n\n /* Now we have to read the message, bit 0 is unused (it's the overall parity bit\n * which we don't care about). Each bit at an index that is a power of 2 is\n * a parity bit and not part of the actual message. */\n\n let ans = \"\";\n\n for (let i = 1; i < bits.length; i++) {\n /* i is not a power of two so it's not a parity bit */\n if ((i & (i - 1)) != 0) {\n ans += bits[i];\n }\n }\n\n /* TODO to avoid ambiguity about endianness why not let the player return the extracted (and corrected)\n * data bits, rather than guessing at how to convert it to a decimal string? */\n return parseInt(ans, 2);\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Contract extends Action {\n constructor(params: IActionParams | null = null) {\n super(params);\n }\n\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return inst.skillMultipliers.successChanceContract;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Contract\", this);\n }\n\n static fromJSON(value: IReviverValue): Contract {\n return Generic_fromJSON(Contract, value.data);\n }\n}\n\nReviver.constructors.Contract = Contract;\n","export const ConsoleHelpText: {\n [key: string]: string[];\n helpList: string[];\n automate: string[];\n clear: string[];\n cls: string[];\n help: string[];\n log: string[];\n skill: string[];\n start: string[];\n stop: string[];\n} = {\n helpList: [\n \"Use 'help [command]' to get more information about a particular Bladeburner console command.\",\n \" \",\n \" automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks\",\n \" clear/cls Clear the console\",\n \" help [cmd] Display this help text, or help text for a specific command\",\n \" log [en/dis] [type] Enable or disable logging for events and actions\",\n \" skill [action] [name] Level or display info about your Bladeburner skills\",\n \" start [type] [name] Start a Bladeburner action/task\",\n \" stop Stops your current Bladeburner action/task\",\n \" \",\n ],\n automate: [\n \"Usage: automate [var] [val] [hi/low]\",\n \" \",\n \"A simple way to automate your Bladeburner actions. This console command can be used \" +\n \"to automatically start an action when your stamina rises above a certain threshold, and \" +\n \"automatically switch to another action when your stamina drops below another threshold.\",\n \" \",\n \" automate status - Check the current status of your automation and get a brief description of what it'll do\",\n \" automate en - Enable the automation feature\",\n \" automate dis - Disable the automation feature\",\n \" \",\n \"There are four properties that must be set for this automation to work properly. Here is how to set them:\",\n \" \",\n \" automate stamina 100 high\",\n \" automate contract Tracking high\",\n \" automate stamina 50 low\",\n \" automate general 'Field Analysis' low\",\n \" \",\n \"Using the four console commands above will set the automation to perform Tracking contracts \" +\n \"if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below \" +\n \"50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must \" +\n \"exactly match whatever the name is in the UI.\",\n \" \",\n ],\n clear: [\"Usage: clear\", \" \", \"Clears the console\", \" \"],\n cls: [\"Usage: cls\", \" \", \"Clears the console\", \" \"],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Running 'help' with no arguments displays the general help text, which lists all console commands \" +\n \"and a brief description of what they do. A command can be specified to get more specific help text \" +\n \"about that particular command. For example:\",\n \" \",\n \" help automate\",\n \" \",\n \"will display specific information about using the automate console command\",\n \" \",\n ],\n log: [\n \"Usage: log [en/dis] [type]\",\n \" \",\n \"Enable or disable logging. By default, the results of completing actions such as contracts/operations are logged \" +\n \"in the console. There are also random events that are logged in the console as well. The five categories of \" +\n \"things that get logged are:\",\n \" \",\n \"[general, contracts, ops, blackops, events]\",\n \" \",\n \"The logging for these categories can be enabled or disabled like so:\",\n \" \",\n \" log dis contracts - Disables logging that occurs when contracts are completed\",\n \" log en contracts - Enables logging that occurs when contracts are completed\",\n \" log dis events - Disables logging for Bladeburner random events\",\n \" \",\n \"Logging can be universally enabled/disabled using the 'all' keyword:\",\n \" \",\n \" log dis all\",\n \" log en all\",\n \" \",\n ],\n skill: [\n \"Usage: skill [action] [name]\",\n \" \",\n \"Level or display information about your skills.\",\n \" \",\n \"To display information about all of your skills and your multipliers, use:\",\n \" \",\n \" skill list\",\n \" \",\n \"To display information about a specific skill, specify the name of the skill afterwards. \" +\n \"Note that the name of the skill is case-sensitive. Enter it exactly as seen in the UI. If \" +\n \"the name of the skill has whitespace, enclose the name of the skill in double quotation marks:\",\n \" \",\n \" skill list Reaper\",\n \" skill list 'Digital Observer'\",\n \" \",\n \"This console command can also be used to level up skills:\",\n \" \",\n \" skill level [skill name]\",\n \" \",\n ],\n start: [\n \"Usage: start [type] [name]\",\n \" \",\n \"Start an action. An action is specified by its type and its name. The \" +\n \"name is case-sensitive. It must appear exactly as it does in the UI. If \" +\n \"the name of the action has whitespace, enclose it in double quotation marks. \" +\n \"Valid action types include:\",\n \" \",\n \"[general, contract, op, blackop]\",\n \" \",\n \"Examples:\",\n \" \",\n \" start contract Tracking\",\n \" start op 'Undercover Operation'\",\n \" \",\n ],\n stop: [\"Usage: stop\", \" \", \"Stop your current action and go idle.\", \" \"],\n};\n","// Defines a \"Research Tree\"\n// Each Industry has a unique Research Tree\n// Each Node in the Research Trees only holds the name(s) of Research,\n// not an actual Research object. The name can be used to obtain a reference\n// to the corresponding Research object using the ResearchMap\nimport { Research } from \"./Research\";\nimport { ResearchMap } from \"./ResearchMap\";\n\nimport { IMap } from \"../types\";\n\ninterface IConstructorParams {\n children?: Node[];\n cost: number;\n text: string;\n parent?: Node | null;\n}\n\nexport class Node {\n // All child Nodes in the tree\n // The Research held in this Node is a prerequisite for all Research in\n // child Nodes\n children: Node[] = [];\n\n // How much Scientific Research is needed for this\n // Necessary to show it on the UI\n cost = 0;\n\n // Whether or not this Research has been unlocked\n researched = false;\n\n // Parent node in the tree\n // The parent node defines the prerequisite Research (there can only be one)\n // Set as null for no prerequisites\n parent: Node | null = null;\n\n // Name of the Research held in this Node\n text = \"\";\n\n constructor(p: IConstructorParams = { cost: 0, text: \"\" }) {\n if (ResearchMap[p.text] == null) {\n throw new Error(`Invalid Research name used when constructing ResearchTree Node: ${p.text}`);\n }\n\n this.text = p.text;\n this.cost = p.cost;\n\n if (p.children && p.children.length > 0) {\n this.children = p.children;\n }\n\n if (p.parent != null) {\n this.parent = p.parent;\n }\n }\n\n addChild(n: Node): void {\n this.children.push(n);\n n.parent = this;\n }\n\n // Recursive function for finding a Node with the specified text\n findNode(text: string): Node | null {\n // Is this the Node?\n if (this.text === text) {\n return this;\n }\n\n // Recursively search chilren\n let res = null;\n for (let i = 0; i < this.children.length; ++i) {\n res = this.children[i].findNode(text);\n if (res != null) {\n return res;\n }\n }\n\n return null;\n }\n\n setParent(n: Node): void {\n this.parent = n;\n }\n}\n\n// A ResearchTree defines all available Research in an Industry\n// The root node in a Research Tree must always be the \"Hi-Tech R&D Laboratory\"\nexport class ResearchTree {\n // Object containing names of all acquired Research by name\n researched: IMap = {};\n\n // Root Node\n root: Node | null = null;\n\n // Gets an array with the 'text' values of ALL Nodes in the Research Tree\n getAllNodes(): string[] {\n const res: string[] = [];\n const queue: Node[] = [];\n\n if (this.root == null) {\n return res;\n }\n\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n res.push(node.text);\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Get total multipliers from this Research Tree\n getAdvertisingMultiplier(): number {\n return this.getMultiplierHelper(\"advertisingMult\");\n }\n\n getEmployeeChaMultiplier(): number {\n return this.getMultiplierHelper(\"employeeChaMult\");\n }\n\n getEmployeeCreMultiplier(): number {\n return this.getMultiplierHelper(\"employeeCreMult\");\n }\n\n getEmployeeEffMultiplier(): number {\n return this.getMultiplierHelper(\"employeeEffMult\");\n }\n\n getEmployeeIntMultiplier(): number {\n return this.getMultiplierHelper(\"employeeIntMult\");\n }\n\n getProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productionMult\");\n }\n\n getProductProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productProductionMult\");\n }\n\n getSalesMultiplier(): number {\n return this.getMultiplierHelper(\"salesMult\");\n }\n\n getScientificResearchMultiplier(): number {\n return this.getMultiplierHelper(\"sciResearchMult\");\n }\n\n getStorageMultiplier(): number {\n return this.getMultiplierHelper(\"storageMult\");\n }\n\n // Helper function for all the multiplier getter fns\n getMultiplierHelper(propName: string): number {\n let res = 1;\n if (this.root == null) {\n return res;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n\n // If the Node has not been researched, there's no need to\n // process it or its children\n if (node == null || !node.researched) {\n continue;\n }\n\n const research: Research | null = ResearchMap[node.text];\n\n // Safety checks\n if (research == null) {\n console.warn(`Invalid Research name in node: ${node.text}`);\n continue;\n }\n\n const mult =\n {\n advertisingMult: research.advertisingMult,\n employeeChaMult: research.employeeChaMult,\n employeeCreMult: research.employeeCreMult,\n employeeEffMult: research.employeeEffMult,\n employeeIntMult: research.employeeIntMult,\n productionMult: research.productionMult,\n productProductionMult: research.productProductionMult,\n salesMult: research.salesMult,\n sciResearchMult: research.sciResearchMult,\n storageMult: research.storageMult,\n }[propName] ?? null;\n\n if (mult == null) {\n console.warn(`Invalid propName specified in ResearchTree.getMultiplierHelper: ${propName}`);\n continue;\n }\n\n res *= mult;\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Search for a Node with the given name ('text' property on the Node)\n // Returns 'null' if it cannot be found\n findNode(name: string): Node | null {\n if (this.root == null) {\n return null;\n }\n return this.root.findNode(name);\n }\n\n // Marks a Node as researched\n research(name: string): void {\n if (this.root == null) {\n return;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n if (node.text === name) {\n node.researched = true;\n this.researched[name] = true;\n return;\n }\n\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n console.warn(`ResearchTree.research() did not find the specified Research node for: ${name}`);\n }\n\n // Set the tree's Root Node\n setRoot(root: Node): void {\n this.root = root;\n }\n}\n","/**\n * How many stock market 'ticks' before a 'cycle' is triggered.\n * A 'tick' is whenver stock prices update\n */\nexport const TicksPerCycle = 75;\n","export const StanekConstants: {\n RAMBonus: number;\n BaseSize: number;\n MaxSize: number;\n} = {\n RAMBonus: 0.1,\n BaseSize: 9,\n MaxSize: 25,\n};\n","import { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { Player } from \"../Player\";\nimport { Script } from \"../Script/Script\";\nimport { GetAllServers } from \"../Server/AllServers\";\n\nconst detect: [string, string][] = [\n [\"getHackTime\", \"returns milliseconds\"],\n [\"getGrowTime\", \"returns milliseconds\"],\n [\"getWeakenTime\", \"returns milliseconds\"],\n [\"getActionTime\", \"returns milliseconds\"],\n [\"hackAnalyzePercent\", \"renamed 'hackAnalyze' and returns decimal\"],\n [\"hackChance\", \"renamed 'hackAnalyzeChance'\"],\n [\"basic.calculateSkill\", \"renamed 'skills.calculateSkill'\"],\n [\"basic.calculateExp\", \"renamed 'skills.calculateExp'\"],\n [\"basic.hackChance\", \"renamed 'hacking.hackChance'\"],\n [\"basic.hackExp\", \"renamed 'hacking.hackExp'\"],\n [\"basic.hackPercent\", \"renamed 'hacking.hackPercent'\"],\n [\"basic.growPercent\", \"renamed 'hacking.growPercent'\"],\n [\"basic.hackTime\", \"renamed 'hacking.hackTime'\"],\n [\"basic.growTime\", \"renamed 'hacking.growTime'\"],\n [\"basic.weakenTime\", \"renamed 'hacking.weakenTime'\"],\n [\"write\", \"needs to be awaited\"],\n [\"scp\", \"needs to be awaited\"],\n [\"sleep\", \"Can no longer be called simultenaously.\"],\n [\"hacking_skill\", \"renamed 'hacking'\"],\n [\"tryWrite\", \"renamed 'tryWritePort'\"],\n];\n\nconst changes: [RegExp, string][] = [\n [/ns.getHackTime/g, \"((...a)=>ns.getHackTime(...a)/1000)\"],\n [/ns.getGrowTime/g, \"((...a)=>ns.getGrowTime(...a)/1000)\"],\n [/ns.getWeakenTime/g, \"((...a)=>ns.getWeakenTime(...a)/1000)\"],\n [/ns.bladeburner.getActionTime/g, \"((...a)=>ns.bladeburner.getActionTime(...a)/1000)\"],\n [/ns.hackAnalyzePercent/g, \"((...a)=>ns.hackAnalyze(...a)*100)\"],\n [/ns.hackChance/g, \"ns.hackAnalyzeChance\"],\n [/ns.tryWrite/g, \"ns.tryWritePort\"],\n [/formulas.basic.calculateSkill/g, \"formulas.skills.calculateSkill\"],\n [/formulas.basic.calculateExp/g, \"formulas.skills.calculateExp\"],\n [/formulas.basic.hackChance/g, \"formulas.hacking.hackChance\"],\n [/formulas.basic.hackExp/g, \"formulas.hacking.hackExp\"],\n [/formulas.basic.hackPercent/g, \"formulas.hacking.hackPercent\"],\n [/formulas.basic.growPercent/g, \"formulas.hacking.growPercent\"],\n [/formulas.basic.hackTime/g, \"formulas.hacking.hackTime\"],\n [/formulas.basic.growTime/g, \"formulas.hacking.growTime\"],\n [/formulas.basic.weakenTime/g, \"formulas.hacking.weakenTime\"],\n];\nfunction hasChanges(code: string): boolean {\n for (const change of changes) {\n if (code.match(change[0])) return true;\n }\n return false;\n}\n\nfunction convert(code: string): string {\n const lines = code.split(\"\\n\");\n const out: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n const orig = lines[i];\n let line = lines[i];\n for (const change of changes) {\n line = line.replace(change[0], change[1]);\n }\n if (line != orig) {\n out.push(`// =============================== original line ===============================`);\n out.push(`/**`);\n out.push(` * ${orig}`);\n out.push(\" */\");\n out.push(`// =============================================================================`);\n }\n out.push(line);\n }\n return out.join(\"\\n\");\n}\n\nexport function AwardNFG(n = 1): void {\n const nf = Player.augmentations.find((a) => a.name === AugmentationNames.NeuroFluxGovernor);\n if (nf) {\n nf.level += n;\n } else {\n const nf = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n nf.level = n;\n Player.augmentations.push(nf);\n }\n}\n\nexport interface IFileLine {\n file: string;\n line: number;\n content: string;\n}\n\nexport function v1APIBreak(): void {\n let txt = \"\";\n for (const server of GetAllServers()) {\n for (const change of detect) {\n const s: IFileLine[] = [];\n for (const script of server.scripts) {\n const lines = script.code.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].includes(change[0])) {\n s.push({\n file: script.filename,\n line: i + 1,\n content: \"\",\n });\n }\n }\n }\n\n if (s.length === 0) continue;\n\n txt += `// Detected change ${change[0]}, reason: ${change[1]}\\n`;\n for (const fl of s) {\n txt += `${fl.file}:${fl.line}\\n`;\n }\n }\n }\n if (txt !== \"\") {\n const home = Player.getHomeComputer();\n home.writeToTextFile(\"v1_DETECTED_CHANGES.txt\", txt);\n }\n\n for (const server of GetAllServers()) {\n const backups: Script[] = [];\n for (const script of server.scripts) {\n if (!hasChanges(script.code)) continue;\n const prefix = script.filename.includes(\"/\") ? \"/BACKUP_\" : \"BACKUP_\";\n backups.push(new Script(Player, prefix + script.filename, script.code, script.server));\n script.code = convert(script.code);\n }\n server.scripts = server.scripts.concat(backups);\n }\n}\n","// Function that returns the next Company Position in the \"ladder\"\n// i.e. the next position to get promoted to\nimport { CompanyPosition } from \"./CompanyPosition\";\nimport { CompanyPositions } from \"./CompanyPositions\";\n\nexport function getNextCompanyPositionHelper(currPos: CompanyPosition | null): CompanyPosition | null {\n if (currPos == null) {\n return null;\n }\n\n const nextPosName: string | null = currPos.nextPosition;\n if (nextPosName == null) {\n return null;\n }\n\n return CompanyPositions[nextPosName];\n}\n","import { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessBladeburner(this: IPlayer): boolean {\n if (this.bitNodeN === 8) {\n return false;\n }\n\n return this.bitNodeN === 6 || this.bitNodeN === 7 || this.sourceFileLvl(6) > 0 || this.sourceFileLvl(7) > 0;\n}\n\nexport function inBladeburner(this: IPlayer): boolean {\n if (this.bladeburner == null) {\n return false;\n }\n return this.bladeburner instanceof Bladeburner;\n}\n\nexport function startBladeburner(this: IPlayer): void {\n this.bladeburner = new Bladeburner(this);\n}\n","import { Corporation } from \"../../Corporation/Corporation\";\nimport {\n CorporationUnlockUpgradeIndex,\n CorporationUnlockUpgrades,\n} from \"../../Corporation/data/CorporationUnlockUpgrades\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessCorporation(this: IPlayer): boolean {\n return this.bitNodeN === 3 || this.sourceFileLvl(3) > 0;\n}\n\nexport function hasCorporation(this: IPlayer): boolean {\n if (this.corporation == null) {\n return false;\n }\n return this.corporation instanceof Corporation;\n}\n\nexport function startCorporation(this: IPlayer, corpName: string, additionalShares = 0): void {\n this.corporation = new Corporation({\n name: corpName,\n });\n\n if (this.sourceFileLvl(3) === 3) {\n const warehouseApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.WarehouseAPI].index;\n const OfficeApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.OfficeAPI].index;\n\n this.corporation.unlockUpgrades[warehouseApi] = 1;\n this.corporation.unlockUpgrades[OfficeApi] = 1;\n }\n\n this.corporation.totalShares += additionalShares;\n}\n","import { Work } from \"../../Work/Work\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function start(this: IPlayer, w: Work): void {\n if (this.currentWork !== null) {\n this.currentWork.finish(this, true);\n }\n this.currentWork = w;\n}\nexport function process(this: IPlayer, cycles = 1): void {\n if (this.currentWork === null) return;\n const finished = this.currentWork.process(this, cycles);\n if (finished) {\n this.finishWork(false);\n }\n}\nexport function finish(this: IPlayer, cancelled: boolean): void {\n if (this.currentWork === null) return;\n this.currentWork.finish(this, cancelled);\n this.currentWork = null;\n this.focus = false;\n}\n","/**\n * Game engine. Handles the main game loop.\n */\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { generateRandomContract } from \"./CodingContractGenerator\";\nimport { initCompanies } from \"./Company/Companies\";\nimport { Corporation } from \"./Corporation/Corporation\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { staneksGift } from \"./CotMG/Helper\";\nimport { processPassiveFactionRepGain, inviteToFaction } from \"./Faction/FactionHelpers\";\nimport { Router } from \"./ui/GameRoot\";\nimport { Page } from \"./ui/Router\";\nimport { SetupTextEditor } from \"./ScriptEditor/ui/ScriptEditorRoot\";\n\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"./PersonObjects/formulas/reputation\";\nimport { hasHacknetServers, processHacknetEarnings } from \"./Hacknet/HacknetHelpers\";\nimport { iTutorialStart } from \"./InteractiveTutorial\";\nimport { checkForMessagesToSend } from \"./Message/MessageHelpers\";\nimport { loadAllRunningScripts, updateOnlineScriptTimes } from \"./NetscriptWorker\";\nimport { Player } from \"./Player\";\nimport { saveObject, loadGame } from \"./SaveObject\";\nimport { initForeignServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { ThemeEvents } from \"./Themes/ui/Theme\";\nimport { initSymbolToStockMap, processStockPrices } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { Money } from \"./ui/React/Money\";\nimport { Hashes } from \"./ui/React/Hashes\";\nimport { Reputation } from \"./ui/React/Reputation\";\n\nimport { AlertEvents } from \"./ui/React/AlertManager\";\nimport { exceptionAlert } from \"./utils/helpers/exceptionAlert\";\n\nimport { startExploits } from \"./Exploits/loops\";\nimport { calculateAchievements } from \"./Achievements/Achievements\";\n\nimport React from \"react\";\nimport { setupUncaughtPromiseHandler } from \"./UncaughtPromiseHandler\";\nimport { Button, Typography } from \"@mui/material\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\n\nconst Engine: {\n _lastUpdate: number;\n updateGame: (numCycles?: number) => void;\n Counters: {\n [key: string]: number | undefined;\n autoSaveCounter: number;\n updateSkillLevelsCounter: number;\n updateDisplays: number;\n updateDisplaysLong: number;\n updateActiveScriptsDisplay: number;\n createProgramNotifications: number;\n augmentationsNotifications: number;\n checkFactionInvitations: number;\n passiveFactionGrowth: number;\n messages: number;\n mechanicProcess: number;\n contractGeneration: number;\n achievementsCounter: number;\n };\n decrementAllCounters: (numCycles?: number) => void;\n checkCounters: () => void;\n load: (saveString: string) => void;\n start: () => void;\n} = {\n // Time variables (milliseconds unix epoch time)\n _lastUpdate: new Date().getTime(),\n\n updateGame: function (numCycles = 1) {\n const time = numCycles * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Terminal.process(Router, Player, numCycles);\n\n Player.processWork(numCycles);\n\n // Update stock prices\n if (Player.hasWseAccount) {\n processStockPrices(numCycles);\n }\n\n // Gang, if applicable\n if (Player.inGang() && Player.gang !== null) {\n Player.gang.process(numCycles, Player);\n }\n\n // Staneks gift\n staneksGift.process(Player, numCycles);\n\n // Corporation\n if (Player.corporation instanceof Corporation) {\n // Stores cycles in a \"buffer\". Processed separately using Engine Counters\n Player.corporation.storeCycles(numCycles);\n }\n\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.storeCycles(numCycles);\n }\n\n // Sleeves\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].process(Player, numCycles);\n }\n\n // Counters\n Engine.decrementAllCounters(numCycles);\n Engine.checkCounters();\n\n // Update the running time of all active scripts\n updateOnlineScriptTimes(numCycles);\n\n // Hacknet Nodes\n processHacknetEarnings(Player, numCycles);\n },\n\n /**\n * Counters for the main event loop. Represent the number of game cycles that\n * are required for something to happen. These counters are in game cycles,\n * which is once every 200ms\n */\n Counters: {\n autoSaveCounter: 300,\n updateSkillLevelsCounter: 10,\n updateDisplays: 3,\n updateDisplaysLong: 15,\n updateActiveScriptsDisplay: 5,\n createProgramNotifications: 10,\n augmentationsNotifications: 10,\n checkFactionInvitations: 100,\n passiveFactionGrowth: 5,\n messages: 150,\n mechanicProcess: 5, // Processes certain mechanics (Corporation, Bladeburner)\n contractGeneration: 3000, // Generate Coding Contracts\n achievementsCounter: 60, // Check if we have new achievements\n },\n\n decrementAllCounters: function (numCycles = 1) {\n for (const counterName of Object.keys(Engine.Counters)) {\n const counter = Engine.Counters[counterName];\n if (counter === undefined) throw new Error(\"counter should not be undefined\");\n Engine.Counters[counterName] = counter - numCycles;\n }\n },\n\n /**\n * Checks if any counters are 0. If they are, executes whatever\n * is necessary and then resets the counter\n */\n checkCounters: function () {\n if (Engine.Counters.autoSaveCounter <= 0) {\n if (Settings.AutosaveInterval == null) {\n Settings.AutosaveInterval = 60;\n }\n if (Settings.AutosaveInterval === 0) {\n warnAutosaveDisabled();\n Engine.Counters.autoSaveCounter = 60 * 5; // Let's check back in a bit\n } else {\n Engine.Counters.autoSaveCounter = Settings.AutosaveInterval * 5;\n saveObject.saveGame(!Settings.SuppressSavedGameToast);\n }\n }\n\n if (Engine.Counters.checkFactionInvitations <= 0) {\n const invitedFactions = Player.checkForFactionInvitations();\n if (invitedFactions.length > 0) {\n const randFaction = invitedFactions[Math.floor(Math.random() * invitedFactions.length)];\n inviteToFaction(randFaction);\n }\n Engine.Counters.checkFactionInvitations = 100;\n }\n\n if (Engine.Counters.passiveFactionGrowth <= 0) {\n const adjustedCycles = Math.floor(5 - Engine.Counters.passiveFactionGrowth);\n processPassiveFactionRepGain(adjustedCycles);\n Engine.Counters.passiveFactionGrowth = 5;\n }\n\n if (Engine.Counters.messages <= 0) {\n checkForMessagesToSend();\n if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {\n Engine.Counters.messages = 4500; // 15 minutes for Red pill message\n } else {\n Engine.Counters.messages = 150;\n }\n }\n if (Player.corporation instanceof Corporation) {\n Player.corporation.process(Player);\n }\n if (Engine.Counters.mechanicProcess <= 0) {\n if (Player.bladeburner instanceof Bladeburner) {\n try {\n Player.bladeburner.process(Router, Player);\n } catch (e) {\n exceptionAlert(\"Exception caught in Bladeburner.process(): \" + e);\n }\n }\n Engine.Counters.mechanicProcess = 5;\n }\n\n if (Engine.Counters.contractGeneration <= 0) {\n // X% chance of a contract being generated\n if (Math.random() <= 0.25) {\n generateRandomContract();\n }\n Engine.Counters.contractGeneration = 3000;\n }\n\n if (Engine.Counters.achievementsCounter <= 0) {\n calculateAchievements();\n Engine.Counters.achievementsCounter = 300;\n }\n },\n\n load: function (saveString) {\n startExploits();\n setupUncaughtPromiseHandler();\n // Load game from save or create new game\n\n if (loadGame(saveString)) {\n ThemeEvents.emit();\n\n initBitNodeMultipliers(Player);\n initAugmentations(); // Also calls Player.reapplyAllAugmentations()\n Player.reapplyAllSourceFiles();\n if (Player.hasWseAccount) {\n initSymbolToStockMap();\n }\n\n // Apply penalty for entropy accumulation\n Player.applyEntropy(Player.entropy);\n\n // Calculate the number of cycles have elapsed while offline\n Engine._lastUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timeOffline = Engine._lastUpdate - lastUpdate;\n const numCyclesOffline = Math.floor(timeOffline / CONSTANTS._idleSpeed);\n\n // Generate coding contracts\n if (Player.sourceFiles.length > 0) {\n let numContracts = 0;\n if (numCyclesOffline < 3000 * 100) {\n // if we have less than 100 rolls, just roll them exactly.\n for (let i = 0; i < numCyclesOffline / 3000; i++) {\n if (Math.random() < 0.25) numContracts++;\n }\n } else {\n // just average it.\n numContracts = (numCyclesOffline / 3000) * 0.25;\n }\n for (let i = 0; i < numContracts; i++) {\n generateRandomContract();\n }\n }\n\n let offlineReputation = 0;\n const offlineHackingIncome = (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * 0.75;\n Player.gainMoney(offlineHackingIncome, \"hacking\");\n // Process offline progress\n\n loadAllRunningScripts(); // This also takes care of offline production for those scripts\n\n if (Player.currentWork !== null) {\n Player.focus = true;\n Player.processWork(numCyclesOffline);\n } else {\n for (let i = 0; i < Player.factions.length; i++) {\n const facName = Player.factions[i];\n if (!Factions.hasOwnProperty(facName)) continue;\n const faction = Factions[facName];\n if (!faction.isMember) continue;\n // No rep for special factions.\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No rep for gangs.\n if (Player.getGangName() === facName) continue;\n\n const hRep = getHackingWorkRepGain(Player, faction.favor);\n const sRep = getFactionSecurityWorkRepGain(Player, faction.favor);\n const fRep = getFactionFieldWorkRepGain(Player, faction.favor);\n // can be infinite, doesn't matter.\n const reputationRate = Math.max(hRep, sRep, fRep) / Player.factions.length;\n\n const rep = reputationRate * numCyclesOffline;\n faction.playerReputation += rep;\n offlineReputation += rep;\n }\n }\n\n // Hacknet Nodes offline progress\n const offlineProductionFromHacknetNodes = processHacknetEarnings(Player, numCyclesOffline);\n const hacknetProdInfo = hasHacknetServers(Player) ? (\n <>\n hashes\n \n ) : (\n \n );\n\n // Passive faction rep gain offline\n processPassiveFactionRepGain(numCyclesOffline);\n\n // Stock Market offline progress\n if (Player.hasWseAccount) {\n processStockPrices(numCyclesOffline);\n }\n\n // Gang progress for BitNode 2\n const gang = Player.gang;\n if (Player.inGang() && gang !== null) {\n gang.process(numCyclesOffline, Player);\n }\n\n // Corporation offline progress\n if (Player.corporation instanceof Corporation) {\n Player.corporation.storeCycles(numCyclesOffline);\n }\n\n // Bladeburner offline progress\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.storeCycles(numCyclesOffline);\n }\n\n staneksGift.process(Player, numCyclesOffline);\n\n // Sleeves offline progress\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].process(Player, numCyclesOffline);\n }\n\n // Update total playtime\n const time = numCyclesOffline * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Player.lastUpdate = Engine._lastUpdate;\n Engine.start(); // Run main game loop and Scripts loop\n const timeOfflineString = convertTimeMsToTimeElapsedString(time);\n setTimeout(\n () =>\n AlertEvents.emit(\n <>\n Offline for {timeOfflineString}. While you were offline:\n
    \n
  • \n \n Your scripts generated \n \n
  • \n
  • \n Your Hacknet Nodes generated {hacknetProdInfo}\n
  • \n
  • \n \n You gained reputation divided amongst your factions\n \n
  • \n
\n ,\n ),\n 250,\n );\n } else {\n // No save found, start new game\n initBitNodeMultipliers(Player);\n Engine.start(); // Run main game loop and Scripts loop\n Player.init();\n initForeignServers(Player.getHomeComputer());\n initCompanies();\n initFactions();\n initAugmentations();\n\n // Start interactive tutorial\n iTutorialStart();\n }\n SetupTextEditor();\n },\n\n start: function () {\n // Get time difference\n const _thisUpdate = new Date().getTime();\n let diff = _thisUpdate - Engine._lastUpdate;\n const offset = diff % CONSTANTS._idleSpeed;\n\n // Divide this by cycle time to determine how many cycles have elapsed since last update\n diff = Math.floor(diff / CONSTANTS._idleSpeed);\n\n if (diff > 0) {\n // Update the game engine by the calculated number of cycles\n Engine._lastUpdate = _thisUpdate - offset;\n Player.lastUpdate = _thisUpdate - offset;\n Engine.updateGame(diff);\n }\n window.requestAnimationFrame(Engine.start);\n },\n};\n\n/**\n * Shows a toast warning that lets the player know that auto-saves are disabled, with an button to re-enable them.\n */\nfunction warnAutosaveDisabled(): void {\n // If the player has suppressed those warnings let's just exit right away.\n if (Settings.SuppressAutosaveDisabledWarnings) return;\n\n // We don't want this warning to show up on certain pages.\n // When in recovery or importing we want to keep autosave disabled.\n const ignoredPages = [Page.Recovery, Page.ImportSave];\n if (ignoredPages.includes(Router.page())) return;\n\n const warningToast = (\n <>\n Auto-saves are disabled!\n {\n // We reset the value to a default\n Settings.AutosaveInterval = 60;\n }}\n >\n Enable\n \n \n );\n SnackbarEvents.emit(warningToast, ToastVariant.WARNING, 5000);\n}\n\nexport { Engine };\n","export { Theme as Default } from \"./default\";\nexport { Theme as DefaultLite } from \"./default-lite\";\nexport { Theme as Monokai } from \"./monokai-ish\";\nexport { Theme as Warmer } from \"./warmer\";\nexport { Theme as DarkPlus } from \"./dark-plus\";\nexport { Theme as MayukaiDark } from \"./mayukai-dark\";\nexport { Theme as Purple } from \"./purple\";\nexport { Theme as SmoothGreen } from \"./smooth-green\";\nexport { Theme as Dracula } from \"./dracula\";\nexport { Theme as DarkBlue } from \"./dark-blue\";\nexport { Theme as DiscordLike } from \"./discord-like\";\nexport { Theme as OneDark } from \"./one-dark\";\nexport { Theme as MutedGoldBlue } from \"./muted-gold-blue\";\nexport { Theme as Light } from \"./light\";\n","import React, { useState, useEffect } from \"react\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\n\nimport { Terminal } from \"../Terminal\";\nimport { load } from \"../db\";\nimport { Player } from \"../Player\";\nimport { Engine } from \"../engine\";\nimport { GameRoot } from \"./GameRoot\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { ActivateRecoveryMode } from \"./React/RecoveryRoot\";\nimport { hash } from \"../hash/hash\";\nimport { pushGameReady } from \"../Electron\";\n\nexport function LoadingScreen(): React.ReactElement {\n const [show, setShow] = useState(false);\n const [loaded, setLoaded] = useState(false);\n\n const version = `v${CONSTANTS.VersionString} (${hash()})`;\n if (process.env.NODE_ENV === \"development\") {\n document.title = `[dev] Bitburner ${version}`;\n } else {\n document.title = `Bitburner ${version}`;\n }\n\n useEffect(() => {\n const id = setTimeout(() => {\n if (!loaded) setShow(true);\n }, 2000);\n return () => clearTimeout(id);\n });\n\n useEffect(() => {\n async function doLoad(): Promise {\n await load()\n .then((saveString) => {\n try {\n Engine.load(saveString);\n } catch (err: unknown) {\n ActivateRecoveryMode();\n setLoaded(true);\n throw err;\n }\n\n pushGameReady();\n setLoaded(true);\n })\n .catch((reason) => {\n console.error(reason);\n Engine.load(\"\");\n setLoaded(true);\n });\n }\n doLoad();\n }, []);\n\n return loaded ? (\n \n ) : (\n \n \n \n \n \n Loading Bitburner {version}\n \n {show && (\n \n \n If the game fails to load, consider killing all scripts\n \n \n )}\n \n );\n}\n","/**\n * Augmentation-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { calculateEntropy } from \"../Grafting/EntropyAccumulation\";\n\nexport function hasAugmentation(this: IPlayer, aug: string | Augmentation, ignoreQueued = false): boolean {\n const augName: string = aug instanceof Augmentation ? aug.name : aug;\n\n for (const owned of this.augmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n\n if (!ignoreQueued) {\n for (const owned of this.queuedAugmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nexport function applyEntropy(this: IPlayer, stacks = 1): void {\n // Re-apply all multipliers\n this.reapplyAllAugmentations();\n this.reapplyAllSourceFiles();\n\n this.mults = calculateEntropy(this, stacks);\n}\n","/**\n * Checks that a variable is a valid number. A valid number\n * must be a \"number\" type and cannot be NaN\n */\nexport function isValidNumber(n: number): boolean {\n return typeof n === \"number\" && !isNaN(n);\n}\n","/**\n * Represents a Limit or Buy Order on the stock market. Does not represent\n * a Market Order since those are just executed immediately\n */\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Order {\n readonly pos: PositionTypes;\n readonly price: number;\n shares: number;\n readonly stockSymbol: string;\n readonly type: OrderTypes;\n\n constructor(\n stockSymbol = \"\",\n shares = 0,\n price = 0,\n typ: OrderTypes = OrderTypes.LimitBuy,\n pos: PositionTypes = PositionTypes.Long,\n ) {\n // Validate arguments\n let invalidArgs = false;\n if (typeof shares !== \"number\" || typeof price !== \"number\") {\n invalidArgs = true;\n }\n if (isNaN(shares) || isNaN(price)) {\n invalidArgs = true;\n }\n if (typeof stockSymbol !== \"string\") {\n invalidArgs = true;\n }\n if (invalidArgs) {\n throw new Error(`Invalid constructor paramters for Order`);\n }\n\n this.stockSymbol = stockSymbol;\n this.shares = shares;\n this.price = price;\n this.type = typ;\n this.pos = pos;\n }\n\n /**\n * Serialize the Order to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Order\", this);\n }\n\n /**\n * Initializes a Order from a JSON save state\n */\n static fromJSON(value: IReviverValue): Order {\n return Generic_fromJSON(Order, value.data);\n }\n}\n\nReviver.constructors.Order = Order;\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Fragment } from \"./Fragment\";\nimport { ActiveFragment } from \"./ActiveFragment\";\nimport { FragmentType } from \"./FragmentType\";\nimport { IStaneksGift } from \"./IStaneksGift\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { CalculateEffect } from \"./formulas/effect\";\nimport { StaneksGiftEvents } from \"./StaneksGiftEvents\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { CONSTANTS } from \"../Constants\";\nimport { StanekConstants } from \"./data/Constants\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../Player\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\n\nexport class StaneksGift implements IStaneksGift {\n storedCycles = 0;\n fragments: ActiveFragment[] = [];\n\n baseSize(): number {\n return StanekConstants.BaseSize + BitNodeMultipliers.StaneksGiftExtraSize + Player.sourceFileLvl(13);\n }\n\n width(): number {\n return Math.max(2, Math.min(Math.floor(this.baseSize() / 2 + 1), StanekConstants.MaxSize));\n }\n height(): number {\n return Math.max(3, Math.min(Math.floor(this.baseSize() / 2 + 0.6), StanekConstants.MaxSize));\n }\n\n charge(player: IPlayer, af: ActiveFragment, threads: number): void {\n if (threads > af.highestCharge) {\n af.numCharge = (af.highestCharge * af.numCharge) / threads + 1;\n af.highestCharge = threads;\n } else {\n af.numCharge += threads / af.highestCharge;\n }\n\n const cotmg = Factions[FactionNames.ChurchOfTheMachineGod];\n cotmg.playerReputation += (player.mults.faction_rep * (Math.pow(threads, 0.95) * (cotmg.favor + 100))) / 1000;\n }\n\n inBonus(): boolean {\n return (this.storedCycles * CONSTANTS._idleSpeed) / 1000 > 1;\n }\n\n process(p: IPlayer, numCycles = 1): void {\n if (!p.hasAugmentation(AugmentationNames.StaneksGift1)) return;\n this.storedCycles += numCycles;\n this.storedCycles -= 10;\n this.storedCycles = Math.max(0, this.storedCycles);\n this.updateMults(p);\n StaneksGiftEvents.emit();\n }\n\n effect(fragment: ActiveFragment): number {\n // Find all the neighbooring cells\n const cells = fragment.neighboors();\n // find the neighbooring active fragments.\n const maybeFragments = cells.map((n) => this.fragmentAt(n[0], n[1]));\n\n // Filter out undefined with typescript \"Type guard\". Whatever\n let neighboors = maybeFragments.filter((v: ActiveFragment | undefined): v is ActiveFragment => !!v);\n\n neighboors = neighboors.filter((fragment) => fragment.fragment().type === FragmentType.Booster);\n let boost = 1;\n\n neighboors = neighboors.filter((v, i, s) => s.indexOf(v) === i);\n for (const neighboor of neighboors) {\n boost *= neighboor.fragment().power;\n }\n return CalculateEffect(fragment.highestCharge, fragment.numCharge, fragment.fragment().power, boost);\n }\n\n canPlace(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (rootX < 0 || rootY < 0) return false;\n if (rootX + fragment.width(rotation) > this.width()) return false;\n if (rootY + fragment.height(rotation) > this.height()) return false;\n if (this.count(fragment) >= fragment.limit) return false;\n const newFrag = new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment });\n for (const aFrag of this.fragments) {\n if (aFrag.collide(newFrag)) return false;\n }\n return true;\n }\n\n place(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (!this.canPlace(rootX, rootY, rotation, fragment)) return false;\n this.fragments.push(new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment }));\n return true;\n }\n\n findFragment(rootX: number, rootY: number): ActiveFragment | undefined {\n return this.fragments.find((f) => f.x === rootX && f.y === rootY);\n }\n\n fragmentAt(worldX: number, worldY: number): ActiveFragment | undefined {\n for (const aFrag of this.fragments) {\n if (aFrag.fullAt(worldX, worldY)) {\n return aFrag;\n }\n }\n\n return undefined;\n }\n\n count(fragment: Fragment): number {\n let amt = 0;\n for (const aFrag of this.fragments) {\n if (aFrag.fragment().id === fragment.id) amt++;\n }\n return amt;\n }\n\n delete(rootX: number, rootY: number): boolean {\n for (let i = 0; i < this.fragments.length; i++) {\n if (this.fragments[i].x === rootX && this.fragments[i].y === rootY) {\n this.fragments.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n clear(): void {\n this.fragments = [];\n }\n\n clearCharge(): void {\n this.fragments.forEach((f) => {\n f.highestCharge = 0;\n f.numCharge = 0;\n });\n }\n\n updateMults(p: IPlayer): void {\n // applyEntropy also reapplies all augmentations and source files\n // This wraps up the reset nicely\n p.applyEntropy(p.entropy);\n\n for (const aFrag of this.fragments) {\n const fragment = aFrag.fragment();\n\n const power = this.effect(aFrag);\n switch (fragment.type) {\n case FragmentType.HackingChance:\n p.mults.hacking_chance *= power;\n break;\n case FragmentType.HackingSpeed:\n p.mults.hacking_speed *= power;\n break;\n case FragmentType.HackingMoney:\n p.mults.hacking_money *= power;\n break;\n case FragmentType.HackingGrow:\n p.mults.hacking_grow *= power;\n break;\n case FragmentType.Hacking:\n p.mults.hacking *= power;\n p.mults.hacking_exp *= power;\n break;\n case FragmentType.Strength:\n p.mults.strength *= power;\n p.mults.strength_exp *= power;\n break;\n case FragmentType.Defense:\n p.mults.defense *= power;\n p.mults.defense_exp *= power;\n break;\n case FragmentType.Dexterity:\n p.mults.dexterity *= power;\n p.mults.dexterity_exp *= power;\n break;\n case FragmentType.Agility:\n p.mults.agility *= power;\n p.mults.agility_exp *= power;\n break;\n case FragmentType.Charisma:\n p.mults.charisma *= power;\n p.mults.charisma_exp *= power;\n break;\n case FragmentType.HacknetMoney:\n p.mults.hacknet_node_money *= power;\n break;\n case FragmentType.HacknetCost:\n p.mults.hacknet_node_purchase_cost /= power;\n p.mults.hacknet_node_ram_cost /= power;\n p.mults.hacknet_node_core_cost /= power;\n p.mults.hacknet_node_level_cost /= power;\n break;\n case FragmentType.Rep:\n p.mults.company_rep *= power;\n p.mults.faction_rep *= power;\n break;\n case FragmentType.WorkMoney:\n p.mults.work_money *= power;\n break;\n case FragmentType.Crime:\n p.mults.crime_success *= power;\n p.mults.crime_money *= power;\n break;\n case FragmentType.Bladeburner:\n p.mults.bladeburner_max_stamina *= power;\n p.mults.bladeburner_stamina_gain *= power;\n p.mults.bladeburner_analysis *= power;\n p.mults.bladeburner_success_chance *= power;\n break;\n }\n }\n p.updateSkillLevels();\n }\n\n prestigeAugmentation(): void {\n this.clearCharge();\n }\n\n prestigeSourceFile(): void {\n this.clear();\n this.storedCycles = 0;\n }\n\n /**\n * Serialize Staneks Gift to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"StaneksGift\", this);\n }\n\n /**\n * Initializes Staneks Gift from a JSON save state\n */\n static fromJSON(value: IReviverValue): StaneksGift {\n return Generic_fromJSON(StaneksGift, value.data);\n }\n}\n\nReviver.constructors.StaneksGift = StaneksGift;\n","/**\n * Class representing a visitable location in the world\n */\nimport { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\nimport { LocationType } from \"./LocationTypeEnum\";\n\ninterface IInfiltrationMetadata {\n maxClearanceLevel: number;\n startingSecurityLevel: number;\n}\n\nexport interface IConstructorParams {\n city?: CityName | null;\n costMult?: number;\n expMult?: number;\n infiltrationData?: IInfiltrationMetadata;\n name?: LocationName;\n types?: LocationType[];\n techVendorMaxRam?: number;\n techVendorMinRam?: number;\n}\n\nexport class Location {\n /**\n * Name of city this location is in. If this property is null, it means this i\n * is a generic location that is available in all cities\n */\n city: CityName | null = null;\n\n /**\n * Cost multiplier that influences how expensive a gym/university is\n */\n costMult = 0;\n\n /**\n * Exp multiplier that influences how effective a gym/university is\n */\n expMult = 0;\n\n /**\n * Companies can be infiltrated. This contains the data required for that\n * infiltration event\n */\n infiltrationData?: IInfiltrationMetadata;\n\n /**\n * Identifier for location\n */\n name: LocationName = LocationName.Void;\n\n /**\n * List of what type(s) this location is. A location can be multiple types\n * (e.g. company and tech vendor)\n */\n types: LocationType[] = [];\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMaxRam = 0;\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMinRam = 0;\n\n constructor(p: IConstructorParams) {\n if (p.city) {\n this.city = p.city;\n }\n if (p.costMult) {\n this.costMult = p.costMult;\n }\n if (p.expMult) {\n this.expMult = p.expMult;\n }\n if (p.infiltrationData) {\n this.infiltrationData = p.infiltrationData;\n }\n if (p.name) {\n this.name = p.name;\n }\n if (p.types) {\n this.types = p.types;\n }\n if (p.techVendorMaxRam) {\n this.techVendorMaxRam = p.techVendorMaxRam;\n }\n if (p.techVendorMinRam) {\n this.techVendorMinRam = p.techVendorMinRam;\n }\n }\n}\n","import { Player } from \"../Player\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { isValidFilePath } from \"../Terminal/DirectoryHelpers\";\nimport { TextFile } from \"../TextFile\";\nimport {\n RFAMessage,\n FileData,\n FileContent,\n isFileServer,\n isFileLocation,\n FileLocation,\n isFileData,\n} from \"./MessageDefinitions\";\n\nimport libSource from \"!!raw-loader!../ScriptEditor/NetscriptDefinitions.d.ts\";\n\nfunction error(errorMsg: string, { id }: RFAMessage): RFAMessage {\n return new RFAMessage({ error: errorMsg, id: id });\n}\n\nexport const RFARequestHandler: Record void | RFAMessage> = {\n pushFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileData(msg.params)) return error(\"Misses parameters\", msg);\n\n const fileData: FileData = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (isScriptFilename(fileData.filename)) server.writeToScriptFile(Player, fileData.filename, fileData.content);\n // Assume it's a text file\n else server.writeToTextFile(fileData.filename, fileData.content);\n\n // If and only if the content is actually changed correctly, send back an OK.\n const savedCorrectly =\n server.getScript(fileData.filename)?.code === fileData.content ||\n server.textFiles.filter((t: TextFile) => t.filename == fileData.filename).at(0)?.text === fileData.content;\n\n if (!savedCorrectly) return error(\"File wasn't saved correctly\", msg);\n\n return new RFAMessage({ result: \"OK\", id: msg.id });\n },\n\n getFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (isScriptFilename(fileData.filename)) {\n const scriptContent = server.getScript(fileData.filename);\n if (!scriptContent) return error(\"File doesn't exist\", msg);\n return new RFAMessage({ result: scriptContent.code, id: msg.id });\n } else {\n // Assume it's a text file\n const file = server.textFiles.filter((t: TextFile) => t.filename == fileData.filename).at(0);\n if (!file) return error(\"File doesn't exist\", msg);\n return new RFAMessage({ result: file.text, id: msg.id });\n }\n },\n\n deleteFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileExists = (): boolean =>\n !!server.getScript(fileData.filename) || server.textFiles.some((t: TextFile) => t.filename === fileData.filename);\n\n if (!fileExists()) return error(\"File doesn't exist\", msg);\n server.removeFile(fileData.filename);\n if (fileExists()) return error(\"Failed to delete the file\", msg);\n\n return new RFAMessage({ result: \"OK\", id: msg.id });\n },\n\n getFileNames: function (msg: RFAMessage): RFAMessage {\n if (!isFileServer(msg.params)) return error(\"Message misses parameters\", msg);\n\n const server = GetServer(msg.params.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileNameList: string[] = [\n ...server.textFiles.map((txt): string => txt.filename),\n ...server.scripts.map((scr): string => scr.filename),\n ];\n\n return new RFAMessage({ result: fileNameList, id: msg.id });\n },\n\n getAllFiles: function (msg: RFAMessage): RFAMessage {\n if (!isFileServer(msg.params)) return error(\"Message misses parameters\", msg);\n\n const server = GetServer(msg.params.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileList: FileContent[] = [\n ...server.textFiles.map((txt): FileContent => {\n return { filename: txt.filename, content: txt.text };\n }),\n ...server.scripts.map((scr): FileContent => {\n return { filename: scr.filename, content: scr.code };\n }),\n ];\n\n return new RFAMessage({ result: fileList, id: msg.id });\n },\n\n calculateRam: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (!isScriptFilename(fileData.filename)) return error(\"Filename isn't a script filename\", msg);\n const script = server.getScript(fileData.filename);\n if (!script) return error(\"File doesn't exist\", msg);\n const ramUsage = script.ramUsage;\n\n return new RFAMessage({ result: ramUsage, id: msg.id });\n },\n\n getDefinitionFile: function (msg: RFAMessage): RFAMessage {\n return new RFAMessage({ result: libSource + \"\", id: msg.id });\n },\n};\n","import React from \"react\";\n\nimport { Typography, Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { StatsRow } from \"../../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../../ui/React/CharacterOverview\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { MoneyRate } from \"../../../ui/React/MoneyRate\";\nimport { ReputationRate } from \"../../../ui/React/ReputationRate\";\nimport { use } from \"../../../ui/Context\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\nimport { BitNodeMultipliers } from \"../../../BitNode/BitNodeMultipliers\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function StatsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n \n \n \n
\n
\n );\n}\n\nexport function EarningsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n const player = use.Player();\n\n let data: (string | JSX.Element)[][] = [];\n if (isSleeveCrimeWork(props.sleeve.currentWork)) {\n const gains = props.sleeve.currentWork.getExp();\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * gains.hackExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * gains.strExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * gains.defExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * gains.dexExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * gains.agiExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * gains.chaExp * BitNodeMultipliers.CrimeExpGain)}`],\n ];\n }\n if (isSleeveClassWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.calculateRates(player, props.sleeve);\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n ];\n }\n if (isSleeveFactionWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.getExpRates(props.sleeve);\n const repGain = props.sleeve.currentWork.getReputationRate(props.sleeve);\n data = [\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n [`Reputation:`, ],\n ];\n }\n\n if (isSleeveCompanyWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.getGainRates(player, props.sleeve);\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n [`Reputation:`, ],\n ];\n }\n\n return (\n \n \n \n \n Earnings {props.sleeve.storedCycles > 50 ? \"(overclock)\" : \"\"}\n \n \n {data.map(([a, b]) => (\n \n \n {a}\n \n \n {b}\n \n \n ))}\n \n
\n );\n}\n","/**\n * Creates a dropdown (select HTML element) with server hostnames as options\n *\n * Configurable to only contain certain types of servers\n */\nimport React from \"react\";\nimport { GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Button from \"@mui/material/Button\";\n\n// TODO make this an enum when this gets converted to TypeScript\nexport const ServerType = {\n All: 0,\n Foreign: 1, // Hackable, non-owned servers\n Owned: 2, // Home Computer, Purchased Servers, and Hacknet Servers\n Purchased: 3, // Everything from Owned except home computer\n};\n\ninterface IProps {\n purchase: () => void;\n canPurchase: boolean;\n serverType: number;\n onChange: (event: SelectChangeEvent) => void;\n value: string;\n}\n\nexport function ServerDropdown(props: IProps): React.ReactElement {\n /**\n * Checks if the server should be shown in the dropdown menu, based on the\n * 'serverType' property\n */\n function isValidServer(s: BaseServer): boolean {\n const purchased = s instanceof Server && s.purchasedByPlayer;\n const type = props.serverType;\n switch (type) {\n case ServerType.All:\n return true;\n case ServerType.Foreign:\n return s.hostname !== \"home\" && !purchased;\n case ServerType.Owned:\n return purchased || s instanceof HacknetServer || s.hostname === \"home\";\n case ServerType.Purchased:\n return purchased || s instanceof HacknetServer;\n default:\n console.warn(`Invalid ServerType specified for ServerDropdown component: ${type}`);\n return false;\n }\n }\n\n const servers = [];\n for (const server of GetAllServers().sort((a, b) => a.hostname.localeCompare(b.hostname))) {\n if (isValidServer(server)) {\n servers.push(\n \n {server.hostname}\n ,\n );\n }\n }\n\n return (\n \n Buy\n \n }\n sx={{ mx: 1 }}\n value={props.value}\n onChange={props.onChange}\n >\n {servers}\n \n );\n}\n","import * as React from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Money } from \"../ui/React/Money\";\nimport { Game, reachedLimit } from \"./Game\";\nimport { Deck } from \"./CardDeck/Deck\";\nimport { Hand } from \"./CardDeck/Hand\";\nimport { InputAdornment } from \"@mui/material\";\nimport { ReactCard } from \"./CardDeck/ReactCard\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\n\nconst MAX_BET = 100e6;\nexport const DECK_COUNT = 5; // 5-deck multideck\n\nenum Result {\n Pending = \"\",\n PlayerWon = \"You won!\",\n PlayerWonByBlackjack = \"You Won! Blackjack!\",\n DealerWon = \"You lost!\",\n Tie = \"Push! (Tie)\",\n}\n\ntype Props = {\n p: IPlayer;\n};\n\ntype State = {\n playerHand: Hand;\n dealerHand: Hand;\n bet: number;\n betInput: string;\n gameInProgress: boolean;\n result: Result;\n gains: number; // Track gains only for this session\n wagerInvalid: boolean;\n wagerInvalidHelperText: string;\n};\n\nexport class Blackjack extends Game {\n deck: Deck;\n\n constructor(props: Props) {\n super(props);\n\n this.deck = new Deck(DECK_COUNT);\n\n const initialBet = 1e6;\n\n this.state = {\n playerHand: new Hand([]),\n dealerHand: new Hand([]),\n bet: initialBet,\n betInput: String(initialBet),\n gameInProgress: false,\n result: Result.Pending,\n gains: 0,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n };\n }\n\n canStartGame = (): boolean => {\n const { p } = this.props;\n const { bet } = this.state;\n\n return p.canAfford(bet);\n };\n\n startGame = (): void => {\n if (!this.canStartGame() || reachedLimit(this.props.p)) {\n return;\n }\n\n // Take money from player right away so that player's dont just \"leave\" to avoid the loss (I mean they could\n // always reload without saving but w.e) TODO: Save/Restore the RNG state to limit the value of save-scumming.\n this.props.p.loseMoney(this.state.bet, \"casino\");\n\n const playerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n const dealerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n\n this.setState({\n playerHand,\n dealerHand,\n gameInProgress: true,\n result: Result.Pending,\n });\n\n // If the player is dealt a blackjack and the dealer is not, then the player\n // immediately wins\n if (this.getTrueHandValue(playerHand) === 21) {\n if (this.getTrueHandValue(dealerHand) === 21) {\n this.finishGame(Result.Tie);\n } else {\n this.finishGame(Result.PlayerWonByBlackjack);\n }\n } else if (this.getTrueHandValue(dealerHand) === 21) {\n // Check if dealer won by blackjack. We know at this point that the player does not also have blackjack.\n this.finishGame(Result.DealerWon);\n }\n };\n\n // Returns an array of numbers representing all possible values of the given Hand. The reason it needs to be\n // an array is because an Ace can count as both 1 and 11.\n getHandValue = (hand: Hand): number[] => {\n let result: number[] = [0];\n\n for (let i = 0; i < hand.cards.length; ++i) {\n const value = hand.cards[i].value;\n if (value >= 10) {\n result = result.map((x) => x + 10);\n } else if (value === 1) {\n result = result.flatMap((x) => [x + 1, x + 11]);\n } else {\n result = result.map((x) => x + value);\n }\n }\n\n return result;\n };\n\n // Returns the single hand value used for determine things like victory and whether or not\n // the dealer has to hit. Essentially this uses the biggest value that's 21 or under. If no such value exists,\n // then it means the hand is busted and we can just return whatever\n getTrueHandValue = (hand: Hand): number => {\n const handValues = this.getHandValue(hand);\n const valuesUnder21 = handValues.filter((x) => x <= 21);\n\n if (valuesUnder21.length > 0) {\n valuesUnder21.sort((a, b) => a - b);\n return valuesUnder21[valuesUnder21.length - 1];\n } else {\n // Just return the first value. It doesnt really matter anyways since hand is buted\n return handValues[0];\n }\n };\n\n // Returns all hand values that are 21 or under. If no values are 21 or under, then the first value is returned.\n getHandDisplayValues = (hand: Hand): number[] => {\n const handValues = this.getHandValue(hand);\n if (this.isHandBusted(hand)) {\n // Hand is busted so just return the 1st value, doesn't really matter\n return [...new Set([handValues[0]])];\n } else {\n return [...new Set(handValues.filter((x) => x <= 21))];\n }\n };\n\n isHandBusted = (hand: Hand): boolean => {\n return this.getTrueHandValue(hand) > 21;\n };\n\n playerHit = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n const newHand = this.state.playerHand.addCards(this.deck.safeDrawCard());\n\n this.setState({\n playerHand: newHand,\n });\n\n // Check if player busted, and finish the game if so\n if (this.isHandBusted(newHand)) {\n this.finishGame(Result.DealerWon);\n }\n };\n\n playerStay = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n // Determine if Dealer needs to hit. A dealer must hit if they have 16 or lower.\n // If the dealer has a Soft 17 (Ace + 6), then they stay.\n let newDealerHand = this.state.dealerHand;\n while (true) {\n // The dealer's \"true\" hand value is the 2nd one if its 21 or less (the 2nd value is always guaranteed\n // to be equal or larger). Otherwise its the 1st.\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n\n if (dealerHandValue <= 16) {\n newDealerHand = newDealerHand.addCards(this.deck.safeDrawCard());\n } else {\n break;\n }\n }\n\n this.setState({\n dealerHand: newDealerHand,\n });\n\n // If dealer has busted, then player wins\n if (this.isHandBusted(newDealerHand)) {\n this.finishGame(Result.PlayerWon);\n } else {\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n const playerHandValue = this.getTrueHandValue(this.state.playerHand);\n\n // We expect nobody to have busted. If someone busted, there is an error\n // in our game logic\n if (dealerHandValue > 21 || playerHandValue > 21) {\n throw new Error(\"Someone busted when not expected to\");\n }\n\n if (playerHandValue > dealerHandValue) {\n this.finishGame(Result.PlayerWon);\n } else if (playerHandValue < dealerHandValue) {\n this.finishGame(Result.DealerWon);\n } else {\n this.finishGame(Result.Tie);\n }\n }\n };\n\n finishGame = (result: Result): void => {\n const gains =\n result === Result.DealerWon\n ? 0 // We took away the bet at the start, don't need to take more\n : result === Result.Tie\n ? this.state.bet // We took away the bet at the start, give it back\n : result === Result.PlayerWon\n ? 2 * this.state.bet // Give back their bet plus their winnings\n : result === Result.PlayerWonByBlackjack\n ? 2.5 * this.state.bet // Blackjack pays out 1.5x bet!\n : (() => {\n throw new Error(`Unexpected result: ${result}`);\n })(); // This can't happen, right?\n this.win(this.props.p, gains);\n this.setState({\n gameInProgress: false,\n result,\n gains: this.state.gains + gains - this.state.bet, // Not updated upfront - only tracks the final outcome\n });\n };\n\n wagerOnChange = (event: React.ChangeEvent): void => {\n const { p } = this.props;\n const betInput = event.target.value;\n const wager = Math.round(parseFloat(betInput));\n if (isNaN(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not a valid number\",\n });\n } else if (wager <= 0) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Must bet a postive amount\",\n });\n } else if (wager > MAX_BET) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Exceeds max bet\",\n });\n } else if (!p.canAfford(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not enough money\",\n });\n } else {\n // Valid wager\n this.setState({\n bet: wager,\n betInput,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n result: Result.Pending, // Reset previous game status to clear the win/lose text UI\n });\n }\n };\n\n // Start game button\n startOnClick = (event: React.MouseEvent): void => {\n // Protect against scripting...although maybe this would be fun to automate\n if (!event.isTrusted) {\n return;\n }\n\n if (!this.state.wagerInvalid) {\n this.startGame();\n }\n };\n\n render(): React.ReactNode {\n const { betInput, playerHand, dealerHand, gameInProgress, result, wagerInvalid, wagerInvalidHelperText, gains } =\n this.state;\n\n // Get the player totals to display.\n const playerHandValues = this.getHandDisplayValues(playerHand);\n const dealerHandValues = this.getHandDisplayValues(dealerHand);\n\n return (\n <>\n {/* Wager input */}\n \n \n {\"Wager (Max: \"}\n \n {\")\"}\n \n }\n disabled={gameInProgress}\n onChange={this.wagerOnChange}\n error={wagerInvalid}\n helperText={wagerInvalid ? wagerInvalidHelperText : \"\"}\n type=\"number\"\n style={{\n width: \"200px\",\n }}\n InputProps={{\n startAdornment: (\n \n $\n \n ),\n }}\n />\n\n \n {\"Total earnings this session: \"}\n \n \n \n\n {/* Buttons */}\n {!gameInProgress ? (\n \n ) : (\n <>\n \n \n \n )}\n\n {/* Main game part. Displays both if the game is in progress OR if there's a result so you can see\n * the cards that led to that result. */}\n {(gameInProgress || result !== Result.Pending) && (\n <>\n \n \n Player\n {playerHand.cards.map((card, i) => (\n \n ))}\n\n \n Count:{\" \"}\n {playerHandValues\n .map((value, i) => {value})\n .reduce((prev, curr) => [prev, \" or \", curr])}\n \n \n \n\n
\n\n \n \n Dealer\n {dealerHand.cards.map((card, i) => (\n // Hide every card except the first while game is in progress\n \n \n \n )}\n\n {/* Results from previous round */}\n {result !== Result.Pending && (\n \n {result} \n {result === Result.PlayerWon && }\n {result === Result.PlayerWonByBlackjack && }\n {result === Result.DealerWon && }\n \n )}\n \n );\n }\n}\n","import React, { FC } from \"react\";\nimport { Card, Suit } from \"./Card\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Paper from \"@mui/material/Paper\";\n\ntype Props = {\n card: Card;\n hidden?: boolean;\n};\n\nconst useStyles = makeStyles(() =>\n createStyles({\n card: {\n padding: \"10px\",\n border: \"solid 1px #808080\",\n backgroundColor: \"white\",\n display: \"inline-block\",\n borderRadius: \"10px\",\n fontSize: \"18.5px\",\n textAlign: \"center\",\n margin: \"3px\",\n fontWeight: \"bold\",\n },\n red: {\n color: \"red\",\n },\n\n black: {\n color: \"black\",\n },\n value: {\n fontSize: \"20px\",\n fontFamily: \"sans-serif\",\n },\n }),\n);\n\nexport const ReactCard: FC = ({ card, hidden }) => {\n const classes = useStyles();\n let suit: React.ReactNode;\n switch (card.suit) {\n case Suit.Clubs:\n suit = ;\n break;\n case Suit.Diamonds:\n suit = ;\n break;\n case Suit.Hearts:\n suit = ;\n break;\n case Suit.Spades:\n suit = ;\n break;\n default:\n throw new Error(`MissingCaseException: ${card.suit}`);\n }\n return (\n \n <>\n {hidden ? \" - \" : card.formatValue()}\n {hidden ? \" - \" : suit}\n \n \n );\n};\n","import { Milestone } from \"./Milestone\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Server } from \"../Server/Server\";\n\nfunction allFactionAugs(p: IPlayer, f: Faction): boolean {\n const factionAugs = f.augmentations.slice().filter((aug) => aug !== \"NeuroFlux Governor\");\n for (const factionAug of factionAugs) {\n if (\n !p.augmentations.some((aug) => {\n return aug.name == factionAug;\n })\n )\n return false;\n }\n return true;\n}\n\nexport const Milestones: Milestone[] = [\n {\n title: \"Gain root access on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"hasAdminRights\")) return false;\n return server instanceof Server && server.hasAdminRights;\n },\n },\n {\n title: \"Install the backdoor on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"backdoorInstalled\")) return false;\n return server instanceof Server && server.backdoorInstalled;\n },\n },\n {\n title: \"Join the faction hinted at in csec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.CyberSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.CyberSec}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.CyberSec]);\n },\n },\n {\n title: \"Join the faction hinted at in nitesec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.NiteSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.NiteSec}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.NiteSec]);\n },\n },\n {\n title: \"Join the faction hinted at in j3.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.TheBlackHand);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.TheBlackHand}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.TheBlackHand]);\n },\n },\n {\n title: \"Join the faction hinted at in 19dfj3l1nd.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.BitRunners);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.BitRunners}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.BitRunners]);\n },\n },\n {\n title: \"Complete fl1ght.exe\",\n fulfilled: (p: IPlayer): boolean => {\n // technically wrong but whatever\n return p.factions.includes(FactionNames.Daedalus);\n },\n },\n {\n title: `Install the special Augmentation from ${FactionNames.Daedalus}`,\n fulfilled: (p: IPlayer): boolean => {\n return p.augmentations.some((aug) => aug.name == \"The Red Pill\");\n },\n },\n {\n title: \"Install the final backdoor and free yourself.\",\n fulfilled: (): boolean => {\n return false;\n },\n },\n];\n","import { StockSymbols } from \"./StockSymbols\";\n\nexport const TickerHeaderFormatData = {\n longestName: 0,\n longestSymbol: 0,\n};\n\nfor (const key of Object.keys(StockSymbols)) {\n TickerHeaderFormatData.longestName = Math.max(key.length, TickerHeaderFormatData.longestName);\n TickerHeaderFormatData.longestSymbol = Math.max(StockSymbols[key].length, TickerHeaderFormatData.longestSymbol);\n}\n","import React from \"react\";\n\nimport { Box, Typography } from \"@mui/material\";\n\nimport { Achievement } from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\";\nimport { AchievementIcon } from \"./AchievementIcon\";\n\ninterface IProps {\n achievement: Achievement;\n unlockedOn?: number;\n cssFiltersUnlocked: string;\n cssFiltersLocked: string;\n}\n\nexport function AchievementEntry({\n achievement,\n unlockedOn,\n cssFiltersUnlocked,\n cssFiltersLocked,\n}: IProps): JSX.Element {\n if (!achievement) return <>;\n const isUnlocked = !!unlockedOn;\n\n const mainColor = isUnlocked ? Settings.theme.primary : Settings.theme.secondarylight;\n\n let achievedOn = \"\";\n if (unlockedOn) {\n achievedOn = new Date(unlockedOn).toLocaleString();\n }\n\n return (\n \n \n \n \n \n {achievement.Name}\n \n \n {achievement.Description}\n \n {isUnlocked && (\n \n Acquired on {achievedOn}\n \n )}\n \n \n \n );\n}\n","// @ts-nocheck\n/* tslint:disable */\n/* eslint-disable */\n\n/*\n Taken from:\n https://codepen.io/sosuke/pen/Pjoqqp\n --------------------------------------------------------\n This utility transform an hex color into css filter rules.\n Useful to change color of a black image to match a given color\n*/\n\nclass Color {\n constructor(r, g, b) {\n this.set(r, g, b);\n }\n\n toString() {\n return `rgb(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(this.b)})`;\n }\n\n set(r, g, b) {\n this.r = this.clamp(r);\n this.g = this.clamp(g);\n this.b = this.clamp(b);\n }\n\n hueRotate(angle = 0) {\n angle = (angle / 180) * Math.PI;\n const sin = Math.sin(angle);\n const cos = Math.cos(angle);\n\n this.multiply([\n 0.213 + cos * 0.787 - sin * 0.213,\n 0.715 - cos * 0.715 - sin * 0.715,\n 0.072 - cos * 0.072 + sin * 0.928,\n 0.213 - cos * 0.213 + sin * 0.143,\n 0.715 + cos * 0.285 + sin * 0.14,\n 0.072 - cos * 0.072 - sin * 0.283,\n 0.213 - cos * 0.213 - sin * 0.787,\n 0.715 - cos * 0.715 + sin * 0.715,\n 0.072 + cos * 0.928 + sin * 0.072,\n ]);\n }\n\n grayscale(value = 1) {\n this.multiply([\n 0.2126 + 0.7874 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 + 0.2848 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 + 0.9278 * (1 - value),\n ]);\n }\n\n sepia(value = 1) {\n this.multiply([\n 0.393 + 0.607 * (1 - value),\n 0.769 - 0.769 * (1 - value),\n 0.189 - 0.189 * (1 - value),\n 0.349 - 0.349 * (1 - value),\n 0.686 + 0.314 * (1 - value),\n 0.168 - 0.168 * (1 - value),\n 0.272 - 0.272 * (1 - value),\n 0.534 - 0.534 * (1 - value),\n 0.131 + 0.869 * (1 - value),\n ]);\n }\n\n saturate(value = 1) {\n this.multiply([\n 0.213 + 0.787 * value,\n 0.715 - 0.715 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 + 0.285 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 - 0.715 * value,\n 0.072 + 0.928 * value,\n ]);\n }\n\n multiply(matrix) {\n const newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);\n const newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);\n const newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);\n this.r = newR;\n this.g = newG;\n this.b = newB;\n }\n\n brightness(value = 1) {\n this.linear(value);\n }\n contrast(value = 1) {\n this.linear(value, -(0.5 * value) + 0.5);\n }\n\n linear(slope = 1, intercept = 0) {\n this.r = this.clamp(this.r * slope + intercept * 255);\n this.g = this.clamp(this.g * slope + intercept * 255);\n this.b = this.clamp(this.b * slope + intercept * 255);\n }\n\n invert(value = 1) {\n this.r = this.clamp((value + (this.r / 255) * (1 - 2 * value)) * 255);\n this.g = this.clamp((value + (this.g / 255) * (1 - 2 * value)) * 255);\n this.b = this.clamp((value + (this.b / 255) * (1 - 2 * value)) * 255);\n }\n\n hsl() {\n // Code taken from https://stackoverflow.com/a/9493060/2688027, licensed under CC BY-SA.\n const r = this.r / 255;\n const g = this.g / 255;\n const b = this.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h,\n s,\n l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0;\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n\n case g:\n h = (b - r) / d + 2;\n break;\n\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: h * 100,\n s: s * 100,\n l: l * 100,\n };\n }\n\n clamp(value) {\n if (value > 255) {\n value = 255;\n } else if (value < 0) {\n value = 0;\n }\n return value;\n }\n}\n\nexport class Solver {\n constructor(target) {\n this.target = target;\n this.targetHSL = target.hsl();\n this.reusedColor = new Color(0, 0, 0);\n }\n\n solve() {\n const result = this.solveNarrow(this.solveWide());\n return {\n values: result.values,\n loss: result.loss,\n filter: this.css(result.values),\n };\n }\n\n solveWide() {\n const A = 5;\n const c = 15;\n const a = [60, 180, 18000, 600, 1.2, 1.2];\n\n let best = { loss: Infinity };\n for (let i = 0; best.loss > 25 && i < 3; i++) {\n const initial = [50, 20, 3750, 50, 100, 100];\n const result = this.spsa(A, a, c, initial, 1000);\n if (result.loss < best.loss) {\n best = result;\n }\n }\n return best;\n }\n\n solveNarrow(wide) {\n const A = wide.loss;\n const c = 2;\n const A1 = A + 1;\n const a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];\n return this.spsa(A, a, c, wide.values, 500);\n }\n\n spsa(A, a, c, values, iters) {\n const alpha = 1;\n const gamma = 0.16666666666666666;\n\n let best = null;\n let bestLoss = Infinity;\n const deltas = new Array(6);\n const highArgs = new Array(6);\n const lowArgs = new Array(6);\n\n for (let k = 0; k < iters; k++) {\n const ck = c / Math.pow(k + 1, gamma);\n for (let i = 0; i < 6; i++) {\n deltas[i] = Math.random() > 0.5 ? 1 : -1;\n highArgs[i] = values[i] + ck * deltas[i];\n lowArgs[i] = values[i] - ck * deltas[i];\n }\n\n const lossDiff = this.loss(highArgs) - this.loss(lowArgs);\n for (let i = 0; i < 6; i++) {\n const g = (lossDiff / (2 * ck)) * deltas[i];\n const ak = a[i] / Math.pow(A + k + 1, alpha);\n values[i] = fix(values[i] - ak * g, i);\n }\n\n const loss = this.loss(values);\n if (loss < bestLoss) {\n best = values.slice(0);\n bestLoss = loss;\n }\n }\n return { values: best, loss: bestLoss };\n\n function fix(value, idx) {\n let max = 100;\n if (idx === 2 /* saturate */) {\n max = 7500;\n } else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {\n max = 200;\n }\n\n if (idx === 3 /* hue-rotate */) {\n if (value > max) {\n value %= max;\n } else if (value < 0) {\n value = max + (value % max);\n }\n } else if (value < 0) {\n value = 0;\n } else if (value > max) {\n value = max;\n }\n return value;\n }\n }\n\n loss(filters) {\n // Argument is array of percentages.\n const color = this.reusedColor;\n color.set(0, 0, 0);\n\n color.invert(filters[0] / 100);\n color.sepia(filters[1] / 100);\n color.saturate(filters[2] / 100);\n color.hueRotate(filters[3] * 3.6);\n color.brightness(filters[4] / 100);\n color.contrast(filters[5] / 100);\n\n const colorHSL = color.hsl();\n return (\n Math.abs(color.r - this.target.r) +\n Math.abs(color.g - this.target.g) +\n Math.abs(color.b - this.target.b) +\n Math.abs(colorHSL.h - this.targetHSL.h) +\n Math.abs(colorHSL.s - this.targetHSL.s) +\n Math.abs(colorHSL.l - this.targetHSL.l)\n );\n }\n\n css(filters) {\n function fmt(idx, multiplier = 1) {\n return Math.round(filters[idx] * multiplier);\n }\n return `invert(${fmt(0)}%) sepia(${fmt(1)}%) saturate(${fmt(2)}%) hue-rotate(${fmt(3, 3.6)}deg) brightness(${fmt(\n 4,\n )}%) contrast(${fmt(5)}%)`;\n }\n}\n\nfunction hexToRgb(hex): number[] {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => {\n return r + r + g + g + b + b;\n });\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null;\n}\n\nexport function getFiltersFromHex(hex): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return \"\";\n\n const [r, g, b] = rgb;\n const color = new Color(r, g, b);\n const solver = new Solver(color);\n return solver.solve().filter;\n}\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Default\",\n description: \"Default game theme, most supported\",\n credit: \"hydroflame\",\n screenshot: img1,\n colors: {\n primarylight: \"#0f0\",\n primary: \"#0c0\",\n primarydark: \"#090\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Default-lite\",\n description: \"Less eye-straining default theme\",\n credit: \"NmuGmu\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/925263801564151888\",\n screenshot: img1,\n colors: {\n primarylight: \"#28CF28\",\n primary: \"#21A821\",\n primarydark: \"#177317\",\n successlight: \"#1CFF1C\",\n success: \"#16CA16\",\n successdark: \"#0D910D\",\n errorlight: \"#FF3B3B\",\n error: \"#C32D2D\",\n errordark: \"#8E2121\",\n secondarylight: \"#B3B3B3\",\n secondary: \"#838383\",\n secondarydark: \"#676767\",\n warninglight: \"#FFFF3A\",\n warning: \"#C3C32A\",\n warningdark: \"#8C8C1E\",\n infolight: \"#64CBFF\",\n info: \"#3399CC\",\n infodark: \"#246D91\",\n welllight: \"#404040\",\n well: \"#1C1C1C\",\n white: \"#C3C3C3\",\n black: \"#0A0B0B\",\n hp: \"#C62E2E\",\n money: \"#D6BB27\",\n hack: \"#ADFF2F\",\n combat: \"#E8EDCD\",\n cha: \"#8B5FAF\",\n int: \"#537CC8\",\n rep: \"#E8EDCD\",\n disabled: \"#5AB5A5\",\n backgroundprimary: \"#0C0D0E\",\n backgroundsecondary: \"#121415\",\n button: \"#252829\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Monokai'ish\",\n description: \"Monokai'ish\",\n credit: \"eltea\",\n screenshot: img1,\n colors: {\n primarylight: \"#FFF\",\n primary: \"#F8F8F2\",\n primarydark: \"#FAFAEB\",\n successlight: \"#ADE146\",\n success: \"#A6E22E\",\n successdark: \"#98E104\",\n errorlight: \"#FF69A0\",\n error: \"#F92672\",\n errordark: \"#D10F56\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E1D992\",\n warning: \"#E6DB74\",\n warningdark: \"#EDDD54\",\n infolight: \"#92E1F1\",\n info: \"#66D9EF\",\n infodark: \"#31CDED\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#F92672\",\n money: \"#E6DB74\",\n hack: \"#A6E22E\",\n combat: \"#75715E\",\n cha: \"#AE81FF\",\n int: \"#66D9EF\",\n rep: \"#E69F66\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#272822\",\n backgroundsecondary: \"#1B1C18\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Warmer\",\n credit: \"hexnaught\",\n description: \"Warmer, softer theme\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999581020028938\",\n screenshot: img1,\n colors: {\n primarylight: \"#EA9062\",\n primary: \"#DD7B4A\",\n primarydark: \"#D3591C\",\n successlight: \"#6ACF6A\",\n success: \"#43BF43\",\n successdark: \"#3E913E\",\n errorlight: \"#C15757\",\n error: \"#B34141\",\n errordark: \"#752525\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E6E69D\",\n warning: \"#DADA56\",\n warningdark: \"#A1A106\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#AD84CF\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#76C6B7\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark+\",\n credit: \"LoganMD\",\n description: \"VSCode Dark+\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999975867617310\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#CCCCAE\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#00D200\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#C80000\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#969090\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#C8C800\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Mayukai Dark\",\n description: \"Mayukai Dark-esque\",\n credit: \"Festive Noire\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922037502334889994\",\n screenshot: img1,\n colors: {\n primarylight: \"#DDDFC5\",\n primary: \"#CDCFB6\",\n primarydark: \"#9D9F8C\",\n successlight: \"#00EF00\",\n success: \"#00A500\",\n successdark: \"#007A00\",\n errorlight: \"#F92672\",\n error: \"#CA1C5C\",\n errordark: \"#90274A\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#D3D300\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#00010A\",\n white: \"#fff\",\n black: \"#020509\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#8CCF27\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#080C11\",\n backgroundsecondary: \"#03080F\",\n button: \"#00010A\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Purple\",\n credit: \"zer0ney\",\n description: \"Essentially all defaults except for purple replacing the main colors\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922091815849570395\",\n screenshot: img1,\n colors: {\n primarylight: \"#BA55D3\",\n primary: \"#9370DB\",\n primarydark: \"#8A2BE2\",\n successlight: \"#BA55D3\",\n success: \"#9370DB\",\n successdark: \"#8A2BE2\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Smooth Green\",\n description: \"A nice green theme that doesn't hurt your eyes.\",\n credit: \"Swidt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922243957986033725\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#B0D9A3\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#6BC16B\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#3D713D\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#8FAF85\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#38F100\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#2F3C2B\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#4AA52E\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#35A135\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#2F3C2B\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dracula\",\n description: \"Dracula Look-alike\",\n credit: \"H3draut3r\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922296307836678144\",\n screenshot: img1,\n colors: {\n primarylight: \"#7082B8\",\n primary: \"#F8F8F2\",\n primarydark: \"#FF79C6\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#FD4545\",\n error: \"#FF2D2D\",\n errordark: \"#C62424\",\n secondarylight: \"#AAA\",\n secondary: \"#8BE9FD\",\n secondarydark: \"#666\",\n warninglight: \"#FFC281\",\n warning: \"#FFB86C\",\n warningdark: \"#E6A055\",\n infolight: \"#A0A0FF\",\n info: \"#7070FF\",\n infodark: \"#4040FF\",\n welllight: \"#44475A\",\n well: \"#363948\",\n white: \"#fff\",\n black: \"#282A36\",\n hp: \"#D34448\",\n money: \"#50FA7B\",\n hack: \"#F1FA8C\",\n combat: \"#BD93F9\",\n cha: \"#FF79C6\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#282A36\",\n backgroundsecondary: \"#21222C\",\n button: \"#21222C\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark Blue\",\n description: \"Very dark with a blue/purplelly primary\",\n credit: \"Saynt_Garmo\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/923084732718264340\",\n screenshot: img1,\n colors: {\n primarylight: \"#023DDE\",\n primary: \"#4A41C8\",\n primarydark: \"#005299\",\n successlight: \"#00FF00\",\n success: \"#D1DAD1\",\n successdark: \"#BFCABF\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#040505\",\n white: \"#fff\",\n black: \"#000000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#091419\",\n backgroundsecondary: \"#000000\",\n button: \"#000000\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Discord-like\",\n description: \"Discord inspired theme\",\n credit: \"Thermite\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924305252017143818\",\n screenshot: img1,\n colors: {\n primarylight: \"#7389DC\",\n primary: \"#7389DC\",\n primarydark: \"#5964F1\",\n successlight: \"#00CC00\",\n success: \"#20DF20\",\n successdark: \"#0CB80C\",\n errorlight: \"#EA5558\",\n error: \"#EC4145\",\n errordark: \"#E82528\",\n secondarylight: \"#C3C3C3\",\n secondary: \"#9C9C9C\",\n secondarydark: \"#4E4E4E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#1C4FB3\",\n welllight: \"#999999\",\n well: \"#35383C\",\n white: \"#FFFFFF\",\n black: \"#202225\",\n hp: \"#FF5656\",\n money: \"#43FF43\",\n hack: \"#FFAB3D\",\n combat: \"#8A90FD\",\n cha: \"#FF51D9\",\n int: \"#6495ed\",\n rep: \"#FFFF30\",\n disabled: \"#474B51\",\n backgroundprimary: \"#2F3136\",\n backgroundsecondary: \"#35393E\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"One Dark\",\n description: \"Dark with a greenish tint\",\n credit: \"Dexalt142\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924650660694208512\",\n screenshot: img1,\n colors: {\n primarylight: \"#98C379\",\n primary: \"#98C379\",\n primarydark: \"#98C379\",\n successlight: \"#98C379\",\n success: \"#98C379\",\n successdark: \"#98C379\",\n errorlight: \"#E06C75\",\n error: \"#BE5046\",\n errordark: \"#BE5046\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E5C07B\",\n warning: \"#E5C07B\",\n warningdark: \"#D19A66\",\n infolight: \"#61AFEF\",\n info: \"#61AFEF\",\n infodark: \"#61AFEF\",\n welllight: \"#4B5263\",\n well: \"#282C34\",\n white: \"#ABB2BF\",\n black: \"#282C34\",\n hp: \"#E06C75\",\n money: \"#E5C07B\",\n hack: \"#98C379\",\n combat: \"#ABB2BF\",\n cha: \"#C678DD\",\n int: \"#61AFEF\",\n rep: \"#ABB2BF\",\n disabled: \"#56B6C2\",\n backgroundprimary: \"#282C34\",\n backgroundsecondary: \"#21252B\",\n button: \"#4B5263\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Muted Gold & Blue\",\n description: \"Muted gold with blue accents.\",\n credit: \"Sloth\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924672660758208563\",\n screenshot: img1,\n colors: {\n primarylight: \"#E3B54A\",\n primary: \"#CAA243\",\n primarydark: \"#7E6937\",\n successlight: \"#82FF82\",\n success: \"#6FDA6F\",\n successdark: \"#64C364\",\n errorlight: \"#FD5555\",\n error: \"#D84A4A\",\n errordark: \"#AC3939\",\n secondarylight: \"#D8D0B8\",\n secondary: \"#B1AA95\",\n secondarydark: \"#736E5E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#111111\",\n white: \"#fff\",\n black: \"#070300\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#0A0A0E\",\n backgroundsecondary: \"#0E0E10\",\n button: \"#222222\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Light\",\n description: \"Cobbled Together Light Theme\",\n credit: \"matt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/926114005456658432\",\n screenshot: img1,\n colors: {\n primarylight: \"#535353\",\n primary: \"#1A1A1A\",\n primarydark: \"#0d0d0d\",\n successlight: \"#63c439\",\n success: \"#428226\",\n successdark: \"#2E5A1B\",\n errorlight: \"#df7051\",\n error: \"#C94824\",\n errordark: \"#91341B\",\n secondarylight: \"#b3b3b3\",\n secondary: \"#9B9B9B\",\n secondarydark: \"#7A7979\",\n warninglight: \"#e8d464\",\n warning: \"#C6AD20\",\n warningdark: \"#9F8A16\",\n infolight: \"#6299cf\",\n info: \"#3778B7\",\n infodark: \"#30689C\",\n welllight: \"#f9f9f9\",\n well: \"#eaeaea\",\n white: \"#F7F7F7\",\n black: \"#F7F7F7\",\n hp: \"#BF5C41\",\n money: \"#E1B121\",\n hack: \"#47BC38\",\n combat: \"#656262\",\n cha: \"#A568AC\",\n int: \"#889BCF\",\n rep: \"#656262\",\n disabled: \"#70B4BF\",\n backgroundprimary: \"#F7F7F7\",\n backgroundsecondary: \"#f9f9f9\",\n button: \"#eaeaea\",\n },\n};\n","export default \"dist/images/83b2443ab7e7d346766c8f6bc5afc7a7.png\";","export default \"dist/images/6caf35202b10b52e1fc2743f674c33e8.png\";","export default \"dist/images/cb88977ea837bccb9cceb727adc78302.png\";","export default \"dist/images/4e0e750f2f09de58219773edd46cbbf5.png\";","export default \"dist/images/e97de4daa946331c7e99dee9c05d629c.png\";","export default \"dist/images/9f96a5084f4e5f1a6c0041b41b34d62d.png\";","export default \"dist/images/85a7b2896acb62be76f3ea7100fe9012.png\";","export default \"dist/images/5aa87b7de67a77c914088783b055e1cf.png\";","export default \"dist/images/c7164b072d62c91c27c6d607b5207e7b.png\";","export default \"dist/images/66f4b86d86164fc117bd6d648e4eaa6f.png\";","export default \"dist/images/a1110d6c8d16a14c4570411750248399.png\";","export default \"dist/images/447bc31e61f55e7eff875be3e9a81f1a.png\";","export default \"dist/images/297df8c0e47764ea113951318b2acf55.png\";","export default \"dist/images/e66b0c327f97d08e4253f52234d659eb.png\";","import { ITerminal, Output, Link, RawOutput, TTimer } from \"./ITerminal\";\nimport { IRouter } from \"../ui/Router\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { Programs } from \"../Programs/Programs\";\nimport { CodingContractResult } from \"../CodingContracts\";\nimport { TerminalEvents, TerminalClearEvents } from \"./TerminalEvents\";\n\nimport { TextFile } from \"../TextFile\";\nimport { Script } from \"../Script/Script\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\n\nimport { removeLeadingSlash, isInRootDirectory, evaluateFilePath } from \"./DirectoryHelpers\";\nimport { checkIfConnectedToDarkweb } from \"../DarkWeb/DarkWeb\";\nimport { iTutorialNextStep, iTutorialSteps, ITutorial } from \"../InteractiveTutorial\";\nimport { getServerOnNetwork, processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { createProgressBarText } from \"../utils/helpers/createProgressBarText\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\n\nimport { alias } from \"./commands/alias\";\nimport { analyze } from \"./commands/analyze\";\nimport { backdoor } from \"./commands/backdoor\";\nimport { buy } from \"./commands/buy\";\nimport { cat } from \"./commands/cat\";\nimport { cd } from \"./commands/cd\";\nimport { check } from \"./commands/check\";\nimport { connect } from \"./commands/connect\";\nimport { cp } from \"./commands/cp\";\nimport { download } from \"./commands/download\";\nimport { expr } from \"./commands/expr\";\nimport { free } from \"./commands/free\";\nimport { grow } from \"./commands/grow\";\nimport { hack } from \"./commands/hack\";\nimport { help } from \"./commands/help\";\nimport { history } from \"./commands/history\";\nimport { home } from \"./commands/home\";\nimport { hostname } from \"./commands/hostname\";\nimport { kill } from \"./commands/kill\";\nimport { killall } from \"./commands/killall\";\nimport { ls } from \"./commands/ls\";\nimport { lscpu } from \"./commands/lscpu\";\nimport { mem } from \"./commands/mem\";\nimport { mv } from \"./commands/mv\";\nimport { nano } from \"./commands/nano\";\nimport { ps } from \"./commands/ps\";\nimport { rm } from \"./commands/rm\";\nimport { run } from \"./commands/run\";\nimport { scan } from \"./commands/scan\";\nimport { scananalyze } from \"./commands/scananalyze\";\nimport { scp } from \"./commands/scp\";\nimport { sudov } from \"./commands/sudov\";\nimport { tail } from \"./commands/tail\";\nimport { top } from \"./commands/top\";\nimport { unalias } from \"./commands/unalias\";\nimport { vim } from \"./commands/vim\";\nimport { weaken } from \"./commands/weaken\";\nimport { wget } from \"./commands/wget\";\nimport { hash } from \"../hash/hash\";\nimport { apr1 } from \"./commands/apr1\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nexport class Terminal implements ITerminal {\n // Flags to determine whether the player is currently running a hack or an analyze\n action: TTimer | null = null;\n\n commandHistory: string[] = [];\n commandHistoryIndex = 0;\n\n outputHistory: (Output | Link | RawOutput)[] = [\n new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\"),\n ];\n\n // True if a Coding Contract prompt is opened\n contractOpen = false;\n\n // Full Path of current directory\n // Excludes the trailing forward slash\n currDir = \"/\";\n\n process(router: IRouter, player: IPlayer, cycles: number): void {\n if (this.action === null) return;\n this.action.timeLeft -= (CONSTANTS._idleSpeed * cycles) / 1000;\n if (this.action.timeLeft < 0.01) this.finishAction(router, player, false);\n TerminalEvents.emit();\n }\n\n append(item: Output | Link | RawOutput): void {\n this.outputHistory.push(item);\n if (this.outputHistory.length > Settings.MaxTerminalCapacity) {\n this.outputHistory.splice(0, this.outputHistory.length - Settings.MaxTerminalCapacity);\n }\n TerminalEvents.emit();\n }\n\n print(s: string): void {\n this.append(new Output(s, \"primary\"));\n }\n\n printRaw(node: React.ReactNode): void {\n this.append(new RawOutput(node));\n }\n\n error(s: string): void {\n this.append(new Output(s, \"error\"));\n }\n\n success(s: string): void {\n this.append(new Output(s, \"success\"));\n }\n\n info(s: string): void {\n this.append(new Output(s, \"info\"));\n }\n\n warn(s: string): void {\n this.append(new Output(s, \"warn\"));\n }\n\n startHack(player: IPlayer): void {\n // Hacking through Terminal should be faster than hacking through a script\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, player) / 4, \"h\", server);\n }\n\n startGrow(player: IPlayer): void {\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateGrowTime(server, player) / 16, \"g\", server);\n }\n startWeaken(player: IPlayer): void {\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateWeakenTime(server, player) / 16, \"w\", server);\n }\n\n startBackdoor(player: IPlayer): void {\n // Backdoor should take the same amount of time as hack\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot backdoor this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, player) / 4, \"b\", server);\n }\n\n startAnalyze(player: IPlayer): void {\n this.print(\"Analyzing system...\");\n const server = player.getCurrentServer();\n this.startAction(1, \"a\", server);\n }\n\n startAction(n: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\", server?: BaseServer): void {\n this.action = new TTimer(n, action, server);\n }\n\n // Complete the hack/analyze command\n finishHack(router: IRouter, player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n\n // Calculate whether hack was successful\n const hackChance = calculateHackingChance(server, player);\n const rand = Math.random();\n const expGainedOnSuccess = calculateHackingExpGain(server, player);\n const expGainedOnFailure = expGainedOnSuccess / 4;\n if (rand < hackChance) {\n // Success!\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n router.toBitVerse(false, false);\n return;\n }\n let moneyGained = calculatePercentMoneyHacked(server, player) * BitNodeMultipliers.ManualHackMoney;\n moneyGained = Math.floor(server.moneyAvailable * moneyGained);\n\n if (moneyGained <= 0) {\n moneyGained = 0;\n } // Safety check\n\n server.moneyAvailable -= moneyGained;\n player.gainMoney(moneyGained, \"hacking\");\n player.gainHackingExp(expGainedOnSuccess);\n player.gainIntelligenceExp(expGainedOnSuccess / CONSTANTS.IntelligenceTerminalHackBaseExpGain);\n\n const oldSec = server.hackDifficulty;\n server.fortify(CONSTANTS.ServerFortifyAmount);\n const newSec = server.hackDifficulty;\n\n this.print(\n `Hack successful on '${server.hostname}'! Gained ${numeralWrapper.formatMoney(\n moneyGained,\n )} and ${numeralWrapper.formatExp(expGainedOnSuccess)} hacking exp`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n } else {\n // Failure\n player.gainHackingExp(expGainedOnFailure);\n this.print(\n `Failed to hack '${server.hostname}'. Gained ${numeralWrapper.formatExp(expGainedOnFailure)} hacking exp`,\n );\n }\n }\n\n finishGrow(player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, player);\n const oldSec = server.hackDifficulty;\n const growth = processSingleServerGrowth(server, 25, player, server.cpuCores) - 1;\n const newSec = server.hackDifficulty;\n\n player.gainHackingExp(expGain);\n this.print(\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n growth,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n }\n\n finishWeaken(player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, player);\n const oldSec = server.hackDifficulty;\n server.weaken(CONSTANTS.ServerWeakenAmount);\n const newSec = server.hackDifficulty;\n\n player.gainHackingExp(expGain);\n this.print(\n `Security decreased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)} (min: ${numeralWrapper.formatSecurity(server.minDifficulty)})` +\n ` and Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n }\n\n finishBackdoor(router: IRouter, player: IPlayer, server: BaseServer, cancelled = false): void {\n if (!cancelled) {\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n if (player.bitNodeN == null) {\n player.bitNodeN = 1;\n }\n router.toBitVerse(false, false);\n return;\n }\n this.print(`Backdoor on '${server.hostname}' successful!`);\n }\n }\n\n finishAnalyze(player: IPlayer, currServ: BaseServer, cancelled = false): void {\n if (!cancelled) {\n const isHacknet = currServ instanceof HacknetServer;\n this.print(currServ.hostname + \": \");\n const org = currServ.organizationName;\n this.print(\"Organization name: \" + (!isHacknet ? org : \"player\"));\n const hasAdminRights = (!isHacknet && currServ.hasAdminRights) || isHacknet;\n this.print(\"Root Access: \" + (hasAdminRights ? \"YES\" : \"NO\"));\n const canRunScripts = hasAdminRights && currServ.maxRam > 0;\n this.print(\"Can run scripts on this host: \" + (canRunScripts ? \"YES\" : \"NO\"));\n this.print(\"RAM: \" + numeralWrapper.formatRAM(currServ.maxRam));\n if (currServ instanceof Server) {\n this.print(\"Backdoor: \" + (currServ.backdoorInstalled ? \"YES\" : \"NO\"));\n const hackingSkill = currServ.requiredHackingSkill;\n this.print(\"Required hacking skill for hack() and backdoor: \" + (!isHacknet ? hackingSkill : \"N/A\"));\n const security = currServ.hackDifficulty;\n this.print(\"Server security level: \" + (!isHacknet ? numeralWrapper.formatServerSecurity(security) : \"N/A\"));\n const hackingChance = calculateHackingChance(currServ, player);\n this.print(\"Chance to hack: \" + (!isHacknet ? numeralWrapper.formatPercentage(hackingChance) : \"N/A\"));\n const hackingTime = calculateHackingTime(currServ, player) * 1000;\n this.print(\"Time to hack: \" + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : \"N/A\"));\n }\n this.print(\n `Total money available on server: ${\n currServ instanceof Server ? numeralWrapper.formatMoney(currServ.moneyAvailable) : \"N/A\"\n }`,\n );\n if (currServ instanceof Server) {\n const numPort = currServ.numOpenPortsRequired;\n this.print(\"Required number of open ports for NUKE: \" + (!isHacknet ? numPort : \"N/A\"));\n this.print(\"SSH port: \" + (currServ.sshPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"FTP port: \" + (currServ.ftpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SMTP port: \" + (currServ.smtpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"HTTP port: \" + (currServ.httpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SQL port: \" + (currServ.sqlPortOpen ? \"Open\" : \"Closed\"));\n }\n }\n }\n\n finishAction(router: IRouter, player: IPlayer, cancelled = false): void {\n if (this.action === null) {\n if (!cancelled) throw new Error(\"Finish action called when there was no action\");\n return;\n }\n\n if (!this.action.server) throw new Error(\"Missing action target server\");\n\n this.print(this.getProgressText());\n if (this.action.action === \"h\") {\n this.finishHack(router, player, this.action.server, cancelled);\n } else if (this.action.action === \"g\") {\n this.finishGrow(player, this.action.server, cancelled);\n } else if (this.action.action === \"w\") {\n this.finishWeaken(player, this.action.server, cancelled);\n } else if (this.action.action === \"b\") {\n this.finishBackdoor(router, player, this.action.server, cancelled);\n } else if (this.action.action === \"a\") {\n this.finishAnalyze(player, this.action.server, cancelled);\n }\n\n if (cancelled) {\n this.print(\"Cancelled\");\n }\n this.action = null;\n TerminalEvents.emit();\n }\n\n getFile(player: IPlayer, filename: string): Script | TextFile | string | null {\n if (isScriptFilename(filename)) {\n return this.getScript(player, filename);\n }\n\n if (filename.endsWith(\".lit\")) {\n return this.getLitFile(player, filename);\n }\n\n if (filename.endsWith(\".txt\")) {\n return this.getTextFile(player, filename);\n }\n\n return null;\n }\n\n getFilepath(filename: string): string {\n const path = evaluateFilePath(filename, this.cwd());\n if (path == null) {\n throw new Error(`Invalid file path specified: ${filename}`);\n }\n\n if (isInRootDirectory(path)) {\n return removeLeadingSlash(path);\n }\n\n return path;\n }\n\n getScript(player: IPlayer, filename: string): Script | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const script of s.scripts) {\n if (filepath === script.filename) {\n return script;\n }\n }\n\n return null;\n }\n\n getTextFile(player: IPlayer, filename: string): TextFile | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const txt of s.textFiles) {\n if (filepath === txt.fn) {\n return txt;\n }\n }\n\n return null;\n }\n\n getLitFile(player: IPlayer, filename: string): string | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const lit of s.messages) {\n if (typeof lit === \"string\" && filepath === lit) {\n return lit;\n }\n }\n\n return null;\n }\n\n cwd(): string {\n return this.currDir;\n }\n\n setcwd(dir: string): void {\n this.currDir = dir;\n TerminalEvents.emit();\n }\n\n async runContract(player: IPlayer, contractName: string): Promise {\n // There's already an opened contract\n if (this.contractOpen) {\n return this.error(\"There's already a Coding Contract in Progress\");\n }\n\n const serv = player.getCurrentServer();\n const contract = serv.getContract(contractName);\n if (contract == null) {\n return this.error(\"No such contract\");\n }\n\n this.contractOpen = true;\n const res = await contract.prompt();\n\n //Check if the contract still exists by the time the promise is fullfilled\n if (serv.getContract(contractName) == null) {\n this.contractOpen = false;\n return this.error(\"Contract no longer exists (Was it solved by a script?)\");\n }\n\n switch (res) {\n case CodingContractResult.Success:\n if (contract.reward !== null) {\n const reward = player.gainCodingContractReward(contract.reward, contract.getDifficulty());\n this.print(`Contract SUCCESS - ${reward}`);\n }\n serv.removeContract(contract);\n break;\n case CodingContractResult.Failure:\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n this.error(\"Contract FAILED - Contract is now self-destructing\");\n serv.removeContract(contract);\n } else {\n this.error(`Contract FAILED - ${contract.getMaxNumTries() - contract.tries} tries remaining`);\n }\n break;\n case CodingContractResult.Cancelled:\n default:\n this.print(\"Contract cancelled\");\n break;\n }\n this.contractOpen = false;\n }\n\n executeScanAnalyzeCommand(player: IPlayer, depth = 1, all = false): void {\n // TODO Using array as stack for now, can make more efficient\n this.print(\"~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~\");\n this.print(\" \");\n\n // Map of all servers to keep track of which have been visited\n const visited: {\n [key: string]: number | undefined;\n } = {};\n for (const server of GetAllServers()) {\n visited[server.hostname] = 0;\n }\n\n const stack: BaseServer[] = [];\n const depthQueue: number[] = [0];\n const currServ = player.getCurrentServer();\n stack.push(currServ);\n while (stack.length != 0) {\n const s = stack.pop();\n if (!s) continue;\n const d = depthQueue.pop();\n if (d === undefined) continue;\n const isHacknet = s instanceof HacknetServer;\n if (!all && s.purchasedByPlayer && s.hostname != \"home\") {\n continue; // Purchased server\n } else if (visited[s.hostname] || d > depth) {\n continue; // Already visited or out-of-depth\n } else if (!all && isHacknet) {\n continue; // Hacknet Server\n } else {\n visited[s.hostname] = 1;\n }\n for (let i = s.serversOnNetwork.length - 1; i >= 0; --i) {\n const newS = getServerOnNetwork(s, i);\n if (newS === null) continue;\n stack.push(newS);\n depthQueue.push(d + 1);\n }\n if (d == 0) {\n continue;\n } // Don't print current server\n const titleDashes = Array((d - 1) * 4 + 1).join(\"-\");\n if (player.hasProgram(Programs.AutoLink.name)) {\n this.append(new Link(titleDashes, s.hostname));\n } else {\n this.print(titleDashes + s.hostname);\n }\n\n const dashes = titleDashes + \"--\";\n let c = \"NO\";\n if (s.hasAdminRights) {\n c = \"YES\";\n }\n if (s instanceof Server) {\n this.print(\n `${dashes}Root Access: ${c}${!isHacknet ? \", Required hacking skill: \" + s.requiredHackingSkill : \"\"}`,\n );\n\n if (s.hasOwnProperty(\"numOpenPortsRequired\")) {\n this.print(dashes + \"Number of open ports required to NUKE: \" + s.numOpenPortsRequired);\n }\n }\n this.print(dashes + \"RAM: \" + numeralWrapper.formatRAM(s.maxRam));\n this.print(\" \");\n }\n }\n\n connectToServer(player: IPlayer, server: string): void {\n const serv = GetServer(server);\n if (serv == null) {\n this.error(\"Invalid server. Connection failed.\");\n return;\n }\n player.getCurrentServer().isConnectedTo = false;\n player.currentServer = serv.hostname;\n player.getCurrentServer().isConnectedTo = true;\n this.print(\"Connected to \" + serv.hostname);\n this.setcwd(\"/\");\n if (player.getCurrentServer().hostname == \"darkweb\") {\n checkIfConnectedToDarkweb(); // Posts a 'help' message if connecting to dark web\n }\n }\n\n executeCommands(router: IRouter, player: IPlayer, commands: string): void {\n // Sanitize input\n commands = commands.trim();\n commands = commands.replace(/\\s\\s+/g, \" \"); // Replace all extra whitespace in command with a single space\n\n // Handle Terminal History - multiple commands should be saved as one\n if (this.commandHistory[this.commandHistory.length - 1] != commands) {\n this.commandHistory.push(commands);\n if (this.commandHistory.length > 50) {\n this.commandHistory.splice(0, 1);\n }\n player.terminalCommandHistory = this.commandHistory;\n }\n this.commandHistoryIndex = this.commandHistory.length;\n const allCommands = ParseCommands(commands);\n\n for (let i = 0; i < allCommands.length; i++) {\n this.executeCommand(router, player, allCommands[i]);\n }\n }\n\n clear(): void {\n this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\")];\n TerminalEvents.emit();\n TerminalClearEvents.emit();\n }\n\n prestige(): void {\n this.action = null;\n this.clear();\n }\n\n executeCommand(router: IRouter, player: IPlayer, command: string): void {\n if (this.action !== null) {\n this.error(`Cannot execute command (${command}) while an action is in progress`);\n return;\n }\n // Allow usage of ./\n if (command.startsWith(\"./\")) {\n command = \"run \" + command.slice(2);\n }\n // Only split the first space\n const commandArray = ParseCommand(command);\n if (commandArray.length == 0) {\n return;\n }\n const s = player.getCurrentServer();\n /****************** Interactive Tutorial Terminal Commands ******************/\n if (ITutorial.isRunning) {\n const n00dlesServ = GetServer(\"n00dles\");\n if (n00dlesServ == null) {\n throw new Error(\"Could not get n00dles server\");\n }\n switch (ITutorial.currStep) {\n case iTutorialSteps.TerminalHelp:\n if (commandArray.length === 1 && commandArray[0] == \"help\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalLs:\n if (commandArray.length === 1 && commandArray[0] == \"ls\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScan:\n if (commandArray.length === 1 && commandArray[0] == \"scan\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze1:\n if (commandArray.length == 1 && commandArray[0] == \"scan-analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze2:\n if (commandArray.length == 2 && commandArray[0] == \"scan-analyze\" && commandArray[1] === 2) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalConnect:\n if (commandArray.length == 2) {\n if (\n commandArray[0] == \"connect\" &&\n (commandArray[1] == \"n00dles\" || commandArray[1] == n00dlesServ.hostname)\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Wrong command! Try again!\");\n return;\n }\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalAnalyze:\n if (commandArray.length === 1 && commandArray[0] === \"analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalNuke:\n if (commandArray.length == 2 && commandArray[0] == \"run\" && commandArray[1] == \"NUKE.exe\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalManualHack:\n if (commandArray.length == 1 && commandArray[0] == \"hack\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalHackingMechanics:\n if (commandArray.length !== 1 || ![\"grow\", \"weaken\", \"hack\"].includes(commandArray[0] + \"\")) {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalGoHome:\n if (commandArray.length == 1 && commandArray[0] == \"home\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalCreateScript:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"nano\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalFree:\n if (commandArray.length == 1 && commandArray[0] == \"free\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalRunScript:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"run\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.ActiveScriptsToTerminal:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"tail\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n default:\n this.error(\"Please follow the tutorial, or click 'EXIT' if you'd like to skip it\");\n return;\n }\n }\n /****************** END INTERACTIVE TUTORIAL ******************/\n /* Command parser */\n const commandName = commandArray[0];\n if (typeof commandName === \"number\" || typeof commandName === \"boolean\") {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n const commands: {\n [key: string]: (\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n ) => void;\n } = {\n \"scan-analyze\": scananalyze,\n alias: alias,\n analyze: analyze,\n backdoor: backdoor,\n buy: buy,\n cat: cat,\n cd: cd,\n check: check,\n clear: () => this.clear(),\n cls: () => this.clear(),\n connect: connect,\n cp: cp,\n download: download,\n expr: expr,\n free: free,\n grow: grow,\n hack: hack,\n help: help,\n history: history,\n home: home,\n hostname: hostname,\n kill: kill,\n killall: killall,\n ls: ls,\n lscpu: lscpu,\n mem: mem,\n mv: mv,\n nano: nano,\n ps: ps,\n rm: rm,\n run: run,\n scan: scan,\n scp: scp,\n sudov: sudov,\n tail: tail,\n apr1: apr1,\n top: top,\n unalias: unalias,\n vim: vim,\n weaken: weaken,\n wget: wget,\n };\n\n const f = commands[commandName.toLowerCase()];\n if (!f) {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n f(this, router, player, s, commandArray.slice(1));\n }\n\n getProgressText(): string {\n if (this.action === null) throw new Error(\"trying to get the progress text when there's no action\");\n return createProgressBarText({\n progress: (this.action.time - this.action.timeLeft) / this.action.time,\n totalTicks: 50,\n });\n }\n}\n","import { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { MinHeap } from \"../utils/Heap\";\n\nimport { comprGenChar, comprLZGenerate, comprLZEncode, comprLZDecode } from \"../utils/CompressionContracts\";\nimport { HammingEncode, HammingDecode, HammingEncodeProperly } from \"../utils/HammingCodeTools\";\n/* tslint:disable:completed-docs no-magic-numbers arrow-return-shorthand */\n\n/* Function that generates a valid 'data' for a contract type */\nexport type GeneratorFunc = () => unknown;\n\n/* Function that checks if the provided solution is the correct one */\nexport type SolverFunc = (data: unknown, answer: string) => boolean;\n\n/* Function that returns a string with the problem's description.\n Requires the 'data' of a Contract as input */\nexport type DescriptionFunc = (data: unknown) => string;\n\ninterface ICodingContractTypeMetadata {\n desc: DescriptionFunc;\n difficulty: number;\n gen: GeneratorFunc;\n name: string;\n numTries: number;\n solver: SolverFunc;\n}\n\n/* Helper functions for Coding Contract implementations */\nfunction removeBracketsFromArrayString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith(\"[\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith(\"]\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction removeQuotesFromString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith('\"') || strCpy.startsWith(\"'\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith('\"') || strCpy.endsWith(\"'\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction convert2DArrayToString(arr: unknown[][]): string {\n const components: string[] = [];\n arr.forEach((e: unknown) => {\n let s = String(e);\n s = [\"[\", s, \"]\"].join(\"\");\n components.push(s);\n });\n\n return components.join(\",\").replace(/\\s/g, \"\");\n}\n\nexport const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [\n {\n desc: (n: unknown): string => {\n return [\"A prime factor is a factor that is a prime number.\", `What is the largest prime factor of ${n}?`].join(\n \" \",\n );\n },\n difficulty: 1,\n gen: (): number => {\n return getRandomInt(500, 1e9);\n },\n name: \"Find Largest Prime Factor\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n let fac = 2;\n let n: number = data;\n while (n > (fac - 1) * (fac - 1)) {\n while (n % fac === 0) {\n n = Math.round(n / fac);\n }\n ++fac;\n }\n\n return (n === 1 ? fac - 1 : n) === parseInt(ans, 10);\n },\n },\n {\n desc: (_n: unknown): string => {\n const n = _n as number[];\n return [\n \"Given the following integer array, find the contiguous subarray\",\n \"(containing at least one number) which has the largest sum and return that sum.\",\n \"'Sum' refers to the sum of all the numbers in the subarray.\\n\",\n `${n.toString()}`,\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(5, 40);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(-10, 10);\n }\n\n return arr;\n },\n name: \"Subarray with Maximum Sum\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const nums: number[] = data.slice();\n for (let i = 1; i < nums.length; i++) {\n nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]);\n }\n\n return parseInt(ans, 10) === Math.max(...nums);\n },\n },\n {\n desc: (n: unknown): string => {\n if (typeof n !== \"number\") throw new Error(\"solver expected number\");\n return [\n \"It is possible write four as a sum in exactly four different ways:\\n\\n\",\n \"    3 + 1\\n\",\n \"    2 + 2\\n\",\n \"    2 + 1 + 1\\n\",\n \"    1 + 1 + 1 + 1\\n\\n\",\n `How many different distinct ways can the number ${n} be written as a sum of at least`,\n \"two positive integers?\",\n ].join(\" \");\n },\n difficulty: 1.5,\n gen: (): number => {\n return getRandomInt(8, 100);\n },\n name: \"Total Ways to Sum\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n const ways: number[] = [1];\n ways.length = data + 1;\n ways.fill(0, 1);\n for (let i = 1; i < data; ++i) {\n for (let j: number = i; j <= data; ++j) {\n ways[j] += ways[j - i];\n }\n }\n\n return ways[data] === parseInt(ans, 10);\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [number, number[]];\n const n: number = data[0];\n const s: number[] = data[1];\n return [\n `How many different distinct ways can the number ${n} be written`,\n \"as a sum of integers contained in the set:\\n\\n\",\n `[${s}]?\\n\\n`,\n \"You may use each integer in the set zero or more times.\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): [number, number[]] => {\n const n: number = getRandomInt(12, 200);\n const maxLen: number = getRandomInt(8, 12);\n const s: number[] = [];\n // Bias towards small numbers is intentional to have much bigger answers in general\n // to force people better optimize their solutions\n for (let i = 1; i <= n; i++) {\n if (s.length == maxLen) {\n break;\n }\n if (Math.random() < 0.6 || n - i < maxLen - s.length) {\n s.push(i);\n }\n }\n return [n, s];\n },\n name: \"Total Ways to Sum II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, number[]];\n // https://www.geeksforgeeks.org/coin-change-dp-7/?ref=lbp\n const n = data[0];\n const s = data[1];\n const ways: number[] = [1];\n ways.length = n + 1;\n ways.fill(0, 1);\n for (let i = 0; i < s.length; i++) {\n for (let j = s[i]; j <= n; j++) {\n ways[j] += ways[j - s[i]];\n }\n }\n return ways[n] === parseInt(ans, 10);\n },\n },\n {\n desc: (_n: unknown): string => {\n const n = _n as number[][];\n let d: string = [\n \"Given the following array of arrays of numbers representing a 2D matrix,\",\n \"return the elements of the matrix as an array in spiral order:\\n\\n\",\n ].join(\" \");\n // for (const line of n) {\n // d += `${line.toString()},\\n`;\n // }\n d += \"    [\\n\";\n d += n\n .map(\n (line: number[]) =>\n \"        [\" +\n line.map((x: number) => `${x}`.padStart(2, \" \")).join(\",\") +\n \"]\",\n )\n .join(\"\\n\");\n d += \"\\n    ]\\n\";\n d += [\n \"\\nHere is an example of what spiral order should be:\\n\\n\",\n \"    [\\n\",\n \"        [1, 2, 3]\\n\",\n \"        [4, 5, 6]\\n\",\n \"        [7, 8, 9]\\n\",\n \"    ]\\n\\n\",\n \"Answer: [1, 2, 3, 6, 9, 8 ,7, 4, 5]\\n\\n\",\n \"Note that the matrix will not always be square:\\n\\n\",\n \"    [\\n\",\n \"        [1,  2,  3,  4]\\n\",\n \"        [5,  6,  7,  8]\\n\",\n \"        [9, 10, 11, 12]\\n\",\n \"    ]\\n\\n\",\n \"Answer: [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]\",\n ].join(\" \");\n\n return d;\n },\n difficulty: 2,\n gen: (): number[][] => {\n const m: number = getRandomInt(1, 15);\n const n: number = getRandomInt(1, 15);\n const matrix: number[][] = [];\n matrix.length = m;\n for (let i = 0; i < m; ++i) {\n matrix[i] = [];\n matrix[i].length = n;\n }\n\n for (let i = 0; i < m; ++i) {\n for (let j = 0; j < n; ++j) {\n matrix[i][j] = getRandomInt(1, 50);\n }\n }\n\n return matrix;\n },\n name: \"Spiralize Matrix\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const spiral: number[] = [];\n const m: number = data.length;\n const n: number = data[0].length;\n let u = 0;\n let d: number = m - 1;\n let l = 0;\n let r: number = n - 1;\n let k = 0;\n while (true) {\n // Up\n for (let col: number = l; col <= r; col++) {\n spiral[k] = data[u][col];\n ++k;\n }\n if (++u > d) {\n break;\n }\n\n // Right\n for (let row: number = u; row <= d; row++) {\n spiral[k] = data[row][r];\n ++k;\n }\n if (--r < l) {\n break;\n }\n\n // Down\n for (let col: number = r; col >= l; col--) {\n spiral[k] = data[d][col];\n ++k;\n }\n if (--d < u) {\n break;\n }\n\n // Left\n for (let row: number = d; row >= u; row--) {\n spiral[k] = data[row][l];\n ++k;\n }\n if (++l > r) {\n break;\n }\n }\n\n const sanitizedPlayerAns = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const playerAns = sanitizedPlayerAns.split(\",\").map((s) => parseInt(s));\n if (spiral.length !== playerAns.length) {\n return false;\n }\n for (let i = 0; i < spiral.length; ++i) {\n if (spiral[i] !== playerAns[i]) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[];\n return [\n \"You are given the following array of integers:\\n\\n\",\n `${arr}\\n\\n`,\n \"Each element in the array represents your MAXIMUM jump length\",\n \"at that position. This means that if you are at position i and your\",\n \"maximum jump length is n, you can jump to any position from\",\n \"i to i+n.\",\n \"\\n\\nAssuming you are initially positioned\",\n \"at the start of the array, determine whether you are\",\n \"able to reach the last index.\\n\\n\",\n \"Your answer should be submitted as 1 or 0, representing true and false respectively\",\n ].join(\" \");\n },\n difficulty: 2.5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; ++i) {\n if (Math.random() < 0.2) {\n arr[i] = 0; // 20% chance of being 0\n } else {\n arr[i] = getRandomInt(0, 10);\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game\",\n numTries: 1,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data.length;\n let i = 0;\n for (let reach = 0; i < n && i <= reach; ++i) {\n reach = Math.max(i + data[i], reach);\n }\n const solution: boolean = i === n;\n return (ans === \"1\" && solution) || (ans === \"0\" && !solution);\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[];\n return [\n \"You are given the following array of integers:\\n\\n\",\n `${arr}\\n\\n`,\n \"Each element in the array represents your MAXIMUM jump length\",\n \"at that position. This means that if you are at position i and your\",\n \"maximum jump length is n, you can jump to any position from\",\n \"i to i+n.\",\n \"\\n\\nAssuming you are initially positioned\",\n \"at the start of the array, determine the minimum number of\",\n \"jumps to reach the end of the array.\\n\\n\",\n \"If it's impossible to reach the end, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < 10; j++) {\n if (Math.random() <= j / 10 + 0.1) {\n arr[i] = j;\n break;\n }\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game II\",\n numTries: 3,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data.length;\n let reach = 0;\n let jumps = 0;\n let lastJump = -1;\n while (reach < n - 1) {\n let jumpedFrom = -1;\n for (let i = reach; i > lastJump; i--) {\n if (i + data[i] > reach) {\n reach = i + data[i];\n jumpedFrom = i;\n }\n }\n if (jumpedFrom === -1) {\n jumps = 0;\n break;\n }\n lastJump = jumpedFrom;\n jumps++;\n }\n return jumps === parseInt(ans, 10);\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[][];\n return [\n \"Given the following array of arrays of numbers representing a list of\",\n \"intervals, merge all overlapping intervals.\\n\\n\",\n `[${convert2DArrayToString(arr)}]\\n\\n`,\n \"Example:\\n\\n\",\n \"[[1, 3], [8, 10], [2, 6], [10, 16]]\\n\\n\",\n \"would merge into [[1, 6], [8, 16]].\\n\\n\",\n \"The intervals must be returned in ASCENDING order.\",\n \"You can assume that in an interval, the first number will always be\",\n \"smaller than the second.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[][] => {\n const intervals: number[][] = [];\n const numIntervals: number = getRandomInt(3, 20);\n for (let i = 0; i < numIntervals; ++i) {\n const start: number = getRandomInt(1, 25);\n const end: number = start + getRandomInt(1, 10);\n intervals.push([start, end]);\n }\n\n return intervals;\n },\n name: \"Merge Overlapping Intervals\",\n numTries: 15,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const intervals: number[][] = data.slice();\n intervals.sort((a: number[], b: number[]) => {\n return a[0] - b[0];\n });\n\n const result: number[][] = [];\n let start: number = intervals[0][0];\n let end: number = intervals[0][1];\n for (const interval of intervals) {\n if (interval[0] <= end) {\n end = Math.max(end, interval[1]);\n } else {\n result.push([start, end]);\n start = interval[0];\n end = interval[1];\n }\n }\n result.push([start, end]);\n\n const sanitizedResult: string = convert2DArrayToString(result);\n const sanitizedAns: string = ans.replace(/\\s/g, \"\");\n\n return sanitizedResult === sanitizedAns || sanitizedResult === removeBracketsFromArrayString(sanitizedAns);\n },\n },\n {\n desc: (data: unknown): string => {\n return [\n \"Given the following string containing only digits, return\",\n \"an array with all possible valid IP address combinations\",\n \"that can be created from the string:\\n\\n\",\n `${data}\\n\\n`,\n \"Note that an octet cannot begin with a '0' unless the number\",\n \"itself is actually 0. For example, '192.168.010.1' is not a valid IP.\\n\\n\",\n \"Examples:\\n\\n\",\n \"25525511135 -> [255.255.11.135, 255.255.111.35]\\n\",\n \"1938718066 -> [193.87.180.66]\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): string => {\n let str = \"\";\n for (let i = 0; i < 4; ++i) {\n const num: number = getRandomInt(0, 255);\n const convNum: string = num.toString();\n str += convNum;\n }\n\n return str;\n },\n name: \"Generate IP Addresses\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n const ret: string[] = [];\n for (let a = 1; a <= 3; ++a) {\n for (let b = 1; b <= 3; ++b) {\n for (let c = 1; c <= 3; ++c) {\n for (let d = 1; d <= 3; ++d) {\n if (a + b + c + d === data.length) {\n const A = parseInt(data.substring(0, a), 10);\n const B = parseInt(data.substring(a, a + b), 10);\n const C = parseInt(data.substring(a + b, a + b + c), 10);\n const D = parseInt(data.substring(a + b + c, a + b + c + d), 10);\n if (A <= 255 && B <= 255 && C <= 255 && D <= 255) {\n const ip: string = [A.toString(), \".\", B.toString(), \".\", C.toString(), \".\", D.toString()].join(\"\");\n if (ip.length === data.length + 3) {\n ret.push(ip);\n }\n }\n }\n }\n }\n }\n }\n\n const sanitizedAns: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const ansArr: string[] = sanitizedAns.split(\",\");\n if (ansArr.length !== ret.length) {\n return false;\n }\n for (const ipInAns of ansArr) {\n if (!ret.includes(ipInAns)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"one transaction (i.e. you can only buy and sell the stock once). If no profit can be made\",\n \"then the answer should be 0. Note\",\n \"that you have to buy the stock before you can sell it\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader I\",\n numTries: 5,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let maxCur = 0;\n let maxSoFar = 0;\n for (let i = 1; i < data.length; ++i) {\n maxCur = Math.max(0, (maxCur += data[i] - data[i - 1]));\n maxSoFar = Math.max(maxCur, maxSoFar);\n }\n\n return maxSoFar.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using as many\",\n \"transactions as you'd like. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let profit = 0;\n for (let p = 1; p < data.length; ++p) {\n profit += Math.max(data[p] - data[p - 1], 0);\n }\n\n return profit.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"two transactions. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader III\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let hold1 = Number.MIN_SAFE_INTEGER;\n let hold2 = Number.MIN_SAFE_INTEGER;\n let release1 = 0;\n let release2 = 0;\n for (const price of data) {\n release2 = Math.max(release2, hold2 + price);\n hold2 = Math.max(hold2, release1 - price);\n release1 = Math.max(release1, hold1 + price);\n hold1 = Math.max(hold1, price * -1);\n }\n\n return release2.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [number, number[]];\n const k = data[0];\n const prices = data[1];\n return [\n \"You are given the following array with two elements:\\n\\n\",\n `[${k}, [${prices}]]\\n\\n`,\n \"The first element is an integer k. The second element is an\",\n \"array of stock prices (which are numbers) where the i-th element\",\n \"represents the stock price on day i.\\n\\n\",\n \"Determine the maximum possible profit you can earn using at most\",\n \"k transactions. A transaction is defined as buying and then selling\",\n \"one share of the stock. Note that you cannot engage in multiple\",\n \"transactions at once. In other words, you must sell the stock before\",\n \"you can buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 8,\n gen: (): [number, number[]] => {\n const k = getRandomInt(2, 10);\n const len = getRandomInt(3, 50);\n const prices: number[] = [];\n prices.length = len;\n for (let i = 0; i < len; ++i) {\n prices[i] = getRandomInt(1, 200);\n }\n\n return [k, prices];\n },\n name: \"Algorithmic Stock Trader IV\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, number[]];\n const k: number = data[0];\n const prices: number[] = data[1];\n\n const len = prices.length;\n if (len < 2) {\n return parseInt(ans) === 0;\n }\n if (k > len / 2) {\n let res = 0;\n for (let i = 1; i < len; ++i) {\n res += Math.max(prices[i] - prices[i - 1], 0);\n }\n\n return parseInt(ans) === res;\n }\n\n const hold: number[] = [];\n const rele: number[] = [];\n hold.length = k + 1;\n rele.length = k + 1;\n for (let i = 0; i <= k; ++i) {\n hold[i] = Number.MIN_SAFE_INTEGER;\n rele[i] = 0;\n }\n\n let cur: number;\n for (let i = 0; i < len; ++i) {\n cur = prices[i];\n for (let j = k; j > 0; --j) {\n rele[j] = Math.max(rele[j], hold[j] + cur);\n hold[j] = Math.max(hold[j], rele[j - 1] - cur);\n }\n }\n\n return parseInt(ans) === rele[k];\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n function createTriangleRecurse(data: number[][], level = 0): string {\n const numLevels: number = data.length;\n if (level >= numLevels) {\n return \"\";\n }\n const numSpaces = numLevels - level + 1;\n\n let str: string = [\" \".repeat(numSpaces), \"[\", data[level].toString(), \"]\"].join(\"\");\n if (level < numLevels - 1) {\n str += \",\";\n }\n\n return str + \"\\n\" + createTriangleRecurse(data, level + 1);\n }\n\n function createTriangle(data: number[][]): string {\n return [\"[\\n\", createTriangleRecurse(data), \"]\"].join(\"\");\n }\n\n const triangle = createTriangle(data);\n\n return [\n \"Given a triangle, find the minimum path sum from top to bottom. In each step\",\n \"of the path, you may only move to adjacent numbers in the row below.\",\n \"The triangle is represented as a 2D array of numbers:\\n\\n\",\n `${triangle}\\n\\n`,\n \"Example: If you are given the following triangle:\\n\\n[\\n\",\n \"     [2],\\n\",\n \"    [3,4],\\n\",\n \"   [6,5,7],\\n\",\n \"  [4,1,8,3]\\n\",\n \"]\\n\\n\",\n \"The minimum path sum is 11 (2 -> 3 -> 5 -> 1).\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const triangle: number[][] = [];\n const levels: number = getRandomInt(3, 12);\n triangle.length = levels;\n\n for (let row = 0; row < levels; ++row) {\n triangle[row] = [];\n triangle[row].length = row + 1;\n for (let i = 0; i < triangle[row].length; ++i) {\n triangle[row][i] = getRandomInt(1, 9);\n }\n }\n\n return triangle;\n },\n name: \"Minimum Path Sum in a Triangle\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const n: number = data.length;\n const dp: number[] = data[n - 1].slice();\n for (let i = n - 2; i > -1; --i) {\n for (let j = 0; j < data[i].length; ++j) {\n dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j];\n }\n }\n\n return dp[0] === parseInt(ans);\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n const numRows = data[0];\n const numColumns = data[1];\n return [\n \"You are in a grid with\",\n `${numRows} rows and ${numColumns} columns, and you are`,\n \"positioned in the top-left corner of that grid. You are trying to\",\n \"reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Determine how many\",\n \"unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an array\",\n \"with the number of rows and columns:\\n\\n\",\n `[${numRows}, ${numColumns}]`,\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const numRows: number = getRandomInt(2, 14);\n const numColumns: number = getRandomInt(2, 14);\n\n return [numRows, numColumns];\n },\n name: \"Unique Paths in a Grid I\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data[0]; // Number of rows\n const m: number = data[1]; // Number of columns\n const currentRow: number[] = [];\n currentRow.length = n;\n\n for (let i = 0; i < n; i++) {\n currentRow[i] = 1;\n }\n for (let row = 1; row < m; row++) {\n for (let i = 1; i < n; i++) {\n currentRow[i] += currentRow[i - 1];\n }\n }\n\n return parseInt(ans) === currentRow[n - 1];\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n let gridString = \"\";\n for (const line of data) {\n gridString += `${line.toString()},\\n`;\n }\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n `${gridString}\\n`,\n \"You are trying reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Furthermore, there are obstacles on the grid\",\n \"that you cannot move onto. These obstacles are denoted by '1', while empty\",\n \"spaces are denoted by 0.\\n\\n\",\n \"Determine how many unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const numRows: number = getRandomInt(2, 12);\n const numColumns: number = getRandomInt(2, 12);\n\n const grid: number[][] = [];\n grid.length = numRows;\n for (let i = 0; i < numRows; ++i) {\n grid[i] = [];\n grid[i].length = numColumns;\n grid[i].fill(0);\n }\n\n for (let r = 0; r < numRows; ++r) {\n for (let c = 0; c < numColumns; ++c) {\n if (r === 0 && c === 0) {\n continue;\n }\n if (r === numRows - 1 && c === numColumns - 1) {\n continue;\n }\n\n // 15% chance of an element being an obstacle\n if (Math.random() < 0.15) {\n grid[r][c] = 1;\n }\n }\n }\n\n return grid;\n },\n name: \"Unique Paths in a Grid II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const obstacleGrid: number[][] = [];\n obstacleGrid.length = data.length;\n for (let i = 0; i < obstacleGrid.length; ++i) {\n obstacleGrid[i] = data[i].slice();\n }\n\n for (let i = 0; i < obstacleGrid.length; i++) {\n for (let j = 0; j < obstacleGrid[0].length; j++) {\n if (obstacleGrid[i][j] == 1) {\n obstacleGrid[i][j] = 0;\n } else if (i == 0 && j == 0) {\n obstacleGrid[0][0] = 1;\n } else {\n obstacleGrid[i][j] = (i > 0 ? obstacleGrid[i - 1][j] : 0) + (j > 0 ? obstacleGrid[i][j - 1] : 0);\n }\n }\n }\n\n return obstacleGrid[obstacleGrid.length - 1][obstacleGrid[0].length - 1] === parseInt(ans);\n },\n },\n {\n name: \"Shortest Path in a Grid\",\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n `  [${data.map((line) => \"[\" + line + \"]\").join(\",\\n   \")}]\\n\\n`,\n \"You are trying to find the shortest path to the bottom-right corner of the grid,\",\n \"but there are obstacles on the grid that you cannot move onto.\",\n \"These obstacles are denoted by '1', while empty spaces are denoted by 0.\\n\\n\",\n \"Determine the shortest path from start to finish, if one exists.\",\n \"The answer should be given as a string of UDLR characters, indicating the moves along the path\\n\\n\",\n \"NOTE: If there are multiple equally short paths, any of them is accepted as answer.\",\n \"If there is no path, the answer should be an empty string.\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\\n\\n\",\n \"Examples:\\n\\n\",\n \"    [[0,1,0,0,0],\\n\",\n \"     [0,0,0,1,0]]\\n\",\n \"\\n\",\n \"Answer: 'DRRURRD'\\n\\n\",\n \"    [[0,1],\\n\",\n \"     [1,0]]\\n\",\n \"\\n\",\n \"Answer: ''\\n\\n\",\n ].join(\" \");\n },\n difficulty: 7,\n numTries: 10,\n gen: (): number[][] => {\n const height = getRandomInt(6, 12);\n const width = getRandomInt(6, 12);\n const dstY = height - 1;\n const dstX = width - 1;\n const minPathLength = dstY + dstX; // Math.abs(dstY - srcY) + Math.abs(dstX - srcX)\n\n const grid: number[][] = new Array(height);\n for (let y = 0; y < height; y++) grid[y] = new Array(width).fill(0);\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n if (y == 0 && x == 0) continue; // Don't block start\n if (y == dstY && x == dstX) continue; // Don't block destination\n\n // Generate more obstacles the farther a position is from start and destination.\n // Raw distance factor peaks at 50% at half-way mark. Rescale to 40% max.\n // Obstacle chance range of [15%, 40%] produces ~78% solvable puzzles\n const distanceFactor = (Math.min(y + x, dstY - y + dstX - x) / minPathLength) * 0.8;\n if (Math.random() < Math.max(0.15, distanceFactor)) grid[y][x] = 1;\n }\n }\n\n return grid;\n },\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const width = data[0].length;\n const height = data.length;\n const dstY = height - 1;\n const dstX = width - 1;\n\n const distance: [number][] = new Array(height);\n //const prev: [[number, number] | undefined][] = new Array(height);\n const queue = new MinHeap<[number, number]>();\n\n for (let y = 0; y < height; y++) {\n distance[y] = new Array(width).fill(Infinity) as [number];\n //prev[y] = new Array(width).fill(undefined) as [undefined];\n }\n\n function validPosition(y: number, x: number): boolean {\n return y >= 0 && y < height && x >= 0 && x < width && data[y][x] == 0;\n }\n\n // List in-bounds and passable neighbors\n function* neighbors(y: number, x: number): Generator<[number, number]> {\n if (validPosition(y - 1, x)) yield [y - 1, x]; // Up\n if (validPosition(y + 1, x)) yield [y + 1, x]; // Down\n if (validPosition(y, x - 1)) yield [y, x - 1]; // Left\n if (validPosition(y, x + 1)) yield [y, x + 1]; // Right\n }\n\n // Prepare starting point\n distance[0][0] = 0;\n queue.push([0, 0], 0);\n\n // Take next-nearest position and expand potential paths from there\n while (queue.size > 0) {\n const [y, x] = queue.pop() as [number, number];\n for (const [yN, xN] of neighbors(y, x)) {\n const d = distance[y][x] + 1;\n if (d < distance[yN][xN]) {\n if (distance[yN][xN] == Infinity)\n // Not reached previously\n queue.push([yN, xN], d);\n // Found a shorter path\n else queue.changeWeight(([yQ, xQ]) => yQ == yN && xQ == xN, d);\n //prev[yN][xN] = [y, x];\n distance[yN][xN] = d;\n }\n }\n }\n\n // No path at all?\n if (distance[dstY][dstX] == Infinity) return ans == \"\";\n\n // There is a solution, require that the answer path is as short as the shortest\n // path we found\n if (ans.length > distance[dstY][dstX]) return false;\n\n // Further verify that the answer path is a valid path\n let ansX = 0;\n let ansY = 0;\n for (const direction of ans) {\n switch (direction) {\n case \"U\":\n ansY -= 1;\n break;\n case \"D\":\n ansY += 1;\n break;\n case \"L\":\n ansX -= 1;\n break;\n case \"R\":\n ansX += 1;\n break;\n default:\n return false; // Invalid character\n }\n if (!validPosition(ansY, ansX)) return false;\n }\n\n // Path was valid, finally verify that the answer path brought us to the end coordinates\n return ansY == dstY && ansX == dstX;\n },\n },\n {\n desc: (data: unknown): string => {\n return [\n \"Given the following string:\\n\\n\",\n `${data}\\n\\n`,\n \"remove the minimum number of invalid parentheses in order to validate\",\n \"the string. If there are multiple minimal ways to validate the string,\",\n \"provide all of the possible results. The answer should be provided\",\n \"as an array of strings. If it is impossible to validate the string\",\n \"the result should be an array with only an empty string.\\n\\n\",\n \"IMPORTANT: The string may contain letters, not just parentheses.\",\n `Examples:\\n`,\n `\"()())()\" -> [()()(), (())()]\\n`,\n `\"(a)())()\" -> [(a)()(), (a())()]\\n`,\n `\")(\" -> [\"\"]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): string => {\n const len: number = getRandomInt(6, 20);\n const chars: string[] = [];\n chars.length = len;\n\n // 80% chance of the first parenthesis being (\n Math.random() < 0.8 ? (chars[0] = \"(\") : (chars[0] = \")\");\n\n for (let i = 1; i < len; ++i) {\n const roll = Math.random();\n if (roll < 0.4) {\n chars[i] = \"(\";\n } else if (roll < 0.8) {\n chars[i] = \")\";\n } else {\n chars[i] = \"a\";\n }\n }\n\n return chars.join(\"\");\n },\n name: \"Sanitize Parentheses in Expression\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n let left = 0;\n let right = 0;\n const res: string[] = [];\n\n for (let i = 0; i < data.length; ++i) {\n if (data[i] === \"(\") {\n ++left;\n } else if (data[i] === \")\") {\n left > 0 ? --left : ++right;\n }\n }\n\n function dfs(\n pair: number,\n index: number,\n left: number,\n right: number,\n s: string,\n solution: string,\n res: string[],\n ): void {\n if (s.length === index) {\n if (left === 0 && right === 0 && pair === 0) {\n for (let i = 0; i < res.length; i++) {\n if (res[i] === solution) {\n return;\n }\n }\n res.push(solution);\n }\n return;\n }\n\n if (s[index] === \"(\") {\n if (left > 0) {\n dfs(pair, index + 1, left - 1, right, s, solution, res);\n }\n dfs(pair + 1, index + 1, left, right, s, solution + s[index], res);\n } else if (s[index] === \")\") {\n if (right > 0) dfs(pair, index + 1, left, right - 1, s, solution, res);\n if (pair > 0) dfs(pair - 1, index + 1, left, right, s, solution + s[index], res);\n } else {\n dfs(pair, index + 1, left, right, s, solution + s[index], res);\n }\n }\n\n dfs(0, 0, left, right, data, \"\", res);\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (sanitizedPlayerAnsArr.length !== res.length) {\n return false;\n }\n for (const resultInAnswer of res) {\n if (!sanitizedPlayerAnsArr.includes(resultInAnswer)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [string, number];\n const digits: string = data[0];\n const target: number = data[1];\n\n return [\n \"You are given the following string which contains only digits between 0 and 9:\\n\\n\",\n `${digits}\\n\\n`,\n `You are also given a target number of ${target}. Return all possible ways`,\n \"you can add the +(add), -(subtract), and *(multiply) operators to the string such\",\n \"that it evaluates to the target number. (Normal order of operations applies.)\\n\\n\",\n \"The provided answer should be an array of strings containing the valid expressions.\",\n \"The data provided by this problem is an array with two elements. The first element\",\n \"is the string of digits, while the second element is the target number:\\n\\n\",\n `[\"${digits}\", ${target}]\\n\\n`,\n \"NOTE: The order of evaluation expects script operator precedence\",\n \"NOTE: Numbers in the expression cannot have leading 0's. In other words,\",\n `\"1+01\" is not a valid expression`,\n \"Examples:\\n\\n\",\n `Input: digits = \"123\", target = 6\\n`,\n `Output: [1+2+3, 1*2*3]\\n\\n`,\n `Input: digits = \"105\", target = 5\\n`,\n `Output: [1*0+5, 10-5]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): [string, number] => {\n const numDigits = getRandomInt(4, 12);\n const digitsArray: string[] = [];\n digitsArray.length = numDigits;\n for (let i = 0; i < digitsArray.length; ++i) {\n if (i === 0) {\n digitsArray[i] = String(getRandomInt(1, 9));\n } else {\n digitsArray[i] = String(getRandomInt(0, 9));\n }\n }\n\n const target: number = getRandomInt(-100, 100);\n const digits: string = digitsArray.join(\"\");\n\n return [digits, target];\n },\n name: \"Find All Valid Math Expressions\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [string, number];\n const num = data[0];\n const target = data[1];\n\n function helper(\n res: string[],\n path: string,\n num: string,\n target: number,\n pos: number,\n evaluated: number,\n multed: number,\n ): void {\n if (pos === num.length) {\n if (target === evaluated) {\n res.push(path);\n }\n return;\n }\n\n for (let i = pos; i < num.length; ++i) {\n if (i != pos && num[pos] == \"0\") {\n break;\n }\n const cur = parseInt(num.substring(pos, i + 1));\n\n if (pos === 0) {\n helper(res, path + cur, num, target, i + 1, cur, cur);\n } else {\n helper(res, path + \"+\" + cur, num, target, i + 1, evaluated + cur, cur);\n helper(res, path + \"-\" + cur, num, target, i + 1, evaluated - cur, -cur);\n helper(res, path + \"*\" + cur, num, target, i + 1, evaluated - multed + multed * cur, multed * cur);\n }\n }\n }\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (num == null || num.length === 0) {\n if (sanitizedPlayerAnsArr.length === 0) {\n return true;\n }\n if (sanitizedPlayerAnsArr.length === 1 && sanitizedPlayerAnsArr[0] === \"\") {\n return true;\n }\n return false;\n }\n\n const result: string[] = [];\n helper(result, \"\", num, target, 0, 0, 0);\n\n for (const expr of result) {\n if (!sanitizedPlayerAnsArr.includes(expr)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n name: \"HammingCodes: Integer to Encoded Binary\",\n numTries: 10,\n difficulty: 5,\n desc: (n: unknown): string => {\n return [\n \"You are given the following decimal Value: \\n\",\n `${n} \\n`,\n \"Convert it to a binary representation and encode it as an 'extended Hamming code'. Eg:\\n \",\n \"Value 8 is expressed in binary as '1000', which will be encoded\",\n \"with the pattern 'pppdpddd', where p is a parity bit and d a data bit,\\n\",\n \"or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\\n\",\n \"The answer should be given as a string containing only 1s and 0s.\\n\",\n \"NOTE: the endianness of the data bits is reversed in relation to the endianness of the parity bits.\\n\",\n \"NOTE: The bit at index zero is the overall parity bit, this should be set last.\\n\",\n \"NOTE 2: You should watch the Hamming Code video from 3Blue1Brown, which explains the 'rule' of encoding,\",\n \"including the first index parity bit mentioned in the previous note.\\n\\n\",\n \"Extra rule for encoding:\\n\",\n \"There should be no leading zeros in the 'data bit' section\",\n ].join(\" \");\n },\n gen: (): number => {\n return getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57)));\n },\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n return ans === HammingEncode(data);\n },\n },\n {\n name: \"HammingCodes: Encoded Binary to Integer\",\n difficulty: 8,\n numTries: 10,\n desc: (n: unknown): string => {\n return [\n \"You are given the following encoded binary string: \\n\",\n `'${n}' \\n\\n`,\n \"Treat it as an extended Hamming code with 1 'possible' error at a random index.\\n\",\n \"Find the 'possible' wrong bit, fix it and extract the decimal value, which is hidden inside the string.\\n\\n\",\n \"Note: The length of the binary string is dynamic, but it's encoding/decoding follows Hamming's 'rule'\\n\",\n \"Note 2: Index 0 is an 'overall' parity bit. Watch the Hamming code video from 3Blue1Brown for more information\\n\",\n \"Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\\n\",\n \"Note: The endianness of the encoded decimal value is reversed in relation to the endianness of the Hamming code. Where\",\n \"the Hamming code is expressed as little-endian (LSB at index 0), the decimal value encoded in it is expressed as big-endian\",\n \"(MSB at index 0).\\n\",\n \"Extra note for automation: return the decimal value as a string\",\n ].join(\" \");\n },\n gen: (): string => {\n const _alteredBit = Math.round(Math.random());\n const _buildArray: Array = HammingEncodeProperly(\n getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57))),\n ).split(\"\");\n if (_alteredBit) {\n const _randomIndex: number = getRandomInt(0, _buildArray.length - 1);\n _buildArray[_randomIndex] = _buildArray[_randomIndex] == \"0\" ? \"1\" : \"0\";\n }\n return _buildArray.join(\"\");\n },\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n return parseInt(ans, 10) === HammingDecode(data);\n },\n },\n {\n name: \"Proper 2-Coloring of a Graph\",\n difficulty: 7,\n numTries: 5,\n desc: (_data: unknown): string => {\n const data = _data as [number, [number, number][]];\n return [\n `You are given the following data, representing a graph:\\n`,\n `${JSON.stringify(data)}\\n`,\n `Note that \"graph\", as used here, refers to the field of graph theory, and has`,\n `no relation to statistics or plotting.`,\n `The first element of the data represents the number of vertices in the graph.`,\n `Each vertex is a unique number between 0 and ${data[0] - 1}.`,\n `The next element of the data represents the edges of the graph.`,\n `Two vertices u,v in a graph are said to be adjacent if there exists an edge [u,v].`,\n `Note that an edge [u,v] is the same as an edge [v,u], as order does not matter.`,\n `You must construct a 2-coloring of the graph, meaning that you have to assign each`,\n `vertex in the graph a \"color\", either 0 or 1, such that no two adjacent vertices have`,\n `the same color. Submit your answer in the form of an array, where element i`,\n `represents the color of vertex i. If it is impossible to construct a 2-coloring of`,\n `the given graph, instead submit an empty array.\\n\\n`,\n `Examples:\\n\\n`,\n `Input: [4, [[0, 2], [0, 3], [1, 2], [1, 3]]]\\n`,\n `Output: [0, 0, 1, 1]\\n\\n`,\n `Input: [3, [[0, 1], [0, 2], [1, 2]]]\\n`,\n `Output: []`,\n ].join(\" \");\n },\n gen: (): [number, [number, number][]] => {\n //Generate two partite sets\n const n = Math.floor(Math.random() * 5) + 3;\n const m = Math.floor(Math.random() * 5) + 3;\n\n //50% chance of spawning any given valid edge in the bipartite graph\n const edges: [number, number][] = [];\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n if (Math.random() > 0.5) {\n edges.push([i, n + j]);\n }\n }\n }\n\n //Add an edge at random with no regard to partite sets\n let a = Math.floor(Math.random() * (n + m));\n let b = Math.floor(Math.random() * (n + m));\n if (a > b) [a, b] = [b, a]; //Enforce lower numbers come first\n if (a != b && !edges.includes([a, b])) {\n edges.push([a, b]);\n }\n\n //Randomize array in-place using Durstenfeld shuffle algorithm.\n function shuffle(array: T[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n }\n\n //Replace instances of the original vertex names in-place\n const vertexShuffler = Array.from(Array(n + m).keys());\n shuffle(vertexShuffler);\n for (let i = 0; i < edges.length; i++) {\n edges[i] = [vertexShuffler[edges[i][0]], vertexShuffler[edges[i][1]]];\n if (edges[i][0] > edges[i][1]) {\n //Enforce lower numbers come first\n [edges[i][0], edges[i][1]] = [edges[i][1], edges[i][0]];\n }\n }\n\n //Shuffle the order of the edges themselves, as well\n shuffle(edges);\n\n return [n + m, edges];\n },\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, [number, number][]];\n\n //Sanitize player input\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n\n //Case where the player believes there is no solution.\n //Attempt to construct one to check if this is correct.\n if (sanitizedPlayerAns === \"\") {\n //Helper function to get neighbourhood of a vertex\n function neighbourhood(vertex: number): number[] {\n const adjLeft = data[1].filter(([a]) => a == vertex).map(([, b]) => b);\n const adjRight = data[1].filter(([, b]) => b == vertex).map(([a]) => a);\n return adjLeft.concat(adjRight);\n }\n\n //Verify that there is no solution by attempting to create a proper 2-coloring.\n const coloring: (number | undefined)[] = Array(data[0]).fill(undefined);\n while (coloring.some((val) => val === undefined)) {\n //Color a vertex in the graph\n const initialVertex: number = coloring.findIndex((val) => val === undefined);\n coloring[initialVertex] = 0;\n const frontier: number[] = [initialVertex];\n\n //Propogate the coloring throughout the component containing v greedily\n while (frontier.length > 0) {\n const v: number = frontier.pop() || 0;\n const neighbors: number[] = neighbourhood(v);\n\n //For each vertex u adjacent to v\n for (const id in neighbors) {\n const u: number = neighbors[id];\n\n //Set the color of u to the opposite of v's color if it is new,\n //then add u to the frontier to continue the algorithm.\n if (coloring[u] === undefined) {\n if (coloring[v] === 0) coloring[u] = 1;\n else coloring[u] = 0;\n\n frontier.push(u);\n }\n\n //Assert u,v do not have the same color\n else if (coloring[u] === coloring[v]) {\n //If u,v do have the same color, no proper 2-coloring exists, meaning\n //the player was correct to say there is no proper 2-coloring of the graph.\n return true;\n }\n }\n }\n }\n\n //If this code is reached, there exists a proper 2-coloring of the input\n //graph, and thus the player was incorrect in submitting no answer.\n return false;\n }\n\n //Solution provided case\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n const coloring: number[] = sanitizedPlayerAnsArr.map((val) => parseInt(val));\n if (coloring.length == data[0]) {\n const edges = data[1];\n const validColors = [0, 1];\n //Check that the provided solution is a proper 2-coloring\n return edges.every(([a, b]) => {\n const aColor = coloring[a];\n const bColor = coloring[b];\n return (\n validColors.includes(aColor) && //Enforce the first endpoint is color 0 or 1\n validColors.includes(bColor) && //Enforce the second endpoint is color 0 or 1\n aColor != bColor //Enforce the endpoints are different colors\n );\n });\n }\n\n //Return false if the coloring is the wrong size\n else return false;\n },\n },\n {\n name: \"Compression I: RLE Compression\",\n difficulty: 2,\n numTries: 10,\n desc: (plaintext: unknown): string => {\n return [\n \"Run-length encoding (RLE) is a data compression technique which encodes data as a series of runs of\",\n \"a repeated single character. Runs are encoded as a length, followed by the character itself. Lengths\",\n \"are encoded as a single ASCII digit; runs of 10 characters or more are encoded by splitting them\",\n \"into multiple runs.\\n\\n\",\n \"You are given the following input string:\\n\",\n `    ${plaintext}\\n`,\n \"Encode it using run-length encoding with the minimum possible output length.\\n\\n\",\n \"Examples:\\n\",\n \"    aaaaabccc            ->  5a1b3c\\n\",\n \"    aAaAaA               ->  1a1A1a1A1a1A\\n\",\n \"    111112333            ->  511233\\n\",\n \"    zzzzzzzzzzzzzzzzzzz  ->  9z9z1z  (or 9z8z2z, etc.)\\n\",\n ].join(\" \");\n },\n gen: (): string => {\n const length = 50 + Math.floor(25 * (Math.random() + Math.random()));\n let plain = \"\";\n\n while (plain.length < length) {\n const r = Math.random();\n\n let n = 1;\n if (r < 0.3) {\n n = 1;\n } else if (r < 0.6) {\n n = 2;\n } else if (r < 0.9) {\n n = Math.floor(10 * Math.random());\n } else {\n n = 10 + Math.floor(5 * Math.random());\n }\n\n const c = comprGenChar();\n plain += c.repeat(n);\n }\n\n return plain.substring(0, length);\n },\n solver: (plain: unknown, ans: string): boolean => {\n if (typeof plain !== \"string\") throw new Error(\"solver expected string\");\n if (ans.length % 2 !== 0) {\n return false;\n }\n\n let ans_plain = \"\";\n for (let i = 0; i + 1 < ans.length; i += 2) {\n const length = ans.charCodeAt(i) - 0x30;\n if (length < 0 || length > 9) {\n return false;\n }\n\n ans_plain += ans[i + 1].repeat(length);\n }\n if (ans_plain !== plain) {\n return false;\n }\n\n let length = 0;\n for (let i = 0; i < plain.length; ) {\n let run_length = 1;\n while (i + run_length < plain.length && plain[i + run_length] === plain[i]) {\n ++run_length;\n }\n i += run_length;\n\n while (run_length > 0) {\n run_length -= 9;\n length += 2;\n }\n }\n\n return ans.length <= length;\n },\n },\n {\n name: \"Compression II: LZ Decompression\",\n difficulty: 4,\n numTries: 10,\n desc: (compressed: unknown): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following LZ-encoded string:\\n\",\n `    ${compressed}\\n`,\n \"Decode it and output the original string.\\n\\n\",\n \"Example: decoding '5aaabb450723abb' chunk-by-chunk\\n\",\n \"    5aaabb           ->  aaabb\\n\",\n \"    5aaabb45         ->  aaabbaaab\\n\",\n \"    5aaabb450        ->  aaabbaaab\\n\",\n \"    5aaabb45072      ->  aaabbaaababababa\\n\",\n \"    5aaabb450723abb  ->  aaabbaaababababaabb\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZEncode(comprLZGenerate());\n },\n solver: (compr: unknown, ans: string): boolean => {\n if (typeof compr !== \"string\") throw new Error(\"solver expected string\");\n return ans === comprLZDecode(compr);\n },\n },\n {\n name: \"Compression III: LZ Compression\",\n difficulty: 10,\n numTries: 10,\n desc: (plaintext: unknown): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following input string:\\n\",\n `    ${plaintext}\\n`,\n \"Encode it using Lempel-Ziv encoding with the minimum possible output length.\\n\\n\",\n \"Examples (some have other possible encodings of minimal length):\\n\",\n \"    abracadabra     ->  7abracad47\\n\",\n \"    mississippi     ->  4miss433ppi\\n\",\n \"    aAAaAAaAaAA     ->  3aAA53035\\n\",\n \"    2718281828      ->  627182844\\n\",\n \"    abcdefghijk     ->  9abcdefghi02jk\\n\",\n \"    aaaaaaaaaaaa    ->  3aaa91\\n\",\n \"    aaaaaaaaaaaaa   ->  1a91031\\n\",\n \"    aaaaaaaaaaaaaa  ->  1a91041\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZGenerate();\n },\n solver: (plain: unknown, ans: string): boolean => {\n if (typeof plain !== \"string\") throw new Error(\"solver expected string\");\n return comprLZDecode(ans) === plain && ans.length <= comprLZEncode(plain).length;\n },\n },\n {\n desc: (_data: unknown): string => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, number];\n return [\n \"Caesar cipher is one of the simplest encryption technique.\",\n \"It is a type of substitution cipher in which each letter in the plaintext \",\n \"is replaced by a letter some fixed number of positions down the alphabet.\",\n \"For example, with a left shift of 3, D would be replaced by A, \",\n \"E would become B, and A would become X (because of rotation).\\n\\n\",\n \"You are given an array with two elements:\\n\",\n `  [\"${data[0]}\", ${data[1]}]\\n`,\n \"The first element is the plaintext, the second element is the left shift value.\\n\\n\",\n \"Return the ciphertext as uppercase string. Spaces remains the same.\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): [string, number] => {\n // return [plaintext, shift value]\n const words = [\n \"ARRAY\",\n \"CACHE\",\n \"CLOUD\",\n \"DEBUG\",\n \"EMAIL\",\n \"ENTER\",\n \"FLASH\",\n \"FRAME\",\n \"INBOX\",\n \"LINUX\",\n \"LOGIC\",\n \"LOGIN\",\n \"MACRO\",\n \"MEDIA\",\n \"MODEM\",\n \"MOUSE\",\n \"PASTE\",\n \"POPUP\",\n \"PRINT\",\n \"QUEUE\",\n \"SHELL\",\n \"SHIFT\",\n \"TABLE\",\n \"TRASH\",\n \"VIRUS\",\n ];\n return [\n words\n .sort(() => Math.random() - 0.5)\n .slice(0, 5)\n .join(\" \"),\n Math.floor(Math.random() * 25 + 1),\n ];\n },\n name: \"Encryption I: Caesar Cipher\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, number];\n // data = [plaintext, shift value]\n // build char array, shifting via map and join to final results\n const cipher = [...data[0]]\n .map((a) => (a === \" \" ? a : String.fromCharCode(((a.charCodeAt(0) - 65 - data[1] + 26) % 26) + 65)))\n .join(\"\");\n return cipher === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, string];\n return [\n \"Vigenère cipher is a type of polyalphabetic substitution. It uses \",\n \"the Vigenère square to encrypt and decrypt plaintext with a keyword.\\n\\n\",\n \"  Vignenère square:\\n\",\n \"         A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \\n\",\n \"       +----------------------------------------------------\\n\",\n \"     A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \\n\",\n \"     B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A \\n\",\n \"     C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B\\n\",\n \"     D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C\\n\",\n \"     E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D\\n\",\n \"                ...\\n\",\n \"     Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X\\n\",\n \"     Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y\\n\\n\",\n \"For encryption each letter of the plaintext is paired with the corresponding letter of a repeating keyword.\",\n \"For example, the plaintext DASHBOARD is encrypted with the keyword LINUX:\\n\",\n \"   Plaintext: DASHBOARD\\n\",\n \"   Keyword:   LINUXLINU\\n\",\n \"So, the first letter D is paired with the first letter of the key L. Therefore, row D and column L of the \",\n \"Vigenère square are used to get the first cipher letter O. This must be repeated for the whole ciphertext.\\n\\n\",\n \"You are given an array with two elements:\\n\",\n `  [\"${data[0]}\", \"${data[1]}\"]\\n`,\n \"The first element is the plaintext, the second element is the keyword.\\n\\n\",\n \"Return the ciphertext as uppercase string.\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): [string, string] => {\n // return [plaintext, keyword]\n const words = [\n \"ARRAY\",\n \"CACHE\",\n \"CLOUD\",\n \"DEBUG\",\n \"EMAIL\",\n \"ENTER\",\n \"FLASH\",\n \"FRAME\",\n \"INBOX\",\n \"LINUX\",\n \"LOGIC\",\n \"LOGIN\",\n \"MACRO\",\n \"MEDIA\",\n \"MODEM\",\n \"MOUSE\",\n \"PASTE\",\n \"POPUP\",\n \"PRINT\",\n \"QUEUE\",\n \"SHELL\",\n \"SHIFT\",\n \"TABLE\",\n \"TRASH\",\n \"VIRUS\",\n ];\n const keys = [\n \"ALGORITHM\",\n \"BANDWIDTH\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BROADBAND\",\n \"BROWSER\",\n \"CAPTCHA\",\n \"CLIPBOARD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"DASHBOARD\",\n \"DATABASE\",\n \"DESKTOP\",\n \"DIGITAL\",\n \"DOCUMENT\",\n \"DOWNLOAD\",\n \"DYNAMIC\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"EXABYTE\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLOWCHART\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HARDWARE\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"ITERATION\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MONITOR\",\n \"NETWORK\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"OPERATING\",\n \"PASSWORD\",\n \"PHISHING\",\n \"PLATFORM\",\n \"PODCAST\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROTOCOL\",\n \"REALTIME\",\n \"RESTORE\",\n \"RUNTIME\",\n \"SCANNER\",\n \"SECURITY\",\n \"SHAREWARE\",\n \"SNAPSHOT\",\n \"SOFTWARE\",\n \"SPAMMER\",\n \"SPYWARE\",\n \"STORAGE\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TOOLBAR\",\n \"TYPEFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n ];\n return [\n words\n .sort(() => Math.random() - 0.5)\n .slice(0, 5)\n .join(\"\"),\n keys.sort(() => Math.random() - 0.5)[0],\n ];\n },\n name: \"Encryption II: Vigenère Cipher\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, string];\n // data = [plaintext, keyword]\n // build char array, shifting via map and corresponding keyword letter and join to final results\n const cipher = [...data[0]]\n .map((a, i) => {\n return a === \" \"\n ? a\n : String.fromCharCode(((a.charCodeAt(0) - 2 * 65 + data[1].charCodeAt(i % data[1].length)) % 26) + 65);\n })\n .join(\"\");\n return cipher === ans;\n },\n },\n];\n","/** Binary heap. */\nabstract class BinHeap {\n /**\n * Heap data array consisting of [weight, payload] pairs, arranged by weight\n * to satisfy heap condition.\n *\n * Encodes the binary tree by storing tree root at index 0 and\n * left child of element i at `i * 2 + 1` and\n * right child of element i at `i * 2 + 2`.\n */\n protected data: [number, T][];\n\n constructor() {\n this.data = [];\n }\n\n /** Get number of elements in the heap. */\n public get size(): number {\n return this.data.length;\n }\n\n /** Add a new element to the heap. */\n public push(value: T, weight: number): void {\n const i = this.data.length;\n this.data[i] = [weight, value];\n this.heapifyUp(i);\n }\n\n /** Get the value of the root-most element of the heap, without changing the heap. */\n public peek(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n return this.data[0][1];\n }\n\n /** Remove the root-most element of the heap and return the removed element's value. */\n public pop(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n const value = this.data[0][1];\n\n this.data[0] = this.data[this.data.length - 1];\n this.data.length = this.data.length - 1;\n\n this.heapifyDown(0);\n\n return value;\n }\n\n /** Change the weight of an element in the heap. */\n public changeWeight(predicate: (value: T) => boolean, weight: number): void {\n // Find first element with matching value, if any\n const i = this.data.findIndex((e) => predicate(e[1]));\n if (i == -1) return;\n\n // Update that element's weight\n this.data[i][0] = weight;\n\n // And re-heapify if needed\n const p = Math.floor((i - 1) / 2);\n\n if (!this.heapOrderABeforeB(this.data[p][0], this.data[i][0]))\n // Needs to shift root-wards?\n this.heapifyUp(i);\n // Try shifting deeper\n else this.heapifyDown(i);\n }\n\n /** Restore heap condition, starting at index i and traveling towards root. */\n protected heapifyUp(i: number): void {\n // Swap the new element up towards root until it reaches root position or\n // settles under under a suitable parent\n while (i > 0) {\n const p = Math.floor((i - 1) / 2);\n\n // Reached heap-ordered state already?\n if (this.heapOrderABeforeB(this.data[p][0], this.data[i][0])) break;\n\n // Swap\n const tmp = this.data[p];\n this.data[p] = this.data[i];\n this.data[i] = tmp;\n\n // And repeat at parent index\n i = p;\n }\n }\n\n /** Restore heap condition, starting at index i and traveling away from root. */\n protected heapifyDown(i: number): void {\n // Swap the shifted element down in the heap until it either reaches the\n // bottom layer or is in correct order relative to it's children\n while (i < this.data.length) {\n const l = i * 2 + 1;\n const r = i * 2 + 2;\n let toSwap = i;\n\n // Find which one of element i and it's children should be closest to root\n if (l < this.data.length && this.heapOrderABeforeB(this.data[l][0], this.data[toSwap][0])) toSwap = l;\n if (r < this.data.length && this.heapOrderABeforeB(this.data[r][0], this.data[toSwap][0])) toSwap = r;\n\n // Already in order?\n if (i == toSwap) break;\n\n // Not in order. Swap child that should be closest to root up to 'i' and repeat\n const tmp = this.data[toSwap];\n this.data[toSwap] = this.data[i];\n this.data[i] = tmp;\n\n i = toSwap;\n }\n }\n\n /**\n * Should element with weight `weightA` be closer to root than element with\n * weight `weightB`?\n */\n protected abstract heapOrderABeforeB(weightA: number, weightB: number): boolean;\n}\n\n/** Binary max-heap. */\nexport class MaxHeap extends BinHeap {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA > weightB;\n }\n}\n\n/** Binary min-heap. */\nexport class MinHeap extends BinHeap {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA < weightB;\n }\n}\n","// Function that generates a random gibberish string of length n\nconst chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\nexport function createRandomString(n: number): string {\n let str = \"\";\n\n for (let i = 0; i < n; ++i) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n","import { BaseServer } from \"../Server/BaseServer\";\nimport { ITerminal } from \"../Terminal/ITerminal\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"../ui/Router\";\n\nexport interface IProgramCreate {\n level: number;\n req(p: IPlayer): boolean; // Function that indicates whether player meets requirements\n time: number;\n tooltip: string;\n}\n\nexport class Program {\n name = \"\";\n create: IProgramCreate | null;\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;\n\n constructor(\n name: string,\n create: IProgramCreate | null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void,\n ) {\n this.name = name;\n this.create = create;\n this.run = run;\n }\n}\n","import { IProgramCreate } from \"../Program\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\nimport { ITerminal } from \"../../Terminal/ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { BitFlumeEvent } from \"../../BitNode/ui/BitFlumeModal\";\nimport { calculateHackingTime, calculateGrowTime, calculateWeakenTime } from \"../../Hacking\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nfunction requireHackingLevel(lvl: number) {\n return function (p: IPlayer) {\n return p.skills.hacking + p.skills.intelligence / 2 >= lvl;\n };\n}\n\nfunction bitFlumeRequirements() {\n return function (p: IPlayer) {\n return p.sourceFiles.length > 0 && p.skills.hacking >= 1;\n };\n}\n\ninterface IProgramCreationParams {\n key: string;\n name: string;\n create: IProgramCreate | null;\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;\n}\n\nexport const programsMetadata: IProgramCreationParams[] = [\n {\n key: \"NukeProgram\",\n name: \"NUKE.exe\",\n create: {\n level: 1,\n tooltip: \"This virus is used to gain root access to a machine if enough ports are opened.\",\n req: requireHackingLevel(1),\n time: CONSTANTS.MillisecondsPerFiveMinutes,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot nuke this kind of server.\");\n return;\n }\n if (server.hasAdminRights) {\n terminal.print(\"You already have root access to this computer. There is no reason to run NUKE.exe\");\n terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n if (server.openPortCount >= server.numOpenPortsRequired) {\n server.hasAdminRights = true;\n terminal.print(\"NUKE successful! Gained root access to \" + server.hostname);\n terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n\n terminal.print(\"NUKE unsuccessful. Not enough ports have been opened\");\n },\n },\n {\n key: \"BruteSSHProgram\",\n name: \"BruteSSH.exe\",\n create: {\n level: 50,\n tooltip: \"This program executes a brute force attack that opens SSH ports\",\n req: requireHackingLevel(50),\n time: CONSTANTS.MillisecondsPerFiveMinutes * 2,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run BruteSSH.exe on this kind of server.\");\n return;\n }\n if (server.sshPortOpen) {\n terminal.print(\"SSH Port (22) is already open!\");\n return;\n }\n\n server.sshPortOpen = true;\n terminal.print(\"Opened SSH Port(22)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"FTPCrackProgram\",\n name: \"FTPCrack.exe\",\n create: {\n level: 100,\n tooltip: \"This program cracks open FTP ports\",\n req: requireHackingLevel(100),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run FTPCrack.exe on this kind of server.\");\n return;\n }\n if (server.ftpPortOpen) {\n terminal.print(\"FTP Port (21) is already open!\");\n return;\n }\n\n server.ftpPortOpen = true;\n terminal.print(\"Opened FTP Port (21)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"RelaySMTPProgram\",\n name: \"relaySMTP.exe\",\n create: {\n level: 250,\n tooltip: \"This program opens SMTP ports by redirecting data\",\n req: requireHackingLevel(250),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run relaySMTP.exe on this kind of server.\");\n return;\n }\n if (server.smtpPortOpen) {\n terminal.print(\"SMTP Port (25) is already open!\");\n return;\n }\n\n server.smtpPortOpen = true;\n terminal.print(\"Opened SMTP Port (25)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"HTTPWormProgram\",\n name: \"HTTPWorm.exe\",\n create: {\n level: 500,\n tooltip: \"This virus opens up HTTP ports\",\n req: requireHackingLevel(500),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run HTTPWorm.exe on this kind of server.\");\n return;\n }\n if (server.httpPortOpen) {\n terminal.print(\"HTTP Port (80) is already open!\");\n return;\n }\n\n server.httpPortOpen = true;\n terminal.print(\"Opened HTTP Port (80)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"SQLInjectProgram\",\n name: \"SQLInject.exe\",\n create: {\n level: 750,\n tooltip: \"This virus opens SQL ports\",\n req: requireHackingLevel(750),\n time: CONSTANTS.MillisecondsPer8Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run SQLInject.exe on this kind of server.\");\n return;\n }\n if (server.sqlPortOpen) {\n terminal.print(\"SQL Port (1433) is already open!\");\n return;\n }\n\n server.sqlPortOpen = true;\n terminal.print(\"Opened SQL Port (1433)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"DeepscanV1\",\n name: \"DeepscanV1.exe\",\n create: {\n level: 75,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 5\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.\");\n },\n },\n {\n key: \"DeepscanV2\",\n name: \"DeepscanV2.exe\",\n create: {\n level: 400,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 10\",\n req: requireHackingLevel(400),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.\");\n },\n },\n {\n key: \"ServerProfiler\",\n name: \"ServerProfiler.exe\",\n create: {\n level: 75,\n tooltip: \"This program is used to display hacking and Netscript-related information about servers\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]): void => {\n if (args.length !== 1) {\n terminal.error(\"Must pass a server hostname or IP as an argument for ServerProfiler.exe\");\n return;\n }\n\n const targetServer = GetServer(args[0]);\n if (targetServer == null) {\n terminal.error(\"Invalid server IP/hostname\");\n return;\n }\n\n if (!(targetServer instanceof Server)) {\n terminal.error(`ServerProfiler.exe can only be run on normal servers.`);\n return;\n }\n\n terminal.print(targetServer.hostname + \":\");\n terminal.print(\"Server base security level: \" + targetServer.baseDifficulty);\n terminal.print(\"Server current security level: \" + targetServer.hackDifficulty);\n terminal.print(\"Server growth rate: \" + targetServer.serverGrowth);\n terminal.print(\n `Netscript hack() execution time: ${convertTimeMsToTimeElapsedString(\n calculateHackingTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n terminal.print(\n `Netscript grow() execution time: ${convertTimeMsToTimeElapsedString(\n calculateGrowTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n terminal.print(\n `Netscript weaken() execution time: ${convertTimeMsToTimeElapsedString(\n calculateWeakenTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n },\n },\n {\n key: \"AutoLink\",\n name: \"AutoLink.exe\",\n create: {\n level: 25,\n tooltip: \"This program allows you to directly connect to other servers through the 'scan-analyze' command\",\n req: requireHackingLevel(25),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'.\");\n terminal.print(\"When using scan-analyze, click on a server's hostname to connect to it.\");\n },\n },\n {\n key: \"Formulas\",\n name: \"Formulas.exe\",\n create: {\n level: 1000,\n tooltip: \"This program allows you to use the formulas API\",\n req: requireHackingLevel(1000),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"Formulas.exe lets you use the formulas API.\");\n },\n },\n {\n key: \"BitFlume\",\n name: \"b1t_flum3.exe\",\n create: {\n level: 1,\n tooltip: \"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)\",\n req: bitFlumeRequirements(),\n time: CONSTANTS.MillisecondsPerFiveMinutes / 20,\n },\n run: (): void => {\n BitFlumeEvent.emit();\n },\n },\n {\n key: \"Flight\",\n name: \"fl1ght.exe\",\n create: null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer): void => {\n const numAugReq = BitNodeMultipliers.DaedalusAugsRequirement;\n const fulfilled =\n player.augmentations.length >= numAugReq && player.money > 1e11 && player.skills.hacking >= 2500;\n if (!fulfilled) {\n terminal.print(`Augmentations: ${player.augmentations.length} / ${numAugReq}`);\n terminal.print(`Money: ${numeralWrapper.formatMoney(player.money)} / $100b`);\n terminal.print(`Hacking skill: ${player.skills.hacking} / 2500`);\n return;\n }\n\n terminal.print(\"We will contact you.\");\n terminal.print(`-- ${FactionNames.Daedalus} --`);\n },\n },\n];\n","/**\n * Checks whether a IP Address string is valid.\n * @param ipaddress A string representing a potential IP Address\n */\nexport function isValidIPAddress(ipaddress: string): boolean {\n const byteRange = \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\";\n const regexStr = `^${byteRange}\\.${byteRange}\\.${byteRange}\\.${byteRange}$`;\n const ipAddressRegex = new RegExp(regexStr);\n\n return ipAddressRegex.test(ipaddress);\n}\n","// Interface that defines a generic object used to track experience/money\n// earnings for tasks\nexport interface ITaskTracker {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n int: number;\n money: number;\n}\n\nexport function createTaskTracker(): ITaskTracker {\n return {\n hack: 0,\n str: 0,\n def: 0,\n dex: 0,\n agi: 0,\n cha: 0,\n int: 0,\n money: 0,\n };\n}\n","/**\n * Returns a MM/DD HH:MM timestamp for the current time\n */\nexport function getTimestamp(): string {\n const d: Date = new Date();\n // A negative slice value takes from the end of the string rather than the beginning.\n const stringWidth = -2;\n const formattedHours: string = `0${d.getHours()}`.slice(stringWidth);\n const formattedMinutes: string = `0${d.getMinutes()}`.slice(stringWidth);\n const formattedSeconds: string = `0${d.getSeconds()}`.slice(stringWidth);\n\n return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}:${formattedSeconds}`;\n}\n","export function CalculateShareMult(power: number): number {\n const x = 1 + Math.log(power) / 25;\n if (isNaN(x) || !isFinite(x)) return 1;\n return x;\n}\n","import * as posNames from \"./companypositionnames\";\nimport { IConstructorParams } from \"../Company\";\n\nimport { IMap } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\n// Create Objects containing Company Positions by category\n// Will help in metadata construction later\nconst AllSoftwarePositions: IMap = {};\nconst AllITPositions: IMap = {};\nconst AllNetworkEngineerPositions: IMap = {};\nconst SecurityEngineerPositions: IMap = {};\nconst AllTechnologyPositions: IMap = {};\nconst AllBusinessPositions: IMap = {};\nconst AllAgentPositions: IMap = {};\nconst AllSecurityPositions: IMap = {};\nconst AllSoftwareConsultantPositions: IMap = {};\nconst AllBusinessConsultantPositions: IMap = {};\nconst SoftwarePositionsUpToHeadOfEngineering: IMap = {};\nconst SoftwarePositionsUpToLeadDeveloper: IMap = {};\nconst BusinessPositionsUpToOperationsManager: IMap = {};\nconst WaiterOnly: IMap = {};\nconst EmployeeOnly: IMap = {};\nconst PartTimeWaiterOnly: IMap = {};\nconst PartTimeEmployeeOnly: IMap = {};\nconst OperationsManagerOnly: IMap = {};\nconst CEOOnly: IMap = {};\n\nposNames.SoftwareCompanyPositions.forEach((e) => {\n AllSoftwarePositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.ITCompanyPositions.forEach((e) => {\n AllITPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.NetworkEngineerCompanyPositions.forEach((e) => {\n AllNetworkEngineerPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nAllTechnologyPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\nSecurityEngineerPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\n\nposNames.BusinessCompanyPositions.forEach((e) => {\n AllBusinessPositions[e] = true;\n});\n\nposNames.SecurityCompanyPositions.forEach((e) => {\n AllSecurityPositions[e] = true;\n});\n\nposNames.AgentCompanyPositions.forEach((e) => {\n AllAgentPositions[e] = true;\n});\n\nposNames.SoftwareConsultantCompanyPositions.forEach((e) => {\n AllSoftwareConsultantPositions[e] = true;\n});\n\nposNames.BusinessConsultantCompanyPositions.forEach((e) => {\n AllBusinessConsultantPositions[e] = true;\n});\n\nfor (let i = 0; i < posNames.SoftwareCompanyPositions.length; ++i) {\n const e = posNames.SoftwareCompanyPositions[i];\n if (i <= 5) {\n SoftwarePositionsUpToHeadOfEngineering[e] = true;\n }\n if (i <= 3) {\n SoftwarePositionsUpToLeadDeveloper[e] = true;\n }\n}\nfor (let i = 0; i < posNames.BusinessCompanyPositions.length; ++i) {\n const e = posNames.BusinessCompanyPositions[i];\n if (i <= 3) {\n BusinessPositionsUpToOperationsManager[e] = true;\n }\n}\n\nWaiterOnly[posNames.MiscCompanyPositions[0]] = true;\nEmployeeOnly[posNames.MiscCompanyPositions[1]] = true;\nPartTimeWaiterOnly[posNames.PartTimeCompanyPositions[0]] = true;\nPartTimeEmployeeOnly[posNames.PartTimeCompanyPositions[1]] = true;\nOperationsManagerOnly[posNames.BusinessCompanyPositions[3]] = true;\nCEOOnly[posNames.BusinessCompanyPositions[5]] = true;\n\n// Metadata\nexport const companiesMetadata: IConstructorParams[] = [\n {\n name: LocationName.AevumECorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.Sector12MegaCorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumBachmanAndAssociates,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.6,\n salaryMultiplier: 2.6,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12BladeIndustries,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenNWO,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumClarkeIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenOmniTekIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12FourSigma,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.5,\n salaryMultiplier: 2.5,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.ChongqingKuaiGongInternational,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.2,\n salaryMultiplier: 2.2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.AevumFulcrumTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaStormTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllSoftwareConsultantPositions, AllBusinessPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoDefComm,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenHeliosLabs,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoVitaLife,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12IcarusMicrosystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12UniversalEnergy,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumGalacticCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumAeroCorp,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenOmniaCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.ChongqingSolarisSpaceSystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12DeltaOne,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.6,\n salaryMultiplier: 1.6,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaNovaMedical,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12CIA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.Sector12NSA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.AevumWatchdogSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenLexoCorp,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllBusinessPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.4,\n salaryMultiplier: 1.4,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumRhoConstruction,\n info: \"\",\n companyPositions: Object.assign({}, SoftwarePositionsUpToLeadDeveloper, BusinessPositionsUpToOperationsManager),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.Sector12AlphaEnterprises,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToLeadDeveloper,\n BusinessPositionsUpToOperationsManager,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumPolice,\n info: \"\",\n companyPositions: Object.assign({}, AllSecurityPositions, SoftwarePositionsUpToLeadDeveloper),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.VolhavenSysCoreSecurities,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenCompuTek,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.AevumNetLinkTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.Sector12CarmichaelSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllAgentPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.Sector12FoodNStuff,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.Sector12JoesGuns,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.IshimaOmegaSoftware,\n info: \"\",\n companyPositions: Object.assign({}, AllSoftwarePositions, AllSoftwareConsultantPositions, AllITPositions),\n expMultiplier: 1.1,\n salaryMultiplier: 1.1,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.NewTokyoNoodleBar,\n info: \"\",\n companyPositions: Object.assign({}, WaiterOnly, PartTimeWaiterOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n];\n","export interface IConstructorParams {\n name: string;\n cost: number;\n desc: string;\n advertisingMult?: number;\n employeeChaMult?: number;\n employeeCreMult?: number;\n employeeEffMult?: number;\n employeeIntMult?: number;\n productionMult?: number;\n productProductionMult?: number;\n salesMult?: number;\n sciResearchMult?: number;\n storageMult?: number;\n}\n\nexport class Research {\n // Name of research. This will be used to identify researches in the Research Tree\n name = \"\";\n\n // How much scientific research it costs to unlock this\n cost = 0;\n\n // Description of what the Research does\n desc = \"\";\n\n // All possible generic upgrades for the company, in the form of multipliers\n advertisingMult = 1;\n employeeChaMult = 1;\n employeeCreMult = 1;\n employeeEffMult = 1;\n employeeIntMult = 1;\n productionMult = 1;\n productProductionMult = 1;\n salesMult = 1;\n sciResearchMult = 1;\n storageMult = 1;\n\n constructor(p: IConstructorParams = { name: \"\", cost: 0, desc: \"\" }) {\n this.name = p.name;\n this.cost = p.cost;\n this.desc = p.desc;\n if (p.advertisingMult) {\n this.advertisingMult = p.advertisingMult;\n }\n if (p.employeeChaMult) {\n this.employeeChaMult = p.employeeChaMult;\n }\n if (p.employeeCreMult) {\n this.employeeCreMult = p.employeeCreMult;\n }\n if (p.employeeEffMult) {\n this.employeeEffMult = p.employeeEffMult;\n }\n if (p.employeeIntMult) {\n this.employeeIntMult = p.employeeIntMult;\n }\n if (p.productionMult) {\n this.productionMult = p.productionMult;\n }\n if (p.productProductionMult) {\n this.productProductionMult = p.productProductionMult;\n }\n if (p.salesMult) {\n this.salesMult = p.salesMult;\n }\n if (p.sciResearchMult) {\n this.sciResearchMult = p.sciResearchMult;\n }\n if (p.storageMult) {\n this.storageMult = p.storageMult;\n }\n }\n}\n","import { IConstructorParams } from \"../Research\";\n\nexport const researchMetadata: IConstructorParams[] = [\n {\n name: \"AutoBrew\",\n cost: 12e3,\n desc:\n \"Automatically keep your employees fully caffeinated with \" +\n \"coffee injections. This research will keep the energy of all \" +\n \"employees at its maximum possible value, for no cost. \" +\n \"This will also disable the Coffee upgrade.\",\n },\n {\n name: \"AutoPartyManager\",\n cost: 15e3,\n desc:\n \"Automatically analyzes your employees' happiness and morale \" +\n \"and boosts them whenever it detects a decrease. This research will \" +\n \"keep the morale and happiness of all employees at their maximum possible \" +\n \"values, for no cost. \" +\n \"This will also disable the 'Throw Party' feature.\",\n },\n {\n name: \"Automatic Drug Administration\",\n cost: 10e3,\n desc:\n \"Research how to automatically administer performance-enhacing drugs to all of \" +\n \"your employees. This unlocks Drug-related Research.\",\n },\n {\n name: \"Bulk Purchasing\",\n cost: 5e3,\n desc:\n \"Research the art of buying materials in bulk. This allows you to purchase \" +\n \"any amount of a material instantly.\",\n },\n {\n name: \"CPH4 Injections\",\n cost: 25e3,\n desc:\n \"Develop an advanced and harmless synthetic drug that is administered to \" +\n \"employees to increase all of their stats, except experience, by 10%.\",\n employeeCreMult: 1.1,\n employeeChaMult: 1.1,\n employeeEffMult: 1.1,\n employeeIntMult: 1.1,\n },\n {\n name: \"Drones\",\n cost: 5e3,\n desc:\n \"Acquire the knowledge needed to create advanced drones. This research does nothing \" +\n \"by itself, but unlocks other Drone-related research.\",\n },\n {\n name: \"Drones - Assembly\",\n cost: 25e3,\n desc:\n \"Manufacture and use Assembly Drones to improve the efficiency of \" +\n \"your production lines. This increases all production by 20%.\",\n productionMult: 1.2,\n },\n {\n name: \"Drones - Transport\",\n cost: 30e3,\n desc:\n \"Manufacture and use intelligent Transport Drones to optimize \" +\n \"your warehouses. This increases the storage space of all warehouses \" +\n \"by 50%.\",\n storageMult: 1.5,\n },\n {\n name: \"Go-Juice\",\n cost: 25e3,\n desc:\n \"Provide employees with Go-Juice, a coffee-derivative that further enhances \" +\n \"the brain's dopamine production. This increases the maximum energy of all \" +\n \"employees by 10.\",\n },\n {\n name: \"Hi-Tech R&D Laboratory\",\n cost: 5e3,\n desc:\n \"Construct a cutting edge facility dedicated to advanced research and \" +\n \"and development. This allows you to spend Scientific Research \" +\n \"on powerful upgrades. It also globally increases Scientific Research \" +\n \"production by 10%.\",\n sciResearchMult: 1.1,\n },\n {\n name: \"HRBuddy-Recruitment\",\n cost: 15e3,\n desc:\n \"Use automated software to handle the hiring of employees. With this \" +\n \"research, each office will automatically hire one employee per \" +\n \"market cycle if there is available space.\",\n },\n {\n name: \"HRBuddy-Training\",\n cost: 20e3,\n desc:\n \"Use automated software to handle the training of employees. With this \" +\n \"research, each employee hired with HRBuddy-Recruitment will automatically \" +\n \"be assigned to 'Training', rather than being unassigned.\",\n },\n {\n name: \"JoyWire\",\n cost: 20e3,\n desc: \"A brain implant which is installed in employees, increasing their maximum happiness by 10.\",\n },\n {\n name: \"Market-TA.I\",\n cost: 20e3,\n desc:\n \"Develop advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know what price to sell your Materials/Products \" +\n \"at in order to avoid losing sales due to having too high of a mark-up. \" +\n \"It also lets you automatically use that sale price.\",\n },\n {\n name: \"Market-TA.II\",\n cost: 50e3,\n desc:\n \"Develop double-advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know how many sales of a Material/Product you lose or gain \" +\n \"from having too high or too low or a sale price. It also lets you automatically \" +\n \"set the sale price of your Materials/Products at the optimal price such that \" +\n \"the amount sold matches the amount produced.\",\n },\n {\n name: \"Overclock\",\n cost: 15e3,\n desc:\n \"Equip employees with a headset that uses transcranial direct current \" +\n \"stimulation (tDCS) to increase the speed of their neurotransmitters. \" +\n \"This research increases the intelligence and efficiency of all \" +\n \"employees by 25%.\",\n employeeEffMult: 1.25,\n employeeIntMult: 1.25,\n },\n {\n name: \"Self-Correcting Assemblers\",\n cost: 25e3,\n desc:\n \"Create assemblers that can be used for universal production. \" +\n \"These assemblers use deep learning to improve their efficiency \" +\n \"at their tasks. This research increases all production by 10%\",\n productionMult: 1.1,\n },\n {\n name: \"Sti.mu\",\n cost: 30e3,\n desc:\n \"Upgrade the tDCS headset to stimulate regions of the brain that \" +\n \"control confidence and enthusiasm. This research increases the max \" +\n \"morale of all employees by 10.\",\n },\n {\n name: \"sudo.Assist\",\n cost: 15e3,\n desc: \"Develop a virtual assistant AI to handle and manage administrative issues for your corporation.\",\n },\n {\n name: \"uPgrade: Capacity.I\",\n cost: 20e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 3 to 4).\",\n },\n {\n name: \"uPgrade: Capacity.II\",\n cost: 30e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 4 to 5).\",\n },\n {\n name: \"uPgrade: Dashboard\",\n cost: 5e3,\n desc:\n \"Improve the software used to manage the industry's production line \" +\n \"for its various products. This allows you to manage the production and \" +\n \"sale of a product before it's finished being designed.\",\n },\n {\n name: \"uPgrade: Fulcrum\",\n cost: 10e3,\n desc:\n \"Streamline the manufacturing of this industry's various products. \" +\n \"This research increases the production of your products by 5%\",\n productProductionMult: 1.05,\n },\n];\n","/**\n * Object representing an upgrade that can be purchased with hashes\n */\nexport interface IConstructorParams {\n cost?: number;\n costPerLevel: number;\n desc: string;\n hasTargetServer?: boolean;\n name: string;\n value: number;\n effectText?: (level: number) => JSX.Element | null;\n}\n\nexport class HashUpgrade {\n /**\n * If the upgrade has a flat cost (never increases), it goes here\n * Otherwise, this property should be undefined\n *\n * This property overrides the 'costPerLevel' property\n */\n cost?: number;\n\n /**\n * Base cost for this upgrade. Every time the upgrade is purchased,\n * its cost increases by this same amount (so its 1x, 2x, 3x, 4x, etc.)\n */\n costPerLevel = 0;\n\n /**\n * Description of what the upgrade does\n */\n desc = \"\";\n\n /**\n * Boolean indicating that this upgrade's effect affects a single server,\n * the \"target\" server\n */\n hasTargetServer = false;\n\n // Name of upgrade\n name = \"\";\n\n // Generic value used to indicate the potency/amount of this upgrade's effect\n // The meaning varies between different upgrades\n value = 0;\n\n constructor(p: IConstructorParams) {\n if (p.cost != null) {\n this.cost = p.cost;\n }\n if (p.effectText != null) {\n this.effectText = p.effectText;\n }\n\n this.costPerLevel = p.costPerLevel;\n this.desc = p.desc;\n this.hasTargetServer = p.hasTargetServer ? p.hasTargetServer : false;\n this.name = p.name;\n this.value = p.value;\n }\n\n // Functions that returns the UI element to display the effect of this upgrade.\n effectText: (level: number) => JSX.Element | null = () => null;\n\n getCost(currentLevel: number, count = 1): number {\n if (typeof this.cost === \"number\") {\n return this.cost * count;\n }\n\n //This formula is equivalent to\n //(currentLevel + 1) * this.costPerLevel\n //being performed repeatedly\n const collapsedSum = 0.5 * count * (count + 2 * currentLevel + 1);\n return this.costPerLevel * collapsedSum;\n }\n}\n","// Metadata used to construct all Hash Upgrades\nimport React from \"react\";\nimport { IConstructorParams } from \"../HashUpgrade\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nexport const HashUpgradesMetadata: IConstructorParams[] = [\n {\n cost: 4,\n costPerLevel: 4,\n desc: \"Sell hashes for $1m\",\n name: \"Sell for Money\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for \n \n ),\n value: 1e6,\n },\n {\n costPerLevel: 100,\n desc: \"Sell hashes for $1b in Corporation funds\",\n name: \"Sell for Corporation Funds\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for Corporation funds.\n \n ),\n value: 1e9,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to decrease the minimum security of a single server by 2%. \" +\n \"Note that a server's minimum security cannot go below 1. This effect persists \" +\n \"until you install Augmentations (since servers are reset at that time).\",\n hasTargetServer: true,\n name: \"Reduce Minimum Security\",\n value: 0.98,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to increase the maximum amount of money on a single server by 2%. \" +\n \"Note that a server's maximum money is soft capped above $10t. \" +\n \"This effect persists until you install Augmentations (since servers \" +\n \"are reset at that time).\",\n hasTargetServer: true,\n name: \"Increase Maximum Money\",\n value: 1.02,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when studying at a university by 20%. \" +\n \"This effect persists until you install Augmentations\",\n name: \"Improve Studying\",\n effectText: (level: number): JSX.Element | null => <>Improves studying by {level * 20}%,\n value: 20, // Improves studying by value%\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when training at the gym by 20%. This effect \" +\n \"persists until you install Augmentations\",\n name: \"Improve Gym Training\",\n effectText: (level: number): JSX.Element | null => <>Improves training by {level * 20}%,\n value: 20, // Improves training by value%\n },\n {\n costPerLevel: 200,\n desc: \"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries\",\n name: \"Exchange for Corporation Research\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {level}k Scientific Research in your industries.\n ),\n value: 1000,\n },\n {\n costPerLevel: 250,\n desc: \"Exchange hashes for 100 Bladeburner Rank\",\n name: \"Exchange for Bladeburner Rank\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(100 * level, \"0a\")} Bladeburner rank\n ),\n value: 100,\n },\n {\n costPerLevel: 250,\n desc: \"Exchanges hashes for 10 Bladeburner Skill Points\",\n name: \"Exchange for Bladeburner SP\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(10 * level, \"0a\")} Bladeburner Skill Points\n ),\n value: 10,\n },\n {\n costPerLevel: 200,\n desc: \"Generate a random Coding Contract somewhere on the network\",\n name: \"Generate Coding Contract\",\n effectText: (level: number): JSX.Element | null => <>Generated {level} contracts.,\n value: 1,\n },\n];\n","import { NS } from \"../ScriptEditor/NetscriptDefinitions\";\n\n/**\n * The environment in which a script runs. The environment holds\n * Netscript functions and arguments for that script.\n */\nexport class Environment {\n /**\n * Whether or not the script that uses this Environment should stop running\n */\n stopFlag = false;\n\n /**\n * The currently running function\n */\n\n runningFn = \"\";\n\n /**\n * Environment variables (currently only Netscript functions)\n */\n vars: NS | null = null;\n}\n","/**\n * Determines if the number is a power of 2\n * @param n The number to check.\n */\nexport function isPowerOfTwo(n: number): boolean {\n if (isNaN(n)) {\n return false;\n }\n\n if (n === 0) {\n return false;\n }\n\n // Disabiling the bitwise rule because it's honestly the most effecient way to check for this.\n // tslint:disable-next-line:no-bitwise\n return (n & (n - 1)) === 0;\n}\n","import { ITaskParams } from \"../ITaskParams\";\n/* tslint:disable:max-line-length */\n\n/**\n * Defines the parameters that can be used to initialize and describe a GangMemberTask\n * (defined in Gang.js)\n */\ninterface IGangMemberTaskMetadata {\n /**\n * Description of the task\n */\n desc: string;\n\n /**\n * Whether or not this task is meant for Combat-type gangs\n */\n isCombat: boolean;\n\n /**\n * Whether or not this task is for Hacking-type gangs\n */\n isHacking: boolean;\n\n /**\n * Name of the task\n */\n name: string;\n\n /**\n * An object containing weighting parameters for the task. These parameters are used for\n * various calculations (respect gain, wanted gain, etc.)\n */\n params: ITaskParams;\n}\n\n/**\n * Array of metadata for all Gang Member tasks. Used to construct the global GangMemberTask\n * objects in Gang.js\n */\nexport const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [\n {\n desc: \"This gang member is currently idle\",\n isCombat: true,\n isHacking: true,\n name: \"Unassigned\",\n params: { hackWeight: 100 }, // This is just to get by the weight check in the GangMemberTask constructor\n },\n {\n desc: \"Assign this gang member to create and distribute ransomware

Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ransomware\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.0001,\n baseMoney: 3,\n hackWeight: 100,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to attempt phishing scams and attacks

Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Phishing\",\n params: {\n baseRespect: 0.00008,\n baseWanted: 0.003,\n baseMoney: 7.5,\n hackWeight: 85,\n chaWeight: 15,\n difficulty: 3.5,\n },\n },\n {\n desc: \"Assign this gang member to attempt identity theft

Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Identity Theft\",\n params: {\n baseRespect: 0.0001,\n baseWanted: 0.075,\n baseMoney: 18,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 5,\n },\n },\n {\n desc: \"Assign this gang member to carry out DDoS attacks

Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"DDoS Attacks\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.2,\n hackWeight: 100,\n difficulty: 8,\n },\n },\n {\n desc: \"Assign this gang member to create and distribute malicious viruses

Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Plant Virus\",\n params: {\n baseRespect: 0.0006,\n baseWanted: 0.4,\n hackWeight: 100,\n difficulty: 12,\n },\n },\n {\n desc: \"Assign this gang member to commit financial fraud and digital counterfeiting

Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Fraud & Counterfeiting\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.3,\n baseMoney: 45,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to launder money

Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Money Laundering\",\n params: {\n baseRespect: 0.001,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 75,\n chaWeight: 25,\n difficulty: 25,\n },\n },\n {\n desc: \"Assign this gang member to commit acts of cyberterrorism

Greatly increases respect - Greatly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Cyberterrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 36,\n },\n },\n {\n desc: \"Assign this gang member to be an ethical hacker for corporations

Earns money - Lowers wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ethical Hacking\",\n params: {\n baseWanted: -0.001,\n baseMoney: 3,\n hackWeight: 90,\n chaWeight: 10,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to mug random people on the streets

Earns money - Slightly increases respect - Very slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Mug People\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.00005,\n baseMoney: 3.6,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 10,\n chaWeight: 15,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to sell drugs

Earns money - Slightly increases respect - Slightly increases wanted level - Scales slightly with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Deal Drugs\",\n params: {\n baseRespect: 0.00006,\n baseWanted: 0.002,\n baseMoney: 15,\n agiWeight: 20,\n dexWeight: 20,\n chaWeight: 60,\n difficulty: 3.5,\n territory: {\n money: 1.2,\n respect: 1,\n wanted: 1.15,\n },\n },\n },\n {\n desc: \"Assign this gang member to extort civilians in your territory

Earns money - Slightly increases respect - Increases wanted - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Strongarm Civilians\",\n params: {\n baseRespect: 0.00004,\n baseWanted: 0.02,\n baseMoney: 7.5,\n hackWeight: 10,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 20,\n agiWeight: 10,\n chaWeight: 10,\n difficulty: 5,\n territory: {\n money: 1.6,\n respect: 1.1,\n wanted: 1.5,\n },\n },\n },\n {\n desc: \"Assign this gang member to run cons

Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Run a Con\",\n params: {\n baseRespect: 0.00012,\n baseWanted: 0.05,\n baseMoney: 45,\n strWeight: 5,\n defWeight: 5,\n agiWeight: 25,\n dexWeight: 25,\n chaWeight: 40,\n difficulty: 14,\n },\n },\n {\n desc: \"Assign this gang member to commit armed robbery on stores, banks and armored cars

Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Armed Robbery\",\n params: {\n baseRespect: 0.00014,\n baseWanted: 0.1,\n baseMoney: 114,\n hackWeight: 20,\n strWeight: 15,\n defWeight: 15,\n agiWeight: 10,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to traffick illegal arms

Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Traffick Illegal Arms\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.24,\n baseMoney: 174,\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 25,\n difficulty: 32,\n territory: {\n money: 1.4,\n respect: 1.3,\n wanted: 1.25,\n },\n },\n },\n {\n desc: \"Assign this gang member to threaten and black mail high-profile targets

Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Threaten & Blackmail\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.125,\n baseMoney: 72,\n hackWeight: 25,\n strWeight: 25,\n dexWeight: 25,\n chaWeight: 25,\n difficulty: 28,\n },\n },\n {\n desc: \"Assign this gang member to engage in human trafficking operations

Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Human Trafficking\",\n params: {\n baseRespect: 0.004,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 30,\n strWeight: 5,\n defWeight: 5,\n dexWeight: 30,\n chaWeight: 30,\n difficulty: 36,\n territory: {\n money: 1.5,\n respect: 1.5,\n wanted: 1.6,\n },\n },\n },\n {\n desc: \"Assign this gang member to commit acts of terrorism

Greatly increases respect - Greatly increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Terrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 36,\n territory: {\n money: 1,\n respect: 2,\n wanted: 2,\n },\n },\n },\n {\n desc: \"Assign this gang member to be a vigilante and protect the city from criminals

Decreases wanted level\",\n isCombat: true,\n isHacking: true,\n name: \"Vigilante Justice\",\n params: {\n baseWanted: -0.001,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n difficulty: 1,\n territory: {\n money: 1,\n respect: 1,\n wanted: 0.9, // Gets harder with more territory\n },\n },\n },\n {\n desc: \"Assign this gang member to increase their combat stats (str, def, dex, agi)\",\n isCombat: true,\n isHacking: true,\n name: \"Train Combat\",\n params: {\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 25,\n difficulty: 100,\n },\n },\n {\n desc: \"Assign this gang member to train their hacking skills\",\n isCombat: true,\n isHacking: true,\n name: \"Train Hacking\",\n params: { hackWeight: 100, difficulty: 45 },\n },\n {\n desc: \"Assign this gang member to train their charisma\",\n isCombat: true,\n isHacking: true,\n name: \"Train Charisma\",\n params: { chaWeight: 100, difficulty: 8 },\n },\n {\n desc: \"Assign this gang member to engage in territorial warfare with other gangs. Members assigned to this task will help increase your gang's territory and will defend your territory from being taken.\",\n isCombat: true,\n isHacking: true,\n name: \"Territory Warfare\",\n params: {\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n chaWeight: 5,\n difficulty: 5,\n },\n },\n];\n","import { IMults, UpgradeType } from \"./data/upgrades\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nexport class GangMemberUpgrade {\n name: string;\n cost: number;\n type: UpgradeType;\n desc: string;\n mults: IMults;\n\n constructor(name = \"\", cost = 0, type: UpgradeType = UpgradeType.Weapon, mults: IMults = {}) {\n this.name = name;\n this.cost = cost;\n this.type = type;\n this.mults = mults;\n\n this.desc = this.createDescription();\n }\n\n createDescription(): string {\n const lines = [\"Effects:\"];\n if (this.mults.str != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.str - 1, 0)} strength skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.str - 1) / 4, 2)} strength exp`);\n }\n if (this.mults.def != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.def - 1, 0)} defense skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.def - 1) / 4, 2)} defense exp`);\n }\n if (this.mults.dex != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.dex - 1, 0)} dexterity skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.dex - 1) / 4, 2)} dexterity exp`);\n }\n if (this.mults.agi != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.agi - 1, 0)} agility skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.agi - 1) / 4, 2)} agility exp`);\n }\n if (this.mults.cha != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.cha - 1, 0)} charisma skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.cha - 1) / 4, 2)} charisma exp`);\n }\n if (this.mults.hack != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.hack - 1, 0)} hacking skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.hack - 1) / 4, 2)} hacking exp`);\n }\n return lines.join(\"
\");\n }\n\n // User friendly version of type.\n getType(): string {\n switch (this.type) {\n case UpgradeType.Weapon:\n return \"Weapon\";\n case UpgradeType.Armor:\n return \"Armor\";\n case UpgradeType.Vehicle:\n return \"Vehicle\";\n case UpgradeType.Rootkit:\n return \"Rootkit\";\n case UpgradeType.Augmentation:\n return \"Augmentation\";\n default:\n return \"\";\n }\n }\n}\n","/**\n * Initialization metadata for all Stocks. This is used to generate the\n * stock parameter values upon a reset\n *\n * Some notes:\n * - Megacorporations have better otlkMags\n * - Higher volatility -> Bigger spread\n * - Lower price -> Bigger spread\n * - Share tx required for movement used for balancing\n */\nimport { StockSymbols } from \"./StockSymbols\";\nimport { IConstructorParams } from \"../Stock\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nexport const InitStockMetadata: IConstructorParams[] = [\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 17e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.AevumECorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumECorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 34e3,\n min: 24e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.Sector12MegaCorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12MegaCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 12e3,\n },\n marketCap: 1.6e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12BladeIndustries,\n otlkMag: 13,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12BladeIndustries],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 10e3,\n },\n marketCap: 1.5e12,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.AevumClarkeIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumClarkeIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 43e3,\n min: 32e3,\n },\n marketCap: 1.8e12,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniTekIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 80e3,\n min: 50e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 110,\n min: 100,\n },\n name: LocationName.Sector12FourSigma,\n otlkMag: 17,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12FourSigma],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 16e3,\n },\n marketCap: 1.9e12,\n mv: {\n divisor: 100,\n max: 85,\n min: 75,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 7,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.ChongqingKuaiGongInternational],\n },\n\n {\n b: true,\n initPrice: {\n max: 36e3,\n min: 29e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 130,\n min: 120,\n },\n name: LocationName.AevumFulcrumTechnologies,\n otlkMag: 16,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumFulcrumTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 20e3,\n },\n marketCap: 1.2e12,\n mv: {\n divisor: 100,\n max: 90,\n min: 80,\n },\n name: LocationName.IshimaStormTechnologies,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.IshimaStormTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 19e3,\n min: 6e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.NewTokyoDefComm,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoDefComm],\n },\n\n {\n b: true,\n initPrice: {\n max: 18e3,\n min: 10e3,\n },\n marketCap: 825e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.VolhavenHeliosLabs,\n otlkMag: 9,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenHeliosLabs],\n },\n\n {\n b: true,\n initPrice: {\n max: 14e3,\n min: 8e3,\n },\n marketCap: 1e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.NewTokyoVitaLife,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoVitaLife],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 800e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n otlkMag: 7.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12IcarusMicrosystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 29e3,\n min: 16e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 60,\n min: 50,\n },\n name: LocationName.Sector12UniversalEnergy,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12UniversalEnergy],\n },\n\n {\n b: true,\n initPrice: {\n max: 17e3,\n min: 8e3,\n },\n marketCap: 640e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.AevumAeroCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.AevumAeroCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 15e3,\n min: 6e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n otlkMag: 4.5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniaCybersystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 14e3,\n },\n marketCap: 705e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n otlkMag: 8.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.ChongqingSolarisSpaceSystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 12e3,\n },\n marketCap: 695e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n otlkMag: 10.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoGlobalPharmaceuticals],\n },\n\n {\n b: true,\n initPrice: {\n max: 27e3,\n min: 15e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.IshimaNovaMedical,\n otlkMag: 5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.IshimaNovaMedical],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 450e9,\n mv: {\n divisor: 100,\n max: 260,\n min: 240,\n },\n name: LocationName.AevumWatchdogSecurity,\n otlkMag: 1.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 12e3,\n },\n symbol: StockSymbols[LocationName.AevumWatchdogSecurity],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 4.5e3,\n },\n marketCap: 300e9,\n mv: {\n divisor: 100,\n max: 135,\n min: 115,\n },\n name: LocationName.VolhavenLexoCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenLexoCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 7e3,\n min: 2e3,\n },\n marketCap: 180e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: LocationName.AevumRhoConstruction,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.AevumRhoConstruction],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 240e9,\n mv: {\n divisor: 100,\n max: 205,\n min: 175,\n },\n name: LocationName.Sector12AlphaEnterprises,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 16,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12AlphaEnterprises],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 3e3,\n },\n marketCap: 200e9,\n mv: {\n divisor: 100,\n max: 170,\n min: 150,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n otlkMag: 3,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.VolhavenSysCoreSecurities],\n },\n\n {\n b: true,\n initPrice: {\n max: 6e3,\n min: 1e3,\n },\n marketCap: 185e9,\n mv: {\n divisor: 100,\n max: 100,\n min: 80,\n },\n name: LocationName.VolhavenCompuTek,\n otlkMag: 4,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.VolhavenCompuTek],\n },\n\n {\n b: true,\n initPrice: {\n max: 5e3,\n min: 1e3,\n },\n marketCap: 58e9,\n mv: {\n divisor: 100,\n max: 400,\n min: 200,\n },\n name: LocationName.AevumNetLinkTechnologies,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 20,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 18e3,\n },\n symbol: StockSymbols[LocationName.AevumNetLinkTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 1e3,\n },\n marketCap: 60e9,\n mv: {\n divisor: 100,\n max: 110,\n min: 90,\n },\n name: LocationName.IshimaOmegaSoftware,\n otlkMag: 0.5,\n spreadPerc: {\n divisor: 10,\n max: 13,\n min: 4,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.IshimaOmegaSoftware],\n },\n\n {\n b: false,\n initPrice: {\n max: 4.5e3,\n min: 500,\n },\n marketCap: 45e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12FoodNStuff,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 6,\n },\n shareTxForMovement: {\n max: 180e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.Sector12FoodNStuff],\n },\n\n {\n b: true,\n initPrice: {\n max: 3.5e3,\n min: 1.5e3,\n },\n marketCap: 30e9,\n mv: {\n divisor: 100,\n max: 275,\n min: 100,\n },\n name: \"Sigma Cosmetics\",\n otlkMag: 0,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 70e3,\n min: 20e3,\n },\n symbol: StockSymbols[\"Sigma Cosmetics\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 42e9,\n mv: {\n divisor: 100,\n max: 350,\n min: 200,\n },\n name: LocationName.Sector12JoesGuns,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 52e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.Sector12JoesGuns],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 100e9,\n mv: {\n divisor: 100,\n max: 175,\n min: 120,\n },\n name: \"Catalyst Ventures\",\n otlkMag: 13.5,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 5,\n },\n shareTxForMovement: {\n max: 72e3,\n min: 24e3,\n },\n symbol: StockSymbols[\"Catalyst Ventures\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 15e3,\n },\n marketCap: 360e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: \"Microdyne Technologies\",\n otlkMag: 8,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Microdyne Technologies\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 420e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: \"Titan Laboratories\",\n otlkMag: 11,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Titan Laboratories\"],\n },\n];\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { GangConstants } from \"../Gang/data/Constants\";\nimport { Player as player } from \"../Player\";\nimport { Gang } from \"../Gang/Gang\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangMemberTasks } from \"../Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"../Gang/GangMemberUpgrades\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nimport {\n Gang as IGang,\n GangGenInfo,\n GangOtherInfo,\n GangMemberInfo,\n GangMemberAscension,\n EquipmentStats,\n GangTaskStats,\n GangOtherInfoObject,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptGang(): InternalAPI {\n const checkGangApiAccess = function (ctx: NetscriptContext): void {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n const hasAccess = gang instanceof Gang;\n if (!hasAccess) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You do not currently have a Gang`);\n }\n };\n\n const getGangMember = function (ctx: NetscriptContext, name: string): GangMember {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n for (const member of gang.members) if (member.name === name) return member;\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid gang member: '${name}'`);\n };\n\n const getGangTask = function (ctx: NetscriptContext, name: string): GangMemberTask {\n const task = GangMemberTasks[name];\n if (!task) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang:\n (ctx: NetscriptContext) =>\n (_faction: unknown): boolean => {\n const faction = helpers.string(ctx, \"faction\", _faction);\n // this list is copied from Faction/ui/Root.tsx\n\n if (!player.canAccessGang() || !GangConstants.Names.includes(faction)) return false;\n if (player.inGang()) return false;\n if (!player.factions.includes(faction)) return false;\n\n const isHacking = faction === FactionNames.NiteSec || faction === FactionNames.TheBlackHand;\n player.startGang(faction, isHacking);\n return true;\n },\n inGang: () => (): boolean => {\n return player.inGang();\n },\n getMemberNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.members.map((member) => member.name);\n },\n getGangInformation: (ctx: NetscriptContext) => (): GangGenInfo => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return {\n faction: gang.facName,\n isHacking: gang.isHackingGang,\n moneyGainRate: gang.moneyGainRate,\n power: gang.getPower(),\n respect: gang.respect,\n respectGainRate: gang.respectGainRate,\n territory: gang.getTerritory(),\n territoryClashChance: gang.territoryClashChance,\n territoryWarfareEngaged: gang.territoryWarfareEngaged,\n wantedLevel: gang.wanted,\n wantedLevelGainRate: gang.wantedGainRate,\n wantedPenalty: gang.getWantedPenalty(),\n };\n },\n getOtherGangInformation: (ctx: NetscriptContext) => (): GangOtherInfo => {\n checkGangApiAccess(ctx);\n const cpy: Record = {};\n for (const gang of Object.keys(AllGangs)) {\n cpy[gang] = Object.assign({}, AllGangs[gang]);\n }\n\n return cpy;\n },\n getMemberInformation:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberInfo => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n return {\n name: member.name,\n task: member.task,\n earnedRespect: member.earnedRespect,\n hack: member.hack,\n str: member.str,\n def: member.def,\n dex: member.dex,\n agi: member.agi,\n cha: member.cha,\n\n hack_exp: member.hack_exp,\n str_exp: member.str_exp,\n def_exp: member.def_exp,\n dex_exp: member.dex_exp,\n agi_exp: member.agi_exp,\n cha_exp: member.cha_exp,\n\n hack_mult: member.hack_mult,\n str_mult: member.str_mult,\n def_mult: member.def_mult,\n dex_mult: member.dex_mult,\n agi_mult: member.agi_mult,\n cha_mult: member.cha_mult,\n\n hack_asc_mult: member.calculateAscensionMult(member.hack_asc_points),\n str_asc_mult: member.calculateAscensionMult(member.str_asc_points),\n def_asc_mult: member.calculateAscensionMult(member.def_asc_points),\n dex_asc_mult: member.calculateAscensionMult(member.dex_asc_points),\n agi_asc_mult: member.calculateAscensionMult(member.agi_asc_points),\n cha_asc_mult: member.calculateAscensionMult(member.cha_asc_points),\n\n hack_asc_points: member.hack_asc_points,\n str_asc_points: member.str_asc_points,\n def_asc_points: member.def_asc_points,\n dex_asc_points: member.dex_asc_points,\n agi_asc_points: member.agi_asc_points,\n cha_asc_points: member.cha_asc_points,\n\n upgrades: member.upgrades.slice(),\n augmentations: member.augmentations.slice(),\n\n respectGain: member.calculateRespectGain(gang),\n wantedLevelGain: member.calculateWantedLevelGain(gang),\n moneyGain: member.calculateMoneyGain(gang),\n };\n },\n canRecruitMember: (ctx: NetscriptContext) => (): boolean => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.canRecruitMember();\n },\n recruitMember:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): boolean => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const recruited = gang.recruitMember(memberName);\n if (recruited) {\n ctx.workerScript.log(\"gang.recruitMember\", () => `Successfully recruited Gang Member '${memberName}'`);\n } else {\n ctx.workerScript.log(\"gang.recruitMember\", () => `Failed to recruit Gang Member '${memberName}'`);\n }\n\n return recruited;\n },\n getTaskNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const tasks = gang.getAllTaskNames();\n tasks.unshift(\"Unassigned\");\n return tasks;\n },\n setMemberTask:\n (ctx: NetscriptContext) =>\n (_memberName: unknown, _taskName: unknown): boolean => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const taskName = helpers.string(ctx, \"taskName\", _taskName);\n checkGangApiAccess(ctx);\n const member = getGangMember(ctx, memberName);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (!gang.getAllTaskNames().includes(taskName)) {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () =>\n `Failed to assign Gang Member '${memberName}' to Invalid task '${taskName}'. '${memberName}' is now Unassigned`,\n );\n return member.assignToTask(\"Unassigned\");\n }\n const success = member.assignToTask(taskName);\n if (success) {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () => `Successfully assigned Gang Member '${memberName}' to '${taskName}' task`,\n );\n } else {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () =>\n `Failed to assign Gang Member '${memberName}' to '${taskName}' task. '${memberName}' is now Unassigned`,\n );\n }\n\n return success;\n },\n getTaskStats:\n (ctx: NetscriptContext) =>\n (_taskName: unknown): GangTaskStats => {\n const taskName = helpers.string(ctx, \"taskName\", _taskName);\n checkGangApiAccess(ctx);\n const task = getGangTask(ctx, taskName);\n const copy = Object.assign({}, task);\n copy.territory = Object.assign({}, task.territory);\n return copy;\n },\n getEquipmentNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\n return Object.keys(GangMemberUpgrades);\n },\n getEquipmentCost:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): number => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const upg = GangMemberUpgrades[equipName];\n if (upg === null) return Infinity;\n return gang.getUpgradeCost(upg);\n },\n getEquipmentType:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): string => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const upg = GangMemberUpgrades[equipName];\n if (upg == null) return \"\";\n return upg.getType();\n },\n getEquipmentStats:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): EquipmentStats => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid equipment: ${equipName}`);\n }\n const typecheck: EquipmentStats = equipment.mults;\n return Object.assign({}, typecheck) as any;\n },\n purchaseEquipment:\n (ctx: NetscriptContext) =>\n (_memberName: unknown, _equipName: unknown): boolean => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) return false;\n const res = member.buyUpgrade(equipment, player, gang);\n if (res) {\n ctx.workerScript.log(\n \"gang.purchaseEquipment\",\n () => `Purchased '${equipName}' for Gang member '${memberName}'`,\n );\n } else {\n ctx.workerScript.log(\n \"gang.purchaseEquipment\",\n () => `Failed to purchase '${equipName}' for Gang member '${memberName}'`,\n );\n }\n\n return res;\n },\n ascendMember:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return gang.ascendMember(member, ctx.workerScript);\n },\n getAscensionResult:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return {\n respect: member.earnedRespect,\n ...member.getAscensionResults(),\n };\n },\n setTerritoryWarfare:\n (ctx: NetscriptContext) =>\n (_engage: unknown): void => {\n const engage = !!_engage;\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (engage) {\n gang.territoryWarfareEngaged = true;\n ctx.workerScript.log(\"gang.setTerritoryWarfare\", () => \"Engaging in Gang Territory Warfare\");\n } else {\n gang.territoryWarfareEngaged = false;\n ctx.workerScript.log(\"gang.setTerritoryWarfare\", () => \"Disengaging in Gang Territory Warfare\");\n }\n },\n getChanceToWinClash:\n (ctx: NetscriptContext) =>\n (_otherGang: unknown): number => {\n const otherGang = helpers.string(ctx, \"otherGang\", _otherGang);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (AllGangs[otherGang] == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid gang: ${otherGang}`);\n }\n\n const playerPower = AllGangs[gang.facName].power;\n const otherPower = AllGangs[otherGang].power;\n\n return playerPower / (otherPower + playerPower);\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return Math.round(gang.storedCycles / 5) * 1000;\n },\n };\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\nexport const PowerMultiplier: {\n [key: string]: number | undefined;\n} = {\n [FactionNames.SlumSnakes]: 1,\n [FactionNames.Tetrads]: 2,\n [FactionNames.TheSyndicate]: 2,\n [FactionNames.TheDarkArmy]: 2,\n [FactionNames.SpeakersForTheDead]: 5,\n [FactionNames.NiteSec]: 2,\n [FactionNames.TheBlackHand]: 5,\n};\n","import { Player as player } from \"../Player\";\nimport { findSleevePurchasableAugs } from \"../PersonObjects/Sleeve/SleeveHelpers\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\n\nimport {\n AugmentPair,\n Sleeve as ISleeve,\n SleeveInformation,\n SleeveSkills,\n SleeveTask,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { isSleeveBladeburnerWork } from \"../PersonObjects/Sleeve/Work/SleeveBladeburnerWork\";\nimport { isSleeveFactionWork } from \"../PersonObjects/Sleeve/Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../PersonObjects/Sleeve/Work/SleeveCompanyWork\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptSleeve(): InternalAPI {\n const checkSleeveAPIAccess = function (ctx: NetscriptContext): void {\n if (player.bitNodeN !== 10 && !player.sourceFileLvl(10)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10\",\n );\n }\n };\n\n const checkSleeveNumber = function (ctx: NetscriptContext, sleeveNumber: number): void {\n if (sleeveNumber >= player.sleeves.length || sleeveNumber < 0) {\n const msg = `Invalid sleeve number: ${sleeveNumber}`;\n helpers.log(ctx, () => msg);\n throw helpers.makeRuntimeErrorMsg(ctx, msg);\n }\n };\n\n const getSleeveStats = function (sleeveNumber: number): SleeveSkills {\n const sl = player.sleeves[sleeveNumber];\n return {\n shock: 100 - sl.shock,\n sync: sl.sync,\n memory: sl.memory,\n hacking: sl.skills.hacking,\n strength: sl.skills.strength,\n defense: sl.skills.defense,\n dexterity: sl.skills.dexterity,\n agility: sl.skills.agility,\n charisma: sl.skills.charisma,\n };\n };\n\n return {\n getNumSleeves: (ctx: NetscriptContext) => (): number => {\n checkSleeveAPIAccess(ctx);\n return player.sleeves.length;\n },\n setToShockRecovery:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].shockRecovery(player);\n },\n setToSynchronize:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].synchronize(player);\n },\n setToCommitCrime:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _crimeRoughName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const crimeRoughName = helpers.string(ctx, \"crimeName\", _crimeRoughName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n const crime = findCrime(crimeRoughName);\n if (crime === null) {\n return false;\n }\n return player.sleeves[sleeveNumber].commitCrime(player, crime.name);\n },\n setToUniversityCourse:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _universityName: unknown, _className: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const universityName = helpers.string(ctx, \"universityName\", _universityName);\n const className = helpers.string(ctx, \"className\", _className);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].takeUniversityCourse(player, universityName, className);\n },\n travel:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _cityName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n if (checkEnum(CityName, cityName)) {\n return player.sleeves[sleeveNumber].travel(player, cityName);\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid city name: '${cityName}'.`);\n }\n },\n setToCompanyWork:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, acompanyName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const companyName = helpers.string(ctx, \"companyName\", acompanyName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot work at the same company that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (isSleeveCompanyWork(other.currentWork) && other.currentWork.companyName === companyName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for company ${companyName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n return player.sleeves[sleeveNumber].workForCompany(player, companyName);\n },\n setToFactionWork:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _factionName: unknown, _workType: unknown): boolean | undefined => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const factionName = helpers.string(ctx, \"factionName\", _factionName);\n const workType = helpers.string(ctx, \"workType\", _workType);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot work at the same faction that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (isSleeveFactionWork(other.currentWork) && other.currentWork.factionName === factionName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n if (player.gang && player.gang.facName == factionName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because you have started a gang with them.`,\n );\n }\n\n return player.sleeves[sleeveNumber].workForFaction(player, factionName, workType);\n },\n setToGymWorkout:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _gymName: unknown, _stat: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const gymName = helpers.string(ctx, \"gymName\", _gymName);\n const stat = helpers.string(ctx, \"stat\", _stat);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n return player.sleeves[sleeveNumber].workoutAtGym(player, gymName, stat);\n },\n getSleeveStats:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveSkills => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return getSleeveStats(sleeveNumber);\n },\n getTask:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveTask | null => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n if (sl.currentWork === null) return null;\n return sl.currentWork.APICopy();\n },\n getInformation:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveInformation => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n tor: false,\n city: sl.city,\n hp: sl.hp,\n jobs: Object.keys(player.jobs), // technically sleeves have the same jobs as the player.\n jobTitle: Object.values(player.jobs),\n\n mult: {\n agility: sl.mults.agility,\n agilityExp: sl.mults.agility_exp,\n charisma: sl.mults.charisma,\n charismaExp: sl.mults.charisma_exp,\n companyRep: sl.mults.company_rep,\n crimeMoney: sl.mults.crime_money,\n crimeSuccess: sl.mults.crime_success,\n defense: sl.mults.defense,\n defenseExp: sl.mults.defense_exp,\n dexterity: sl.mults.dexterity,\n dexterityExp: sl.mults.dexterity_exp,\n factionRep: sl.mults.faction_rep,\n hacking: sl.mults.hacking,\n hackingExp: sl.mults.hacking_exp,\n strength: sl.mults.strength,\n strengthExp: sl.mults.strength_exp,\n workMoney: sl.mults.work_money,\n },\n };\n },\n getSleeveAugmentations:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): string[] => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const augs = [];\n for (let i = 0; i < player.sleeves[sleeveNumber].augmentations.length; i++) {\n augs.push(player.sleeves[sleeveNumber].augmentations[i].name);\n }\n return augs;\n },\n getSleevePurchasableAugs:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): AugmentPair[] => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const purchasableAugs = findSleevePurchasableAugs(player.sleeves[sleeveNumber], player);\n const augs = [];\n for (let i = 0; i < purchasableAugs.length; i++) {\n const aug = purchasableAugs[i];\n augs.push({\n name: aug.name,\n cost: aug.baseCost,\n });\n }\n\n return augs;\n },\n purchaseSleeveAug:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _augName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n if (getSleeveStats(sleeveNumber).shock > 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Sleeve shock too high: Sleeve ${sleeveNumber}`);\n }\n\n const aug = StaticAugmentations[augName];\n if (!aug) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n\n return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);\n },\n getSleeveAugmentationPrice:\n (ctx: NetscriptContext) =>\n (_augName: unknown): number => {\n checkSleeveAPIAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug: Augmentation = StaticAugmentations[augName];\n return aug.baseCost;\n },\n getSleeveAugmentationRepReq:\n (ctx: NetscriptContext) =>\n (_augName: unknown): number => {\n checkSleeveAPIAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug: Augmentation = StaticAugmentations[augName];\n return aug.getCost(player).repCost;\n },\n setToBladeburnerAction:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _action: unknown, _contract?: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const action = helpers.string(ctx, \"action\", _action);\n let contract: string;\n if (typeof _contract === \"undefined\") {\n contract = \"------\";\n } else {\n contract = helpers.string(ctx, \"contract\", _contract);\n }\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot Take on Contracts if another sleeve is performing that action\n if (action === \"Take on contracts\") {\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (isSleeveBladeburnerWork(other.currentWork) && other.currentWork.actionName === contract) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot take on contracts because Sleeve ${i} is already performing that action.`,\n );\n }\n }\n }\n\n return player.sleeves[sleeveNumber].bladeburner(player, action, contract);\n },\n };\n}\n","// Metadata used for constructing Company Positions\nimport { IConstructorParams } from \"../CompanyPosition\";\nimport * as posNames from \"./companypositionnames\";\n\nexport const companyPositionMetadata: IConstructorParams[] = [\n {\n name: posNames.SoftwareCompanyPositions[0], // Software Enginering Intern\n nextPosition: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n baseSalary: 33,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.05,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n baseSalary: 80,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.1,\n reqdHacking: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n baseSalary: 165,\n charismaEffectiveness: 20,\n charismaExpGain: 0.08,\n hackingEffectiveness: 80,\n hackingExpGain: 0.4,\n reqdCharisma: 51,\n reqdHacking: 251,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n nextPosition: posNames.SoftwareCompanyPositions[4], // Head of Software\n baseSalary: 500,\n charismaEffectiveness: 25,\n charismaExpGain: 0.1,\n hackingEffectiveness: 75,\n hackingExpGain: 0.8,\n reqdCharisma: 151,\n reqdHacking: 401,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.SoftwareCompanyPositions[4], // Head of Software\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 800,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 400e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n nextPosition: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n baseSalary: 1650,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1.1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n nextPosition: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n baseSalary: 2310,\n charismaEffectiveness: 30,\n charismaExpGain: 0.6,\n hackingEffectiveness: 70,\n hackingExpGain: 1.2,\n reqdCharisma: 401,\n reqdHacking: 601,\n reqdReputation: 1.6e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n nextPosition: null,\n baseSalary: 2640,\n charismaEffectiveness: 35,\n charismaExpGain: 1,\n hackingEffectiveness: 65,\n hackingExpGain: 1.5,\n reqdCharisma: 501,\n reqdHacking: 751,\n reqdReputation: 3.2e6,\n repMultiplier: 2,\n },\n {\n name: posNames.ITCompanyPositions[0], // IT Intern\n nextPosition: posNames.ITCompanyPositions[1], // IT Analyst\n baseSalary: 26,\n charismaEffectiveness: 10,\n charismaExpGain: 0.01,\n hackingEffectiveness: 90,\n hackingExpGain: 0.04,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.ITCompanyPositions[1], // IT Analyst\n nextPosition: posNames.ITCompanyPositions[2], // IT Manager\n baseSalary: 66,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.08,\n reqdHacking: 26,\n reqdReputation: 7e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.ITCompanyPositions[2], // IT Manager\n nextPosition: posNames.ITCompanyPositions[3], // Systems Administrator\n baseSalary: 132,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.3,\n reqdCharisma: 51,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.ITCompanyPositions[3], // Systems Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.2,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.SecurityEngineerCompanyPositions[0], // Security Engineer\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[0], // Network Engineer\n nextPosition: posNames.NetworkEngineerCompanyPositions[1], // Network Adminsitrator\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[1], // Network Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[0], // Business Intern\n nextPosition: posNames.BusinessCompanyPositions[1], // Business Analyst\n baseSalary: 46,\n charismaEffectiveness: 90,\n charismaExpGain: 0.08,\n hackingEffectiveness: 10,\n hackingExpGain: 0.01,\n reqdCharisma: 1,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.BusinessCompanyPositions[1], // Business Analyst\n nextPosition: posNames.BusinessCompanyPositions[2], // Business Manager\n baseSalary: 100,\n charismaEffectiveness: 85,\n charismaExpGain: 0.15,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 51,\n reqdHacking: 6,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.BusinessCompanyPositions[2], // Business Manager\n nextPosition: posNames.BusinessCompanyPositions[3], // Operations Manager\n baseSalary: 200,\n charismaEffectiveness: 85,\n charismaExpGain: 0.3,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 101,\n reqdHacking: 51,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[3], // Operations Manager\n nextPosition: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n baseSalary: 660,\n charismaEffectiveness: 85,\n charismaExpGain: 0.4,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 226,\n reqdHacking: 51,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n nextPosition: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n baseSalary: 1950,\n charismaEffectiveness: 90,\n charismaExpGain: 1,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 501,\n reqdHacking: 76,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n nextPosition: null,\n baseSalary: 3900,\n charismaEffectiveness: 90,\n charismaExpGain: 1.5,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 751,\n reqdHacking: 101,\n reqdReputation: 3.2e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SecurityCompanyPositions[0], // Police Officer\n nextPosition: posNames.SecurityCompanyPositions[1], // Police Chief\n baseSalary: 82,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.04,\n reqdHacking: 11,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[1], // Police Chief\n nextPosition: null,\n baseSalary: 460,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.1,\n reqdHacking: 101,\n reqdStrength: 301,\n reqdDefense: 301,\n reqdDexterity: 301,\n reqdAgility: 301,\n reqdCharisma: 151,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[2], // Security Guard\n nextPosition: posNames.SecurityCompanyPositions[3], // Security Officer\n baseSalary: 50,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.01,\n strengthExpGain: 0.04,\n defenseExpGain: 0.04,\n dexterityExpGain: 0.04,\n agilityExpGain: 0.04,\n charismaExpGain: 0.02,\n reqdStrength: 51,\n reqdDefense: 51,\n reqdDexterity: 51,\n reqdAgility: 51,\n reqdCharisma: 1,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[3], // Security Officer\n nextPosition: posNames.SecurityCompanyPositions[4], // Security Supervisor\n baseSalary: 195,\n hackingEffectiveness: 10,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 10,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.05,\n reqdHacking: 26,\n reqdStrength: 151,\n reqdDefense: 151,\n reqdDexterity: 151,\n reqdAgility: 151,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SecurityCompanyPositions[4], // Security Supervisor\n nextPosition: posNames.SecurityCompanyPositions[5], // Head of Security\n baseSalary: 660,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.02,\n strengthExpGain: 0.12,\n defenseExpGain: 0.12,\n dexterityExpGain: 0.12,\n agilityExpGain: 0.12,\n charismaExpGain: 0.1,\n reqdHacking: 26,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 101,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[5], // Head of Security\n nextPosition: null,\n baseSalary: 1320,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.05,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.15,\n reqdHacking: 51,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 151,\n reqdReputation: 144e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.AgentCompanyPositions[0], // Field Agent\n nextPosition: posNames.AgentCompanyPositions[1], // Secret Agent\n baseSalary: 330,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 20,\n hackingExpGain: 0.04,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.05,\n reqdHacking: 101,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 101,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.AgentCompanyPositions[1], // Secret Agent\n nextPosition: posNames.AgentCompanyPositions[2], // Special Operative\n baseSalary: 990,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.1,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.1,\n reqdHacking: 201,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 201,\n reqdReputation: 32e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.AgentCompanyPositions[2], // Special Operative\n nextPosition: null,\n baseSalary: 2000,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.15,\n strengthExpGain: 0.2,\n defenseExpGain: 0.2,\n dexterityExpGain: 0.2,\n agilityExpGain: 0.2,\n charismaExpGain: 0.15,\n reqdHacking: 251,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 251,\n reqdReputation: 162e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.MiscCompanyPositions[0], // Waiter\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.05,\n repMultiplier: 1,\n },\n {\n name: posNames.MiscCompanyPositions[1], // Employee\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[0], // Software Consultant\n nextPosition: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n baseSalary: 66,\n hackingEffectiveness: 80,\n charismaEffectiveness: 20,\n hackingExpGain: 0.08,\n charismaExpGain: 0.03,\n reqdHacking: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n nextPosition: null,\n baseSalary: 132,\n hackingEffectiveness: 75,\n charismaEffectiveness: 25,\n hackingExpGain: 0.25,\n charismaExpGain: 0.06,\n reqdHacking: 251,\n reqdCharisma: 51,\n repMultiplier: 1.2,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[0], // Business Consultant\n nextPosition: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n baseSalary: 66,\n hackingEffectiveness: 20,\n charismaEffectiveness: 80,\n hackingExpGain: 0.015,\n charismaExpGain: 0.15,\n reqdHacking: 6,\n reqdCharisma: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n nextPosition: null,\n baseSalary: 525,\n hackingEffectiveness: 15,\n charismaEffectiveness: 85,\n hackingExpGain: 0.015,\n charismaExpGain: 0.3,\n reqdHacking: 51,\n reqdCharisma: 226,\n repMultiplier: 1.2,\n },\n {\n name: posNames.PartTimeCompanyPositions[0], // Part-time waiter\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.PartTimeCompanyPositions[1], // Part-time employee\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.03,\n repMultiplier: 1,\n },\n];\n","import { Player as player } from \"../Player\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport * as bcrypt from \"bcryptjs\";\nimport { Apr1Events as devMenu } from \"../ui/Apr1\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport interface INetscriptExtra {\n heart: {\n break(): number;\n };\n openDevMenu(): void;\n exploit(): void;\n bypass(doc: Document): void;\n alterReality(): void;\n rainbow(guess: string): void;\n}\n\nexport function NetscriptExtra(): InternalAPI {\n return {\n heart: {\n // Easter egg function\n break: () => (): number => {\n return player.karma;\n },\n },\n openDevMenu: () => (): void => {\n devMenu.emit();\n },\n exploit: () => (): void => {\n player.giveExploit(Exploit.UndocumentedFunctionCall);\n },\n bypass:\n (ctx: NetscriptContext) =>\n (doc: unknown): void => {\n // reset both fields first\n type temporary = { completely_unused_field: unknown };\n const d = doc as temporary;\n d.completely_unused_field = undefined;\n const real_document = document as unknown as temporary;\n real_document.completely_unused_field = undefined;\n // set one to true and check that it affected the other.\n real_document.completely_unused_field = true;\n if (d.completely_unused_field && ctx.workerScript.ramUsage === 1.6) {\n player.giveExploit(Exploit.Bypass);\n }\n d.completely_unused_field = undefined;\n real_document.completely_unused_field = undefined;\n },\n alterReality: () => (): void => {\n // We need to trick webpack into not optimizing a variable that is guaranteed to be false (and doesn't use prototypes)\n let x = false;\n const recur = function (depth: number): void {\n if (depth === 0) return;\n x = !x;\n recur(depth - 1);\n };\n recur(2);\n console.warn(\"I am sure that this variable is false.\");\n if (x !== false) {\n console.warn(\"Reality has been altered!\");\n player.giveExploit(Exploit.RealityAlteration);\n }\n },\n rainbow:\n (ctx: NetscriptContext) =>\n (guess: unknown): boolean => {\n function tryGuess(): boolean {\n // eslint-disable-next-line no-sync\n const verified = bcrypt.compareSync(\n helpers.string(ctx, \"guess\", guess),\n \"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO\",\n );\n if (verified) {\n player.giveExploit(Exploit.INeedARainbow);\n return true;\n }\n return false;\n }\n return tryGuess();\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n purchaseHashUpgrade,\n updateHashManagerCapacity,\n} from \"../Hacknet/HacknetHelpers\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { HashUpgrades } from \"../Hacknet/HashUpgrades\";\nimport { HashUpgrade } from \"../Hacknet/HashUpgrade\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { Hacknet as IHacknet, NodeStats } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptHacknet(): InternalAPI {\n // Utility function to get Hacknet Node object\n const getHacknetNode = function (ctx: NetscriptContext, i: number): HacknetNode | HacknetServer {\n if (i < 0 || i >= player.hacknetNodes.length) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Index specified for Hacknet Node is out-of-bounds: \" + i);\n }\n\n if (hasHacknetServers(player)) {\n const hi = player.hacknetNodes[i];\n if (typeof hi !== \"string\") throw new Error(\"hacknet node was not a string\");\n const hserver = GetServer(hi);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"hacknet server was not actually hacknet server\");\n if (hserver == null) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Could not get Hacknet Server for index ${i}. This is probably a bug, please report to game dev`,\n );\n }\n\n return hserver;\n } else {\n const node = player.hacknetNodes[i];\n if (!(node instanceof HacknetNode)) throw new Error(\"hacknet node was not node.\");\n return node;\n }\n };\n\n return {\n numNodes: () => (): number => {\n return player.hacknetNodes.length;\n },\n maxNumNodes: () => (): number => {\n if (hasHacknetServers(player)) {\n return HacknetServerConstants.MaxServers;\n }\n return Infinity;\n },\n purchaseNode: () => (): number => {\n return purchaseHacknet(player);\n },\n getPurchaseNodeCost: () => (): number => {\n if (hasHacknetServers(player)) {\n return getCostOfNextHacknetServer(player);\n } else {\n return getCostOfNextHacknetNode(player);\n }\n },\n getNodeStats:\n (ctx: NetscriptContext) =>\n (_i: unknown): NodeStats => {\n const i = helpers.number(ctx, \"i\", _i);\n const node = getHacknetNode(ctx, i);\n const hasUpgraded = hasHacknetServers(player);\n const res: NodeStats = {\n name: node instanceof HacknetServer ? node.hostname : node.name,\n level: node.level,\n ram: node instanceof HacknetServer ? node.maxRam : node.ram,\n cores: node.cores,\n production: node instanceof HacknetServer ? node.hashRate : node.moneyGainRatePerSecond,\n timeOnline: node.onlineTimeSeconds,\n totalProduction: node instanceof HacknetServer ? node.totalHashesGenerated : node.totalMoneyGenerated,\n };\n\n if (hasUpgraded && node instanceof HacknetServer) {\n res.cache = node.cache;\n res.hashCapacity = node.hashCapacity;\n res.ramUsed = node.ramUsed;\n }\n\n return res;\n },\n upgradeLevel:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseLevelUpgrade(player, node, n);\n },\n upgradeRam:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseRamUpgrade(player, node, n);\n },\n upgradeCore:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseCoreUpgrade(player, node, n);\n },\n upgradeCache:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n if (!hasHacknetServers(player)) {\n return false;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n helpers.log(ctx, () => \"Can only be called on hacknet servers\");\n return false;\n }\n const res = purchaseCacheUpgrade(player, node, n);\n if (res) {\n updateHashManagerCapacity(player);\n }\n return res;\n },\n getLevelUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateLevelUpgradeCost(n, player.mults.hacknet_node_level_cost);\n },\n getRamUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateRamUpgradeCost(n, player.mults.hacknet_node_ram_cost);\n },\n getCoreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateCoreUpgradeCost(n, player.mults.hacknet_node_core_cost);\n },\n getCacheUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n helpers.log(ctx, () => \"Can only be called on hacknet servers\");\n return -1;\n }\n return node.calculateCacheUpgradeCost(n);\n },\n numHashes: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.hashes;\n },\n hashCapacity: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.capacity;\n },\n hashCost:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _count: unknown = 1): number => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const count = helpers.number(ctx, \"count\", _count);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName, count);\n },\n spendHashes:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _upgTarget: unknown = \"\", _count: unknown = 1): boolean => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const upgTarget = helpers.string(ctx, \"upgTarget\", _upgTarget);\n const count = helpers.number(ctx, \"count\", _count);\n if (!hasHacknetServers(player)) {\n return false;\n }\n return purchaseHashUpgrade(player, upgName, upgTarget, count);\n },\n getHashUpgrades: () => (): string[] => {\n if (!hasHacknetServers(player)) {\n return [];\n }\n return Object.values(HashUpgrades).map((upgrade: HashUpgrade) => upgrade.name);\n },\n getHashUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgName: unknown): number => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid Hash Upgrade: ${upgName}`);\n }\n return level;\n },\n getStudyMult: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 1;\n }\n return player.hashManager.getStudyMult();\n },\n getTrainingMult: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 1;\n }\n return player.hashManager.getTrainingMult();\n },\n };\n}\n","import { Player as player } from \"../Player\";\n\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { Fragments, FragmentById } from \"../CotMG/Fragment\";\nimport { FragmentType } from \"../CotMG/FragmentType\";\n\nimport {\n Fragment as IFragment,\n ActiveFragment as IActiveFragment,\n Stanek as IStanek,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { NetscriptContext, InternalAPI } from \"../Netscript/APIWrapper\";\nimport { applyAugmentation } from \"../Augmentation/AugmentationHelpers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { Factions } from \"../Faction/Factions\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptStanek(): InternalAPI {\n function checkStanekAPIAccess(ctx: NetscriptContext): void {\n if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Stanek's Gift is not installed\");\n }\n }\n\n return {\n giftWidth: (ctx: NetscriptContext) =>\n function (): number {\n checkStanekAPIAccess(ctx);\n return staneksGift.width();\n },\n giftHeight: (ctx: NetscriptContext) =>\n function (): number {\n checkStanekAPIAccess(ctx);\n return staneksGift.height();\n },\n chargeFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): Promise {\n //Get the fragment object using the given coordinates\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n const fragment = staneksGift.findFragment(rootX, rootY);\n //Check whether the selected fragment can ge charged\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `No fragment with root (${rootX}, ${rootY}).`);\n if (fragment.fragment().type == FragmentType.Booster) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `The fragment with root (${rootX}, ${rootY}) is a Booster Fragment and thus cannot be charged.`,\n );\n }\n //Charge the fragment\n const time = staneksGift.inBonus() ? 200 : 1000;\n return helpers.netscriptDelay(ctx, time).then(function () {\n staneksGift.charge(player, fragment, ctx.workerScript.scriptRef.threads);\n helpers.log(ctx, () => `Charged fragment with ${ctx.workerScript.scriptRef.threads} threads.`);\n return Promise.resolve();\n });\n },\n fragmentDefinitions: (ctx: NetscriptContext) =>\n function (): IFragment[] {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Returned ${Fragments.length} fragments`);\n return Fragments.map((f) => f.copy());\n },\n activeFragments: (ctx: NetscriptContext) =>\n function (): IActiveFragment[] {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Returned ${staneksGift.fragments.length} fragments`);\n return staneksGift.fragments.map((af) => {\n return { ...af.copy(), ...af.fragment().copy() };\n });\n },\n clearGift: (ctx: NetscriptContext) =>\n function (): void {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Cleared Stanek's Gift.`);\n staneksGift.clear();\n },\n canPlaceFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown, _rotation: unknown, _fragmentId: unknown): boolean {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n const rotation = helpers.number(ctx, \"rotation\", _rotation);\n const fragmentId = helpers.number(ctx, \"fragmentId\", _fragmentId);\n checkStanekAPIAccess(ctx);\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);\n const can = staneksGift.canPlace(rootX, rootY, rotation, fragment);\n return can;\n },\n placeFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown, _rotation: unknown, _fragmentId: unknown): boolean {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n const rotation = helpers.number(ctx, \"rotation\", _rotation);\n const fragmentId = helpers.number(ctx, \"fragmentId\", _fragmentId);\n checkStanekAPIAccess(ctx);\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);\n return staneksGift.place(rootX, rootY, rotation, fragment);\n },\n getFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): IActiveFragment | undefined {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n const fragment = staneksGift.findFragment(rootX, rootY);\n if (fragment !== undefined) return fragment.copy();\n return undefined;\n },\n removeFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): boolean {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n return staneksGift.delete(rootX, rootY);\n },\n acceptGift: (ctx: NetscriptContext) =>\n function (): boolean {\n //Check if the player is eligible to join the church\n if (\n player.canAccessCotMG() &&\n player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0 &&\n player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0\n ) {\n //Attempt to join CotMG\n joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);\n //Attempt to install the first Stanek aug\n if (\n !player.hasAugmentation(AugmentationNames.StaneksGift1) &&\n !player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n helpers.log(\n ctx,\n () => `'${FactionNames.ChurchOfTheMachineGod}' joined and '${AugmentationNames.StaneksGift1}' installed.`,\n );\n }\n }\n //Return true iff the player is in CotMG and has the first Stanek aug installed\n return (\n Factions[FactionNames.ChurchOfTheMachineGod].isMember &&\n player.hasAugmentation(AugmentationNames.StaneksGift1)\n );\n },\n };\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nexport function CalculateEffect(highestCharge: number, numCharge: number, power: number, boost: number): number {\n return (\n 1 +\n (Math.log(highestCharge + 1) / 60) *\n Math.pow((numCharge + 1) / 5, 0.07) *\n power *\n boost *\n BitNodeMultipliers.StaneksGiftPowerMultiplier\n );\n}\n","import { Player as player } from \"../Player\";\n\nimport {\n Infiltration as IInfiltration,\n InfiltrationLocation,\n PossibleInfiltrationLocation,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Location } from \"../Locations/Location\";\nimport { Locations } from \"../Locations/Locations\";\nimport { calculateDifficulty, calculateReward } from \"../Infiltration/formulas/game\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../Infiltration/formulas/victory\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Factions } from \"../Faction/Factions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptInfiltration(): InternalAPI {\n const getLocationsWithInfiltrations = Object.values(Locations).filter(\n (location: Location) => location.infiltrationData,\n );\n\n const calculateInfiltrationData = (ctx: NetscriptContext, locationName: string): InfiltrationLocation => {\n if (!checkEnum(LocationName, locationName)) throw new Error(`Location '${locationName}' does not exists.`);\n const location = Locations[locationName];\n if (location === undefined) throw helpers.makeRuntimeErrorMsg(ctx, `Location '${location}' does not exists.`);\n if (location.infiltrationData === undefined)\n throw helpers.makeRuntimeErrorMsg(ctx, `Location '${location}' does not provide infiltrations.`);\n const startingSecurityLevel = location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(player, startingSecurityLevel);\n const reward = calculateReward(player, startingSecurityLevel);\n const maxLevel = location.infiltrationData.maxClearanceLevel;\n return {\n location: JSON.parse(JSON.stringify(location)),\n reward: {\n tradeRep: calculateTradeInformationRepReward(player, reward, maxLevel, startingSecurityLevel),\n sellCash: calculateSellInformationCashReward(player, reward, maxLevel, startingSecurityLevel),\n SoARep: calculateInfiltratorsRepReward(player, Factions[FactionNames.ShadowsOfAnarchy], startingSecurityLevel),\n },\n difficulty: difficulty,\n };\n };\n return {\n getPossibleLocations: () => (): PossibleInfiltrationLocation[] => {\n return getLocationsWithInfiltrations.map((l) => ({\n city: l.city ?? \"\",\n name: String(l.name),\n }));\n },\n getInfiltration:\n (ctx: NetscriptContext) =>\n (_location: unknown): InfiltrationLocation => {\n const location = helpers.string(ctx, \"location\", _location);\n return calculateInfiltrationData(ctx, location);\n },\n };\n}\n","import {\n GameInfo,\n IStyleSettings,\n UserInterface as IUserInterface,\n UserInterfaceTheme,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Settings } from \"../Settings/Settings\";\nimport { ThemeEvents } from \"../Themes/ui/Theme\";\nimport { defaultTheme } from \"../Themes/Themes\";\nimport { defaultStyles } from \"../Themes/Styles\";\nimport { CONSTANTS } from \"../Constants\";\nimport { hash } from \"../hash/hash\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { Terminal } from \"../../src/Terminal\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptUserInterface(): InternalAPI {\n return {\n windowSize: () => (): [number, number] => {\n return [window.innerWidth, window.innerHeight];\n },\n getTheme: () => (): UserInterfaceTheme => {\n return { ...Settings.theme };\n },\n\n getStyles: () => (): IStyleSettings => {\n return { ...Settings.styles };\n },\n\n setTheme:\n (ctx: NetscriptContext) =>\n (newTheme: UserInterfaceTheme): void => {\n const hex = /^(#)((?:[A-Fa-f0-9]{2}){3,4}|(?:[A-Fa-f0-9]{3}))$/;\n const currentTheme = { ...Settings.theme };\n const errors: string[] = [];\n for (const key of Object.keys(newTheme)) {\n if (!currentTheme[key]) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else if (!hex.test(newTheme[key] ?? \"\")) {\n errors.push(`Invalid color \"${key}\": ${newTheme[key]}`);\n } else {\n currentTheme[key] = newTheme[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.theme, currentTheme);\n ThemeEvents.emit();\n helpers.log(ctx, () => `Successfully set theme`);\n } else {\n helpers.log(ctx, () => `Failed to set theme. Errors: ${errors.join(\", \")}`);\n }\n },\n\n setStyles:\n (ctx: NetscriptContext) =>\n (newStyles: IStyleSettings): void => {\n const currentStyles = { ...Settings.styles };\n const errors: string[] = [];\n for (const key of Object.keys(newStyles)) {\n if (!(currentStyles as any)[key]) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else {\n (currentStyles as any)[key] = (newStyles as any)[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.styles, currentStyles);\n ThemeEvents.emit();\n helpers.log(ctx, () => `Successfully set styles`);\n } else {\n helpers.log(ctx, () => `Failed to set styles. Errors: ${errors.join(\", \")}`);\n }\n },\n\n resetTheme: (ctx: NetscriptContext) => (): void => {\n Settings.theme = { ...defaultTheme };\n ThemeEvents.emit();\n helpers.log(ctx, () => `Reinitialized theme to default`);\n },\n\n resetStyles: (ctx: NetscriptContext) => (): void => {\n Settings.styles = { ...defaultStyles };\n ThemeEvents.emit();\n helpers.log(ctx, () => `Reinitialized styles to default`);\n },\n\n getGameInfo: () => (): GameInfo => {\n const version = CONSTANTS.VersionString;\n const commit = hash();\n const platform = navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1 ? \"Steam\" : \"Browser\";\n\n const gameInfo = {\n version,\n commit,\n platform,\n };\n\n return gameInfo;\n },\n\n clearTerminal: (ctx: NetscriptContext) => (): void => {\n helpers.log(ctx, () => `Clearing terminal`);\n Terminal.clear();\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { Bladeburner } from \"../Bladeburner/Bladeburner\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Bladeburner as INetscriptBladeburner, BladeburnerCurAction } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { IAction } from \"src/Bladeburner/IAction\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\nimport { BlackOperation } from \"../Bladeburner/BlackOperation\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptBladeburner(): InternalAPI {\n const checkBladeburnerAccess = function (ctx: NetscriptContext, skipjoined = false): void {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const apiAccess =\n player.bitNodeN === 7 ||\n player.sourceFiles.some((a) => {\n return a.n === 7;\n });\n if (!apiAccess) {\n const apiDenied = `You do not currently have access to the Bladeburner API. You must either be in BitNode-7 or have Source-File 7.`;\n throw helpers.makeRuntimeErrorMsg(ctx, apiDenied);\n }\n if (!skipjoined) {\n const bladeburnerAccess = bladeburner instanceof Bladeburner;\n if (!bladeburnerAccess) {\n const bladeburnerDenied = `You must be a member of the Bladeburner division to use this API.`;\n throw helpers.makeRuntimeErrorMsg(ctx, bladeburnerDenied);\n }\n }\n };\n\n const checkBladeburnerCity = function (ctx: NetscriptContext, city: string): void {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n if (!bladeburner.cities.hasOwnProperty(city)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid city: ${city}`);\n }\n };\n\n const getBladeburnerActionObject = function (ctx: NetscriptContext, type: string, name: string): IAction {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const actionId = bladeburner.getActionIdFromTypeAndName(type, name);\n if (!actionId) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid action type='${type}', name='${name}'`);\n }\n\n return actionObj;\n };\n\n return {\n getContractNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getContractNamesNetscriptFn();\n },\n getOperationNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getOperationNamesNetscriptFn();\n },\n getBlackOpNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getBlackOpNamesNetscriptFn();\n },\n getBlackOpRank:\n (ctx: NetscriptContext) =>\n (_blackOpName: unknown): number => {\n const blackOpName = helpers.string(ctx, \"blackOpName\", _blackOpName);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, \"blackops\", blackOpName);\n if (!(action instanceof BlackOperation)) throw new Error(\"action was not a black operation\");\n return action.reqdRank;\n },\n getGeneralActionNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getGeneralActionNamesNetscriptFn();\n },\n getSkillNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getSkillNamesNetscriptFn();\n },\n startAction:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): boolean => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.startActionNetscriptFn(player, type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n stopBladeburnerAction: (ctx: NetscriptContext) => (): void => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.resetAction();\n },\n getCurrentAction: (ctx: NetscriptContext) => (): BladeburnerCurAction => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n },\n getActionTime:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const time = bladeburner.getActionTimeNetscriptFn(player, type, name);\n if (typeof time === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n helpers.log(ctx, () => errorLogText);\n return -1;\n } else {\n return time;\n }\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionCurrentTime: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const timecomputed =\n Math.min(bladeburner.actionTimeCurrent + bladeburner.actionTimeOverflow, bladeburner.actionTimeToComplete) *\n 1000;\n return timecomputed;\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionEstimatedSuccessChance:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): [number, number] => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const chance = bladeburner.getActionEstimatedSuccessChanceNetscriptFn(player, type, name);\n if (typeof chance === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n helpers.log(ctx, () => errorLogText);\n return [-1, -1];\n } else {\n return chance;\n }\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionRepGain:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const level = helpers.number(ctx, \"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n let rewardMultiplier;\n if (level == null || isNaN(level)) {\n rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n } else {\n rewardMultiplier = Math.pow(action.rewardFac, level - 1);\n }\n\n return action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank;\n },\n getActionCountRemaining:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionCountRemainingNetscriptFn(type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionMaxLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.maxLevel;\n },\n getActionCurrentLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.level;\n },\n getActionAutolevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): boolean => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.autoLevel;\n },\n setActionAutolevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _autoLevel: unknown = true): void => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const autoLevel = !!_autoLevel;\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n action.autoLevel = autoLevel;\n },\n setActionLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown = 1): void => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const level = helpers.number(ctx, \"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n if (level < 1 || level > action.maxLevel) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Level must be between 1 and ${action.maxLevel}, is ${level}`);\n }\n action.level = level;\n },\n getRank: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.rank;\n },\n getSkillPoints: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.skillPoints;\n },\n getSkillLevel:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): number => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillLevelNetscriptFn(skillName, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getSkillUpgradeCost:\n (ctx: NetscriptContext) =>\n (_skillName: unknown, _count: unknown = 1): number => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n const count = helpers.number(ctx, \"count\", _count);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillUpgradeCostNetscriptFn(skillName, count, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n upgradeSkill:\n (ctx: NetscriptContext) =>\n (_skillName: unknown, _count: unknown = 1): boolean => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n const count = helpers.number(ctx, \"count\", _count);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.upgradeSkillNetscriptFn(skillName, count, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getTeamSizeNetscriptFn(type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n setTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _size: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const size = helpers.number(ctx, \"size\", _size);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.setTeamSizeNetscriptFn(type, name, size, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getCityEstimatedPopulation:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].popEst;\n },\n getCityCommunities:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].comms;\n },\n getCityChaos:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].chaos;\n },\n getCity: (ctx: NetscriptContext) => (): string => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.city;\n },\n switchCity:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): boolean => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n bladeburner.city = cityName;\n return true;\n },\n getStamina: (ctx: NetscriptContext) => (): [number, number] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return [bladeburner.stamina, bladeburner.maxStamina];\n },\n joinBladeburnerFaction: (ctx: NetscriptContext) => (): boolean => {\n checkBladeburnerAccess(ctx, true);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.joinBladeburnerFactionNetscriptFn(ctx.workerScript);\n },\n joinBladeburnerDivision: (ctx: NetscriptContext) => (): boolean => {\n if (player.bitNodeN === 7 || player.sourceFileLvl(7) > 0) {\n if (player.bitNodeN === 8) {\n return false;\n }\n if (player.bladeburner instanceof Bladeburner) {\n return true; // Already member\n } else if (\n player.skills.strength >= 100 &&\n player.skills.defense >= 100 &&\n player.skills.dexterity >= 100 &&\n player.skills.agility >= 100\n ) {\n player.bladeburner = new Bladeburner(player);\n helpers.log(ctx, () => \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n helpers.log(ctx, () => \"You do not meet the requirements for joining the Bladeburner division\");\n return false;\n }\n }\n return false;\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return Math.round(bladeburner.storedCycles / 5) * 1000;\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { CodingContract } from \"../CodingContracts\";\nimport { CodingAttemptOptions, CodingContract as ICodingContract } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptCodingContract(): InternalAPI {\n const getCodingContract = function (\n ctx: NetscriptContext,\n func: string,\n hostname: string,\n filename: string,\n ): CodingContract {\n const server = helpers.getServer(ctx, hostname);\n const contract = server.getContract(filename);\n if (contract == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Cannot find contract '${filename}' on server '${hostname}'`);\n }\n\n return contract;\n };\n\n return {\n attempt:\n (ctx: NetscriptContext) =>\n (\n answer: unknown,\n _filename: unknown,\n _hostname: unknown = ctx.workerScript.hostname,\n { returnReward }: CodingAttemptOptions = { returnReward: false },\n ): boolean | string => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"attempt\", hostname, filename);\n\n if (typeof answer !== \"number\" && typeof answer !== \"string\" && !Array.isArray(answer))\n throw new Error(\"The answer provided was not a number, string, or array\");\n\n // Convert answer to string.\n const answerStr = typeof answer === \"string\" ? answer : JSON.stringify(answer);\n const creward = contract.reward;\n if (creward === null) throw new Error(\"Somehow solved a contract that didn't have a reward\");\n\n const serv = helpers.getServer(ctx, hostname);\n if (contract.isSolution(answerStr)) {\n const reward = player.gainCodingContractReward(creward, contract.getDifficulty());\n helpers.log(ctx, () => `Successfully completed Coding Contract '${filename}'. Reward: ${reward}`);\n serv.removeContract(filename);\n return returnReward ? reward : true;\n } else {\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n helpers.log(ctx, () => `Coding Contract attempt '${filename}' failed. Contract is now self-destructing`);\n serv.removeContract(filename);\n } else {\n helpers.log(\n ctx,\n () =>\n `Coding Contract attempt '${filename}' failed. ${\n contract.getMaxNumTries() - contract.tries\n } attempts remaining.`,\n );\n }\n\n return returnReward ? \"\" : false;\n }\n },\n getContractType:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): string => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getContractType\", hostname, filename);\n return contract.getType();\n },\n getData:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): unknown => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getData\", hostname, filename);\n const data = contract.getData();\n if (Array.isArray(data)) {\n // For two dimensional arrays, we have to copy the internal arrays using\n // slice() as well. As of right now, no contract has arrays that have\n // more than two dimensions\n const copy = data.slice();\n for (let i = 0; i < copy.length; ++i) {\n if (data[i].constructor === Array) {\n copy[i] = data[i].slice();\n }\n }\n\n return copy;\n } else {\n return data;\n }\n },\n getDescription:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): string => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getDescription\", hostname, filename);\n return contract.getDescription();\n },\n getNumTriesRemaining:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): number => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getNumTriesRemaining\", hostname, filename);\n return contract.getMaxNumTries() - contract.tries;\n },\n };\n}\n","import { Player as player } from \"../Player\";\n\nimport { OfficeSpace } from \"../Corporation/OfficeSpace\";\nimport { Employee } from \"../Corporation/Employee\";\nimport { Product } from \"../Corporation/Product\";\nimport { Material } from \"../Corporation/Material\";\nimport { Warehouse } from \"../Corporation/Warehouse\";\nimport { IIndustry } from \"../Corporation/IIndustry\";\nimport { ICorporation } from \"../Corporation/ICorporation\";\n\nimport {\n Corporation as NSCorporation,\n CorporationInfo,\n Employee as NSEmployee,\n Product as NSProduct,\n Material as NSMaterial,\n Warehouse as NSWarehouse,\n Division as NSDivision,\n WarehouseAPI,\n OfficeAPI,\n InvestmentOffer,\n Office as NSOffice,\n} from \"../ScriptEditor/NetscriptDefinitions\";\n\nimport {\n NewIndustry,\n NewCity,\n UnlockUpgrade,\n LevelUpgrade,\n IssueDividends,\n SellMaterial,\n SellProduct,\n SetSmartSupply,\n BuyMaterial,\n AssignJob,\n AutoAssignJob,\n UpgradeOfficeSize,\n PurchaseWarehouse,\n UpgradeWarehouse,\n BuyCoffee,\n ThrowParty,\n HireAdVert,\n MakeProduct,\n Research,\n ExportMaterial,\n CancelExportMaterial,\n SetMaterialMarketTA1,\n SetMaterialMarketTA2,\n SetProductMarketTA1,\n SetProductMarketTA2,\n BulkPurchase,\n SellShares,\n BuyBackShares,\n SetSmartSupplyUseLeftovers,\n LimitMaterialProduction,\n LimitProductProduction,\n UpgradeWarehouseCost,\n} from \"../Corporation/Actions\";\nimport { CorporationUnlockUpgrades } from \"../Corporation/data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrades } from \"../Corporation/data/CorporationUpgrades\";\nimport { EmployeePositions } from \"../Corporation/EmployeePositions\";\nimport { Industry } from \"../Corporation/Industry\";\nimport { IndustryResearchTrees, IndustryStartingCosts } from \"../Corporation/IndustryData\";\nimport { CorporationConstants } from \"../Corporation/data/Constants\";\nimport { ResearchMap } from \"../Corporation/ResearchMap\";\nimport { Factions } from \"../Faction/Factions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptCorporation(): InternalAPI {\n function createCorporation(corporationName: string, selfFund = true): boolean {\n if (!player.canAccessCorporation() || player.hasCorporation()) return false;\n if (!corporationName) return false;\n if (player.bitNodeN !== 3 && !selfFund) throw new Error(\"cannot use seed funds outside of BitNode 3\");\n if (BitNodeMultipliers.CorporationSoftcap < 0.15)\n throw new Error(`You cannot create a corporation in Bitnode ${player.bitNodeN}`);\n\n if (selfFund) {\n if (!player.canAfford(150e9)) return false;\n\n player.startCorporation(corporationName);\n player.loseMoney(150e9, \"corporation\");\n } else {\n player.startCorporation(corporationName, 500e6);\n }\n return true;\n }\n\n function hasUnlockUpgrade(upgradeName: string): boolean {\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.unlockUpgrades[upgN] === 1;\n }\n\n function getUnlockUpgradeCost(upgradeName: string): number {\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n return upgrade.price;\n }\n\n function getUpgradeLevel(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.upgrades[upgN];\n }\n\n function getUpgradeLevelCost(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n const baseCost = upgrade.basePrice;\n const priceMult = upgrade.priceMult;\n const level = corporation.upgrades[upgN];\n return baseCost * Math.pow(priceMult, level);\n }\n\n function getExpandIndustryCost(industryName: string): number {\n const cost = IndustryStartingCosts[industryName];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industryName}'`);\n }\n return cost;\n }\n\n function getExpandCityCost(): number {\n return CorporationConstants.OfficeInitialCost;\n }\n\n function getInvestmentOffer(): InvestmentOffer {\n const corporation = getCorporation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\n return {\n funds: 0,\n shares: 0,\n round: corporation.fundingRound + 1, // Make more readable\n }; // Don't throw an error here, no reason to have a second function to check if you can get investment.\n const val = corporation.determineValuation();\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n return {\n funds: funding,\n shares: investShares,\n round: corporation.fundingRound + 1, // Make more readable\n };\n }\n\n function acceptInvestmentOffer(): boolean {\n const corporation = getCorporation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\n return false;\n const val = corporation.determineValuation();\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n return true;\n }\n\n function goPublic(numShares: number): boolean {\n const corporation = getCorporation();\n const initialSharePrice = corporation.determineValuation() / corporation.totalShares;\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares > corporation.numShares) throw new Error(\"You don't have that many shares to issue!\");\n corporation.public = true;\n corporation.sharePrice = initialSharePrice;\n corporation.issuedShares = numShares;\n corporation.numShares -= numShares;\n corporation.addFunds(numShares * initialSharePrice);\n return true;\n }\n\n function getResearchCost(division: IIndustry, researchName: string): number {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n return research.cost;\n }\n\n function hasResearched(division: IIndustry, researchName: string): boolean {\n return division.researched[researchName] === undefined ? false : (division.researched[researchName] as boolean);\n }\n\n function bribe(factionName: string, amountCash: number): boolean {\n if (!player.factions.includes(factionName)) throw new Error(\"Invalid faction name\");\n if (isNaN(amountCash) || amountCash < 0)\n throw new Error(\"Invalid value for amount field! Must be numeric, grater than 0.\");\n\n const corporation = getCorporation();\n if (corporation.funds < amountCash) return false;\n const faction = Factions[factionName];\n const info = faction.getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(factionName)) return false;\n\n const repGain = amountCash / CorporationConstants.BribeToRepRatio;\n faction.playerReputation += repGain;\n corporation.funds = corporation.funds - amountCash;\n\n return true;\n }\n\n function getCorporation(): ICorporation {\n const corporation = player.corporation;\n if (corporation === null) throw new Error(\"cannot be called without a corporation\");\n return corporation;\n }\n\n function getDivision(divisionName: string): IIndustry {\n const corporation = getCorporation();\n const division = corporation.divisions.find((div) => div.name === divisionName);\n if (division === undefined) throw new Error(`No division named '${divisionName}'`);\n return division;\n }\n\n function getOffice(divisionName: string, cityName: string): OfficeSpace {\n const division = getDivision(divisionName);\n if (!(cityName in division.offices)) throw new Error(`Invalid city name '${cityName}'`);\n const office = division.offices[cityName];\n if (office === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return office;\n }\n\n function getWarehouse(divisionName: string, cityName: string): Warehouse {\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n if (warehouse === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return warehouse;\n }\n\n function getMaterial(divisionName: string, cityName: string, materialName: string): Material {\n const warehouse = getWarehouse(divisionName, cityName);\n const matName = materialName.replace(/ /g, \"\");\n const material = warehouse.materials[matName];\n if (material === undefined) throw new Error(`Invalid material name: '${materialName}'`);\n return material;\n }\n\n function getProduct(divisionName: string, productName: string): Product {\n const division = getDivision(divisionName);\n const product = division.products[productName];\n if (product === undefined) throw new Error(`Invalid product name: '${productName}'`);\n return product;\n }\n\n function getEmployee(divisionName: string, cityName: string, employeeName: string): Employee {\n const office = getOffice(divisionName, cityName);\n const employee = office.employees.find((e) => e.name === employeeName);\n if (employee === undefined) throw new Error(`Invalid employee name: '${employeeName}'`);\n return employee;\n }\n\n function checkAccess(ctx: NetscriptContext, api?: number): void {\n if (player.corporation === null) throw helpers.makeRuntimeErrorMsg(ctx, \"Must own a corporation.\");\n if (!api) return;\n\n if (!player.corporation.unlockUpgrades[api])\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have access to this API.\");\n }\n\n function getSafeDivision(division: Industry): NSDivision {\n const cities: string[] = [];\n for (const office of Object.values(division.offices)) {\n if (office === 0) continue;\n cities.push(office.loc);\n }\n\n return {\n name: division.name,\n type: division.type,\n awareness: division.awareness,\n popularity: division.popularity,\n prodMult: division.prodMult,\n research: division.sciResearch.qty,\n lastCycleRevenue: division.lastCycleRevenue,\n lastCycleExpenses: division.lastCycleExpenses,\n thisCycleRevenue: division.thisCycleRevenue,\n thisCycleExpenses: division.thisCycleExpenses,\n upgrades: [0, division.numAdVerts],\n cities: cities,\n products: division.products === undefined ? [] : Object.keys(division.products),\n makesProducts: division.makesProducts,\n };\n }\n\n const warehouseAPI: InternalAPI = {\n getPurchaseWarehouseCost: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx, 7);\n return CorporationConstants.WarehouseInitialCost;\n },\n getUpgradeWarehouseCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _amt: unknown = 1): number => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amt = helpers.number(ctx, \"amount\", _amt);\n if (amt < 1) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must provide a positive number\");\n }\n const warehouse = getWarehouse(divisionName, cityName);\n return UpgradeWarehouseCost(warehouse, amt);\n },\n hasWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): boolean => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n return warehouse !== 0;\n },\n getWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): NSWarehouse => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const warehouse = getWarehouse(divisionName, cityName);\n return {\n level: warehouse.level,\n loc: warehouse.loc,\n size: warehouse.size,\n sizeUsed: warehouse.sizeUsed,\n smartSupplyEnabled: warehouse.smartSupplyEnabled,\n };\n },\n getMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown): NSMaterial => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const material = getMaterial(divisionName, cityName, materialName);\n const corporation = getCorporation();\n return {\n cost: material.bCost,\n sCost: material.sCost,\n name: material.name,\n qty: material.qty,\n qlt: material.qlt,\n dmd: corporation.unlockUpgrades[2] ? material.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,\n prod: material.prd,\n sell: material.sll,\n };\n },\n getProduct:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown): NSProduct => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const product = getProduct(divisionName, productName);\n const corporation = getCorporation();\n return {\n name: product.name,\n dmd: corporation.unlockUpgrades[2] ? product.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? product.cmp : undefined,\n rat: product.rat,\n properties: {\n qlt: product.qlt,\n per: product.per,\n dur: product.dur,\n rel: product.rel,\n aes: product.aes,\n fea: product.fea,\n },\n pCost: product.pCost,\n sCost: product.sCost,\n cityData: product.data,\n developmentProgress: product.prog,\n };\n },\n purchaseWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const corporation = getCorporation();\n PurchaseWarehouse(corporation, getDivision(divisionName), cityName);\n },\n upgradeWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _amt: unknown = 1): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amt = helpers.number(ctx, \"amount\", _amt);\n const corporation = getCorporation();\n if (amt < 1) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must provide a positive number\");\n }\n UpgradeWarehouse(corporation, getDivision(divisionName), getWarehouse(divisionName, cityName), amt);\n },\n sellMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown, _price: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n const price = helpers.string(ctx, \"price\", _price);\n const material = getMaterial(divisionName, cityName, materialName);\n SellMaterial(material, amt, price);\n },\n sellProduct:\n (ctx: NetscriptContext) =>\n (\n _divisionName: unknown,\n _cityName: unknown,\n _productName: unknown,\n _amt: unknown,\n _price: unknown,\n _all: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n const price = helpers.string(ctx, \"price\", _price);\n const all = !!_all;\n const product = getProduct(divisionName, productName);\n SellProduct(product, cityName, amt, price, all);\n },\n discontinueProduct:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n getDivision(divisionName).discontinueProduct(getProduct(divisionName, productName));\n },\n setSmartSupply:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _enabled: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const enabled = !!_enabled;\n const warehouse = getWarehouse(divisionName, cityName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not purchased the Smart Supply upgrade!`);\n SetSmartSupply(warehouse, enabled);\n },\n setSmartSupplyUseLeftovers:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _enabled: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const enabled = !!_enabled;\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not purchased the Smart Supply upgrade!`);\n SetSmartSupplyUseLeftovers(warehouse, material, enabled);\n },\n buyMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.number(ctx, \"amt\", _amt);\n if (amt < 0) throw new Error(\"Invalid value for amount field! Must be numeric and greater than 0\");\n const material = getMaterial(divisionName, cityName, materialName);\n BuyMaterial(material, amt);\n },\n bulkPurchase:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n if (!hasResearched(getDivision(divisionName), \"Bulk Purchasing\"))\n throw new Error(`You have not researched Bulk Purchasing in ${divisionName}`);\n const corporation = getCorporation();\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.number(ctx, \"amt\", _amt);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n BulkPurchase(corporation, warehouse, material, amt);\n },\n makeProduct:\n (ctx: NetscriptContext) =>\n (\n _divisionName: unknown,\n _cityName: unknown,\n _productName: unknown,\n _designInvest: unknown,\n _marketingInvest: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const designInvest = helpers.number(ctx, \"designInvest\", _designInvest);\n const marketingInvest = helpers.number(ctx, \"marketingInvest\", _marketingInvest);\n const corporation = getCorporation();\n MakeProduct(corporation, getDivision(divisionName), cityName, productName, designInvest, marketingInvest);\n },\n limitProductProduction:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _cityName: unknown, _qty: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const qty = helpers.number(ctx, \"qty\", _qty);\n LimitProductProduction(getProduct(divisionName, productName), cityName, qty);\n },\n exportMaterial:\n (ctx: NetscriptContext) =>\n (\n _sourceDivision: unknown,\n _sourceCity: unknown,\n _targetDivision: unknown,\n _targetCity: unknown,\n _materialName: unknown,\n _amt: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const sourceDivision = helpers.string(ctx, \"sourceDivision\", _sourceDivision);\n const sourceCity = helpers.string(ctx, \"sourceCity\", _sourceCity);\n const targetDivision = helpers.string(ctx, \"targetDivision\", _targetDivision);\n const targetCity = helpers.string(ctx, \"targetCity\", _targetCity);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n ExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n getDivision(targetDivision),\n );\n },\n cancelExportMaterial:\n (ctx: NetscriptContext) =>\n (\n _sourceDivision: unknown,\n _sourceCity: unknown,\n _targetDivision: unknown,\n _targetCity: unknown,\n _materialName: unknown,\n _amt: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const sourceDivision = helpers.string(ctx, \"sourceDivision\", _sourceDivision);\n const sourceCity = helpers.string(ctx, \"sourceCity\", _sourceCity);\n const targetDivision = helpers.string(ctx, \"targetDivision\", _targetDivision);\n const targetCity = helpers.string(ctx, \"targetCity\", _targetCity);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n CancelExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n );\n },\n limitMaterialProduction:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _qty: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const qty = helpers.number(ctx, \"qty\", _qty);\n LimitMaterialProduction(getMaterial(divisionName, cityName, materialName), qty);\n },\n setMaterialMarketTA1:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.I for division: ${divisionName}`);\n SetMaterialMarketTA1(getMaterial(divisionName, cityName, materialName), on);\n },\n setMaterialMarketTA2:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.II for division: ${divisionName}`);\n SetMaterialMarketTA2(getMaterial(divisionName, cityName, materialName), on);\n },\n setProductMarketTA1:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.I for division: ${divisionName}`);\n SetProductMarketTA1(getProduct(divisionName, productName), on);\n },\n setProductMarketTA2:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.II for division: ${divisionName}`);\n SetProductMarketTA2(getProduct(divisionName, productName), on);\n },\n };\n\n const officeAPI: InternalAPI = {\n getHireAdVertCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.getAdVertCost();\n },\n getHireAdVertCount:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.numAdVerts;\n },\n getResearchCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n return getResearchCost(getDivision(divisionName), researchName);\n },\n hasResearched:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): boolean => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n return hasResearched(getDivision(divisionName), researchName);\n },\n getOfficeSizeUpgradeCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const size = helpers.number(ctx, \"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n return CorporationConstants.OfficeInitialCost * mult;\n },\n assignJob:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _employeeName: unknown, _job: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const employeeName = helpers.string(ctx, \"employeeName\", _employeeName);\n const job = helpers.string(ctx, \"job\", _job);\n\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n const office = getOffice(divisionName, cityName);\n\n AssignJob(office, employeeName, job);\n },\n setAutoJobAssignment:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _job: unknown, _amount: unknown): boolean => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amount = helpers.number(ctx, \"amount\", _amount);\n const job = helpers.string(ctx, \"job\", _job);\n\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n const office = getOffice(divisionName, cityName);\n\n return AutoAssignJob(office, job, amount);\n },\n hireEmployee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): NSEmployee | undefined => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const office = getOffice(divisionName, cityName);\n const employee = office.hireRandomEmployee();\n if (employee === undefined) return undefined;\n return {\n name: employee.name,\n mor: employee.mor,\n hap: employee.hap,\n ene: employee.ene,\n int: employee.int,\n cha: employee.cha,\n exp: employee.exp,\n cre: employee.cre,\n eff: employee.eff,\n sal: employee.sal,\n loc: employee.loc,\n pos: employee.pos,\n };\n },\n upgradeOfficeSize:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const size = helpers.number(ctx, \"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n UpgradeOfficeSize(corporation, office, size);\n },\n throwParty:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _costPerEmployee: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const costPerEmployee = helpers.number(ctx, \"costPerEmployee\", _costPerEmployee);\n\n if (costPerEmployee < 0) {\n throw new Error(\"Invalid value for Cost Per Employee field! Must be numeric and greater than 0\");\n }\n\n const corporation = getCorporation();\n const office = getOffice(divisionName, cityName);\n\n return ThrowParty(corporation, office, costPerEmployee);\n },\n buyCoffee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): boolean => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n\n const corporation = getCorporation();\n const office = getOffice(divisionName, cityName);\n\n return BuyCoffee(corporation, office);\n },\n hireAdVert:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const corporation = getCorporation();\n HireAdVert(corporation, getDivision(divisionName));\n },\n research:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n Research(getDivision(divisionName), researchName);\n },\n getOffice:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): NSOffice => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const office = getOffice(divisionName, cityName);\n return {\n loc: office.loc,\n size: office.size,\n minEne: office.minEne,\n maxEne: office.maxEne,\n minHap: office.minHap,\n maxHap: office.maxHap,\n minMor: office.minMor,\n maxMor: office.maxMor,\n employees: office.employees.map((e) => e.name),\n employeeProd: {\n Operations: office.employeeProd[EmployeePositions.Operations],\n Engineer: office.employeeProd[EmployeePositions.Engineer],\n Business: office.employeeProd[EmployeePositions.Business],\n Management: office.employeeProd[EmployeePositions.Management],\n \"Research & Development\": office.employeeProd[EmployeePositions.RandD],\n Training: office.employeeProd[EmployeePositions.Training],\n Unassigned: 0,\n },\n employeeJobs: {\n Operations: office.employeeJobs[EmployeePositions.Operations],\n Engineer: office.employeeJobs[EmployeePositions.Engineer],\n Business: office.employeeJobs[EmployeePositions.Business],\n Management: office.employeeJobs[EmployeePositions.Management],\n \"Research & Development\": office.employeeJobs[EmployeePositions.RandD],\n Training: office.employeeJobs[EmployeePositions.Training],\n Unassigned: office.employeeJobs[EmployeePositions.Unassigned],\n },\n };\n },\n getEmployee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _employeeName: unknown): NSEmployee => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const employeeName = helpers.string(ctx, \"employeeName\", _employeeName);\n const employee = getEmployee(divisionName, cityName, employeeName);\n return {\n name: employee.name,\n mor: employee.mor,\n hap: employee.hap,\n ene: employee.ene,\n int: employee.int,\n cha: employee.cha,\n exp: employee.exp,\n cre: employee.cre,\n eff: employee.eff,\n sal: employee.sal,\n loc: employee.loc,\n pos: employee.pos,\n };\n },\n };\n\n return {\n ...warehouseAPI,\n ...officeAPI,\n getMaterialNames: () => (): string[] => {\n return CorporationConstants.AllMaterials;\n },\n getIndustryTypes: () => (): string[] => {\n return CorporationConstants.AllIndustryTypes;\n },\n getUnlockables: () => (): string[] => {\n return CorporationConstants.AllUnlocks;\n },\n getUpgradeNames: () => (): string[] => {\n return CorporationConstants.AllUpgrades;\n },\n getResearchNames: () => (): string[] => {\n return CorporationConstants.AllResearch;\n },\n expandIndustry:\n (ctx: NetscriptContext) =>\n (_industryName: unknown, _divisionName: unknown): void => {\n checkAccess(ctx);\n const industryName = helpers.string(ctx, \"industryName\", _industryName);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const corporation = getCorporation();\n NewIndustry(corporation, industryName, divisionName);\n },\n expandCity:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): void => {\n checkAccess(ctx);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n if (!CorporationConstants.Cities.includes(cityName)) throw new Error(\"Invalid city name\");\n const corporation = getCorporation();\n const division = getDivision(divisionName);\n NewCity(corporation, division, cityName);\n },\n unlockUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): void => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n UnlockUpgrade(corporation, upgrade);\n },\n levelUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): void => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n LevelUpgrade(corporation, upgrade);\n },\n issueDividends:\n (ctx: NetscriptContext) =>\n (_rate: unknown): void => {\n checkAccess(ctx);\n const rate = helpers.number(ctx, \"rate\", _rate);\n const max = CorporationConstants.DividendMaxRate;\n if (rate < 0 || rate > max)\n throw new Error(`Invalid value for rate field! Must be numeric, greater than 0, and less than ${max}`);\n const corporation = getCorporation();\n if (!corporation.public) throw helpers.makeRuntimeErrorMsg(ctx, `Your company has not gone public!`);\n IssueDividends(corporation, rate);\n },\n\n // If you modify these objects you will affect them for real, it's not\n // copies.\n getDivision:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): NSDivision => {\n checkAccess(ctx);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return getSafeDivision(division);\n },\n getCorporation: (ctx: NetscriptContext) => (): CorporationInfo => {\n checkAccess(ctx);\n const corporation = getCorporation();\n return {\n name: corporation.name,\n funds: corporation.funds,\n revenue: corporation.revenue,\n expenses: corporation.expenses,\n public: corporation.public,\n totalShares: corporation.totalShares,\n numShares: corporation.numShares,\n shareSaleCooldown: corporation.shareSaleCooldown,\n issuedShares: corporation.issuedShares,\n sharePrice: corporation.sharePrice,\n dividendRate: corporation.dividendRate,\n dividendTax: corporation.dividendTax,\n dividendEarnings: corporation.getCycleDividends() / CorporationConstants.SecsPerMarketCycle,\n state: corporation.state.getState(),\n divisions: corporation.divisions.map((division): NSDivision => getSafeDivision(division)),\n };\n },\n createCorporation:\n (ctx: NetscriptContext) =>\n (_corporationName: unknown, _selfFund: unknown = true): boolean => {\n const corporationName = helpers.string(ctx, \"corporationName\", _corporationName);\n const selfFund = !!_selfFund;\n return createCorporation(corporationName, selfFund);\n },\n hasUnlockUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): boolean => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return hasUnlockUpgrade(upgradeName);\n },\n getUnlockUpgradeCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUnlockUpgradeCost(upgradeName);\n },\n getUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUpgradeLevel(ctx, upgradeName);\n },\n getUpgradeLevelCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUpgradeLevelCost(ctx, upgradeName);\n },\n getExpandIndustryCost:\n (ctx: NetscriptContext) =>\n (_industryName: unknown): number => {\n checkAccess(ctx);\n const industryName = helpers.string(ctx, \"industryName\", _industryName);\n return getExpandIndustryCost(industryName);\n },\n getExpandCityCost: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx);\n return getExpandCityCost();\n },\n getInvestmentOffer: (ctx: NetscriptContext) => (): InvestmentOffer => {\n checkAccess(ctx);\n return getInvestmentOffer();\n },\n acceptInvestmentOffer: (ctx: NetscriptContext) => (): boolean => {\n checkAccess(ctx);\n return acceptInvestmentOffer();\n },\n goPublic:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return goPublic(numShares);\n },\n sellShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): number => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return SellShares(getCorporation(), player, numShares);\n },\n buyBackShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return BuyBackShares(getCorporation(), player, numShares);\n },\n bribe:\n (ctx: NetscriptContext) =>\n (_factionName: unknown, _amountCash: unknown): boolean => {\n checkAccess(ctx);\n const factionName = helpers.string(ctx, \"factionName\", _factionName);\n const amountCash = helpers.number(ctx, \"amountCash\", _amountCash);\n return bribe(factionName, amountCash);\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx);\n return Math.round(getCorporation().storedCycles / 5) * 1000;\n },\n };\n}\n","import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { Industries, IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { Material } from \"./Material\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { calculateEffectWithFactors } from \"../utils/calculateEffectWithFactors\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Product } from \"./Product\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { Warehouse } from \"./Warehouse\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\n\ninterface IParams {\n name?: string;\n corp?: ICorporation;\n type?: string;\n}\n\nexport class Industry implements IIndustry {\n name = \"\";\n type = Industries.Agriculture;\n sciResearch = new Material({ name: \"Scientific Research\" });\n researched: { [key: string]: boolean | undefined } = {};\n reqMats: { [key: string]: number | undefined } = {};\n\n //An array of the name of materials being produced\n prodMats: string[] = [];\n\n products: { [key: string]: Product | undefined } = {};\n makesProducts = false;\n\n awareness = 0;\n popularity = 0; //Should always be less than awareness\n startingCost = 0;\n\n /* The following are factors for how much production/other things are increased by\n different factors. The production increase always has diminishing returns,\n and they are all reprsented by exponentials of < 1 (e.g x ^ 0.5, x ^ 0.8)\n The number for these represent the exponential. A lower number means more\n diminishing returns */\n reFac = 0; //Real estate Factor\n sciFac = 0; //Scientific Research Factor, affects quality\n hwFac = 0; //Hardware factor\n robFac = 0; //Robotics Factor\n aiFac = 0; //AI Cores factor;\n advFac = 0; //Advertising factor, affects sales\n\n prodMult = 0; //Production multiplier\n\n //Financials\n lastCycleRevenue: number;\n lastCycleExpenses: number;\n thisCycleRevenue: number;\n thisCycleExpenses: number;\n\n state = \"START\";\n newInd = true;\n\n //Maps locations to warehouses. 0 if no warehouse at that location\n warehouses: { [key: string]: Warehouse | 0 };\n\n //Maps locations to offices. 0 if no office at that location\n offices: { [key: string]: OfficeSpace | 0 } = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new OfficeSpace({\n loc: CityName.Sector12,\n size: CorporationConstants.OfficeInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n numAdVerts = 0;\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.type = params.type ? params.type : Industries.Agriculture;\n\n //Financials\n this.lastCycleRevenue = 0;\n this.lastCycleExpenses = 0;\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n this.warehouses = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new Warehouse({\n corp: params.corp,\n industry: this,\n loc: CityName.Sector12,\n size: CorporationConstants.WarehouseInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n this.init();\n }\n\n init(): void {\n //Set the unique properties of an industry (how much its affected by real estate/scientific research, etc.)\n const startingCost = IndustryStartingCosts[this.type];\n if (startingCost === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.startingCost = startingCost;\n switch (this.type) {\n case Industries.Energy:\n this.reFac = 0.65;\n this.sciFac = 0.7;\n this.robFac = 0.05;\n this.aiFac = 0.3;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.2,\n };\n this.prodMats = [\"Energy\"];\n break;\n case Industries.Utilities:\n case \"Utilities\":\n this.reFac = 0.5;\n this.sciFac = 0.6;\n this.robFac = 0.4;\n this.aiFac = 0.4;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.1,\n };\n this.prodMats = [\"Water\"];\n break;\n case Industries.Agriculture:\n this.reFac = 0.72;\n this.sciFac = 0.5;\n this.hwFac = 0.2;\n this.robFac = 0.3;\n this.aiFac = 0.3;\n this.advFac = 0.04;\n this.reqMats = {\n Water: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"Plants\", \"Food\"];\n break;\n case Industries.Fishing:\n this.reFac = 0.15;\n this.sciFac = 0.35;\n this.hwFac = 0.35;\n this.robFac = 0.5;\n this.aiFac = 0.2;\n this.advFac = 0.08;\n this.reqMats = {\n Energy: 0.5,\n };\n this.prodMats = [\"Food\"];\n break;\n case Industries.Mining:\n this.reFac = 0.3;\n this.sciFac = 0.26;\n this.hwFac = 0.4;\n this.robFac = 0.45;\n this.aiFac = 0.45;\n this.advFac = 0.06;\n this.reqMats = {\n Energy: 0.8,\n };\n this.prodMats = [\"Metal\"];\n break;\n case Industries.Food:\n //reFac is unique for this bc it diminishes greatly per city. Handle this separately in code?\n this.sciFac = 0.12;\n this.hwFac = 0.15;\n this.robFac = 0.3;\n this.aiFac = 0.25;\n this.advFac = 0.25;\n this.reFac = 0.05;\n this.reqMats = {\n Food: 0.5,\n Water: 0.5,\n Energy: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Tobacco:\n this.reFac = 0.15;\n this.sciFac = 0.75;\n this.hwFac = 0.15;\n this.robFac = 0.2;\n this.aiFac = 0.15;\n this.advFac = 0.2;\n this.reqMats = {\n Plants: 1,\n Water: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Chemical:\n this.reFac = 0.25;\n this.sciFac = 0.75;\n this.hwFac = 0.2;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.07;\n this.reqMats = {\n Plants: 1,\n Energy: 0.5,\n Water: 0.5,\n };\n this.prodMats = [\"Chemicals\"];\n break;\n case Industries.Pharmaceutical:\n this.reFac = 0.05;\n this.sciFac = 0.8;\n this.hwFac = 0.15;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.16;\n this.reqMats = {\n Chemicals: 2,\n Energy: 1,\n Water: 0.5,\n };\n this.prodMats = [\"Drugs\"];\n this.makesProducts = true;\n break;\n case Industries.Computer:\n case \"Computer\":\n this.reFac = 0.2;\n this.sciFac = 0.62;\n this.robFac = 0.36;\n this.aiFac = 0.19;\n this.advFac = 0.17;\n this.reqMats = {\n Metal: 2,\n Energy: 1,\n };\n this.prodMats = [\"Hardware\"];\n this.makesProducts = true;\n break;\n case Industries.Robotics:\n this.reFac = 0.32;\n this.sciFac = 0.65;\n this.aiFac = 0.36;\n this.advFac = 0.18;\n this.hwFac = 0.19;\n this.reqMats = {\n Hardware: 5,\n Energy: 3,\n };\n this.prodMats = [\"Robots\"];\n this.makesProducts = true;\n break;\n case Industries.Software:\n this.sciFac = 0.62;\n this.advFac = 0.16;\n this.hwFac = 0.25;\n this.reFac = 0.15;\n this.aiFac = 0.18;\n this.robFac = 0.05;\n this.reqMats = {\n Hardware: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"AICores\"];\n this.makesProducts = true;\n break;\n case Industries.Healthcare:\n this.reFac = 0.1;\n this.sciFac = 0.75;\n this.advFac = 0.11;\n this.hwFac = 0.1;\n this.robFac = 0.1;\n this.aiFac = 0.1;\n this.reqMats = {\n Robots: 10,\n AICores: 5,\n Energy: 5,\n Water: 5,\n };\n this.makesProducts = true;\n break;\n case Industries.RealEstate:\n this.robFac = 0.6;\n this.aiFac = 0.6;\n this.advFac = 0.25;\n this.sciFac = 0.05;\n this.hwFac = 0.05;\n this.reqMats = {\n Metal: 5,\n Energy: 5,\n Water: 2,\n Hardware: 4,\n };\n this.prodMats = [\"RealEstate\"];\n this.makesProducts = true;\n break;\n default:\n console.error(`Invalid Industry Type passed into Industry.init(): ${this.type}`);\n return;\n }\n }\n\n getProductDescriptionText(): string {\n if (!this.makesProducts) return \"\";\n switch (this.type) {\n case Industries.Food:\n return \"create and manage restaurants\";\n case Industries.Tobacco:\n return \"create tobacco and tobacco-related products\";\n case Industries.Pharmaceutical:\n return \"develop new pharmaceutical drugs\";\n case Industries.Computer:\n case \"Computer\":\n return \"create new computer hardware and networking infrastructures\";\n case Industries.Robotics:\n return \"build specialized robots and robot-related products\";\n case Industries.Software:\n return \"develop computer software\";\n case Industries.Healthcare:\n return \"build and manage hospitals\";\n case Industries.RealEstate:\n return \"develop and manage real estate properties\";\n default:\n console.error(\"Invalid industry type in Industry.getProductDescriptionText\");\n return \"\";\n }\n }\n\n getMaximumNumberProducts(): number {\n if (!this.makesProducts) return 0;\n\n // Calculate additional number of allowed Products from Research/Upgrades\n let additional = 0;\n if (this.hasResearch(\"uPgrade: Capacity.I\")) ++additional;\n if (this.hasResearch(\"uPgrade: Capacity.II\")) ++additional;\n\n return CorporationConstants.BaseMaxProducts + additional;\n }\n\n hasMaximumNumberProducts(): boolean {\n return Object.keys(this.products).length >= this.getMaximumNumberProducts();\n }\n\n //Calculates the values that factor into the production and properties of\n //materials/products (such as quality, etc.)\n calculateProductionFactors(): void {\n let multSum = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const warehouse = this.warehouses[city];\n if (!(warehouse instanceof Warehouse)) {\n continue;\n }\n\n const materials = warehouse.materials;\n\n const cityMult =\n Math.pow(0.002 * materials.RealEstate.qty + 1, this.reFac) *\n Math.pow(0.002 * materials.Hardware.qty + 1, this.hwFac) *\n Math.pow(0.002 * materials.Robots.qty + 1, this.robFac) *\n Math.pow(0.002 * materials.AICores.qty + 1, this.aiFac);\n multSum += Math.pow(cityMult, 0.73);\n }\n\n multSum < 1 ? (this.prodMult = 1) : (this.prodMult = multSum);\n }\n\n updateWarehouseSizeUsed(warehouse: Warehouse): void {\n warehouse.updateMaterialSizeUsed();\n\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n warehouse.sizeUsed += prod.data[warehouse.loc][0] * prod.siz;\n }\n }\n }\n\n process(marketCycles = 1, state: string, corporation: ICorporation): void {\n this.state = state;\n\n //At the start of a cycle, store and reset revenue/expenses\n //Then calculate salaries and processs the markets\n if (state === \"START\") {\n if (isNaN(this.thisCycleRevenue) || isNaN(this.thisCycleExpenses)) {\n console.error(\"NaN in Corporation's computed revenue/expenses\");\n dialogBoxCreate(\n \"Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer\",\n );\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n }\n this.lastCycleRevenue = this.thisCycleRevenue / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.lastCycleExpenses = this.thisCycleExpenses / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n // Once you start making revenue, the player should no longer be\n // considered new, and therefore no longer needs the 'tutorial' UI elements\n if (this.lastCycleRevenue > 0) {\n this.newInd = false;\n }\n\n // Process offices (and the employees in them)\n let employeeSalary = 0;\n for (const officeLoc of Object.keys(this.offices)) {\n const office = this.offices[officeLoc];\n if (office === 0) continue;\n if (office instanceof OfficeSpace) {\n employeeSalary += office.process(marketCycles, corporation, this);\n }\n }\n this.thisCycleExpenses = this.thisCycleExpenses + employeeSalary;\n\n // Process change in demand/competition of materials/products\n this.processMaterialMarket();\n this.processProductMarket(marketCycles);\n\n // Process loss of popularity\n this.popularity -= marketCycles * 0.0001;\n this.popularity = Math.max(0, this.popularity);\n\n // Process Dreamsense gains\n const popularityGain = corporation.getDreamSenseGain(),\n awarenessGain = popularityGain * 4;\n if (popularityGain > 0) {\n const awareness = this.awareness + awarenessGain * marketCycles;\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = this.popularity + popularityGain * marketCycles;\n this.popularity = Math.min(popularity, Number.MAX_VALUE);\n }\n\n return;\n }\n\n // Process production, purchase, and import/export of materials\n let res = this.processMaterials(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n\n // Process creation, production & sale of products\n res = this.processProducts(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n }\n\n // Process change in demand and competition for this industry's materials\n processMaterialMarket(): void {\n //References to prodMats and reqMats\n const reqMats = this.reqMats,\n prodMats = this.prodMats;\n\n //Only 'process the market' for materials that this industry deals with\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n //If this industry has a warehouse in this city, process the market\n //for every material this industry requires or produces\n if (this.warehouses[CorporationConstants.Cities[i]] instanceof Warehouse) {\n const wh = this.warehouses[CorporationConstants.Cities[i]];\n if (wh === 0) continue;\n for (const name of Object.keys(reqMats)) {\n if (reqMats.hasOwnProperty(name)) {\n wh.materials[name].processMarket();\n }\n }\n\n //Produced materials are stored in an array\n for (let foo = 0; foo < prodMats.length; ++foo) {\n wh.materials[prodMats[foo]].processMarket();\n }\n\n //Process these twice because these boost production\n wh.materials[\"Hardware\"].processMarket();\n wh.materials[\"Robots\"].processMarket();\n wh.materials[\"AICores\"].processMarket();\n wh.materials[\"RealEstate\"].processMarket();\n }\n }\n }\n\n // Process change in demand and competition for this industry's products\n processProductMarket(marketCycles = 1): void {\n // Demand gradually decreases, and competition gradually increases\n for (const name of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(name)) {\n const product = this.products[name];\n if (product === undefined) continue;\n let change = getRandomInt(0, 3) * 0.0004;\n if (change === 0) continue;\n\n if (\n this.type === Industries.Pharmaceutical ||\n this.type === Industries.Software ||\n this.type === Industries.Robotics\n ) {\n change *= 3;\n }\n change *= marketCycles;\n product.dmd -= change;\n product.cmp += change;\n product.cmp = Math.min(product.cmp, 99.99);\n product.dmd = Math.max(product.dmd, 0.001);\n }\n }\n }\n\n //Process production, purchase, and import/export of materials\n processMaterials(marketCycles = 1, corporation: ICorporation): [number, number] {\n let revenue = 0,\n expenses = 0;\n this.calculateProductionFactors();\n\n //At the start of the export state, set the imports of everything to 0\n if (this.state === \"EXPORT\") {\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n if (!(this.warehouses[city] instanceof Warehouse)) {\n continue;\n }\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.imp = 0;\n }\n }\n }\n }\n\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n\n if (this.warehouses[city] instanceof Warehouse) {\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n\n switch (this.state) {\n case \"PURCHASE\": {\n /* Process purchase of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n const mat = warehouse.materials[matName];\n let buyAmt = 0;\n let maxAmt = 0;\n if (warehouse.smartSupplyEnabled && Object.keys(this.reqMats).includes(matName)) {\n continue;\n }\n buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) {\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n this.updateWarehouseSizeUsed(warehouse);\n } //End process purchase of materials\n\n // smart supply\n const smartBuy: { [key: string]: number | undefined } = {};\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n if (!warehouse.smartSupplyEnabled || !Object.keys(this.reqMats).includes(matName)) continue;\n const mat = warehouse.materials[matName];\n\n //Smart supply tracker is stored as per second rate\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n mat.buy = reqMat * warehouse.smartSupplyStore;\n let buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) smartBuy[matName] = buyAmt;\n }\n\n // Find which material were trying to create the least amount of product with.\n let worseAmt = 1e99;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n const amt = buyAmt / reqMat;\n if (amt < worseAmt) worseAmt = amt;\n }\n\n // Align all the materials to the smallest amount.\n for (const matName of Object.keys(smartBuy)) {\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n smartBuy[matName] = worseAmt * reqMat;\n }\n\n // Calculate the total size of all things were trying to buy\n let totalSize = 0;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n totalSize += buyAmt * MaterialSizes[matName];\n }\n\n // Shrink to the size of available space.\n const freeSpace = warehouse.size - warehouse.sizeUsed;\n if (totalSize > freeSpace) {\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.floor((buyAmt * freeSpace) / totalSize);\n }\n }\n\n // Use the materials already in the warehouse if the option is on.\n for (const matName of Object.keys(smartBuy)) {\n if (!warehouse.smartSupplyUseLeftovers[matName]) continue;\n const mat = warehouse.materials[matName];\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.max(0, buyAmt - mat.qty);\n }\n\n // buy them\n for (const matName of Object.keys(smartBuy)) {\n const mat = warehouse.materials[matName];\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n break;\n }\n case \"PRODUCTION\":\n warehouse.smartSupplyStore = 0; //Reset smart supply amount\n\n /* Process production of materials */\n if (this.prodMats.length > 0) {\n const mat = warehouse.materials[this.prodMats[0]];\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office) *\n this.prodMult * // Multiplier from materials\n corporation.getProductionMultiplier() *\n this.getProductionMultiplier(); // Multiplier from Research\n let prod;\n\n if (mat.prdman[0]) {\n //Production is manually limited\n prod = Math.min(maxProd, mat.prdman[1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles; //Convert production from per second to per market cycle\n\n // Calculate net change in warehouse storage making the produced materials will cost\n let totalMatSize = 0;\n for (let tmp = 0; tmp < this.prodMats.length; ++tmp) {\n totalMatSize += MaterialSizes[this.prodMats[tmp]];\n }\n for (const reqMatName of Object.keys(this.reqMats)) {\n const normQty = this.reqMats[reqMatName];\n if (normQty === undefined) continue;\n totalMatSize -= MaterialSizes[reqMatName] * normQty;\n }\n // If not enough space in warehouse, limit the amount of produced materials\n if (totalMatSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / totalMatSize);\n prod = Math.min(maxAmt, prod);\n }\n\n if (prod < 0) {\n prod = 0;\n }\n\n // Keep track of production for smart supply (/s)\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n // Make sure we have enough resource to make our materials\n let producableFrac = 1;\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const req = reqMat * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n if (producableFrac <= 0) {\n producableFrac = 0;\n prod = 0;\n }\n\n // Make our materials if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(this.reqMats)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const reqMatQtyNeeded = reqMat * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd = 0;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n for (let j = 0; j < this.prodMats.length; ++j) {\n warehouse.materials[this.prodMats[j]].qty += prod * producableFrac;\n warehouse.materials[this.prodMats[j]].qlt =\n office.employeeProd[EmployeePositions.Engineer] / 90 +\n Math.pow(this.sciResearch.qty, this.sciFac) +\n Math.pow(warehouse.materials[\"AICores\"].qty, this.aiFac) / 10e3;\n }\n } else {\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n }\n\n //Per second\n const fooProd = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n for (let fooI = 0; fooI < this.prodMats.length; ++fooI) {\n warehouse.materials[this.prodMats[fooI]].prd = fooProd;\n }\n } else {\n //If this doesn't produce any materials, then it only creates\n //Products. Creating products will consume materials. The\n //Production of all consumed materials must be set to 0\n for (const reqMatName of Object.keys(this.reqMats)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n break;\n\n case \"SALE\":\n /* Process sale of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n if (mat.sCost < 0 || mat.sllman[0] === false) {\n mat.sll = 0;\n continue;\n }\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(mat); //Competition + demand\n\n // Determine the cost that the material will be sold at\n const markupLimit = mat.getMarkupLimit();\n let sCost;\n if (mat.marketTa2) {\n const prod = mat.prd;\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n (mat.qlt + 0.001) *\n marketFactor *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = mat.bCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + mat.bCost;\n }\n\n // We'll store this \"Optimal Price\" in a property so that we don't have\n // to re-calculate it for the UI\n mat.marketTa2Price = optimalPrice;\n\n sCost = optimalPrice;\n } else if (mat.marketTa1) {\n sCost = mat.bCost + markupLimit;\n } else if (isString(mat.sCost)) {\n sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sCost = eval(sCost);\n } else {\n sCost = mat.sCost;\n }\n\n // Calculate how much of the material sells (per second)\n let markup = 1;\n if (sCost > mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - mat.bCost), 2);\n }\n } else if (sCost < mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = mat.bCost / sCost;\n }\n }\n\n mat.maxsll =\n (mat.qlt + 0.001) *\n marketFactor *\n markup *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (isString(mat.sllman[1])) {\n //Dynamically evaluated\n let tmp = (mat.sllman[1] as string).replace(/MAX/g, (mat.maxsll + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, mat.prd + \"\");\n try {\n sellAmt = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell amount for material \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. The sell amount \" +\n \"is being set to zero\",\n );\n sellAmt = 0;\n }\n sellAmt = Math.min(mat.maxsll, sellAmt);\n } else if (mat.sllman[1] === -1) {\n //Backwards compatibility, -1 = MAX\n sellAmt = mat.maxsll;\n } else {\n //Player's input value is just a number\n sellAmt = Math.min(mat.maxsll, mat.sllman[1] as number);\n }\n\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(mat.qty, sellAmt);\n if (sellAmt < 0) {\n console.warn(`sellAmt calculated to be negative for ${matName} in ${city}`);\n mat.sll = 0;\n continue;\n }\n if (sellAmt && sCost >= 0) {\n mat.qty -= sellAmt;\n revenue += sellAmt * sCost;\n mat.sll = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n } else {\n mat.sll = 0;\n }\n }\n } //End processing of sale of materials\n break;\n\n case \"EXPORT\":\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.totalExp = 0; //Reset export\n for (let expI = 0; expI < mat.exp.length; ++expI) {\n const exp = mat.exp[expI];\n const amtStr = exp.amt.replace(\n /MAX/g,\n (mat.qty / (CorporationConstants.SecsPerMarketCycle * marketCycles) + \"\").toUpperCase(),\n );\n let amt = 0;\n try {\n amt = eval(amtStr);\n } catch (e) {\n dialogBoxCreate(\n \"Calculating export for \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" division failed with \" +\n \"error: \" +\n e,\n );\n continue;\n }\n if (isNaN(amt)) {\n dialogBoxCreate(\n \"Error calculating export amount for \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" division.\",\n );\n continue;\n }\n amt = amt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n if (mat.qty < amt) {\n amt = mat.qty;\n }\n if (amt === 0) {\n break; //None left\n }\n for (let foo = 0; foo < corporation.divisions.length; ++foo) {\n if (corporation.divisions[foo].name === exp.ind) {\n const expIndustry = corporation.divisions[foo];\n const expWarehouse = expIndustry.warehouses[exp.city];\n if (!(expWarehouse instanceof Warehouse)) {\n console.error(`Invalid export! ${expIndustry.name} ${exp.city}`);\n break;\n }\n\n // Make sure theres enough space in warehouse\n if (expWarehouse.sizeUsed >= expWarehouse.size) {\n // Warehouse at capacity. Exporting doesnt\n // affect revenue so just return 0's\n return [0, 0];\n } else {\n const maxAmt = Math.floor((expWarehouse.size - expWarehouse.sizeUsed) / MaterialSizes[matName]);\n amt = Math.min(maxAmt, amt);\n }\n expWarehouse.materials[matName].imp +=\n amt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n expWarehouse.materials[matName].qty += amt;\n expWarehouse.materials[matName].qlt = mat.qlt;\n mat.qty -= amt;\n mat.totalExp += amt;\n expIndustry.updateWarehouseSizeUsed(expWarehouse);\n break;\n }\n }\n }\n //totalExp should be per second\n mat.totalExp /= CorporationConstants.SecsPerMarketCycle * marketCycles;\n }\n }\n\n break;\n\n case \"START\":\n break;\n default:\n console.error(`Invalid state: ${this.state}`);\n break;\n } //End switch(this.state)\n this.updateWarehouseSizeUsed(warehouse);\n } // End warehouse\n\n //Produce Scientific Research based on R&D employees\n //Scientific Research can be produced without a warehouse\n if (office instanceof OfficeSpace) {\n this.sciResearch.qty +=\n 0.004 *\n Math.pow(office.employeeProd[EmployeePositions.RandD], 0.5) *\n corporation.getScientificResearchMultiplier() *\n this.getScientificResearchMultiplier();\n }\n }\n return [revenue, expenses];\n }\n\n //Process production & sale of this industry's FINISHED products (including all of their stats)\n processProducts(marketCycles = 1, corporation: ICorporation): [number, number] {\n let revenue = 0;\n const expenses = 0;\n\n //Create products\n if (this.state === \"PRODUCTION\") {\n for (const prodName of Object.keys(this.products)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n if (!prod.fin) {\n const city = prod.createCity;\n const office = this.offices[city];\n if (office === 0) continue;\n\n prod.createProduct(marketCycles, office.employeeProd);\n if (prod.prog >= 100) {\n prod.finishProduct(this);\n }\n break;\n }\n }\n }\n\n //Produce Products\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod instanceof Product && prod.fin) {\n revenue += this.processProduct(marketCycles, prod, corporation);\n }\n }\n }\n return [revenue, expenses];\n }\n\n //Processes FINISHED products\n processProduct(marketCycles = 1, product: Product, corporation: ICorporation): number {\n let totalProfit = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n const warehouse = this.warehouses[city];\n if (warehouse instanceof Warehouse) {\n switch (this.state) {\n case \"PRODUCTION\": {\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office, { forProduct: true }) *\n corporation.getProductionMultiplier() *\n this.prodMult * // Multiplier from materials\n this.getProductionMultiplier() * // Multiplier from research\n this.getProductProductionMultiplier(); // Multiplier from research\n let prod;\n\n //Account for whether production is manually limited\n if (product.prdman[city][0]) {\n prod = Math.min(maxProd, product.prdman[city][1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n //Calculate net change in warehouse storage making the Products will cost\n let netStorageSize = product.siz;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const normQty = product.reqMats[reqMatName];\n netStorageSize -= MaterialSizes[reqMatName] * normQty;\n }\n }\n\n //If there's not enough space in warehouse, limit the amount of Product\n if (netStorageSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / netStorageSize);\n prod = Math.min(maxAmt, prod);\n }\n\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n //Make sure we have enough resources to make our Products\n let producableFrac = 1;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const req = product.reqMats[reqMatName] * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n\n //Make our Products if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const reqMatQtyNeeded = product.reqMats[reqMatName] * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n }\n //Quantity\n product.data[city][0] += prod * producableFrac;\n }\n\n //Keep track of production Per second\n product.data[city][1] = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n break;\n }\n case \"SALE\": {\n //Process sale of Products\n product.pCost = 0; //Estimated production cost\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n product.pCost += product.reqMats[reqMatName] * warehouse.materials[reqMatName].bCost;\n }\n }\n\n // Since its a product, its production cost is increased for labor\n product.pCost *= CorporationConstants.ProductProductionCostRatio;\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(product); //Competition + demand\n\n // Calculate Sale Cost (sCost), which could be dynamically evaluated\n const markupLimit = product.rat / product.mku;\n let sCost;\n if (product.marketTa2) {\n const prod = product.data[city][1];\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'roduct.pCost = sCost\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = product.pCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + product.pCost;\n }\n\n // Store this \"optimal Price\" in a property so we don't have to re-calculate for UI\n product.marketTa2Price[city] = optimalPrice;\n sCost = optimalPrice;\n } else if (product.marketTa1) {\n sCost = product.pCost + markupLimit;\n } else if (isString(product.sCost)) {\n const sCostString = product.sCost as string;\n if (product.mku === 0) {\n console.error(`mku is zero, reverting to 1 to avoid Infinity`);\n product.mku = 1;\n }\n sCost = sCostString.replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sCost = eval(sCost);\n } else {\n sCost = product.sCost;\n }\n\n let markup = 1;\n if (sCost > product.pCost) {\n if (sCost - product.pCost > markupLimit) {\n markup = markupLimit / (sCost - product.pCost);\n }\n }\n\n product.maxsll =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n Math.pow(markup, 2) *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (product.sllman[city][0] && isString(product.sllman[city][1])) {\n //Sell amount is dynamically evaluated\n let tmp = product.sllman[city][1].replace(/MAX/g, (product.maxsll + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, product.data[city][1]);\n try {\n tmp = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell price expression for \" +\n product.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. Sell price is being set to MAX\",\n );\n tmp = product.maxsll;\n }\n sellAmt = Math.min(product.maxsll, tmp);\n } else if (product.sllman[city][0] && product.sllman[city][1] > 0) {\n //Sell amount is manually limited\n sellAmt = Math.min(product.maxsll, product.sllman[city][1]);\n } else if (product.sllman[city][0] === false) {\n sellAmt = 0;\n } else {\n sellAmt = product.maxsll;\n }\n if (sellAmt < 0) {\n sellAmt = 0;\n }\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(product.data[city][0], sellAmt); //data[0] is qty\n if (sellAmt && sCost) {\n product.data[city][0] -= sellAmt; //data[0] is qty\n totalProfit += sellAmt * sCost;\n product.data[city][2] = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles); //data[2] is sell property\n } else {\n product.data[city][2] = 0; //data[2] is sell property\n }\n break;\n }\n case \"START\":\n case \"PURCHASE\":\n case \"EXPORT\":\n break;\n default:\n console.error(`Invalid State: ${this.state}`);\n break;\n } //End switch(this.state)\n }\n }\n return totalProfit;\n }\n\n discontinueProduct(product: Product): void {\n for (const productName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(productName)) {\n if (product === this.products[productName]) {\n delete this.products[productName];\n }\n }\n }\n }\n\n getAdVertCost(): number {\n return 1e9 * Math.pow(1.06, this.numAdVerts);\n }\n\n applyAdVert(corporation: ICorporation): void {\n const advMult = corporation.getAdvertisingMultiplier() * this.getAdvertisingMultiplier();\n const awareness = (this.awareness + 3 * advMult) * (1.01 * advMult);\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = (this.popularity + 1 * advMult) * ((1 + getRandomInt(1, 3) / 100) * advMult);\n this.popularity = Math.min(popularity, Number.MAX_VALUE);\n\n ++this.numAdVerts;\n }\n\n // Returns how much of a material can be produced based of office productivity (employee stats)\n getOfficeProductivity(office: OfficeSpace, params: { forProduct?: boolean } = {}): number {\n const opProd = office.employeeProd[EmployeePositions.Operations];\n const engrProd = office.employeeProd[EmployeePositions.Engineer];\n const mgmtProd = office.employeeProd[EmployeePositions.Management];\n const total = opProd + engrProd + mgmtProd;\n\n if (total <= 0) return 0;\n\n // Management is a multiplier for the production from Operations and Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n\n // For production, Operations is slightly more important than engineering\n // Both Engineering and Operations have diminishing returns\n const prod = (Math.pow(opProd, 0.4) + Math.pow(engrProd, 0.3)) * mgmtFactor;\n\n // Generic multiplier for the production. Used for game-balancing purposes\n const balancingMult = 0.05;\n\n if (params && params.forProduct) {\n // Products are harder to create and therefore have less production\n return 0.5 * balancingMult * prod;\n } else {\n return balancingMult * prod;\n }\n }\n\n // Returns a multiplier based on the office' 'Business' employees that affects sales\n getBusinessFactor(office: OfficeSpace): number {\n const businessProd = 1 + office.employeeProd[EmployeePositions.Business];\n\n return calculateEffectWithFactors(businessProd, 0.26, 10e3);\n }\n\n //Returns a set of multipliers based on the Industry's awareness, popularity, and advFac. This\n //multiplier affects sales. The result is:\n // [Total sales mult, total awareness mult, total pop mult, awareness/pop ratio mult]\n getAdvertisingFactors(): [number, number, number, number] {\n const awarenessFac = Math.pow(this.awareness + 1, this.advFac);\n const popularityFac = Math.pow(this.popularity + 1, this.advFac);\n const ratioFac = this.awareness === 0 ? 0.01 : Math.max((this.popularity + 0.001) / this.awareness, 0.01);\n const totalFac = Math.pow(awarenessFac * popularityFac * ratioFac, 0.85);\n return [totalFac, awarenessFac, popularityFac, ratioFac];\n }\n\n //Returns a multiplier based on a materials demand and competition that affects sales\n getMarketFactor(mat: { dmd: number; cmp: number }): number {\n return Math.max(0.1, (mat.dmd * (100 - mat.cmp)) / 100);\n }\n\n // Returns a boolean indicating whether this Industry has the specified Research\n hasResearch(name: string): boolean {\n return this.researched[name] === true;\n }\n\n updateResearchTree(): void {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry \"${this.type}\"`);\n\n // Since ResearchTree data isnt saved, we'll update the Research Tree data\n // based on the stored 'researched' property in the Industry object\n if (Object.keys(researchTree.researched).length !== Object.keys(this.researched).length) {\n for (const research of Object.keys(this.researched)) {\n researchTree.research(research);\n }\n }\n }\n\n // Get multipliers from Research\n getAdvertisingMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getAdvertisingMultiplier();\n }\n\n getEmployeeChaMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeChaMultiplier();\n }\n\n getEmployeeCreMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeCreMultiplier();\n }\n\n getEmployeeEffMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeEffMultiplier();\n }\n\n getEmployeeIntMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeIntMultiplier();\n }\n\n getProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductionMultiplier();\n }\n\n getProductProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductProductionMultiplier();\n }\n\n getSalesMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getSalesMultiplier();\n }\n\n getScientificResearchMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getScientificResearchMultiplier();\n }\n\n getStorageMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getStorageMultiplier();\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Industry\", this);\n }\n\n /**\n * Initiatizes a Industry object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Industry {\n return Generic_fromJSON(Industry, value.data);\n }\n}\n\nReviver.constructors.Industry = Industry;\n","/**\n * This is a component that implements a mathematical formula used commonly throughout the\n * game. This formula is (typically) used to calculate the effect that various statistics\n * have on a game mechanic. It looks something like:\n *\n * (stat ^ exponential factor) + (stat / linear factor)\n *\n * where the exponential factor is a number between 0 and 1 and the linear factor\n * is typically a relatively larger number.\n *\n * This formula ensures that the effects of the statistic that is being processed\n * has diminishing returns, but never loses its effectiveness as you continue\n * to raise it.\n */\nexport function calculateEffectWithFactors(n: number, expFac: number, linearFac: number): number {\n if (expFac <= 0 || expFac >= 1) {\n console.warn(`Exponential factor is ${expFac}. This is not an intended value for it`);\n }\n if (linearFac < 1) {\n console.warn(`Linear factor is ${linearFac}. This is not an intended value for it`);\n }\n\n return Math.pow(n, expFac) + n / linearFac;\n}\n","import { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\n\ninterface IParams {\n name?: string;\n morale?: number;\n happiness?: number;\n energy?: number;\n intelligence?: number;\n charisma?: number;\n experience?: number;\n creativity?: number;\n efficiency?: number;\n salary?: number;\n loc?: string;\n}\n\nexport class Employee {\n name: string;\n mor: number;\n hap: number;\n ene: number;\n int: number;\n cha: number;\n exp: number;\n cre: number;\n eff: number;\n sal: number;\n cyclesUntilRaise = CorporationConstants.CyclesPerEmployeeRaise;\n loc: string;\n pos: string;\n nextPos: string;\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"Bobby\";\n\n //Morale, happiness, and energy are 0-100\n this.mor = params.morale ? params.morale : getRandomInt(50, 100);\n this.hap = params.happiness ? params.happiness : getRandomInt(50, 100);\n this.ene = params.energy ? params.energy : getRandomInt(50, 100);\n\n this.int = params.intelligence ? params.intelligence : getRandomInt(10, 50);\n this.cha = params.charisma ? params.charisma : getRandomInt(10, 50);\n this.exp = params.experience ? params.experience : getRandomInt(10, 50);\n this.cre = params.creativity ? params.creativity : getRandomInt(10, 50);\n this.eff = params.efficiency ? params.efficiency : getRandomInt(10, 50);\n this.sal = params.salary ? params.salary : getRandomInt(0.1, 5);\n\n this.loc = params.loc ? params.loc : \"\";\n this.pos = EmployeePositions.Unassigned;\n this.nextPos = this.pos;\n }\n\n //Returns the amount the employee needs to be paid\n process(marketCycles = 1): number {\n const gain = 0.003 * marketCycles;\n const det = gain * Math.random();\n this.exp += gain;\n\n //Training\n const trainingEff = gain * Math.random();\n if (this.pos === EmployeePositions.Training) {\n //To increase creativity and intelligence special upgrades are needed\n this.cha += trainingEff;\n this.exp += trainingEff;\n this.eff += trainingEff;\n }\n\n this.ene -= det;\n this.hap -= det;\n\n const salary = this.sal * marketCycles * CorporationConstants.SecsPerMarketCycle;\n return salary;\n }\n\n calculateProductivity(corporation: ICorporation, industry: IIndustry): number {\n const effCre = this.cre * corporation.getEmployeeCreMultiplier() * industry.getEmployeeCreMultiplier(),\n effCha = this.cha * corporation.getEmployeeChaMultiplier() * industry.getEmployeeChaMultiplier(),\n effInt = this.int * corporation.getEmployeeIntMultiplier() * industry.getEmployeeIntMultiplier(),\n effEff = this.eff * corporation.getEmployeeEffMultiplier() * industry.getEmployeeEffMultiplier();\n const prodBase = this.mor * this.hap * this.ene * 1e-6;\n let prodMult = 0;\n switch (this.pos) {\n //Calculate productivity based on position. This is multipled by prodBase\n //to get final value\n case EmployeePositions.Operations:\n prodMult = 0.6 * effInt + 0.1 * effCha + this.exp + 0.5 * effCre + effEff;\n break;\n case EmployeePositions.Engineer:\n prodMult = effInt + 0.1 * effCha + 1.5 * this.exp + effEff;\n break;\n case EmployeePositions.Business:\n prodMult = 0.4 * effInt + effCha + 0.5 * this.exp;\n break;\n case EmployeePositions.Management:\n prodMult = 2 * effCha + this.exp + 0.2 * effCre + 0.7 * effEff;\n break;\n case EmployeePositions.RandD:\n prodMult = 1.5 * effInt + 0.8 * this.exp + effCre + 0.5 * effEff;\n break;\n case EmployeePositions.Unassigned:\n case EmployeePositions.Training:\n prodMult = 0;\n break;\n default:\n console.error(`Invalid employee position: ${this.pos}`);\n break;\n }\n return prodBase * prodMult;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Employee\", this);\n }\n\n static fromJSON(value: IReviverValue): Employee {\n return Generic_fromJSON(Employee, value.data);\n }\n}\n\nReviver.constructors.Employee = Employee;\n","import { Industries } from \"./IndustryData\";\nimport { IMap } from \"../types\";\n\nexport interface IProductRatingWeight {\n Aesthetics?: number;\n Durability?: number;\n Features?: number;\n Quality?: number;\n Performance?: number;\n Reliability?: number;\n}\n\nexport const ProductRatingWeights: IMap = {\n [Industries.Food]: {\n Quality: 0.7,\n Durability: 0.1,\n Aesthetics: 0.2,\n },\n [Industries.Tobacco]: {\n Quality: 0.4,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.2,\n },\n [Industries.Pharmaceutical]: {\n Quality: 0.2,\n Performance: 0.2,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.2,\n },\n [Industries.Computer]: {\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n Computer: {\n //Repeat\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n [Industries.Robotics]: {\n Quality: 0.1,\n Performance: 0.2,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.1,\n Features: 0.2,\n },\n [Industries.Software]: {\n Quality: 0.2,\n Performance: 0.2,\n Reliability: 0.2,\n Durability: 0.2,\n Features: 0.2,\n },\n [Industries.Healthcare]: {\n Quality: 0.4,\n Performance: 0.1,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.1,\n },\n [Industries.RealEstate]: {\n Quality: 0.2,\n Durability: 0.25,\n Reliability: 0.1,\n Aesthetics: 0.35,\n Features: 0.1,\n },\n};\n","import { Player as player } from \"../Player\";\nimport { calculateServerGrowth } from \"../Server/formulas/grow\";\nimport {\n calculateMoneyGainRate,\n calculateLevelUpgradeCost,\n calculateRamUpgradeCost,\n calculateCoreUpgradeCost,\n calculateNodeCost,\n} from \"../Hacknet/formulas/HacknetNodes\";\nimport {\n calculateHashGainRate as HScalculateHashGainRate,\n calculateLevelUpgradeCost as HScalculateLevelUpgradeCost,\n calculateRamUpgradeCost as HScalculateRamUpgradeCost,\n calculateCoreUpgradeCost as HScalculateCoreUpgradeCost,\n calculateCacheUpgradeCost as HScalculateCacheUpgradeCost,\n calculateServerCost as HScalculateServerCost,\n} from \"../Hacknet/formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { calculateSkill, calculateExp } from \"../PersonObjects/formulas/skill\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { Programs } from \"../Programs/Programs\";\nimport {\n Formulas as IFormulas,\n HacknetNodeConstants as DefHacknetNodeConstants,\n HacknetServerConstants as DefHacknetServerConstants,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport {\n calculateRespectGain,\n calculateWantedLevelGain,\n calculateMoneyGain,\n calculateWantedPenalty,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"../Gang/formulas/formulas\";\nimport { favorToRep as calculateFavorToRep, repToFavor as calculateRepToFavor } from \"../Faction/formulas/favor\";\nimport { repFromDonation } from \"../Faction/formulas/donation\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\nimport { WorkStats } from \"../Work/WorkStats\";\nimport { calculateCrimeWorkStats } from \"../Work/formulas/Crime\";\nimport { Crimes } from \"../Crime/Crimes\";\nimport { calculateClassEarnings } from \"../Work/formulas/Class\";\nimport { ClassType } from \"../Work/ClassWork\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { calculateFactionExp, calculateFactionRep } from \"../Work/formulas/Faction\";\nimport { FactionWorkType } from \"../Work/data/FactionWorkType\";\n\nimport { Player as INetscriptPlayer, Server as IServerDef } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { defaultMultipliers } from \"../PersonObjects/Multipliers\";\n\nexport function NetscriptFormulas(): InternalAPI {\n const checkFormulasAccess = function (ctx: NetscriptContext): void {\n if (!player.hasProgram(Programs.Formulas.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Requires Formulas.exe to run.`);\n }\n };\n return {\n mockServer: () => (): IServerDef => ({\n cpuCores: 0,\n ftpPortOpen: false,\n hasAdminRights: false,\n hostname: \"\",\n httpPortOpen: false,\n ip: \"\",\n isConnectedTo: false,\n maxRam: 0,\n organizationName: \"\",\n ramUsed: 0,\n smtpPortOpen: false,\n sqlPortOpen: false,\n sshPortOpen: false,\n purchasedByPlayer: false,\n backdoorInstalled: false,\n baseDifficulty: 0,\n hackDifficulty: 0,\n minDifficulty: 0,\n moneyAvailable: 0,\n moneyMax: 0,\n numOpenPortsRequired: 0,\n openPortCount: 0,\n requiredHackingSkill: 0,\n serverGrowth: 0,\n }),\n mockPlayer: () => (): INetscriptPlayer => ({\n hp: { current: 0, max: 0 },\n skills: {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n },\n exp: {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n },\n mults: defaultMultipliers(),\n numPeopleKilled: 0,\n money: 0,\n city: \"\",\n location: \"\",\n bitNodeN: 0,\n totalPlaytime: 0,\n playtimeSinceLastAug: 0,\n playtimeSinceLastBitnode: 0,\n jobs: {},\n factions: [],\n tor: false,\n hasCorporation: false,\n inBladeburner: false,\n entropy: 0,\n }),\n reputation: {\n calculateFavorToRep:\n (ctx: NetscriptContext) =>\n (_favor: unknown): number => {\n const favor = helpers.number(ctx, \"favor\", _favor);\n checkFormulasAccess(ctx);\n return calculateFavorToRep(favor);\n },\n calculateRepToFavor:\n (ctx: NetscriptContext) =>\n (_rep: unknown): number => {\n const rep = helpers.number(ctx, \"rep\", _rep);\n checkFormulasAccess(ctx);\n return calculateRepToFavor(rep);\n },\n repFromDonation:\n (ctx: NetscriptContext) =>\n (_amount: unknown, _player: unknown): number => {\n const amount = helpers.number(ctx, \"amount\", _amount);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return repFromDonation(amount, player);\n },\n },\n skills: {\n calculateSkill:\n (ctx: NetscriptContext) =>\n (_exp: unknown, _mult: unknown = 1): number => {\n const exp = helpers.number(ctx, \"exp\", _exp);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateSkill(exp, mult);\n },\n calculateExp:\n (ctx: NetscriptContext) =>\n (_skill: unknown, _mult: unknown = 1): number => {\n const skill = helpers.number(ctx, \"skill\", _skill);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateExp(skill, mult);\n },\n },\n hacking: {\n hackChance:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingChance(server, player);\n },\n hackExp:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingExpGain(server, player);\n },\n hackPercent:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent:\n (ctx: NetscriptContext) =>\n (_server: unknown, _threads: unknown, _player: unknown, _cores: unknown = 1): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const cores = helpers.number(ctx, \"cores\", _cores);\n checkFormulasAccess(ctx);\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingTime(server, player) * 1000;\n },\n growTime:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateGrowTime(server, player) * 1000;\n },\n weakenTime:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateWeakenTime(server, player) * 1000;\n },\n },\n hacknetNodes: {\n moneyGainRate:\n (ctx: NetscriptContext) =>\n (_level: unknown, _ram: unknown, _cores: unknown, _mult: unknown = 1): number => {\n const level = helpers.number(ctx, \"level\", _level);\n const ram = helpers.number(ctx, \"ram\", _ram);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateMoneyGainRate(level, ram, cores, mult);\n },\n levelUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingLevel: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingLevel = helpers.number(ctx, \"startingLevel\", _startingLevel);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingRam: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingRam = helpers.number(ctx, \"startingRam\", _startingRam);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingCore: unknown, _extraCores: unknown = 1, _costMult: unknown = 1): number => {\n const startingCore = helpers.number(ctx, \"startingCore\", _startingCore);\n const extraCores = helpers.number(ctx, \"extraCores\", _extraCores);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n hacknetNodeCost:\n (ctx: NetscriptContext) =>\n (_n: unknown, _mult: unknown): number => {\n const n = helpers.number(ctx, \"n\", _n);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateNodeCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): DefHacknetNodeConstants => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetNodeConstants);\n },\n },\n hacknetServers: {\n hashGainRate:\n (ctx: NetscriptContext) =>\n (_level: unknown, _ramUsed: unknown, _maxRam: unknown, _cores: unknown, _mult: unknown = 1): number => {\n const level = helpers.number(ctx, \"level\", _level);\n const ramUsed = helpers.number(ctx, \"ramUsed\", _ramUsed);\n const maxRam = helpers.number(ctx, \"maxRam\", _maxRam);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateHashGainRate(level, ramUsed, maxRam, cores, mult);\n },\n levelUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingLevel: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingLevel = helpers.number(ctx, \"startingLevel\", _startingLevel);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingRam: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingRam = helpers.number(ctx, \"startingRam\", _startingRam);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingCore: unknown, _extraCores: unknown = 1, _costMult: unknown = 1): number => {\n const startingCore = helpers.number(ctx, \"startingCore\", _startingCore);\n const extraCores = helpers.number(ctx, \"extraCores\", _extraCores);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n cacheUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingCache: unknown, _extraCache: unknown = 1): number => {\n const startingCache = helpers.number(ctx, \"startingCache\", _startingCache);\n const extraCache = helpers.number(ctx, \"extraCache\", _extraCache);\n checkFormulasAccess(ctx);\n return HScalculateCacheUpgradeCost(startingCache, extraCache);\n },\n hashUpgradeCost:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _level: unknown): number => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const level = helpers.number(ctx, \"level\", _level);\n checkFormulasAccess(ctx);\n const upg = player.hashManager.getUpgrade(upgName);\n if (!upg) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid Hash Upgrade: ${upgName}`);\n }\n return upg.getCost(level);\n },\n hacknetServerCost:\n (ctx: NetscriptContext) =>\n (_n: unknown, _mult: unknown = 1): number => {\n const n = helpers.number(ctx, \"n\", _n);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateServerCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): DefHacknetServerConstants => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetServerConstants);\n },\n },\n gang: {\n wantedPenalty:\n (ctx: NetscriptContext) =>\n (_gang: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n checkFormulasAccess(ctx);\n return calculateWantedPenalty(gang);\n },\n respectGain:\n (ctx: NetscriptContext) =>\n (_gang: unknown, _member: unknown, _task: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateRespectGain(gang, member, task);\n },\n wantedLevelGain:\n (ctx: NetscriptContext) =>\n (_gang: unknown, _member: unknown, _task: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateWantedLevelGain(gang, member, task);\n },\n moneyGain:\n (ctx: NetscriptContext) =>\n (_gang: unknown, _member: unknown, _task: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateMoneyGain(gang, member, task);\n },\n ascensionPointsGain:\n (ctx: NetscriptContext) =>\n (_exp: unknown): number => {\n const exp = helpers.number(ctx, \"exp\", _exp);\n checkFormulasAccess(ctx);\n return calculateAscensionPointsGain(exp);\n },\n ascensionMultiplier:\n (ctx: NetscriptContext) =>\n (_points: unknown): number => {\n const points = helpers.number(ctx, \"points\", _points);\n checkFormulasAccess(ctx);\n return calculateAscensionMult(points);\n },\n },\n work: {\n crimeGains:\n (ctx: NetscriptContext) =>\n (_crimeType: unknown): WorkStats => {\n const crimeType = helpers.string(ctx, \"crimeType\", _crimeType);\n const crime = Object.values(Crimes).find((c) => String(c.type) === crimeType);\n if (!crime) throw new Error(`Invalid crime type: ${crimeType}`);\n return calculateCrimeWorkStats(crime);\n },\n classGains:\n (ctx: NetscriptContext) =>\n (_player: unknown, _classType: unknown, _locationName: unknown): WorkStats => {\n const target = helpers.player(ctx, _player);\n const classType = helpers.string(ctx, \"classType\", _classType);\n const locationName = helpers.string(ctx, \"locationName\", _locationName);\n return calculateClassEarnings(player, target, classType as ClassType, locationName as LocationName);\n },\n factionGains:\n (ctx: NetscriptContext) =>\n (_player: unknown, _workType: unknown, _favor: unknown): WorkStats => {\n const player = helpers.player(ctx, _player);\n const workType = helpers.string(ctx, \"_workType\", _workType) as FactionWorkType;\n const favor = helpers.number(ctx, \"favor\", _favor);\n const exp = calculateFactionExp(player, workType);\n const rep = calculateFactionRep(player, workType, favor);\n exp.reputation = rep;\n return exp;\n },\n // companyGains: (ctx: NetscriptContext) =>_player: unknown (): WorkStats {\n // const player = helpers.player(ctx, _player);\n\n // },\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport { StockMarket, SymbolToStockMap, placeOrder, cancelOrder, initStockMarketFn } from \"../StockMarket/StockMarket\";\nimport { getBuyTransactionCost, getSellTransactionGain } from \"../StockMarket/StockMarketHelpers\";\nimport { OrderTypes } from \"../StockMarket/data/OrderTypes\";\nimport { PositionTypes } from \"../StockMarket/data/PositionTypes\";\nimport { StockSymbols } from \"../StockMarket/data/StockSymbols\";\nimport {\n getStockMarket4SDataCost,\n getStockMarket4STixApiCost,\n getStockMarketWseCost,\n getStockMarketTixApiCost,\n} from \"../StockMarket/StockMarketCosts\";\nimport { Stock } from \"../StockMarket/Stock\";\nimport { StockOrder, TIX } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptStockMarket(): InternalAPI {\n /**\n * Checks if the player has TIX API access. Throws an error if the player does not\n */\n const checkTixApiAccess = function (ctx: NetscriptContext): void {\n if (!player.hasWseAccount) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You don't have WSE Access! Cannot use ${ctx.function}()`);\n }\n if (!player.hasTixApiAccess) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You don't have TIX API Access! Cannot use ${ctx.function}()`);\n }\n };\n\n const getStockFromSymbol = function (ctx: NetscriptContext, symbol: string): Stock {\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n\n return {\n hasWSEAccount: () => (): boolean => {\n return player.hasWseAccount;\n },\n hasTIXAPIAccess: () => (): boolean => {\n return player.hasTixApiAccess;\n },\n has4SData: () => (): boolean => {\n return player.has4SData;\n },\n has4SDataTIXAPI: () => (): boolean => {\n return player.has4SDataTixApi;\n },\n getSymbols: (ctx: NetscriptContext) => (): string[] => {\n checkTixApiAccess(ctx);\n return Object.values(StockSymbols);\n },\n getPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.price;\n },\n getAskPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getAskPrice();\n },\n getBidPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getBidPrice();\n },\n getPosition:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): [number, number, number, number] => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid stock symbol: ${symbol}`);\n }\n return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];\n },\n getMaxShares:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.maxShares;\n },\n getPurchaseCost:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _posType: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n let shares = helpers.number(ctx, \"shares\", _shares);\n const posType = helpers.string(ctx, \"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return Infinity;\n }\n\n const res = getBuyTransactionCost(stock, shares, pos);\n if (res == null) {\n return Infinity;\n }\n\n return res;\n },\n getSaleGain:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _posType: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n let shares = helpers.number(ctx, \"shares\", _shares);\n const posType = helpers.string(ctx, \"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return 0;\n }\n\n const res = getSellTransactionGain(stock, shares, pos);\n if (res == null) {\n return 0;\n }\n\n return res;\n },\n buyStock:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = buyStock(stock, shares, ctx, {});\n return res ? stock.getAskPrice() : 0;\n },\n sellStock:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellStock(stock, shares, ctx, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n buyShort:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = shortStock(stock, shares, ctx, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n sellShort:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellShort(stock, shares, ctx, {});\n\n return res ? stock.getAskPrice() : 0;\n },\n placeOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n const price = helpers.number(ctx, \"price\", _price);\n const type = helpers.string(ctx, \"type\", _type);\n const pos = helpers.string(ctx, \"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, ctx);\n },\n cancelOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n const price = helpers.number(ctx, \"price\", _price);\n const type = helpers.string(ctx, \"type\", _type);\n const pos = helpers.string(ctx, \"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n if (isNaN(shares) || isNaN(price)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`,\n );\n }\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid position type: ${pos}`);\n }\n const params = {\n stock: stock,\n shares: shares,\n price: price,\n type: orderType,\n pos: orderPos,\n };\n return cancelOrder(params, ctx);\n },\n getOrders: (ctx: NetscriptContext) => (): StockOrder => {\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must either be in BitNode-8 or have Source-File 8 Level 3.\");\n }\n }\n\n const orders: StockOrder = {};\n\n const stockMarketOrders = StockMarket[\"Orders\"];\n for (const symbol of Object.keys(stockMarketOrders)) {\n const orderBook = stockMarketOrders[symbol];\n if (orderBook.constructor === Array && orderBook.length > 0) {\n orders[symbol] = [];\n for (let i = 0; i < orderBook.length; ++i) {\n orders[symbol].push({\n shares: orderBook[i].shares,\n price: orderBook[i].price,\n type: orderBook[i].type,\n position: orderBook[i].pos,\n });\n }\n }\n }\n\n return orders;\n },\n getVolatility:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.mv / 100; // Convert from percentage to decimal\n },\n getForecast:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n let forecast = 50;\n stock.b ? (forecast += stock.otlkMag) : (forecast -= stock.otlkMag);\n return forecast / 100; // Convert from percentage to decimal\n },\n purchase4SMarketData: (ctx: NetscriptContext) => (): boolean => {\n if (player.has4SData) {\n helpers.log(ctx, () => \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (player.money < getStockMarket4SDataCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n player.has4SData = true;\n player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: (ctx: NetscriptContext) => (): boolean => {\n checkTixApiAccess(ctx);\n\n if (player.has4SDataTixApi) {\n helpers.log(ctx, () => \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (player.money < getStockMarket4STixApiCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase 4S Market Data TIX API\");\n return false;\n }\n\n player.has4SDataTixApi = true;\n player.loseMoney(getStockMarket4STixApiCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased 4S Market Data TIX API\");\n return true;\n },\n purchaseWseAccount: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasWseAccount) {\n helpers.log(ctx, () => \"Already purchased WSE Account\");\n return true;\n }\n\n if (player.money < getStockMarketWseCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase WSE Account Access\");\n return false;\n }\n\n player.hasWseAccount = true;\n initStockMarketFn();\n player.loseMoney(getStockMarketWseCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased WSE Account Access\");\n return true;\n },\n purchaseTixApi: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasTixApiAccess) {\n helpers.log(ctx, () => \"Already purchased TIX API\");\n return true;\n }\n\n if (player.money < getStockMarketTixApiCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase TIX API Access\");\n return false;\n }\n\n player.hasTixApiAccess = true;\n player.loseMoney(getStockMarketTixApiCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased TIX API\");\n return true;\n },\n };\n}\n","import { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { hasAugmentationPrereqs } from \"../Faction/FactionHelpers\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { GraftableAugmentation } from \"../PersonObjects/Grafting/GraftableAugmentation\";\nimport { getGraftingAvailableAugs, calculateGraftingTimeWithBonus } from \"../PersonObjects/Grafting/GraftingHelpers\";\nimport { Player as player } from \"../Player\";\nimport { Grafting as IGrafting } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Router } from \"../ui/GameRoot\";\nimport { GraftingWork } from \"../Work/GraftingWork\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptGrafting(): InternalAPI {\n const checkGraftingAPIAccess = (ctx: NetscriptContext): void => {\n if (!player.canAccessGrafting()) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You do not currently have access to the Grafting API. This is either because you are not in BitNode 10 or because you do not have Source-File 10\",\n );\n }\n };\n\n return {\n getAugmentationGraftPrice:\n (ctx: NetscriptContext) =>\n (_augName: unknown): number => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return graftableAug.cost;\n },\n\n getAugmentationGraftTime:\n (ctx: NetscriptContext) =>\n (_augName: string): number => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return calculateGraftingTimeWithBonus(player, graftableAug);\n },\n\n getGraftableAugmentations: (ctx: NetscriptContext) => (): string[] => {\n checkGraftingAPIAccess(ctx);\n const graftableAugs = getGraftingAvailableAugs(player);\n return graftableAugs;\n },\n\n graftAugmentation:\n (ctx: NetscriptContext) =>\n (_augName: string, _focus: unknown = true): boolean => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n const focus = !!_focus;\n checkGraftingAPIAccess(ctx);\n if (player.city !== CityName.NewTokyo) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must be in New Tokyo to begin grafting an Augmentation.\");\n }\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n helpers.log(ctx, () => `Invalid aug: ${augName}`);\n return false;\n }\n\n const wasFocusing = player.focus;\n\n const craftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n if (player.money < craftableAug.cost) {\n helpers.log(ctx, () => `You don't have enough money to craft ${augName}`);\n return false;\n }\n\n if (!hasAugmentationPrereqs(craftableAug.augmentation)) {\n helpers.log(ctx, () => `You don't have the pre-requisites for ${augName}`);\n return false;\n }\n\n player.startWork(\n new GraftingWork({\n singularity: true,\n augmentation: augName,\n player: player,\n }),\n );\n\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n\n helpers.log(ctx, () => `Began grafting Augmentation ${augName}.`);\n return true;\n },\n };\n}\n","import { saveObject } from \"../SaveObject\";\nimport { Script } from \"../Script/Script\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { IFileLine } from \"./v1APIBreak\";\nimport { openV2Modal } from \"./V2Modal\";\n\nconst singularity = [\n \"applyToCompany\",\n \"b1tflum3\",\n \"checkFactionInvitations\",\n \"commitCrime\",\n \"connect\",\n \"createProgram\",\n \"destroyW0r1dD43m0n\",\n \"donateToFaction\",\n \"getAugmentationBasePrice\",\n \"getAugmentationCost\",\n \"getAugmentationPrereq\",\n \"getAugmentationPrice\",\n \"getAugmentationRepReq\",\n \"getAugmentationsFromFaction\",\n \"getAugmentationStats\",\n \"getCompanyFavor\",\n \"getCompanyFavorGain\",\n \"getCompanyRep\",\n \"getCrimeChance\",\n \"getCrimeStats\",\n \"getCurrentServer\",\n \"getDarkwebProgramCost\",\n \"getDarkwebPrograms\",\n \"getFactionFavor\",\n \"getFactionFavorGain\",\n \"getFactionRep\",\n \"getOwnedAugmentations\",\n \"getOwnedSourceFiles\",\n \"getUpgradeHomeCoresCost\",\n \"getUpgradeHomeRamCost\",\n \"goToLocation\",\n \"gymWorkout\",\n \"hospitalize\",\n \"installAugmentations\",\n \"installBackdoor\",\n \"isBusy\",\n \"isFocused\",\n \"joinFaction\",\n \"manualHack\",\n \"purchaseAugmentation\",\n \"purchaseProgram\",\n \"purchaseTor\",\n \"quitJob\",\n \"setFocus\",\n \"softReset\",\n \"stopAction\",\n \"travelToCity\",\n \"universityCourse\",\n \"upgradeHomeCores\",\n \"upgradeHomeRam\",\n \"workForCompany\",\n \"workForFaction\",\n];\n\nconst getPlayerFields = [\n \"workChaExpGained\",\n \"currentWorkFactionName\",\n \"workDexExpGained\",\n \"workHackExpGained\",\n \"createProgramReqLvl\",\n \"workStrExpGained\",\n \"companyName\",\n \"crimeType\",\n \"workRepGained\",\n \"workChaExpGainRate\",\n \"workType\",\n \"workStrExpGainRate\",\n \"isWorking\",\n \"workRepGainRate\",\n \"workDefExpGained\",\n \"currentWorkFactionDescription\",\n \"workHackExpGainRate\",\n \"workAgiExpGainRate\",\n \"workDexExpGainRate\",\n \"workMoneyGained\",\n \"workMoneyLossRate\",\n \"workMoneyGainRate\",\n \"createProgramName\",\n \"workDefExpGainRate\",\n \"workAgiExpGained\",\n \"className\",\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"intelligence\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"intelligence_exp\",\n \"hp\",\n \"max_hp\",\n \"hasWseAccount\",\n \"hasTixApiAccess\",\n \"has4SData\",\n \"has4SDataTixApi\",\n];\n\nconst mults = [\n \"hacking_chance_mult\",\n \"hacking_speed_mult\",\n \"hacking_money_mult\",\n \"hacking_grow_mult\",\n \"hacking_mult\",\n \"hacking_exp_mult\",\n \"strength_mult\",\n \"strength_exp_mult\",\n \"defense_mult\",\n \"defense_exp_mult\",\n \"dexterity_mult\",\n \"dexterity_exp_mult\",\n \"agility_mult\",\n \"agility_exp_mult\",\n \"charisma_mult\",\n \"charisma_exp_mult\",\n \"hacknet_node_money_mult\",\n \"hacknet_node_purchase_cost_mult\",\n \"hacknet_node_ram_cost_mult\",\n \"hacknet_node_core_cost_mult\",\n \"hacknet_node_level_cost_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"work_money_mult\",\n \"crime_success_mult\",\n \"crime_money_mult\",\n \"bladeburner_max_stamina_mult\",\n \"bladeburner_stamina_gain_mult\",\n \"bladeburner_analysis_mult\",\n \"bladeburner_success_chance_mult\",\n];\n\ninterface IRule {\n matchJS: RegExp;\n matchScript?: RegExp;\n reason: string;\n offenders: IFileLine[];\n}\n\nexport const v2APIBreak = () => {\n const home = GetServer(\"home\");\n if (!home) throw new Error(\"'home' server was not found.\");\n const rules: IRule[] = [\n {\n matchJS: /ns\\.workForCompany/g,\n matchScript: /workForCompany/g,\n reason: \"workForCompany argument companyName is now not-optional.\",\n offenders: [],\n },\n {\n matchJS: /ns\\.getScriptExpGain/g,\n matchScript: /getScriptExpGain/g,\n reason: \"getScriptExpGain with 0 argument no longer returns the sum of all scripts. Use getTotalScriptExpGain\",\n offenders: [],\n },\n {\n matchJS: /ns\\.getScriptExpGain/g,\n matchScript: /getScriptExpGain/g,\n reason: \"getScriptIncome with 0 argument no longer returns the sum of all scripts. Use getTotalScriptIncome\",\n offenders: [],\n },\n {\n matchJS: /ns\\.scp/g,\n matchScript: /scp/g,\n reason:\n \"scp arguments were switch, it is now scp(files, destination, optionally_source). If you were using 2 argument (not 3) this doesn't affect you.\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.buy/g,\n matchScript: /stock\\.buy/g,\n reason: \"buy is a very common word so in order to avoid ram costs it was renamed ns.stock.buyStock\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.sell/g,\n matchScript: /stock\\.sell/g,\n reason: \"sell is a very common word so in order to avoid ram costs it was renamed ns.stock.sellStock\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.short/g,\n matchScript: /stock\\.short/g,\n reason: \"short is a very common word so in order to avoid ram costs it was renamed ns.stock.buyShort\",\n offenders: [],\n },\n {\n matchJS: /ns\\.corporation\\.bribe/g,\n matchScript: /corporation\\.bribe/g,\n reason: \"bribe no longer allows you to give shares of the corporation, only money\",\n offenders: [],\n },\n ];\n\n for (const fn of singularity) {\n rules.push({\n matchJS: new RegExp(`ns.${fn}`, \"g\"),\n reason: `ns.${fn} was moved to ns.singularity.${fn}`,\n offenders: [],\n });\n }\n\n for (const mult of mults) {\n rules.push({\n matchJS: new RegExp(mult, \"g\"),\n reason: `ns.getPlayer().${mult} was moved to ns.getPlayer().mults.${mult.slice(0, mult.length - 5)}`,\n offenders: [],\n });\n }\n\n for (const f of getPlayerFields) {\n rules.push({\n matchJS: new RegExp(f, \"g\"),\n reason: `The work system is completely reworked and ns.getPlayer().${f} no longer exists. This data is likely available inside ns.getPlayer().currentWork, skills, exp, or hp`,\n offenders: [],\n });\n }\n\n for (const script of home.scripts) {\n processScript(rules, script);\n }\n\n home.writeToTextFile(\"V2_0_0_API_BREAK.txt\", formatRules(rules));\n openV2Modal();\n\n for (const server of GetAllServers()) {\n server.runningScripts = [];\n }\n saveObject.exportGame();\n};\n\nconst formatOffenders = (offenders: IFileLine[]): string => {\n const files: Record = {};\n for (const off of offenders) {\n const current = files[off.file] ?? [];\n current.push(off);\n files[off.file] = current;\n }\n\n let txt = \"\";\n for (const file in files) {\n txt += \"\\t\" + file + \"\\n\";\n for (const fileline of files[file]) {\n txt += `\\t\\tLine ${fileline.line} ${fileline.content.trim()}\\n`;\n }\n }\n return txt;\n};\n\nconst formatRules = (rules: IRule[]): string => {\n let txt =\n \"This file contains the list of potential API break. A pattern was used to look through all your files and note the spots where you might have a problem. Not everything here is broken.\";\n for (const rule of rules) {\n if (rule.offenders.length === 0) continue;\n txt += String(rule.matchJS) + \"\\n\";\n txt += rule.reason + \"\\n\\n\";\n txt += formatOffenders(rule.offenders);\n txt += \"\\n\\n\";\n }\n return txt;\n};\n\nconst processScript = (rules: IRule[], script: Script) => {\n const lines = script.code.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n for (const rule of rules) {\n const line = lines[i];\n const match = script.filename.endsWith(\".script\") ? rule.matchScript ?? rule.matchJS : rule.matchJS;\n if (line.match(match)) {\n rule.offenders.push({\n file: script.filename,\n line: i + 1,\n content: line,\n });\n }\n }\n }\n};\n","import React, { useState, useEffect } from \"react\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Button from \"@mui/material/Button\";\nimport ArrowForwardIos from \"@mui/icons-material/ArrowForwardIos\";\nimport ArrowBackIos from \"@mui/icons-material/ArrowBackIos\";\nimport { ITutorialEvents } from \"./ITutorialEvents\";\nimport { CopyableText } from \"../React/CopyableText\";\n\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\";\nimport StorageIcon from \"@mui/icons-material/Storage\";\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nimport {\n iTutorialPrevStep,\n iTutorialNextStep,\n ITutorial,\n iTutorialSteps,\n iTutorialEnd,\n} from \"../../InteractiveTutorial\";\nimport { NSSelection } from \"./NSSelection\";\n\ninterface IContent {\n content: React.ReactElement;\n canNext: boolean;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n borderBottom: \"1px solid \" + theme.palette.primary.main,\n },\n code: {\n whiteSpace: \"pre\",\n backgroundColor: theme.palette.background.paper,\n },\n }),\n);\n\nenum Language {\n None,\n NS1,\n NS2,\n}\n\nexport function InteractiveTutorialRoot(): React.ReactElement {\n const [nsSelectionOpen, setNSSelectionOpen] = useState(false);\n const [language, setLanguage] = useState(Language.None);\n const classes = useStyles();\n\n const tutorialScriptExtension = {\n [Language.None]: \".script\",\n [Language.NS1]: \".script\",\n [Language.NS2]: \".js\",\n }[language];\n const tutorialScriptName = `n00dles${tutorialScriptExtension}`;\n\n const contents: { [number: string]: IContent | undefined } = {\n [iTutorialSteps.Start as number]: {\n content: (\n <>\n \n Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian\n future... The year is 2077...\n
\n
\n This tutorial will show you the basics of the game. You may skip the tutorial at any time.\n
\n
\n You can also collapse this panel to temporarily hide this tutorial.\n
\n \n ),\n canNext: true,\n },\n [iTutorialSteps.NSSelection as number]: {\n content: (\n <>\n The tutorial will adjust to your programming ability.\n Bitburner has 2 types of scripts:\n \n \n NS1: Javascript from 2009, very simple. Recommended for beginners to programming.\n \n \n \n NS2: Native, modern Javascript. Recommended if you know any programming language or are serious about\n learning programming.\n \n \n \n \n Both are available at all time and interchangeably. This choice is only for the tutorial.\n \n {\n setLanguage(Language.NS1);\n iTutorialNextStep();\n }}\n >\n Use NS1\n \n {\n setLanguage(Language.NS2);\n iTutorialNextStep();\n }}\n >\n Use NS2\n \n \n
\n \n ),\n canNext: false,\n },\n [iTutorialSteps.GoToCharacterPage as number]: {\n content: (\n <>\n Let's start by heading to the Stats page. Click\n \n \n Stats\n \n\n on the main navigation menu (left-hand side of the screen)\n \n ),\n canNext: false,\n },\n [iTutorialSteps.CharacterPage as number]: {\n content: (\n <>\n \n \n Stats\n \n \n shows a lot of important information about your progress, such as your skills, money, and bonuses.\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.CharacterGoToTerminalPage as number]: {\n content: (\n <>\n Let's head to your computer's terminal by clicking\n \n \n Terminal\n \n on the main navigation menu.\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalIntro as number]: {\n content: (\n <>\n \n \n Terminal\n \n \n is used to interface with your home computer as well as all of the other machines around the world.\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHelp as number]: {\n content: (\n <>\n Let's try it out. Start by entering\n {\"[home ~/]> help\"}\n (Don't forget to press Enter after typing the command)\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalLs as number]: {\n content: (\n <>\n {\"[home ~/]> help\"}\n \n displays a list of all available Terminal commands, how to use them, and a description of what they do.{\" \"}\n
\n
\n Let's try another command. Enter\n
\n\n {\"[home ~/]> ls\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScan as number]: {\n content: (\n <>\n {\"[home ~/]> ls\"}\n \n {\" \"}\n is a basic command that shows files on the computer. Right now, it shows that you have a program called{\" \"}\n NUKE.exe on your computer. We'll get to what this does later.
\n
\n Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that\n now by first entering\n
\n {\"[home ~/]> scan\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze1 as number]: {\n content: (\n <>\n {\"[home ~/]> scan\"}\n \n shows all available network connections. In other words, it displays a list of all servers that can be\n connected to from your current machine. A server is identified by its hostname.
\n
\n That's great and all, but there's so many servers. Which one should you go to?{\" \"}\n
\n\n {\"[home ~/]> scan-analyze\"}\n gives some more detailed information about servers on the network. Try it now!\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze2 as number]: {\n content: (\n <>\n {\"[home ~/]> scan-analyze\"}\n \n shows more detailed information about each server that you can connect to (servers that are a distance of\n one node away).
\n
It is also possible to run scan-analyze with a higher depth. Let's try a depth of two with the\n following command:{\" \"}\n
\n\n {\"[home ~/]> scan-analyze 2\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalConnect as number]: {\n content: (\n <>\n \n Now you can see information about all servers that are up to two nodes away, as well as figure out how to\n navigate to those servers through the network. You can only connect to a server that is one node away. To\n connect to a machine, use\n \n {\"[home ~/]> connect hostname\"}\n\n From the results of \n {\"[home ~/]> scan-analyze 2\"}\n\n \n {\" \"}\n we can see that the n00dles server is only one node away. Let's connect to it now using:\n \n\n {\"[home ~/]> connect n00dles\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalAnalyze as number]: {\n content: (\n <>\n \n You are now connected to another machine! What can you do now? You can hack it!\n
\n
In the year 2077, currency has become digital and decentralized. People and corporations store their\n money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain\n experience.
\n
\n Before you try to hack a server, you should run diagnostics using{\" \"}\n
\n {\"[n00dles ~/]> analyze\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalNuke as number]: {\n content: (\n <>\n When \n {\"[n00dles ~/]> analyze\"}\n\n \n finishes running it will show useful information about hacking the server.
\n
For this server, the required hacking skill is only 1, which means you can hack it right now.\n However, in order to hack a server you must first gain root access. The NUKE.exe program that we saw earlier\n on your home computer is a virus that will grant you root access to a machine if there are enough open\n ports.\n
\n {\"[n00dles ~/]> analyze\"}\n\n \n {\" \"}\n shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead\n and run the virus using{\" \"}\n \n {\"[n00dles ~/]> run NUKE.exe\"}\n\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalManualHack as number]: {\n content: (\n <>\n You now have root access! You can hack the server using \n {\"[n00dles ~/]> hack\"}\n\n Try doing that now.\n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHackingMechanics as number]: {\n content: (\n \n You are now attempting to hack the server. Performing a hack takes time and only has a certain percentage\n chance of success. This time and success chance is determined by a variety of factors, including your hacking\n skill and the server's security level.\n
\n
\n If your attempt to hack the server is successful, you will steal a certain percentage of the server's total\n money. This percentage is affected by your hacking skill and the server's security level.\n
\n
\n The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money,\n then you will encounter diminishing returns in your hacking. You will need to use{\" \"}\n {\"[n00dles ~/]> grow\"}\n which tricks the company into adding money to their server and{\" \"}\n {\"[n00dles ~/]> weaken\"}\n which increases the speed of hack and grow.\n
\n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalGoHome as number]: {\n content: (\n <>\n From any server you can get back home using\n {\"[n00dles ~/]> home\"}\n\n Let's head home before creating our first script!\n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalCreateScript as number]: {\n content: (\n <>\n \n Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be\n hacking manually the entire time. You can automate your hacking by writing scripts!\n
\n
\n To create a new script or edit an existing one, you can use{\" \"}\n
\n {\"[home ~/]> nano\"}\n\n \n Scripts must end with the {tutorialScriptExtension} extension. Let's make a script now by entering{\" \"}\n \n {`[n00dles ~/]> nano ${tutorialScriptName}`}\n\n \n after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)\n \n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTypeScript as number]: {\n content: (\n <>\n \n This is the script editor. You can use it to program your scripts.{\" \"}\n {language !== Language.NS2 && <>Scripts are written in a simplified version of javascript.} Copy and\n paste the following code into the script editor:
\n
\n\n \n {language !== Language.NS2 && (\n \n )}\n {language === Language.NS2 && (\n \n )}\n \n \n For anyone with basic programming experience, this code should be straightforward. This script will\n continuously hack the n00dles server.\n
\n
\n To save and close the script editor, press the button in the bottom left, or press ctrl + s then ctrl + b.\n
\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalFree as number]: {\n content: (\n <>\n \n Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine\n which you have root access to. Different servers have different amounts of RAM. You can also purchase more\n RAM for your home server.\n
\n
\n To check how much RAM is available on this machine, enter\n
\n {\"[n00dles ~/]> free\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalRunScript as number]: {\n content: (\n <>\n \n We have 4GB of free RAM on this machine, which is enough to run our script. Let's run our script using\n \n {`[n00dles ~/]> run ${tutorialScriptName}`}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalGoToActiveScriptsPage as number]: {\n content: (\n <>\n \n Your script is now running! It will continuously run in the background and will automatically stop if the\n code ever completes (the {tutorialScriptName} will never complete because it runs an infinite loop).
\n
\n These scripts can passively earn you income and hacking experience. Your scripts will also earn money and\n experience while you are offline, although at a slightly slower rate.
\n
\n Let's check out some statistics for our running scripts by clicking{\" \"}\n
\n \n \n Active Scripts\n \n \n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsPage as number]: {\n content: (\n <>\n \n This page displays information about all of your scripts that are running across every server. You can use\n this to gauge how well your scripts are doing. Let's go back to\n \n \n \n Terminal\n \n \n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsToTerminal as number]: {\n content: (\n <>\n \n One last thing about scripts, each active script contains logs that detail what it's doing. We can check\n these logs using the tail command. Do that now for the script we just ran by typing{\" \"}\n \n {`[n00dles ~/]> tail ${tutorialScriptName}`}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTailScript as number]: {\n content: (\n <>\n \n The log for this script won't show much right now (it might show nothing at all) because it just started\n running...but check back again in a few minutes!
\n
\n This covers the basics of hacking. To learn more about writing scripts, select\n
\n \n \n Tutorial\n \n \n in the main navigation menu to look at the documentation.\n
\n
\n For now, let's move on to something else!\n
\n \n ),\n canNext: true,\n },\n [iTutorialSteps.GoToHacknetNodesPage as number]: {\n content: (\n <>\n \n Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and\n upgrading Hacknet Nodes. Let's go to\n \n \n \n Hacknet\n \n through the main navigation menu now.\n \n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesIntroduction as number]: {\n content: (\n \n Here you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now.\n \n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesGoToWorldPage as number]: {\n content: (\n <>\n \n You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online\n and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.\n
\n
\n Let's go to\n
\n \n \n City\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.WorldDescription as number]: {\n content: (\n <>\n \n This page lists all of the different locations you can currently travel to. Each location has something that\n you can do. There's a lot of content out in the world, make sure you explore and discover!\n
\n
\n Lastly, click on\n
\n \n \n Tutorial\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.TutorialPageInfo as number]: {\n content: (\n \n This page contains a lot of different documentation about the game's content and mechanics. I know it's a lot,\n but I highly suggest you read (or at least skim) through this before you start playing . That's the end of the\n tutorial. Hope you enjoy the game!\n \n ),\n canNext: true,\n },\n [iTutorialSteps.End as number]: {\n content: ,\n canNext: true,\n },\n };\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n const step = ITutorial.currStep;\n const content = contents[step];\n if (content === undefined) throw new Error(\"error in the tutorial\");\n return (\n <>\n setNSSelectionOpen(false)} />\n \n {content.content}\n {step !== iTutorialSteps.TutorialPageInfo && (\n <>\n {step !== iTutorialSteps.Start && (\n \n \n \n )}\n {content.canNext && (\n \n \n \n )}\n \n )}\n
\n
\n \n
\n \n );\n}\n","import Editor from \"@monaco-editor/react\";\nimport { Tab, Tabs, Typography } from \"@mui/material\";\nimport React from \"react\";\n\nimport { Modal } from \"../React/Modal\";\n\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nconst ns1Example = `while(true) {\n hack('n00dles');\n}`;\nconst ns2Example = `/** @param {NS} ns */\nexport async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}`;\n\nexport function NSSelection(props: IProps): React.ReactElement {\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n function onMount(editor: IStandaloneCodeEditor): void {\n editor.updateOptions({ readOnly: true });\n }\n\n return (\n \n \n \n \n \n\n {value === 0 && (\n <>\n \n These scripts end with '.script'. Using a very old interpreted version of javascript. It is perfect for\n beginner to programming.\n \n Example script using NS1:\n }\n defaultLanguage=\"javascript\"\n defaultValue={ns1Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n onMount={onMount}\n options={{ fontSize: 30 }}\n />\n \n )}\n {value === 1 && (\n <>\n \n These scripts end with '.js'. Scripts using ns2 are running natively along the game. If you know any\n programming language you should be using this. However if you're unfamiliar with javascript Promises you\n might want to read up on them a little bit before diving in.\n \n Example script using NS2:\n }\n defaultLanguage=\"javascript\"\n defaultValue={ns2Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n options={{ fontSize: 30 }}\n />\n \n )}\n \n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Draggable, { DraggableEventHandler } from \"react-draggable\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Paper from \"@mui/material/Paper\";\nimport KeyboardArrowDownIcon from \"@mui/icons-material/KeyboardArrowDown\";\nimport KeyboardArrowUpIcon from \"@mui/icons-material/KeyboardArrowUp\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport SchoolIcon from \"@mui/icons-material/School\";\nimport { use } from \"../Context\";\nimport { Page } from \"../Router\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Box, Button, Typography } from \"@mui/material\";\nimport { debounce } from \"lodash\";\n\nconst useStyles = makeStyles({\n overviewContainer: {\n position: \"fixed\",\n top: 0,\n right: 0,\n zIndex: 1500,\n display: \"flex\",\n justifyContent: \"flex-end\",\n flexDirection: \"column\",\n },\n\n header: {\n cursor: \"grab\",\n textAlign: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n\n visibilityToggle: {\n padding: \"2px\",\n minWidth: \"inherit\",\n backgroundColor: \"transparent\",\n border: \"none\",\n \"&:hover\": {\n backgroundColor: \"rgba(255, 255, 255, 0.1)\",\n },\n },\n\n collapse: {\n borderTop: `1px solid ${Settings.theme.welllight}`,\n margin: \"0 auto\",\n },\n\n icon: {\n fontSize: \"24px\",\n },\n});\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n mode: \"tutorial\" | \"overview\";\n}\n\nexport interface OverviewSettings {\n opened: boolean;\n x: number;\n y: number;\n}\n\nexport function Overview({ children, mode }: IProps): React.ReactElement {\n const draggableRef = useRef(null);\n const [open, setOpen] = useState(Settings.overview.opened);\n const [x, setX] = useState(Settings.overview.x);\n const [y, setY] = useState(Settings.overview.y);\n const classes = useStyles();\n const router = use.Router();\n\n const CurrentIcon = open ? KeyboardArrowUpIcon : KeyboardArrowDownIcon;\n const LeftIcon = mode === \"tutorial\" ? SchoolIcon : EqualizerIcon;\n const header = mode === \"tutorial\" ? \"Tutorial\" : \"Overview\";\n const handleStop: DraggableEventHandler = (e, data) => {\n setX(data.x);\n setY(data.y);\n };\n\n useEffect(() => {\n Settings.overview = { x, y, opened: open };\n }, [open, x, y]);\n\n // Trigger fakeDrag once to make sure loaded data is not outside bounds\n useEffect(() => fakeDrag(), []);\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", fakeDrag);\n return () => {\n window.removeEventListener(\"resize\", fakeDrag);\n };\n }, []);\n\n const fakeDrag = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n // No official way to trigger an onChange to recompute the bounds\n // See: https://github.com/react-grid-layout/react-draggable/issues/363#issuecomment-947751127\n triggerMouseEvent(node, \"mouseover\");\n triggerMouseEvent(node, \"mousedown\");\n triggerMouseEvent(document, \"mousemove\");\n triggerMouseEvent(node, \"mouseup\");\n triggerMouseEvent(node, \"click\");\n }, 100);\n\n const triggerMouseEvent = (node: HTMLDivElement | Document, eventType: string): void => {\n const clickEvent = document.createEvent(\"MouseEvents\");\n clickEvent.initEvent(eventType, true, true);\n node.dispatchEvent(clickEvent);\n };\n\n if (router.page() === Page.BitVerse || router.page() === Page.Loading || router.page() === Page.Recovery)\n return <>;\n return (\n \n \n setOpen((old) => !old)} ref={draggableRef}>\n \n \n \n {header}\n \n \n {\n setOpen((old) => !old)}\n onTouchEnd={() => setOpen((old) => !old)}\n />\n }\n \n \n \n \n {children}\n \n \n \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { KEYCODE } from \"../../utils/helpers/keyCodes\";\nimport clsx from \"clsx\";\nimport { styled, Theme, CSSObject } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport MuiDrawer from \"@mui/material/Drawer\";\nimport List from \"@mui/material/List\";\nimport Divider from \"@mui/material/Divider\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport ListItem from \"@mui/material/ListItem\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Typography from \"@mui/material/Typography\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Badge from \"@mui/material/Badge\";\n\nimport ComputerIcon from \"@mui/icons-material/Computer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\"; // Terminal\nimport CreateIcon from \"@mui/icons-material/Create\"; // Create Script\nimport StorageIcon from \"@mui/icons-material/Storage\"; // Active Scripts\nimport BugReportIcon from \"@mui/icons-material/BugReport\"; // Create Program\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\"; // Stats\nimport ContactsIcon from \"@mui/icons-material/Contacts\"; // Factions\nimport DoubleArrowIcon from \"@mui/icons-material/DoubleArrow\"; // Augmentations\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\"; // Hacknet\nimport PeopleAltIcon from \"@mui/icons-material/PeopleAlt\"; // Sleeves\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\"; // City\nimport AirplanemodeActiveIcon from \"@mui/icons-material/AirplanemodeActive\"; // Travel\nimport WorkIcon from \"@mui/icons-material/Work\"; // Job\nimport TrendingUpIcon from \"@mui/icons-material/TrendingUp\"; // Stock Market\nimport FormatBoldIcon from \"@mui/icons-material/FormatBold\"; // Bladeburner\nimport BusinessIcon from \"@mui/icons-material/Business\"; // Corp\nimport SportsMmaIcon from \"@mui/icons-material/SportsMma\"; // Gang\nimport CheckIcon from \"@mui/icons-material/Check\"; // Milestones\nimport HelpIcon from \"@mui/icons-material/Help\"; // Tutorial\nimport SettingsIcon from \"@mui/icons-material/Settings\"; // options\nimport DeveloperBoardIcon from \"@mui/icons-material/DeveloperBoard\"; // Dev\nimport EmojiEventsIcon from \"@mui/icons-material/EmojiEvents\"; // Achievements\nimport AccountBoxIcon from \"@mui/icons-material/AccountBox\";\nimport PublicIcon from \"@mui/icons-material/Public\";\nimport LiveHelpIcon from \"@mui/icons-material/LiveHelp\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { IRouter, Page } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../../InteractiveTutorial\";\nimport { getAvailableCreatePrograms } from \"../../Programs/ProgramHelpers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { ProgramsSeen } from \"../../Programs/ui/ProgramsRoot\";\nimport { InvitationsSeen } from \"../../Faction/ui/FactionsRoot\";\nimport { hash } from \"../../hash/hash\";\nimport { Locations } from \"../../Locations/Locations\";\n\nconst openedMixin = (theme: Theme): CSSObject => ({\n width: theme.spacing(31),\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen,\n }),\n overflowX: \"hidden\",\n});\n\nconst closedMixin = (theme: Theme): CSSObject => ({\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n overflowX: \"hidden\",\n width: `calc(${theme.spacing(2)} + 1px)`,\n [theme.breakpoints.up(\"sm\")]: {\n width: `calc(${theme.spacing(7)} + 1px)`,\n },\n});\n\nconst Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== \"open\" })(({ theme, open }) => ({\n width: theme.spacing(31),\n whiteSpace: \"nowrap\",\n boxSizing: \"border-box\",\n ...(open && {\n ...openedMixin(theme),\n \"& .MuiDrawer-paper\": openedMixin(theme),\n }),\n ...(!open && {\n ...closedMixin(theme),\n \"& .MuiDrawer-paper\": closedMixin(theme),\n }),\n}));\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n active: {\n borderLeft: \"3px solid \" + theme.palette.primary.main,\n },\n listitem: {},\n }),\n);\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n page: Page;\n opened: boolean;\n onToggled: (newValue: boolean) => void;\n}\n\nexport function SidebarRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const [hackingOpen, setHackingOpen] = useState(true);\n const [characterOpen, setCharacterOpen] = useState(true);\n const [worldOpen, setWorldOpen] = useState(true);\n const [helpOpen, setHelpOpen] = useState(true);\n\n const flashTerminal =\n ITutorial.currStep === iTutorialSteps.CharacterGoToTerminalPage ||\n ITutorial.currStep === iTutorialSteps.ActiveScriptsPage;\n\n const flashStats = ITutorial.currStep === iTutorialSteps.GoToCharacterPage;\n\n const flashActiveScripts = ITutorial.currStep === iTutorialSteps.TerminalGoToActiveScriptsPage;\n\n const flashHacknet = ITutorial.currStep === iTutorialSteps.GoToHacknetNodesPage;\n\n const flashCity = ITutorial.currStep === iTutorialSteps.HacknetNodesGoToWorldPage;\n\n const flashTutorial = ITutorial.currStep === iTutorialSteps.WorldDescription;\n\n const augmentationCount = props.player.queuedAugmentations.length;\n const invitationsCount = props.player.factionInvitations.filter((f) => !InvitationsSeen.includes(f)).length;\n const programCount = getAvailableCreatePrograms(props.player).length - ProgramsSeen.length;\n\n const canOpenFactions =\n props.player.factionInvitations.length > 0 ||\n props.player.factions.length > 0 ||\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenAugmentations =\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenSleeves = props.player.sleeves.length > 0;\n\n const canCorporation = !!props.player.corporation;\n const canGang = !!props.player.gang;\n const canJob = Object.values(props.player.jobs).length > 0;\n const canStockMarket = props.player.hasWseAccount;\n const canBladeburner = !!props.player.bladeburner;\n const canStaneksGift = props.player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1);\n\n function clickTerminal(): void {\n props.router.toTerminal();\n if (flashTerminal) iTutorialNextStep();\n }\n\n function clickScriptEditor(): void {\n props.router.toScriptEditor();\n }\n\n function clickStats(): void {\n props.router.toStats();\n if (flashStats) iTutorialNextStep();\n }\n\n function clickActiveScripts(): void {\n props.router.toActiveScripts();\n if (flashActiveScripts) iTutorialNextStep();\n }\n\n function clickCreateProgram(): void {\n props.router.toCreateProgram();\n }\n\n function clickStaneksGift(): void {\n props.router.toStaneksGift();\n }\n\n function clickFactions(): void {\n props.router.toFactions();\n }\n\n function clickAugmentations(): void {\n props.router.toAugmentations();\n }\n\n function clickSleeves(): void {\n props.router.toSleeves();\n }\n\n function clickHacknet(): void {\n props.router.toHacknetNodes();\n if (flashHacknet) iTutorialNextStep();\n }\n\n function clickCity(): void {\n props.router.toCity();\n if (flashCity) iTutorialNextStep();\n }\n\n function clickTravel(): void {\n props.router.toTravel();\n }\n\n function clickJob(): void {\n props.router.toJob(Locations[Object.keys(props.player.jobs)[0]]);\n }\n\n function clickStockMarket(): void {\n props.router.toStockMarket();\n }\n\n function clickBladeburner(): void {\n props.router.toBladeburner();\n }\n\n function clickCorp(): void {\n props.router.toCorporation();\n }\n\n function clickGang(): void {\n props.router.toGang();\n }\n\n function clickTutorial(): void {\n props.router.toTutorial();\n if (flashTutorial) iTutorialNextStep();\n }\n\n function clickMilestones(): void {\n props.router.toMilestones();\n }\n function clickOptions(): void {\n props.router.toGameOptions();\n }\n\n function clickDev(): void {\n props.router.toDevMenu();\n }\n\n function clickAchievements(): void {\n props.router.toAchievements();\n }\n\n useEffect(() => {\n // Shortcuts to navigate through the game\n // Alt-t - Terminal\n // Alt-c - Character\n // Alt-e - Script editor\n // Alt-s - Active scripts\n // Alt-h - Hacknet Nodes\n // Alt-w - City\n // Alt-j - Job\n // Alt-r - Travel Agency of current city\n // Alt-p - Create program\n // Alt-f - Factions\n // Alt-a - Augmentations\n // Alt-u - Tutorial\n // Alt-o - Options\n // Alt-b - Bladeburner\n // Alt-g - Gang\n function handleShortcuts(this: Document, event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n if ((props.player.currentWork && props.player.focus) || props.router.page() === Page.BitVerse) return;\n if (event.code === KEYCODE.T && event.altKey) {\n event.preventDefault();\n clickTerminal();\n } else if (event.code === KEYCODE.C && event.altKey) {\n event.preventDefault();\n clickStats();\n } else if (event.code === KEYCODE.E && event.altKey) {\n event.preventDefault();\n clickScriptEditor();\n } else if (event.code === KEYCODE.S && event.altKey) {\n event.preventDefault();\n clickActiveScripts();\n } else if (event.code === KEYCODE.H && event.altKey) {\n event.preventDefault();\n clickHacknet();\n } else if (event.code === KEYCODE.W && event.altKey) {\n event.preventDefault();\n clickCity();\n } else if (event.code === KEYCODE.J && event.altKey && !event.ctrlKey && !event.metaKey && canJob) {\n // ctrl/cmd + alt + j is shortcut to open Chrome dev tools\n event.preventDefault();\n clickJob();\n } else if (event.code === KEYCODE.R && event.altKey) {\n event.preventDefault();\n clickTravel();\n } else if (event.code === KEYCODE.P && event.altKey) {\n event.preventDefault();\n clickCreateProgram();\n } else if (event.code === KEYCODE.F && event.altKey) {\n if (props.page == Page.Terminal && Settings.EnableBashHotkeys) {\n return;\n }\n event.preventDefault();\n clickFactions();\n } else if (event.code === KEYCODE.A && event.altKey) {\n event.preventDefault();\n clickAugmentations();\n } else if (event.code === KEYCODE.U && event.altKey) {\n event.preventDefault();\n clickTutorial();\n } else if (event.code === KEYCODE.O && event.altKey) {\n event.preventDefault();\n clickOptions();\n } else if (event.code === KEYCODE.B && event.altKey && props.player.bladeburner) {\n event.preventDefault();\n clickBladeburner();\n } else if (event.code === KEYCODE.G && event.altKey && props.player.gang) {\n event.preventDefault();\n clickGang();\n }\n }\n\n document.addEventListener(\"keydown\", handleShortcuts);\n return () => document.removeEventListener(\"keydown\", handleShortcuts);\n }, []);\n\n const classes = useStyles();\n const [open, setOpen] = useState(props.opened);\n const toggleDrawer = (): void => setOpen((old) => !old);\n\n useEffect(() => {\n props.onToggled(open);\n }, [open]);\n\n return (\n \n \n \n {!open ? : }\n \n \n Bitburner v{CONSTANTS.VersionString}\n \n }\n />\n \n \n \n setHackingOpen((old) => !old)}>\n \n \n \n \n \n Hacking} />\n {hackingOpen ? : }\n \n \n \n \n \n \n \n \n \n \n \n Terminal\n \n \n \n \n \n \n \n \n \n \n \n Script Editor\n \n \n \n \n \n \n \n \n \n \n \n Active Scripts\n \n \n \n \n \n 0 ? programCount : undefined} color=\"error\">\n \n \n \n \n \n \n \n Create Program\n \n \n \n {canStaneksGift && (\n \n \n \n \n \n \n \n \n Stanek's Gift\n \n \n \n )}\n \n \n\n \n setCharacterOpen((old) => !old)}>\n \n \n \n \n \n Character} />\n {characterOpen ? : }\n \n \n \n \n \n \n \n \n \n \n Stats\n \n \n \n {canOpenFactions && (\n \n \n \n \n \n \n \n \n \n \n Factions\n \n \n \n )}\n {canOpenAugmentations && (\n \n \n \n \n \n \n \n \n \n \n Augmentations\n \n \n \n )}\n \n \n \n \n \n \n \n \n Hacknet\n \n \n \n {canOpenSleeves && (\n \n \n \n \n \n \n \n Sleeves\n \n \n )}\n \n\n \n setWorldOpen((old) => !old)}>\n \n \n \n \n \n World} />\n {worldOpen ? : }\n \n \n \n \n \n \n \n \n \n \n City\n \n \n \n \n \n \n \n \n \n \n Travel\n \n \n {canJob && (\n \n \n \n \n \n \n \n Job\n \n \n )}\n {canStockMarket && (\n \n \n \n \n \n \n \n Stock Market\n \n \n )}\n {canBladeburner && (\n \n \n \n \n \n \n \n Bladeburner\n \n \n )}\n {canCorporation && (\n \n \n \n \n \n \n \n Corp\n \n \n )}\n {canGang && (\n \n \n \n \n \n \n \n Gang\n \n \n )}\n \n\n \n setHelpOpen((old) => !old)}>\n \n \n \n \n \n Help} />\n {helpOpen ? : }\n \n \n \n \n \n \n \n \n \n Milestones\n \n \n \n \n \n \n \n \n \n \n Tutorial\n \n \n \n \n \n \n \n \n \n \n Achievements\n \n \n \n \n \n \n \n \n \n Options\n \n \n {process.env.NODE_ENV === \"development\" && (\n \n \n \n \n \n \n \n Dev\n \n \n )}\n \n \n \n );\n}\n","import { Programs } from \"./Programs\";\nimport { Program } from \"./Program\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\n//Returns the programs this player can create.\nexport function getAvailableCreatePrograms(player: IPlayer): Program[] {\n const programs: Program[] = [];\n for (const key of Object.keys(Programs)) {\n // Non-creatable program\n const create = Programs[key].create;\n if (create == null) continue;\n\n // Already has program\n if (player.hasProgram(Programs[key].name)) continue;\n\n // Does not meet requirements\n if (!create.req(player)) continue;\n\n programs.push(Programs[key]);\n }\n\n return programs;\n}\n","/**\n * Root React component for the Augmentations UI page that display all of your\n * owned and purchased Augmentations and Source-Files.\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { InstalledAugmentations } from \"./InstalledAugmentations\";\nimport { PlayerMultipliers } from \"./PlayerMultipliers\";\nimport { PurchasedAugmentations } from \"./PurchasedAugmentations\";\nimport { SourceFilesElement } from \"./SourceFiles\";\n\nimport { canGetBonus } from \"../../ExportBonus\";\nimport { use } from \"../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Container from \"@mui/material/Container\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { Info } from \"@mui/icons-material\";\n\ninterface NFGDisplayProps {\n player: IPlayer;\n}\n\nconst NeuroFluxDisplay = ({ player }: NFGDisplayProps): React.ReactElement => {\n const level = player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0;\n\n return level > 0 ? (\n \n \n NeuroFlux Governor - Level {level}\n \n \n {StaticAugmentations[AugmentationNames.NeuroFluxGovernor].stats}\n \n \n ) : (\n <>\n );\n};\n\ninterface EntropyDisplayProps {\n player: IPlayer;\n}\n\nconst EntropyDisplay = ({ player }: EntropyDisplayProps): React.ReactElement => {\n return player.entropy > 0 ? (\n \n \n Entropy Virus - Level {player.entropy}\n \n \n All multipliers decreased by: {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}%\n (multiplicative)\n \n \n ) : (\n <>\n );\n};\n\ninterface IProps {\n exportGameFn: () => void;\n installAugmentationsFn: () => void;\n}\n\nexport function AugmentationsRoot(props: IProps): React.ReactElement {\n const [installOpen, setInstallOpen] = useState(false);\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n function doExport(): void {\n props.exportGameFn();\n rerender();\n }\n\n function exportBonusStr(): string {\n if (canGetBonus()) return \"(+1 favor to all factions)\";\n return \"\";\n }\n\n function doInstall(): void {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n setInstallOpen(true);\n } else {\n props.installAugmentationsFn();\n }\n }\n\n return (\n \n Augmentations\n \n \n \n Purchased Augmentations\n \n \n Below is a list of all Augmentations you have purchased but not yet installed. Click the button\n below to install them.\n \n \n WARNING: Installing your Augmentations resets most of your progress, including:\n \n
\n - Stats/Skill levels and Experience\n - Money\n - Scripts on every computer but your home computer\n - Purchased servers\n - Hacknet Nodes\n - Faction/Company reputation\n - Stocks\n
\n \n Installing Augmentations lets you start over with the perks and benefits granted by all of the\n Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your\n home computer (but you will lose all programs besides NUKE.exe)\n \n \n }\n >\n \n \n
\n setInstallOpen(false)}\n onConfirm={props.installAugmentationsFn}\n confirmationText={\n <>\n Installing will reset\n
\n
- money\n
- skill / experience\n
- every server except home\n
- factions and reputation\n
\n
\n You will keep:\n
\n
- All scripts on home\n
- home ram and cores\n
\n
\n It is recommended to install several Augmentations at once. Preferably everything from any faction of\n your choosing.\n \n }\n />\n \n 'I never asked for this'}>\n \n \n \n \n It's always a good idea to backup/export your save!}>\n \n \n \n
\n {player.queuedAugmentations.length > 0 ? (\n \n \n \n \n ) : (\n \n No Augmentations have been purchased yet\n \n )}\n
\n\n e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0) > 0) +\n +!!(player.entropy > 0)\n }, 1fr)`,\n gap: 1,\n }}\n >\n \n \n \n\n \n \n \n \n
\n );\n}\n","/**\n * React Component for displaying all of the player's installed Augmentations and\n * Source-Files.\n *\n * It also contains 'configuration' buttons that allow you to change how the\n * Augs/SF's are displayed\n */\nimport { Box, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport List from \"@mui/material/List\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport React, { useState } from \"react\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\n\nexport function InstalledAugmentations(): React.ReactElement {\n const setRerender = useState(true)[1];\n const player = use.Player();\n const sourceAugs = player.augmentations.slice().filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor);\n\n const [selectedAug, setSelectedAug] = useState(sourceAugs[0]);\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceAugs.sort((aug1, aug2) => {\n return aug1.name.localeCompare(aug2.name);\n });\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function sortByAcquirementTime(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime;\n rerender();\n }\n\n function sortInOrder(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically;\n rerender();\n }\n\n return (\n \n \n Installed Augmentations\n \n \n \n \n \n \n \n \n \n {sourceAugs.length > 0 ? (\n \n \n \n {sourceAugs.map((k, i) => (\n setSelectedAug(k)} selected={selectedAug === k}>\n {k.name}\n \n ))}\n \n \n \n \n {selectedAug.name}\n \n \n {(() => {\n const aug = StaticAugmentations[selectedAug.name];\n\n const info = typeof aug.info === \"string\" ? {aug.info} : aug.info;\n const tooltip = (\n <>\n {info}\n
\n
\n {aug.stats}\n \n );\n return tooltip;\n })()}\n
\n
\n
\n ) : (\n \n No Augmentations have been installed yet\n \n )}\n
\n );\n}\n","/**\n * React component for displaying the player's multipliers on the Augmentation UI page\n */\nimport { DoubleArrow } from \"@mui/icons-material\";\nimport { List, ListItem, ListItemText, Paper, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { Multipliers, defaultMultipliers, mergeMultipliers } from \"../../PersonObjects/Multipliers\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\n\nfunction calculateAugmentedStats(): Multipliers {\n let augP: Multipliers = defaultMultipliers();\n for (const aug of Player.queuedAugmentations) {\n const augObj = StaticAugmentations[aug.name];\n augP = mergeMultipliers(augP, augObj.mults);\n }\n return augP;\n}\n\ninterface IBitNodeModifiedStatsProps {\n base: number;\n mult: number;\n color: string;\n}\n\nfunction BitNodeModifiedStats(props: IBitNodeModifiedStatsProps): React.ReactElement {\n // If player doesn't have SF5 or if the property isn't affected by BitNode mults\n if (props.mult === 1 || Player.sourceFileLvl(5) === 0)\n return {numeralWrapper.formatPercentage(props.base)};\n\n return (\n \n {numeralWrapper.formatPercentage(props.base)}{\" \"}\n {numeralWrapper.formatPercentage(props.base * props.mult)}\n \n );\n}\n\ninterface MultiplierListItemData {\n mult: string;\n current: number;\n augmented: number;\n bnMult?: number;\n color?: string;\n}\n\ninterface IMultiplierListProps {\n rows: MultiplierListItemData[];\n}\n\nfunction MultiplierList(props: IMultiplierListProps): React.ReactElement {\n const listItems = props.rows\n .map((data) => {\n const { mult, current, augmented, bnMult = 1, color = Settings.theme.primary } = data;\n\n if (!isNaN(augmented)) {\n return (\n \n \n {mult}\n \n }\n secondary={\n \n \n \n \n \n }\n disableTypography\n />\n \n );\n }\n return;\n })\n .filter((i) => i !== undefined);\n\n return listItems.length > 0 ? {listItems} : <>;\n}\n\nexport function PlayerMultipliers(): React.ReactElement {\n const mults = calculateAugmentedStats();\n\n const leftColData: MultiplierListItemData[] = [\n ...[\n {\n mult: \"Hacking Chance\",\n current: Player.mults.hacking_chance,\n augmented: Player.mults.hacking_chance * mults.hacking_chance,\n },\n {\n mult: \"Hacking Speed\",\n current: Player.mults.hacking_speed,\n augmented: Player.mults.hacking_speed * mults.hacking_speed,\n },\n {\n mult: \"Hacking Money\",\n current: Player.mults.hacking_money,\n augmented: Player.mults.hacking_money * mults.hacking_money,\n bnMult: BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n current: Player.mults.hacking_grow,\n augmented: Player.mults.hacking_grow * mults.hacking_grow,\n },\n {\n mult: \"Hacking Level\",\n current: Player.mults.hacking,\n augmented: Player.mults.hacking * mults.hacking,\n bnMult: BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n current: Player.mults.hacking_exp,\n augmented: Player.mults.hacking_exp * mults.hacking_exp,\n bnMult: BitNodeMultipliers.HackExpGain,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.hack,\n }),\n ),\n ...[\n {\n mult: \"Strength Level\",\n current: Player.mults.strength,\n augmented: Player.mults.strength * mults.strength,\n bnMult: BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n current: Player.mults.strength_exp,\n augmented: Player.mults.strength_exp * mults.strength_exp,\n },\n {\n mult: \"Defense Level\",\n current: Player.mults.defense,\n augmented: Player.mults.defense * mults.defense,\n bnMult: BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n current: Player.mults.defense_exp,\n augmented: Player.mults.defense_exp * mults.defense_exp,\n },\n {\n mult: \"Dexterity Level\",\n current: Player.mults.dexterity,\n augmented: Player.mults.dexterity * mults.dexterity,\n bnMult: BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n current: Player.mults.dexterity_exp,\n augmented: Player.mults.dexterity_exp * mults.dexterity_exp,\n },\n {\n mult: \"Agility Level\",\n current: Player.mults.agility,\n augmented: Player.mults.agility * mults.agility,\n bnMult: BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n current: Player.mults.agility_exp,\n augmented: Player.mults.agility_exp * mults.agility_exp,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.combat,\n }),\n ),\n {\n mult: \"Charisma Level\",\n current: Player.mults.charisma,\n augmented: Player.mults.charisma * mults.charisma,\n bnMult: BitNodeMultipliers.CharismaLevelMultiplier,\n color: Settings.theme.cha,\n },\n {\n mult: \"Charisma Experience\",\n current: Player.mults.charisma_exp,\n augmented: Player.mults.charisma_exp * mults.charisma_exp,\n color: Settings.theme.cha,\n },\n ];\n const rightColData: MultiplierListItemData[] = [\n {\n mult: \"Hacknet Node Production\",\n current: Player.mults.hacknet_node_money,\n augmented: Player.mults.hacknet_node_money * mults.hacknet_node_money,\n bnMult: BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n current: Player.mults.hacknet_node_purchase_cost,\n augmented: Player.mults.hacknet_node_purchase_cost * mults.hacknet_node_purchase_cost,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n current: Player.mults.hacknet_node_ram_cost,\n augmented: Player.mults.hacknet_node_ram_cost * mults.hacknet_node_ram_cost,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n current: Player.mults.hacknet_node_core_cost,\n augmented: Player.mults.hacknet_node_core_cost * mults.hacknet_node_core_cost,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n current: Player.mults.hacknet_node_level_cost,\n augmented: Player.mults.hacknet_node_level_cost * mults.hacknet_node_level_cost,\n },\n {\n mult: \"Company Reputation Gain\",\n current: Player.mults.company_rep,\n augmented: Player.mults.company_rep * mults.company_rep,\n },\n {\n mult: \"Faction Reputation Gain\",\n current: Player.mults.faction_rep,\n augmented: Player.mults.faction_rep * mults.faction_rep,\n bnMult: BitNodeMultipliers.FactionWorkRepGain,\n },\n {\n mult: \"Salary\",\n current: Player.mults.work_money,\n augmented: Player.mults.work_money * mults.work_money,\n bnMult: BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n {\n mult: \"Crime Success Chance\",\n current: Player.mults.crime_success,\n augmented: Player.mults.crime_success * mults.crime_success,\n color: Settings.theme.combat,\n },\n {\n mult: \"Crime Money\",\n current: Player.mults.crime_money,\n augmented: Player.mults.crime_money * mults.crime_money,\n bnMult: BitNodeMultipliers.CrimeMoney,\n color: Settings.theme.money,\n },\n ];\n\n if (Player.canAccessBladeburner()) {\n rightColData.push(\n {\n mult: \"Bladeburner Success Chance\",\n current: Player.mults.bladeburner_success_chance,\n augmented: Player.mults.bladeburner_success_chance * mults.bladeburner_success_chance,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n current: Player.mults.bladeburner_max_stamina,\n augmented: Player.mults.bladeburner_max_stamina * mults.bladeburner_max_stamina,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n current: Player.mults.bladeburner_stamina_gain,\n augmented: Player.mults.bladeburner_stamina_gain * mults.bladeburner_stamina_gain,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n current: Player.mults.bladeburner_analysis,\n augmented: Player.mults.bladeburner_analysis * mults.bladeburner_analysis,\n },\n );\n }\n\n return (\n \n \n \n \n );\n}\n","/**\n * React component for displaying all of the player's purchased (but not installed)\n * Augmentations on the Augmentations UI.\n */\nimport { List, ListItemText, Paper, Tooltip, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { Player } from \"../../Player\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\n\nexport function PurchasedAugmentations(): React.ReactElement {\n const augs: React.ReactElement[] = [];\n // Only render the last NeuroFlux (there are no findLastIndex btw)\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; i++) {\n const ownedAug = Player.queuedAugmentations[i];\n let displayName = ownedAug.name;\n\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n const aug = StaticAugmentations[ownedAug.name];\n\n let level = null;\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ownedAug.level;\n displayName += ` - Level ${level}`;\n }\n\n augs.push(\n \n {(() => {\n const info = typeof aug.info === \"string\" ? {aug.info} : aug.info;\n const tooltip = (\n <>\n {info}\n
\n
\n {aug.stats}\n \n );\n return tooltip;\n })()}\n \n }\n enterNextDelay={500}\n key={displayName}\n >\n \n ,\n );\n }\n\n return (\n \n \n {augs}\n \n \n );\n}\n","import { ListItemButton, ListItemText, Paper } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\nimport List from \"@mui/material/List\";\nimport Typography from \"@mui/material/Typography\";\nimport React, { useState } from \"react\";\nimport { Exploit, ExploitName } from \"../../Exploits/Exploit\";\nimport { Player } from \"../../Player\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { SourceFile } from \"../../SourceFile/SourceFile\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\n\ninterface SfMinus1 {\n info: React.ReactElement;\n n: number;\n name: string;\n lvl: number;\n}\n\nconst safeGetSf = (sfNum: number): SourceFile | SfMinus1 | null => {\n if (sfNum === -1) {\n const sfMinus1: SfMinus1 = {\n info: (\n <>\n This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.\n
\n
\n It increases all of the player's multipliers by 0.1%\n
\n
\n You have found the following exploits:\n
\n
\n {Player.exploits.map((c: Exploit) => (\n \n * {ExploitName(c)}\n
\n
\n ))}\n \n ),\n lvl: Player.exploits.length,\n n: -1,\n name: \"Source-File -1: Exploits in the BitNodes\",\n };\n return sfMinus1;\n }\n\n const srcFileKey = \"SourceFile\" + sfNum;\n const sfObj = SourceFiles[srcFileKey];\n if (sfObj == null) {\n console.error(`Invalid source file number: ${sfNum}`);\n return null;\n }\n return sfObj;\n};\n\nconst getMaxLevel = (sfObj: SourceFile | SfMinus1): string | number => {\n let maxLevel;\n switch (sfObj.n) {\n case 12:\n maxLevel = \"∞\";\n break;\n case -1:\n maxLevel = Object.keys(Exploit).length;\n break;\n default:\n maxLevel = \"3\";\n }\n return maxLevel;\n};\n\nexport function SourceFilesElement(): React.ReactElement {\n const sourceSfs = Player.sourceFiles.slice();\n const exploits = Player.exploits;\n // Create a fake SF for -1, if \"owned\"\n if (exploits.length > 0) {\n sourceSfs.unshift({\n n: -1,\n lvl: exploits.length,\n });\n }\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceSfs.sort((sf1, sf2) => {\n return sf1.n - sf2.n;\n });\n }\n\n if (sourceSfs.length === 0) {\n return <>;\n }\n\n const [selectedSf, setSelectedSf] = useState(sourceSfs[0]);\n\n return (\n \n \n Source Files\n \n \n \n \n {sourceSfs.map((e, i) => {\n const sfObj = safeGetSf(e.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n setSelectedSf(e)}\n selected={selectedSf.n === e.n}\n sx={{ py: 0 }}\n >\n {sfObj.name}}\n secondary={\n \n Level {e.lvl} / {maxLevel}\n \n }\n />\n \n );\n })}\n \n \n \n \n {safeGetSf(selectedSf.n)?.name}\n \n \n {(() => {\n const sfObj = safeGetSf(selectedSf.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n <>\n Level {selectedSf.lvl} / {maxLevel}\n
\n
\n {sfObj.info}\n \n );\n })()}\n
\n
\n
\n
\n );\n}\n","import { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { IEngine } from \"./IEngine\";\nimport { IRouter } from \"./ui/Router\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\n\nimport React, { useEffect } from \"react\";\n\nimport { General } from \"./DevMenu/ui/General\";\nimport { Stats } from \"./DevMenu/ui/Stats\";\nimport { Factions } from \"./DevMenu/ui/Factions\";\nimport { Augmentations } from \"./DevMenu/ui/Augmentations\";\nimport { SourceFiles } from \"./DevMenu/ui/SourceFiles\";\nimport { Programs } from \"./DevMenu/ui/Programs\";\nimport { Servers } from \"./DevMenu/ui/Servers\";\nimport { Companies } from \"./DevMenu/ui/Companies\";\nimport { Bladeburner as BladeburnerElem } from \"./DevMenu/ui/Bladeburner\";\nimport { Gang } from \"./DevMenu/ui/Gang\";\nimport { Corporation } from \"./DevMenu/ui/Corporation\";\nimport { CodingContracts } from \"./DevMenu/ui/CodingContracts\";\nimport { StockMarket } from \"./DevMenu/ui/StockMarket\";\nimport { Sleeves } from \"./DevMenu/ui/Sleeves\";\nimport { Stanek } from \"./DevMenu/ui/Stanek\";\nimport { TimeSkip } from \"./DevMenu/ui/TimeSkip\";\nimport { SaveFile } from \"./DevMenu/ui/SaveFile\";\nimport { Achievements } from \"./DevMenu/ui/Achievements\";\nimport { Entropy } from \"./DevMenu/ui/Entropy\";\nimport Typography from \"@mui/material/Typography\";\nimport { Exploit } from \"./Exploits/Exploit\";\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n router: IRouter;\n}\n\nexport function DevMenuRoot(props: IProps): React.ReactElement {\n useEffect(() => {\n props.player.giveExploit(Exploit.YoureNotMeantToAccessThis);\n }, []);\n return (\n <>\n Development Menu - Only meant to be used for testing/debugging\n \n \n \n \n \n \n \n \n\n {props.player.bladeburner instanceof Bladeburner && }\n\n {props.player.inGang() && }\n\n {props.player.hasCorporation() && }\n\n \n\n {props.player.hasWseAccount && }\n\n {props.player.sleeves.length > 0 && }\n {props.player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1) && }\n\n \n \n \n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../ui/React/Money\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { MenuItem, SelectChangeEvent, TextField, Select } from \"@mui/material\";\nimport { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { checkForMessagesToSend } from \"../../Message/MessageHelpers\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function General(props: IProps): React.ReactElement {\n const [error, setError] = useState(false);\n const [corporationName, setCorporationName] = useState(\"\");\n const [gangFaction, setGangFaction] = useState(\"\");\n\n function addMoney(n: number) {\n return function () {\n props.player.gainMoney(n, \"other\");\n };\n }\n\n function upgradeRam(): void {\n props.player.getHomeComputer().maxRam *= 2;\n }\n\n function quickB1tFlum3(): void {\n props.router.toBitVerse(true, true);\n }\n\n function b1tflum3(): void {\n props.router.toBitVerse(true, false);\n }\n\n function quickHackW0r1dD43m0n(): void {\n props.router.toBitVerse(false, true);\n }\n\n function hackW0r1dD43m0n(): void {\n props.router.toBitVerse(false, false);\n }\n\n function createCorporation(): void {\n props.player.startCorporation(corporationName);\n }\n\n function joinBladeburner(): void {\n props.player.bladeburner = new Bladeburner(props.player);\n }\n\n function startGang(): void {\n const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand;\n props.player.startGang(gangFaction, isHacking);\n }\n\n function setGangFactionDropdown(event: SelectChangeEvent): void {\n setGangFaction(event.target.value);\n }\n\n function checkMessages(): void {\n checkForMessagesToSend();\n }\n\n useEffect(() => {\n if (error) throw new ReferenceError(\"Manually thrown error\");\n }, [error]);\n\n return (\n \n }>\n General\n \n \n \n \n \n \n \n \n
\n Corporation Name:\n setCorporationName(x.target.value)} />\n \n
\n Gang Faction:\n \n \n
\n \n
\n\n \n \n \n \n \n \n
\n
\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n function modifyExp(stat: string, modifier: number) {\n return function (exp: number) {\n switch (stat) {\n case \"hacking\":\n if (exp) {\n props.player.gainHackingExp(exp * modifier);\n }\n break;\n case \"strength\":\n if (exp) {\n props.player.gainStrengthExp(exp * modifier);\n }\n break;\n case \"defense\":\n if (exp) {\n props.player.gainDefenseExp(exp * modifier);\n }\n break;\n case \"dexterity\":\n if (exp) {\n props.player.gainDexterityExp(exp * modifier);\n }\n break;\n case \"agility\":\n if (exp) {\n props.player.gainAgilityExp(exp * modifier);\n }\n break;\n case \"charisma\":\n if (exp) {\n props.player.gainCharismaExp(exp * modifier);\n }\n break;\n case \"intelligence\":\n if (exp) {\n props.player.gainIntelligenceExp(exp * modifier);\n }\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function modifyKarma(modifier: number) {\n return function (amt: number) {\n props.player.karma += amt * modifier;\n };\n }\n\n function tonsOfExp(): void {\n props.player.gainHackingExp(bigNumber);\n props.player.gainStrengthExp(bigNumber);\n props.player.gainDefenseExp(bigNumber);\n props.player.gainDexterityExp(bigNumber);\n props.player.gainAgilityExp(bigNumber);\n props.player.gainCharismaExp(bigNumber);\n props.player.gainIntelligenceExp(bigNumber);\n props.player.updateSkillLevels();\n }\n\n function resetAllExp(): void {\n props.player.exp.hacking = 0;\n props.player.exp.strength = 0;\n props.player.exp.defense = 0;\n props.player.exp.dexterity = 0;\n props.player.exp.agility = 0;\n props.player.exp.charisma = 0;\n props.player.exp.intelligence = 0;\n props.player.updateSkillLevels();\n }\n\n function resetExperience(stat: string): () => void {\n return function () {\n switch (stat) {\n case \"hacking\":\n props.player.exp.hacking = 0;\n break;\n case \"strength\":\n props.player.exp.strength = 0;\n break;\n case \"defense\":\n props.player.exp.defense = 0;\n break;\n case \"dexterity\":\n props.player.exp.dexterity = 0;\n break;\n case \"agility\":\n props.player.exp.agility = 0;\n break;\n case \"charisma\":\n props.player.exp.charisma = 0;\n break;\n case \"intelligence\":\n props.player.exp.intelligence = 0;\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function resetKarma(): () => void {\n return function () {\n props.player.karma = 0;\n };\n }\n\n function enableIntelligence(): void {\n if (props.player.skills.intelligence === 0) {\n props.player.skills.intelligence = 1;\n props.player.updateSkillLevels();\n }\n }\n\n function disableIntelligence(): void {\n props.player.exp.intelligence = 0;\n props.player.skills.intelligence = 0;\n props.player.updateSkillLevels();\n }\n\n return (\n \n }>\n Experience / Stats\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n All:\n \n \n \n
\n Hacking:\n \n modifyExp(\"hacking\", 1)(bigNumber)}\n add={modifyExp(\"hacking\", 1)}\n subtract={modifyExp(\"hacking\", -1)}\n reset={resetExperience(\"hacking\")}\n />\n
\n Strength:\n \n modifyExp(\"strength\", 1)(bigNumber)}\n add={modifyExp(\"strength\", 1)}\n subtract={modifyExp(\"strength\", -1)}\n reset={resetExperience(\"strength\")}\n />\n
\n Defense:\n \n modifyExp(\"defense\", 1)(bigNumber)}\n add={modifyExp(\"defense\", 1)}\n subtract={modifyExp(\"defense\", -1)}\n reset={resetExperience(\"defense\")}\n />\n
\n Dexterity:\n \n modifyExp(\"dexterity\", 1)(bigNumber)}\n add={modifyExp(\"dexterity\", 1)}\n subtract={modifyExp(\"dexterity\", -1)}\n reset={resetExperience(\"dexterity\")}\n />\n
\n Agility:\n \n modifyExp(\"agility\", 1)(bigNumber)}\n add={modifyExp(\"agility\", 1)}\n subtract={modifyExp(\"agility\", -1)}\n reset={resetExperience(\"agility\")}\n />\n
\n Charisma:\n \n modifyExp(\"charisma\", 1)(bigNumber)}\n add={modifyExp(\"charisma\", 1)}\n subtract={modifyExp(\"charisma\", -1)}\n reset={resetExperience(\"charisma\")}\n />\n
\n Intelligence:\n \n modifyExp(\"intelligence\", 1)(bigNumber)}\n add={modifyExp(\"intelligence\", 1)}\n subtract={modifyExp(\"intelligence\", -1)}\n reset={resetExperience(\"intelligence\")}\n />\n \n \n \n \n
\n Karma:\n \n modifyExp(\"intelligence\", 1)(100000)}\n add={modifyKarma(1)}\n subtract={modifyKarma(-1)}\n reset={resetKarma()}\n />\n
\n
\n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Factions as AllFaction } from \"../../Faction/Factions\";\nimport FormControl from \"@mui/material/FormControl\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyAllIcon from \"@mui/icons-material/ReplyAll\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport InputLabel from \"@mui/material/InputLabel\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Factions(props: IProps): React.ReactElement {\n const [faction, setFaction] = useState(FactionNames.Illuminati as string);\n\n function setFactionDropdown(event: SelectChangeEvent): void {\n setFaction(event.target.value);\n }\n\n function receiveInvite(): void {\n props.player.receiveInvite(faction);\n }\n\n function receiveAllInvites(): void {\n Object.values(FactionNames).forEach((faction) => props.player.receiveInvite(faction));\n }\n\n function modifyFactionRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(reputation)) {\n fac.playerReputation += reputation * modifier;\n }\n };\n }\n\n function resetFactionRep(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.playerReputation = 0;\n }\n }\n\n function modifyFactionFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(favor)) {\n fac.favor += favor * modifier;\n }\n };\n }\n\n function resetFactionFavor(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.favor = 0;\n }\n }\n\n function tonsOfRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = bigNumber;\n }\n }\n\n function resetAllRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = 0;\n }\n }\n\n function tonsOfFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = bigNumber;\n }\n }\n\n function resetAllFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = 0;\n }\n }\n\n return (\n \n }>\n Factions\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Faction:\n \n \n Faction\n \n \n \n \n \n \n \n \n }\n >\n {Object.values(AllFaction).map((faction) => (\n \n {faction.name}\n \n ))}\n \n \n
\n Reputation:\n \n modifyFactionRep(1)(bigNumber)}\n add={modifyFactionRep(1)}\n subtract={modifyFactionRep(-1)}\n reset={resetFactionRep}\n />\n
\n Favor:\n \n modifyFactionFavor(1)(2000)}\n add={modifyFactionFavor(1)}\n subtract={modifyFactionFavor(-1)}\n reset={resetFactionFavor}\n />\n
\n All Reputation:\n \n \n \n
\n All Favor:\n \n \n \n
\n
\n
\n );\n}\n","import { Clear, ExpandMore, Reply, ReplyAll } from \"@mui/icons-material\";\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n IconButton,\n MenuItem,\n Select,\n SelectChangeEvent,\n Typography,\n} from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Augmentations(props: IProps): React.ReactElement {\n const [augmentation, setAugmentation] = useState(\"Augmented Targeting I\");\n\n function setAugmentationDropdown(event: SelectChangeEvent): void {\n setAugmentation(event.target.value);\n }\n function queueAug(): void {\n props.player.queueAugmentation(augmentation);\n }\n\n function queueAllAugs(): void {\n for (const augName of Object.values(AugmentationNames)) {\n props.player.queueAugmentation(augName);\n }\n }\n\n function clearAugs(): void {\n props.player.augmentations = [];\n }\n\n function clearQueuedAugs(): void {\n props.player.queuedAugmentations = [];\n }\n\n return (\n \n }>\n Augmentations\n \n \n \n \n \n \n \n \n \n \n }\n endAdornment={\n <>\n \n \n \n \n }\n >\n {Object.values(AugmentationNames).map((aug) => (\n \n {aug}\n \n ))}\n \n \n \n \n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { PlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\n\n// Update as additional BitNodes get implemented\nconst validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function SourceFiles(props: IProps): React.ReactElement {\n function setSF(sfN: number, sfLvl: number) {\n return function () {\n if (sfN === 9) {\n props.player.hacknetNodes = [];\n }\n if (sfLvl === 0) {\n props.player.sourceFiles = props.player.sourceFiles.filter((sf) => sf.n !== sfN);\n return;\n }\n\n if (!props.player.sourceFiles.some((sf) => sf.n === sfN)) {\n props.player.sourceFiles.push(new PlayerOwnedSourceFile(sfN, sfLvl));\n return;\n }\n\n for (let i = 0; i < props.player.sourceFiles.length; i++) {\n if (props.player.sourceFiles[i].n === sfN) {\n props.player.sourceFiles[i].lvl = sfLvl;\n }\n }\n };\n }\n\n function setAllSF(sfLvl: number) {\n return () => {\n for (let i = 0; i < validSFN.length; i++) {\n setSF(validSFN[i], sfLvl)();\n }\n };\n }\n\n function clearExploits(): void {\n props.player.exploits = [];\n }\n\n return (\n \n }>\n Source-Files\n \n \n \n \n \n \n \n \n \n \n \n \n {validSFN.map((i) => (\n \n \n \n \n ))}\n \n
\n Exploits:\n \n \n
\n All:\n \n \n \n \n \n \n \n
\n SF-{i}:\n \n \n \n \n \n \n \n
\n
\n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Programs as AllPrograms } from \"../../Programs/Programs\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Programs(props: IProps): React.ReactElement {\n const [program, setProgram] = useState(\"NUKE.exe\");\n function setProgramDropdown(event: SelectChangeEvent): void {\n setProgram(event.target.value);\n }\n function addProgram(): void {\n if (!props.player.hasProgram(program)) {\n props.player.getHomeComputer().programs.push(program);\n }\n }\n\n function addAllPrograms(): void {\n for (const i of Object.keys(AllPrograms)) {\n if (!props.player.hasProgram(AllPrograms[i].name)) {\n props.player.getHomeComputer().programs.push(AllPrograms[i].name);\n }\n }\n }\n\n return (\n \n }>\n Programs\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Program:\n \n \n
\n Add:\n \n \n \n
\n
\n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { GetServer, GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nexport function Servers(): React.ReactElement {\n const [server, setServer] = useState(\"home\");\n function setServerDropdown(event: SelectChangeEvent): void {\n setServer(event.target.value);\n }\n function rootServer(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n\n function rootAllServers(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n }\n\n function minSecurity(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n\n function minAllSecurity(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n }\n\n function maxMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n\n function maxAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n }\n\n function minMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n\n function minAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n }\n\n return (\n \n }>\n Servers\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Server:\n \n \n
\n Root:\n \n \n \n \n
\n Security:\n \n \n \n \n
\n Money:\n \n \n \n \n \n \n \n \n
\n
\n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Companies as AllCompanies } from \"../../Company/Companies\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { Adjuster } from \"./Adjuster\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\nexport function Companies(): React.ReactElement {\n const [company, setCompany] = useState(FactionNames.ECorp as string);\n function setCompanyDropdown(event: SelectChangeEvent): void {\n setCompany(event.target.value);\n }\n function resetCompanyRep(): void {\n AllCompanies[company].playerReputation = 0;\n }\n\n function modifyCompanyRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(reputation)) {\n c.playerReputation += reputation * modifier;\n }\n };\n }\n\n function modifyCompanyFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(favor)) {\n c.favor += favor * modifier;\n }\n };\n }\n\n function resetCompanyFavor(): void {\n AllCompanies[company].favor = 0;\n }\n\n function tonsOfRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = bigNumber;\n }\n }\n\n function resetAllRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = 0;\n }\n }\n\n function tonsOfFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = bigNumber;\n }\n }\n\n function resetAllFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = 0;\n }\n }\n\n return (\n \n }>\n Companies\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Company:\n \n \n
\n Reputation:\n \n modifyCompanyRep(1)(bigNumber)}\n add={modifyCompanyRep(1)}\n subtract={modifyCompanyRep(-1)}\n reset={resetCompanyRep}\n />\n
\n Favor:\n \n modifyCompanyFavor(1)(2000)}\n add={modifyCompanyFavor(1)}\n subtract={modifyCompanyFavor(-1)}\n reset={resetCompanyFavor}\n />\n
\n All Reputation:\n \n \n \n
\n All Favor:\n \n \n \n
\n
\n
\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Bladeburner(props: IProps): React.ReactElement {\n const bladeburner = props.player.bladeburner;\n if (bladeburner === null) return <>;\n function modifyBladeburnerRank(modify: number): (x: number) => void {\n return function (rank: number): void {\n if (!bladeburner) return;\n bladeburner.changeRank(props.player, rank * modify);\n };\n }\n\n function resetBladeburnerRank(): void {\n if (!bladeburner) return;\n bladeburner.rank = 0;\n bladeburner.maxRank = 0;\n }\n\n function addTonsBladeburnerRank(): void {\n if (!bladeburner) return;\n\n bladeburner.changeRank(props.player, bigNumber);\n }\n\n function modifyBladeburnerCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += cycles * modify;\n };\n }\n\n function resetBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles = 0;\n }\n\n function addTonsBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += bigNumber;\n }\n\n return (\n \n }>\n Bladeburner\n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Rank:\n \n \n
\n Cycles:\n \n \n
\n
\n
\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Gang(props: IProps): React.ReactElement {\n function addTonsGangCycles(): void {\n if (props.player.gang) {\n props.player.gang.storedCycles = bigNumber;\n }\n }\n\n function modifyGangCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (props.player.gang) {\n props.player.gang.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetGangCycles(): void {\n if (props.player.gang) {\n props.player.gang.storedCycles = 0;\n }\n }\n\n return (\n \n }>\n Gang\n \n \n \n \n \n \n \n \n \n
\n Cycles:\n \n \n
\n
\n
\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Corporation(props: IProps): React.ReactElement {\n function addTonsCorporationFunds(): void {\n if (props.player.corporation) {\n props.player.corporation.funds = props.player.corporation.funds + bigNumber;\n }\n }\n\n function modifyCorporationFunds(modify: number): (x: number) => void {\n return function (funds: number): void {\n if (props.player.corporation) {\n props.player.corporation.funds += funds * modify;\n }\n };\n }\n\n function resetCorporationFunds(): void {\n if (props.player.corporation) {\n props.player.corporation.funds = props.player.corporation.funds - props.player.corporation.funds;\n }\n }\n\n function addTonsCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = bigNumber;\n }\n }\n\n function modifyCorporationCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = 0;\n }\n }\n\n function finishCorporationProducts(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n Object.keys(div.products).forEach((prod) => {\n const product = div.products[prod];\n if (product === undefined) throw new Error(\"Impossible product undefined\");\n product.prog = 99.9;\n });\n });\n }\n\n function addCorporationResearch(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n div.sciResearch.qty += 1e10;\n });\n }\n\n return (\n \n }>\n Corporation\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Funds:\n \n \n
\n Cycles:\n \n \n
\n \n
\n \n
\n
\n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { generateContract, generateRandomContract, generateRandomContractOnHome } from \"../../CodingContractGenerator\";\nimport { CodingContractTypes } from \"../../CodingContracts\";\n\nexport function CodingContracts(): React.ReactElement {\n const [codingcontract, setCodingcontract] = useState(\"Find Largest Prime Factor\");\n function setCodingcontractDropdown(event: SelectChangeEvent): void {\n setCodingcontract(event.target.value);\n }\n\n function specificContract(): void {\n generateContract({\n problemType: codingcontract,\n server: \"home\",\n });\n }\n\n return (\n \n }>\n Coding Contracts\n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n \n \n
\n
\n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { Money } from \"../../ui/React/Money\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { StockMarket as SM } from \"../../StockMarket/StockMarket\";\nimport { Stock } from \"../../StockMarket/Stock\";\n\nexport function StockMarket(): React.ReactElement {\n const [stockPrice, setStockPrice] = useState(0);\n const [stockSymbol, setStockSymbol] = useState(\"\");\n\n function setStockPriceField(event: React.ChangeEvent): void {\n setStockPrice(parseFloat(event.target.value));\n }\n\n function setStockSymbolField(event: React.ChangeEvent): void {\n setStockSymbol(event.target.value);\n }\n\n function processStocks(sub: (arg0: Stock) => void): void {\n const inputSymbols = stockSymbol.replace(/\\s/g, \"\");\n\n let match: (symbol: string) => boolean = (): boolean => {\n return true;\n };\n\n if (inputSymbols !== \"\" && inputSymbols !== \"all\") {\n match = function (symbol: string): boolean {\n return inputSymbols.split(\",\").includes(symbol);\n };\n }\n\n for (const name of Object.keys(SM)) {\n if (SM.hasOwnProperty(name)) {\n const stock = SM[name];\n if (stock instanceof Stock && match(stock.symbol)) {\n sub(stock);\n }\n }\n }\n }\n\n function doSetStockPrice(): void {\n if (!isNaN(stockPrice)) {\n processStocks((stock: Stock) => {\n stock.price = stockPrice;\n });\n }\n }\n\n function viewStockCaps(): void {\n const stocks: JSX.Element[] = [];\n processStocks((stock: Stock) => {\n stocks.push(\n \n {stock.symbol}\n \n \n \n ,\n );\n });\n dialogBoxCreate(\n \n \n \n \n \n \n {stocks}\n \n
StockPrice cap
,\n );\n }\n return (\n \n }>\n Stock Market\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Symbol:\n \n \n
\n Price:\n \n \n \n
\n Caps:\n \n \n
\n
\n
\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Adjuster } from \"./Adjuster\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Sleeves(props: IProps): React.ReactElement {\n function sleeveMaxAllShock(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].shock = 0;\n }\n }\n\n function sleeveClearAllShock(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].shock = 100;\n }\n }\n\n function sleeveSyncMaxAll(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].sync = 100;\n }\n }\n\n function sleeveSyncClearAll(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].sync = 0;\n }\n }\n\n function sleeveSetStoredCycles(cycles: number): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].storedCycles = cycles;\n }\n }\n\n return (\n \n }>\n Sleeves\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n Shock:\n \n \n \n \n
\n Sync:\n \n \n \n \n
\n sleeveSetStoredCycles(10000000)}\n add={sleeveSetStoredCycles}\n subtract={sleeveSetStoredCycles}\n reset={() => sleeveSetStoredCycles(0)}\n />\n
\n
\n
\n );\n}\n","import React from \"react\";\n\nimport { staneksGift } from \"../../CotMG/Helper\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { Adjuster } from \"./Adjuster\";\n\nexport function Stanek(): React.ReactElement {\n function addCycles(): void {\n staneksGift.storedCycles = 1e6;\n }\n\n function modCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.storedCycles += cycles * modify;\n };\n }\n\n function resetCycles(): void {\n staneksGift.storedCycles = 0;\n }\n\n function addCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.highestCharge = 1e21;\n f.numCharge = 1e21;\n });\n }\n\n function modCharge(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.fragments.forEach((f) => (f.highestCharge += cycles * modify));\n };\n }\n\n function resetCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.highestCharge = 0;\n f.numCharge = 0;\n });\n }\n\n return (\n \n }>\n Stanek's Gift\n \n \n \n \n \n \n \n \n \n \n \n
\n \n
\n \n
\n
\n
\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { saveObject } from \"../../SaveObject\";\nimport { IEngine } from \"../../IEngine\";\n\n// Update as additional BitNodes get implemented\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function TimeSkip(props: IProps): React.ReactElement {\n function timeskip(time: number) {\n return () => {\n props.player.lastUpdate -= time;\n props.engine._lastUpdate -= time;\n saveObject.saveGame();\n setTimeout(() => location.reload(), 1000);\n };\n }\n\n return (\n \n }>\n Time skip\n \n \n \n \n \n \n \n );\n}\n","import React, { useState, useRef } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { saveObject } from \"../../SaveObject\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { Upload } from \"@mui/icons-material\";\nimport { Button } from \"@mui/material\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport function SaveFile(): React.ReactElement {\n const importInput = useRef(null);\n const [saveFile, setSaveFile] = useState(\"\");\n const [restoreScripts, setRestoreScripts] = useState(true);\n const [restoreAugs, setRestoreAugs] = useState(true);\n const [restoreSFs, setRestoreSFs] = useState(true);\n\n async function onImport(event: React.ChangeEvent): Promise {\n try {\n const base64Save = await saveObject.getImportStringFromFile(event.target.files);\n const save = atob(base64Save);\n setSaveFile(save);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n }\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n function doRestore(): void {\n const save = JSON.parse(saveFile);\n // TODO: Continue here.\n console.error(save);\n }\n\n return (\n \n }>\n Save file\n \n \n \n
\n {saveFile !== \"\" && (\n <>\n setRestoreScripts(v)}\n text=\"Restore scripts\"\n tooltip={<>Restore the save file home computer scripts.}\n />\n
\n setRestoreAugs(v)}\n text=\"Restore Augmentations\"\n tooltip={<>Restore the save file installed augmentations.}\n />\n
\n setRestoreSFs(v)}\n text=\"Restore Source Files\"\n tooltip={<>Restore the save file acquired source files.}\n />\n
\n \n \n )}\n
\n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport { Tooltip } from \"@mui/material\";\nimport LockIcon from \"@mui/icons-material/Lock\";\nimport LockOpenIcon from \"@mui/icons-material/LockOpen\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { IEngine } from \"../../IEngine\";\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function Achievements(props: IProps): React.ReactElement {\n const [playerAchievement, setPlayerAchievements] = useState(props.player.achievements.map((m) => m.ID));\n\n function grantAchievement(id: string): void {\n props.player.giveAchievement(id);\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function grantAllAchievements(): void {\n Object.values(achievements).forEach((a) => props.player.giveAchievement(a.ID));\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function removeAchievement(id: string): void {\n props.player.achievements = props.player.achievements.filter((a) => a.ID !== id);\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function clearAchievements(): void {\n props.player.achievements = [];\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function disableEngine(): void {\n props.engine.Counters.achievementsCounter = Number.MAX_VALUE;\n }\n\n function enableEngine(): void {\n props.engine.Counters.achievementsCounter = 0;\n }\n\n return (\n \n }>\n Achievements\n \n \n \n \n \n \n \n \n \n {Object.values(achievements).map((i) => {\n const achieved = playerAchievement.includes(i.ID);\n return (\n \n \n \n \n \n );\n })}\n \n
\n Achievements:\n \n \n \n \n \n \n \n
\n {achieved ? (\n \n \n \n ) : (\n \n \n \n )}\n \n \n {i.ID}\n
\n {i.Description}\n \n }\n >\n {i.Name}:\n \n
\n \n \n \n \n
\n
\n
\n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IEngine } from \"../../IEngine\";\n\n// Update as additional BitNodes get implemented\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function Entropy(props: IProps): React.ReactElement {\n return (\n \n }>\n Entropy\n \n \n {\n props.player.entropy += num;\n props.player.applyEntropy(props.player.entropy);\n }}\n subtract={(num) => {\n props.player.entropy -= num;\n props.player.applyEntropy(props.player.entropy);\n }}\n tons={() => {\n props.player.entropy += 1e12;\n props.player.applyEntropy(props.player.entropy);\n }}\n reset={() => {\n props.player.entropy = 0;\n props.player.applyEntropy(props.player.entropy);\n }}\n />\n \n \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Stats } from \"./Stats\";\nimport { Console } from \"./Console\";\nimport { AllPages } from \"./AllPages\";\n\nimport { use } from \"../../ui/Context\";\nimport Box from \"@mui/material/Box\";\n\nexport function BladeburnerRoot(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const bladeburner = player.bladeburner;\n if (bladeburner === null) return <>;\n return (\n \n \n \n \n \n\n \n \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { TravelModal } from \"./TravelModal\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n router: IRouter;\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n const [travelOpen, setTravelOpen] = useState(false);\n const setRerender = useState(false)[1];\n\n const inFaction = props.bladeburner.rank >= BladeburnerConstants.RankNeededForFaction;\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function openFaction(): void {\n if (!inFaction) return;\n const faction = Factions[FactionNames.Bladeburners];\n if (!faction.isMember) {\n joinFaction(faction);\n }\n\n props.router.toFaction(faction);\n }\n\n return (\n \n \n \n \n Rank 25 required. : \"\"}>\n \n \n \n \n setTravelOpen(false)} bladeburner={props.bladeburner} />\n \n \n Your rank within the Bladeburner division.}>\n Rank: {formatNumber(props.bladeburner.rank, 2)}\n \n \n
\n \n \n Performing actions will use up your stamina.\n
\n
\n Your max stamina is determined primarily by your agility stat.\n
\n
\n Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads\n to a higher gain rate.\n
\n
\n Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of\n your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this\n means your success rate would be multipled by 85% (100 - 15).\n
\n
\n Your max stamina and stamina gain rate can also be increased by training, or through skills and\n Augmentation upgrades.\n \n }\n >\n \n Stamina: {formatNumber(props.bladeburner.stamina, 3)} / {formatNumber(props.bladeburner.maxStamina, 3)}\n \n \n
\n
\n \n Stamina Penalty: {formatNumber((1 - props.bladeburner.calculateStaminaPenalty()) * 100, 1)}%\n \n
\n Team Size: {formatNumber(props.bladeburner.teamSize, 0)}\n Team Members Lost: {formatNumber(props.bladeburner.teamLost, 0)}\n
\n Num Times Hospitalized: {props.bladeburner.numHosp}\n \n Money Lost From Hospitalizations: \n \n
\n Current City: {props.bladeburner.city}\n \n \n This is your Bladeburner division's estimate of how many Synthoids exist in your current city. An\n accurate population count increases success rate estimates.\n \n }\n >\n \n Est. Synthoid Population: {numeralWrapper.formatPopulation(props.bladeburner.getCurrentCity().popEst)}\n \n \n \n
\n \n \n This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city.\n \n }\n >\n Synthoid Communities: {formatNumber(props.bladeburner.getCurrentCity().comms, 0)}\n \n \n
\n \n \n The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a\n chaos level can make contracts and operations harder.\n \n }\n >\n City Chaos: {formatNumber(props.bladeburner.getCurrentCity().chaos)}\n \n \n
\n {(props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000 > 15000 && (\n <>\n \n \n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by\n browser). Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.\n \n }\n >\n \n Bonus time:{\" \"}\n {convertTimeMsToTimeElapsedString(\n (props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000,\n )}\n \n \n \n
\n \n )}\n Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}\n
\n \n Aug. Success Chance mult: {formatNumber(props.player.mults.bladeburner_success_chance * 100, 1)}%\n
\n Aug. Max Stamina mult: {formatNumber(props.player.mults.bladeburner_max_stamina * 100, 1)}%\n
\n Aug. Stamina Gain mult: {formatNumber(props.player.mults.bladeburner_stamina_gain * 100, 1)}%\n
\n Aug. Field Analysis mult: {formatNumber(props.player.mults.bladeburner_analysis * 100, 1)}%\n
\n
\n
\n );\n}\n","import React from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { Settings } from \"../../Settings/Settings\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n function travel(city: string): void {\n props.bladeburner.city = city;\n props.onClose();\n }\n\n return (\n \n <>\n \n Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in\n for your Bladeburner duties does not affect your location in the game otherwise.\n \n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n \n ))\n ) : (\n travel(city)} />\n )}\n \n \n );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Paper from \"@mui/material/Paper\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ILineProps {\n content: React.ReactNode;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n width: \"100%\",\n },\n input: {\n backgroundColor: theme.colors.backgroundsecondary,\n },\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n }),\n);\n\nfunction Line(props: ILineProps): React.ReactElement {\n return (\n \n {props.content}\n \n );\n}\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function Console(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [command, setCommand] = useState(\"\");\n const setRerender = useState(false)[1];\n const consoleInput = useRef(null);\n\n function handleCommandChange(event: React.ChangeEvent): void {\n setCommand(event.target.value);\n }\n\n const [consoleHistoryIndex, setConsoleHistoryIndex] = useState(props.bladeburner.consoleHistory.length);\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n function handleKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) {\n event.preventDefault();\n if (command.length > 0) {\n props.bladeburner.postToConsole(\"> \" + command);\n props.bladeburner.executeConsoleCommands(props.player, command);\n setConsoleHistoryIndex(props.bladeburner.consoleHistory.length);\n setCommand(\"\");\n }\n }\n\n const consoleHistory = props.bladeburner.consoleHistory;\n\n if (event.key === KEY.UP_ARROW) {\n // up\n let i = consoleHistoryIndex;\n const len = consoleHistory.length;\n if (len === 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n if (i !== 0) {\n i = i - 1;\n }\n setConsoleHistoryIndex(i);\n const prevCommand = consoleHistory[i];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n\n if (event.key === KEY.DOWN_ARROW) {\n const i = consoleHistoryIndex;\n const len = consoleHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n setConsoleHistoryIndex(len);\n event.currentTarget.value = \"\";\n } else {\n setConsoleHistoryIndex(consoleHistoryIndex + 1);\n const prevCommand = consoleHistory[consoleHistoryIndex + 1];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n }\n }\n\n function handleClick(): void {\n if (!consoleInput.current) return;\n consoleInput.current.focus();\n }\n\n return (\n \n \n \n \n \n \n \n \n \n ),\n spellCheck: false,\n }}\n />\n \n );\n}\n\ninterface ILogProps {\n entries: string[];\n}\n\nfunction Logs({ entries }: ILogProps): React.ReactElement {\n const scrollHook = useRef(null);\n\n // TODO: Text gets shifted up as new entries appear, if the user scrolled up it should attempt to keep the text focused\n function scrollToBottom(): void {\n if (!scrollHook.current) return;\n scrollHook.current.scrollTop = scrollHook.current.scrollHeight;\n }\n\n useEffect(() => {\n scrollToBottom();\n }, [entries.length]);\n\n return (\n \n {entries && entries.map((log: string, i: number) => )}\n \n );\n}\n","import React from \"react\";\nimport { GeneralActionPage } from \"./GeneralActionPage\";\nimport { ContractPage } from \"./ContractPage\";\nimport { OperationPage } from \"./OperationPage\";\nimport { BlackOpPage } from \"./BlackOpPage\";\nimport { SkillPage } from \"./SkillPage\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function AllPages(props: IProps): React.ReactElement {\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n {value === 0 && }\n {value === 1 && }\n {value === 2 && }\n {value === 3 && }\n {value === 4 && }\n \n \n );\n}\n","import * as React from \"react\";\nimport { GeneralActionList } from \"./GeneralActionList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function GeneralActionPage(props: IProps): React.ReactElement {\n return (\n <>\n These are generic actions that will assist you in your Bladeburner duties.\n \n \n );\n}\n","import React from \"react\";\nimport { GeneralActionElem } from \"./GeneralActionElem\";\nimport { Action } from \"../Action\";\nimport { GeneralActions } from \"../GeneralActions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function GeneralActionList(props: IProps): React.ReactElement {\n const actions: Action[] = [];\n for (const name of Object.keys(GeneralActions)) {\n if (GeneralActions.hasOwnProperty(name)) {\n actions.push(GeneralActions[name]);\n }\n }\n return (\n <>\n {actions.map((action: Action) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IAction } from \"../IAction\";\nimport { GeneralActions } from \"../data/GeneralActions\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: IAction;\n}\n\nexport function GeneralActionElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive = props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = (function (): number {\n switch (props.action.name) {\n case \"Training\":\n case \"Field Analysis\":\n return 30;\n case \"Diplomacy\":\n case \"Hyperbolic Regeneration Chamber\":\n case \"Incite Violence\":\n return 60;\n case \"Recruitment\":\n return props.bladeburner.getRecruitmentTime(props.player);\n }\n return -1; // dead code\n })();\n const successChance =\n props.action.name === \"Recruitment\"\n ? Math.max(0, Math.min(props.bladeburner.getRecruitmentSuccessChance(props.player), 1))\n : -1;\n\n const actionData = GeneralActions[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n \n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n ) : (\n \n \n \n \n )}\n
\n
\n {actionData.desc}\n
\n
\n \n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n {successChance !== -1 && (\n <>\n
\n Estimated success chance: {formatNumber(successChance * 100, 1)}%\n \n )}\n
\n
\n );\n}\n","import * as React from \"react\";\nimport { ContractList } from \"./ContractList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractPage(props: IProps): React.ReactElement {\n return (\n <>\n \n Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you\n to lose HP, which can lead to hospitalization.\n
\n
\n You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more\n difficult, but grant more rank, experience, and money.\n
\n \n \n );\n}\n","import React from \"react\";\nimport { ContractElem } from \"./ContractElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.contracts);\n const contracts = props.bladeburner.contracts;\n return (\n <>\n {names.map((name: string) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Contracts } from \"../data/Contracts\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IAction } from \"../IAction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: IAction;\n}\n\nexport function ContractElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Contract\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner, props.player);\n\n const actionData = Contracts[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n ) : (\n <>\n \n \n \n )}\n
\n
\n \n
\n
\n \n {actionData.desc}\n
\n
\n \n
\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n
\n Contracts remaining: {Math.floor(props.action.count)}\n
\n Successes: {props.action.successes}\n
\n Failures: {props.action.failures}\n
\n
\n \n
\n );\n}\n","import React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const Contracts: {\n [key: string]: IContract | undefined;\n} = {\n Tracking: {\n desc: (\n <>\n Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT\n engage. Stealth is of the utmost importance.\n
\n
\n Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever\n city you are currently in.\n \n ),\n },\n \"Bounty Hunter\": {\n desc: (\n <>\n Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.\n
\n
\n Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also\n increase its chaos level.\n \n ),\n },\n Retirement: {\n desc: (\n <>\n Hunt down and retire (kill) rogue Synthoids.\n
\n
\n Successfully completing a Retirement contract will lower the population in your current city, and will also\n increase its chaos level.\n \n ),\n },\n};\n","import React from \"react\";\nimport { stealthIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function StealthIcon(): React.ReactElement {\n return This action involves stealth}>{stealthIcon};\n}\n","import React from \"react\";\nimport { killIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function KillIcon(): React.ReactElement {\n return This action involves retirement}>{killIcon};\n}\n","import * as React from \"react\";\nimport { OperationList } from \"./OperationList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationPage(props: IProps): React.ReactElement {\n return (\n <>\n \n Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It\n will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more\n punishing than contracts, but are also more rewarding.\n
\n
\n Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary\n between different Operations.\n
\n
\n For operations, you can use a team. You must first recruit team members. Having a larger team will improve your\n chances of success.\n
\n
\n You can unlock higher-level operations by successfully completing them. Higher-level operations are more\n difficult, but grant more rank and experience.\n
\n \n \n );\n}\n","import React from \"react\";\nimport { OperationElem } from \"./OperationElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.operations);\n const operations = props.bladeburner.operations;\n return (\n <>\n {names.map((name: string) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { Operation } from \"../Operation\";\nimport { Operations } from \"../data/Operations\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: Operation;\n}\n\nexport function OperationElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Operation\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner, props.player);\n\n const actionData = Operations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n ) : (\n <>\n \n \n \n \n )}\n
\n
\n\n \n
\n
\n \n {actionData.desc}\n
\n
\n \n
\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n
\n Operations remaining: {Math.floor(props.action.count)}\n
\n Successes: {props.action.successes}\n
\n Failures: {props.action.failures}\n
\n
\n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Action } from \"../Action\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: Action;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TeamSizeModal(props: IProps): React.ReactElement {\n const [teamSize, setTeamSize] = useState();\n\n function confirmTeamSize(): void {\n if (teamSize === undefined) return;\n const num = Math.round(teamSize);\n if (isNaN(num) || num < 0) {\n dialogBoxCreate(\"Invalid value entered for number of Team Members (must be numeric, positive)\");\n } else {\n props.action.teamCount = num;\n }\n props.onClose();\n }\n\n function onTeamSize(event: React.ChangeEvent): void {\n const x = parseFloat(event.target.value);\n if (x > props.bladeburner.teamSize) setTeamSize(props.bladeburner.teamSize);\n else setTeamSize(x);\n }\n\n return (\n \n \n Enter the amount of team members you would like to take on this Op. If you do not have the specified number of\n team members, then as many as possible will be used. Note that team members may be lost during operations.\n \n \n \n \n );\n}\n","import React from \"react\";\n\ninterface IOperation {\n desc: JSX.Element;\n}\n\nexport const Operations: {\n [key: string]: IOperation | undefined;\n} = {\n Investigation: {\n desc: (\n <>\n As a field agent, investigate and identify Synthoid populations, movements, and operations.\n
\n
\n Successful Investigation ops will increase the accuracy of your synthoid data.\n
\n
\n You will NOT lose HP from failed Investigation ops.\n \n ),\n },\n \"Undercover Operation\": {\n desc: (\n <>\n Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.\n
\n
\n Successful Undercover ops will increase the accuracy of your synthoid data.\n \n ),\n },\n \"Sting Operation\": {\n desc: <>Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.,\n },\n Raid: {\n desc: (\n <>\n Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your\n current city in order for this Operation to be successful.\n \n ),\n },\n \"Stealth Retirement Operation\": {\n desc: (\n <>\n Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any\n attention. Stealth and discretion are key.\n \n ),\n },\n Assassination: {\n desc: (\n <>\n Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the\n Synthoid communities.\n \n ),\n },\n};\n","import * as React from \"react\";\nimport { BlackOpList } from \"./BlackOpList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { use } from \"../../ui/Context\";\nimport { BlackOperationNames } from \"../data/BlackOperationNames\";\nimport { Button } from \"@mui/material\";\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\n const router = use.Router();\n return (\n <>\n \n Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked\n successively by completing the one before it.\n
\n
\n \n Your ultimate goal to climb through the ranks of {FactionNames.Bladeburners} is to complete all of the Black\n Ops.\n \n
\n
\n Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank\n losses.\n
\n {props.bladeburner.blackops[BlackOperationNames.OperationDaedalus] ? (\n \n ) : (\n \n )}\n \n );\n}\n","import React from \"react\";\nimport { BlackOperations } from \"../BlackOperations\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOpElem } from \"./BlackOpElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpList(props: IProps): React.ReactElement {\n let blackops: BlackOperation[] = [];\n for (const blackopName of Object.keys(BlackOperations)) {\n if (BlackOperations.hasOwnProperty(blackopName)) {\n blackops.push(BlackOperations[blackopName]);\n }\n }\n blackops.sort(function (a, b) {\n return a.reqdRank - b.reqdRank;\n });\n\n blackops = blackops.filter(\n (blackop: BlackOperation, i: number) =>\n !(\n props.bladeburner.blackops[blackops[i].name] == null &&\n i !== 0 &&\n props.bladeburner.blackops[blackops[i - 1].name] == null\n ),\n );\n\n blackops = blackops.reverse();\n\n return (\n <>\n {blackops.map((blackop: BlackOperation) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOperations } from \"../data/BlackOperations\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: BlackOperation;\n}\n\nexport function BlackOpElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isCompleted = props.bladeburner.blackops[props.action.name] != null;\n if (isCompleted) {\n return (\n \n {props.action.name} (COMPLETED)\n \n );\n }\n\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"BlackOperation\"] &&\n props.action.name === props.bladeburner.action.name;\n const actionTime = props.action.getActionTime(props.bladeburner, props.player);\n const hasReqdRank = props.bladeburner.rank >= props.action.reqdRank;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n\n const actionData = BlackOperations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n <>\n \n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n \n ) : (\n <>\n \n\n \n \n \n )}\n\n
\n
\n {actionData.desc}\n
\n
\n \n Required Rank: {formatNumber(props.action.reqdRank, 0)}\n \n
\n \n \n
\n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n
\n
\n );\n}\n","import React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { BlackOperationNames } from \"./BlackOperationNames\";\n\ninterface IBlackOp {\n desc: JSX.Element;\n}\n\nexport const BlackOperations: {\n [key: string]: IBlackOp | undefined;\n} = {\n [BlackOperationNames.OperationTyphoon]: {\n desc: (\n <>\n Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that\n Zenyatta, along with the rest of the PMC, is a Synthoid.\n
\n
\n The goal of {BlackOperationNames.OperationTyphoon} is to find and eliminate Zenyatta and RedWater by any means\n necessary. After the task is completed, the actions must be covered up from the general public.\n \n ),\n },\n\n [BlackOperationNames.OperationZero]: {\n desc: (\n <>\n AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a\n supporter of Synthoid rights. He must be removed.\n
\n
\n The goal of {BlackOperationNames.OperationZero} is to covertly infiltrate AeroCorp and uncover any incriminating\n evidence or information against Watataki that will cause him to be removed from his position at AeroCorp.\n Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced\n security measures in the world.\n \n ),\n },\n [BlackOperationNames.OperationX]: {\n desc: (\n <>\n We have recently discovered an underground publication group called Samizdat. Even though most of their\n publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of\n their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and\n other Eastern countries.\n
\n
\n Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that\n their base of operations is in {CityName.Ishima}'s underground sewer systems. Your task is to investigate the\n sewer systems, and eliminate Samizdat. They must never publish anything again.\n \n ),\n },\n [BlackOperationNames.OperationTitan]: {\n desc: (\n <>\n Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we\n know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to,\n but the research that they could be conducting using Titan Laboraties' vast resources is potentially very\n dangerous.\n
\n
\n Your goal is to enter and destroy the Bioengineering department's facility in {CityName.Aevum}. The task is not\n just to retire the Synthoids there, but also to destroy any information or research at the facility that is\n relevant to the Synthoids and their goals.\n \n ),\n },\n [BlackOperationNames.OperationAres]: {\n desc: (\n <>\n One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai\n between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy\n weapons. It is critical for the safety of humanity that this deal does not happen.\n
\n
\n Your task is to intercept the deal. Leave no survivors.\n \n ),\n },\n [BlackOperationNames.OperationArchangel]: {\n desc: (\n <>\n Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI\n Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms\n trafficking operation.\n
\n
\n The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the\n number of other casualties, but do what you must to complete the mission.\n \n ),\n },\n [BlackOperationNames.OperationJuggernaut]: {\n desc: (\n <>\n The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls\n himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into{\" \"}\n {CityName.Sector12}. We also have reason to believe they tried to break into one of Universal Energy's\n facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented\n Synthoid, and have thus enlisted our help.\n
\n
\n Your mission is to eradicate Juggernaut and his followers.\n \n ),\n },\n [BlackOperationNames.OperationRedDragon]: {\n desc: (\n <>\n The {FactionNames.Tetrads} criminal organization is suspected of reverse-engineering the MK-VI Synthoid design.\n We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in\n order to bolster their criminal activities.\n
\n
\n Your task is to infiltrate and destroy the {FactionNames.Tetrads}' base of operations in Los Angeles.\n Intelligence tells us that their base houses one of their Synthoid manufacturing units.\n \n ),\n },\n [BlackOperationNames.OperationK]: {\n desc: (\n <>\n CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology.\n This technology is supposedly capable of cloning Synthoids, not only physically but also their advanced AI\n modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any\n Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would\n be catastrophic.\n
\n
\n We do not have the power or jurisdiction to shut this down through legal or political means, so we must resort\n to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in its\n creation.\n \n ),\n },\n [BlackOperationNames.OperationDeckard]: {\n desc: (\n <>\n Despite your success in eliminating VitaLife's new android-replicating technology in{\" \"}\n {BlackOperationNames.OperationK}, we've discovered that a small group of MK-VI Synthoids were able to make off\n with the schematics and design of the technology before the Operation. It is almost a certainty that these\n Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.\n
\n
\n The goal of {BlackOperationNames.OperationDeckard} is to hunt down these Synthoids and retire them. I don't need\n to tell you how critical this mission is.\n \n ),\n },\n [BlackOperationNames.OperationTyrell]: {\n desc: (\n <>\n A week ago {FactionNames.BladeIndustries} reported a small break-in at one of their {CityName.Aevum}{\" \"}\n Augmentation storage facilities. We figured out that {FactionNames.TheDarkArmy} was behind the heist, and didn't\n think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that\n break-in group.\n
\n
\n We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt\n down associated {FactionNames.TheDarkArmy} members and eliminate them.\n \n ),\n },\n [BlackOperationNames.OperationWallace]: {\n desc: (\n <>\n Based on information gathered from {BlackOperationNames.OperationTyrell}, we've discovered that{\" \"}\n {FactionNames.TheDarkArmy} was well aware that there were Synthoids amongst their ranks. Even worse, we believe\n that {FactionNames.TheDarkArmy} is working together with other criminal organizations such as{\" \"}\n {FactionNames.TheSyndicate} and that they are planning some sort of large-scale takeover of multiple major\n cities, most notably {CityName.Aevum}. We suspect that Synthoids have infiltrated the ranks of these criminal\n factions and are trying to stage another Synthoid uprising.\n
\n
\n The best way to deal with this is to prevent it before it even happens. The goal of{\" \"}\n {BlackOperationNames.OperationWallace} is to destroy {FactionNames.TheDarkArmy} and Syndicate factions in{\" \"}\n {CityName.Aevum} immediately. Leave no survivors.\n \n ),\n },\n [BlackOperationNames.OperationShoulderOfOrion]: {\n desc: (\n <>\n China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using\n Synthoids. We believe China is trying to establish the first off-world colonies.\n
\n
\n The mission is to prevent this launch without instigating an international conflict. When you accept this\n mission you will be officially disavowed by the NSA and the national government until after you successfully\n return. In the event of failure, all of the operation's team members must not let themselves be captured alive.\n \n ),\n },\n [BlackOperationNames.OperationHyron]: {\n desc: (\n <>\n Our intelligence tells us that {FactionNames.FulcrumSecretTechnologies} is developing a quantum supercomputer\n using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data\n and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of\n organic human brains means that the supercomputer may be able to reason abstractly and become self-aware.\n
\n
\n I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.\n
\n
\n The research for this project is being conducted at one of {FactionNames.FulcrumSecretTechnologies} secret\n facilities in {CityName.Aevum}, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work,\n and then find and kill the project lead.\n \n ),\n },\n [BlackOperationNames.OperationMorpheus]: {\n desc: (\n <>\n DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the\n people's dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our\n agents and informants in {CityName.Chongqing}, we have reason to believe that one of the broadcast towers there\n has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.\n
\n
\n The mission is to destroy this broadcast tower. Speed and stealth are of the utmost importance for this.\n \n ),\n },\n [BlackOperationNames.OperationIonStorm]: {\n desc: (\n <>\n Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the{\" \"}\n {CityName.Sector12} Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they\n have been stockpiling weapons, money, and other resources. This makes them dangerous.\n
\n
\n This is a full-scale assault operation to find and retire all of these Synthoids in the {CityName.Sector12}{\" \"}\n Slums.\n \n ),\n },\n [BlackOperationNames.OperationAnnihilus]: {\n desc: (\n <>\n Our superiors have ordered us to eradicate everything and everyone in an underground facility located in{\" \"}\n {CityName.Aevum}. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist\n organization called '{FactionNames.TheCovenant}'. We have no prior intelligence about this organization, so you\n are going in blind.\n \n ),\n },\n [BlackOperationNames.OperationUltron]: {\n desc: (\n <>\n {FactionNames.OmniTekIncorporated}, the original designer and manufacturer of Synthoids, has notified us of a\n malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized\n and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue\n ones from the Uprising.\n
\n
\n {FactionNames.OmniTekIncorporated} has also told us they believe someone has triggered this malfunction in a\n large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in{\" \"}\n {CityName.Volhaven} to form a terrorist group called Ultron.\n
\n
\n Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making\n moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).\n
\n
\n Your task is to find and destroy Ultron.\n \n ),\n },\n [BlackOperationNames.OperationCenturion]: {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n
\n
\n Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its\n advancement became our primary goal. And at the peak of human civilization technology turned into power. Global,\n absolute power.\n
\n
\n It seems that the universe is not without a sense of irony.\n
\n
\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n \n ),\n },\n [BlackOperationNames.OperationVindictus]: {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n
\n
\n The bits are all around us. The daemons that hold the Node together can manifest themselves in many different\n ways.\n
\n
\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n \n ),\n },\n [BlackOperationNames.OperationDaedalus]: {\n desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.,\n },\n};\n","import React, { useState } from \"react\";\nimport { SkillList } from \"./SkillList\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\ninterface IProps {\n bladeburner: IBladeburner;\n}\n\nexport function SkillPage(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const mults = props.bladeburner.skillMultipliers;\n\n function valid(mult: number | undefined): boolean {\n return mult !== undefined && mult !== 1;\n }\n\n return (\n <>\n \n Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}\n \n \n You will gain one skill point every {BladeburnerConstants.RanksPerSkillPoint} ranks.\n
\n Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different\n skills with each other is multiplicative.\n
\n {valid(mults[\"successChanceAll\"]) && (\n Total Success Chance: x{formatNumber(mults[\"successChanceAll\"], 3)}\n )}\n {valid(mults[\"successChanceStealth\"]) && (\n Stealth Success Chance: x{formatNumber(mults[\"successChanceStealth\"], 3)}\n )}\n {valid(mults[\"successChanceKill\"]) && (\n Retirement Success Chance: x{formatNumber(mults[\"successChanceKill\"], 3)}\n )}\n {valid(mults[\"successChanceContract\"]) && (\n Contract Success Chance: x{formatNumber(mults[\"successChanceContract\"], 3)}\n )}\n {valid(mults[\"successChanceOperation\"]) && (\n Operation Success Chance: x{formatNumber(mults[\"successChanceOperation\"], 3)}\n )}\n {valid(mults[\"successChanceEstimate\"]) && (\n Synthoid Data Estimate: x{formatNumber(mults[\"successChanceEstimate\"], 3)}\n )}\n {valid(mults[\"actionTime\"]) && Action Time: x{formatNumber(mults[\"actionTime\"], 3)}}\n {valid(mults[\"effHack\"]) && Hacking Skill: x{formatNumber(mults[\"effHack\"], 3)}}\n {valid(mults[\"effStr\"]) && Strength: x{formatNumber(mults[\"effStr\"], 3)}}\n {valid(mults[\"effDef\"]) && Defense: x{formatNumber(mults[\"effDef\"], 3)}}\n {valid(mults[\"effDex\"]) && Dexterity: x{formatNumber(mults[\"effDex\"], 3)}}\n {valid(mults[\"effAgi\"]) && Agility: x{formatNumber(mults[\"effAgi\"], 3)}}\n {valid(mults[\"effCha\"]) && Charisma: x{formatNumber(mults[\"effCha\"], 3)}}\n {valid(mults[\"effInt\"]) && Intelligence: x{formatNumber(mults[\"effInt\"], 3)}}\n {valid(mults[\"stamina\"]) && Stamina: x{formatNumber(mults[\"stamina\"], 3)}}\n {valid(mults[\"money\"]) && Contract Money: x{formatNumber(mults[\"money\"], 3)}}\n {valid(mults[\"expGain\"]) && Exp Gain: x{formatNumber(mults[\"expGain\"], 3)}}\n setRerender((old) => !old)} />\n \n );\n}\n\n/*\n\n\n\n\nvar multKeys = Object.keys(this.skillMultipliers);\nfor (var i = 0; i < multKeys.length; ++i) {\n var mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n mult = formatNumber(mult, 3);\n switch(multKeys[i]) {\n\n }\n }\n}\n*/\n","import * as React from \"react\";\nimport { SkillElem } from \"./SkillElem\";\nimport { Skills } from \"../Skills\";\nimport { IBladeburner } from \"../IBladeburner\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillList(props: IProps): React.ReactElement {\n return (\n <>\n {Object.keys(Skills).map((skill: string) => (\n \n ))}\n \n );\n}\n","import React from \"react\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { Skill } from \"../Skill\";\n\ninterface IProps {\n skill: Skill;\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillElem(props: IProps): React.ReactElement {\n const skillName = props.skill.name;\n let currentLevel = 0;\n if (props.bladeburner.skills[skillName] && !isNaN(props.bladeburner.skills[skillName])) {\n currentLevel = props.bladeburner.skills[skillName];\n }\n const pointCost = props.skill.calculateCost(currentLevel);\n\n const canLevel = props.bladeburner.skillPoints >= pointCost;\n const maxLvl = props.skill.maxLvl ? currentLevel >= props.skill.maxLvl : false;\n\n function onClick(): void {\n if (props.bladeburner.skillPoints < pointCost) return;\n props.bladeburner.skillPoints -= pointCost;\n props.bladeburner.upgradeSkill(props.skill);\n props.onUpgrade();\n }\n\n return (\n \n \n \n {!canLevel || maxLvl ? (\n \n \n \n ) : (\n \n \n \n )}\n \n Level: {currentLevel}\n {maxLvl ? (\n MAX LEVEL\n ) : (\n Skill Points required: {formatNumber(pointCost, 0)}\n )}\n {props.skill.desc}\n \n );\n}\n","/**\n * React Component for all the gang stuff.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { ManagementSubpage } from \"./ManagementSubpage\";\nimport { TerritorySubpage } from \"./TerritorySubpage\";\nimport { EquipmentsSubpage } from \"./EquipmentsSubpage\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function GangRoot(): React.ReactElement {\n const player = use.Player();\n const gang = (function () {\n if (player.gang === null) throw new Error(\"Gang should not be null\");\n return player.gang;\n })();\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n \n \n \n \n \n \n {value === 0 && }\n {value === 1 && }\n {value === 2 && }\n \n );\n}\n","/**\n * React Component for the subpage that manages gang members, the main page.\n */\nimport React from \"react\";\nimport { GangStats } from \"./GangStats\";\nimport { GangMemberList } from \"./GangMemberList\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\n\nexport function ManagementSubpage(): React.ReactElement {\n const gang = useGang();\n return (\n <>\n \n This page is used to manage your gang members and get an overview of your gang's stats.\n
\n
\n If a gang member is not earning much money or respect, the task that you have assigned to that member might be\n too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of\n the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact\n that your wanted level is too high. Consider assigning a few members to the '\n {gang.isHackingGang ? \"Ethical Hacking\" : \"Vigilante Justice\"}' task to lower your wanted level.\n
\n
\n Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing\n Augmentations, you will automatically be a member of whatever Faction you created your gang with.\n
\n
\n You can also manage your gang programmatically through Netscript using the Gang API\n
\n
\n \n
\n \n \n );\n}\n","/**\n * React Component for the stats related to the gang, like total respect and\n * money per second.\n */\nimport React from \"react\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { AllGangs } from \"../AllGangs\";\nimport { BonusTime } from \"./BonusTime\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nexport function GangStats(): React.ReactElement {\n const gang = useGang();\n const territoryMult = AllGangs[gang.facName].territory * 100;\n let territoryStr;\n if (territoryMult <= 0) {\n territoryStr = formatNumber(0, 2);\n } else if (territoryMult >= 100) {\n territoryStr = formatNumber(100, 2);\n } else {\n territoryStr = formatNumber(territoryMult, 2);\n }\n\n return (\n <>\n \n \n Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect\n affects the amount of money your gang members will earn, and also determines how much reputation you are\n earning with your gang's corresponding Faction.\n \n }\n >\n \n Respect: {numeralWrapper.formatRespect(gang.respect)} (\n {numeralWrapper.formatRespect(5 * gang.respectGainRate)} / sec)\n \n \n \n\n \n \n Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder\n it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.\n \n }\n >\n \n Wanted Level: {numeralWrapper.formatWanted(gang.wanted)} (\n {numeralWrapper.formatWanted(5 * gang.wantedGainRate)} / sec)\n \n \n \n\n \n Penalty for respect and money gain rates due to Wanted Level}>\n Wanted Level Penalty: -{formatNumber((1 - gang.getWantedPenalty()) * 100, 2)}%\n \n \n\n \n Money gain rate: \n \n\n \n The percentage of total territory your Gang controls}>\n Territory: {territoryStr}%\n \n \n \n Faction reputation: \n \n\n \n \n );\n}\n","/**\n * React Component for displaying the bonus time remaining.\n */\nimport * as React from \"react\";\nimport { Gang } from \"../Gang\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n gang: Gang;\n}\n\nexport function BonusTime(props: IProps): React.ReactElement {\n const CyclerPerSecond = 1000 / CONSTANTS._idleSpeed;\n if ((props.gang.storedCycles / CyclerPerSecond) * 1000 <= 5000) return <>;\n const bonusMillis = (props.gang.storedCycles / CyclerPerSecond) * 1000;\n return (\n \n \n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the\n browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed.\n \n }\n >\n Bonus time: {convertTimeMsToTimeElapsedString(bonusMillis)}\n \n \n );\n}\n","/**\n * React Component for the list of gang members on the management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberCard } from \"./GangMemberCard\";\nimport { RecruitButton } from \"./RecruitButton\";\nimport { useGang } from \"./Context\";\n\nimport { Box, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { GangMember } from \"../GangMember\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport function GangMemberList(): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n const [filter, setFilter] = useState(\"\");\n const [ascendOnly, setAscendOnly] = useState(false);\n\n const handleFilterChange = (event: React.ChangeEvent): void => {\n setFilter(event.target.value.toLowerCase());\n };\n\n const members = gang.members\n .filter((member) => member && member.name.toLowerCase().includes(filter))\n .filter((member) => {\n if (ascendOnly) return member.canAscend();\n return true;\n });\n\n return (\n <>\n setRerender((old) => !old)} />\n ,\n spellCheck: false,\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: \"15%\" }}\n />\n setAscendOnly(newValue)}\n text=\"Show only ascendable\"\n tooltip={<>Filter the members list by whether or not the member can be ascended.}\n />\n \n {members.map((member: GangMember) => (\n \n ))}\n \n \n );\n}\n","/**\n * React Component for a gang member on the management subpage.\n */\nimport React from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberCardContent } from \"./GangMemberCardContent\";\n\nimport Box from \"@mui/material/Box\";\n\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberCard(props: IProps): React.ReactElement {\n return (\n \n \n {props.member.name}} />\n \n \n \n );\n}\n","/**\n * React Component for the content of the accordion of gang members on the\n * management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberStats } from \"./GangMemberStats\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { AscensionModal } from \"./AscensionModal\";\n\nimport { Box } from \"@mui/system\";\nimport { Button, Typography } from \"@mui/material\";\nimport HelpIcon from \"@mui/icons-material/Help\";\n\nimport { GangMember } from \"../GangMember\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberCardContent(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [helpOpen, setHelpOpen] = useState(false);\n const [ascendOpen, setAscendOpen] = useState(false);\n\n return (\n <>\n {props.member.canAscend() && (\n \n \n setAscendOpen(false)}\n member={props.member}\n onAscend={() => setRerender((old) => !old)}\n />\n \n setHelpOpen(false)}>\n \n Ascending a Gang Member resets the member's progress and stats in exchange for a permanent boost to their\n stat multipliers.\n
\n
\n The additional stat multiplier that the Gang Member gains upon ascension is based on the amount of exp\n they have.\n
\n
\n Upon ascension, the member will lose all of its non-Augmentation Equipment and your gang will lose respect\n equal to the total respect earned by the member.\n
\n
\n
\n )}\n \n \n setRerender((old) => !old)} member={props.member} />\n \n \n );\n}\n","/**\n * React Component for the first part of a gang member details.\n * Contains skills and exp.\n */\nimport React from \"react\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMember } from \"../GangMember\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../ui/React/CharacterOverview\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberStats(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n\n const gang = useGang();\n const data = [\n [`Money:`, ],\n [`Respect:`, `${numeralWrapper.formatRespect(5 * props.member.calculateRespectGain(gang))} / sec`],\n [`Wanted Level:`, `${numeralWrapper.formatWanted(5 * props.member.calculateWantedLevelGain(gang))} / sec`],\n [`Total Respect:`, `${numeralWrapper.formatRespect(props.member.earnedRespect)}`],\n ];\n\n return (\n <>\n \n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.hack)}{\" \"}\n Asc)\n
\n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.str)}{\" \"}\n Asc)\n
\n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.def)}{\" \"}\n Asc)\n
\n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.dex)}{\" \"}\n Asc)\n
\n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.agi)}{\" \"}\n Asc)\n
\n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.cha)}{\" \"}\n Asc)\n \n }\n >\n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n {data.map(([a, b]) => (\n \n \n {a}\n \n \n {b}\n \n \n ))}\n
\n
\n \n \n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n killScripts: () => void;\n}\n\nexport function KillScriptsModal(props: IProps): React.ReactElement {\n function onClick(): void {\n props.killScripts();\n props.onClose();\n }\n\n return (\n \n Forcefully kill all running scripts? This will also save your game and reload the game.\n \n \n );\n}\n","/**\n * React Component for the middle part of the gang member accordion. Contains\n * the task selector as well as some stats.\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\nimport { TaskDescription } from \"./TaskDescription\";\n\nimport { Box } from \"@mui/material\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\nimport { GangMember } from \"../GangMember\";\n\ninterface IProps {\n member: GangMember;\n onTaskChange: () => void;\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const gang = useGang();\n const [currentTask, setCurrentTask] = useState(props.member.task);\n\n const contextMember = gang.members.find((member) => member.name == props.member.name);\n if (contextMember && contextMember.task != currentTask) {\n setCurrentTask(contextMember.task);\n }\n\n function onChange(event: SelectChangeEvent): void {\n const task = event.target.value;\n props.member.assignToTask(task);\n setCurrentTask(task);\n props.onTaskChange();\n }\n\n const tasks = gang.getAllTaskNames();\n\n return (\n \n \n \n \n );\n}\n","/**\n * React Component for left side of the gang member accordion, contains the\n * description of the task that member is currently doing.\n */\nimport React from \"react\";\nimport { GangMemberTasks } from \"../GangMemberTasks\";\nimport { GangMember } from \"../GangMember\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function TaskDescription(props: IProps): React.ReactElement {\n const task = GangMemberTasks[props.member.task];\n const desc = task ? task.desc : GangMemberTasks[\"Unassigned\"].desc;\n\n return ;\n}\n","/**\n * React Component for the content of the popup before the player confirms the\n * ascension of a gang member.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n member: GangMember;\n onAscend: () => void;\n}\n\nexport function AscensionModal(props: IProps): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function confirm(): void {\n props.onAscend();\n const res = gang.ascendMember(props.member);\n dialogBoxCreate(\n <>\n You ascended {props.member.name}!
\n
\n Your gang lost {numeralWrapper.formatRespect(res.respect)} respect.\n
\n
\n {props.member.name} gained the following stat multipliers for ascending:\n
\n Hacking: x{numeralWrapper.format(res.hack, \"0.000\")}\n
\n Strength: x{numeralWrapper.format(res.str, \"0.000\")}\n
\n Defense: x{numeralWrapper.format(res.def, \"0.000\")}\n
\n Dexterity: x{numeralWrapper.format(res.dex, \"0.000\")}\n
\n Agility: x{numeralWrapper.format(res.agi, \"0.000\")}\n
\n Charisma: x{numeralWrapper.format(res.cha, \"0.000\")}\n
\n ,\n );\n props.onClose();\n }\n\n // const ascendBenefits = props.member.getAscensionResults();\n const preAscend = props.member.getCurrentAscensionMults();\n const postAscend = props.member.getAscensionMultsAfterAscend();\n\n return (\n \n \n Are you sure you want to ascend this member? They will lose all of\n
\n their non-Augmentation upgrades and their stats will reset back to 1.\n
\n
\n Furthermore, your gang will lose {numeralWrapper.formatRespect(props.member.earnedRespect)} respect\n
\n
\n In return, they will gain the following permanent boost to stat multipliers:\n
\n Hacking: x{numeralWrapper.format(preAscend.hack, \"0.000\")} => x\n {numeralWrapper.format(postAscend.hack, \"0.000\")}\n
\n Strength: x{numeralWrapper.format(preAscend.str, \"0.000\")} => x\n {numeralWrapper.format(postAscend.str, \"0.000\")}\n
\n Defense: x{numeralWrapper.format(preAscend.def, \"0.000\")} => x\n {numeralWrapper.format(postAscend.def, \"0.000\")}\n
\n Dexterity: x{numeralWrapper.format(preAscend.dex, \"0.000\")} => x\n {numeralWrapper.format(postAscend.dex, \"0.000\")}\n
\n Agility: x{numeralWrapper.format(preAscend.agi, \"0.000\")} => x\n {numeralWrapper.format(postAscend.agi, \"0.000\")}\n
\n Charisma: x{numeralWrapper.format(preAscend.cha, \"0.000\")} => x\n {numeralWrapper.format(postAscend.cha, \"0.000\")}\n
\n
\n \n
\n );\n}\n","/**\n * React Component for the recruitment button and text on the gang main page.\n */\nimport React, { useState } from \"react\";\nimport { RecruitModal } from \"./RecruitModal\";\nimport { GangConstants } from \"../data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n onRecruit: () => void;\n}\n\nexport function RecruitButton(props: IProps): React.ReactElement {\n const gang = useGang();\n const [open, setOpen] = useState(false);\n if (gang.members.length >= GangConstants.MaximumGangMembers) {\n return <>;\n }\n\n if (!gang.canRecruitMember()) {\n const respect = gang.getRespectNeededToRecruitMember();\n return (\n \n \n \n {numeralWrapper.formatRespect(respect)} respect needed to recruit next member\n \n \n );\n }\n\n return (\n <>\n \n \n \n setOpen(false)} onRecruit={props.onRecruit} />\n \n );\n}\n","/**\n * React Component for the popup used to recruit new gang members.\n */\nimport React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\ninterface IRecruitPopupProps {\n open: boolean;\n onClose: () => void;\n onRecruit: () => void;\n}\n\nexport function RecruitModal(props: IRecruitPopupProps): React.ReactElement {\n const gang = useGang();\n const [name, setName] = useState(\"\");\n\n const disabled = name === \"\" || !gang.canRecruitMember();\n function recruit(): void {\n if (disabled) return;\n // At this point, the only way this can fail is if you already\n // have a gang member with the same name\n if (!gang.recruitMember(name)) {\n dialogBoxCreate(\"You already have a gang member with this name!\");\n return;\n }\n\n props.onRecruit();\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) recruit();\n }\n\n function onChange(event: React.ChangeEvent): void {\n setName(event.target.value);\n }\n\n return (\n \n Enter a name for your new Gang member:\n
\n \n Recruit\n \n ),\n }}\n />\n
\n );\n}\n","/**\n * React Component for the territory subpage.\n */\nimport React, { useState } from \"react\";\n\nimport { Container, Button, Paper, Box, Tooltip, Switch, FormControlLabel, Typography } from \"@mui/material\";\nimport { Help } from \"@mui/icons-material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\n\nimport { AllGangs } from \"../AllGangs\";\n\nimport { useGang } from \"./Context\";\nimport { TerritoryInfoModal } from \"./TerritoryInfoModal\";\n\nexport function TerritorySubpage(): React.ReactElement {\n const gang = useGang();\n const gangNames = Object.keys(AllGangs).filter((g) => g != gang.facName);\n const [infoOpen, setInfoOpen] = useState(false);\n\n return (\n \n \n This page shows how much territory your Gang controls. This statistic is listed as a percentage, which\n represents how much of the total territory you control.\n \n\n \n\n \n \n {gang.facName} (Your gang)\n \n\n (gang.territoryWarfareEngaged = event.target.checked)}\n />\n }\n label={\n \n Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance\n to gradually decrease until it reaches 0%.\n
\n }\n >\n Engage in Territory Warfare\n \n }\n />\n
\n (gang.notifyMemberDeath = event.target.checked)}\n />\n }\n label={\n \n If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members\n dies in a territory clash.\n \n }\n >\n Notify about Gang Member Deaths\n \n }\n />\n\n \n Territory Clash Chance: {numeralWrapper.formatPercentage(gang.territoryClashChance, 3)}
\n Power: {formatNumber(AllGangs[gang.facName].power, 3)}
\n Territory: {formatTerritory(AllGangs[gang.facName].territory)}%
\n
\n \n \n {gangNames\n .sort((a, b) => {\n if (AllGangs[a].territory <= 0 && AllGangs[b].territory > 0) return 1;\n if (AllGangs[a].territory > 0 && AllGangs[b].territory <= 0) return -1;\n return 0;\n })\n .map((name) => (\n \n ))}\n \n setInfoOpen(false)} />\n \n );\n}\nfunction formatTerritory(n: number): string {\n const v = n * 100;\n const precision = 3;\n if (v <= 0) {\n return formatNumber(0, precision);\n } else if (v >= 100) {\n return formatNumber(100, precision);\n } else {\n return formatNumber(v, precision);\n }\n}\n\ninterface ITerritoryProps {\n name: string;\n}\n\nfunction OtherGangTerritory(props: ITerritoryProps): React.ReactElement {\n const gang = useGang();\n const playerPower = AllGangs[gang.facName].power;\n const power = AllGangs[props.name].power;\n const clashVictoryChance = playerPower / (power + playerPower);\n const territory = AllGangs[props.name].territory;\n const opacity = territory ? 1 : 0.75;\n return (\n \n \n {props.name}\n \n \n Power: {formatNumber(power, 3)}
\n Territory: {formatTerritory(territory)}%
\n Clash Win Chance: {numeralWrapper.formatPercentage(clashVictoryChance, 3)}\n
\n
\n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport { Modal } from \"../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport const TerritoryInfoModal = ({ open, onClose }: IProps): React.ReactElement => {\n return (\n \n <>\n Clashing\n \n Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on\n your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The\n accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare'\n task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also\n loses a small amount of power whenever you lose a clash.\n
\n
\n NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of\n whether you win or lose the clash. A gang member being killed results in both respect and power loss for your\n gang.\n
\n
\n Territory\n \n The amount of territory you have affects all aspects of your Gang members' production, including money,\n respect, and wanted level. It is very beneficial to have high territory control.\n
\n
\n To increase your chances of winning territory, assign gang members to \"Territory Warfare\". This will build\n your gang power. Then, enable \"Engage in Territory Warfare\" to start fighting over territory.\n
\n
\n Territory Clash Chance\n \n This percentage represents the chance you have of 'clashing' with another gang. If you do not wish to\n gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.\n \n \n
\n );\n};\n","/**\n * React Component for the popup that manages gang members upgrades\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { MenuItem, Table, TableBody, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMemberUpgrades } from \"../GangMemberUpgrades\";\nimport { GangMemberUpgrade } from \"../GangMemberUpgrade\";\nimport { Money } from \"../../ui/React/Money\";\nimport { GangMember } from \"../GangMember\";\nimport { UpgradeType } from \"../data/upgrades\";\nimport { use } from \"../../ui/Context\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\n\ninterface INextRevealProps {\n upgrades: string[];\n type: UpgradeType;\n}\n\nfunction NextReveal(props: INextRevealProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n const upgrades = Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (player.money > gang.getUpgradeCost(upg)) return false;\n if (upg.type !== props.type) return false;\n if (props.upgrades.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n\n if (upgrades.length === 0) return <>;\n return (\n \n Next at \n \n );\n}\n\nfunction PurchasedUpgrade({ upgName }: { upgName: string }): React.ReactElement {\n const upg = GangMemberUpgrades[upgName];\n return (\n \n }>\n {upg.name}\n \n \n );\n}\n\ninterface IUpgradeButtonProps {\n upg: GangMemberUpgrade;\n rerender: () => void;\n member: GangMember;\n}\n\nfunction UpgradeButton(props: IUpgradeButtonProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n function onClick(): void {\n props.member.buyUpgrade(props.upg, player, gang);\n props.rerender();\n }\n return (\n }>\n \n \n \n \n );\n}\n\ninterface IPanelProps {\n member: GangMember;\n}\n\nfunction GangMemberUpgradePanel(props: IPanelProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n const setRerender = useState(false)[1];\n const [currentCategory, setCurrentCategory] = useState(\"Weapons\");\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function filterUpgrades(list: string[], type: UpgradeType): GangMemberUpgrade[] {\n return Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (player.money < gang.getUpgradeCost(upg)) return false;\n if (upg.type !== type) return false;\n if (list.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n }\n\n const onChange = (event: SelectChangeEvent): void => {\n setCurrentCategory(event.target.value);\n rerender();\n };\n\n const weaponUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Weapon);\n const armorUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Armor);\n const vehicleUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Vehicle);\n const rootkitUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Rootkit);\n const augUpgrades = filterUpgrades(props.member.augmentations, UpgradeType.Augmentation);\n\n const categories: { [key: string]: (GangMemberUpgrade[] | UpgradeType)[] } = {\n Weapons: [weaponUpgrades, UpgradeType.Weapon],\n Armor: [armorUpgrades, UpgradeType.Armor],\n Vehicles: [vehicleUpgrades, UpgradeType.Vehicle],\n Rootkits: [rootkitUpgrades, UpgradeType.Rootkit],\n Augmentations: [augUpgrades, UpgradeType.Augmentation],\n };\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n return (\n \n \n \n \n {props.member.name} ({props.member.task})\n \n \n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.hack)} Asc)\n
\n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.str)} Asc)\n
\n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.def)} Asc)\n
\n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.dex)} Asc)\n
\n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.agi)} Asc)\n
\n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.cha)} Asc)\n \n }\n >\n \n \n \n \n \n \n \n \n \n
\n \n
\n\n \n \n\n \n {(categories[currentCategory][0] as GangMemberUpgrade[]).length === 0 && (\n All upgrades owned!\n )}\n \n {(categories[currentCategory][0] as GangMemberUpgrade[]).map((upg) => (\n \n ))}\n \n \n \n \n
\n\n Purchased Upgrades: \n \n {props.member.upgrades.map((upg: string) => (\n \n ))}\n {props.member.augmentations.map((upg: string) => (\n \n ))}\n \n
\n );\n}\n\nexport function EquipmentsSubpage(): React.ReactElement {\n const gang = useGang();\n const [filter, setFilter] = useState(\"\");\n\n const handleFilterChange = (event: React.ChangeEvent): void => {\n setFilter(event.target.value.toLowerCase());\n };\n\n const members = gang.members.filter((member) => member && member.name.toLowerCase().includes(filter));\n\n return (\n <>\n \n You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power\n leads to more discounts.\n \n }\n >\n Discount: -{numeralWrapper.formatPercentage(1 - 1 / gang.getDiscount())}\n \n\n ,\n spellCheck: false,\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: \"15%\" }}\n />\n\n \n {members.map((member: GangMember) => (\n \n ))}\n \n \n );\n}\n","// React Components for the Corporation UI's navigation tabs\n// These are the tabs at the top of the UI that let you switch to different\n// divisions, see an overview of your corporation, or create a new industry\nimport React, { useState, useEffect } from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MainPanel } from \"./MainPanel\";\nimport { Industries } from \"../IndustryData\";\nimport { ExpandIndustryTab } from \"./ExpandIndustryTab\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\nimport { Overview } from \"./Overview\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function CorporationRoot(): React.ReactElement {\n const player = use.Player();\n const corporation = player.corporation;\n if (corporation === null) return <>;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [divisionName, setDivisionName] = useState(\"Overview\");\n function handleChange(event: React.SyntheticEvent, tab: string | number): void {\n setDivisionName(tab);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const canExpand =\n Object.keys(Industries).filter(\n (industryType: string) =>\n corporation.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n ).length > 0;\n\n return (\n \n \n \n {corporation.divisions.map((div) => (\n \n ))}\n {canExpand && }\n \n {divisionName === \"Overview\" && }\n {divisionName === -1 && }\n {typeof divisionName === \"string\" && divisionName !== \"Overview\" && (\n \n )}\n \n );\n}\n","// React Component for the element that contains the actual info/data\n// for the Corporation UI. This panel lies below the header tabs and will\n// be filled with whatever is needed based on the routing/navigation\nimport React from \"react\";\n\nimport { CityTabs } from \"./CityTabs\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Context, useCorporation } from \"./Context\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\n\ninterface IProps {\n divisionName: string;\n rerender: () => void;\n}\n\nexport function MainPanel(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division =\n props.divisionName !== \"Overview\"\n ? corp.divisions.find((division: IIndustry) => division.name === props.divisionName)\n : undefined; // use undefined because find returns undefined\n\n if (division === undefined) throw new Error(\"Cannot find division\");\n return (\n \n \n \n );\n}\n","// React Components for the Corporation UI's City navigation tabs\n// These allow player to navigate between different cities for each industry\nimport React, { useState } from \"react\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industry } from \"./Industry\";\nimport { ExpandNewCity } from \"./ExpandNewCity\";\nimport { useDivision } from \"./Context\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\ninterface IProps {\n city: string;\n rerender: () => void;\n}\n\nexport function CityTabs(props: IProps): React.ReactElement {\n const division = useDivision();\n const [city, setCity] = useState(props.city);\n\n const office = division.offices[city];\n if (office === 0) {\n setCity(\"Sector-12\");\n return <>;\n }\n\n const canExpand =\n Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0).length > 0;\n function handleChange(event: React.SyntheticEvent, tab: string): void {\n setCity(tab);\n }\n return (\n <>\n \n {Object.values(division.offices).map(\n (office: OfficeSpace | 0) => office !== 0 && ,\n )}\n {canExpand && }\n \n\n {city !== \"Expand\" ? (\n \n ) : (\n \n )}\n \n );\n}\n","// React Component for managing the Corporation's Industry UI\n// This Industry component does NOT include the city tabs at the top\nimport React from \"react\";\n\nimport { IndustryOffice } from \"./IndustryOffice\";\nimport { IndustryOverview } from \"./IndustryOverview\";\nimport { IndustryWarehouse } from \"./IndustryWarehouse\";\nimport { Warehouse } from \"../Warehouse\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n city: string;\n warehouse: Warehouse | 0;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function Industry(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const division = useDivision();\n return (\n \n \n \n \n \n \n \n \n \n );\n}\n","// React Component for displaying an Industry's OfficeSpace information\n// (bottom-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Employee } from \"../Employee\";\nimport { EmployeePositions } from \"../EmployeePositions\";\nimport { BuyCoffee } from \"../Actions\";\n\nimport { MoneyCost } from \"./MoneyCost\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { UpgradeOfficeSizeModal } from \"./modals/UpgradeOfficeSizeModal\";\nimport { ThrowPartyModal } from \"./modals/ThrowPartyModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Paper from \"@mui/material/Paper\";\nimport ArrowForwardIcon from \"@mui/icons-material/ArrowForward\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport { Box } from \"@mui/material\";\n\ninterface IProps {\n office: OfficeSpace;\n rerender: () => void;\n}\n\ninterface ISwitchProps {\n manualMode: boolean;\n switchMode: (f: (b: boolean) => boolean) => void;\n}\n\nfunction SwitchButton(props: ISwitchProps): React.ReactElement {\n if (props.manualMode) {\n return (\n \n Switch to Automatic Assignment Mode, which will automatically assign employees to your selected jobs. You\n simply have to select the number of assignments for each job\n \n }\n >\n \n \n );\n } else {\n return (\n \n Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs\n \n }\n >\n \n \n );\n }\n}\n\nfunction ManualManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [employee, setEmployee] = useState(\n props.office.employees.length > 0 ? props.office.employees[0] : null,\n );\n\n // Employee Selector\n const employees = [];\n for (let i = 0; i < props.office.employees.length; ++i) {\n employees.push(\n \n {props.office.employees[i].name}\n ,\n );\n }\n\n function employeeSelectorOnChange(e: SelectChangeEvent): void {\n const name = e.target.value;\n for (let i = 0; i < props.office.employees.length; ++i) {\n if (name === props.office.employees[i].name) {\n setEmployee(props.office.employees[i]);\n break;\n }\n }\n\n props.rerender();\n }\n\n // Employee Positions Selector\n const emp = employee;\n let employeePositionSelectorInitialValue = \"\";\n const employeePositions = [];\n const positionNames = Object.values(EmployeePositions);\n for (let i = 0; i < positionNames.length; ++i) {\n employeePositions.push(\n \n {positionNames[i]}\n ,\n );\n if (emp != null && emp.nextPos === positionNames[i]) {\n employeePositionSelectorInitialValue = emp.nextPos;\n }\n }\n\n function employeePositionSelectorOnChange(e: SelectChangeEvent): void {\n if (employee === null) return;\n props.office.assignSingleJob(employee, e.target.value);\n props.rerender();\n }\n\n // Numeraljs formatter\n const nf = \"0.000\";\n\n // Employee stats (after applying multipliers)\n const effCre = emp ? emp.cre * corp.getEmployeeCreMultiplier() * division.getEmployeeCreMultiplier() : 0;\n const effCha = emp ? emp.cha * corp.getEmployeeChaMultiplier() * division.getEmployeeChaMultiplier() : 0;\n const effInt = emp ? emp.int * corp.getEmployeeIntMultiplier() * division.getEmployeeIntMultiplier() : 0;\n const effEff = emp ? emp.eff * corp.getEmployeeEffMultiplier() * division.getEmployeeEffMultiplier() : 0;\n\n return (\n <>\n
\n \n {employee != null && (\n \n Morale: {numeralWrapper.format(employee.mor, nf)}\n
\n Happiness: {numeralWrapper.format(employee.hap, nf)}\n
\n Energy: {numeralWrapper.format(employee.ene, nf)}\n
\n Intelligence: {numeralWrapper.format(effInt, nf)}\n
\n Charisma: {numeralWrapper.format(effCha, nf)}\n
\n Experience: {numeralWrapper.format(employee.exp, nf)}\n
\n Creativity: {numeralWrapper.format(effCre, nf)}\n
\n Efficiency: {numeralWrapper.format(effEff, nf)}\n
\n Salary: \n
\n )}\n {employee != null && (\n \n )}\n \n );\n}\n\ninterface IAutoAssignProps {\n office: OfficeSpace;\n job: string;\n desc: string;\n rerender: () => void;\n}\n\nfunction EmployeeCount(props: { num: number; next: number }): React.ReactElement {\n return (\n \n {props.num === props.next ? null : props.num}\n {props.num === props.next ? null : }\n {props.next}\n \n );\n}\n\nfunction AutoAssignJob(props: IAutoAssignProps): React.ReactElement {\n const currJob = props.office.employeeJobs[props.job];\n const nextJob = props.office.employeeNextJobs[props.job];\n const nextUna = props.office.employeeNextJobs[EmployeePositions.Unassigned];\n\n function assignEmployee(): void {\n if (nextUna <= 0) {\n console.warn(\"Cannot assign employee. No unassigned employees available\");\n return;\n }\n\n props.office.autoAssignJob(props.job, nextJob + 1);\n props.rerender();\n }\n\n function unassignEmployee(): void {\n props.office.autoAssignJob(props.job, nextJob - 1);\n props.rerender();\n }\n\n return (\n \n \n \n {props.job}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n\nfunction AutoManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const vechain = corp.unlockUpgrades[4] === 1; // Has Vechain upgrade\n\n // Calculate average morale, happiness, energy, and salary.\n let totalMorale = 0,\n totalHappiness = 0,\n totalEnergy = 0,\n totalSalary = 0;\n for (let i = 0; i < props.office.employees.length; ++i) {\n totalMorale += props.office.employees[i].mor;\n totalHappiness += props.office.employees[i].hap;\n totalEnergy += props.office.employees[i].ene;\n totalSalary += props.office.employees[i].sal;\n }\n\n let avgMorale = 0,\n avgHappiness = 0,\n avgEnergy = 0;\n if (props.office.employees.length > 0) {\n avgMorale = totalMorale / props.office.employees.length;\n avgHappiness = totalHappiness / props.office.employees.length;\n avgEnergy = totalEnergy / props.office.employees.length;\n }\n\n const currUna = props.office.employeeJobs[EmployeePositions.Unassigned];\n const nextUna = props.office.employeeNextJobs[EmployeePositions.Unassigned];\n\n return (\n \n \n \n \n Unassigned Employees:\n \n \n \n \n \n \n \n Avg Employee Morale:\n \n \n {numeralWrapper.format(avgMorale, \"0.000\")}\n \n \n \n \n Avg Employee Happiness:\n \n \n {numeralWrapper.format(avgHappiness, \"0.000\")}\n \n \n \n \n Avg Employee Energy:\n \n \n {numeralWrapper.format(avgEnergy, \"0.000\")}\n \n \n \n \n Total Employee Salary:\n \n \n \n \n \n \n \n {vechain && (\n <>\n \n \n \n The base amount of material this office can produce. Does not include production multipliers from\n upgrades and materials. This value is based off the productivity of your Operations, Engineering,\n and Management employees\n \n }\n >\n Material Production:\n \n \n \n \n {numeralWrapper.format(division.getOfficeProductivity(props.office), \"0.000\")}\n \n \n \n \n \n \n The base amount of any given Product this office can produce. Does not include production\n multipliers from upgrades and materials. This value is based off the productivity of your\n Operations, Engineering, and Management employees\n \n }\n >\n Product Production:\n \n \n \n \n {numeralWrapper.format(\n division.getOfficeProductivity(props.office, {\n forProduct: true,\n }),\n \"0.000\",\n )}\n \n \n \n \n \n The effect this office's 'Business' employees has on boosting sales}\n >\n Business Multiplier:\n \n \n \n x{numeralWrapper.format(division.getBusinessFactor(props.office), \"0.000\")}\n \n \n \n )}\n \n\n \n\n \n\n \n\n \n\n \n \n
\n );\n}\n\nexport function IndustryOffice(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [upgradeOfficeSizeOpen, setUpgradeOfficeSizeOpen] = useState(false);\n const [throwPartyOpen, setThrowPartyOpen] = useState(false);\n const [employeeManualAssignMode, setEmployeeManualAssignMode] = useState(false);\n\n function autohireEmployeeButtonOnClick(): void {\n if (props.office.atCapacity()) return;\n props.office.hireRandomEmployee();\n props.rerender();\n }\n\n return (\n \n Office Space\n \n Size: {props.office.employees.length} / {props.office.size} employees\n \n \n \n Automatically hires an employee and gives him/her a random name}>\n \n \n \n \n Upgrade the office's size so that it can hold more employees!}>\n \n \n \n \n setUpgradeOfficeSizeOpen(false)}\n />\n\n {!division.hasResearch(\"AutoBrew\") && (\n <>\n Provide your employees with coffee, increasing their energy by 5%}\n >\n \n 0}\n onClick={() => BuyCoffee(corp, props.office)}\n >\n {props.office.coffeeMult > 0 ? (\n \"Buying coffee...\"\n ) : (\n \n Buy Coffee - \n \n )}\n \n \n \n \n )}\n\n {!division.hasResearch(\"AutoPartyManager\") && (\n <>\n Throw an office party to increase your employee's morale and happiness}\n >\n \n 0}\n onClick={() => setThrowPartyOpen(true)}\n >\n {props.office.partyMult > 0 ? \"Throwing Party...\" : \"Throw Party\"}\n \n \n \n setThrowPartyOpen(false)}\n />\n \n )}\n \n \n \n {employeeManualAssignMode ? (\n \n ) : (\n \n )}\n \n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { OfficeSpace } from \"../../OfficeSpace\";\nimport { ICorporation } from \"../../ICorporation\";\nimport { UpgradeOfficeSize } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IUpgradeButton {\n cost: number;\n size: number;\n corp: ICorporation;\n office: OfficeSpace;\n onClose: () => void;\n rerender: () => void;\n}\n\nfunction UpgradeSizeButton(props: IUpgradeButton): React.ReactElement {\n const corp = useCorporation();\n function upgradeSize(cost: number, size: number): void {\n if (corp.funds < cost) {\n return;\n }\n\n UpgradeOfficeSize(corp, props.office, size);\n props.rerender();\n props.onClose();\n }\n return (\n \n \n \n \n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function UpgradeOfficeSizeModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const initialPriceMult = Math.round(props.office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n const upgradeCost = CorporationConstants.OfficeInitialCost * Math.pow(costMultiplier, initialPriceMult);\n\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < 5; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const upgradeCost15 = CorporationConstants.OfficeInitialCost * mult;\n\n //Calculate max upgrade size and cost\n const maxMult = corp.funds / CorporationConstants.OfficeInitialCost;\n let maxNum = 1;\n mult = Math.pow(costMultiplier, initialPriceMult);\n while (maxNum < 50) {\n //Hard cap of 50x (extra 150 employees)\n if (mult >= maxMult) break;\n const multIncrease = Math.pow(costMultiplier, initialPriceMult + maxNum);\n if (mult + multIncrease > maxMult) {\n break;\n } else {\n mult += multIncrease;\n }\n ++maxNum;\n }\n const upgradeCostMax = CorporationConstants.OfficeInitialCost * mult;\n\n return (\n \n Increase the size of your office space to fit additional employees!\n \n Upgrade size: \n \n \n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { OfficeSpace } from \"../../OfficeSpace\";\nimport { ThrowParty } from \"../../Actions\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function ThrowPartyModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [cost, setCost] = useState(0);\n\n const totalCost = cost * props.office.employees.length;\n const canParty = corp.funds >= totalCost;\n function changeCost(event: React.ChangeEvent): void {\n let x = parseFloat(event.target.value);\n if (isNaN(x)) x = 0;\n setCost(x);\n }\n\n function throwParty(): void {\n if (cost === null || isNaN(cost) || cost < 0) {\n dialogBoxCreate(\"Invalid value entered\");\n } else if (!canParty) {\n dialogBoxCreate(\"You don't have enough company funds to throw a party!\");\n } else {\n const mult = ThrowParty(corp, props.office, cost);\n\n if (mult > 0) {\n dialogBoxCreate(\n \"You threw a party for the office! The morale and happiness \" +\n \"of each employee increased by \" +\n numeralWrapper.formatPercentage(mult - 1),\n );\n }\n\n props.rerender();\n props.onClose();\n }\n }\n\n function EffectText(): React.ReactElement {\n if (isNaN(cost) || cost < 0) return Invalid value entered!;\n return (\n \n Throwing this party will cost a total of \n \n );\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) throwParty();\n }\n\n return (\n \n Enter the amount of money you would like to spend PER EMPLOYEE on this office party\n \n \n \n \n \n \n );\n}\n","// React Component for displaying an Industry's overview information\n// (top-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { Industries } from \"../IndustryData\";\nimport { HireAdVert } from \"../Actions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { MakeProductModal } from \"./modals/MakeProductModal\";\nimport { ResearchModal } from \"./modals/ResearchModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport Box from \"@mui/material/Box\";\n\nfunction MakeProductButton(): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [makeOpen, setMakeOpen] = useState(false);\n\n const hasMaxProducts = division.hasMaximumNumberProducts();\n\n function shouldFlash(): boolean {\n return Object.keys(division.products).length === 0;\n }\n\n let createProductButtonText = \"\";\n switch (division.type) {\n case Industries.Food:\n createProductButtonText = \"Build Restaurant\";\n break;\n case Industries.Tobacco:\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Pharmaceutical:\n createProductButtonText = \"Create Drug\";\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Robotics:\n createProductButtonText = \"Design Robot\";\n break;\n case Industries.Software:\n createProductButtonText = \"Develop Software\";\n break;\n case Industries.Healthcare:\n createProductButtonText = \"Build Hospital\";\n break;\n case Industries.RealEstate:\n createProductButtonText = \"Develop Property\";\n break;\n default:\n createProductButtonText = \"Create Product\";\n return <>;\n }\n\n return (\n <>\n \n You have reached the maximum number of products: {division.getMaximumNumberProducts()}\n \n ) : (\n \"\"\n )\n }\n >\n \n \n setMakeOpen(false)} />\n \n );\n}\n\ninterface IProps {\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [helpOpen, setHelpOpen] = useState(false);\n const [researchOpen, setResearchOpen] = useState(false);\n const vechain = corp.unlockUpgrades[4] === 1;\n const profit = division.lastCycleRevenue - division.lastCycleExpenses;\n\n let advertisingInfo = false;\n const advertisingFactors = division.getAdvertisingFactors();\n const awarenessFac = advertisingFactors[1];\n const popularityFac = advertisingFactors[2];\n const ratioFac = advertisingFactors[3];\n const totalAdvertisingFac = advertisingFactors[0];\n if (vechain) {\n advertisingInfo = true;\n }\n\n function convertEffectFacToGraphic(fac: number): string {\n return createProgressBarText({\n progress: fac,\n totalTicks: 20,\n });\n }\n\n return (\n \n \n Industry: {division.type} (Corp Funds: )\n \n
\n \n {advertisingInfo !== false && (\n \n Total multiplier for this industrys sales due to its awareness and popularity\n \n \n }\n >\n Advertising Multiplier: x{numeralWrapper.formatReallyBigNumber(totalAdvertisingFac)}\n \n )}\n
\n ],\n [\"Expenses:\", ],\n [\"Profit:\", ],\n ]}\n />\n
\n \n \n Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real\n Estate.\n \n }\n >\n Production Multiplier: {numeralWrapper.formatReallyBigNumber(division.prodMult)}\n \n setHelpOpen(true)}>\n \n \n setHelpOpen(false)}>\n \n Owning Hardware, Robots, AI Cores, and Real Estate can boost your Industry's production. The effect these\n materials have on your production varies between Industries. For example, Real Estate may be very effective\n for some Industries, but ineffective for others.\n
\n
\n This division's production multiplier is calculated by summing the individual production multiplier of each\n of its office locations. This production multiplier is applied to each office. Therefore, it is beneficial\n to expand into new cities as this can greatly increase the production multiplier of your entire Division.\n
\n
\n Below are approximations for how effective each material is at boosting this industry's production\n multiplier (Bigger bars = more effective):\n
\n
\n Hardware:    {convertEffectFacToGraphic(division.hwFac)}\n
\n Robots:      {convertEffectFacToGraphic(division.robFac)}\n
\n AI Cores:    {convertEffectFacToGraphic(division.aiFac)}\n
\n Real Estate: {convertEffectFacToGraphic(division.reFac)}\n
\n
\n
\n \n \n Scientific Research increases the quality of the materials and products that you produce.\n \n }\n >\n Scientific Research: {numeralWrapper.formatReallyBigNumber(division.sciResearch.qty)}\n \n \n setResearchOpen(false)} industry={division} />\n \n
\n \n \n Hire AdVert.Inc to advertise your company. Each level of this upgrade grants your company a static\n increase of 3 and 1 to its awareness and popularity, respectively. It will then increase your company's\n awareness by 1%, and its popularity by a random percentage between 1% and 3%. These effects are increased\n by other upgrades that increase the power of your advertising.\n \n }\n >\n corp.funds}\n onClick={function () {\n HireAdVert(corp, division);\n props.rerender();\n }}\n >\n Hire AdVert -  \n \n \n {division.makesProducts && }\n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Industries } from \"../../IndustryData\";\nimport { MakeProduct } from \"../../Actions\";\nimport { useCorporation, useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction productPlaceholder(tpe: string): string {\n if (tpe === Industries.Food) {\n return \"Restaurant Name\";\n } else if (tpe === Industries.Healthcare) {\n return \"Hospital Name\";\n } else if (tpe === Industries.RealEstate) {\n return \"Property Name\";\n }\n return \"Product Name\";\n}\n\n// Create a popup that lets the player create a product for their current industry\nexport function MakeProductModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const allCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] !== 0);\n const [city, setCity] = useState(allCities.length > 0 ? allCities[0] : \"\");\n const [name, setName] = useState(\"\");\n const [design, setDesign] = useState(NaN);\n const [marketing, setMarketing] = useState(NaN);\n if (division.hasMaximumNumberProducts()) return <>;\n\n let createProductPopupText = <>;\n switch (division.type) {\n case Industries.Food:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Build and manage a new restaurant!\n \n );\n break;\n case Industries.Tobacco:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Create a new tobacco product!\n \n );\n break;\n case Industries.Pharmaceutical:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Design and develop a new pharmaceutical drug!\n \n );\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Design and manufacture a new computer hardware product!\n \n );\n break;\n case Industries.Robotics:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Design and create a new robot or robotic system!\n \n );\n break;\n case Industries.Software:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Develop a new piece of software!\n \n );\n break;\n case Industries.Healthcare:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Build and manage a new hospital!\n \n );\n break;\n case Industries.RealEstate:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Develop a new piece of real estate property!\n \n );\n break;\n default:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n Create a new product!\n \n );\n return <>;\n }\n createProductPopupText = (\n <>\n {createProductPopupText}\n
\n
\n To begin developing a product, first choose the city in which it will be designed. The stats of your employees in\n the selected city affect the properties of the finished product, such as its quality, performance, and durability.\n
\n
\n You can also choose to invest money in the design and marketing of the product. Investing money in its design will\n result in a superior product. Investing money in marketing the product will help the product's sales.\n \n );\n\n function makeProduct(): void {\n if (isNaN(design) || isNaN(marketing)) return;\n try {\n MakeProduct(corp, division, city, name, design, marketing);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onCityChange(event: SelectChangeEvent): void {\n setCity(event.target.value);\n }\n\n function onProductNameChange(event: React.ChangeEvent): void {\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) makeProduct();\n }\n\n return (\n \n {createProductPopupText}\n \n \n
\n \n \n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { IndustryResearchTrees } from \"../../IndustryData\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { IIndustry } from \"../../IIndustry\";\nimport { Research } from \"../../Actions\";\nimport { Node } from \"../../ResearchTree\";\nimport { ResearchMap } from \"../../ResearchMap\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport CheckIcon from \"@mui/icons-material/Check\";\n\ninterface INodeProps {\n n: Node | null;\n division: IIndustry;\n}\nfunction Upgrade({ n, division }: INodeProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (n === null) return <>;\n const r = ResearchMap[n.text];\n let disabled = division.sciResearch.qty < r.cost || n.researched;\n const parent = n.parent;\n if (parent !== null) {\n disabled = disabled || !parent.researched;\n }\n\n function research(): void {\n if (n === null || disabled) return;\n try {\n Research(division, n.text);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(\n `Researched ${n.text}. It may take a market cycle ` +\n `(~${CorporationConstants.SecsPerMarketCycle} seconds) before the effects of ` +\n `the Research apply.`,\n );\n }\n\n let color: \"primary\" | \"info\" = \"primary\";\n if (n.researched) {\n color = \"info\";\n }\n\n const wrapInTooltip = (ele: React.ReactElement): React.ReactElement => {\n return (\n \n Research points: {r.cost}\n
\n {r.desc}\n \n }\n >\n {ele}\n \n );\n };\n\n const but = (\n \n {wrapInTooltip(\n \n \n {n.researched && }\n {n.text}\n \n ,\n )}\n \n );\n\n if (n.children.length === 0) return but;\n\n return (\n \n \n {wrapInTooltip(\n \n \n {n.researched && }\n {n.text}\n \n ,\n )}\n setOpen((old) => !old)}\n sx={{ borderColor: Settings.theme.button, minWidth: \"fit-content\" }}\n >\n {open ? : }\n \n \n \n \n {n.children.map((m) => (\n \n ))}\n \n \n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n industry: IIndustry;\n}\n\n// Create the Research Tree UI for this Industry\nexport function ResearchModal(props: IProps): React.ReactElement {\n const researchTree = IndustryResearchTrees[props.industry.type];\n if (researchTree === undefined) return <>;\n\n return (\n \n \n \n Research points: {props.industry.sciResearch.qty.toFixed(3)}\n
\n Multipliers from research:\n
* Advertising Multiplier: x{researchTree.getAdvertisingMultiplier()}\n
* Employee Charisma Multiplier: x{researchTree.getEmployeeChaMultiplier()}\n
* Employee Creativity Multiplier: x{researchTree.getEmployeeCreMultiplier()}\n
* Employee Efficiency Multiplier: x{researchTree.getEmployeeEffMultiplier()}\n
* Employee Intelligence Multiplier: x{researchTree.getEmployeeIntMultiplier()}\n
* Production Multiplier: x{researchTree.getProductionMultiplier()}\n
* Sales Multiplier: x{researchTree.getSalesMultiplier()}\n
* Scientific Research Multiplier: x{researchTree.getScientificResearchMultiplier()}\n
* Storage Multiplier: x{researchTree.getStorageMultiplier()}\n
\n
\n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Material } from \"../Material\";\nimport { Product } from \"../Product\";\nimport { Warehouse } from \"../Warehouse\";\nimport { SmartSupplyModal } from \"./modals/SmartSupplyModal\";\nimport { ProductElem } from \"./ProductElem\";\nimport { MaterialElem } from \"./MaterialElem\";\nimport { MaterialSizes } from \"../MaterialSizes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { isRelevantMaterial } from \"./Helpers\";\nimport { IndustryProductEquation } from \"./IndustryProductEquation\";\nimport { PurchaseWarehouse } from \"../Actions\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n warehouse: Warehouse | 0;\n currentCity: string;\n player: IPlayer;\n rerender: () => void;\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n retainHeight: {\n minHeight: \"3em\",\n },\n }),\n);\n\nfunction WarehouseRoot(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [smartSupplyOpen, setSmartSupplyOpen] = useState(false);\n if (props.warehouse === 0) return <>;\n\n // Upgrade Warehouse size button\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, props.warehouse.level + 1);\n const canAffordUpgrade = corp.funds > sizeUpgradeCost;\n function upgradeWarehouseOnClick(): void {\n if (division === null) return;\n if (props.warehouse === 0) return;\n if (!canAffordUpgrade) return;\n ++props.warehouse.level;\n props.warehouse.updateSize(corp, division);\n corp.funds = corp.funds - sizeUpgradeCost;\n props.rerender();\n }\n\n const classes = useStyles();\n\n // Current State:\n let stateText;\n switch (division.state) {\n case \"START\":\n stateText = \"Current state: Preparing...\";\n break;\n case \"PURCHASE\":\n stateText = \"Current state: Purchasing materials...\";\n break;\n case \"PRODUCTION\":\n stateText = \"Current state: Producing materials and/or products...\";\n break;\n case \"SALE\":\n stateText = \"Current state: Selling materials and/or products...\";\n break;\n case \"EXPORT\":\n stateText = \"Current state: Exporting materials and/or products...\";\n break;\n default:\n console.error(`Invalid state: ${division.state}`);\n break;\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n // Only create UI for materials that are relevant for the industry or in stock\n const isInStock = props.warehouse.materials[matName].qty > 0;\n const isRelevant = isRelevantMaterial(matName, division);\n if (!isInStock && !isRelevant) continue;\n mats.push(\n ,\n );\n }\n\n // Create React components for products\n const products = [];\n if (division.makesProducts && Object.keys(division.products).length > 0) {\n for (const productName of Object.keys(division.products)) {\n const product = division.products[productName];\n if (!(product instanceof Product)) continue;\n products.push(\n ,\n );\n }\n }\n\n const breakdownItems: JSX.Element[] = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n const mat = props.warehouse.materials[matName];\n if (!MaterialSizes.hasOwnProperty(matName)) continue;\n if (mat.qty === 0) continue;\n breakdownItems.push(\n <>\n {matName}: {numeralWrapper.format(mat.qty * MaterialSizes[matName], \"0,0.0\")}\n ,\n );\n }\n\n for (const prodName of Object.keys(division.products)) {\n const prod = division.products[prodName];\n if (prod === undefined) continue;\n breakdownItems.push(\n <>\n {prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, \"0,0.0\")}\n ,\n );\n }\n\n let breakdown;\n if (breakdownItems && breakdownItems.length > 0) {\n breakdown = breakdownItems.reduce(\n (previous: JSX.Element, current: JSX.Element): JSX.Element =>\n (previous && (\n <>\n {previous}\n
\n {current}\n \n )) || <>{current},\n );\n } else {\n breakdown = <>No items in storage.;\n }\n\n return (\n \n \n \n <>{breakdown}\n \n ) : (\n \"\"\n )\n }\n >\n = props.warehouse.size ? \"error\" : \"primary\"}>\n Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{\" \"}\n {numeralWrapper.formatBigNumber(props.warehouse.size)}\n \n \n \n\n \n\n This industry uses the following equation for its production: \n
\n \n \n \n
\n \n To get started with production, purchase your required materials or import them from another of your company's\n divisions.\n \n
\n\n {stateText}\n\n {corp.unlockUpgrades[1] && (\n <>\n \n setSmartSupplyOpen(false)}\n warehouse={props.warehouse}\n />\n \n )}\n\n {mats}\n\n {products}\n
\n );\n}\n\nexport function IndustryWarehouse(props: IProps): React.ReactElement {\n if (props.warehouse instanceof Warehouse) {\n return ;\n } else {\n return ;\n }\n}\n\ninterface IEmptyProps {\n city: string;\n rerender: () => void;\n}\n\nfunction EmptyWarehouse(props: IEmptyProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const disabled = corp.funds < CorporationConstants.WarehouseInitialCost;\n function purchaseWarehouse(): void {\n if (disabled) return;\n PurchaseWarehouse(corp, division, props.city);\n props.rerender();\n }\n return (\n \n \n \n );\n}\n","import React, { useState } from \"react\";\n\nimport { Warehouse } from \"../../Warehouse\";\nimport { SetSmartSupply, SetSmartSupplyUseLeftovers } from \"../../Actions\";\nimport { Material } from \"../../Material\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface ILeftoverProps {\n matName: string;\n warehouse: Warehouse;\n}\n\nfunction Leftover(props: ILeftoverProps): React.ReactElement {\n const [checked, setChecked] = useState(!!props.warehouse.smartSupplyUseLeftovers[props.matName.replace(/ /g, \"\")]);\n\n function onChange(event: React.ChangeEvent): void {\n try {\n const matName = props.matName.replace(/ /g, \"\");\n const material = props.warehouse.materials[matName];\n SetSmartSupplyUseLeftovers(props.warehouse, material, event.target.checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n setChecked(event.target.checked);\n }\n\n return (\n <>\n }\n label={{props.warehouse.materials[props.matName.replace(/ /g, \"\")].name}}\n />\n
\n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n warehouse: Warehouse;\n}\n\nexport function SmartSupplyModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n // Smart Supply Checkbox\n function smartSupplyOnChange(e: React.ChangeEvent): void {\n SetSmartSupply(props.warehouse, e.target.checked);\n rerender();\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n if (!Object.keys(division.reqMats).includes(matName)) continue;\n mats.push();\n }\n\n return (\n \n <>\n }\n label={Enable Smart Supply}\n />\n
\n Use materials already in the warehouse instead of buying new ones, if available:\n {mats}\n \n
\n );\n}\n","import React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Product } from \"../Product\";\nimport { DiscontinueProductModal } from \"./modals/DiscontinueProductModal\";\nimport { LimitProductProductionModal } from \"./modals/LimitProductProductionModal\";\nimport { SellProductModal } from \"./modals/SellProductModal\";\nimport { ProductMarketTaModal } from \"./modals/ProductMarketTaModal\";\nimport { CancelProductModal } from \"./modals/CancelProductModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProductProps {\n city: string;\n product: Product;\n rerender: () => void;\n}\n\n// Creates the UI for a single Product type\nexport function ProductElem(props: IProductProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [sellOpen, setSellOpen] = useState(false);\n const [limitOpen, setLimitOpen] = useState(false);\n const [discontinueOpen, setDiscontinueOpen] = useState(false);\n const [cancelOpen, setCancelOpen] = useState(false);\n const [marketTaOpen, setMarketTaOpen] = useState(false);\n const city = props.city;\n const product = props.product;\n\n // Numeraljs formatters\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be big\n\n const hasUpgradeDashboard = division.hasResearch(\"uPgrade: Dashboard\");\n\n // Total product gain = production - sale\n const totalGain = product.data[city][1] - product.data[city][2];\n\n // Sell button\n let sellButtonText: JSX.Element;\n if (product.sllman[city][0]) {\n if (isString(product.sllman[city][1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/{product.sllman[city][1]})\n \n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/\n {numeralWrapper.format(product.sllman[city][1], nfB)})\n \n );\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000);\n }\n\n if (product.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (product.marketTa1) {\n const markupLimit = product.rat / product.mku;\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (product.sCost) {\n if (isString(product.sCost)) {\n const sCost = (product.sCost as string).replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n }\n }\n\n // Limit Production button\n let limitProductionButtonText = \"Limit Production\";\n if (product.prdman[city][0]) {\n limitProductionButtonText += \" (\" + numeralWrapper.format(product.prdman[city][1], nf) + \")\";\n }\n\n return (\n \n {!product.fin ? (\n <>\n \n Designing {product.name} (req. Operations/Engineers in {product.createCity})...\n \n
\n {numeralWrapper.format(product.prog, \"0.00\")}% complete\n \n setCancelOpen(false)}\n />\n \n ) : (\n <>\n \n \n Prod: {numeralWrapper.format(product.data[city][1], nfB)}/s\n
\n Sell: {numeralWrapper.format(product.data[city][2], nfB)} /s\n \n }\n >\n \n {product.name}: {numeralWrapper.format(product.data[city][0], nfB)} (\n {numeralWrapper.format(totalGain, nfB)}\n /s)\n \n \n
\n \n \n Quality: {numeralWrapper.format(product.qlt, nf)}
\n Performance: {numeralWrapper.format(product.per, nf)}
\n Durability: {numeralWrapper.format(product.dur, nf)}
\n Reliability: {numeralWrapper.format(product.rel, nf)}
\n Aesthetics: {numeralWrapper.format(product.aes, nf)}
\n Features: {numeralWrapper.format(product.fea, nf)}\n {corp.unlockUpgrades[2] === 1 &&
}\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(product.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 &&
}\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(product.cmp, nf)}\n \n }\n >\n Rating: {numeralWrapper.format(product.rat, nf)}\n \n
\n \n An estimate of the material cost it takes to create this Product.}>\n \n Est. Production Cost:{\" \"}\n {numeralWrapper.formatMoney(product.pCost / CorporationConstants.ProductProductionCostRatio)}\n \n \n \n \n \n An estimate of how much consumers are willing to pay for this product. Setting the sale price above\n this may result in less sales. Setting the sale price below this may result in more sales.\n \n }\n >\n Est. Market Price: {numeralWrapper.formatMoney(product.pCost)}\n \n \n \n setDiscontinueOpen(false)}\n />\n \n )}\n\n {(hasUpgradeDashboard || product.fin) && (\n <>\n \n setSellOpen(false)} />\n
\n \n setLimitOpen(false)}\n />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n \n setMarketTaOpen(false)} />\n \n )}\n \n )}\n
\n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player discontinue a product\nexport function DiscontinueProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function discontinue(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n \n \n Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no\n longer produce this product and all of its existing stock will be removed and left unsold\n \n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { Product } from \"../../Product\";\nimport { LimitProductProduction } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitProductProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState(null);\n\n // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\n\n function limitProductProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitProductProduction(props.product, props.city, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) limitProductProduction();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n \n \n Enter a limit to the amount of this product you would like to produce per second. Leave the box empty to set no\n limit.\n \n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Product } from \"../../Product\";\nimport { SellProduct } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\nfunction initialPrice(product: Product): string {\n let val = product.sCost ? product.sCost + \"\" : \"\";\n if (product.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (product.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellProductModal(props: IProps): React.ReactElement {\n const [checked, setChecked] = useState(true);\n const [iQty, setQty] = useState(\n props.product.sllman[props.city][1] ? props.product.sllman[props.city][1] : \"\",\n );\n const [px, setPx] = useState(initialPrice(props.product));\n\n function onCheckedChange(event: React.ChangeEvent): void {\n setChecked(event.target.checked);\n }\n\n function sellProduct(): void {\n try {\n SellProduct(props.product, props.city, iQty, px, checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent): void {\n setQty(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent): void {\n setPx(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) sellProduct();\n }\n\n return (\n \n \n Enter the maximum amount of {props.product.name} you would like to sell per second, as well as the price at\n which you would like to sell it at.\n
\n
\n If the sell amount is set to 0, then the product will not be sold. If the sell price is set to 0, then the\n product will be discarded.\n
\n
\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n
\n
\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less\n of the material than you produce.\n
\n
\n When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on\n the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five\n times the estimated market price.\n
\n
\n \n \n \n }\n label={Use same 'Sell Amount' for all cities}\n />\n
\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface ITa2Props {\n product: Product;\n}\n\nfunction MarketTA2(props: ITa2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <>;\n const markupLimit = props.product.rat / props.product.mku;\n const [value, setValue] = useState(props.product.pCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent): void {\n setValue(parseFloat(event.target.value));\n }\n\n function onCheckedChange(event: React.ChangeEvent): void {\n props.product.marketTa2 = event.target.checked;\n rerender();\n }\n\n const sCost = value;\n let markup = 1;\n if (sCost > props.product.pCost) {\n if (sCost - props.product.pCost > markupLimit) {\n markup = markupLimit / (sCost - props.product.pCost);\n }\n }\n\n return (\n <>\n Market-TA.II\n
\n \n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n \n \n
\n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n \n }\n >\n Use Market-TA.II for Auto-Sale Price\n \n }\n />\n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n}\n\n// Create a popup that lets the player use the Market TA research for Products\nexport function ProductMarketTaModal(props: IProps): React.ReactElement {\n const markupLimit = props.product.rat / props.product.mku;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent): void {\n props.product.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n \n <>\n Market-TA.I\n \n The maximum sale price you can mark this up to is{\" \"}\n {numeralWrapper.formatMoney(props.product.pCost + markupLimit)}. This means that if you set the sale price\n higher than this, you will begin to experience a loss in number of sales\n \n\n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n \n }\n >\n Use Market-TA.I for Auto-Sale Price\n \n }\n />\n \n\n \n \n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player cancel a product\nexport function CancelProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function cancel(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n \n \n Are you sure you want to do this? Canceling a product removes it completely and permanently. You will receive no\n money back by doing so\n \n \n \n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Material } from \"../Material\";\nimport { Warehouse } from \"../Warehouse\";\nimport { ExportModal } from \"./modals/ExportModal\";\nimport { MaterialMarketTaModal } from \"./modals/MaterialMarketTaModal\";\nimport { SellMaterialModal } from \"./modals/SellMaterialModal\";\nimport { PurchaseMaterialModal } from \"./modals/PurchaseMaterialModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport { LimitMaterialProductionModal } from \"./modals/LimitMaterialProductionModal\";\n\ninterface IMaterialProps {\n warehouse: Warehouse;\n city: string;\n mat: Material;\n rerender: () => void;\n}\n\n// Creates the UI for a single Material type\nexport function MaterialElem(props: IMaterialProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [purchaseMaterialOpen, setPurchaseMaterialOpen] = useState(false);\n const [exportOpen, setExportOpen] = useState(false);\n const [sellMaterialOpen, setSellMaterialOpen] = useState(false);\n const [materialMarketTaOpen, setMaterialMarketTaOpen] = useState(false);\n const [limitProductionOpen, setLimitProductionOpen] = useState(false);\n\n const warehouse = props.warehouse;\n const city = props.city;\n const mat = props.mat;\n const markupLimit = mat.getMarkupLimit();\n const office = division.offices[city];\n if (!(office instanceof OfficeSpace)) {\n throw new Error(`Could not get OfficeSpace object for this city (${city})`);\n }\n\n // Numeraljs formatter\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be biger\n\n // Total gain or loss of this material (per second)\n const totalGain = mat.buy + mat.prd + mat.imp - mat.sll - mat.totalExp;\n\n // Flag that determines whether this industry is \"new\" and the current material should be\n // marked with flashing-red lights\n const tutorial =\n division.newInd && Object.keys(division.reqMats).includes(mat.name) && mat.buy === 0 && mat.imp === 0;\n\n // Purchase material button\n const purchaseButtonText = `Buy (${numeralWrapper.format(mat.buy, nfB)})`;\n\n // Sell material button\n let sellButtonText: JSX.Element;\n if (mat.sllman[0]) {\n if (isString(mat.sllman[1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{mat.sllman[1]})\n \n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{numeralWrapper.format(mat.sllman[1] as number, nfB)})\n \n );\n }\n\n if (mat.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (mat.marketTa1) {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (mat.sCost) {\n if (isString(mat.sCost)) {\n const sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n }\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000);\n }\n\n // Limit Production button\n let limitMaterialButtonText = \"Limit Material\";\n if (mat.prdman[0]) {\n limitMaterialButtonText += \" (\" + numeralWrapper.format(mat.prdman[1], nf) + \")\";\n }\n\n return (\n \n \n \n \n Buy: {numeralWrapper.format(mat.buy, nfB)}
\n Prod: {numeralWrapper.format(mat.prd, nfB)}
\n Sell: {numeralWrapper.format(mat.sll, nfB)}
\n Export: {numeralWrapper.format(mat.totalExp, nfB)}
\n Import: {numeralWrapper.format(mat.imp, nfB)}\n {corp.unlockUpgrades[2] === 1 &&
}\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(mat.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 &&
}\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(mat.cmp, nf)}\n \n }\n >\n \n {mat.name}: {numeralWrapper.format(mat.qty, nfB)} ({numeralWrapper.format(totalGain, nfB)}/s)\n \n \n \n Market Price: The price you would pay if you were to buy this material on the market\n \n }\n >\n MP: {numeralWrapper.formatMoney(mat.bCost)}\n \n The quality of your material. Higher quality will lead to more sales}\n >\n Quality: {numeralWrapper.format(mat.qlt, \"0.00a\")}\n \n
\n\n \n Purchase your required materials to get production started! : \"\"}\n >\n \n \n setPurchaseMaterialOpen(false)}\n />\n\n {corp.unlockUpgrades[0] === 1 && (\n <>\n \n\n setExportOpen(false)} />\n \n )}\n\n setSellMaterialOpen(true)}\n >\n {sellButtonText}\n \n setSellMaterialOpen(false)} />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n \n\n setMaterialMarketTaOpen(false)}\n />\n \n )}\n \n setLimitProductionOpen(false)}\n />\n \n
\n
\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Material } from \"../../Material\";\nimport { Export } from \"../../Export\";\nimport { IIndustry } from \"../../IIndustry\";\nimport { ExportMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport { isRelevantMaterial } from \"../Helpers\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player manage exports\nexport function ExportModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const possibleDivisions = corp.divisions.filter((division: IIndustry) =>\n isRelevantMaterial(props.mat.name, division),\n );\n if (possibleDivisions.length === 0) throw new Error(\"Export popup created with no divisions.\");\n const defaultDivision = possibleDivisions[0];\n if (Object.keys(defaultDivision.warehouses).length === 0)\n throw new Error(\"Export popup created in a division with no warehouses.\");\n const [industry, setIndustry] = useState(defaultDivision.name);\n const [city, setCity] = useState(Object.keys(defaultDivision.warehouses)[0]);\n const [amt, setAmt] = useState(\"\");\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onCityChange(event: SelectChangeEvent): void {\n setCity(event.target.value);\n }\n\n function onIndustryChange(event: SelectChangeEvent): void {\n const div = event.target.value;\n setIndustry(div);\n setCity(Object.keys(corp.divisions[0].warehouses)[0]);\n }\n\n function onAmtChange(event: React.ChangeEvent): void {\n setAmt(event.target.value);\n }\n\n function exportMaterial(): void {\n try {\n ExportMaterial(industry, city, props.mat, amt, currentDivision);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function removeExport(exp: Export): void {\n for (let i = 0; i < props.mat.exp.length; ++i) {\n if (props.mat.exp[i].ind !== exp.ind || props.mat.exp[i].city !== exp.city || props.mat.exp[i].amt !== exp.amt)\n continue;\n props.mat.exp.splice(i, 1);\n break;\n }\n rerender();\n }\n\n const currentDivision = corp.divisions.find((division: IIndustry) => division.name === industry);\n if (currentDivision === undefined)\n throw new Error(`Export popup somehow ended up with undefined division '${currentDivision}'`);\n const possibleCities = Object.keys(currentDivision.warehouses).filter(\n (city) => currentDivision.warehouses[city] !== 0,\n );\n if (possibleCities.length > 0 && !possibleCities.includes(city)) {\n setCity(possibleCities[0]);\n }\n\n return (\n \n \n Select the industry and city to export this material to, as well as how much of this material to export per\n second. You can set the export amount to 'MAX' to export all of the materials in this warehouse.\n \n \n \n \n \n \n Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports\n below will REMOVE that export.\n \n {props.mat.exp.map((exp: Export, index: number) => (\n \n \n \n Industry: {exp.ind}\n
\n City: {exp.city}\n
\n Amount/s: {exp.amt}\n
\n
\n ))}\n
\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Material } from \"../../Material\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IMarketTA2Props {\n mat: Material;\n}\n\nfunction MarketTA2(props: IMarketTA2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <>;\n const [newCost, setNewCost] = useState(props.mat.bCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setNewCost(0);\n else setNewCost(parseFloat(event.target.value));\n }\n\n const sCost = newCost;\n let markup = 1;\n if (sCost > props.mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - props.mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - props.mat.bCost), 2);\n }\n } else if (sCost < props.mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = props.mat.bCost / sCost;\n }\n }\n\n function onMarketTA2(event: React.ChangeEvent): void {\n props.mat.marketTa2 = event.target.checked;\n rerender();\n }\n\n return (\n <>\n Market-TA.II\n
\n \n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n \n \n
\n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n \n }\n >\n Use Market-TA.II for Auto-Sale Price\n \n }\n />\n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player use the Market TA research for Materials\nexport function MaterialMarketTaModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onMarketTA1(event: React.ChangeEvent): void {\n props.mat.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n \n <>\n Market-TA.I\n \n The maximum sale price you can mark this up to is {numeralWrapper.formatMoney(props.mat.bCost + markupLimit)}.\n This means that if you set the sale price higher than this, you will begin to experience a loss in number of\n sales\n \n\n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n \n }\n >\n Use Market-TA.I for Auto-Sale Price\n \n }\n />\n \n\n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Material } from \"../../Material\";\nimport { SellMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\nfunction initialPrice(mat: Material): string {\n let val = mat.sCost ? mat.sCost + \"\" : \"\";\n if (mat.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (mat.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellMaterialModal(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState(props.mat.sllman[1] ? props.mat.sllman[1] + \"\" : \"\");\n const [price, setPrice] = useState(initialPrice(props.mat));\n\n function sellMaterial(): void {\n try {\n SellMaterial(props.mat, amt, price);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent): void {\n setAmt(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent): void {\n setPrice(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) sellMaterial();\n }\n\n return (\n \n \n Enter the maximum amount of {props.mat.name} you would like to sell per second, as well as the price at which\n you would like to sell at.\n
\n
\n If the sell amount is set to 0, then the material will not be sold. If the sell price if set to 0, then the\n material will be discarded\n
\n
\n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n
\n
\n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less\n of the material than you produce.\n
\n
\n When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that\n depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at\n $10 above the market price.\n
\n
\n \n \n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { MaterialSizes } from \"../../MaterialSizes\";\nimport { Warehouse } from \"../../Warehouse\";\nimport { Material } from \"../../Material\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { BulkPurchase, BuyMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation, useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IBulkPurchaseTextProps {\n warehouse: Warehouse;\n mat: Material;\n amount: string;\n}\n\ninterface IBPProps {\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\nfunction BulkPurchaseSection(props: IBPProps): React.ReactElement {\n const corp = useCorporation();\n const [buyAmt, setBuyAmt] = useState(\"\");\n const [disabled, setDisabled] = useState(false);\n\n function BulkPurchaseText(props: IBulkPurchaseTextProps): React.ReactElement {\n const parsedAmt = parseFloat(props.amount);\n const cost = parsedAmt * props.mat.bCost;\n\n const matSize = MaterialSizes[props.mat.name];\n const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;\n\n if (parsedAmt > maxAmount) {\n setDisabled(true);\n return (\n <>\n Not enough warehouse space to purchase this amount\n \n );\n } else if (isNaN(cost) || parsedAmt < 0) {\n setDisabled(true);\n return (\n <>\n Invalid input for Bulk Purchase amount\n \n );\n } else {\n setDisabled(false);\n return (\n <>\n \n Purchasing {numeralWrapper.format(parsedAmt, \"0,0.00\")} of {props.mat.name} will cost{\" \"}\n {numeralWrapper.formatMoney(cost)}\n \n \n );\n }\n }\n\n function bulkPurchase(): void {\n try {\n BulkPurchase(corp, props.warehouse, props.mat, parseFloat(buyAmt));\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) bulkPurchase();\n }\n\n function onChange(event: React.ChangeEvent): void {\n setBuyAmt(event.target.value);\n }\n\n return (\n <>\n \n Enter the amount of {props.mat.name} you would like to bulk purchase. This purchases the specified amount\n instantly (all at once).\n \n \n \n \n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n disablePurchaseLimit: boolean;\n}\n\n// Create a popup that lets the player purchase a Material\nexport function PurchaseMaterialModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const [buyAmt, setBuyAmt] = useState(props.mat.buy ? props.mat.buy : 0);\n\n function purchaseMaterial(): void {\n if (buyAmt === null) return;\n try {\n BuyMaterial(props.mat, buyAmt);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function clearPurchase(): void {\n props.mat.buy = 0;\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) purchaseMaterial();\n }\n\n function onChange(event: React.ChangeEvent): void {\n setBuyAmt(parseFloat(event.target.value));\n }\n\n return (\n \n <>\n \n Enter the amount of {props.mat.name} you would like to purchase per second. This material's cost changes\n constantly.\n {props.disablePurchaseLimit ? \"Note: Purchase amount is disabled as smart supply is enabled\" : \"\"}\n \n \n \n \n {division.hasResearch(\"Bulk Purchasing\") && (\n \n )}\n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { LimitMaterialProduction } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { Material } from \"../../Material\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n material: Material;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitMaterialProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState(null);\n\n // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\n\n function limitMaterialProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitMaterialProduction(props.material, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) limitMaterialProduction();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n \n \n Enter a limit to the amount of this material you would like to produce per second. Leave the box empty to set no\n limit.\n \n \n \n \n );\n}\n","import React from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\ninterface IProps {\n division: IIndustry;\n}\n\nexport function IndustryProductEquation(props: IProps): React.ReactElement {\n const reqs = [];\n for (const reqMat of Object.keys(props.division.reqMats)) {\n const reqAmt = props.division.reqMats[reqMat];\n if (reqAmt === undefined) continue;\n reqs.push(String.raw`${reqAmt}\\text{ }${reqMat}`);\n }\n const prod = props.division.prodMats.map((p) => `1\\\\text{ }${p}`);\n if (props.division.makesProducts) {\n prod.push(\"Products\");\n }\n\n return {\"\\\\(\" + reqs.join(\"+\") + `\\\\Rightarrow ` + prod.join(\"+\") + \"\\\\)\"};\n}\n","import React, { useState } from \"react\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { NewCity } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n cityStateSetter: (city: string) => void;\n}\n\nexport function ExpandNewCity(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const possibleCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0);\n const [city, setCity] = useState(possibleCities[0]);\n\n const disabled = corp.funds < CorporationConstants.OfficeInitialCost;\n\n function onCityChange(event: SelectChangeEvent): void {\n setCity(event.target.value);\n }\n\n function expand(): void {\n try {\n NewCity(corp, division, city);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(`Opened a new office in ${city}!`);\n\n props.cityStateSetter(city);\n }\n return (\n <>\n \n Would you like to expand into a new city by opening an office? This would cost{\" \"}\n \n \n \n Confirm\n \n }\n value={city}\n onChange={onCityChange}\n >\n {possibleCities.map((cityName: string) => (\n \n {cityName}\n \n ))}\n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { IndustryStartingCosts, Industries, IndustryDescriptions } from \"../IndustryData\";\nimport { useCorporation } from \"./Context\";\nimport { IIndustry } from \"../IIndustry\";\nimport { NewIndustry } from \"../Actions\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\ninterface IProps {\n setDivisionName: (name: string) => void;\n}\n\nexport function ExpandIndustryTab(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const allIndustries = Object.keys(Industries).sort();\n const possibleIndustries = allIndustries\n .filter(\n (industryType: string) =>\n corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n )\n .sort();\n const [industry, setIndustry] = useState(possibleIndustries.length > 0 ? possibleIndustries[0] : \"\");\n const [name, setName] = useState(\"\");\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n const disabled = corp.funds < cost || name === \"\";\n\n function newIndustry(): void {\n if (disabled) return;\n try {\n NewIndustry(corp, industry, name);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n // Set routing to the new division so that the UI automatically switches to it\n props.setDivisionName(name);\n }\n\n function onNameChange(event: React.ChangeEvent): void {\n // [a-zA-Z0-9-_]\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) newIndustry();\n }\n\n function onIndustryChange(event: SelectChangeEvent): void {\n setIndustry(event.target.value);\n }\n\n const desc = IndustryDescriptions[industry];\n if (desc === undefined) throw new Error(`Trying to create an industry that doesn't exists: '${industry}'`);\n\n return (\n <>\n Create a new division to expand into a new industry:\n \n {desc(corp)}\n
\n
\n\n Division name:\n\n \n \n Expand\n \n ),\n }}\n />\n \n \n );\n}\n","// React Component for displaying Corporation Overview info\nimport React, { useState } from \"react\";\nimport { LevelableUpgrade } from \"./LevelableUpgrade\";\nimport { UnlockUpgrade } from \"./UnlockUpgrade\";\nimport { BribeFactionModal } from \"./modals/BribeFactionModal\";\nimport { SellSharesModal } from \"./modals/SellSharesModal\";\nimport { BuybackSharesModal } from \"./modals/BuybackSharesModal\";\nimport { IssueDividendsModal } from \"./modals/IssueDividendsModal\";\nimport { IssueNewSharesModal } from \"./modals/IssueNewSharesModal\";\nimport { FindInvestorsModal } from \"./modals/FindInvestorsModal\";\nimport { GoPublicModal } from \"./modals/GoPublicModal\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"../data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgradeIndex, CorporationUpgrades } from \"../data/CorporationUpgrades\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n rerender: () => void;\n}\nexport function Overview({ rerender }: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const profit: number = corp.revenue - corp.expenses;\n\n const multRows: string[][] = [];\n function appendMult(name: string, value: number): void {\n if (value === 1) return;\n multRows.push([name, numeralWrapper.format(value, \"0.000\")]);\n }\n appendMult(\"Production Multiplier: \", corp.getProductionMultiplier());\n appendMult(\"Storage Multiplier: \", corp.getStorageMultiplier());\n appendMult(\"Advertising Multiplier: \", corp.getAdvertisingMultiplier());\n appendMult(\"Empl. Creativity Multiplier: \", corp.getEmployeeCreMultiplier());\n appendMult(\"Empl. Charisma Multiplier: \", corp.getEmployeeChaMultiplier());\n appendMult(\"Empl. Intelligence Multiplier: \", corp.getEmployeeIntMultiplier());\n appendMult(\"Empl. Efficiency Multiplier: \", corp.getEmployeeEffMultiplier());\n appendMult(\"Sales Multiplier: \", corp.getSalesMultiplier());\n appendMult(\"Scientific Research Multiplier: \", corp.getScientificResearchMultiplier());\n\n return (\n <>\n ],\n [\"Total Revenue:\", ],\n [\"Total Expenses:\", ],\n [\"Total Profit:\", ],\n [\"Publicly Traded:\", corp.public ? \"Yes\" : \"No\"],\n [\"Owned Stock Shares:\", numeralWrapper.format(corp.numShares, \"0.000a\")],\n [\"Stock Price:\", corp.public ? : \"N/A\"],\n ]}\n />\n
\n \n \n }\n >\n Total Stock Shares: {numeralWrapper.format(corp.totalShares, \"0.000a\")}\n \n \n
\n \n
\n \n
\n \n \n \n Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' This is a .lit file\n that guides you through the beginning of setting up a Corporation and provides some tips/pointers for\n helping you get started with managing it.\n \n }\n >\n \n \n {corp.public ? : }\n \n \n
\n \n \n );\n}\n\ninterface IPrivateButtonsProps {\n rerender: () => void;\n}\n// Render the buttons for when your Corporation is still private\nfunction PrivateButtons({ rerender }: IPrivateButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [findInvestorsopen, setFindInvestorsopen] = useState(false);\n const [goPublicopen, setGoPublicopen] = useState(false);\n\n const fundingAvailable = corp.fundingRound < 4;\n const findInvestorsTooltip = fundingAvailable\n ? \"Search for private investors who will give you startup funding in exchange for equity (stock shares) in your company\"\n : \"\";\n\n return (\n <>\n {findInvestorsTooltip}}>\n \n \n \n Become a publicly traded and owned entity. Going public involves issuing shares for an IPO. Once you are a\n public company, your shares will be traded on the stock market.\n \n }\n >\n \n \n setFindInvestorsopen(false)} rerender={rerender} />\n setGoPublicopen(false)} rerender={rerender} />\n \n );\n}\n\ninterface IUpgradeProps {\n rerender: () => void;\n}\n// Render the UI for Corporation upgrades\nfunction Upgrades({ rerender }: IUpgradeProps): React.ReactElement {\n const corp = useCorporation();\n // Don't show upgrades\n if (corp.divisions.length <= 0) {\n return Upgrades are unlocked once you create an industry.;\n }\n\n return (\n <>\n \n Unlocks\n \n {Object.values(CorporationUnlockUpgrades)\n .filter((upgrade: CorporationUnlockUpgrade) => !corp.unlockUpgrades[upgrade.index])\n .map((upgrade: CorporationUnlockUpgrade) => (\n \n ))}\n \n \n \n Upgrades\n \n {corp.upgrades\n .map((level: number, i: number) => CorporationUpgrades[i as CorporationUpgradeIndex])\n .map((upgrade: CorporationUpgrade) => (\n \n ))}\n \n \n \n );\n}\n\ninterface IPublicButtonsProps {\n rerender: () => void;\n}\n\n// Render the buttons for when your Corporation has gone public\nfunction PublicButtons({ rerender }: IPublicButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [sellSharesOpen, setSellSharesOpen] = useState(false);\n const [buybackSharesOpen, setBuybackSharesOpen] = useState(false);\n const [issueNewSharesOpen, setIssueNewSharesOpen] = useState(false);\n const [issueDividendsOpen, setIssueDividendsOpen] = useState(false);\n\n const sellSharesOnCd = corp.shareSaleCooldown > 0;\n const sellSharesTooltip = sellSharesOnCd\n ? \"Cannot sell shares for \" + corp.convertCooldownToString(corp.shareSaleCooldown)\n : \"Sell your shares in the company. The money earned from selling your \" +\n \"shares goes into your personal account, not the Corporation's. \" +\n \"This is one of the only ways to profit from your business venture.\";\n\n const issueNewSharesOnCd = corp.issueNewSharesCooldown > 0;\n const issueNewSharesTooltip = issueNewSharesOnCd\n ? \"Cannot issue new shares for \" + corp.convertCooldownToString(corp.issueNewSharesCooldown)\n : \"Issue new equity shares to raise capital.\";\n\n return (\n <>\n {sellSharesTooltip}}>\n \n \n setSellSharesOpen(false)} rerender={rerender} />\n Buy back shares you that previously issued or sold at market price.}>\n \n \n setBuybackSharesOpen(false)} rerender={rerender} />\n {issueNewSharesTooltip}}>\n \n \n setIssueNewSharesOpen(false)} />\n Manage the dividends that are paid out to shareholders (including yourself)}\n >\n \n \n setIssueDividendsOpen(false)} />\n \n );\n}\n\nfunction BribeButton(): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [open, setOpen] = useState(false);\n const canBribe =\n corp.determineValuation() >= CorporationConstants.BribeThreshold &&\n player.factions.filter((f) => Factions[f].getInfo().offersWork()).length > 0;\n\n function openBribe(): void {\n if (!canBribe) return;\n setOpen(true);\n }\n\n return (\n <>\n \n \n \n setOpen(false)} />\n \n );\n}\n\ninterface IDividendsStatsProps {\n profit: number;\n}\nfunction DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {\n const corp = useCorporation();\n if (corp.dividendRate <= 0 || profit <= 0) return <>;\n const totalDividends = corp.dividendRate * profit;\n const retainedEarnings = profit - totalDividends;\n const dividendsPerShare = totalDividends / corp.totalShares;\n const playerEarnings = corp.getCycleDividends() / CorporationConstants.SecsPerMarketCycle;\n return (\n ],\n [\"Dividend Percentage:\", numeralWrapper.format(corp.dividendRate, \"0%\")],\n [\"Dividends per share:\", ],\n [\"Your earnings as a shareholder:\", ],\n ]}\n />\n );\n}\n\n// Returns a string with general information about Corporation\nfunction BonusTime(): React.ReactElement {\n const corp = useCorporation();\n const storedTime = corp.storedCycles * CONSTANTS.MilliPerCycle;\n if (storedTime <= 15000) return <>;\n return (\n \n Bonus time: {convertTimeMsToTimeElapsedString(storedTime)}\n
\n
\n
\n );\n}\n","// React components for the levelable upgrade buttons on the overview panel\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUpgrade } from \"../data/CorporationUpgrades\";\nimport { LevelUpgrade } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgrade: CorporationUpgrade;\n rerender: () => void;\n}\n\nexport function LevelableUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgrade;\n const level = corp.upgrades[data.index];\n\n const baseCost = data.basePrice;\n const priceMult = data.priceMult;\n const cost = baseCost * Math.pow(priceMult, level);\n\n const tooltip = data.desc;\n function onClick(): void {\n if (corp.funds < cost) return;\n try {\n LevelUpgrade(corp, props.upgrade);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n \n \n \n \n \n {data.name} - lvl {level}\n \n \n \n \n );\n}\n","// React Components for the Unlock upgrade buttons on the overview page\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUnlockUpgrade } from \"../data/CorporationUnlockUpgrades\";\nimport { useCorporation } from \"./Context\";\nimport { UnlockUpgrade as UU } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgradeData: CorporationUnlockUpgrade;\n rerender: () => void;\n}\n\nexport function UnlockUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgradeData;\n const tooltip = data.desc;\n function onClick(): void {\n if (corp.funds < data.price) return;\n try {\n UU(corp, props.upgradeData);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n \n \n \n \n {data.name}\n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function BribeFactionModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const factions = player.factions.filter((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(name)) return false;\n return true;\n });\n const corp = useCorporation();\n const [money, setMoney] = useState(NaN);\n const [selectedFaction, setSelectedFaction] = useState(factions.length > 0 ? factions[0] : \"\");\n const disabled = money === 0 || isNaN(money) || money < 0 || corp.funds < money;\n\n function changeFaction(event: SelectChangeEvent): void {\n setSelectedFaction(event.target.value);\n }\n\n function repGain(money: number): number {\n return money / CorporationConstants.BribeToRepRatio;\n }\n\n function getRepText(money: number): string {\n if (money === 0) return \"\";\n if (isNaN(money) || money < 0) {\n return \"ERROR: Invalid value(s) entered\";\n } else if (corp.funds < money) {\n return \"ERROR: You do not have this much money to bribe with\";\n } else {\n return (\n \"You will gain \" +\n numeralWrapper.formatReputation(repGain(money)) +\n \" reputation with \" +\n selectedFaction +\n \" with this bribe\"\n );\n }\n }\n\n function bribe(money: number): void {\n const fac = Factions[selectedFaction];\n if (disabled) return;\n const rep = repGain(money);\n dialogBoxCreate(\n \"You gained \" + numeralWrapper.formatReputation(rep) + \" reputation with \" + fac.name + \" by bribing them.\",\n );\n fac.playerReputation += rep;\n corp.funds = corp.funds - money;\n props.onClose();\n }\n\n return (\n \n \n You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation.\n \n \n Faction:\n \n \n {getRepText(money ? money : 0)}\n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport { ICorporation } from \"../../ICorporation\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { SellShares } from \"../../Actions\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player sell Corporation shares\n// This is created when the player clicks the \"Sell Shares\" button in the overview panel\nexport function SellSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n\n const disabled = isNaN(shares) || shares <= 0 || shares > corp.numShares;\n\n function ProfitIndicator(props: { shares: number | null; corp: ICorporation }): React.ReactElement {\n if (props.shares === null) return <>;\n let text = \"\";\n if (isNaN(props.shares) || props.shares <= 0) {\n text = `ERROR: Invalid value entered for number of shares to sell`;\n } else if (props.shares > corp.numShares) {\n text = `You don't have this many shares to sell!`;\n } else {\n const stockSaleResults = corp.calculateShareSale(props.shares);\n const profit = stockSaleResults[0];\n text = `Sell ${props.shares} shares for a total of ${numeralWrapper.formatMoney(profit)}`;\n }\n\n return (\n \n {text}\n \n );\n }\n\n function sell(): void {\n if (disabled) return;\n try {\n const profit = SellShares(corp, player, shares);\n props.onClose();\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatMoney(shares)} shares for\n . The corporation's stock price fell to  \n as a result of dilution.\n ,\n );\n\n props.rerender();\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) sell();\n }\n\n return (\n \n \n Enter the number of shares you would like to sell. The money from selling your shares will go directly to you\n (NOT your Corporation).\n
\n
\n Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a\n large number of shares all at once will have an immediate effect in reducing your stock price.\n
\n
\n The current price of your company's stock is {numeralWrapper.formatMoney(corp.sharePrice)}\n
\n
\n \n \n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport { BuyBackShares } from \"../../Actions\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player buyback shares\n// This is created when the player clicks the \"Buyback Shares\" button in the overview panel\nexport function BuybackSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n\n const currentStockPrice = corp.sharePrice;\n const buybackPrice = currentStockPrice * 1.1;\n const disabled =\n shares === null ||\n isNaN(shares) ||\n shares <= 0 ||\n shares > corp.issuedShares ||\n shares * buybackPrice > player.money;\n\n function buy(): void {\n if (disabled) return;\n try {\n BuyBackShares(corp, player, shares);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n props.rerender();\n }\n\n function CostIndicator(): React.ReactElement {\n if (shares === null) return <>;\n if (isNaN(shares) || shares <= 0) {\n return <>ERROR: Invalid value entered for number of shares to buyback;\n } else if (shares > corp.issuedShares) {\n return (\n <>\n There are not this many shares available to buy back. There are only{\" \"}\n {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding shares.\n \n );\n } else {\n return (\n <>\n Purchase {shares} shares for a total of {numeralWrapper.formatMoney(shares * buybackPrice)}\n \n );\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) buy();\n }\n\n return (\n \n \n Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium.\n However, repurchasing shares from the market tends to lead to an increase in stock price.\n
\n
\n To purchase these shares, you must use your own money (NOT your Corporation's funds).\n
\n
\n The current buyback price of your company's stock is {numeralWrapper.formatMoney(buybackPrice)}. Your company\n currently has {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding stock shares.\n
\n \n
\n \n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { IssueDividends } from \"../../Actions\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue & manage dividends\n// This is created when the player clicks the \"Issue Dividends\" button in the overview panel\nexport function IssueDividendsModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [percent, setPercent] = useState(0);\n\n const canIssue = !isNaN(percent) && percent >= 0 && percent <= CorporationConstants.DividendMaxRate * 100;\n function issueDividends(): void {\n if (!canIssue) return;\n if (percent === null) return;\n try {\n IssueDividends(corp, percent / 100);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) issueDividends();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setPercent(0);\n else {\n let p = parseFloat(event.target.value);\n if (p > 100) p = 100;\n if (p < 0) p = 0;\n setPercent(p);\n }\n }\n\n return (\n \n \n Dividends are a distribution of a portion of the corporation's profits to the shareholders. This includes\n yourself, as well.\n
\n
\n In order to issue dividends, simply allocate some percentage of your corporation's profits to dividends. This\n percentage must be an integer between 0 and 100. (A percentage of 0 means no dividends will be issued)\n
\n
\n Two important things to note:\n
\n * Issuing dividends will negatively affect your corporation's stock price\n
\n
\n Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends.\n That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as\n dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share\n per second before taxes.\n
\n \n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { getRandomInt } from \"../../../utils/helpers/getRandomInt\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IEffectTextProps {\n shares: number | null;\n}\n\nfunction EffectText(props: IEffectTextProps): React.ReactElement {\n const corp = useCorporation();\n if (props.shares === null) return <>;\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n let newShares = props.shares;\n if (isNaN(newShares)) {\n return Invalid input;\n }\n\n // Round to nearest ten-millionth\n newShares /= 10e6;\n newShares = Math.round(newShares) * 10e6;\n\n if (newShares < 10e6) {\n return Must issue at least 10 million new shares;\n }\n\n if (newShares > maxNewShares) {\n return You cannot issue that many shares;\n }\n\n return (\n \n Issue {numeralWrapper.format(newShares, \"0.000a\")} new shares for{\" \"}\n {numeralWrapper.formatMoney(newShares * newSharePrice)}?\n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue new shares\n// This is created when the player clicks the \"Issue New Shares\" buttons in the overview panel\nexport function IssueNewSharesModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n\n const newShares = Math.round((shares || 0) / 10e6) * 10e6;\n const disabled = isNaN(shares) || isNaN(newShares) || newShares < 10e6 || newShares > maxNewShares;\n\n function issueNewShares(): void {\n if (isNaN(shares)) return;\n if (disabled) return;\n\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n let newShares = shares;\n\n // Round to nearest ten-millionth\n newShares = Math.round(newShares / 10e6) * 10e6;\n\n const profit = newShares * newSharePrice;\n corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown;\n\n // Determine how many are bought by private investors\n // If private investors own n% of the company, private investors get up to 0.5n% at most\n // Round # of private shares to the nearest million\n const privateOwnedRatio = 1 - (corp.numShares + corp.issuedShares) / corp.totalShares;\n const maxPrivateShares = Math.round((newShares / 2) * privateOwnedRatio);\n const privateShares = Math.round(getRandomInt(0, maxPrivateShares) / 1e6) * 1e6;\n\n corp.issuedShares += newShares - privateShares;\n corp.totalShares += newShares;\n corp.funds = corp.funds + profit;\n corp.immediatelyUpdateSharePrice();\n props.onClose();\n\n let dialogContents =\n `Issued ${numeralWrapper.format(newShares, \"0.000a\")} new shares` +\n ` and raised ${numeralWrapper.formatMoney(profit)}.`;\n if (privateShares > 0) {\n dialogContents += `
${numeralWrapper.format(\n privateShares,\n \"0.000a\",\n )} of these shares were bought by private investors.`;\n }\n dialogContents += `

Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`;\n dialogBoxCreate(dialogContents);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) issueNewShares();\n }\n\n return (\n \n \n You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.\n
\n
\n  * You can issue at most {numeralWrapper.formatMoney(maxNewShares)} new shares\n
\n  * New shares are sold at a 10% discount\n
\n  * You can only issue new shares once every 12 hours\n
\n  * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share\n
\n  * Number of new shares issued must be a multiple of 10 million\n
\n
\n When you choose to issue new equity, private shareholders have first priority for up to 0.5n% of the new shares,\n where n is the percentage of the company currently owned by private shareholders. If they choose to exercise\n this option, these newly issued shares become private, restricted shares, which means you cannot buy them back.\n
\n \n \n \n
\n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function FindInvestorsModal(props: IProps): React.ReactElement {\n const corporation = useCorporation();\n const val = corporation.determineValuation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length\n )\n return <>;\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n\n function findInvestors(): void {\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n props.rerender();\n props.onClose();\n }\n return (\n \n \n An investment firm has offered you {numeralWrapper.formatMoney(funding)} in funding in exchange for a{\" \"}\n {numeralWrapper.format(percShares * 100, \"0.000a\")}% stake in the company (\n {numeralWrapper.format(investShares, \"0.000a\")} shares).\n
\n
\n Do you accept or reject this offer?\n
\n
\n Hint: Investment firms will offer more money if your corporation is turning a profit\n
\n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Box from \"@mui/material/Box\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function GoPublicModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n\n function goPublic(): void {\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n if (isNaN(shares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (shares > corp.numShares) {\n dialogBoxCreate(\"Error: You don't have that many shares to issue!\");\n return;\n }\n corp.public = true;\n corp.sharePrice = initialSharePrice;\n corp.issuedShares = shares;\n corp.numShares -= shares;\n corp.addFunds(shares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(shares * initialSharePrice)} in your IPO`,\n );\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) goPublic();\n }\n\n return (\n \n \n Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will\n no longer own them. Your Corporation will receive {numeralWrapper.formatMoney(initialSharePrice)} per share (the\n IPO money will be deposited directly into your Corporation's funds).\n
\n
\n You have a total of {numeralWrapper.format(corp.numShares, \"0.000a\")} of shares that you can issue.\n
\n \n \n \n \n
\n );\n}\n","import React, { useState } from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { use } from \"../../ui/Context\";\nimport { calculateDifficulty, calculateReward } from \"../formulas/game\";\nimport { Game } from \"./Game\";\nimport { Intro } from \"./Intro\";\ninterface IProps {\n location: Location;\n}\n\nexport function InfiltrationRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [start, setStart] = useState(false);\n\n if (props.location.infiltrationData === undefined) throw new Error(\"Trying to do infiltration on invalid location.\");\n const startingSecurityLevel = props.location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(player, startingSecurityLevel);\n const reward = calculateReward(player, startingSecurityLevel);\n\n function cancel(): void {\n router.toCity();\n }\n\n return (\n
\n {start ? (\n \n ) : (\n setStart(true)}\n cancel={cancel}\n />\n )}\n
\n );\n}\n","import { Button, Container, Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { use } from \"../../ui/Context\";\nimport { BackwardGame } from \"./BackwardGame\";\nimport { BracketGame } from \"./BracketGame\";\nimport { BribeGame } from \"./BribeGame\";\nimport { CheatCodeGame } from \"./CheatCodeGame\";\nimport { Countdown } from \"./Countdown\";\nimport { Cyberpunk2077Game } from \"./Cyberpunk2077Game\";\nimport { MinesweeperGame } from \"./MinesweeperGame\";\nimport { SlashGame } from \"./SlashGame\";\nimport { Victory } from \"./Victory\";\nimport { WireCuttingGame } from \"./WireCuttingGame\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nenum Stage {\n Countdown = 0,\n Minigame,\n Result,\n Sell,\n}\n\nconst minigames = [\n SlashGame,\n BracketGame,\n BackwardGame,\n BribeGame,\n CheatCodeGame,\n Cyberpunk2077Game,\n MinesweeperGame,\n WireCuttingGame,\n];\n\nexport function Game(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [level, setLevel] = useState(1);\n const [stage, setStage] = useState(Stage.Countdown);\n const [results, setResults] = useState(\"\");\n const [gameIds, setGameIds] = useState({\n lastGames: [-1, -1],\n id: Math.floor(Math.random() * minigames.length),\n });\n\n function nextGameId(): number {\n let id = gameIds.lastGames[0];\n const ids = [gameIds.lastGames[0], gameIds.lastGames[1], gameIds.id];\n while (ids.includes(id)) {\n id = Math.floor(Math.random() * minigames.length);\n }\n return id;\n }\n\n function setupNextGame(): void {\n setGameIds({\n lastGames: [gameIds.lastGames[1], gameIds.id],\n id: nextGameId(),\n });\n }\n\n function success(): void {\n pushResult(true);\n if (level === props.MaxLevel) {\n setStage(Stage.Sell);\n } else {\n setStage(Stage.Countdown);\n setLevel(level + 1);\n }\n setupNextGame();\n }\n\n function pushResult(win: boolean): void {\n setResults((old) => {\n let next = old;\n next += win ? \"✓\" : \"✗\";\n if (next.length > 15) next = next.slice(1);\n return next;\n });\n }\n\n function failure(options?: { automated: boolean }): void {\n setStage(Stage.Countdown);\n pushResult(false);\n // Kill the player immediately if they use automation, so\n // it's clear they're not meant to\n const damage = options?.automated\n ? player.hp.current\n : props.StartingDifficulty * 3 * (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 0.5 : 1);\n if (player.takeDamage(damage)) {\n router.toCity();\n return;\n }\n setupNextGame();\n }\n\n function cancel(): void {\n router.toCity();\n return;\n }\n\n let stageComponent: React.ReactNode;\n switch (stage) {\n case Stage.Countdown:\n stageComponent = setStage(Stage.Minigame)} />;\n break;\n case Stage.Minigame: {\n const MiniGame = minigames[gameIds.id];\n stageComponent = ;\n break;\n }\n case Stage.Sell:\n stageComponent = (\n \n );\n break;\n }\n\n function Progress(): React.ReactElement {\n return (\n \n {results.slice(0, results.length - 1)}\n {results[results.length - 1]}\n \n );\n }\n\n return (\n \n \n {stage !== Stage.Sell && (\n \n )}\n \n Level {level} / {props.MaxLevel}\n \n \n \n\n {stageComponent}\n \n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 16000, min: 3, max: 4 },\n Normal: { timer: 12500, min: 2, max: 3 },\n Hard: { timer: 15000, min: 3, max: 4 },\n Impossible: { timer: 8000, min: 4, max: 4 },\n};\n\nexport function BackwardGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [answer] = useState(makeAnswer(difficulty));\n const [guess, setGuess] = useState(\"\");\n const hasAugment = Player.hasAugmentation(AugmentationNames.ChaosOfDionysus, true);\n\n function ignorableKeyboardEvent(event: KeyboardEvent): boolean {\n return event.key === KEY.BACKSPACE || (event.shiftKey && event.key === \"Shift\") || event.ctrlKey || event.altKey;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (ignorableKeyboardEvent(event)) return;\n const nextGuess = guess + event.key.toUpperCase();\n if (!answer.startsWith(nextGuess)) props.onFailure();\n else if (answer === nextGuess) props.onSuccess();\n else setGuess(nextGuess);\n }\n\n return (\n <>\n \n \n Type it{!hasAugment ? \" backward\" : \"\"}\n \n {answer}\n \n {guess}\n \n \n \n \n );\n}\n\nfunction makeAnswer(difficulty: Difficulty): string {\n const length = random(difficulty.min, difficulty.max);\n let answer = \"\";\n for (let i = 0; i < length; i++) {\n if (i > 0) answer += \" \";\n answer += words[Math.floor(Math.random() * words.length)];\n }\n\n return answer;\n}\n\nconst words = [\n \"ALGORITHM\",\n \"ANALOG\",\n \"APP\",\n \"APPLICATION\",\n \"ARRAY\",\n \"BACKUP\",\n \"BANDWIDTH\",\n \"BINARY\",\n \"BIT\",\n \"BITE\",\n \"BITMAP\",\n \"BLOG\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BOOT\",\n \"BROADBAND\",\n \"BROWSER\",\n \"BUFFER\",\n \"BUG\",\n \"BUS\",\n \"BYTE\",\n \"CACHE\",\n \"CAPS LOCK\",\n \"CAPTCHA\",\n \"CD\",\n \"CD-ROM\",\n \"CLIENT\",\n \"CLIPBOARD\",\n \"CLOUD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"COOKIE\",\n \"COPY\",\n \"CPU\",\n \"CYBERCRIME\",\n \"CYBERSPACE\",\n \"DASHBOARD\",\n \"DATA\",\n \"MINING\",\n \"DATABASE\",\n \"DEBUG\",\n \"DECOMPRESS\",\n \"DELETE\",\n \"DESKTOP\",\n \"DEVELOPMENT\",\n \"DIGITAL\",\n \"DISK\",\n \"DNS\",\n \"DOCUMENT\",\n \"DOMAIN\",\n \"DOMAIN NAME\",\n \"DOT\",\n \"DOT MATRIX\",\n \"DOWNLOAD\",\n \"DRAG\",\n \"DVD\",\n \"DYNAMIC\",\n \"EMAIL\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"ENCRYPTION\",\n \"ENTER\",\n \"EXABYTE\",\n \"FAQ\",\n \"FILE\",\n \"FINDER\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLASH\",\n \"FLASH DRIVE\",\n \"FLOPPY DISK\",\n \"FLOWCHART\",\n \"FOLDER\",\n \"FONT\",\n \"FORMAT\",\n \"FRAME\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HACK\",\n \"HACKER\",\n \"HARDWARE\",\n \"HOME PAGE\",\n \"HOST\",\n \"HTML\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"ICON\",\n \"INBOX\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"IP ADDRESS\",\n \"ITERATION\",\n \"JAVA\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KERNEL\",\n \"KEY\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LAPTOP\",\n \"LASER PRINTER\",\n \"LINK\",\n \"LINUX\",\n \"LOG OUT\",\n \"LOGIC\",\n \"LOGIN\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MACRO\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MEDIA\",\n \"MEMORY\",\n \"MIRROR\",\n \"MODEM\",\n \"MONITOR\",\n \"MOTHERBOARD\",\n \"MOUSE\",\n \"MULTIMEDIA\",\n \"NET\",\n \"NETWORK\",\n \"NODE\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"ONLINE\",\n \"OPENSOURCE\",\n \"OPERATING\",\n \"SYSTEM\",\n \"OPTION\",\n \"OUTPUT\",\n \"PAGE\",\n \"PASSWORD\",\n \"PASTE\",\n \"PATH\",\n \"PHISHING\",\n \"PIRACY\",\n \"PIRATE\",\n \"PLATFORM\",\n \"PLUGIN\",\n \"PODCAST\",\n \"POPUP\",\n \"PORTAL\",\n \"PRINT\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROGRAMMER\",\n \"PROTOCOL\",\n \"QUEUE\",\n \"QWERTY\",\n \"RAM\",\n \"REALTIME\",\n \"REBOOT\",\n \"RESOLUTION\",\n \"RESTORE\",\n \"ROM\",\n \"ROOT\",\n \"ROUTER\",\n \"RUNTIME\",\n \"SAVE\",\n \"SCAN\",\n \"SCANNER\",\n \"SCREEN\",\n \"SCREENSHOT\",\n \"SCRIPT\",\n \"SCROLL\",\n \"SCROLL\",\n \"SEARCH\",\n \"ENGINE\",\n \"SECURITY\",\n \"SERVER\",\n \"SHAREWARE\",\n \"SHELL\",\n \"SHIFT\",\n \"SHIFT KEY\",\n \"SNAPSHOT\",\n \"SOCIAL NETWORKING\",\n \"SOFTWARE\",\n \"SPAM\",\n \"SPAMMER\",\n \"SPREADSHEET\",\n \"SPYWARE\",\n \"STATUS\",\n \"STORAGE\",\n \"SUPERCOMPUTER\",\n \"SURF\",\n \"SYNTAX\",\n \"TABLE\",\n \"TAG\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TEXT EDITOR\",\n \"THREAD\",\n \"TOOLBAR\",\n \"TRASH\",\n \"TROJAN HORSE\",\n \"TYPEFACE\",\n \"UNDO\",\n \"UNIX\",\n \"UPLOAD\",\n \"URL\",\n \"USER\",\n \"USER INTERFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"VIRTUAL MEMORY\",\n \"VIRUS\",\n \"WEB\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WIDGET\",\n \"WIKI\",\n \"WINDOW\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n \"WORKSTATION\",\n \"WEB\",\n \"WORM\",\n \"WWW\",\n \"XML\",\n \"ZIP\",\n];\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 8000, min: 2, max: 3 },\n Normal: { timer: 6000, min: 4, max: 5 },\n Hard: { timer: 4000, min: 4, max: 6 },\n Impossible: { timer: 2500, min: 7, max: 7 },\n};\n\nfunction generateLeftSide(difficulty: Difficulty): string {\n let str = \"\";\n const options = [KEY.OPEN_BRACKET, KEY.LESS_THAN, KEY.OPEN_PARENTHESIS, KEY.OPEN_BRACE];\n if (Player.hasAugmentation(AugmentationNames.WisdomOfAthena, true)) {\n options.splice(0, 1);\n }\n const length = random(difficulty.min, difficulty.max);\n for (let i = 0; i < length; i++) {\n str += options[Math.floor(Math.random() * options.length)];\n }\n\n return str;\n}\n\nfunction getChar(event: KeyboardEvent): string {\n if (event.key === KEY.CLOSE_PARENTHESIS) return KEY.CLOSE_PARENTHESIS;\n if (event.key === KEY.CLOSE_BRACKET) return KEY.CLOSE_BRACKET;\n if (event.key === KEY.CLOSE_BRACE) return KEY.CLOSE_BRACE;\n if (event.key === KEY.GREATER_THAN) return KEY.GREATER_THAN;\n return \"\";\n}\n\nfunction match(left: string, right: string): boolean {\n return (\n (left === KEY.OPEN_BRACKET && right === KEY.CLOSE_BRACKET) ||\n (left === KEY.LESS_THAN && right === KEY.GREATER_THAN) ||\n (left === KEY.OPEN_PARENTHESIS && right === KEY.CLOSE_PARENTHESIS) ||\n (left === KEY.OPEN_BRACE && right === KEY.CLOSE_BRACE)\n );\n}\n\nexport function BracketGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [right, setRight] = useState(\"\");\n const [left] = useState(generateLeftSide(difficulty));\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const char = getChar(event);\n if (!char) return;\n if (!match(left[left.length - right.length - 1], char)) {\n props.onFailure();\n return;\n }\n if (left.length === right.length + 1) {\n props.onSuccess();\n return;\n }\n setRight(right + char);\n }\n\n return (\n <>\n \n \n Close the brackets\n \n {`${left}${right}`}\n \n \n \n \n \n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n size: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12000, size: 6 },\n Normal: { timer: 9000, size: 8 },\n Hard: { timer: 5000, size: 9 },\n Impossible: { timer: 2500, size: 12 },\n};\n\nexport function BribeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, size: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [choices] = useState(makeChoices(difficulty));\n const [correctIndex, setCorrectIndex] = useState(0);\n const [index, setIndex] = useState(0);\n const currentChoice = choices[index];\n\n useEffect(() => {\n setCorrectIndex(choices.findIndex((choice) => positive.includes(choice)));\n }, [choices]);\n\n const defaultColor = Settings.theme.primary;\n const disabledColor = Settings.theme.disabled;\n let upColor = defaultColor;\n let downColor = defaultColor;\n let choiceColor = defaultColor;\n const hasAugment = Player.hasAugmentation(AugmentationNames.BeautyOfAphrodite, true);\n\n if (hasAugment) {\n const upIndex = index + 1 >= choices.length ? 0 : index + 1;\n let upDistance = correctIndex - upIndex;\n if (upIndex > correctIndex) {\n upDistance = choices.length - 1 - upIndex + correctIndex;\n }\n\n const downIndex = index - 1 < 0 ? choices.length - 1 : index - 1;\n let downDistance = downIndex - correctIndex;\n if (downIndex < correctIndex) {\n downDistance = downIndex + choices.length - 1 - correctIndex;\n }\n\n const onCorrectIndex = correctIndex == index;\n\n upColor = upDistance <= downDistance && !onCorrectIndex ? upColor : disabledColor;\n downColor = upDistance >= downDistance && !onCorrectIndex ? downColor : disabledColor;\n choiceColor = onCorrectIndex ? defaultColor : disabledColor;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n\n const k = event.key;\n if (k === KEY.SPACE) {\n if (positive.includes(currentChoice)) props.onSuccess();\n else props.onFailure();\n return;\n }\n\n let newIndex = index;\n if ([KEY.UP_ARROW, KEY.W, KEY.RIGHT_ARROW, KEY.D].map((k) => k as string).includes(k)) newIndex++;\n if ([KEY.DOWN_ARROW, KEY.S, KEY.LEFT_ARROW, KEY.A].map((k) => k as string).includes(k)) newIndex--;\n while (newIndex < 0) newIndex += choices.length;\n while (newIndex > choices.length - 1) newIndex -= choices.length;\n setIndex(newIndex);\n }\n\n return (\n <>\n \n \n Say something nice about the guard\n \n \n {upArrowSymbol}\n \n \n {currentChoice}\n \n \n {downArrowSymbol}\n \n \n \n );\n}\n\nfunction shuffleArray(array: string[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}\n\nfunction makeChoices(difficulty: Difficulty): string[] {\n const choices = [];\n choices.push(positive[Math.floor(Math.random() * positive.length)]);\n for (let i = 0; i < difficulty.size; i++) {\n const option = negative[Math.floor(Math.random() * negative.length)];\n if (choices.includes(option)) {\n i--;\n continue;\n }\n choices.push(option);\n }\n shuffleArray(choices);\n return choices;\n}\n\nconst positive = [\n \"affectionate\",\n \"agreeable\",\n \"bright\",\n \"charming\",\n \"creative\",\n \"determined\",\n \"energetic\",\n \"friendly\",\n \"funny\",\n \"generous\",\n \"polite\",\n \"likable\",\n \"diplomatic\",\n \"helpful\",\n \"giving\",\n \"kind\",\n \"hardworking\",\n \"patient\",\n \"dynamic\",\n \"loyal\",\n \"straightforward\",\n];\n\nconst negative = [\n \"aggressive\",\n \"aloof\",\n \"arrogant\",\n \"big-headed\",\n \"boastful\",\n \"boring\",\n \"bossy\",\n \"careless\",\n \"clingy\",\n \"couch potato\",\n \"cruel\",\n \"cynical\",\n \"grumpy\",\n \"hot air\",\n \"know it all\",\n \"obnoxious\",\n \"pain in the neck\",\n \"picky\",\n \"tactless\",\n \"thoughtless\",\n \"cringe\",\n];\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport {\n downArrowSymbol,\n getArrow,\n getInverseArrow,\n leftArrowSymbol,\n random,\n rightArrowSymbol,\n upArrowSymbol,\n} from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 13000, min: 6, max: 8 },\n Normal: { timer: 7000, min: 7, max: 8 },\n Hard: { timer: 5000, min: 8, max: 9 },\n Impossible: { timer: 3000, min: 9, max: 10 },\n};\n\nexport function CheatCodeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [code] = useState(generateCode(difficulty));\n const [index, setIndex] = useState(0);\n const hasAugment = Player.hasAugmentation(AugmentationNames.TrickeryOfHermes, true);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (code[index] !== getArrow(event) && (!hasAugment || code[index] !== getInverseArrow(event))) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (index + 1 >= code.length) props.onSuccess();\n }\n\n return (\n <>\n \n \n Enter the Code!\n {code[index]}\n \n \n \n );\n}\n\nfunction generateCode(difficulty: Difficulty): string {\n const arrows = [leftArrowSymbol, rightArrowSymbol, upArrowSymbol, downArrowSymbol];\n let code = \"\";\n for (let i = 0; i < random(difficulty.min, difficulty.max); i++) {\n let arrow = arrows[Math.floor(4 * Math.random())];\n while (arrow === code[code.length - 1]) arrow = arrows[Math.floor(4 * Math.random())];\n code += arrow;\n }\n\n return code;\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IProps {\n onFinish: () => void;\n}\n\nexport function Countdown(props: IProps): React.ReactElement {\n const [x, setX] = useState(3);\n useEffect(() => {\n if (x === 0) {\n props.onFinish();\n return;\n }\n setTimeout(() => setX(x - 1), 300);\n });\n\n return (\n \n Get Ready!\n {x}\n \n );\n}\n","import { Paper, Typography, Box } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n symbols: number;\n}\n\ninterface GridItem {\n content: string;\n color: string;\n selected?: boolean;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12500, width: 3, height: 3, symbols: 6 },\n Normal: { timer: 15000, width: 4, height: 4, symbols: 7 },\n Hard: { timer: 12500, width: 5, height: 5, symbols: 8 },\n Impossible: { timer: 10000, width: 6, height: 6, symbols: 9 },\n};\n\nexport function Cyberpunk2077Game(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, symbols: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [grid] = useState(generatePuzzle(difficulty));\n const [answers] = useState(generateAnswers(grid, difficulty));\n const [currentAnswerIndex, setCurrentAnswerIndex] = useState(0);\n const [pos, setPos] = useState([0, 0]);\n\n const hasAugment = Player.hasAugmentation(AugmentationNames.FloodOfPoseidon, true);\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + grid[0].length) % grid[0].length;\n next[1] = (next[1] + grid.length) % grid.length;\n setPos(next);\n\n if (event.key === KEY.SPACE) {\n const selected = grid[pos[1]][pos[0]];\n const expected = answers[currentAnswerIndex];\n if (selected !== expected) {\n props.onFailure();\n return;\n }\n setCurrentAnswerIndex(currentAnswerIndex + 1);\n if (answers.length === currentAnswerIndex + 1) props.onSuccess();\n }\n }\n\n const flatGrid: GridItem[] = [];\n grid.map((line, y) =>\n line.map((cell, x) => {\n const isCorrectAnswer = cell === answers[currentAnswerIndex];\n const optionColor = hasAugment && !isCorrectAnswer ? Settings.theme.disabled : Settings.theme.primary;\n\n if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ color: optionColor, content: cell, selected: true });\n return;\n }\n\n flatGrid.push({ color: optionColor, content: cell });\n }),\n );\n\n const fontSize = \"2em\";\n return (\n <>\n \n \n Match the symbols!\n \n Targets:{\" \"}\n {answers.map((a, i) => {\n if (i == currentAnswerIndex)\n return (\n \n {a} \n \n );\n return (\n \n {a} \n \n );\n })}\n \n
\n \n {flatGrid.map((item) => (\n \n {item.content}\n \n ))}\n \n \n
\n \n );\n}\n\nfunction generateAnswers(grid: string[][], difficulty: Difficulty): string[] {\n const answers = [];\n for (let i = 0; i < Math.round(difficulty.symbols); i++) {\n answers.push(grid[Math.floor(Math.random() * grid.length)][Math.floor(Math.random() * grid[0].length)]);\n }\n return answers;\n}\n\nfunction randChar(): string {\n return \"ABCDEF0123456789\"[Math.floor(Math.random() * 16)];\n}\n\nfunction generatePuzzle(difficulty: Difficulty): string[][] {\n const puzzle = [];\n for (let i = 0; i < Math.round(difficulty.height); i++) {\n const line = [];\n for (let j = 0; j < Math.round(difficulty.width); j++) {\n line.push(randChar() + randChar());\n }\n puzzle.push(line);\n }\n return puzzle;\n}\n","import { Close, Flag, Report } from \"@mui/icons-material\";\nimport { Box, Paper, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n mines: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 15000, width: 3, height: 3, mines: 4 },\n Normal: { timer: 15000, width: 4, height: 4, mines: 7 },\n Hard: { timer: 15000, width: 5, height: 5, mines: 11 },\n Impossible: { timer: 15000, width: 6, height: 6, mines: 15 },\n};\n\nexport function MinesweeperGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, mines: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [minefield] = useState(generateMinefield(difficulty));\n const [answer, setAnswer] = useState(generateEmptyField(difficulty));\n const [pos, setPos] = useState([0, 0]);\n const [memoryPhase, setMemoryPhase] = useState(true);\n const hasAugment = Player.hasAugmentation(AugmentationNames.HuntOfArtemis, true);\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (memoryPhase) return;\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + minefield[0].length) % minefield[0].length;\n next[1] = (next[1] + minefield.length) % minefield.length;\n setPos(next);\n\n if (event.key == KEY.SPACE) {\n if (!minefield[pos[1]][pos[0]]) {\n props.onFailure();\n return;\n }\n setAnswer((old) => {\n old[pos[1]][pos[0]] = true;\n if (fieldEquals(minefield, old)) props.onSuccess();\n return old;\n });\n }\n }\n\n useEffect(() => {\n const id = setTimeout(() => setMemoryPhase(false), 2000);\n return () => clearInterval(id);\n }, []);\n\n const flatGrid: { flagged?: boolean; current?: boolean; marked?: boolean }[] = [];\n\n minefield.map((line, y) =>\n line.map((cell, x) => {\n if (memoryPhase) {\n flatGrid.push({ flagged: Boolean(minefield[y][x]) });\n return;\n } else if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ current: true });\n } else if (answer[y][x]) {\n flatGrid.push({ marked: true });\n } else if (hasAugment && minefield[y][x]) {\n flatGrid.push({ flagged: true });\n } else {\n flatGrid.push({});\n }\n }),\n );\n\n return (\n <>\n \n \n {memoryPhase ? \"Remember all the mines!\" : \"Mark all the mines!\"}\n \n {flatGrid.map((item) => {\n let color: string;\n let icon: React.ReactElement;\n\n if (item.marked) {\n color = Settings.theme.warning;\n icon = ;\n } else if (item.current) {\n color = Settings.theme.infolight;\n icon = ;\n } else if (item.flagged) {\n color = Settings.theme.error;\n icon = ;\n } else {\n color = Settings.theme.primary;\n icon = <>;\n }\n\n return (\n \n {icon}\n \n );\n })}\n \n \n \n \n );\n}\n\nfunction fieldEquals(a: boolean[][], b: boolean[][]): boolean {\n function count(field: boolean[][]): number {\n return field.flat().reduce((a, b) => a + (b ? 1 : 0), 0);\n }\n return count(a) === count(b);\n}\n\nfunction generateEmptyField(difficulty: Difficulty): boolean[][] {\n const field = [];\n for (let i = 0; i < difficulty.height; i++) {\n field.push(new Array(Math.round(difficulty.width)).fill(false));\n }\n return field;\n}\n\nfunction generateMinefield(difficulty: Difficulty): boolean[][] {\n const field = generateEmptyField(difficulty);\n for (let i = 0; i < difficulty.mines; i++) {\n const x = Math.floor(Math.random() * field.length);\n const y = Math.floor(Math.random() * field[0].length);\n if (field[x][y]) {\n i--;\n continue;\n }\n field[x][y] = true;\n }\n return field;\n}\n","import { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n window: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { window: 600 },\n Normal: { window: 325 },\n Hard: { window: 250 },\n Impossible: { window: 150 },\n};\n\nexport function SlashGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { window: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const [phase, setPhase] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (event.key !== KEY.SPACE) return;\n if (phase !== 2) {\n props.onFailure();\n } else {\n props.onSuccess();\n }\n }\n const hasAugment = Player.hasAugmentation(AugmentationNames.MightOfAres, true);\n const phaseZeroTime = Math.random() * 3250 + 1500 - (250 + difficulty.window);\n const phaseOneTime = 250;\n const timeUntilAttacking = phaseZeroTime + phaseOneTime;\n\n useEffect(() => {\n let id = window.setTimeout(() => {\n setPhase(1);\n id = window.setTimeout(() => {\n setPhase(2);\n id = window.setTimeout(() => setPhase(0), difficulty.window);\n }, phaseOneTime);\n }, phaseZeroTime);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n return (\n <>\n \n \n Slash when his guard is down!\n\n {hasAugment ? (\n \n Guard will drop in...\n null} noPaper />\n \n ) : (\n <>\n )}\n\n {phase === 0 && Guarding ...}\n {phase === 1 && Preparing?}\n {phase === 2 && ATTACKING!}\n \n \n \n );\n}\n","import { Box, Button, MenuItem, Paper, Select, SelectChangeEvent, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { inviteToFaction } from \"../../Faction/FactionHelpers\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { use } from \"../../ui/Context\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../formulas/victory\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nexport function Victory(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [faction, setFaction] = useState(\"none\");\n\n function quitInfiltration(): void {\n handleInfiltrators();\n router.toCity();\n }\n\n const soa = Factions[FactionNames.ShadowsOfAnarchy];\n const repGain = calculateTradeInformationRepReward(player, props.Reward, props.MaxLevel, props.StartingDifficulty);\n const moneyGain = calculateSellInformationCashReward(player, props.Reward, props.MaxLevel, props.StartingDifficulty);\n const infiltrationRepGain = calculateInfiltratorsRepReward(player, soa, props.StartingDifficulty);\n\n const isMemberOfInfiltrators = player.factions.includes(FactionNames.ShadowsOfAnarchy);\n\n function sell(): void {\n handleInfiltrators();\n player.gainMoney(moneyGain, \"infiltration\");\n quitInfiltration();\n }\n\n function trade(): void {\n if (faction === \"none\") return;\n handleInfiltrators();\n Factions[faction].playerReputation += repGain;\n quitInfiltration();\n }\n\n function changeDropdown(event: SelectChangeEvent): void {\n setFaction(event.target.value);\n }\n\n function handleInfiltrators(): void {\n inviteToFaction(Factions[FactionNames.ShadowsOfAnarchy]);\n if (isMemberOfInfiltrators) {\n soa.playerReputation += infiltrationRepGain;\n }\n }\n\n return (\n \n Infiltration successful!\n \n You{\" \"}\n {isMemberOfInfiltrators ? (\n <>\n have gained {formatNumber(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{\" \"}\n \n ) : (\n <>\n )}\n can trade the confidential information you found for money or reputation.\n \n \n \n \n \n \n \n \n \n \n );\n}\n","import { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n wiresmin: number;\n wiresmax: number;\n rules: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 9000, wiresmin: 4, wiresmax: 4, rules: 2 },\n Normal: { timer: 7000, wiresmin: 6, wiresmax: 6, rules: 2 },\n Hard: { timer: 5000, wiresmin: 8, wiresmax: 8, rules: 3 },\n Impossible: { timer: 4000, wiresmin: 9, wiresmax: 9, rules: 4 },\n};\n\nconst types = [KEY.PIPE, KEY.DOT, KEY.FORWARD_SLASH, KEY.HYPHEN, \"█\", KEY.HASH];\n\nconst colors = [\"red\", \"#FFC107\", \"blue\", \"white\"];\n\nconst colorNames: Record = {\n red: \"red\",\n \"#FFC107\": \"yellow\",\n blue: \"blue\",\n white: \"white\",\n};\n\ninterface Wire {\n tpe: string;\n colors: string[];\n}\n\ninterface Question {\n toString: () => string;\n shouldCut: (wire: Wire, index: number) => boolean;\n}\n\nexport function WireCuttingGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = {\n timer: 0,\n wiresmin: 0,\n wiresmax: 0,\n rules: 0,\n };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [wires] = useState(generateWires(difficulty));\n const [cutWires, setCutWires] = useState(new Array(wires.length).fill(false));\n const [questions] = useState(generateQuestion(wires, difficulty));\n const hasAugment = Player.hasAugmentation(AugmentationNames.KnowledgeOfApollo, true);\n\n function checkWire(wireNum: number): boolean {\n return questions.some((q) => q.shouldCut(wires[wireNum - 1], wireNum - 1));\n }\n\n useEffect(() => {\n // check if we won\n const wiresToBeCut = [];\n for (let j = 0; j < wires.length; j++) {\n let shouldBeCut = false;\n for (let i = 0; i < questions.length; i++) {\n shouldBeCut = shouldBeCut || questions[i].shouldCut(wires[j], j);\n }\n wiresToBeCut.push(shouldBeCut);\n }\n if (wiresToBeCut.every((b, i) => b === cutWires[i])) {\n props.onSuccess();\n }\n }, [cutWires]);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const wireNum = parseInt(event.key);\n\n if (wireNum < 1 || wireNum > wires.length || isNaN(wireNum)) return;\n setCutWires((old) => {\n const next = [...old];\n next[wireNum - 1] = true;\n if (!checkWire(wireNum)) {\n props.onFailure();\n }\n\n return next;\n });\n }\n\n return (\n <>\n \n \n \n Cut the wires with the following properties! (keyboard 1 to 9)\n \n {questions.map((question, i) => (\n {question.toString()}\n ))}\n \n {new Array(wires.length).fill(0).map((_, i) => {\n const isCorrectWire = checkWire(i + 1);\n const color = hasAugment && !isCorrectWire ? Settings.theme.disabled : Settings.theme.primary;\n return (\n \n {i + 1}\n \n );\n })}\n {new Array(8).fill(0).map((_, i) => (\n \n {wires.map((wire, j) => {\n if ((i === 3 || i === 4) && cutWires[j]) {\n return ;\n }\n const isCorrectWire = checkWire(j + 1);\n const wireColor =\n hasAugment && !isCorrectWire ? Settings.theme.disabled : wire.colors[i % wire.colors.length];\n return (\n \n |{wire.tpe}|\n \n );\n })}\n \n ))}\n \n \n \n \n );\n}\n\nfunction randomPositionQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n return {\n toString: (): string => {\n return `Cut wires number ${index + 1}.`;\n },\n shouldCut: (wire: Wire, i: number): boolean => {\n return index === i;\n },\n };\n}\n\nfunction randomColorQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n const cutColor = wires[index].colors[0];\n return {\n toString: (): string => {\n return `Cut all wires colored ${colorNames[cutColor]}.`;\n },\n shouldCut: (wire: Wire): boolean => {\n return wire.colors.includes(cutColor);\n },\n };\n}\n\nfunction generateQuestion(wires: Wire[], difficulty: Difficulty): Question[] {\n const numQuestions = difficulty.rules;\n const questionGenerators = [randomPositionQuestion, randomColorQuestion];\n const questions = [];\n for (let i = 0; i < numQuestions; i++) {\n questions.push(questionGenerators[i % 2](wires));\n }\n return questions;\n}\n\nfunction generateWires(difficulty: Difficulty): Wire[] {\n const wires = [];\n const numWires = random(difficulty.wiresmin, difficulty.wiresmax);\n for (let i = 0; i < numWires; i++) {\n const wireColors = [colors[Math.floor(Math.random() * colors.length)]];\n if (Math.random() < 0.15) {\n wireColors.push(colors[Math.floor(Math.random() * colors.length)]);\n }\n wires.push({\n tpe: types[Math.floor(Math.random() * types.length)],\n colors: wireColors,\n });\n }\n return wires;\n}\n","import { Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\ninterface IProps {\n Location: Location;\n Difficulty: number;\n MaxLevel: number;\n start: () => void;\n cancel: () => void;\n}\n\nfunction arrowPart(color: string, length: number): JSX.Element {\n let arrow = \"\";\n if (length <= 0) length = 0;\n else if (length > 13) length = 13;\n else {\n length--;\n arrow = \">\";\n }\n return (\n \n {\"=\".repeat(length)}\n {arrow}\n {\" \".repeat(13 - arrow.length - length)}\n \n );\n}\n\nfunction coloredArrow(difficulty: number): JSX.Element {\n if (difficulty === 0) {\n return (\n \n {\">\"}\n {\" \".repeat(38)}\n \n );\n } else {\n return (\n <>\n {arrowPart(Settings.theme.primary, difficulty * 13)}\n {arrowPart(Settings.theme.warning, (difficulty - 1) * 13)}\n {arrowPart(Settings.theme.error, (difficulty - 2) * 13)}\n \n );\n }\n}\n\nexport function Intro(props: IProps): React.ReactElement {\n return (\n \n \n \n Infiltrating {props.Location.name}\n \n \n Maximum Level: \n {props.MaxLevel}\n \n 2\n ? Settings.theme.error\n : props.Difficulty > 1\n ? Settings.theme.warning\n : Settings.theme.primary,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n Difficulty: \n {numeralWrapper.format(props.Difficulty * 33.3333, \"0\")} / 100\n {props.Difficulty > 1.5 && (\n \n This location is too heavily guarded for your current stats. It is recommended that you try training,\n or finding an easier location.\n \n }\n >\n \n \n )}\n \n\n [{coloredArrow(props.Difficulty)}]\n {`▲ ▲ ▲ ▲`}\n {` Trivial Normal Hard Impossible`}\n \n\n \n \n Infiltration is a series of short minigames that get progressively harder. You take damage for failing\n them. Reaching the maximum level rewards you with intel that you can trade for money or reputation.\n
\n
\n Gameplay:\n
\n
    \n \n
  • \n The minigames you play are randomly selected.\n
    \n It might take you a few tries to get used to them.\n
  • \n
  • No game requires use of the mouse.
  • \n
  • \n Spacebar is the default action/confirm button.\n
  • \n
  • \n The arrow keys and WASD can be used interchangeably.\n
  • \n
  • Sometimes the rest of the keyboard is used.
  • \n
    \n
\n\n \n \n \n \n
\n
\n );\n}\n","import { Box, Container, Paper, Table, TableBody, Tooltip } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { Companies } from \"../Company/Companies\";\nimport { Company } from \"../Company/Company\";\nimport { CONSTANTS } from \"../Constants\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Locations } from \"../Locations/Locations\";\nimport { Settings } from \"../Settings/Settings\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { use } from \"./Context\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Money } from \"./React/Money\";\nimport { MoneyRate } from \"./React/MoneyRate\";\nimport { ProgressBar } from \"./React/Progress\";\nimport { Reputation } from \"./React/Reputation\";\nimport { ReputationRate } from \"./React/ReputationRate\";\nimport { StatsRow } from \"./React/StatsRow\";\nimport { isCrimeWork } from \"../Work/CrimeWork\";\nimport { isClassWork } from \"../Work/ClassWork\";\nimport { WorkStats } from \"../Work/WorkStats\";\nimport { isCreateProgramWork } from \"../Work/CreateProgramWork\";\nimport { isGraftingWork } from \"../Work/GraftingWork\";\nimport { isFactionWork } from \"../Work/FactionWork\";\nimport { FactionWorkType } from \"../Work/data/FactionWorkType\";\nimport { isCompanyWork } from \"../Work/CompanyWork\";\n\nconst CYCLES_PER_SEC = 1000 / CONSTANTS.MilliPerCycle;\n\ninterface IWorkInfo {\n buttons: {\n cancel: () => void;\n unfocus?: () => void;\n };\n title: string | React.ReactElement;\n\n description?: string | React.ReactElement;\n gains?: (string | React.ReactElement)[];\n progress?: {\n elapsed?: number;\n remaining?: number;\n percentage?: number;\n };\n\n stopText: string;\n stopTooltip?: string | React.ReactElement;\n}\n\nfunction ExpRows(rate: WorkStats): React.ReactElement[] {\n return [\n rate.hackExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.strExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.defExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.dexExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.agiExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.chaExp > 0 ? (\n \n ) : (\n <>\n ),\n ];\n}\n\nfunction CrimeExpRows(rate: WorkStats): React.ReactElement[] {\n return [\n rate.hackExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.strExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.defExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.dexExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.agiExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.chaExp > 0 ? (\n \n ) : (\n <>\n ),\n ];\n}\n\nexport function WorkInProgressRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, CONSTANTS.MilliPerCycle);\n return () => clearInterval(id);\n }, []);\n\n const player = use.Player();\n const router = use.Router();\n\n let workInfo: IWorkInfo = {\n buttons: {\n cancel: () => undefined,\n },\n title: \"\",\n stopText: \"\",\n };\n\n if (player.currentWork === null) {\n setTimeout(() => router.toTerminal());\n return <>;\n }\n\n if (isCrimeWork(player.currentWork)) {\n const crime = player.currentWork.getCrime();\n const completion = (player.currentWork.unitCompleted / crime.time) * 100;\n const gains = player.currentWork.earnings();\n const successChance = crime.successRate(player);\n workInfo = {\n buttons: {\n cancel: () => {\n router.toLocation(Locations[LocationName.Slums]);\n player.finishWork(true);\n },\n unfocus: () => {\n router.toCity();\n player.stopFocusing();\n },\n },\n title: `You are attempting ${crime.workName}`,\n\n gains: [\n Success chance: {numeralWrapper.formatPercentage(successChance)},\n Gains (on success),\n \n \n \n \n ,\n ...CrimeExpRows(gains),\n ],\n progress: {\n remaining: crime.time - player.currentWork.unitCompleted,\n percentage: completion,\n },\n\n stopText: \"Stop commiting crime\",\n };\n }\n\n if (isClassWork(player.currentWork)) {\n const classWork = player.currentWork;\n function cancel(): void {\n player.finishWork(true);\n router.toCity();\n }\n\n function unfocus(): void {\n router.toCity();\n player.stopFocusing();\n }\n\n let stopText = \"\";\n if (classWork.isGym()) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n const rates = classWork.calculateRates(player);\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {classWork.getClass().youAreCurrently}\n \n ),\n\n gains: [\n \n \n ()\n \n ,\n ...ExpRows(rates),\n ],\n progress: {\n elapsed: classWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: stopText,\n };\n }\n\n if (isCreateProgramWork(player.currentWork)) {\n const create = player.currentWork;\n function cancel(): void {\n player.finishWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (create.unitCompleted / create.unitNeeded()) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on coding {create.programName}\n \n ),\n\n progress: {\n elapsed: create.cyclesWorked * CONSTANTS._idleSpeed,\n percentage: completion,\n },\n\n stopText: \"Stop creating program\",\n stopTooltip: \"Your work will be saved and you can return to complete the program later.\",\n };\n }\n\n if (isGraftingWork(player.currentWork)) {\n const graft = player.currentWork;\n function cancel(): void {\n player.finishWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on grafting {graft.augmentation}\n \n ),\n\n progress: {\n elapsed: graft.cyclesWorked * CONSTANTS._idleSpeed,\n percentage: (graft.unitCompleted / graft.unitNeeded()) * 100,\n },\n\n stopText: \"Stop grafting\",\n stopTooltip: (\n <>\n If you cancel, your work will not be saved, and the money you spent will not be returned\n \n ),\n };\n }\n\n if (isFactionWork(player.currentWork)) {\n const faction = player.currentWork.getFaction();\n if (!faction) {\n workInfo = {\n buttons: {\n cancel: () => router.toFactions(),\n },\n title:\n `You have not joined ${player.currentWork.factionName || \"(Faction not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Factions\",\n };\n }\n\n function cancel(): void {\n router.toFaction(faction);\n player.finishWork(true);\n }\n function unfocus(): void {\n router.toFaction(faction);\n player.stopFocusing();\n }\n\n const description = {\n [FactionWorkType.HACKING]: \"carrying out hacking contracts\",\n [FactionWorkType.FIELD]: \"carrying out field missions\",\n [FactionWorkType.SECURITY]: \"performing security detail\",\n };\n\n const exp = player.currentWork.getExpRates(player);\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {description[player.currentWork.factionWorkType]} for {faction.name}\n \n ),\n\n description: (\n <>\n Current Faction Reputation: (\n )\n \n ),\n gains: ExpRows(exp),\n progress: {\n elapsed: player.currentWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: \"Stop Faction work\",\n };\n }\n\n if (isCompanyWork(player.currentWork)) {\n const comp = Companies[player.currentWork.companyName];\n if (comp == null || !(comp instanceof Company)) {\n workInfo = {\n buttons: {\n cancel: () => router.toTerminal(),\n },\n title:\n `You cannot work for ${player.currentWork.companyName || \"(Company not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Terminal\",\n };\n }\n\n const companyRep = comp.playerReputation;\n\n function cancel(): void {\n player.finishWork(true);\n router.toJob(Locations[comp.name]);\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob(Locations[comp.name]);\n }\n\n const position = player.jobs[player.currentWork.companyName];\n const gains = player.currentWork.getGainRates(player);\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a {position} at {player.currentWork.companyName}\n \n ),\n\n description: (\n <>\n Current Company Reputation: \n \n ),\n gains: [\n \n \n \n \n ,\n \n \n \n \n ,\n ...ExpRows(gains),\n ],\n progress: {\n elapsed: player.currentWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: \"Stop working\",\n };\n }\n\n if (workInfo.title === \"\") {\n return <>;\n }\n\n const tooltipInfo =\n typeof workInfo?.stopTooltip === \"string\" ? (\n {workInfo.stopTooltip}\n ) : (\n workInfo.stopTooltip || <>\n );\n\n return (\n \n \n {workInfo.title}\n {workInfo.description}\n {workInfo.gains && (\n \n \n {workInfo.gains.map((row) => (\n {row}\n ))}\n \n
\n )}\n
\n \n {workInfo.progress !== undefined && (\n \n \n {workInfo.progress.elapsed !== undefined && (\n {convertTimeMsToTimeElapsedString(workInfo.progress.elapsed)} elapsed\n )}\n {workInfo.progress.remaining !== undefined && (\n {convertTimeMsToTimeElapsedString(workInfo.progress.remaining)} remaining\n )}\n {workInfo.progress.percentage !== undefined && (\n {workInfo.progress.percentage.toFixed(2)}% done\n )}\n \n {workInfo.progress.percentage !== undefined && (\n \n )}\n \n )}\n\n \n {workInfo.stopTooltip ? (\n \n \n \n ) : (\n \n )}\n {workInfo.buttons.unfocus && (\n \n )}\n \n \n \n );\n}\n","import { Box, Container, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\nimport { GameOptionsSidebar } from \"./GameOptionsSidebar\";\nimport { GameplayPage } from \"./GameplayPage\";\nimport { InterfacePage } from \"./InterfacePage\";\nimport { MiscPage } from \"./MiscPage\";\nimport { RemoteAPIPage } from \"./RemoteAPIPage\";\nimport { SystemPage } from \"./SystemPage\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\nexport function GameOptionsRoot(props: IProps): React.ReactElement {\n const [currentTab, setCurrentTab] = useState(GameOptionsTab.SYSTEM);\n\n return (\n \n Options\n \n \n {currentTab === GameOptionsTab.SYSTEM && }\n {currentTab === GameOptionsTab.INTERFACE && }\n {currentTab === GameOptionsTab.GAMEPLAY && }\n {currentTab === GameOptionsTab.MISC && }\n {currentTab === GameOptionsTab.REMOTE_API && }\n \n \n );\n}\n","import {\n BugReport,\n Chat,\n Download,\n LibraryBooks,\n Palette,\n Reddit,\n Save,\n SystemUpdateAlt,\n Upload,\n Bloodtype,\n} from \"@mui/icons-material\";\nimport { Box, Button, List, ListItemButton, Paper, Tooltip, Typography } from \"@mui/material\";\nimport { default as React, useRef, useState } from \"react\";\nimport { FileDiagnosticModal } from \"../../Diagnostic/FileDiagnosticModal\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { ImportData, saveObject } from \"../../SaveObject\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { StyleEditorButton } from \"../../Themes/ui/StyleEditorButton\";\nimport { ThemeEditorButton } from \"../../Themes/ui/ThemeEditorButton\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { DeleteGameButton } from \"../../ui/React/DeleteGameButton\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { SoftResetButton } from \"../../ui/React/SoftResetButton\";\nimport { IRouter } from \"../../ui/Router\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\n\ninterface IProps {\n tab: GameOptionsTab;\n setTab: (tab: GameOptionsTab) => void;\n player: IPlayer;\n router: IRouter;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\ninterface ITabProps {\n sideBarProps: IProps;\n tab: GameOptionsTab;\n tabName: string;\n}\n\nconst SideBarTab = (props: ITabProps): React.ReactElement => {\n return (\n props.sideBarProps.setTab(props.tab)}\n >\n {props.tabName}\n \n );\n};\n\nexport const GameOptionsSidebar = (props: IProps): React.ReactElement => {\n const importInput = useRef(null);\n\n const [diagnosticOpen, setDiagnosticOpen] = useState(false);\n const [importSaveOpen, setImportSaveOpen] = useState(false);\n const [importData, setImportData] = useState(null);\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n async function onImport(event: React.ChangeEvent): Promise {\n try {\n const base64Save = await saveObject.getImportStringFromFile(event.target.files);\n const data = await saveObject.getImportDataFromString(base64Save);\n setImportData(data);\n setImportSaveOpen(true);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n }\n\n async function confirmedImportGame(): Promise {\n if (!importData) return;\n\n try {\n await saveObject.importGame(importData.base64);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n function compareSaveGame(): void {\n if (!importData) return;\n props.router.toImportSave(importData.base64);\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Export your game to a text file.}>\n \n \n \n Import your game from a text file.\n
\n This will overwrite your current game. Back it up first!\n \n }\n >\n \n \n setImportSaveOpen(false)}\n onConfirm={() => confirmedImportGame()}\n additionalButton={}\n confirmationText={\n <>\n Importing a new game will completely wipe the current data!\n
\n
\n Make sure to have a backup of your current save file before importing.\n
\n The file you are attempting to import seems valid.\n {(importData?.playerData?.lastSave ?? 0) > 0 && (\n <>\n
\n
\n The export date of the save file is{\" \"}\n {new Date(importData?.playerData?.lastSave ?? 0).toLocaleString()}\n \n )}\n {(importData?.playerData?.totalPlaytime ?? 0) > 0 && (\n <>\n
\n
\n Total play time of imported game:{\" \"}\n {convertTimeMsToTimeElapsedString(importData?.playerData?.totalPlaytime ?? 0)}\n \n )}\n
\n
\n \n }\n />\n \n Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game.\n After using this, save the game and then reload the page. This is different than normal kill in that\n normal kill will tell the script to shut down while force kill just removes the references to it (and it\n should crash on its own). This will not remove the files on your computer, just forcefully kill all\n running instances of all scripts.\n \n }\n >\n \n \n \n \n \n \n If your save file is extremely big you can use this button to view a map of all the files on every server.\n Be careful: there might be spoilers.\n \n }\n >\n \n \n \n \n \n \n \n \n \n \n \n\n \n }\n href=\"https://github.com/danielyxie/bitburner/issues/new\"\n target=\"_blank\"\n sx={{ gridArea: \"bug\" }}\n >\n Report Bug\n \n }\n href=\"https://bitburner.readthedocs.io/en/latest/changelog.html\"\n target=\"_blank\"\n sx={{ gridArea: \" changelog\" }}\n >\n Changelog\n \n }\n href=\"https://bitburner.readthedocs.io/en/latest/index.html\"\n target=\"_blank\"\n sx={{ gridArea: \"docs\" }}\n >\n Documentation\n \n \n }\n href=\"https://www.reddit.com/r/bitburner\"\n target=\"_blank\"\n sx={{ gridArea: \"reddit\" }}\n >\n Reddit\n \n
\n\n {!location.href.startsWith(\"file://\") && (\n \n \n \n \n \n hydroflame (Current Maintainer)\n \n \n Donate blood!\n \n \n \n )}\n \n setDiagnosticOpen(false)} />\n \n );\n};\n","import React from \"react\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\nimport { Modal } from \"../ui/React/Modal\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\ninterface IServerProps {\n hostname: string;\n}\n\nfunction ServerAccordion(props: IServerProps): React.ReactElement {\n const server = GetServer(props.hostname);\n if (server === null) throw new Error(`server '${props.hostname}' should not be null`);\n let totalSize = 0;\n for (const f of server.scripts) {\n totalSize += f.code.length;\n }\n\n for (const f of server.textFiles) {\n totalSize += f.text.length;\n }\n\n if (totalSize === 0) {\n return <>;\n }\n\n interface File {\n name: string;\n size: number;\n }\n\n const files: File[] = [];\n\n for (const f of server.scripts) {\n files.push({ name: f.filename, size: f.code.length });\n }\n\n for (const f of server.textFiles) {\n files.push({ name: f.fn, size: f.text.length });\n }\n\n files.sort((a: File, b: File): number => b.size - a.size);\n\n return (\n \n }>\n \n {server.hostname} ({numeralWrapper.formatBigNumber(totalSize)}b)\n \n \n \n \n \n \n \n \n Filename\n \n \n Size\n \n \n \n \n {files.map((file: File) => (\n \n \n {file.name}\n \n \n {numeralWrapper.formatBigNumber(file.size)}b\n \n \n ))}\n \n
\n
\n
    \n
    \n
    \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FileDiagnosticModal(props: IProps): React.ReactElement {\n const keys: string[] = [];\n for (const key of GetAllServers()) {\n keys.push(key.hostname);\n }\n\n return (\n \n <>\n \n Welcome to the file diagnostic! If your save file is really big it's likely because you have too many\n text/scripts. This tool can help you narrow down where they are.\n \n {keys.map((hostname: string) => (\n \n ))}\n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport SaveIcon from \"@mui/icons-material/Save\";\n\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { defaultStyles } from \"../Styles\";\nimport { Tooltip } from \"@mui/material\";\nimport { IStyleSettings } from \"../../ScriptEditor/NetscriptDefinitions\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\ninterface FontFamilyProps {\n value: React.CSSProperties[\"fontFamily\"];\n onChange: (newValue: React.CSSProperties[\"fontFamily\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction FontFamilyField({ value, onChange, refreshId }: FontFamilyProps): React.ReactElement {\n const [errorText, setErrorText] = useState();\n const [fontFamily, setFontFamily] = useState(value);\n\n function update(newValue: React.CSSProperties[\"fontFamily\"]): void {\n setFontFamily(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(fontFamily, errorText), [fontFamily]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n \n );\n}\n\ninterface LineHeightProps {\n value: React.CSSProperties[\"lineHeight\"];\n onChange: (newValue: React.CSSProperties[\"lineHeight\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction LineHeightField({ value, onChange, refreshId }: LineHeightProps): React.ReactElement {\n const [errorText, setErrorText] = useState();\n const [lineHeight, setLineHeight] = useState(value);\n\n function update(newValue: React.CSSProperties[\"lineHeight\"]): void {\n setLineHeight(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else if (isNaN(Number(newValue))) {\n setErrorText(\"Must be a number\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(lineHeight, errorText), [lineHeight]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n \n );\n}\n\nexport function StyleEditorModal(props: IProps): React.ReactElement {\n const [refreshId, setRefreshId] = useState(0);\n const [error, setError] = useState();\n const [customStyle, setCustomStyle] = useState({\n ...Settings.styles,\n });\n\n function persistToSettings(styles: IStyleSettings): void {\n Object.assign(Settings.styles, styles);\n ThemeEvents.emit();\n }\n\n function saveStyles(): void {\n persistToSettings(customStyle);\n }\n\n function setDefaults(): void {\n const styles = { ...defaultStyles };\n setCustomStyle(styles);\n persistToSettings(styles);\n setRefreshId(refreshId + 1);\n }\n\n function update(styles: IStyleSettings, errorMessage?: string): void {\n setError(errorMessage);\n if (!errorMessage) {\n setCustomStyle(styles);\n }\n }\n\n return (\n \n Styles Editor\n \n WARNING: Changing styles may mess up the interface. Drastic changes are{\" \"}\n NOT recommended.\n \n \n update({ ...customStyle, fontFamily: value ?? \"\" }, error)}\n />\n
    \n update({ ...customStyle, lineHeight: Number(value) ?? 0 }, error)}\n />\n
    \n \n \n \n \n \n \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport PaletteSharpIcon from \"@mui/icons-material/PaletteSharp\";\nimport HistoryIcon from \"@mui/icons-material/History\";\nimport { Color, ColorPicker } from \"material-ui-color\";\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings, defaultSettings } from \"../../Settings/Settings\";\nimport { defaultTheme } from \"../Themes\";\nimport { UserInterfaceTheme } from \"../../ScriptEditor/NetscriptDefinitions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ThemeCollaborate } from \"./ThemeCollaborate\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n router: IRouter;\n}\n\ninterface IColorEditorProps {\n name: string;\n color: string | undefined;\n onColorChange: (name: string, value: string) => void;\n defaultColor: string;\n}\n\nfunction ColorEditor({ name, onColorChange, color, defaultColor }: IColorEditorProps): React.ReactElement {\n if (color === undefined) {\n console.error(`color ${name} was undefined, reverting to default`);\n color = defaultColor;\n }\n\n return (\n <>\n \n onColorChange(name, \"#\" + newColor.hex)}\n disableAlpha\n />\n \n ),\n endAdornment: (\n <>\n onColorChange(name, defaultColor)}>\n \n \n \n ),\n }}\n />\n \n );\n}\n\nexport function ThemeEditorModal(props: IProps): React.ReactElement {\n const [customTheme, setCustomTheme] = useState<{ [key: string]: string | undefined }>({\n ...Settings.theme,\n });\n\n function setTheme(theme: UserInterfaceTheme): void {\n setCustomTheme(theme);\n Object.assign(Settings.theme, theme);\n ThemeEvents.emit();\n }\n\n function onThemeChange(event: React.ChangeEvent): void {\n try {\n const importedTheme = JSON.parse(event.target.value);\n if (typeof importedTheme !== \"object\") return;\n setCustomTheme(importedTheme);\n for (const key of Object.keys(importedTheme)) {\n Settings.theme[key] = importedTheme[key];\n }\n ThemeEvents.emit();\n } catch (err) {\n // ignore\n }\n }\n\n function onColorChange(name: string, value: string): void {\n setCustomTheme((old: { [key: string]: string | undefined }) => {\n old[name] = value;\n return old;\n });\n\n Settings.theme[name] = value;\n ThemeEvents.emit();\n }\n\n function setTemplateTheme(theme: UserInterfaceTheme): void {\n setTheme(theme);\n }\n\n return (\n \n \n Example tooltip}>\n \n \n \n \n \n \n \n
    \n \n text with primary color\n \n  \n \n text with secondary color\n \n  \n \n text with error color\n \n
    \n \n
    \n\n \n \n \n \n\n
    \n \n \n \n\n
    \n \n \n \n\n
    \n \n \n \n\n
    \n \n \n \n\n
    \n \n \n \n\n
    \n \n \n \n \n \n \n \n\n
    \n \n \n \n \n \n \n \n \n
    \n\n \n \n <>\n Backup your theme or share it with others by copying the string above.\n \n \n \n \n \n \n \n \n \n \n \n
    \n );\n}\n","import React from \"react\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { use } from \"../../ui/Context\";\n\nexport const GameplayPage = (): React.ReactElement => {\n const player = use.Player();\n return (\n \n (Settings.SuppressMessages = newValue)}\n text=\"Suppress story messages\"\n tooltip={\n <>\n If this is set, then any messages you receive will not appear as popups on the screen. They will still get\n sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal command.\n \n }\n />\n (Settings.SuppressFactionInvites = newValue)}\n text=\"Suppress faction invites\"\n tooltip={\n <>\n If this is set, then any faction invites you receive will not appear as popups on the screen. Your\n outstanding faction invites can be viewed in the 'Factions' page.\n \n }\n />\n (Settings.SuppressTravelConfirmation = newValue)}\n text=\"Suppress travel confirmations\"\n tooltip={\n <>\n If this is set, the confirmation message before traveling will not show up. You will automatically be\n deducted the travel cost as soon as you click.\n \n }\n />\n (Settings.SuppressBuyAugmentationConfirmation = newValue)}\n text=\"Suppress augmentations confirmation\"\n tooltip={<>If this is set, the confirmation message before buying augmentation will not show up.}\n />\n (Settings.SuppressTIXPopup = newValue)}\n text=\"Suppress TIX messages\"\n tooltip={<>If this is set, the stock market will never create any popup.}\n />\n {player.bladeburner && (\n (Settings.SuppressBladeburnerPopup = newValue)}\n text=\"Suppress bladeburner popup\"\n tooltip={\n <>\n If this is set, then having your Bladeburner actions interrupted by being busy with something else will\n not display a popup message.\n \n }\n />\n )}\n \n );\n};\n","import React, { useState } from \"react\";\nimport { MenuItem, Select, SelectChangeEvent, TextField, Tooltip, Typography } from \"@mui/material\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { formatTime } from \"../../utils/helpers/formatTime\";\n\nexport const InterfacePage = (): React.ReactElement => {\n const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat);\n const [locale, setLocale] = useState(Settings.Locale);\n\n function handleLocaleChange(event: SelectChangeEvent): void {\n setLocale(event.target.value);\n Settings.Locale = event.target.value;\n }\n function handleTimestampFormatChange(event: React.ChangeEvent): void {\n setTimestampFormat(event.target.value);\n Settings.TimestampsFormat = event.target.value;\n }\n return (\n \n (Settings.DisableASCIIArt = newValue)}\n text=\"Disable ascii art\"\n tooltip={<>If this is set all ASCII art will be disabled.}\n />\n (Settings.DisableTextEffects = newValue)}\n text=\"Disable text effects\"\n tooltip={\n <>\n If this is set, text effects will not be displayed. This can help if text is difficult to read in certain\n areas.\n \n }\n />\n (Settings.DisableOverviewProgressBars = newValue)}\n text=\"Disable Overview Progress Bars\"\n tooltip={<>If this is set, the progress bars in the character overview will be hidden.}\n />\n (Settings.UseIEC60027_2 = newValue)}\n text=\"Use GiB instead of GB\"\n tooltip={\n <>If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.\n }\n />\n \n Terminal commands and log entries will be timestamped. See https://date-fns.org/docs/Getting-Started/\n \n }\n >\n \n Timestamp format: \n \n ),\n }}\n value={timestampFormat}\n onChange={handleTimestampFormatChange}\n placeholder=\"yyyy-MM-dd hh:mm:ss\"\n />\n \n \n Example timestamp: {timestampFormat !== \"\" ? formatTime(timestampFormat) : \"no timestamp\"}\n \n
    \n\n \n
    \n );\n};\n","import React from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\n\nexport const MiscPage = (): React.ReactElement => {\n return (\n \n (Settings.DisableHotkeys = newValue)}\n text=\"Disable hotkeys\"\n tooltip={\n <>\n If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes Terminal\n commands, hotkeys to navigate between different parts of the game, and the \"Save and Close (Ctrl + b)\"\n hotkey in the Text Editor.\n \n }\n />\n (Settings.EnableBashHotkeys = newValue)}\n text=\"Enable bash hotkeys\"\n tooltip={\n <>\n Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features that\n more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser\n shortcuts are overriden by the new Bash shortcuts.\n \n }\n />\n \n );\n};\n","import React, { useState } from \"react\";\nimport { Button, Link, TextField, Tooltip, Typography } from \"@mui/material\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConnectionBauble } from \"./ConnectionBauble\";\nimport { isRemoteFileApiConnectionLive, newRemoteFileApiConnection } from \"../../RemoteFileAPI/RemoteFileAPI\";\n\nexport const RemoteAPIPage = (): React.ReactElement => {\n const [remoteFileApiPort, setRemoteFileApiPort] = useState(Settings.RemoteFileApiPort);\n\n function handleRemoteFileApiPortChange(event: React.ChangeEvent): void {\n setRemoteFileApiPort(Number(event.target.value) as number);\n Settings.RemoteFileApiPort = Number(event.target.value);\n }\n\n return (\n \n \n These settings control the Remote API for bitburner. This is typically used to write scripts using an external\n text editor and then upload files to the home server.\n \n \n \n Documentation\n \n \n \n \n This port number is used to connect to a Remote API port, please ensure that it matches with your Remote API\n server port. Set to 0 to disable the feature.\n \n }\n >\n 0 && remoteFileApiPort <= 65535 ? \"success\" : \"error\"}>\n Port: \n \n ),\n endAdornment: ,\n }}\n value={remoteFileApiPort}\n onChange={handleRemoteFileApiPortChange}\n placeholder=\"12525\"\n />\n \n \n );\n};\n","import { Typography } from \"@mui/material\";\nimport React, { useState, useEffect } from \"react\";\nimport WifiIcon from \"@mui/icons-material/Wifi\";\nimport WifiOffIcon from \"@mui/icons-material/WifiOff\";\n\ninterface baubleProps {\n isConnected: () => boolean;\n}\n\nexport const ConnectionBauble = (props: baubleProps): React.ReactElement => {\n const [connection, setConnection] = useState(props.isConnected());\n\n useEffect(() => {\n const timer = setInterval(() => {\n setConnection(props.isConnected());\n }, 1000);\n return () => clearInterval(timer);\n });\n\n return (\n <>\n \n Status: \n \n {connection ? (\n <>\n Online \n \n \n ) : (\n <>\n Offline \n \n \n )}\n \n \n \n );\n};\n","import { RFAMessage } from \"./MessageDefinitions\";\nimport { RFARequestHandler } from \"./MessageHandlers\";\nimport { SnackbarEvents, ToastVariant } from \"../ui/React/Snackbar\";\n\nexport class Remote {\n connection?: WebSocket;\n static protocol = \"ws\";\n ipaddr: string;\n port: number;\n\n constructor(ip: string, port: number) {\n this.ipaddr = ip;\n this.port = port;\n }\n\n public stopConnection(): void {\n this.connection?.close();\n }\n\n public startConnection(): void {\n const address = Remote.protocol + \"://\" + this.ipaddr + \":\" + this.port;\n this.connection = new WebSocket(address);\n\n this.connection.addEventListener(\"error\", (e: Event) =>\n SnackbarEvents.emit(`Error with websocket ${address}, details: ${JSON.stringify(e)}`, ToastVariant.ERROR, 5000),\n );\n this.connection.addEventListener(\"message\", handleMessageEvent);\n this.connection.addEventListener(\"open\", () =>\n SnackbarEvents.emit(\n `Remote API connection established on ${this.ipaddr}:${this.port}`,\n ToastVariant.SUCCESS,\n 2000,\n ),\n );\n this.connection.addEventListener(\"close\", () =>\n SnackbarEvents.emit(\"Remote API connection closed\", ToastVariant.WARNING, 2000),\n );\n }\n}\n\nfunction handleMessageEvent(this: WebSocket, e: MessageEvent): void {\n const msg: RFAMessage = JSON.parse(e.data);\n\n if (!msg.method || !RFARequestHandler[msg.method]) {\n const response = new RFAMessage({ error: \"Unknown message received\", id: msg.id });\n this.send(JSON.stringify(response));\n return;\n }\n const response = RFARequestHandler[msg.method](msg);\n if (!response) return;\n this.send(JSON.stringify(response));\n}\n","import React, { useState } from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { OptionsSlider } from \"./OptionsSlider\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport const SystemPage = (): React.ReactElement => {\n const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime);\n const [recentScriptsSize, setRecentScriptsSize] = useState(Settings.MaxRecentScriptsCapacity);\n const [logSize, setLogSize] = useState(Settings.MaxLogCapacity);\n const [portSize, setPortSize] = useState(Settings.MaxPortCapacity);\n const [terminalSize, setTerminalSize] = useState(Settings.MaxTerminalCapacity);\n const [autosaveInterval, setAutosaveInterval] = useState(Settings.AutosaveInterval);\n\n function handlePortSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setPortSize(newValue as number);\n Settings.MaxPortCapacity = newValue as number;\n }\n\n function handleTerminalSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setTerminalSize(newValue as number);\n Settings.MaxTerminalCapacity = newValue as number;\n }\n\n function handleExecTimeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleRecentScriptsSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setRecentScriptsSize(newValue as number);\n Settings.MaxRecentScriptsCapacity = newValue as number;\n }\n\n function handleLogSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setLogSize(newValue as number);\n Settings.MaxLogCapacity = newValue as number;\n }\n\n function handleAutosaveIntervalChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setAutosaveInterval(newValue as number);\n Settings.AutosaveInterval = newValue as number;\n }\n return (\n \n {/* Wrap in a React fragment to prevent the sliders from breaking as list items */}\n <>\n \n The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low can\n result in poor performance if you have many scripts running.\n \n }\n />\n The maximum number of recently killed scripts the game will keep.}\n />\n \n The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a\n lot of memory if you have many scripts running.\n \n }\n />\n \n The maximum number of entries that can be written to a port using Netscript's write() function. Setting\n this too high can cause the game to use a lot of memory.\n \n }\n />\n \n The maximum number of entries that can be written to the terminal. Setting this too high can cause the\n game to use a lot of memory.\n \n }\n marks\n />\n The time (in seconds) between each autosave. Set to 0 to disable autosave.}\n marks\n />\n \n (Settings.SuppressSavedGameToast = newValue)}\n text=\"Suppress Auto-Save Game Toast\"\n tooltip={<>If this is set, there will be no \"Game Saved!\" toast appearing after an auto-save.}\n />\n (Settings.SuppressAutosaveDisabledWarnings = newValue)}\n text=\"Suppress Auto-Save Disabled Warning\"\n tooltip={<>If this is set, there will be no warning triggered when auto-save is disabled (at 0).}\n />\n (Settings.SaveGameOnFileSave = newValue)}\n text=\"Save game on file save\"\n tooltip={<>Save your game any time a file is saved in the script editor.}\n />\n (Settings.ExcludeRunningScriptsFromSave = newValue)}\n text=\"Exclude Running Scripts from Save\"\n tooltip={\n <>\n If this is set, the save file will exclude all running scripts. This is only useful if your save is lagging\n a lot. You'll have to restart your script every time you launch the game.\n \n }\n />\n \n );\n};\n","import React, { useState, useEffect } from \"react\";\n\nimport { Box, Typography, Button, Container } from \"@mui/material\";\n\nimport { use } from \"../../../ui/Context\";\n\nimport { SleeveElem } from \"./SleeveElem\";\nimport { FAQModal } from \"./FAQModal\";\n\nexport function SleeveRoot(): React.ReactElement {\n const player = use.Player();\n const [FAQOpen, setFAQOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n \n Sleeves\n \n Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In\n other words, these Synthoids contain a perfect duplicate of your mind.\n
    \n
    \n Sleeves can be used to perform different tasks synchronously.\n
    \n
    \n
    \n
    \n\n \n \n Wiki Documentation\n \n \n {player.sleeves.map((sleeve, i) => (\n \n ))}\n \n setFAQOpen(false)} />\n \n );\n}\n","import { Box, Button, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { use } from \"../../../ui/Context\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { ProgressBar } from \"../../../ui/React/Progress\";\nimport { Sleeve } from \"../Sleeve\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { EarningsElement, StatsElement } from \"./StatsElement\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { TravelModal } from \"./TravelModal\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveSynchroWork } from \"../Work/SleeveSynchroWork\";\nimport { isSleeveRecoveryWork } from \"../Work/SleeveRecoveryWork\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveInfiltrateWork } from \"../Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../Work/SleeveSupportWork\";\nimport { isSleeveBladeburnerWork } from \"../Work/SleeveBladeburnerWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\n\ninterface IProps {\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function SleeveElem(props: IProps): React.ReactElement {\n const player = use.Player();\n const [statsOpen, setStatsOpen] = useState(false);\n const [travelOpen, setTravelOpen] = useState(false);\n const [augmentationsOpen, setAugmentationsOpen] = useState(false);\n\n const [abc, setABC] = useState([\"------\", \"------\", \"------\"]);\n\n function setTask(): void {\n switch (abc[0]) {\n case \"------\":\n break;\n case \"Work for Company\":\n props.sleeve.workForCompany(player, abc[1]);\n break;\n case \"Work for Faction\":\n props.sleeve.workForFaction(player, abc[1], abc[2]);\n break;\n case \"Commit Crime\":\n props.sleeve.commitCrime(player, abc[1]);\n break;\n case \"Take University Course\":\n props.sleeve.takeUniversityCourse(player, abc[2], abc[1]);\n break;\n case \"Workout at Gym\":\n props.sleeve.workoutAtGym(player, abc[2], abc[1]);\n break;\n case \"Perform Bladeburner Actions\":\n props.sleeve.bladeburner(player, abc[1], abc[2]);\n break;\n case \"Shock Recovery\":\n props.sleeve.shockRecovery(player);\n break;\n case \"Synchronize\":\n props.sleeve.synchronize(player);\n break;\n default:\n console.error(`Invalid/Unrecognized taskValue in setSleeveTask(): ${abc[0]}`);\n }\n props.rerender();\n }\n\n let desc = <>This sleeve is currently idle;\n\n if (isSleeveCrimeWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n const crime = w.getCrime();\n desc = (\n <>\n This sleeve is currently attempting to {crime.type} (Success Rate:{\" \"}\n {numeralWrapper.formatPercentage(crime.successRate(props.sleeve))}).\n \n );\n }\n\n if (isSleeveClassWork(props.sleeve.currentWork)) {\n if (props.sleeve.currentWork.isGym())\n desc = <>This sleeve is currently working out at {props.sleeve.currentWork.location}.;\n else desc = <>This sleeve is currently studying at {props.sleeve.currentWork.location}.;\n }\n if (isSleeveSynchroWork(props.sleeve.currentWork)) {\n desc = (\n <>\n This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's\n synchronization to increase.\n \n );\n }\n if (isSleeveRecoveryWork(props.sleeve.currentWork)) {\n desc = (\n <>\n This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a faster\n rate.\n \n );\n }\n if (isSleeveFactionWork(props.sleeve.currentWork)) {\n let doing = \"nothing\";\n switch (props.sleeve.currentWork.factionWorkType) {\n case FactionWorkType.FIELD:\n doing = \"Field work\";\n break;\n case FactionWorkType.HACKING:\n doing = \"Hacking contracts\";\n break;\n case FactionWorkType.SECURITY:\n doing = \"Security work\";\n break;\n }\n desc = (\n <>\n This sleeve is currently doing {doing} for {props.sleeve.currentWork.factionName}.\n \n );\n }\n if (isSleeveCompanyWork(props.sleeve.currentWork)) {\n desc = <>This sleeve is currently working your job at {props.sleeve.currentWork.companyName}.;\n }\n\n if (isSleeveBladeburnerWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n desc = (\n <>\n This sleeve is currently attempting to perform {w.actionName}. (\n {((100 * w.cyclesWorked) / w.cyclesNeeded(player, props.sleeve)).toFixed(2)}%)\n \n );\n }\n\n if (isSleeveInfiltrateWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n desc = (\n <>\n This sleeve is currently attempting to infiltrate synthoids communities. (\n {((100 * w.cyclesWorked) / w.cyclesNeeded()).toFixed(2)}%)\n \n );\n }\n\n if (isSleeveSupportWork(props.sleeve.currentWork)) {\n desc = <>This sleeve is currently supporting you in your bladeburner activities.;\n }\n\n return (\n <>\n \n \n \n \n \n Insufficient funds : \"\"}>\n \n setTravelOpen(true)}\n disabled={player.money < CONSTANTS.TravelCost}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\n Travel\n \n \n \n Unlocked when sleeve has fully recovered : \"\"}\n >\n \n setAugmentationsOpen(true)}\n disabled={props.sleeve.shock < 100}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\n Manage Augmentations\n \n \n \n \n \n \n \n \n \n {desc}\n \n {isSleeveCrimeWork(props.sleeve.currentWork) && (\n \n )}\n {isSleeveBladeburnerWork(props.sleeve.currentWork) && (\n \n )}\n \n \n \n setStatsOpen(false)} sleeve={props.sleeve} />\n setTravelOpen(false)}\n sleeve={props.sleeve}\n rerender={props.rerender}\n />\n setAugmentationsOpen(false)}\n sleeve={props.sleeve}\n />\n \n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../../utils/StringHelperFunctions\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Typography } from \"@mui/material\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport React from \"react\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreStatsModal(props: IProps): React.ReactElement {\n return (\n \n Hacking: ,\n props.sleeve.skills.hacking,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.hacking)} exp),\n ],\n [\n <>Strength: ,\n props.sleeve.skills.strength,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.strength)} exp),\n ],\n [\n <>Defense: ,\n props.sleeve.skills.defense,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.defense)} exp),\n ],\n [\n <>Dexterity: ,\n props.sleeve.skills.dexterity,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.dexterity)} exp),\n ],\n [\n <>Agility: ,\n props.sleeve.skills.agility,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.agility)} exp),\n ],\n [\n <>Charisma: ,\n props.sleeve.skills.charisma,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.charisma)} exp),\n ],\n ]}\n title=\"Stats:\"\n />\n
    \n Hacking Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.hacking)],\n [<>Hacking Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.hacking_exp)],\n [<>Strength Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.strength)],\n [\n <>Strength Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.strength_exp),\n ],\n [<>Defense Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.defense)],\n [<>Defense Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.defense_exp)],\n [<>Dexterity Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.dexterity)],\n [\n <>Dexterity Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.dexterity_exp),\n ],\n [<>Agility Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.agility)],\n [<>Agility Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.agility_exp)],\n [<>Charisma Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.charisma)],\n [\n <>Charisma Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.charisma_exp),\n ],\n [\n <>Faction Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.faction_rep),\n ],\n [\n <>Company Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.company_rep),\n ],\n [<>Salary multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.work_money)],\n [<>Crime Money multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.crime_money)],\n [<>Crime Success multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.crime_success)],\n ]}\n title=\"Multipliers:\"\n />\n\n {/* Check for storedCycles to be a bit over 0 to prevent jittering */}\n {props.sleeve.storedCycles > 10 && (\n \n Bonus Time: {convertTimeMsToTimeElapsedString(props.sleeve.storedCycles * CONSTANTS.MilliPerCycle)}\n \n )}\n
    \n );\n}\n","import { Container, Typography, Paper } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { PurchasableAugmentations } from \"../../../Augmentation/ui/PurchasableAugmentations\";\nimport { use } from \"../../../ui/Context\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Sleeve } from \"../Sleeve\";\nimport { findSleevePurchasableAugs } from \"../SleeveHelpers\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function SleeveAugmentationsModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 150);\n return () => clearInterval(id);\n }, []);\n\n // Array of all owned Augmentations. Names only\n const ownedAugNames = props.sleeve.augmentations.map((e) => e.name);\n\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n const availableAugs = findSleevePurchasableAugs(props.sleeve, player);\n\n return (\n \n \n \n You can purchase Augmentations for your Duplicate Sleeves. These Augmentations have the same effect as they\n would for you. You can only purchase Augmentations that you have unlocked through Factions.\n
    \n
    \n When purchasing an Augmentation for a Duplicate Sleeve, they are immediately installed. This means that the\n Duplicate Sleeve will immediately lose all of its stat experience.\n
    \n
    \n Augmentations will appear below as they become available.\n
    \n
    \n aug.name)}\n ownedAugNames={ownedAugNames}\n player={player}\n canPurchase={(player, aug) => {\n return player.money > aug.baseCost;\n }}\n purchaseAugmentation={(player, aug) => {\n props.sleeve.tryBuyAugmentation(player, aug);\n rerender();\n }}\n sleeveAugs\n />\n
    \n );\n}\n","import React from \"react\";\n\nimport { Augmentation } from \"../Augmentation\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { purchaseAugmentation } from \"../../Faction/FactionHelpers\";\nimport { isRepeatableAug } from \"../AugmentationHelpers\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n faction?: Faction;\n aug?: Augmentation;\n}\n\nexport function PurchaseAugmentationModal(props: IProps): React.ReactElement {\n if (typeof props.aug === \"undefined\" || typeof props.faction === \"undefined\") {\n return <>;\n }\n\n const player = use.Player();\n\n function buy(): void {\n if (!isRepeatableAug(props.aug as Augmentation) && player.hasAugmentation(props.aug as Augmentation)) {\n return;\n }\n\n purchaseAugmentation(props.aug as Augmentation, props.faction as Faction);\n props.onClose();\n }\n\n return (\n \n {props.aug.name}\n \n {props.aug.info}\n
    \n
    \n {props.aug.stats}\n
    \n
    \n Would you like to purchase the {props.aug.name} Augmentation for \n ?\n
    \n
    \n
    \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveBladeburnerWork } from \"../Work/SleeveBladeburnerWork\";\nimport { isSleeveRecoveryWork } from \"../Work/SleeveRecoveryWork\";\nimport { isSleeveSynchroWork } from \"../Work/SleeveSynchroWork\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveInfiltrateWork } from \"../Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../Work/SleeveSupportWork\";\nimport { ClassType } from \"../../../Work/ClassWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\n\nconst universitySelectorOptions: string[] = [\n \"Study Computer Science\",\n \"Data Structures\",\n \"Networks\",\n \"Algorithms\",\n \"Management\",\n \"Leadership\",\n];\n\nconst gymSelectorOptions: string[] = [\"Train Strength\", \"Train Defense\", \"Train Dexterity\", \"Train Agility\"];\n\nconst bladeburnerSelectorOptions: string[] = [\n \"Field analysis\",\n \"Recruitment\",\n \"Diplomacy\",\n \"Infiltrate synthoids\",\n \"Support main sleeve\",\n \"Take on contracts\",\n];\n\ninterface IProps {\n sleeve: Sleeve;\n player: IPlayer;\n setABC: (abc: string[]) => void;\n}\n\ninterface ITaskDetails {\n first: string[];\n second: (s1: string) => string[];\n}\n\nfunction possibleJobs(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all companies that other sleeves are working at\n const forbiddenCompanies: string[] = [];\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveCompanyWork(otherSleeve.currentWork)) {\n forbiddenCompanies.push(otherSleeve.currentWork.companyName);\n }\n }\n const allJobs: string[] = Object.keys(player.jobs);\n\n return allJobs.filter((company) => !forbiddenCompanies.includes(company));\n}\n\nfunction possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all factions that other sleeves are working for\n const forbiddenFactions = [FactionNames.Bladeburners as string, FactionNames.ShadowsOfAnarchy as string];\n if (player.gang) {\n forbiddenFactions.push(player.gang.facName);\n }\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveFactionWork(otherSleeve.currentWork)) {\n forbiddenFactions.push(otherSleeve.currentWork.factionName);\n }\n }\n\n const factions = [];\n for (const fac of player.factions) {\n if (!forbiddenFactions.includes(fac)) {\n factions.push(fac);\n }\n }\n\n return factions.filter((faction) => {\n const factionObj = Factions[faction];\n if (!factionObj) return false;\n const facInfo = factionObj.getInfo();\n return facInfo.offerHackingWork || facInfo.offerFieldWork || facInfo.offerSecurityWork;\n });\n}\n\nfunction possibleContracts(player: IPlayer, sleeve: Sleeve): string[] {\n const bb = player.bladeburner;\n if (bb === null) {\n return [\"------\"];\n }\n let contracts = bb.getContractNamesNetscriptFn();\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveBladeburnerWork(otherSleeve.currentWork) && otherSleeve.currentWork.actionType === \"Contracts\") {\n const w = otherSleeve.currentWork;\n contracts = contracts.filter((x) => x != w.actionName);\n }\n }\n if (contracts.length === 0) {\n return [\"------\"];\n }\n return contracts;\n}\n\nconst tasks: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => ITaskDetails);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Perform Bladeburner Actions\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n} = {\n \"------\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let jobs = possibleJobs(player, sleeve);\n\n if (jobs.length === 0) jobs = [\"------\"];\n return { first: jobs, second: () => [\"------\"] };\n },\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let factions = possibleFactions(player, sleeve);\n if (factions.length === 0) factions = [\"------\"];\n\n return {\n first: factions,\n second: (s1: string) => {\n const faction = Factions[s1];\n if (!faction) return [\"------\"];\n\n const facInfo = faction.getInfo();\n const options: string[] = [];\n if (facInfo.offerHackingWork) {\n options.push(\"Hacking Contracts\");\n }\n if (facInfo.offerFieldWork) {\n options.push(\"Field Work\");\n }\n if (facInfo.offerSecurityWork) {\n options.push(\"Security Work\");\n }\n return options;\n },\n };\n },\n \"Commit Crime\": (): ITaskDetails => {\n return { first: Object.values(Crimes).map((crime) => crime.name), second: () => [\"------\"] };\n },\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let universities: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n universities = [LocationName.AevumSummitUniversity];\n break;\n case CityName.Sector12:\n universities = [LocationName.Sector12RothmanUniversity];\n break;\n case CityName.Volhaven:\n universities = [LocationName.VolhavenZBInstituteOfTechnology];\n break;\n default:\n universities = [\"No university available in city!\"];\n break;\n }\n\n return { first: universitySelectorOptions, second: () => universities };\n },\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let gyms: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n gyms = [LocationName.AevumCrushFitnessGym, LocationName.AevumSnapFitnessGym];\n break;\n case CityName.Sector12:\n gyms = [LocationName.Sector12IronGym, LocationName.Sector12PowerhouseGym];\n break;\n case CityName.Volhaven:\n gyms = [LocationName.VolhavenMilleniumFitnessGym];\n break;\n default:\n gyms = [\"No gym available in city!\"];\n break;\n }\n\n return { first: gymSelectorOptions, second: () => gyms };\n },\n \"Perform Bladeburner Actions\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n return {\n first: bladeburnerSelectorOptions,\n second: (s1: string) => {\n if (s1 === \"Take on contracts\") {\n return possibleContracts(player, sleeve);\n } else {\n return [\"------\"];\n }\n },\n };\n },\n \"Shock Recovery\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n Synchronize: (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n};\n\nconst canDo: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => boolean);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Perform Bladeburner Actions\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n} = {\n \"------\": () => true,\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve) => possibleJobs(player, sleeve).length > 0,\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve) => possibleFactions(player, sleeve).length > 0,\n \"Commit Crime\": () => true,\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Perform Bladeburner Actions\": (player: IPlayer) => player.inBladeburner(),\n \"Shock Recovery\": (player: IPlayer, sleeve: Sleeve) => sleeve.shock < 100,\n Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,\n};\n\nfunction getABC(sleeve: Sleeve): [string, string, string] {\n const w = sleeve.currentWork;\n if (w === null) {\n return [\"------\", \"------\", \"------\"];\n }\n\n if (isSleeveCompanyWork(w)) {\n return [\"Work for Company\", w.companyName, \"------\"];\n }\n if (isSleeveFactionWork(w)) {\n let workType = \"\";\n switch (w.factionWorkType) {\n case FactionWorkType.HACKING:\n workType = \"Hacking Contracts\";\n break;\n case FactionWorkType.FIELD:\n workType = \"Field Work\";\n break;\n case FactionWorkType.SECURITY:\n workType = \"Security Work\";\n break;\n }\n return [\"Work for Faction\", w.factionName, workType];\n }\n if (isSleeveBladeburnerWork(w)) {\n if (w.actionType === \"Contracts\") {\n return [\"Perform Bladeburner Actions\", \"Take on contracts\", w.actionName];\n }\n switch (w.actionName) {\n case \"Field Analysis\":\n return [\"Perform Bladeburner Actions\", \"Field Analysis\", \"------\"];\n case \"Diplomacy\":\n return [\"Perform Bladeburner Actions\", \"Diplomacy\", \"------\"];\n case \"Recruitment\":\n return [\"Perform Bladeburner Actions\", \"Recruitment\", \"------\"];\n }\n }\n\n if (isSleeveClassWork(w)) {\n switch (w.classType) {\n case ClassType.StudyComputerScience:\n return [\"Take University Course\", \"Study Computer Science\", w.location];\n case ClassType.DataStructures:\n return [\"Take University Course\", \"Data Structures\", w.location];\n case ClassType.Networks:\n return [\"Take University Course\", \"Networks\", w.location];\n case ClassType.Algorithms:\n return [\"Take University Course\", \"Algorithms\", w.location];\n case ClassType.Management:\n return [\"Take University Course\", \"Management\", w.location];\n case ClassType.Leadership:\n return [\"Take University Course\", \"Leadership\", w.location];\n case ClassType.GymStrength:\n return [\"Workout at Gym\", \"Train Strength\", w.location];\n case ClassType.GymDefense:\n return [\"Workout at Gym\", \"Train Defense\", w.location];\n case ClassType.GymDexterity:\n return [\"Workout at Gym\", \"Train Dexterity\", w.location];\n case ClassType.GymAgility:\n return [\"Workout at Gym\", \"Train Agility\", w.location];\n }\n }\n if (isSleeveCrimeWork(w)) {\n return [\n \"Commit Crime\",\n Object.values(Crimes).find((crime) => crime.type === w.crimeType)?.name ?? \"Shoplift\",\n \"------\",\n ];\n }\n if (isSleeveSupportWork(w)) {\n return [\"Perform Bladeburner Actions\", \"Support main sleeve\", \"------\"];\n }\n if (isSleeveInfiltrateWork(w)) {\n return [\"Perform Bladeburner Actions\", \"Infiltrate synthoids\", \"------\"];\n }\n if (isSleeveRecoveryWork(w)) {\n return [\"Shock Recovery\", \"------\", \"------\"];\n }\n if (isSleeveSynchroWork(w)) {\n return [\"Synchronize\", \"------\", \"------\"];\n }\n\n return [\"------\", \"------\", \"------\"];\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const abc = getABC(props.sleeve);\n const [s0, setS0] = useState(abc[0]);\n const [s1, setS1] = useState(abc[1]);\n const [s2, setS2] = useState(abc[2]);\n\n const validActions = Object.keys(canDo).filter((k) =>\n (canDo[k] as (player: IPlayer, sleeve: Sleeve) => boolean)(props.player, props.sleeve),\n );\n\n const detailsF = tasks[s0];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(s1);\n\n if (details.first.length > 0 && !details.first.includes(s1)) {\n setS1(details.first[0]);\n props.setABC([s0, details.first[0], s2]);\n }\n if (details2.length > 0 && !details2.includes(s2)) {\n setS2(details2[0]);\n props.setABC([s0, s1, details2[0]]);\n }\n\n function onS0Change(event: SelectChangeEvent): void {\n const n = event.target.value;\n const detailsF = tasks[n];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(details.first[0]) ?? [\"------\"];\n setS2(details2[0]);\n setS1(details.first[0]);\n setS0(n);\n props.setABC([n, details.first[0], details2[0]]);\n }\n\n function onS1Change(event: SelectChangeEvent): void {\n setS1(event.target.value);\n props.setABC([s0, event.target.value, s2]);\n }\n\n function onS2Change(event: SelectChangeEvent): void {\n setS2(event.target.value);\n props.setABC([s0, s1, event.target.value]);\n }\n\n return (\n <>\n \n {!(details.first.length === 1 && details.first[0] === \"------\") && (\n <>\n \n \n )}\n {!(details2.length === 1 && details2[0] === \"------\") && (\n <>\n \n \n )}\n \n );\n}\n","import React from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { WorldMap } from \"../../../ui/React/WorldMap\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { use } from \"../../../ui/Context\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n const player = use.Player();\n function travel(city: string): void {\n if (!player.canAfford(CONSTANTS.TravelCost)) {\n dialogBoxCreate(\"You cannot afford to have this sleeve travel to another city\");\n }\n props.sleeve.city = city as CityName;\n player.loseMoney(CONSTANTS.TravelCost, \"sleeve\");\n props.sleeve.stopWork(player);\n props.rerender();\n props.onClose();\n }\n\n return (\n \n <>\n \n Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can\n study. Traveling to a different city costs . It will\n also set your current sleeve task to idle.\n \n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n \n ))\n ) : (\n travel(city)} />\n )}\n \n \n );\n}\n","import React from \"react\";\n\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FAQModal({ open, onClose }: IProps): React.ReactElement {\n return (\n \n <>\n How do Duplicate Sleeves work?\n
    \n \n Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working\n for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience,\n and reputation.\n \n
    \n
    \n \n Sleeves are their own individuals, which means they each have their own experience and stats.\n \n
    \n
    \n \n When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well\n as all of the player's other sleeves.\n \n
    \n
    \n What is Synchronization (Sync)?\n
    \n \n Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a\n numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing\n a task.\n \n
    \n
    \n \n Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve\n and the player's original host consciousness earn N% of the amount of experience normally earned by the task.\n All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience.\n \n
    \n
    \n Synchronization can be increased by assigning sleeves to the 'Synchronize' task.\n
    \n
    \n What is Shock?\n
    \n \n Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a\n numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the\n amount of experience earned by the sleeve.\n \n
    \n
    \n \n Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning\n sleeves to the 'Shock Recovery' task.\n \n
    \n
    \n Why can't I work for this company or faction?\n
    \n \n Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two\n sleeves they can work for two different companies, but they cannot both work for the same company.\n \n
    \n
    \n Why did my Sleeve stop working?\n
    \n \n Sleeves are subject to the same time restrictions as you. This means that they automatically stop working at a\n company after 8 hours, and stop working for a faction after 20 hours.\n \n
    \n
    \n How do I buy Augmentations for my Sleeves?\n
    \n Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it.\n
    \n
    \n Why can't I buy the X Augmentation for my sleeve?\n
    \n \n Certain Augmentations, like {FactionNames.Bladeburners}-specific ones and NeuroFlux Governor, are not\n available for sleeves.\n \n
    \n
    \n Do sleeves get reset when installing Augmentations or switching BitNodes?\n
    \n Sleeves are reset when switching BitNodes, but not when installing Augmentations.\n
    \n
    \n What is Memory?\n
    \n \n Sleeve memory dictates what a sleeve's synchronization will be when it's reset by switching BitNodes. For\n example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be\n set to 25, rather than 1.\n \n
    \n
    \n \n Memory can only be increased by purchasing upgrades from {FactionNames.TheCovenant}. It is a persistent stat,\n meaning it never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.\n \n \n
    \n );\n}\n","/**\n * Root React Component for the Hacknet Node UI\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { GeneralInfo } from \"./GeneralInfo\";\nimport { HacknetNodeElem } from \"./HacknetNodeElem\";\nimport { HacknetServerElem } from \"./HacknetServerElem\";\nimport { HacknetNode } from \"../HacknetNode\";\nimport { HacknetServer } from \"../HacknetServer\";\nimport { HashUpgradeModal } from \"./HashUpgradeModal\";\nimport { MultiplierButtons } from \"./MultiplierButtons\";\nimport { PlayerInfo } from \"./PlayerInfo\";\nimport { PurchaseButton } from \"./PurchaseButton\";\nimport { PurchaseMultipliers } from \"../data/Constants\";\n\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport { Box } from \"@mui/material\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function HacknetRoot(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [purchaseMultiplier, setPurchaseMultiplier] = useState(PurchaseMultipliers.x1);\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n let totalProduction = 0;\n for (let i = 0; i < props.player.hacknetNodes.length; ++i) {\n const node = props.player.hacknetNodes[i];\n if (hasHacknetServers(props.player)) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n if (hserver) {\n totalProduction += hserver.hashRate;\n } else {\n console.warn(`Could not find Hacknet Server object in AllServers map (i=${i})`);\n }\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n totalProduction += node.moneyGainRatePerSecond;\n }\n }\n\n function handlePurchaseButtonClick(): void {\n purchaseHacknet(props.player);\n rerender();\n }\n\n // Cost to purchase a new Hacknet Node\n let purchaseCost;\n if (hasHacknetServers(props.player)) {\n purchaseCost = getCostOfNextHacknetServer(props.player);\n } else {\n purchaseCost = getCostOfNextHacknetNode(props.player);\n }\n\n // onClick event handlers for purchase multiplier buttons\n const purchaseMultiplierOnClicks = [\n () => setPurchaseMultiplier(PurchaseMultipliers.x1),\n () => setPurchaseMultiplier(PurchaseMultipliers.x5),\n () => setPurchaseMultiplier(PurchaseMultipliers.x10),\n () => setPurchaseMultiplier(PurchaseMultipliers.MAX),\n ];\n\n // HacknetNode components\n const nodes = props.player.hacknetNodes.map((node: string | HacknetNode) => {\n if (hasHacknetServers(props.player)) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (hserver == null) {\n throw new Error(`Could not find Hacknet Server object in AllServers map for IP: ${node}`);\n }\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n return (\n \n );\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n return (\n \n );\n }\n });\n\n return (\n <>\n Hacknet {hasHacknetServers(props.player) ? \"Servers\" : \"Nodes\"}\n \n\n \n\n
    \n\n \n \n \n \n \n \n \n \n\n {hasHacknetServers(props.player) && }\n\n {nodes}\n setOpen(false)} />\n \n );\n}\n","/**\n * React Component for the Hacknet Node UI\n *\n * Displays general information about Hacknet Nodes\n */\nimport React from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n hasHacknetServers: boolean;\n}\n\nexport function GeneralInfo(props: IProps): React.ReactElement {\n return (\n <>\n \n The Hacknet is a global, decentralized network of machines. It is used by hackers all around the world to\n anonymously share computing power and perform distributed cyberattacks without the fear of being traced.\n \n {!props.hasHacknetServers ? (\n <>\n \n {`Here, you can purchase a Hacknet Node, a specialized machine that can connect ` +\n `and contribute its resources to the Hacknet network. This allows you to take ` +\n `a small percentage of profits from hacks performed on the network. Essentially, ` +\n `you are renting out your Node's computing power.`}\n \n \n {`Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node ` +\n `can be upgraded in order to increase its computing power and thereby increase ` +\n `the profit you earn from it.`}\n \n \n ) : (\n <>\n \n {`Here, you can purchase a Hacknet Server, an upgraded version of the Hacknet Node. ` +\n `Hacknet Servers will perform computations and operations on the network, earning ` +\n `you hashes. Hashes can be spent on a variety of different upgrades.`}\n \n \n {`Hacknet Servers can also be used as servers to run scripts. However, running scripts ` +\n `on a server will reduce its hash rate (hashes generated per second). A Hacknet Server's hash ` +\n `rate will be reduced by the percentage of RAM that is being used by that Server to run ` +\n `scripts.`}\n \n \n )}\n \n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetNodeConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { HacknetNode } from \"../HacknetNode\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateMoneyGainRate } from \"../formulas/HacknetNodes\";\n\ninterface IProps {\n node: HacknetNode;\n purchaseMultiplier: number | \"MAX\";\n rerender: () => void;\n player: IPlayer;\n}\n\nexport function HacknetNodeElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetNodeConstants.MaxLevel) {\n upgradeLevelButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(props.player, node, HacknetNodeConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(node.level + multiplier, node.ram, node.cores, props.player.mults.hacknet_node_money) -\n node.moneyGainRatePerSecond;\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.mults.hacknet_node_level_cost);\n upgradeLevelButton = (\n \n +\n \n }\n >\n \n \n );\n }\n function upgradeLevelOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\"\n ? getMaxNumberLevelUpgrades(props.player, node, HacknetNodeConstants.MaxLevel)\n : purchaseMult;\n purchaseLevelUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n\n let upgradeRAMButton;\n if (node.ram >= HacknetNodeConstants.MaxRam) {\n upgradeRAMButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(props.player, node, HacknetNodeConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetNodeConstants.MaxRam / node.ram));\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(\n node.level,\n node.ram * Math.pow(2, multiplier),\n node.cores,\n props.player.mults.hacknet_node_money,\n ) - node.moneyGainRatePerSecond;\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.mults.hacknet_node_ram_cost);\n upgradeRAMButton = (\n \n +\n \n }\n >\n \n \n );\n }\n function upgradeRamOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\" ? getMaxNumberRamUpgrades(props.player, node, HacknetNodeConstants.MaxRam) : purchaseMult;\n purchaseRamUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n\n function upgradeCoresOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\"\n ? getMaxNumberCoreUpgrades(props.player, node, HacknetNodeConstants.MaxCores)\n : purchaseMult;\n purchaseCoreUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n let upgradeCoresButton;\n if (node.cores >= HacknetNodeConstants.MaxCores) {\n upgradeCoresButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(props.player, node, HacknetNodeConstants.MaxCores);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(node.level, node.ram, node.cores + multiplier, props.player.mults.hacknet_node_money) -\n node.moneyGainRatePerSecond;\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.mults.hacknet_node_core_cost);\n upgradeCoresButton = (\n \n +\n \n }\n >\n \n \n );\n }\n\n return (\n \n \n \n \n \n {node.name}\n \n \n \n \n Production:\n \n \n \n (\n )\n \n \n \n \n \n Level:\n \n \n {node.level}\n \n {upgradeLevelButton}\n \n \n \n RAM:\n \n \n {numeralWrapper.formatRAM(node.ram)}\n \n {upgradeRAMButton}\n \n \n \n Cores:\n \n \n {node.cores}\n \n {upgradeCoresButton}\n \n \n
    \n
    \n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetServerConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n getMaxNumberCacheUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n updateHashManagerCapacity,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { HacknetServer } from \"../HacknetServer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateHashGainRate } from \"../formulas/HacknetServers\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n node: HacknetServer;\n purchaseMultiplier: number | string;\n rerender: () => void;\n player: IPlayer;\n}\n\nexport function HacknetServerElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetServerConstants.MaxLevel) {\n upgradeLevelButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(props.player, node, HacknetServerConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetServerConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(\n node.level + multiplier,\n 0,\n node.maxRam,\n node.cores,\n props.player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.mults.hacknet_node_level_cost);\n upgradeLevelButton = (\n \n + (effective increase, taking current RAM usage into account)\n
    \n \n +\n {\" \"}\n (base increase, attained when no script is running)\n \n }\n >\n \n \n );\n }\n function upgradeLevelOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberLevelUpgrades(props.player, node, HacknetServerConstants.MaxLevel);\n }\n purchaseLevelUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n\n function upgradeRamOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberRamUpgrades(props.player, node, HacknetServerConstants.MaxRam);\n }\n purchaseRamUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n // Upgrade RAM Button\n let upgradeRamButton;\n if (node.maxRam >= HacknetServerConstants.MaxRam) {\n upgradeRamButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(props.player, node, HacknetServerConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetServerConstants.MaxRam / node.maxRam));\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(\n node.level,\n 0,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n props.player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n\n const modded_increase =\n calculateHashGainRate(\n node.level,\n node.ramUsed,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n props.player.mults.hacknet_node_money,\n ) -\n calculateHashGainRate(node.level, node.ramUsed, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.mults.hacknet_node_ram_cost);\n upgradeRamButton = (\n \n + (effective increase, taking current RAM usage into account)\n
    \n \n +\n {\" \"}\n (base increase, attained when no script is running)\n \n }\n >\n \n \n );\n }\n\n function upgradeCoresOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCoreUpgrades(props.player, node, HacknetServerConstants.MaxCores);\n }\n purchaseCoreUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n // Upgrade Cores Button\n let upgradeCoresButton;\n if (node.cores >= HacknetServerConstants.MaxCores) {\n upgradeCoresButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(props.player, node, HacknetServerConstants.MaxCores);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(\n node.level,\n 0,\n node.maxRam,\n node.cores + multiplier,\n props.player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.mults.hacknet_node_core_cost);\n upgradeCoresButton = (\n \n + (effective increase, taking current RAM usage into account)\n
    \n \n +\n {\" \"}\n (base increase, attained when no script is running)\n \n }\n >\n \n \n );\n }\n\n // Upgrade Cache button\n let upgradeCacheButton;\n if (node.cache >= HacknetServerConstants.MaxCache) {\n upgradeCacheButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCacheUpgrades(props.player, node, HacknetServerConstants.MaxCache);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCache - node.cache;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase = 32 * Math.pow(2, node.cache + multiplier) - node.hashCapacity;\n const upgradeCacheCost = node.calculateCacheUpgradeCost(multiplier);\n upgradeCacheButton = (\n \n + hashes\n \n }\n >\n \n \n );\n if (props.player.money < upgradeCacheCost) {\n } else {\n }\n }\n function upgradeCacheOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCacheUpgrades(props.player, node, HacknetServerConstants.MaxCache);\n }\n purchaseCacheUpgrade(props.player, node, numUpgrades as number);\n rerender();\n updateHashManagerCapacity(props.player);\n }\n\n return (\n \n \n \n \n \n {node.hostname}\n \n \n \n \n Production:\n \n \n \n hashes produced by this server since last augment\n installation.\n
    \n current production rate.\n
    \n \n \n {\" \"}\n max production rate. (achieved when 100% RAM is allocated to it)\n
    \n {numeralWrapper.formatRAM(node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * node.ramUsed) / node.maxRam)}%) RAM allocated to script.\n
    \n {numeralWrapper.formatRAM(node.maxRam - node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * (node.maxRam - node.ramUsed)) / node.maxRam)}%) RAM allocated to hash production.\n \n }\n >\n \n ()\n \n \n
    \n
    \n \n \n Hash Capacity:\n \n \n \n \n \n \n \n \n \n Level:\n \n \n {node.level}\n \n {upgradeLevelButton}\n \n \n \n RAM:\n \n \n {numeralWrapper.formatRAM(node.maxRam)}\n \n {upgradeRamButton}\n \n \n \n Cores:\n \n \n {node.cores}\n \n {upgradeCoresButton}\n \n \n \n Cache Level:\n \n \n {node.cache}\n \n {upgradeCacheButton}\n \n
    \n
    \n
    \n );\n}\n","/**\n * Create the pop-up for purchasing upgrades with hashes\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrades } from \"../HashUpgrades\";\n\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HacknetUpgradeElem } from \"./HacknetUpgradeElem\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function HashUpgradeModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n const hashManager = player.hashManager;\n if (!(hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager)`);\n }\n\n return (\n \n <>\n Spend your hashes on a variety of different upgrades\n \n Hashes: \n \n {Object.keys(HashUpgrades).map((upgName) => {\n const upg = HashUpgrades[upgName];\n return (\n \n );\n })}\n \n \n );\n}\n","import React, { useState } from \"react\";\n\nimport { purchaseHashUpgrade } from \"../HacknetHelpers\";\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrade } from \"../HashUpgrade\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { ServerDropdown, ServerType } from \"../../ui/React/ServerDropdown\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { SelectChangeEvent } from \"@mui/material/Select\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\ninterface IProps {\n player: IPlayer;\n hashManager: HashManager;\n upg: HashUpgrade;\n rerender: () => void;\n}\n\nconst serversMap: { [key: string]: string } = {};\n\nexport function HacknetUpgradeElem(props: IProps): React.ReactElement {\n const [selectedServer, setSelectedServer] = useState(\n serversMap[props.upg.name] ? serversMap[props.upg.name] : FactionNames.ECorp.toLowerCase(),\n );\n function changeTargetServer(event: SelectChangeEvent): void {\n setSelectedServer(event.target.value);\n serversMap[props.upg.name] = event.target.value;\n }\n\n function purchase(): void {\n const canPurchase = props.hashManager.hashes >= props.hashManager.getUpgradeCost(props.upg.name);\n if (canPurchase) {\n const res = purchaseHashUpgrade(props.player, props.upg.name, selectedServer);\n if (!res) {\n dialogBoxCreate(\n \"Failed to purchase upgrade. This may be because you do not have enough hashes, \" +\n \"or because you do not have access to the feature upgrade affects.\",\n );\n }\n props.rerender();\n }\n }\n\n const hashManager = props.hashManager;\n const upg = props.upg;\n const cost = hashManager.getUpgradeCost(upg.name);\n const level = hashManager.upgrades[upg.name];\n const effect = upg.effectText(level);\n\n // Purchase button\n const canPurchase = hashManager.hashes >= cost;\n\n // We'll reuse a Bladeburner css class\n return (\n \n \n \n \n \n Cost: , Bought: {level} times\n \n\n {upg.desc}\n {!upg.hasTargetServer && (\n \n )}\n {upg.hasTargetServer && (\n \n )}\n {level > 0 && effect && {effect}}\n \n );\n}\n","/**\n * React Component for the Multiplier buttons on the Hacknet page.\n * These buttons let the player control how many Nodes/Upgrades they're\n * purchasing when using the UI (x1, x5, x10, MAX)\n */\nimport React from \"react\";\n\nimport { PurchaseMultipliers } from \"../data/Constants\";\nimport Button from \"@mui/material/Button\";\n\ninterface IMultiplierProps {\n disabled: boolean;\n onClick: () => void;\n text: string;\n}\n\nfunction MultiplierButton(props: IMultiplierProps): React.ReactElement {\n return (\n \n );\n}\n\ninterface IProps {\n purchaseMultiplier: number | string;\n onClicks: (() => void)[];\n}\n\nexport function MultiplierButtons(props: IProps): React.ReactElement {\n if (props.purchaseMultiplier == null) {\n throw new Error(`MultiplierButtons constructed without required props`);\n }\n\n const mults = [\"x1\", \"x5\", \"x10\", \"MAX\"];\n const onClicks = props.onClicks;\n const buttons = [];\n for (let i = 0; i < mults.length; ++i) {\n const mult = mults[i];\n const btnProps = {\n disabled: props.purchaseMultiplier === PurchaseMultipliers[mult],\n onClick: onClicks[i],\n text: mult,\n };\n\n buttons.push();\n }\n\n return <>{buttons};\n}\n","/**\n * React Component for displaying Player info and stats on the Hacknet Node UI.\n * This includes:\n * - Player's money\n * - Player's production from Hacknet Nodes\n */\nimport React from \"react\";\n\nimport { hasHacknetServers } from \"../HacknetHelpers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n totalProduction: number;\n player: IPlayer;\n}\n\nexport function PlayerInfo(props: IProps): React.ReactElement {\n const hasServers = hasHacknetServers(props.player);\n\n let prod;\n if (hasServers) {\n prod = ;\n } else {\n prod = ;\n }\n\n return (\n <>\n \n Money:\n \n \n\n {hasServers && (\n <>\n \n Hashes: /{\" \"}\n \n \n \n )}\n\n \n Total Hacknet {hasServers ? \"Server\" : \"Node\"} Production: {prod}\n \n \n );\n}\n","/**\n * React Component for the button that is used to purchase new Hacknet Nodes\n */\nimport React from \"react\";\n\nimport { hasHacknetServers, hasMaxNumberHacknetServers } from \"../HacknetHelpers\";\nimport { Player } from \"../../Player\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n multiplier: number | string;\n onClick: () => void;\n cost: number;\n}\n\nexport function PurchaseButton(props: IProps): React.ReactElement {\n const cost = props.cost;\n let text;\n if (hasHacknetServers(Player)) {\n if (hasMaxNumberHacknetServers(Player)) {\n text = <>Hacknet Server limit reached;\n } else {\n text = (\n <>\n Purchase Hacknet Server - \n \n \n );\n }\n } else {\n text = (\n <>\n Purchase Hacknet Node - \n \n \n );\n }\n\n return (\n \n );\n}\n","/**\n * React Component for displaying a location's UI\n *\n * This is a \"router\" component of sorts, meaning it deduces the type of\n * location that is being rendered and then creates the proper component(s) for that.\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { CompanyLocation } from \"./CompanyLocation\";\nimport { GymLocation } from \"./GymLocation\";\nimport { HospitalLocation } from \"./HospitalLocation\";\nimport { SlumsLocation } from \"./SlumsLocation\";\nimport { SpecialLocation } from \"./SpecialLocation\";\nimport { TechVendorLocation } from \"./TechVendorLocation\";\nimport { TravelAgencyRoot } from \"./TravelAgencyRoot\";\nimport { UniversityLocation } from \"./UniversityLocation\";\nimport { CasinoLocation } from \"./CasinoLocation\";\n\nimport { Location } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { isBackdoorInstalled } from \"../../Server/ServerHelpers\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { use } from \"../../ui/Context\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Tooltip } from \"@mui/material\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function GenericLocation({ loc }: IProps): React.ReactElement {\n const router = use.Router();\n const player = use.Player();\n /**\n * Determine what needs to be rendered for this location based on the locations\n * type. Returns an array of React components that should be rendered\n */\n function getLocationSpecificContent(): React.ReactNode[] {\n const content: React.ReactNode[] = [];\n\n if (loc.types.includes(LocationType.Company)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Gym)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Hospital)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Slums)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Special)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.TechVendor)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.TravelAgency)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.University)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Casino)) {\n content.push();\n }\n\n return content;\n }\n\n const locContent: React.ReactNode[] = getLocationSpecificContent();\n const serverMeta = serverMetadata.find((s) => s.specialName === loc.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n\n const backdoorInstalled = server !== null && isBackdoorInstalled(server);\n\n return (\n <>\n \n \n {backdoorInstalled && !Settings.DisableTextEffects ? (\n \n \n \n \n \n ) : (\n loc.name\n )}\n \n {locContent}\n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a company\n *\n * This subcomponent renders all of the buttons for applying to jobs at a company\n */\nimport React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nimport { ApplyToJobButton } from \"./ApplyToJobButton\";\n\nimport { Locations } from \"../Locations\";\nimport { LocationName } from \"../data/LocationNames\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { use } from \"../../ui/Context\";\nimport { QuitJobModal } from \"../../Company/ui/QuitJobModal\";\nimport { CompanyWork } from \"../../Work/CompanyWork\";\n\ntype IProps = {\n locName: LocationName;\n};\n\nexport function CompanyLocation(props: IProps): React.ReactElement {\n const p = use.Player();\n const router = use.Router();\n const [quitOpen, setQuitOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n /**\n * We'll keep a reference to the Company that this component is being rendered for,\n * so we don't have to look it up every time\n */\n const company = Companies[props.locName];\n if (company == null) throw new Error(`CompanyLocation component constructed with invalid company: ${props.locName}`);\n\n /**\n * Reference to the Location that this component is being rendered for\n */\n const location = Locations[props.locName];\n if (location == null) {\n throw new Error(`CompanyLocation component constructed with invalid location: ${props.locName}`);\n }\n\n /**\n * Name of company position that player holds, if applicable\n */\n const jobTitle = p.jobs[props.locName] ? p.jobs[props.locName] : null;\n\n /**\n * CompanyPosition object for the job that the player holds at this company\n * (if he has one)\n */\n const companyPosition = jobTitle ? CompanyPositions[jobTitle] : null;\n\n p.location = props.locName;\n\n function applyForAgentJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForAgentJob();\n rerender();\n }\n\n function applyForBusinessConsultantJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForBusinessConsultantJob();\n rerender();\n }\n\n function applyForBusinessJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForBusinessJob();\n rerender();\n }\n\n function applyForEmployeeJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForEmployeeJob();\n rerender();\n }\n\n function applyForItJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForItJob();\n rerender();\n }\n\n function applyForPartTimeEmployeeJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForPartTimeEmployeeJob();\n rerender();\n }\n\n function applyForPartTimeWaiterJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForPartTimeWaiterJob();\n rerender();\n }\n\n function applyForSecurityJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSecurityJob();\n rerender();\n }\n\n function applyForSoftwareConsultantJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSoftwareConsultantJob();\n rerender();\n }\n\n function applyForSoftwareJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSoftwareJob();\n rerender();\n }\n\n function applyForWaiterJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForWaiterJob();\n rerender();\n }\n\n function startInfiltration(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n const loc = location;\n if (!loc.infiltrationData)\n throw new Error(`trying to start infiltration at ${props.locName} but the infiltrationData is null`);\n\n router.toInfiltration(loc);\n }\n\n function work(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n\n const pos = companyPosition;\n if (pos instanceof CompanyPosition) {\n p.startWork(\n new CompanyWork({\n singularity: false,\n companyName: props.locName,\n }),\n );\n p.startFocusing();\n router.toWork();\n }\n }\n\n const isEmployedHere = jobTitle != null;\n const favorGain = company.getFavorGain();\n\n return (\n <>\n {isEmployedHere && (\n <>\n Job Title: {jobTitle}\n -------------------------\n \n \n You will have company favor upon resetting after\n installing Augmentations\n \n }\n >\n \n Company reputation: \n \n \n \n -------------------------\n \n \n Company favor increases the rate at which you earn reputation for this company by 1% per favor.\n Company favor is gained whenever you reset after installing Augmentations. The amount of favor you\n gain depends on how much reputation you have with the company.\n \n }\n >\n \n Company Favor: \n \n \n \n -------------------------\n
    \n \n )}\n \n {isEmployedHere && (\n \n \n \n setQuitOpen(false)}\n />\n \n )}\n {company.hasAgentPositions() && (\n \n )}\n {company.hasBusinessConsultantPositions() && (\n \n )}\n {company.hasBusinessPositions() && (\n \n )}\n {company.hasEmployeePositions() && (\n \n )}\n {company.hasEmployeePositions() && (\n \n )}\n {company.hasITPositions() && (\n \n )}\n {company.hasSecurityPositions() && (\n \n )}\n {company.hasSoftwareConsultantPositions() && (\n \n )}\n {company.hasSoftwarePositions() && (\n \n )}\n {company.hasWaiterPositions() && (\n \n )}\n {company.hasWaiterPositions() && (\n \n )}\n {location.infiltrationData != null && }\n \n \n );\n}\n","import React from \"react\";\nimport { Company } from \"../Company\";\nimport { use } from \"../../ui/Context\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n locName: string;\n company: Company;\n onQuit: () => void;\n}\n\nexport function QuitJobModal(props: IProps): React.ReactElement {\n const player = use.Player();\n function quit(): void {\n player.quitJob(props.locName);\n props.onQuit();\n props.onClose();\n }\n\n return (\n \n Would you like to quit your job at {props.company.name}?\n
    \n
    \n \n
    \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Box } from \"@mui/material\";\nimport { ClassWork, ClassType, Classes } from \"../../Work/ClassWork\";\nimport { calculateCost } from \"../../Work/formulas/Class\";\n\ntype IProps = {\n loc: Location;\n p: IPlayer;\n router: IRouter;\n};\n\nexport function GymLocation(props: IProps): React.ReactElement {\n function train(stat: ClassType): void {\n props.p.startWork(\n new ClassWork({\n classType: stat,\n location: props.loc.name,\n singularity: false,\n }),\n );\n props.p.startFocusing();\n props.router.toWork();\n }\n\n const cost = calculateCost(Classes[ClassType.GymStrength], props.loc);\n\n return (\n \n \n \n \n \n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a hospital\n *\n * This subcomponent renders all of the buttons for hospital options\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\n\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ntype IProps = {\n p: IPlayer;\n};\n\ntype IState = {\n currHp: number;\n};\n\nexport class HospitalLocation extends React.Component {\n /**\n * Stores button styling that sets them all to block display\n */\n btnStyle = { display: \"block\" };\n\n constructor(props: IProps) {\n super(props);\n\n this.getCost = this.getCost.bind(this);\n this.getHealed = this.getHealed.bind(this);\n\n this.state = {\n currHp: this.props.p.hp.current,\n };\n }\n\n getCost(): number {\n return getHospitalizationCost(this.props.p);\n }\n\n getHealed(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n\n if (this.props.p.hp.current < 0) {\n this.props.p.hp.current = 0;\n }\n if (this.props.p.hp.current >= this.props.p.hp.max) {\n return;\n }\n\n const cost = this.getCost();\n this.props.p.loseMoney(cost, \"hospitalization\");\n this.props.p.hp.current = this.props.p.hp.max;\n\n // This just forces a re-render to update the cost\n this.setState({\n currHp: this.props.p.hp.current,\n });\n\n dialogBoxCreate(\n <>\n You were healed to full health! The hospital billed you for \n ,\n );\n }\n\n render(): React.ReactNode {\n const cost = this.getCost();\n\n return (\n \n );\n }\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a slum\n *\n * This subcomponent renders all of the buttons for committing crimes\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { use } from \"../../ui/Context\";\nimport { Box } from \"@mui/material\";\n\nexport function SlumsLocation(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n function shoplift(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Shoplift.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function robStore(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.RobStore.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function mug(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Mug.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function larceny(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Larceny.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function dealDrugs(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.DealDrugs.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function bondForgery(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.BondForgery.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function traffickArms(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.TraffickArms.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function homicide(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Homicide.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function grandTheftAuto(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.GrandTheftAuto.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function kidnap(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Kidnap.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function assassinate(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Assassination.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function heist(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Heist.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n const shopliftChance = Crimes.Shoplift.successRate(player);\n const robStoreChance = Crimes.RobStore.successRate(player);\n const mugChance = Crimes.Mug.successRate(player);\n const larcenyChance = Crimes.Larceny.successRate(player);\n const drugsChance = Crimes.DealDrugs.successRate(player);\n const bondChance = Crimes.BondForgery.successRate(player);\n const armsChance = Crimes.TraffickArms.successRate(player);\n const homicideChance = Crimes.Homicide.successRate(player);\n const gtaChance = Crimes.GrandTheftAuto.successRate(player);\n const kidnapChance = Crimes.Kidnap.successRate(player);\n const assassinateChance = Crimes.Assassination.successRate(player);\n const heistChance = Crimes.Heist.successRate(player);\n\n return (\n \n Attempt to shoplift from a low-end retailer}>\n \n \n Attempt to commit armed robbery on a high-end store}>\n \n \n Attempt to mug a random person on the street}>\n \n \n Attempt to rob property from someone's house}>\n \n \n Attempt to deal drugs}>\n \n \n Attempt to forge corporate bonds}>\n \n \n Attempt to smuggle illegal arms into the city}>\n \n \n Attempt to murder a random person on the street}>\n \n \n Attempt to commit grand theft auto}>\n \n \n Attempt to kidnap and ransom a high-profile-target}>\n \n \n Attempt to assassinate a high-profile target}>\n \n \n Attempt to pull off the ultimate heist}>\n \n \n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location has special\n * actions/options/properties\n *\n * Examples:\n * - Bladeburner @ NSA\n * - Re-sleeving @ VitaLife\n * - Create Corporation @ City Hall\n *\n * This subcomponent creates all of the buttons for interacting with those special\n * properties\n */\nimport React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\nimport { CreateCorporationModal } from \"../../Corporation/ui/modals/CreateCorporationModal\";\nimport { LocationName } from \"../data/LocationNames\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\n\nimport { use } from \"../../ui/Context\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { N00dles } from \"../../utils/helpers/N00dles\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { ArcadeRoot } from \"../../Arcade/ui/ArcadeRoot\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function SpecialLocation(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n const inBladeburner = player.inBladeburner();\n\n /**\n * Click handler for Bladeburner button at Sector-12 NSA\n */\n function handleBladeburner(): void {\n const p = player;\n if (p.inBladeburner()) {\n // Enter Bladeburner division\n router.toBladeburner();\n } else if (\n p.skills.strength >= 100 &&\n p.skills.defense >= 100 &&\n p.skills.dexterity >= 100 &&\n p.skills.agility >= 100\n ) {\n // Apply for Bladeburner division\n p.startBladeburner();\n dialogBoxCreate(\"You have been accepted into the Bladeburner division!\");\n setRerender((old) => !old);\n\n const worldHeader = document.getElementById(\"world-menu-header\");\n if (worldHeader instanceof HTMLElement) {\n worldHeader.click();\n worldHeader.click();\n }\n } else {\n dialogBoxCreate(\"Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)\");\n }\n }\n\n /**\n * Click handler for Resleeving button at New Tokyo VitaLife\n */\n function handleGrafting(): void {\n router.toGrafting();\n }\n\n function renderBladeburner(): React.ReactElement {\n if (!player.canAccessBladeburner()) {\n return <>;\n }\n const text = inBladeburner ? \"Enter Bladeburner Headquarters\" : \"Apply to Bladeburner Division\";\n return (\n <>\n
    \n \n \n );\n }\n\n function renderNoodleBar(): React.ReactElement {\n function EatNoodles(): void {\n SnackbarEvents.emit(\"You ate some delicious noodles and feel refreshed\", ToastVariant.SUCCESS, 2000);\n N00dles(); // This is the true power of the noodles.\n if (player.sourceFiles.length > 0) player.giveExploit(Exploit.N00dles);\n if (player.sourceFileLvl(5) > 0 || player.bitNodeN === 5) {\n player.exp.intelligence *= 1.0000000000000002;\n }\n player.exp.hacking *= 1.0000000000000002;\n player.exp.strength *= 1.0000000000000002;\n player.exp.defense *= 1.0000000000000002;\n player.exp.agility *= 1.0000000000000002;\n player.exp.dexterity *= 1.0000000000000002;\n player.exp.charisma *= 1.0000000000000002;\n for (const node of player.hacknetNodes) {\n if (node instanceof HacknetNode) {\n player.gainMoney(node.moneyGainRatePerSecond * 0.001, \"other\");\n } else {\n const server = GetServer(node);\n if (!(server instanceof HacknetServer)) throw new Error(`Server ${node} is not a hacknet server.`);\n player.hashManager.storeHashes(server.hashRate * 0.001);\n }\n }\n\n if (player.bladeburner) {\n player.bladeburner.rank += 0.00001;\n }\n\n if (player.corporation) {\n player.corporation.funds += player.corporation.revenue * 0.01;\n }\n }\n\n return (\n <>\n
    \n \n \n );\n }\n\n function CreateCorporation(): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (!player.canAccessCorporation()) {\n return (\n <>\n \n A businessman is yelling at a clerk. You should come back later.\n \n \n );\n }\n return (\n <>\n \n setOpen(false)} />\n \n );\n }\n\n function renderGrafting(): React.ReactElement {\n if (!player.canAccessGrafting()) {\n return <>;\n }\n return (\n \n );\n }\n\n function handleCotMG(): void {\n const faction = Factions[FactionNames.ChurchOfTheMachineGod];\n if (!player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n joinFaction(faction);\n }\n if (\n !player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1) &&\n !player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n }\n\n router.toStaneksGift();\n }\n\n function renderCotMG(): React.ReactElement {\n const toStanek = ;\n // prettier-ignore\n const symbol = \n {\" `` \"}
    \n {\" -odmmNmds: \"}
    \n {\" `hNmo:..-omNh. \"}
    \n {\" yMd` `hNh \"}
    \n {\" mMd oNm \"}
    \n {\" oMNo .mM/ \"}
    \n {\" `dMN+ -mM+ \"}
    \n {\" -mMNo -mN+ \"}
    \n {\" .+- :mMNo/mN/ \"}
    \n {\":yNMd. :NMNNN/ \"}
    \n {\"-mMMMh. /NMMh` \"}
    \n {\" .dMMMd. /NMMMy` \"}
    \n {\" `yMMMd. /NNyNMMh` \"}
    \n {\" `sMMMd. +Nm: +NMMh. \"}
    \n {\" oMMMm- oNm: /NMMd. \"}
    \n {\" +NMMmsMm- :mMMd. \"}
    \n {\" /NMMMm- -mMMd. \"}
    \n {\" /MMMm- -mMMd. \"}
    \n {\" `sMNMMm- .mMmo \"}
    \n {\" `sMd:hMMm. ./. \"}
    \n {\" `yMy` `yNMd` \"}
    \n {\" `hMs` oMMy \"}
    \n {\" `hMh sMN- \"}
    \n {\" /MM- .NMo \"}
    \n {\" +MM: :MM+ \"}
    \n {\" sNNo-.`.-omNy` \"}
    \n {\" -smNNNNmdo- \"}
    \n {\" `..` \"}
    \n if (player.hasAugmentation(AugmentationNames.StaneksGift3, true)) {\n return (\n <>\n \n \n Allison \"Mother\" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer\n look at you. Yes wonderful, I see my creation has taken root without consquence or much ill effect it\n seems. Curious, Just how much of a machine's soul do you house in that body?\n \n \n
    \n {toStanek}\n
    \n {symbol}\n \n );\n }\n if (player.hasAugmentation(AugmentationNames.StaneksGift2, true)) {\n return (\n <>\n \n \n Allison \"Mother\" Stanek: I see you've taken to my creation. So much that it could hardly be recognized as\n one of my own after your tinkering with it. I see you follow the ways of the Machine God as I do, and your\n mastery of the gift clearly demonstrates that. My hopes are climbing by the day for you.\n \n \n
    \n {toStanek}\n
    \n {symbol}\n \n );\n }\n if (player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n return (\n <>\n \n Allison \"Mother\" Stanek: Welcome back my child!\n \n
    \n {toStanek}\n
    \n {symbol}\n \n );\n }\n\n if (!player.canAccessCotMG()) {\n return (\n <>\n \n A decrepit altar stands in the middle of a dilapidated church.\n
    \n
    A symbol is carved in the altar.\n
    \n
    \n {symbol}\n \n );\n }\n\n if (\n player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0 ||\n player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0\n ) {\n return (\n <>\n \n \n Allison \"Mother\" Stanek: Begone you filth! My gift must be the first modification that your body should\n have!\n \n \n \n );\n }\n\n return (\n <>\n \n \n Allison \"Mother\" Stanek: Welcome child, I see your body is pure. Are you ready to ascend beyond our human\n form? If you are, accept my gift.\n \n \n \n {symbol}\n \n );\n }\n\n function renderGlitch(): React.ReactElement {\n return (\n <>\n \n \n \n \n );\n }\n\n switch (props.loc.name) {\n case LocationName.NewTokyoVitaLife: {\n return renderGrafting();\n }\n case LocationName.Sector12CityHall: {\n return (BitNodeMultipliers.CorporationSoftcap < 0.15 && <>) || ;\n }\n case LocationName.Sector12NSA: {\n return renderBladeburner();\n }\n case LocationName.NewTokyoNoodleBar: {\n return renderNoodleBar();\n }\n case LocationName.ChongqingChurchOfTheMachineGod: {\n return renderCotMG();\n }\n case LocationName.IshimaGlitch: {\n return renderGlitch();\n }\n case LocationName.NewTokyoArcade: {\n return ;\n }\n default:\n console.error(`Location ${props.loc.name} doesn't have any special properties`);\n return <>;\n }\n}\n","import React, { useState } from \"react\";\n\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function CreateCorporationModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const canSelfFund = player.canAfford(150e9);\n if (!player.canAccessCorporation() || player.hasCorporation()) {\n props.onClose();\n return <>;\n }\n\n const [name, setName] = useState(\"\");\n function onChange(event: React.ChangeEvent): void {\n setName(event.target.value);\n }\n\n function selfFund(): void {\n if (!canSelfFund) {\n return;\n }\n\n if (name == \"\") {\n return;\n }\n\n player.startCorporation(name);\n player.loseMoney(150e9, \"corporation\");\n\n props.onClose();\n router.toCorporation();\n }\n\n function seed(): void {\n if (name == \"\") {\n return;\n }\n\n player.startCorporation(name, 500e6);\n\n props.onClose();\n router.toCorporation();\n }\n\n return (\n \n \n Would you like to start a corporation? This will require $150b for registration and initial funding.{\" \"}\n {player.bitNodeN === 3 &&\n `This $150b\n can either be self-funded, or you can obtain the seed money from the government in exchange for 500 million\n shares`}\n
    \n
    \n If you would like to start one, please enter a name for your corporation below:\n
    \n \n {player.bitNodeN === 3 && (\n \n )}\n \n
    \n );\n}\n","const n00dlePower =\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(\" +\n \"!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]\" +\n \"+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+\" +\n \"[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[\" +\n \"])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!\" +\n \"+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+\" +\n \"[]+[!+[]+!+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[\" +\n \"])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+\" +\n \"(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+\" +\n \"[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+\" +\n \"!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]\" +\n \"]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]\" +\n \"]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[\" +\n \"+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(\" +\n \"![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[]\" +\n \")[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+\" +\n \"[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!\" +\n \"![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(\" +\n \"![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[\" +\n \"])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[]\" +\n \")[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[\" +\n \"]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[]\" +\n \")[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]\" +\n \"]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]\" +\n \"]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+(\" +\n \"[][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[\" +\n \"+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+\" +\n \"[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[\" +\n \"]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+\" +\n \"(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[]\" +\n \")[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]]\" +\n \"(!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]])()([][(![]+[])[+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[(![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]]\" +\n \"((+((+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+[+[\" +\n \"]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+!+[]]])+[])[!+[]+!+[]]+[+!+[]])+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]])()())[!+[]+!+[]+!+[]+[+[]]]+(+[]+[][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]])[+!+[]+[+[]]]+(+[]+[][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]]()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]\" +\n \"+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]\" +\n \"+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+\" +\n \"[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]\" +\n \"+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+([\" +\n \"![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[!+[]+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(+[![]]+[+(+!+[]+(\" +\n \"!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(!![]+[][(![]\" +\n \"+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][\" +\n \"[]]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[\" +\n \"]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+\" +\n \"!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(+(!+[]\" +\n \"+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])\" +\n \"[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+\" +\n \"[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[\" +\n \"]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!\" +\n \"+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]\" +\n \"+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(!\" +\n \"[]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!\" +\n \"![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]]\" +\n \")+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[\" +\n \"+!+[]+[+!+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![\" +\n \"]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[\" +\n \"])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+\" +\n \"[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[\" +\n \"+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!\" +\n \"+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![\" +\n \"]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!\" +\n \"[]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!!\" +\n \"[]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]\" +\n \"]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![\" +\n \"]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[\" +\n \"]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]\" +\n \"+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+\" +\n \"[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]\" +\n \"+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+\" +\n \"[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])\" +\n \"[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[\" +\n \"])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()\" +\n \"+[])[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[\" +\n \"+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[]\" +\n \"[(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]])()\";\n\nexport function N00dles(): void {\n // TODO: Too powerful, needs a nerf.\n eval(n00dlePower);\n}\n","import React, { useState } from \"react\";\nimport { BBCabinetRoot } from \"./BBCabinet\";\n\nimport Button from \"@mui/material/Button\";\nimport { use } from \"../../ui/Context\";\nimport { AlertEvents } from \"../../ui/React/AlertManager\";\n\nenum Page {\n None,\n Megabyteburner2000,\n}\n\nexport function ArcadeRoot(): React.ReactElement {\n const player = use.Player();\n const [page, setPage] = useState(Page.None);\n\n function mbBurner2000(): void {\n if (player.sourceFileLvl(1) === 0) {\n AlertEvents.emit(\"This machine is broken.\");\n } else {\n setPage(Page.Megabyteburner2000);\n }\n }\n\n if (page === Page.None) {\n return (\n <>\n \n \n );\n }\n let currentGame = <>;\n switch (page) {\n case Page.Megabyteburner2000:\n currentGame = ;\n }\n return (\n <>\n \n {currentGame}\n \n );\n}\n","import React, { useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { use } from \"../../ui/Context\";\nimport { Exploit } from \"../../Exploits/Exploit\";\n\nconst metaBB = \"https://bitburner-official.github.io/bitburner-legacy/\";\n\nconst style = {\n width: \"1060px\",\n height: \"800px\",\n border: \"0px\",\n};\n\nexport function BBCabinetRoot(): React.ReactElement {\n const player = use.Player();\n useEffect(() => {\n window.addEventListener(\"message\", function (this: Window, ev: MessageEvent) {\n if (ev.isTrusted && ev.origin == \"https://bitburner-official.github.io\" && ev.data) {\n player.giveExploit(Exploit.TrueRecursion);\n }\n });\n });\n // prettier-ignore\n const joystick =\n <>\n \n ,'\" \"', .-. \n / \\ ( ) \n | | .-. '-' .-. \n \\ / ( ) ( )\n '.___.' '-' .-. '-'\n ||| ( ) \n ||| '-' \n ;\n return (\n <>\n \n \n \n \n );\n}\n","import React from \"react\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ICityProps {\n currentCity: CityName;\n city: CityName;\n onTravel: (city: CityName) => void;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n travel: {\n color: theme.colors.white,\n lineHeight: \"1em\",\n whiteSpace: \"pre\",\n cursor: \"pointer\",\n },\n }),\n);\n\nfunction City(props: ICityProps): React.ReactElement {\n const classes = useStyles();\n if (props.city !== props.currentCity) {\n return (\n {props.city}}>\n props.onTravel(props.city)} className={classes.travel}>\n {props.city[0]}\n \n \n );\n }\n return {props.city[0]};\n}\n\ninterface IProps {\n currentCity: CityName;\n onTravel: (city: CityName) => void;\n}\n\nexport function WorldMap(props: IProps): React.ReactElement {\n // prettier-ignore\n return (\n <>\n ,_ . ._. _. .\n , _-\\','|~\\~ ~/ ;-'_ _-' ,;_;_, ~~-\n /~~-\\_/-'~'--' \\~~| ', ,' / / ~|-_\\_/~/~ ~~--~~~~'--_\n / ,/'-/~ '\\ ,' _ , ','|~ ._/-, /~\n ~/-'~\\_, '-,| '|. ' ~ ,\\ /'~ / /_ /~\n .-~ '| '',\\~|\\ _\\~ ,_ , /,\n '\\ /'~ |_/~\\\\,-,~ \\ \" ,_,/ |\n | / ._-~'\\_ _~| \\ ) \n \\ __-\\ '/ ~ |\\ \\_ / ~\n ., '\\ |, ~-_ - | \\\\_' ~| /\\ \\~ ,\n ~-_' _; '\\ '-, \\,' /\\/ |\n '\\_,~'\\_ \\_ _, /' ' |, /|'\n / \\_ ~ | / \\ ~'; -,_.\n | ~\\ | | , '-_, ,; ~ ~\\\n \\, / \\ / /| ,-, , -,\n | ,/ | |' |/ ,- ~ \\ '.\n ,| ,/ \\ ,/ \\ |\n / | ~ -~~-, / _\n | ,-' ~ /\n / ,' ~\n ',| ~\n ~'\n \n );\n}\n","import React from \"react\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { StealthIcon } from \"./StealthIcon\";\nimport { KillIcon } from \"./KillIcon\";\nimport { IAction } from \"../IAction\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { Player } from \"../../Player\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: IAction;\n}\n\nexport function SuccessChance(props: IProps): React.ReactElement {\n const estimatedSuccessChance = props.action.getEstSuccessChance(props.bladeburner, Player);\n\n let chance = <>;\n if (estimatedSuccessChance[0] === estimatedSuccessChance[1]) {\n chance = <>{formatNumber(estimatedSuccessChance[0] * 100, 1)}%;\n } else {\n chance = (\n <>\n {formatNumber(estimatedSuccessChance[0] * 100, 1)}% ~ {formatNumber(estimatedSuccessChance[1] * 100, 1)}%\n \n );\n }\n\n return (\n <>\n Estimated success chance: {chance} {props.action.isStealth ? : <>}\n {props.action.isKill ? : <>}\n \n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n}\n\nexport function StaticModal(props: IProps): React.ReactElement {\n return (\n \n {props.children}\n \n );\n}\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveRecoveryWork = (w: Work | null): w is SleeveRecoveryWork =>\n w !== null && w.type === WorkType.RECOVERY;\n\nexport class SleeveRecoveryWork extends Work {\n constructor() {\n super(WorkType.RECOVERY);\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n sleeve.shock = Math.min(100, sleeve.shock + 0.0002 * cycles);\n if (sleeve.shock >= 100) sleeve.stopWork(player);\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveRecoveryWork\", this);\n }\n\n /**\n * Initiatizes a RecoveryWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveRecoveryWork {\n return Generic_fromJSON(SleeveRecoveryWork, value.data);\n }\n}\n\nReviver.constructors.SleeveRecoveryWork = SleeveRecoveryWork;\n","import { IPlayer } from \"../../IPlayer\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../../../utils/JSONReviver\";\nimport { Sleeve } from \"../Sleeve\";\nimport { Work, WorkType } from \"./Work\";\n\nexport const isSleeveSynchroWork = (w: Work | null): w is SleeveSynchroWork =>\n w !== null && w.type === WorkType.SYNCHRO;\n\nexport class SleeveSynchroWork extends Work {\n constructor() {\n super(WorkType.SYNCHRO);\n }\n\n process(player: IPlayer, sleeve: Sleeve, cycles: number): number {\n sleeve.sync = Math.min(100, sleeve.sync + player.getIntelligenceBonus(0.5) * 0.0002 * cycles);\n if (sleeve.sync >= 100) sleeve.stopWork(player);\n return 0;\n }\n\n APICopy(): Record {\n return {\n type: this.type,\n };\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"SleeveSynchroWork\", this);\n }\n\n /**\n * Initiatizes a SynchroWork object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): SleeveSynchroWork {\n return Generic_fromJSON(SleeveSynchroWork, value.data);\n }\n}\n\nReviver.constructors.SleeveSynchroWork = SleeveSynchroWork;\n","/**\n * Class representing a Script instance that is actively running.\n * A Script can have multiple active instances\n */\nimport { Script } from \"./Script\";\nimport { ScriptUrl } from \"./ScriptUrl\";\nimport { Settings } from \"../Settings/Settings\";\nimport { IMap } from \"../types\";\nimport { Terminal } from \"../Terminal\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { formatTime } from \"../utils/helpers/formatTime\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\n\nexport class RunningScript {\n // Script arguments\n args: ScriptArg[] = [];\n\n // Map of [key: hostname] -> Hacking data. Used for offline progress calculations.\n // Hacking data format: [MoneyStolen, NumTimesHacked, NumTimesGrown, NumTimesWeaken]\n dataMap: IMap = {};\n\n // Script filename\n filename = \"\";\n\n // This script's logs. An array of log entries\n logs: string[] = [];\n\n // Flag indicating whether the logs have been updated since\n // the last time the UI was updated\n logUpd = false;\n\n // Total amount of hacking experience earned from this script when offline\n offlineExpGained = 0;\n\n // Total amount of money made by this script when offline\n offlineMoneyMade = 0;\n\n // Number of seconds that the script has been running offline\n offlineRunningTime = 0.01;\n\n // Total amount of hacking experience earned from this script when online\n onlineExpGained = 0;\n\n // Total amount of money made by this script when online\n onlineMoneyMade = 0;\n\n // Number of seconds that this script has been running online\n onlineRunningTime = 0.01;\n\n // Process ID. Must be an integer and equals the PID of corresponding WorkerScript\n pid = -1;\n\n // How much RAM this script uses for ONE thread\n ramUsage = 0;\n\n // hostname of the server on which this script is running\n server = \"\";\n\n // Number of threads that this script is running with\n threads = 1;\n\n // Script urls for the current running script for translating urls back to file names in errors\n dependencies: ScriptUrl[] = [];\n\n constructor(script: Script | null = null, args: ScriptArg[] = []) {\n if (script == null) {\n return;\n }\n this.filename = script.filename;\n this.args = args;\n this.server = script.server;\n this.ramUsage = script.ramUsage;\n this.dependencies = script.dependencies;\n }\n\n log(txt: string): void {\n if (this.logs.length > Settings.MaxLogCapacity) {\n this.logs.shift();\n }\n\n let logEntry = txt;\n if (Settings.TimestampsFormat) {\n logEntry = \"[\" + formatTime(Settings.TimestampsFormat) + \"] \" + logEntry;\n }\n\n this.logs.push(logEntry);\n this.logUpd = true;\n }\n\n displayLog(): void {\n for (let i = 0; i < this.logs.length; ++i) {\n Terminal.print(this.logs[i]);\n }\n }\n\n clearLog(): void {\n this.logs.length = 0;\n }\n\n // Update the moneyStolen and numTimesHack maps when hacking\n recordHack(hostname: string, moneyGained: number, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][0] += moneyGained;\n this.dataMap[hostname][1] += n;\n }\n\n // Update the grow map when calling grow()\n recordGrow(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][2] += n;\n }\n\n // Update the weaken map when calling weaken() {\n recordWeaken(hostname: string, n = 1): void {\n if (this.dataMap[hostname] == null || this.dataMap[hostname].constructor !== Array) {\n this.dataMap[hostname] = [0, 0, 0, 0];\n }\n this.dataMap[hostname][3] += n;\n }\n\n // Serialize the current object to a JSON save state\n toJSON(): IReviverValue {\n return Generic_toJSON(\"RunningScript\", this);\n }\n\n // Initializes a RunningScript Object from a JSON save state\n static fromJSON(value: IReviverValue): RunningScript {\n return Generic_fromJSON(RunningScript, value.data);\n }\n}\n\nReviver.constructors.RunningScript = RunningScript;\n","import { Literatures } from \"./Literatures\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\n\nexport function showLiterature(fn: string): void {\n const litObj = Literatures[fn];\n if (litObj == null) {\n return;\n }\n const txt = `${litObj.title}

    ${litObj.txt}`;\n dialogBoxCreate(txt);\n}\n","import React from \"react\";\nimport { DarkWebItems } from \"./DarkWebItems\";\n\nimport { Player } from \"../Player\";\nimport { Terminal } from \"../Terminal\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { Money } from \"../ui/React/Money\";\nimport { DarkWebItem } from \"./DarkWebItem\";\nimport { isCreateProgramWork } from \"../Work/CreateProgramWork\";\n\n//Posts a \"help\" message if connected to DarkWeb\nexport function checkIfConnectedToDarkweb(): void {\n const server = Player.getCurrentServer();\n if (server !== null && SpecialServers.DarkWeb == server.hostname) {\n Terminal.print(\n \"You are now connected to the dark web. From the dark web you can purchase illegal items. \" +\n \"Use the 'buy -l' command to display a list of all the items you can buy. Use 'buy [item-name]' \" +\n \"to purchase an item. Use 'buy -a' to purchase all unowned items.\",\n );\n }\n}\n\nexport function listAllDarkwebItems(): void {\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n\n const cost = Player.getHomeComputer().programs.includes(item.program) ? (\n [OWNED]\n ) : (\n \n );\n\n Terminal.printRaw(\n <>\n {item.program} - {cost} - {item.description}\n ,\n );\n }\n}\n\nexport function buyDarkwebItem(itemName: string): void {\n itemName = itemName.toLowerCase();\n\n // find the program that matches, if any\n let item: DarkWebItem | null = null;\n\n for (const key of Object.keys(DarkWebItems)) {\n const i = DarkWebItems[key];\n if (i.program.toLowerCase() == itemName) {\n item = i;\n }\n }\n\n // return if invalid\n if (item === null) {\n Terminal.error(\"Unrecognized item: \" + itemName);\n return;\n }\n\n // return if the player already has it.\n if (Player.hasProgram(item.program)) {\n Terminal.print(\"You already have the \" + item.program + \" program\");\n return;\n }\n\n // return if the player doesn't have enough money\n if (Player.money < item.price) {\n Terminal.error(\"Not enough money to purchase \" + item.program);\n return;\n }\n\n // buy and push\n Player.loseMoney(item.price, \"other\");\n\n Player.getHomeComputer().pushProgram(item.program);\n // Cancel if the program is in progress of writing\n if (isCreateProgramWork(Player.currentWork) && Player.currentWork.programName === item.program) {\n Player.finishWork(true);\n }\n\n Terminal.print(\n \"You have purchased the \" + item.program + \" program. The new program can be found on your home computer.\",\n );\n}\n\nexport function buyAllDarkwebItems(): void {\n const itemsToBuy: DarkWebItem[] = [];\n let cost = 0;\n\n for (const key of Object.keys(DarkWebItems)) {\n const item = DarkWebItems[key];\n if (!Player.hasProgram(item.program)) {\n itemsToBuy.push(item);\n cost += item.price;\n }\n }\n\n if (itemsToBuy.length === 0) {\n Terminal.print(\"All available programs have been purchased already.\");\n return;\n }\n\n if (cost > Player.money) {\n Terminal.error(\n \"Not enough money to purchase remaining programs, \" + numeralWrapper.formatMoney(cost) + \" required\",\n );\n return;\n }\n\n for (const item of itemsToBuy) {\n buyDarkwebItem(item.program);\n }\n}\n","import { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { calculateSkill } from \"../../PersonObjects/formulas/skill\";\n\nfunction calculateRawDiff(player: IPlayer, stats: number, startingDifficulty: number): number {\n const difficulty = startingDifficulty - Math.pow(stats, 0.9) / 250 - player.skills.intelligence / 1600;\n if (difficulty < 0) return 0;\n if (difficulty > 3) return 3;\n return difficulty;\n}\n\nexport function calculateDifficulty(player: IPlayer, startingSecurityLevel: number): number {\n const totalStats =\n player.skills.strength +\n player.skills.defense +\n player.skills.dexterity +\n player.skills.agility +\n player.skills.charisma;\n return calculateRawDiff(player, totalStats, startingSecurityLevel);\n}\n\nexport function calculateReward(player: IPlayer, startingSecurityLevel: number): number {\n const xpMult = 10 * 60 * 15;\n const total =\n calculateSkill(player.mults.strength_exp * xpMult, player.mults.strength) +\n calculateSkill(player.mults.defense_exp * xpMult, player.mults.defense) +\n calculateSkill(player.mults.agility_exp * xpMult, player.mults.agility) +\n calculateSkill(player.mults.dexterity_exp * xpMult, player.mults.dexterity) +\n calculateSkill(player.mults.charisma_exp * xpMult, player.mults.charisma);\n return calculateRawDiff(player, total, startingSecurityLevel);\n}\n","import { KEY } from \"../utils/helpers/keyCodes\";\nimport { substituteAliases } from \"../Alias\";\n// Helper function to parse individual arguments into number/boolean/string as appropriate\nfunction parseArg(arg: string): string | number | boolean {\n // Handles all numbers including hexadecimal, octal, and binary representations, returning NaN on an unparseable string\n const asNumber = Number(arg);\n if (!isNaN(asNumber)) {\n return asNumber;\n }\n\n if (arg === \"true\" || arg === \"false\") {\n return arg === \"true\";\n }\n\n return arg;\n}\n\nexport function ParseCommands(commands: string): string[] {\n // Sanitize input\n commands = commands.trim();\n // Replace all extra whitespace in command with a single space\n commands = commands.replace(/\\s\\s+/g, \" \");\n\n const match = commands.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g);\n if (!match) return [];\n // Split commands and execute sequentially\n const allCommands = match\n .map(substituteAliases)\n .map((c) => c.match(/(?:'[^']*'|\"[^\"]*\"|[^;\"])*/g))\n .flat();\n\n const out: string[] = [];\n for (const c of allCommands) {\n if (c === null) continue;\n if (c.match(/^\\s*$/)) {\n continue;\n } // Don't run commands that only have whitespace\n out.push(c.trim());\n }\n return out;\n}\n\nexport function ParseCommand(command: string): (string | number | boolean)[] {\n let idx = 0;\n const args = [];\n\n let lastQuote = \"\";\n\n let arg = \"\";\n while (idx < command.length) {\n const c = command.charAt(idx);\n\n // If the current character is a backslash, add the next character verbatim to the argument\n if (c === \"\\\\\") {\n arg += command.charAt(++idx);\n // If the current character is a single- or double-quote mark, add it to the current argument.\n } else if (c === KEY.DOUBLE_QUOTE || c === KEY.QUOTE) {\n // If we're currently in a quoted string argument and this quote mark is the same as the beginning,\n // the string is done\n if (lastQuote !== \"\" && c === lastQuote) {\n lastQuote = \"\";\n // Otherwise if we're not in a string argument, we've begun one\n } else if (lastQuote === \"\") {\n lastQuote = c;\n // Otherwise if we're in a string argument, add the current character to it\n } else {\n arg += c;\n }\n // If the current character is a space and we are not inside a string, parse the current argument\n // and start a new one\n } else if (c === KEY.SPACE && lastQuote === \"\") {\n args.push(parseArg(arg));\n\n arg = \"\";\n } else {\n // Add the current character to the current argument\n arg += c;\n }\n\n idx++;\n }\n\n // Add the last arg (if any)\n if (arg !== \"\") {\n args.push(parseArg(arg));\n }\n\n return args;\n}\n","import React, { useState } from \"react\";\n\nimport { CinematicLine } from \"./CinematicLine\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n lines: string[];\n auto?: boolean;\n onDone?: () => void;\n}\n\nexport function CinematicText(props: IProps): React.ReactElement {\n const [i, setI] = useState(0);\n const [done, setDone] = useState(false);\n\n function advance(): void {\n const newI = i + 1;\n setI(newI);\n if (newI >= props.lines.length) {\n if (props.onDone && props.auto) props.onDone();\n setDone(true);\n }\n }\n\n return (\n <>\n {props.lines.slice(0, i).map((line, i) => (\n {line}\n ))}\n {props.lines.length > i && }\n {!props.auto && props.onDone && done && }\n \n );\n}\n","/**\n * Implements the purchasing of extra Duplicate Sleeves from The Covenant,\n * as well as the purchasing of upgrades (memory)\n */\n\nexport const MaxSleevesFromCovenant = 5;\nexport const BaseCostPerSleeve = 10e12;\n","/**\n * Implements RAM Calculation functionality.\n *\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST, calculating RAM usage along\n * the way\n */\nimport * as walk from \"acorn-walk\";\nimport acorn, { parse } from \"acorn\";\n\nimport { RamCalculationErrorCode } from \"./RamCalculationErrorCodes\";\n\nimport { RamCosts, RamCostConstants } from \"../Netscript/RamCostGenerator\";\nimport { Script } from \"./Script\";\nimport { areImportsEquals } from \"../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Node } from \"../NetscriptJSEvaluator\";\n\nexport interface RamUsageEntry {\n type: \"ns\" | \"dom\" | \"fn\" | \"misc\";\n name: string;\n cost: number;\n}\n\nexport interface RamCalculation {\n cost: number;\n entries?: RamUsageEntry[];\n}\n\n// These special strings are used to reference the presence of a given logical\n// construct within a user script.\nconst specialReferenceIF = \"__SPECIAL_referenceIf\";\nconst specialReferenceFOR = \"__SPECIAL_referenceFor\";\nconst specialReferenceWHILE = \"__SPECIAL_referenceWhile\";\n\n// The global scope of a script is registered under this key during parsing.\nconst memCheckGlobalKey = \".__GLOBAL__\";\n\n/**\n * Parses code into an AST and walks through it recursively to calculate\n * RAM usage. Also accounts for imported modules.\n * @param {Script[]} otherScripts - All other scripts on the server. Used to account for imported scripts\n * @param {string} codeCopy - The code being parsed\n * @param {WorkerScript} workerScript - Object containing RAM costs of Netscript functions. Also used to\n * keep track of what functions have/havent been accounted for\n */\nfunction parseOnlyRamCalculate(player: IPlayer, otherScripts: Script[], code: string): RamCalculation {\n try {\n /**\n * Maps dependent identifiers to their dependencies.\n *\n * The initial identifier is __SPECIAL_INITIAL_MODULE__.__GLOBAL__.\n * It depends on all the functions declared in the module, all the global scopes\n * of its imports, and any identifiers referenced in this global scope. Each\n * function depends on all the identifiers referenced internally.\n * We walk the dependency graph to calculate RAM usage, given that some identifiers\n * reference Netscript functions which have a RAM cost.\n */\n let dependencyMap: { [key: string]: string[] } = {};\n\n // Scripts we've parsed.\n const completedParses = new Set();\n\n // Scripts we've discovered that need to be parsed.\n const parseQueue: string[] = [];\n\n // Parses a chunk of code with a given module name, and updates parseQueue and dependencyMap.\n function parseCode(code: string, moduleName: string): void {\n const result = parseOnlyCalculateDeps(code, moduleName);\n completedParses.add(moduleName);\n\n // Add any additional modules to the parse queue;\n for (let i = 0; i < result.additionalModules.length; ++i) {\n if (!completedParses.has(result.additionalModules[i])) {\n parseQueue.push(result.additionalModules[i]);\n }\n }\n\n // Splice all the references in\n dependencyMap = Object.assign(dependencyMap, result.dependencyMap);\n }\n\n // Parse the initial module, which is the \"main\" script that is being run\n const initialModule = \"__SPECIAL_INITIAL_MODULE__\";\n parseCode(code, initialModule);\n\n // Process additional modules, which occurs if the \"main\" script has any imports\n while (parseQueue.length > 0) {\n const nextModule = parseQueue.shift();\n if (nextModule === undefined) throw new Error(\"nextModule should not be undefined\");\n if (nextModule.startsWith(\"https://\") || nextModule.startsWith(\"http://\")) continue;\n\n let script = null;\n const fn = nextModule.startsWith(\"./\") ? nextModule.slice(2) : nextModule;\n for (const s of otherScripts) {\n if (areImportsEquals(s.filename, fn)) {\n script = s;\n break;\n }\n }\n\n if (script == null) {\n return { cost: RamCalculationErrorCode.ImportError }; // No such script on the server\n }\n\n parseCode(script.code, nextModule);\n }\n\n // Finally, walk the reference map and generate a ram cost. The initial set of keys to scan\n // are those that start with __SPECIAL_INITIAL_MODULE__.\n let ram = RamCostConstants.ScriptBaseRamCost;\n const detailedCosts: RamUsageEntry[] = [\n { type: \"misc\", name: \"baseCost\", cost: RamCostConstants.ScriptBaseRamCost },\n ];\n const unresolvedRefs = Object.keys(dependencyMap).filter((s) => s.startsWith(initialModule));\n const resolvedRefs = new Set();\n const loadedFns: Record = {};\n while (unresolvedRefs.length > 0) {\n const ref = unresolvedRefs.shift();\n if (ref === undefined) throw new Error(\"ref should not be undefined\");\n\n // Check if this is one of the special keys, and add the appropriate ram cost if so.\n if (ref === \"hacknet\" && !resolvedRefs.has(\"hacknet\")) {\n ram += RamCostConstants.ScriptHacknetNodesRamCost;\n detailedCosts.push({ type: \"ns\", name: \"hacknet\", cost: RamCostConstants.ScriptHacknetNodesRamCost });\n }\n if (ref === \"document\" && !resolvedRefs.has(\"document\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: \"dom\", name: \"document\", cost: RamCostConstants.ScriptDomRamCost });\n }\n if (ref === \"window\" && !resolvedRefs.has(\"window\")) {\n ram += RamCostConstants.ScriptDomRamCost;\n detailedCosts.push({ type: \"dom\", name: \"window\", cost: RamCostConstants.ScriptDomRamCost });\n }\n if (ref === \"corporation\" && !resolvedRefs.has(\"corporation\")) {\n ram += RamCostConstants.ScriptCorporationRamCost;\n detailedCosts.push({ type: \"ns\", name: \"corporation\", cost: RamCostConstants.ScriptCorporationRamCost });\n }\n\n resolvedRefs.add(ref);\n\n if (ref.endsWith(\".*\")) {\n // A prefix reference. We need to find all matching identifiers.\n const prefix = ref.slice(0, ref.length - 2);\n for (const ident of Object.keys(dependencyMap).filter((k) => k.startsWith(prefix))) {\n for (const dep of dependencyMap[ident] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n } else {\n // An exact reference. Add all dependencies of this ref.\n for (const dep of dependencyMap[ref] || []) {\n if (!resolvedRefs.has(dep)) unresolvedRefs.push(dep);\n }\n }\n\n // Check if this identifier is a function in the workerScript environment.\n // If it is, then we need to get its RAM cost.\n try {\n function applyFuncRam(cost: number | ((p: IPlayer) => number)): number {\n if (typeof cost === \"number\") {\n return cost;\n } else if (typeof cost === \"function\") {\n return cost(player);\n } else {\n return 0;\n }\n }\n\n // Only count each function once\n if (loadedFns[ref]) {\n continue;\n }\n loadedFns[ref] = true;\n\n // This accounts for namespaces (Bladeburner, CodingContract, etc.)\n const findFunc = (\n prefix: string,\n obj: object,\n ref: string,\n ): { func: (p: IPlayer) => number | number; refDetail: string } | undefined => {\n if (!obj) return;\n const elem = Object.entries(obj).find(([key]) => key === ref);\n if (elem !== undefined && (typeof elem[1] === \"function\" || typeof elem[1] === \"number\")) {\n return { func: elem[1], refDetail: `${prefix}${ref}` };\n }\n for (const [key, value] of Object.entries(obj)) {\n const found = findFunc(`${key}.`, value, ref);\n if (found) return found;\n }\n return undefined;\n };\n\n const details = findFunc(\"\", RamCosts, ref);\n const fnRam = applyFuncRam(details?.func ?? 0);\n ram += fnRam;\n detailedCosts.push({ type: \"fn\", name: details?.refDetail ?? \"\", cost: fnRam });\n } catch (error) {\n console.log(error);\n continue;\n }\n }\n return { cost: ram, entries: detailedCosts.filter((e) => e.cost > 0) };\n } catch (error) {\n // console.info(\"parse or eval error: \", error);\n // This is not unexpected. The user may be editing a script, and it may be in\n // a transitory invalid state.\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n}\n\nexport function checkInfiniteLoop(code: string): number {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n\n function nodeHasTrueTest(node: acorn.Node): boolean {\n return node.type === \"Literal\" && (node as any).raw === \"true\";\n }\n\n function hasAwait(ast: acorn.Node): boolean {\n let hasAwait = false;\n walk.recursive(\n ast,\n {},\n {\n AwaitExpression: () => {\n hasAwait = true;\n },\n },\n );\n return hasAwait;\n }\n\n let missingAwaitLine = -1;\n walk.recursive(\n ast,\n {},\n {\n WhileStatement: (node: Node, st: unknown, walkDeeper: walk.WalkerCallback) => {\n if (nodeHasTrueTest(node.test) && !hasAwait(node)) {\n missingAwaitLine = (code.slice(0, node.start).match(/\\n/g) || []).length + 1;\n } else {\n node.body && walkDeeper(node.body, st);\n }\n },\n },\n );\n\n return missingAwaitLine;\n}\n\ninterface ParseDepsResult {\n dependencyMap: {\n [key: string]: Set | undefined;\n };\n additionalModules: string[];\n}\n\n/**\n * Helper function that parses a single script. It returns a map of all dependencies,\n * which are items in the code's AST that potentially need to be evaluated\n * for RAM usage calculations. It also returns an array of additional modules\n * that need to be parsed (i.e. are 'import'ed scripts).\n */\nfunction parseOnlyCalculateDeps(code: string, currentModule: string): ParseDepsResult {\n const ast = parse(code, { sourceType: \"module\", ecmaVersion: \"latest\" });\n // Everything from the global scope goes in \".\". Everything else goes in \".function\", where only\n // the outermost layer of functions counts.\n const globalKey = currentModule + memCheckGlobalKey;\n const dependencyMap: { [key: string]: Set | undefined } = {};\n dependencyMap[globalKey] = new Set();\n\n // If we reference this internal name, we're really referencing that external name.\n // Filled when we import names from other modules.\n const internalToExternal: { [key: string]: string | undefined } = {};\n\n const additionalModules: string[] = [];\n\n // References get added pessimistically. They are added for thisModule.name, name, and for\n // any aliases.\n function addRef(key: string, name: string): void {\n const s = dependencyMap[key] || (dependencyMap[key] = new Set());\n const external = internalToExternal[name];\n if (external !== undefined) {\n s.add(external);\n }\n s.add(currentModule + \".\" + name);\n s.add(name); // For builtins like hack.\n }\n\n //A list of identifiers that resolve to \"native Javascript code\"\n const objectPrototypeProperties = Object.getOwnPropertyNames(Object.prototype);\n\n interface State {\n key: string;\n }\n\n // If we discover a dependency identifier, state.key is the dependent identifier.\n // walkDeeper is for doing recursive walks of expressions in composites that we handle.\n function commonVisitors(): walk.RecursiveVisitors {\n return {\n Identifier: (node: Node, st: State) => {\n if (objectPrototypeProperties.includes(node.name)) {\n return;\n }\n addRef(st.key, node.name);\n },\n WhileStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n DoWhileStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceWHILE);\n node.test && walkDeeper(node.test, st);\n node.body && walkDeeper(node.body, st);\n },\n ForStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceFOR);\n node.init && walkDeeper(node.init, st);\n node.test && walkDeeper(node.test, st);\n node.update && walkDeeper(node.update, st);\n node.body && walkDeeper(node.body, st);\n },\n IfStatement: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n addRef(st.key, specialReferenceIF);\n node.test && walkDeeper(node.test, st);\n node.consequent && walkDeeper(node.consequent, st);\n node.alternate && walkDeeper(node.alternate, st);\n },\n MemberExpression: (node: Node, st: State, walkDeeper: walk.WalkerCallback) => {\n node.object && walkDeeper(node.object, st);\n node.property && walkDeeper(node.property, st);\n },\n };\n }\n\n walk.recursive(\n ast,\n { key: globalKey },\n Object.assign(\n {\n ImportDeclaration: (node: Node, st: State) => {\n const importModuleName = node.source.value;\n additionalModules.push(importModuleName);\n\n // This module's global scope refers to that module's global scope, no matter how we\n // import it.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + memCheckGlobalKey);\n\n for (let i = 0; i < node.specifiers.length; ++i) {\n const spec = node.specifiers[i];\n if (spec.imported !== undefined && spec.local !== undefined) {\n // We depend on specific things.\n internalToExternal[spec.local.name] = importModuleName + \".\" + spec.imported.name;\n } else {\n // We depend on everything.\n const set = dependencyMap[st.key];\n if (set === undefined) throw new Error(\"set should not be undefined\");\n set.add(importModuleName + \".*\");\n }\n }\n },\n FunctionDeclaration: (node: Node) => {\n // node.id will be null when using 'export default'. Add a module name indicating the default export.\n const key = currentModule + \".\" + (node.id === null ? \"__SPECIAL_DEFAULT_EXPORT__\" : node.id.name);\n walk.recursive(node, { key: key }, commonVisitors());\n },\n },\n commonVisitors(),\n ),\n );\n\n return { dependencyMap: dependencyMap, additionalModules: additionalModules };\n}\n\n/**\n * Calculate's a scripts RAM Usage\n * @param {string} codeCopy - The script's code\n * @param {Script[]} otherScripts - All other scripts on the server.\n * Used to account for imported scripts\n */\nexport function calculateRamUsage(player: IPlayer, codeCopy: string, otherScripts: Script[]): RamCalculation {\n try {\n return parseOnlyRamCalculate(player, otherScripts, codeCopy);\n } catch (e) {\n console.error(`Failed to parse script for RAM calculations:`);\n console.error(e);\n return { cost: RamCalculationErrorCode.SyntaxError };\n }\n}\n","/**\n * Rounds a number to two decimal places.\n * @param decimal A decimal value to trim to two places.\n */\nexport function roundToTwo(decimal: number): number {\n const leftShift: number = Math.round(parseFloat(`${decimal}e+2`));\n\n return +`${leftShift}e-2`;\n}\n","import { workerScripts } from \"./WorkerScripts\";\n\nlet pidCounter = 1;\n\n/**\n * Find and return the next availble PID for a script\n */\nexport function generateNextPid(): number {\n let tempCounter = pidCounter;\n\n // Cap the number of search iterations at some arbitrary value to avoid\n // infinite loops. We'll assume that players wont have 1mil+ running scripts\n let found = false;\n for (let i = 0; i < 1e6; ) {\n if (!workerScripts.has(tempCounter + i)) {\n found = true;\n tempCounter = tempCounter + i;\n break;\n }\n\n if (i === Number.MAX_SAFE_INTEGER - 1) {\n i = 1;\n } else {\n ++i;\n }\n }\n\n if (found) {\n pidCounter = tempCounter + 1;\n if (pidCounter >= Number.MAX_SAFE_INTEGER) {\n pidCounter = 1;\n }\n\n return tempCounter;\n } else {\n return -1;\n }\n}\n\nexport function resetPidCounter(): void {\n pidCounter = 1;\n}\n","/**\n * TODO\n * Add police clashes\n * balance point to keep them from running out of control\n */\n\nimport { Faction } from \"../Faction/Faction\";\nimport { Factions } from \"../Faction/Factions\";\n\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\n\nimport { exceptionAlert } from \"../utils/helpers/exceptionAlert\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\n\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangConstants } from \"./data/Constants\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { IAscensionResult } from \"./IAscensionResult\";\n\nimport { AllGangs } from \"./AllGangs\";\nimport { GangMember } from \"./GangMember\";\n\nimport { WorkerScript } from \"../Netscript/WorkerScript\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { PowerMultiplier } from \"./data/power\";\nimport { IGang } from \"./IGang\";\n\nexport class Gang implements IGang {\n facName: string;\n members: GangMember[];\n wanted: number;\n respect: number;\n\n isHackingGang: boolean;\n\n respectGainRate: number;\n wantedGainRate: number;\n moneyGainRate: number;\n\n storedCycles: number;\n\n storedTerritoryAndPowerCycles: number;\n\n territoryClashChance: number;\n territoryWarfareEngaged: boolean;\n\n notifyMemberDeath: boolean;\n\n constructor(facName = \"\", hacking = false) {\n this.facName = facName;\n this.members = [];\n this.wanted = 1;\n this.respect = 1;\n\n this.isHackingGang = hacking;\n\n this.respectGainRate = 0;\n this.wantedGainRate = 0;\n this.moneyGainRate = 0;\n\n // When processing gains, this stores the number of cycles until some\n // limit is reached, and then calculates and applies the gains only at that limit\n this.storedCycles = 0;\n\n // Separate variable to keep track of cycles for Territry + Power gang, which\n // happens on a slower \"clock\" than normal processing\n this.storedTerritoryAndPowerCycles = 0;\n\n this.territoryClashChance = 0;\n this.territoryWarfareEngaged = false;\n\n this.notifyMemberDeath = true;\n }\n\n getPower(): number {\n return AllGangs[this.facName].power;\n }\n\n getTerritory(): number {\n return AllGangs[this.facName].territory;\n }\n\n process(numCycles = 1, player: IPlayer): void {\n const CyclesPerSecond = 1000 / CONSTANTS._idleSpeed;\n\n if (isNaN(numCycles)) {\n console.error(`NaN passed into Gang.process(): ${numCycles}`);\n }\n this.storedCycles += numCycles;\n\n // Only process if there are at least 2 seconds, and at most 5 seconds\n if (this.storedCycles < 2 * CyclesPerSecond) return;\n const cycles = Math.min(this.storedCycles, 5 * CyclesPerSecond);\n\n try {\n this.processGains(cycles, player);\n this.processExperienceGains(cycles);\n this.processTerritoryAndPowerGains(cycles);\n this.storedCycles -= cycles;\n } catch (e: unknown) {\n console.error(`Exception caught when processing Gang: ${e}`);\n }\n }\n\n processGains(numCycles = 1, player: IPlayer): void {\n // Get gains per cycle\n let moneyGains = 0;\n let respectGains = 0;\n let wantedLevelGains = 0;\n let justice = 0;\n for (let i = 0; i < this.members.length; ++i) {\n respectGains += this.members[i].calculateRespectGain(this);\n moneyGains += this.members[i].calculateMoneyGain(this);\n const wantedLevelGain = this.members[i].calculateWantedLevelGain(this);\n wantedLevelGains += wantedLevelGain;\n if (this.members[i].getTask().baseWanted < 0) justice++; // this member is lowering wanted.\n }\n this.respectGainRate = respectGains;\n this.wantedGainRate = wantedLevelGains;\n this.moneyGainRate = moneyGains;\n const gain = respectGains * numCycles;\n this.respect += gain;\n // Faction reputation gains is respect gain divided by some constant\n const fac = Factions[this.facName];\n if (!(fac instanceof Faction)) {\n dialogBoxCreate(\n \"ERROR: Could not get Faction associates with your gang. This is a bug, please report to game dev\",\n );\n throw new Error(\"Could not find the faction associated with this gang.\");\n }\n const favorMult = 1 + fac.favor / 100;\n\n fac.playerReputation += (player.mults.faction_rep * gain * favorMult) / GangConstants.GangRespectToReputationRatio;\n\n // Keep track of respect gained per member\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].recordEarnedRespect(numCycles, this);\n }\n if (!(this.wanted === 1 && wantedLevelGains < 0)) {\n const oldWanted = this.wanted;\n let newWanted = oldWanted + wantedLevelGains * numCycles;\n newWanted = newWanted * (1 - justice * 0.001); // safeguard\n // Prevent overflow\n if (wantedLevelGains <= 0 && newWanted > oldWanted) newWanted = 1;\n\n this.wanted = newWanted;\n if (this.wanted < 1) this.wanted = 1;\n }\n player.gainMoney(moneyGains * numCycles, \"gang\");\n }\n\n processTerritoryAndPowerGains(numCycles = 1): void {\n this.storedTerritoryAndPowerCycles += numCycles;\n if (this.storedTerritoryAndPowerCycles < GangConstants.CyclesPerTerritoryAndPowerUpdate) return;\n this.storedTerritoryAndPowerCycles -= GangConstants.CyclesPerTerritoryAndPowerUpdate;\n\n // Process power first\n const gangName = this.facName;\n for (const name of Object.keys(AllGangs)) {\n if (AllGangs.hasOwnProperty(name)) {\n if (name == gangName) {\n AllGangs[name].power += this.calculatePower();\n } else {\n // All NPC gangs get random power gains\n const gainRoll = Math.random();\n if (gainRoll < 0.5) {\n // Multiplicative gain (50% chance)\n // This is capped per cycle, to prevent it from getting out of control\n const multiplicativeGain = AllGangs[name].power * 0.005;\n AllGangs[name].power += Math.min(0.85, multiplicativeGain);\n } else {\n // Additive gain (50% chance)\n const powerMult = PowerMultiplier[name];\n if (powerMult === undefined) throw new Error(\"Should not be undefined\");\n const additiveGain = 0.75 * gainRoll * AllGangs[name].territory * powerMult;\n AllGangs[name].power += additiveGain;\n }\n }\n }\n }\n\n // Determine if territory should be processed\n if (this.territoryWarfareEngaged) {\n this.territoryClashChance = 1;\n } else if (this.territoryClashChance > 0) {\n // Engagement turned off, but still a positive clash chance. So there's\n // still a chance of clashing but it slowly goes down over time\n this.territoryClashChance = Math.max(0, this.territoryClashChance - 0.01);\n }\n\n // Then process territory\n const gangs = GangConstants.Names.filter((g) => AllGangs[g].territory > 0 || g === gangName);\n if (gangs.length > 1) {\n for (let i = 0; i < gangs.length; ++i) {\n const others = gangs.filter((e) => {\n return e !== gangs[i];\n });\n const other = getRandomInt(0, others.length - 1);\n\n const thisGang = gangs[i];\n const otherGang = others[other];\n\n // If either of the gangs involved in this clash is the player, determine\n // whether to skip or process it using the clash chance\n if (thisGang === gangName || otherGang === gangName) {\n if (!(Math.random() < this.territoryClashChance)) continue;\n }\n\n const thisPwr = AllGangs[thisGang].power;\n const otherPwr = AllGangs[otherGang].power;\n const thisChance = thisPwr / (thisPwr + otherPwr);\n\n function calculateTerritoryGain(winGang: string, loseGang: string): number {\n const powerBonus = Math.max(\n 1,\n 1 + Math.log(AllGangs[winGang].power / AllGangs[loseGang].power) / Math.log(50),\n );\n const gains = Math.min(AllGangs[loseGang].territory, powerBonus * 0.0001 * (Math.random() + 0.5));\n return gains;\n }\n\n if (Math.random() < thisChance) {\n if (AllGangs[otherGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(thisGang, otherGang);\n AllGangs[thisGang].territory += territoryGain;\n AllGangs[otherGang].territory -= territoryGain;\n if (thisGang === gangName) {\n this.clash(true); // Player won\n AllGangs[otherGang].power *= 1 / 1.01;\n } else if (otherGang === gangName) {\n this.clash(false); // Player lost\n } else {\n AllGangs[otherGang].power *= 1 / 1.01;\n }\n } else {\n if (AllGangs[thisGang].territory <= 0) return;\n const territoryGain = calculateTerritoryGain(otherGang, thisGang);\n AllGangs[thisGang].territory -= territoryGain;\n AllGangs[otherGang].territory += territoryGain;\n if (thisGang === gangName) {\n this.clash(false); // Player lost\n } else if (otherGang === gangName) {\n this.clash(true); // Player won\n AllGangs[thisGang].power *= 1 / 1.01;\n } else {\n AllGangs[thisGang].power *= 1 / 1.01;\n }\n }\n\n const total = Object.values(AllGangs)\n .map((g) => g.territory)\n .reduce((p, c) => p + c, 0);\n Object.values(AllGangs).forEach((g) => (g.territory /= total));\n }\n }\n }\n\n processExperienceGains(numCycles = 1): void {\n for (let i = 0; i < this.members.length; ++i) {\n this.members[i].gainExperience(numCycles);\n this.members[i].updateSkillLevels();\n }\n }\n\n clash(won = false): void {\n // Determine if a gang member should die\n let baseDeathChance = 0.01;\n if (won) baseDeathChance /= 2;\n // If the clash was lost, the player loses a small percentage of power\n else AllGangs[this.facName].power *= 1 / 1.008;\n\n // Deaths can only occur during X% of clashes\n if (Math.random() < 0.65) return;\n\n for (let i = this.members.length - 1; i >= 0; --i) {\n const member = this.members[i];\n\n // Only members assigned to Territory Warfare can die\n if (member.task !== \"Territory Warfare\") continue;\n\n // Chance to die is decreased based on defense\n const modifiedDeathChance = baseDeathChance / Math.pow(member.def, 0.6);\n if (Math.random() < modifiedDeathChance) {\n this.killMember(member);\n }\n }\n }\n\n canRecruitMember(): boolean {\n if (this.members.length >= GangConstants.MaximumGangMembers) return false;\n return this.respect >= this.getRespectNeededToRecruitMember();\n }\n\n getRespectNeededToRecruitMember(): number {\n // First N gang members are free (can be recruited at 0 respect)\n const numFreeMembers = 3;\n if (this.members.length < numFreeMembers) return 0;\n\n const i = this.members.length - (numFreeMembers - 1);\n return Math.pow(5, i);\n }\n\n recruitMember(name: string): boolean {\n name = String(name);\n if (name === \"\" || !this.canRecruitMember()) return false;\n\n // Check for already-existing names\n const sameNames = this.members.filter((m) => m.name === name);\n if (sameNames.length >= 1) return false;\n\n const member = new GangMember(name);\n this.members.push(member);\n return true;\n }\n\n // Money and Respect gains multiplied by this number (< 1)\n getWantedPenalty(): number {\n return this.respect / (this.respect + this.wanted);\n }\n\n //Calculates power GAIN, which is added onto the Gang's existing power\n calculatePower(): number {\n let memberTotal = 0;\n for (let i = 0; i < this.members.length; ++i) {\n if (!GangMemberTasks.hasOwnProperty(this.members[i].task) || this.members[i].task !== \"Territory Warfare\")\n continue;\n memberTotal += this.members[i].calculatePower();\n }\n return 0.015 * Math.max(0.002, this.getTerritory()) * memberTotal;\n }\n\n killMember(member: GangMember): void {\n // Player loses a percentage of total respect, plus whatever respect that member has earned\n const totalRespect = this.respect;\n const lostRespect = 0.05 * totalRespect + member.earnedRespect;\n this.respect = Math.max(0, totalRespect - lostRespect);\n\n for (let i = 0; i < this.members.length; ++i) {\n if (member.name === this.members[i].name) {\n this.members.splice(i, 1);\n break;\n }\n }\n\n // Notify of death\n if (this.notifyMemberDeath) {\n dialogBoxCreate(`${member.name} was killed in a gang clash! You lost ${lostRespect} respect`);\n }\n }\n\n ascendMember(member: GangMember, workerScript?: WorkerScript): IAscensionResult {\n try {\n const res = member.ascend();\n this.respect = Math.max(1, this.respect - res.respect);\n if (workerScript) {\n workerScript.log(\"gang.ascendMember\", () => `Ascended Gang member ${member.name}`);\n }\n return res;\n } catch (e: unknown) {\n if (workerScript == null) {\n exceptionAlert(e);\n }\n throw e; // Re-throw, will be caught in the Netscript Function\n }\n }\n\n // Cost of upgrade gets cheaper as gang increases in respect + power\n getDiscount(): number {\n const power = this.getPower();\n const respect = this.respect;\n\n const respectLinearFac = 5e6;\n const powerLinearFac = 1e6;\n const discount =\n Math.pow(respect, 0.01) + respect / respectLinearFac + Math.pow(power, 0.01) + power / powerLinearFac - 1;\n return Math.max(1, discount);\n }\n\n // Returns only valid tasks for this gang. Excludes 'Unassigned'\n getAllTaskNames(): string[] {\n return Object.keys(GangMemberTasks).filter((taskName: string) => {\n const task = GangMemberTasks[taskName];\n if (task == null) return false;\n if (task.name === \"Unassigned\") return false;\n // yes you need both checks\n return this.isHackingGang === task.isHacking || !this.isHackingGang === task.isCombat;\n });\n }\n\n getUpgradeCost(upg: GangMemberUpgrade | null): number {\n if (upg == null) {\n return Infinity;\n }\n return upg.cost / this.getDiscount();\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Gang\", this);\n }\n\n /**\n * Initiatizes a Gang object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Gang {\n return Generic_fromJSON(Gang, value.data);\n }\n}\n\nReviver.constructors.Gang = Gang;\n","import { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function repFromDonation(amt: number, player: IPlayer): number {\n return (amt / CONSTANTS.DonateMoneyToRepDivisor) * player.mults.faction_rep;\n}\n","import { Settings } from \"../Settings/Settings\";\nimport { Remote } from \"./Remote\";\n\nlet server: Remote;\n\nexport function newRemoteFileApiConnection(): void {\n if (server) server.stopConnection();\n if (Settings.RemoteFileApiPort === 0) return;\n server = new Remote(\"localhost\", Settings.RemoteFileApiPort);\n server.startConnection();\n}\n\nexport function isRemoteFileApiConnectionLive(): boolean {\n return server && server.connection != undefined && server.connection.readyState == 1;\n}\n","import { Company } from \"./Company\";\nimport { CompanyPosition } from \"./CompanyPosition\";\n\n/**\n * Returns a string with the given CompanyPosition's stat requirements\n */\n\nexport function getJobRequirementText(company: Company, pos: CompanyPosition, tooltiptext = false): string {\n let reqText = \"\";\n const offset: number = company.jobStatReqOffset;\n const reqHacking: number = pos.requiredHacking > 0 ? pos.requiredHacking + offset : 0;\n const reqStrength: number = pos.requiredStrength > 0 ? pos.requiredStrength + offset : 0;\n const reqDefense: number = pos.requiredDefense > 0 ? pos.requiredDefense + offset : 0;\n const reqDexterity: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqAgility: number = pos.requiredDexterity > 0 ? pos.requiredDexterity + offset : 0;\n const reqCharisma: number = pos.requiredCharisma > 0 ? pos.requiredCharisma + offset : 0;\n const reqRep: number = pos.requiredReputation;\n if (tooltiptext) {\n reqText = \"Requires:
    \";\n reqText += reqHacking.toString() + \" hacking
    \";\n reqText += reqStrength.toString() + \" strength
    \";\n reqText += reqDefense.toString() + \" defense
    \";\n reqText += reqDexterity.toString() + \" dexterity
    \";\n reqText += reqAgility.toString() + \" agility
    \";\n reqText += reqCharisma.toString() + \" charisma
    \";\n reqText += reqRep.toString() + \" reputation\";\n } else {\n reqText = \"(Requires \";\n if (reqHacking > 0) {\n reqText += reqHacking + \" hacking, \";\n }\n if (reqStrength > 0) {\n reqText += reqStrength + \" strength, \";\n }\n if (reqDefense > 0) {\n reqText += reqDefense + \" defense, \";\n }\n if (reqDexterity > 0) {\n reqText += reqDexterity + \" dexterity, \";\n }\n if (reqAgility > 0) {\n reqText += reqAgility + \" agility, \";\n }\n if (reqCharisma > 0) {\n reqText += reqCharisma + \" charisma, \";\n }\n if (reqRep > 1) {\n reqText += reqRep + \" reputation, \";\n }\n reqText = reqText.substring(0, reqText.length - 2);\n reqText += \")\";\n }\n return reqText;\n}\n","/* tslint:disable:max-line-length completed-docs variable-name*/\nimport { IMap } from \"../types\";\n\nexport const TerminalHelpText: string[] = [\n \"Type 'help name' to learn more about the command \",\n \" \",\n ' alias [-g] [name=\"value\"] Create or display Terminal aliases',\n \" analyze Get information about the current machine \",\n \" backdoor Install a backdoor on the current machine \",\n \" buy [-l/-a/program] Purchase a program through the Dark Web\",\n \" cat [file] Display a .msg, .lit, or .txt file\",\n \" cd [dir] Change to a new directory\",\n \" check [script] [args...] Print a script's logs to Terminal\",\n \" clear Clear all text on the terminal \",\n \" cls See 'clear' command \",\n \" connect [hostname] Connects to a remote server\",\n \" cp [src] [dst] Copy a file\",\n \" download [script/text file] Downloads scripts or text files to your computer\",\n \" expr [math expression] Evaluate a mathematical expression\",\n \" free Check the machine's memory (RAM) usage\",\n \" grow Spoof money in a servers bank account, increasing the amount available.\",\n \" hack Hack the current machine\",\n \" help [command] Display this help text, or the help text for a command\",\n \" history [-c] Display the terminal history\",\n \" home Connect to home computer\",\n \" hostname Displays the hostname of the machine\",\n \" kill [script/pid] [args...] Stops the specified script on the current server \",\n \" killall Stops all running scripts on the current machine\",\n \" ls [dir] [--grep pattern] Displays all files on the machine\",\n \" lscpu Displays the number of CPU cores on the machine\",\n \" mem [script] [-t n] Displays the amount of RAM required to run the script\",\n \" mv [src] [dest] Move/rename a text or script file\",\n \" nano [file ...] Text editor - Open up and edit one or more scripts or text files\",\n \" ps Display all scripts that are currently running\",\n \" rm [file] Delete a file from the server\",\n \" run [name] [-t n] [--tail] [args...] Execute a program or script\",\n \" scan Prints all immediately-available network connections\",\n \" scan-analyze [d] [-a] Prints info for all servers up to d nodes away\",\n \" scp [file ...] [server] Copies a file to a destination server\",\n \" sudov Shows whether you have root access on this computer\",\n \" tail [script] [args...] Displays dynamic logs for the specified script\",\n \" top Displays all running scripts and their RAM usage\",\n \" unalias [alias name] Deletes the specified alias\",\n \" vim [file ...] Text editor - Open up and edit one or more scripts or text files in vim mode\",\n \" weaken Reduce the security of the current machine\",\n \" wget [url] [target file] Retrieves code/text from a web server\",\n \" \",\n];\n\nconst TemplatedHelpTexts: IMap<(command: string) => string[]> = {\n scriptEditor: (command) => {\n return [\n `Usage: ${command} [file ...] | [glob]`,\n ` `,\n `Opens up the specified file(s) in the Script Editor. Only scripts (.js, or .script) or text files (.txt) `,\n `can be edited using the Script Editor. If a file does not exist a new one will be created`,\n ` `,\n `If provided a glob as the only argument, ${command} can spider directories and open all matching `,\n `files at once. ${command} cannot create files using globs, so your scripts must already exist.`,\n ` `,\n `Examples:`,\n ` `,\n ` ${command} test.js`,\n ` ${command} test.js test2.js`,\n ` `,\n ` ${command} test.*`,\n ` ${command} /my-dir/*.js`,\n ` `,\n ];\n },\n};\n\nexport const HelpTexts: IMap = {\n alias: [\n 'Usage: alias [-g] [name=\"value\"] ',\n \" \",\n \"Create or display aliases. An alias enables a replacement of a word with another string. \",\n \"It can be used to abbreviate a commonly used command, or commonly used parts of a command. The NAME \",\n \"of an alias defines the word that will be replaced, while the VALUE defines what it will be replaced by. For example, \",\n \"you could create the alias 'nuke' for the Terminal command 'run NUKE.exe' using the following: \",\n \" \",\n ' alias nuke=\"run NUKE.exe\"',\n \" \",\n \"Then, to run the NUKE.exe program you would just have to enter 'nuke' in Terminal rather than the full command. \",\n \"It is important to note that 'default' aliases will only be substituted for the first word of a Terminal command. For \",\n \"example, if the following alias was set: \",\n \" \",\n ' alias worm=\"HTTPWorm.exe\"',\n \" \",\n \"and then you tried to run the following terminal command: \",\n \" \",\n \" run worm\",\n \" \",\n \"This would fail because the worm alias is not the first word of a Terminal command. To allow an alias to be substituted \",\n \"anywhere in a Terminal command, rather than just the first word, you must set it to be a global alias using the -g flag: \",\n \" \",\n ' alias -g worm=\"HTTPWorm.exe\"',\n \" \",\n \"Now, the 'worm' alias will be substituted anytime it shows up as an individual word in a Terminal command. \",\n \" \",\n \"Entering just the command 'alias' without any arguments prints the list of all defined aliases in the reusable form \",\n \"'alias NAME=VALUE' on the Terminal. \",\n \" \",\n \"The 'unalias' command can be used to remove aliases.\",\n \" \",\n ],\n analyze: [\n \"Usage: analyze\",\n \" \",\n \"Prints details and statistics about the current server. The information that is printed includes basic \",\n \"server details such as the hostname, whether the player has root access, what ports are opened/closed, and also \",\n \"hacking-related information such as an estimated chance to successfully hack, an estimate of how much money is \",\n \"available on the server, etc.\",\n \" \",\n ],\n backdoor: [\n \"Usage: backdoor\",\n \" \",\n \"Install a backdoor on the current machine, grants a secret bonus depending on the machine.\",\n \" \",\n \"Requires root access to run.\",\n \" \",\n ],\n buy: [\n \"Usage: buy [-l / -a / program]\",\n \" \",\n \"Purchase a program through the Dark Web. Requires a TOR router to use.\",\n \" \",\n \"If this command is ran with the '-l' flag, it will display a list of all programs that can be bought through the \",\n \"dark web to the Terminal, as well as their costs.\",\n \" \",\n \"If this command is ran with the '-a' flag, it will attempt to purchase all unowned programs.\",\n \" \",\n \"Otherwise, the name of the program must be passed in as a parameter. This name is NOT case-sensitive.\",\n \" \",\n ],\n cat: [\n \"Usage: cat [file]\",\n \" \",\n \"Display message (.msg), literature (.lit), or text (.txt) files. Examples:\",\n \" \",\n \" cat j1.msg\",\n \" \",\n \" cat foo.lit\",\n \" \",\n \" cat servers.txt\",\n \" \",\n ],\n cd: [\n \"Usage: cd [dir]\",\n \" \",\n \"Change to the specified directory. Note that this works even for directories that don't exist. If you \",\n \"change to a directory that does not exist, it will not be 'created'. Examples:\",\n \" \",\n \" cd scripts/hacking\",\n \" \",\n \" cd /logs\",\n \" \",\n \" cd ../\",\n \" \",\n ],\n check: [\n \"Usage: check [script name] [args...]\",\n \" \",\n \"Print the logs of the script specified by the script name and arguments to the Terminal. Each argument must be separated by \",\n \"a space. Remember that a running script is uniquely \",\n \"identified both by its name and the arguments that are used to start it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 1 2 foodnstuff\",\n \" \",\n \"Then to run the 'check' command on this script you would have to pass the same arguments in: \",\n \" \",\n \" check foo.script 1 2 foodnstuff\",\n \" \",\n ],\n clear: [\n \"Usage: clear\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'cls' command\",\n \" \",\n ],\n cls: [\n \"Usage: cls\",\n \" \",\n \"Clear the Terminal screen, deleting all of the text. Note that this does not delete the user's command history, so using the up \",\n \"and down arrow keys is still valid. Also note that this is permanent and there is no way to undo this. Synonymous with 'clear' command\",\n \" \",\n ],\n connect: [\n \"Usage: connect [hostname]\",\n \" \",\n \"Connect to a remote server. The hostname of the remote server must be given as the argument \",\n \"to this command. Note that only servers that are immediately adjacent to the current server in the network and the ones that have\",\n \"a backdoor installed can be connected to. To see which servers can be connected to, use the 'scan' command.\",\n \" \",\n ],\n cp: [\"Usage: cp [src] [dst]\", \" \", \"Copy a file on this server. To copy a file to another server use scp.\", \" \"],\n download: [\n \"Usage: download [script/text file]\",\n \" \",\n \"Downloads a script or text file to your computer (like your real life computer).\",\n \" \",\n \"You can also download all of your scripts/text files as a zip file using the following Terminal commands:\",\n \" \",\n \"Download all scripts and text files: download *\",\n \" \",\n \"Download all scripts: download *.script\",\n \" \",\n \"Download all text files: download *.txt\",\n \" \",\n ],\n expr: [\n \"Usage: expr [mathematical expression]\",\n \" \",\n \"Evaluate a simple mathematical expression. Supports native JavaScript operators:\",\n \" \",\n \"+, -, /, *, **, %\",\n \" \",\n \"Example:\",\n \" \",\n \" expr 25 * 2 ** 10\",\n \" \",\n \"Note that letters (non-digits) are not allowed and will be removed from the input.\",\n \" \",\n ],\n free: [\n \"Usage: free\",\n \" \",\n \"Displays the memory usage on the current machine. Print the amount of RAM that is available on the current server as well as \",\n \"how much of it is being used.\",\n \" \",\n ],\n grow: [\n \"Usage: grow\",\n \" \",\n \"Spoof transactions in the current server. Increasing the money available by hacking. Requires root access.\",\n \"See the wiki page for hacking mechanics.\",\n \" \",\n ],\n hack: [\n \"Usage: hack\",\n \" \",\n \"Attempt to hack the current server. Requires root access in order to be run. See the wiki page for hacking mechanics\",\n \" \",\n ],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Display Terminal help information. Without arguments, 'help' prints a list of all valid Terminal commands and a brief \",\n \"description of their functionality. You can also pass the name of a Terminal command as an argument to 'help' to print \",\n \"more detailed information about the Terminal command. Examples: \",\n \" \",\n \" help alias\",\n \" \",\n \" help scan-analyze\",\n \" \",\n ],\n history: [\n \"Usage: history [-c]\",\n \" \",\n \"Without arguments, displays the terminal command history. To clear the history, pass in the '-c' argument.\",\n \" \",\n ],\n home: [\n \"Usage: home\",\n \" \",\n \"Connect to your home computer. This will work no matter what server you are currently connected to.\",\n \" \",\n ],\n hostname: [\"Usage: hostname\", \" \", \"Prints the hostname of the current server\", \" \"],\n kill: [\n \"Usage: kill [script name] [args...] or kill [pid\",\n \" \",\n \"Kill the script specified by the script name and arguments OR by its PID.\",\n \" \",\n \"If you are killing the script using its filename and arguments, then each \",\n \"argument must be separated by a space. Remember that a running script is \",\n \"uniquely identified by both its name and the arguments that are used to start \",\n \"it. So, if a script was ran with the following arguments:\",\n \" \",\n \" run foo.script 1 sigma-cosmetics\",\n \" \",\n \"Then to kill this script the same arguments would have to be used:\",\n \" \",\n \" kill foo.script 1 sigma-cosmetics\",\n \" \",\n \"If you are killing the script using its PID, then the PID argument must be numeric\",\n \" \",\n ],\n killall: [\n \"Usage: killall\",\n \" \",\n \"Kills all scripts on the current server. \",\n \"Note that after the 'kill' command is issued for a script, it may take a while for the script to actually stop running. \",\n \"This will happen if the script is in the middle of a command such as grow() or weaken() that takes time to execute. \",\n \"The script will not be stopped/killed until after that time has elapsed.\",\n \" \",\n ],\n ls: [\n \"Usage: ls [dir] [-l] [--grep pattern]\",\n \" \",\n \"The ls command, with no arguments, prints all files and directories on the current server's directory to the Terminal screen. \",\n \"The files will be displayed in alphabetical order. \",\n \" \",\n \"The 'dir' optional parameter can be used to display files/directories in another directory.\",\n \" \",\n \"The '-l' optional parameter allows you to force each item onto a single line.\",\n \" \",\n \"The '--grep pattern' optional parameter can be used to only display files whose filenames match the specified pattern.\",\n \" \",\n \"Examples:\",\n \" \",\n \"List all files with the '.script' extension in the current directory:\",\n \" \",\n \" ls -l --grep .script\",\n \" \",\n \"List all files with the '.js' extension in the root directory:\",\n \" \",\n \" ls / -l --grep .js\",\n \" \",\n \"List all files with the word 'purchase' in the filename, in the 'scripts' directory:\",\n \" \",\n \" ls scripts -l --grep purchase\",\n \" \",\n ],\n lscpu: [\"Usage: lscpu\", \" \", \"Prints the number of CPU Cores the current server has\", \" \"],\n\n mem: [\n \"Usage: mem [script name] [-t num_threads]\",\n \" \",\n \"Displays the amount of RAM needed to run the specified script with a single thread. The command can also be used to print \",\n \"the amount of RAM needed to run a script with multiple threads using the '-t' flag. If the '-t' flag is specified, then \",\n \"an argument for the number of threads must be passed in afterwards. Examples:\",\n \" \",\n \" mem foo.script\",\n \" \",\n \" mem foo.script -t 50\",\n \" \",\n \"The first example above will print the amount of RAM needed to run 'foo.script' with a single thread. The second example \",\n \"above will print the amount of RAM needed to run 'foo.script' with 50 threads.\",\n \" \",\n ],\n mv: [\n \"Usage: mv [src] [dest]\",\n \" \",\n \"Move the source file to the specified destination. This can also be used to rename files. \",\n \"This command only works for scripts and text files (.txt). This command CANNOT be used to \",\n \"convert to different file types\",\n \" \",\n \"Note that, unlike the Linux 'mv' command, the destination argument must be the \",\n \"full filepath. \",\n \"Examples: \",\n \" \",\n \" mv hacking-controller.script scripts/hacking-controller.script\",\n \" \",\n \" mv myScript.js myOldScript.js\",\n \" \",\n ],\n nano: TemplatedHelpTexts.scriptEditor(\"nano\"),\n ps: [\"Usage: ps\", \" \", \"Prints all scripts that are running on the current server\", \" \"],\n rm: [\n \"Usage: rm [file]\",\n \" \",\n \"Removes the specified file from the current server. A file can be a script, a program, or a message file. \",\n \" \",\n \"WARNING: This is permanent and cannot be undone\",\n \" \",\n ],\n run: [\n \"Usage: run [file name] [-t] [num threads] [args...]\",\n \" \",\n \"Execute a program, script or coding contract.\",\n \" \",\n \"The '[-t]', '[num threads]', and '[args...]' arguments are only valid when running a script. The '-t' flag is used \",\n \"to indicate that the script should be run with the specified number of threads. If the flag is omitted, \",\n \"then the script will be run with a single thread by default. \",\n \"If the '-t' flag is used, then it MUST come immediately \",\n \"after the script name, and the [num threads] argument MUST come immediately afterwards. \",\n \" \",\n \"[args...] represents a variable number of arguments that will be passed into the script. See the documentation \",\n \"about script arguments. Each specified argument must be separated by a space. \",\n \" \",\n ],\n scan: [\n \"Usage: scan\",\n \" \",\n \"Prints all immediately-available network connection. This will print a list of all servers that you can currently connect \",\n \"to using the 'connect' Terminal command.\",\n \" \",\n ],\n \"scan-analyze\": [\n \"Usage: scan-analyze [depth] [-a]\",\n \" \",\n \"Prints detailed information about all servers up to [depth] nodes away on the network. Calling \",\n \"'scan-analyze 1' will display information for the same servers that are shown by the 'scan' Terminal \",\n \"command. This command also shows the relative paths to reach each server.\",\n \" \",\n \"By default, the maximum depth that can be specified for 'scan-analyze' is 3. However, once you have \",\n \"the DeepscanV1.exe and DeepscanV2.exe programs, you can execute 'scan-analyze' with a depth up to \",\n \"5 and 10, respectively.\",\n \" \",\n \"The information 'scan-analyze' displays about each server includes whether or not you have root access to it, \",\n \"its required hacking level, the number of open ports required to run NUKE.exe on it, and how much RAM \",\n \"it has.\",\n \" \",\n \"By default, this command will not display servers that you have purchased. However, you can pass in the \",\n \"-a flag at the end of the command if you would like to enable that.\",\n \" \",\n ],\n scp: [\n \"Usage: scp [filename ...] [target server]\",\n \" \",\n \"Copies the specified file(s) from the current server to the target server. \",\n \"This command only works for script files (.script or .js extension), literature files (.lit extension), \",\n \"and text files (.txt extension). \",\n \"The second argument passed in must be the hostname or IP of the target server. Examples:\",\n \" \",\n \" scp foo.script n00dles\",\n \" \",\n \" scp foo.script bar.script n00dles\",\n \" \",\n ],\n sudov: [\"Usage: sudov\", \" \", \"Prints whether or not you have root access to the current machine\", \" \"],\n\n tail: [\n \"Usage: tail [script name] [args...]\",\n \" \",\n \"Displays dynamic logs for the script specified by the script name and arguments. Each argument must be separated \",\n \"by a space. Remember that a running script is uniquely identified by both its name and the arguments that were used \",\n \"to run it. So, if a script was ran with the following arguments: \",\n \" \",\n \" run foo.script 10 50000\",\n \" \",\n \"Then in order to check its logs with 'tail' the same arguments must be used: \",\n \" \",\n \" tail foo.script 10 50000\",\n \" \",\n ],\n top: [\n \"Usage: top\",\n \" \",\n \"Prints a list of all scripts running on the current server as well as their thread count and how much \",\n \"RAM they are using in total.\",\n \" \",\n ],\n unalias: [\n \"Usage: unalias [alias name]\",\n \" \",\n \"Deletes the specified alias. Note that the double quotation marks are required. \",\n \" \",\n \"As an example, if an alias was declared using:\",\n \" \",\n ' alias r=\"run\"',\n \" \",\n \"Then it could be removed using:\",\n \" \",\n \" unalias r\",\n \" \",\n \"It is not necessary to differentiate between global and non-global aliases when using 'unalias'\",\n \" \",\n ],\n vim: TemplatedHelpTexts.scriptEditor(\"vim\"),\n weaken: [\n \"Usage: weaken\",\n \" \",\n \"Reduces the security level of the current server. Decreasing the time it takes for all operations on this server.\",\n \"Requires root access. See the wiki page for hacking mechanics.\",\n \" \",\n ],\n wget: [\n \"Usage: wget [url] [target file]\",\n \" \",\n \"Retrieves data from a URL and downloads it to a file on the current server. The data can only \",\n \"be downloaded to a script (.script or .js) or a text file (.txt). If the file already exists, \",\n \"it will be overwritten by this command.\",\n \" \",\n \"Note that it will not be possible to download data from many websites because they do not allow \",\n \"cross-origin resource sharing (CORS). Example:\",\n \" \",\n \" wget https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md game_readme.txt\",\n \" \",\n ],\n};\n","import React from \"react\";\n\nimport { Page } from \"../ui/Router\";\nimport { hash } from \"../hash/hash\";\nimport { CONSTANTS } from \"../Constants\";\n\nenum GameEnv {\n Production,\n Development,\n}\n\nenum Platform {\n Browser,\n Steam,\n}\n\ninterface GameVersion {\n version: string;\n hash: string;\n\n toDisplay: () => string;\n}\n\ninterface BrowserFeatures {\n userAgent: string;\n language: string;\n cookiesEnabled: boolean;\n doNotTrack: string | null;\n indexedDb: boolean;\n}\n\ninterface IErrorMetadata {\n error: Error;\n errorInfo?: React.ErrorInfo;\n page?: Page;\n\n environment: GameEnv;\n platform: Platform;\n version: GameVersion;\n features: BrowserFeatures;\n}\n\nexport interface IErrorData {\n metadata: IErrorMetadata;\n\n title: string;\n body: string;\n\n features: string;\n fileName?: string;\n\n issueUrl: string;\n}\n\nexport const newIssueUrl = `https://github.com/danielyxie/bitburner/issues/new`;\n\nfunction getErrorMetadata(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorMetadata {\n const isElectron = navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1;\n const env = process.env.NODE_ENV === \"development\" ? GameEnv.Development : GameEnv.Production;\n const version: GameVersion = {\n version: CONSTANTS.VersionString,\n hash: hash(),\n toDisplay: () => `v${CONSTANTS.VersionString} (${hash()})`,\n };\n const features: BrowserFeatures = {\n userAgent: navigator.userAgent,\n\n language: navigator.language,\n cookiesEnabled: navigator.cookieEnabled,\n doNotTrack: navigator.doNotTrack,\n indexedDb: !!window.indexedDB,\n };\n const metadata: IErrorMetadata = {\n platform: isElectron ? Platform.Steam : Platform.Browser,\n environment: env,\n version,\n features,\n error,\n errorInfo,\n page,\n };\n return metadata;\n}\n\nexport function getErrorForDisplay(error: Error, errorInfo?: React.ErrorInfo, page?: Page): IErrorData {\n const metadata = getErrorMetadata(error, errorInfo, page);\n const fileName = (metadata.error as any).fileName;\n const features =\n `lang=${metadata.features.language} cookiesEnabled=${metadata.features.cookiesEnabled.toString()}` +\n ` doNotTrack=${metadata.features.doNotTrack ?? \"null\"} indexedDb=${metadata.features.indexedDb.toString()}`;\n\n const title = `${metadata.error.name}: ${metadata.error.message}${metadata.page && ` (at \"${Page[metadata.page]}\")`}`;\n const body = `\n## ${title}\n\n### How did this happen?\n\nPlease fill this information with details if relevant.\n\n- [ ] Save file\n- [ ] Minimal scripts to reproduce the issue\n- [ ] Steps to reproduce\n\n### Environment\n\n* Error: ${metadata.error?.toString() ?? \"n/a\"}\n* Page: ${metadata.page ? Page[metadata.page] : \"n/a\"}\n* Version: ${metadata.version.toDisplay()}\n* Environment: ${GameEnv[metadata.environment]}\n* Platform: ${Platform[metadata.platform]}\n* UserAgent: ${navigator.userAgent}\n* Features: ${features}\n* Source: ${fileName ?? \"n/a\"}\n\n${\n metadata.environment === GameEnv.Development\n ? `\n### Stack Trace\n\\`\\`\\`\n${metadata.errorInfo?.componentStack.toString().trim()}\n\\`\\`\\`\n`\n : \"\"\n}\n### Save\n\\`\\`\\`\nCopy your save here if possible\n\\`\\`\\`\n`.trim();\n\n const issueUrl = `${newIssueUrl}?title=${encodeURIComponent(title)}&body=${encodeURIComponent(body)}`;\n\n const data: IErrorData = {\n metadata,\n fileName,\n features,\n title,\n body,\n issueUrl,\n };\n return data;\n}\n","import { getRandomInt } from \"./getRandomInt\";\n\n/**\n * Gets a random value in the range of a byte (0 - 255), or up to the maximum.\n * @param max The maximum value (up to 255).\n */\nexport function getRandomByte(max: number): number {\n // Technically 2^8 is 256, but the values are 0-255, not 1-256.\n const byteMaximum = 255;\n const upper: number = Math.max(Math.min(max, byteMaximum), 0);\n\n return getRandomInt(0, upper);\n}\n","import { getRandomInt } from \"../../utils/helpers/getRandomInt\";\n\nexport const Growths: {\n [key: string]: (() => number) | undefined;\n [\"Tracking\"]: () => number;\n [\"Bounty Hunter\"]: () => number;\n [\"Retirement\"]: () => number;\n [\"Investigation\"]: () => number;\n [\"Undercover Operation\"]: () => number;\n [\"Sting Operation\"]: () => number;\n [\"Raid\"]: () => number;\n [\"Stealth Retirement Operation\"]: () => number;\n [\"Assassination\"]: () => number;\n} = {\n Tracking: () => getRandomInt(5, 75) / 10,\n \"Bounty Hunter\": () => getRandomInt(5, 75) / 10,\n Retirement: () => getRandomInt(5, 75) / 10,\n Investigation: () => getRandomInt(10, 40) / 10,\n \"Undercover Operation\": () => getRandomInt(10, 40) / 10,\n \"Sting Operation\": () => getRandomInt(3, 40) / 10,\n Raid: () => getRandomInt(2, 40) / 10,\n \"Stealth Retirement Operation\": () => getRandomInt(1, 20) / 10,\n Assassination: () => getRandomInt(1, 20) / 10,\n};\n","/**\n * Utility function that creates a \"city map\", which is an object where\n * each city is a key (property).\n *\n * This map uses the official name of the city, NOT its key in the 'Cities' object\n */\nimport { Cities } from \"./Cities\";\nimport { IMap } from \"../types\";\n\nexport function createCityMap(initValue: T): IMap {\n const map: IMap = {};\n const cities = Object.keys(Cities);\n for (let i = 0; i < cities.length; ++i) {\n map[cities[i]] = initValue;\n }\n\n // round try JSON so to make sure none of the initial values have the same references.\n return JSON.parse(JSON.stringify(map));\n}\n","/**\n * Represents a Hand of cards.\n *\n * This class is IMMUTABLE\n */\n\nimport { Card } from \"./Card\";\n\nexport class Hand {\n constructor(readonly cards: readonly Card[]) {}\n\n addCards(...cards: Card[]): Hand {\n return new Hand([...this.cards, ...cards]);\n }\n\n removeByIndex(i: number): Hand {\n if (i >= this.cards.length) {\n throw new Error(`Tried to remove invalid card from Hand by index: ${i}`);\n }\n\n return new Hand([...this.cards.slice().splice(i, 1)]);\n }\n}\n","/**\n * React Component for a button that initiates a transaction on the Stock Market UI\n * (Buy, Sell, Buy Max, etc.)\n */\nimport * as React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\ntype IProps = {\n onClick: () => void;\n text: string;\n tooltip?: JSX.Element | null;\n};\n\nexport function StockTickerTxButton(props: IProps): React.ReactElement {\n return (\n {props.tooltip} : \"\"}>\n \n \n );\n}\n","import { Box, Table } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { DummyGift } from \"../DummyGift\";\nimport { Grid } from \"./Grid\";\nimport { zeros } from \"../Helper\";\n\ninterface IProps {\n width: number;\n height: number;\n fragments: ActiveFragment[];\n}\n\nexport function DummyGrid(props: IProps): React.ReactElement {\n const gift = new DummyGift(props.width, props.height, props.fragments);\n const ghostGrid = zeros(props.width, props.height);\n return (\n \n \n undefined}\n click={() => undefined}\n />\n
    \n
    \n );\n}\n","/**\n * Abstract Base Class for any Server object\n */\nimport { CodingContract } from \"../CodingContracts\";\nimport { RunningScript } from \"../Script/RunningScript\";\nimport { Script } from \"../Script/Script\";\nimport { isValidFilePath } from \"../Terminal/DirectoryHelpers\";\nimport { TextFile } from \"../TextFile\";\nimport { IReturnStatus } from \"../types\";\n\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\n\nimport { createRandomIp } from \"../utils/IPAddress\";\nimport { compareArrays } from \"../utils/helpers/compareArrays\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\n\ninterface IConstructorParams {\n adminRights?: boolean;\n hostname: string;\n ip?: string;\n isConnectedTo?: boolean;\n maxRam?: number;\n organizationName?: string;\n}\n\ninterface writeResult {\n success: boolean;\n overwritten: boolean;\n}\n\nexport class BaseServer {\n // Coding Contract files on this server\n contracts: CodingContract[] = [];\n\n // How many CPU cores this server has. Maximum of 8.\n // Currently, this only affects hacking missions\n cpuCores = 1;\n\n // Flag indicating whether the FTP port is open\n ftpPortOpen = false;\n\n // Flag indicating whether player has admin/root access to this server\n hasAdminRights = false;\n\n // Hostname. Must be unique\n hostname = \"\";\n\n // Flag indicating whether HTTP Port is open\n httpPortOpen = false;\n\n // IP Address. Must be unique\n ip = \"\";\n\n // Flag indicating whether player is curently connected to this server\n isConnectedTo = false;\n\n // RAM (GB) available on this server\n maxRam = 0;\n\n // Message files AND Literature files on this Server\n messages: string[] = [];\n\n // Name of company/faction/etc. that this server belongs to.\n // Optional, not applicable to all Servers\n organizationName = \"\";\n\n // Programs on this servers. Contains only the names of the programs\n programs: string[] = [];\n\n // RAM (GB) used. i.e. unavailable RAM\n ramUsed = 0;\n\n // RunningScript files on this server\n runningScripts: RunningScript[] = [];\n\n // Script files on this Server\n scripts: Script[] = [];\n\n // Contains the hostnames of all servers that are immediately\n // reachable from this one\n serversOnNetwork: string[] = [];\n\n // Flag indicating whether SMTP Port is open\n smtpPortOpen = false;\n\n // Flag indicating whether SQL Port is open\n sqlPortOpen = false;\n\n // Flag indicating whether the SSH Port is open\n sshPortOpen = false;\n\n // Text files on this server\n textFiles: TextFile[] = [];\n\n // Flag indicating wehther this is a purchased server\n purchasedByPlayer = false;\n\n constructor(params: IConstructorParams = { hostname: \"\", ip: createRandomIp() }) {\n this.ip = params.ip ? params.ip : createRandomIp();\n\n this.hostname = params.hostname;\n this.organizationName = params.organizationName != null ? params.organizationName : \"\";\n this.isConnectedTo = params.isConnectedTo != null ? params.isConnectedTo : false;\n\n //Access information\n this.hasAdminRights = params.adminRights != null ? params.adminRights : false;\n }\n\n addContract(contract: CodingContract): void {\n this.contracts.push(contract);\n }\n\n getContract(contractName: string): CodingContract | null {\n for (const contract of this.contracts) {\n if (contract.fn === contractName) {\n return contract;\n }\n }\n return null;\n }\n\n /**\n * Find an actively running script on this server\n * @param scriptName - Filename of script to search for\n * @param scriptArgs - Arguments that script is being run with\n * @returns RunningScript for the specified active script\n * Returns null if no such script can be found\n */\n getRunningScript(scriptName: string, scriptArgs: ScriptArg[]): RunningScript | null {\n for (const rs of this.runningScripts) {\n if (rs.filename === scriptName && compareArrays(rs.args, scriptArgs)) {\n return rs;\n }\n }\n\n return null;\n }\n\n /**\n * Given the name of the script, returns the corresponding\n * Script object on the server (if it exists)\n */\n getScript(scriptName: string): Script | null {\n for (let i = 0; i < this.scripts.length; i++) {\n if (this.scripts[i].filename === scriptName) {\n return this.scripts[i];\n }\n }\n\n return null;\n }\n\n /**\n * Returns boolean indicating whether the given script is running on this server\n */\n isRunning(fn: string): boolean {\n for (const runningScriptObj of this.runningScripts) {\n if (runningScriptObj.filename === fn) {\n return true;\n }\n }\n\n return false;\n }\n\n removeContract(contract: CodingContract | string): void {\n if (contract instanceof CodingContract) {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract.fn;\n });\n } else {\n this.contracts = this.contracts.filter((c) => {\n return c.fn !== contract;\n });\n }\n }\n\n /**\n * Remove a file from the server\n * @param fn {string} Name of file to be deleted\n * @returns {IReturnStatus} Return status object indicating whether or not file was deleted\n */\n removeFile(fn: string): IReturnStatus {\n if (fn.endsWith(\".exe\") || fn.match(/^.+\\.exe-\\d+(?:\\.\\d*)?%-INC$/) != null) {\n for (let i = 0; i < this.programs.length; ++i) {\n if (this.programs[i] === fn) {\n this.programs.splice(i, 1);\n return { res: true };\n }\n }\n } else if (isScriptFilename(fn)) {\n for (let i = 0; i < this.scripts.length; ++i) {\n if (this.scripts[i].filename === fn) {\n if (this.isRunning(fn)) {\n return {\n res: false,\n msg: \"Cannot delete a script that is currently running!\",\n };\n }\n\n this.scripts.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".lit\")) {\n for (let i = 0; i < this.messages.length; ++i) {\n const f = this.messages[i];\n if (typeof f === \"string\" && f === fn) {\n this.messages.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".txt\")) {\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n this.textFiles.splice(i, 1);\n return { res: true };\n }\n }\n } else if (fn.endsWith(\".cct\")) {\n for (let i = 0; i < this.contracts.length; ++i) {\n if (this.contracts[i].fn === fn) {\n this.contracts.splice(i, 1);\n return { res: true };\n }\n }\n }\n\n return { res: false, msg: \"No such file exists\" };\n }\n\n /**\n * Called when a script is run on this server.\n * All this function does is add a RunningScript object to the\n * `runningScripts` array. It does NOT check whether the script actually can\n * be run.\n */\n runScript(script: RunningScript): void {\n this.runningScripts.push(script);\n }\n\n setMaxRam(ram: number): void {\n this.maxRam = ram;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n updateRamUsed(ram: number, player: IPlayer): void {\n this.ramUsed = ram;\n }\n\n pushProgram(program: string): void {\n if (this.programs.includes(program)) return;\n\n // Remove partially created program if there is one\n const existingPartialExeIndex = this.programs.findIndex((p) => p.startsWith(program));\n // findIndex returns -1 if there is no match, we only want to splice on a match\n if (existingPartialExeIndex > -1) {\n this.programs.splice(existingPartialExeIndex, 1);\n }\n\n this.programs.push(program);\n }\n\n /**\n * Write to a script file\n * Overwrites existing files. Creates new files if the script does not eixst\n */\n writeToScriptFile(player: IPlayer, fn: string, code: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !isScriptFilename(fn)) {\n return ret;\n }\n\n // Check if the script already exists, and overwrite it if it does\n for (let i = 0; i < this.scripts.length; ++i) {\n if (fn === this.scripts[i].filename) {\n const script = this.scripts[i];\n script.code = code;\n script.updateRamUsage(player, this.scripts);\n script.markUpdated();\n ret.overwritten = true;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise, create a new script\n const newScript = new Script(player, fn, code, this.hostname, this.scripts);\n this.scripts.push(newScript);\n ret.success = true;\n return ret;\n }\n\n // Write to a text file\n // Overwrites existing files. Creates new files if the text file does not exist\n writeToTextFile(fn: string, txt: string): writeResult {\n const ret = { success: false, overwritten: false };\n if (!isValidFilePath(fn) || !fn.endsWith(\"txt\")) {\n return ret;\n }\n\n // Check if the text file already exists, and overwrite if it does\n for (let i = 0; i < this.textFiles.length; ++i) {\n if (this.textFiles[i].fn === fn) {\n ret.overwritten = true;\n this.textFiles[i].text = txt;\n ret.success = true;\n return ret;\n }\n }\n\n // Otherwise create a new text file\n const newFile = new TextFile(fn, txt);\n this.textFiles.push(newFile);\n ret.success = true;\n return ret;\n }\n}\n","import React, { useState, useEffect } from \"react\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nimport { CodingContract, CodingContractTypes } from \"../../CodingContracts\";\nimport { CopyableText } from \"./CopyableText\";\nimport { Modal } from \"./Modal\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n c: CodingContract;\n onClose: () => void;\n onAttempt: (answer: string) => void;\n}\n\nexport const CodingContractEvent = new EventEmitter<[IProps]>();\n\nexport function CodingContractModal(): React.ReactElement {\n const [props, setProps] = useState(null);\n const [answer, setAnswer] = useState(\"\");\n\n useEffect(() => {\n CodingContractEvent.subscribe((props) => setProps(props));\n });\n if (props === null) return <>;\n\n function onChange(event: React.ChangeEvent): void {\n setAnswer(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (props === null) return;\n // React just won't cooperate on this one.\n // \"React.KeyboardEvent\" seems like the right type but\n // whatever ...\n const value = (event.target as any).value;\n\n if (event.key === KEY.ENTER && value !== \"\") {\n event.preventDefault();\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }\n }\n\n function close(): void {\n if (props === null) return;\n props.onClose();\n setProps(null);\n }\n\n const contractType = CodingContractTypes[props.c.type];\n const description = [];\n for (const [i, value] of contractType.desc(props.c.data).split(\"\\n\").entries())\n description.push(\" }}>);\n return (\n \n \n \n You are attempting to solve a Coding Contract. You have {props.c.getMaxNumTries() - props.c.tries} tries\n remaining, after which the contract will self-destruct.\n \n
    \n {description}\n
    \n {\n props.onAttempt(answer);\n setAnswer(\"\");\n close();\n }}\n >\n Solve\n \n ),\n }}\n />\n
    \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const BitFlumeEvent = new EventEmitter<[]>();\n\nexport function BitFlumeModal(): React.ReactElement {\n const router = use.Router();\n const [open, setOpen] = useState(false);\n function flume(): void {\n router.toBitVerse(true, false);\n setOpen(false);\n }\n\n useEffect(() => BitFlumeEvent.subscribe(() => setOpen(true)), []);\n\n return (\n setOpen(false)}>\n \n WARNING: USING THIS PROGRAM WILL CAUSE YOU TO LOSE ALL OF YOUR PROGRESS ON THE CURRENT BITNODE.\n
    \n
    \n Do you want to travel to the BitNode Nexus? This allows you to reset the current BitNode and select a new one.\n
    \n
    \n
    \n \n
    \n );\n}\n","import * as augmentationMethods from \"./PlayerObjectAugmentationMethods\";\nimport * as bladeburnerMethods from \"./PlayerObjectBladeburnerMethods\";\nimport * as corporationMethods from \"./PlayerObjectCorporationMethods\";\nimport * as gangMethods from \"./PlayerObjectGangMethods\";\nimport * as generalMethods from \"./PlayerObjectGeneralMethods\";\nimport * as serverMethods from \"./PlayerObjectServerMethods\";\nimport * as workMethods from \"./PlayerObjectWorkMethods\";\n\nimport { IMap } from \"../../types\";\nimport { Sleeve } from \"../Sleeve/Sleeve\";\nimport { IPlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Company } from \"../../Company/Company\";\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { ICodingContractReward } from \"../../CodingContracts\";\n\nimport { IPlayer } from \"../IPlayer\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\nimport { IPlayerOwnedAugmentation } from \"../../Augmentation/PlayerOwnedAugmentation\";\nimport { ICorporation } from \"../../Corporation/ICorporation\";\nimport { IGang } from \"../../Gang/IGang\";\nimport { IBladeburner } from \"../../Bladeburner/IBladeburner\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\n\nimport { HashManager } from \"../../Hacknet/HashManager\";\nimport { CityName } from \"../../Locations/data/CityNames\";\n\nimport { MoneySourceTracker } from \"../../utils/MoneySourceTracker\";\nimport { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../../utils/JSONReviver\";\nimport { ISkillProgress } from \"../formulas/skill\";\nimport { PlayerAchievement } from \"../../Achievements/Achievements\";\nimport { cyrb53 } from \"../../utils/StringHelperFunctions\";\nimport { getRandomInt } from \"../../utils/helpers/getRandomInt\";\nimport { ITaskTracker } from \"../ITaskTracker\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { Work } from \"src/Work/Work\";\nimport { defaultMultipliers, Multipliers } from \"../Multipliers\";\nimport { HP } from \"../HP\";\nimport { Skills } from \"../Skills\";\n\nexport class PlayerObject implements IPlayer {\n // Class members\n augmentations: IPlayerOwnedAugmentation[];\n bitNodeN: number;\n city: CityName;\n corporation: ICorporation | null;\n gang: IGang | null;\n bladeburner: IBladeburner | null;\n currentServer: string;\n factions: string[];\n factionInvitations: string[];\n hacknetNodes: (HacknetNode | string)[]; // HacknetNode object or IP of Hacknet Server\n has4SData: boolean;\n has4SDataTixApi: boolean;\n hashManager: HashManager;\n hasTixApiAccess: boolean;\n hasWseAccount: boolean;\n jobs: IMap;\n init: () => void;\n karma: number;\n numPeopleKilled: number;\n location: LocationName;\n money: number;\n moneySourceA: MoneySourceTracker;\n moneySourceB: MoneySourceTracker;\n playtimeSinceLastAug: number;\n playtimeSinceLastBitnode: number;\n purchasedServers: string[];\n queuedAugmentations: IPlayerOwnedAugmentation[];\n scriptProdSinceLastAug: number;\n sleeves: Sleeve[];\n sleevesFromCovenant: number;\n sourceFiles: IPlayerOwnedSourceFile[];\n exploits: Exploit[];\n achievements: PlayerAchievement[];\n terminalCommandHistory: string[];\n identifier: string;\n lastUpdate: number;\n lastSave: number;\n totalPlaytime: number;\n\n hp: HP;\n skills: Skills;\n exp: Skills;\n\n mults: Multipliers;\n\n currentWork: Work | null;\n focus: boolean;\n\n entropy: number;\n\n // Methods\n startWork: (w: Work) => void;\n processWork: (cycles: number) => void;\n finishWork: (cancelled: boolean) => void;\n applyForAgentJob: (sing?: boolean) => boolean;\n applyForBusinessConsultantJob: (sing?: boolean) => boolean;\n applyForBusinessJob: (sing?: boolean) => boolean;\n applyForEmployeeJob: (sing?: boolean) => boolean;\n applyForItJob: (sing?: boolean) => boolean;\n applyForJob: (entryPosType: CompanyPosition, sing?: boolean) => boolean;\n applyForNetworkEngineerJob: (sing?: boolean) => boolean;\n applyForPartTimeEmployeeJob: (sing?: boolean) => boolean;\n applyForPartTimeWaiterJob: (sing?: boolean) => boolean;\n applyForSecurityEngineerJob: (sing?: boolean) => boolean;\n applyForSecurityJob: (sing?: boolean) => boolean;\n applyForSoftwareConsultantJob: (sing?: boolean) => boolean;\n applyForSoftwareJob: (sing?: boolean) => boolean;\n applyForWaiterJob: (sing?: boolean) => boolean;\n canAccessBladeburner: () => boolean;\n canAccessCorporation: () => boolean;\n canAccessGang: () => boolean;\n canAccessGrafting: () => boolean;\n canAfford: (cost: number) => boolean;\n gainHackingExp: (exp: number) => void;\n gainStrengthExp: (exp: number) => void;\n gainDefenseExp: (exp: number) => void;\n gainDexterityExp: (exp: number) => void;\n gainAgilityExp: (exp: number) => void;\n gainCharismaExp: (exp: number) => void;\n gainIntelligenceExp: (exp: number) => void;\n gainStats: (retValue: ITaskTracker) => void;\n gainMoney: (money: number, source: string) => void;\n getCurrentServer: () => BaseServer;\n getGangFaction: () => Faction;\n getGangName: () => string;\n getHomeComputer: () => Server;\n getNextCompanyPosition: (company: Company, entryPosType: CompanyPosition) => CompanyPosition | null;\n getUpgradeHomeRamCost: () => number;\n getUpgradeHomeCoresCost: () => number;\n gotoLocation: (to: LocationName) => boolean;\n hasAugmentation: (aug: string | Augmentation, installed?: boolean) => boolean;\n hasCorporation: () => boolean;\n hasGangWith: (facName: string) => boolean;\n hasTorRouter: () => boolean;\n hasProgram: (program: string) => boolean;\n inBladeburner: () => boolean;\n inGang: () => boolean;\n isAwareOfGang: () => boolean;\n isQualified: (company: Company, position: CompanyPosition) => boolean;\n loseMoney: (money: number, source: string) => void;\n reapplyAllAugmentations: (resetMultipliers?: boolean) => void;\n reapplyAllSourceFiles: () => void;\n regenerateHp: (amt: number) => void;\n recordMoneySource: (amt: number, source: string) => void;\n setMoney: (amt: number) => void;\n startBladeburner: () => void;\n startCorporation: (corpName: string, additionalShares?: number) => void;\n startFocusing: () => void;\n startGang: (facName: string, isHacking: boolean) => void;\n takeDamage: (amt: number) => boolean;\n travel: (to: CityName) => boolean;\n giveExploit: (exploit: Exploit) => void;\n giveAchievement: (achievementId: string) => void;\n queryStatFromString: (str: string) => number;\n getIntelligenceBonus: (weight: number) => number;\n getCasinoWinnings: () => number;\n quitJob: (company: string, sing?: boolean) => void;\n hasJob: () => boolean;\n createHacknetServer: () => HacknetServer;\n queueAugmentation: (augmentationName: string) => void;\n receiveInvite: (factionName: string) => void;\n updateSkillLevels: () => void;\n gainCodingContractReward: (reward: ICodingContractReward, difficulty?: number) => string;\n stopFocusing: () => void;\n resetMultipliers: () => void;\n prestigeAugmentation: () => void;\n prestigeSourceFile: () => void;\n calculateSkill: (exp: number, mult?: number) => number;\n calculateSkillProgress: (exp: number, mult?: number) => ISkillProgress;\n hospitalize: () => void;\n checkForFactionInvitations: () => Faction[];\n setBitNodeNumber: (n: number) => void;\n canAccessCotMG: () => boolean;\n sourceFileLvl: (n: number) => number;\n applyEntropy: (stacks?: number) => void;\n focusPenalty: () => number;\n\n constructor() {\n this.hp = { current: 10, max: 10 };\n this.skills = {\n hacking: 1,\n strength: 1,\n defense: 1,\n dexterity: 1,\n agility: 1,\n charisma: 1,\n intelligence: 0,\n };\n this.exp = {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n };\n\n this.mults = defaultMultipliers();\n\n //Money\n this.money = 1000 + CONSTANTS.Donations;\n\n //Location information\n this.city = CityName.Sector12;\n this.location = LocationName.TravelAgency;\n\n // Jobs that the player holds\n // Map of company name (key) -> name of company position (value. Just the name, not the CompanyPosition object)\n // The CompanyPosition name must match a key value in CompanyPositions\n this.jobs = {};\n\n // Servers\n this.currentServer = \"\"; //hostname of Server currently being accessed through termina;\n this.purchasedServers = []; //hostnames of purchased server;\n\n // Hacknet Nodes/Servers\n this.hacknetNodes = []; // Note= For Hacknet Servers, this array holds the hostnames of the server;\n this.hashManager = new HashManager();\n\n //Factions\n this.factions = []; //Names of all factions player has joine;\n this.factionInvitations = []; //Outstanding faction invitation;\n\n //Augmentations\n this.queuedAugmentations = [];\n this.augmentations = [];\n\n this.sourceFiles = [];\n\n //Crime statistics\n this.numPeopleKilled = 0;\n this.karma = 0;\n\n //Stock Market\n this.hasWseAccount = false;\n this.hasTixApiAccess = false;\n this.has4SData = false;\n this.has4SDataTixApi = false;\n\n //Gang\n this.gang = null;\n\n //Corporation\n this.corporation = null;\n\n //Bladeburner\n this.bladeburner = null;\n\n // Sleeves & Re-sleeving\n this.sleeves = [];\n this.sleevesFromCovenant = 0; // # of Duplicate sleeves purchased from the covenant\n //bitnode\n this.bitNodeN = 1;\n\n this.entropy = 0;\n\n //Used to store the last update time.\n this.lastUpdate = 0;\n this.lastSave = 0;\n this.totalPlaytime = 0;\n\n this.playtimeSinceLastAug = 0;\n this.playtimeSinceLastBitnode = 0;\n\n // Keep track of where money comes from\n this.moneySourceA = new MoneySourceTracker(); // Where money comes from since last-installed Augmentation\n this.moneySourceB = new MoneySourceTracker(); // Where money comes from for this entire BitNode run\n // Production since last Augmentation installation\n this.scriptProdSinceLastAug = 0;\n\n this.exploits = [];\n this.achievements = [];\n this.terminalCommandHistory = [];\n\n this.focus = false;\n this.currentWork = null;\n\n // Let's get a hash of some semi-random stuff so we have something unique.\n this.identifier = cyrb53(\n \"I-\" +\n new Date().getTime() +\n navigator.userAgent +\n window.innerWidth +\n window.innerHeight +\n getRandomInt(100, 999),\n );\n\n this.init = generalMethods.init;\n this.prestigeAugmentation = generalMethods.prestigeAugmentation;\n this.prestigeSourceFile = generalMethods.prestigeSourceFile;\n this.receiveInvite = generalMethods.receiveInvite;\n this.calculateSkill = generalMethods.calculateSkill;\n this.calculateSkillProgress = generalMethods.calculateSkillProgress;\n this.updateSkillLevels = generalMethods.updateSkillLevels;\n this.resetMultipliers = generalMethods.resetMultipliers;\n this.hasProgram = generalMethods.hasProgram;\n this.setMoney = generalMethods.setMoney;\n this.gainMoney = generalMethods.gainMoney;\n this.loseMoney = generalMethods.loseMoney;\n this.canAfford = generalMethods.canAfford;\n this.recordMoneySource = generalMethods.recordMoneySource;\n this.gainHackingExp = generalMethods.gainHackingExp;\n this.gainStrengthExp = generalMethods.gainStrengthExp;\n this.gainDefenseExp = generalMethods.gainDefenseExp;\n this.gainDexterityExp = generalMethods.gainDexterityExp;\n this.gainAgilityExp = generalMethods.gainAgilityExp;\n this.gainCharismaExp = generalMethods.gainCharismaExp;\n this.gainIntelligenceExp = generalMethods.gainIntelligenceExp;\n this.gainStats = generalMethods.gainStats;\n this.queryStatFromString = generalMethods.queryStatFromString;\n this.startWork = workMethods.start;\n this.processWork = workMethods.process;\n this.finishWork = workMethods.finish;\n this.startFocusing = generalMethods.startFocusing;\n this.stopFocusing = generalMethods.stopFocusing;\n this.takeDamage = generalMethods.takeDamage;\n this.regenerateHp = generalMethods.regenerateHp;\n this.hospitalize = generalMethods.hospitalize;\n this.applyForJob = generalMethods.applyForJob;\n this.getNextCompanyPosition = generalMethods.getNextCompanyPosition;\n this.quitJob = generalMethods.quitJob;\n this.hasJob = generalMethods.hasJob;\n this.applyForSoftwareJob = generalMethods.applyForSoftwareJob;\n this.applyForSoftwareConsultantJob = generalMethods.applyForSoftwareConsultantJob;\n this.applyForItJob = generalMethods.applyForItJob;\n this.applyForSecurityEngineerJob = generalMethods.applyForSecurityEngineerJob;\n this.applyForNetworkEngineerJob = generalMethods.applyForNetworkEngineerJob;\n this.applyForBusinessJob = generalMethods.applyForBusinessJob;\n this.applyForBusinessConsultantJob = generalMethods.applyForBusinessConsultantJob;\n this.applyForSecurityJob = generalMethods.applyForSecurityJob;\n this.applyForAgentJob = generalMethods.applyForAgentJob;\n this.applyForEmployeeJob = generalMethods.applyForEmployeeJob;\n this.applyForPartTimeEmployeeJob = generalMethods.applyForPartTimeEmployeeJob;\n this.applyForWaiterJob = generalMethods.applyForWaiterJob;\n this.applyForPartTimeWaiterJob = generalMethods.applyForPartTimeWaiterJob;\n this.isQualified = generalMethods.isQualified;\n this.reapplyAllAugmentations = generalMethods.reapplyAllAugmentations;\n this.reapplyAllSourceFiles = generalMethods.reapplyAllSourceFiles;\n this.checkForFactionInvitations = generalMethods.checkForFactionInvitations;\n this.setBitNodeNumber = generalMethods.setBitNodeNumber;\n this.queueAugmentation = generalMethods.queueAugmentation;\n this.gainCodingContractReward = generalMethods.gainCodingContractReward;\n this.travel = generalMethods.travel;\n this.gotoLocation = generalMethods.gotoLocation;\n this.canAccessGrafting = generalMethods.canAccessGrafting;\n this.giveExploit = generalMethods.giveExploit;\n this.giveAchievement = generalMethods.giveAchievement;\n this.getIntelligenceBonus = generalMethods.getIntelligenceBonus;\n this.getCasinoWinnings = generalMethods.getCasinoWinnings;\n this.hasAugmentation = augmentationMethods.hasAugmentation;\n this.canAccessBladeburner = bladeburnerMethods.canAccessBladeburner;\n this.inBladeburner = bladeburnerMethods.inBladeburner;\n this.startBladeburner = bladeburnerMethods.startBladeburner;\n this.canAccessCorporation = corporationMethods.canAccessCorporation;\n this.hasCorporation = corporationMethods.hasCorporation;\n this.startCorporation = corporationMethods.startCorporation;\n this.canAccessGang = gangMethods.canAccessGang;\n this.isAwareOfGang = gangMethods.isAwareOfGang;\n this.getGangFaction = gangMethods.getGangFaction;\n this.getGangName = gangMethods.getGangName;\n this.hasGangWith = gangMethods.hasGangWith;\n this.inGang = gangMethods.inGang;\n this.startGang = gangMethods.startGang;\n\n this.hasTorRouter = serverMethods.hasTorRouter;\n this.getCurrentServer = serverMethods.getCurrentServer;\n this.getHomeComputer = serverMethods.getHomeComputer;\n this.getUpgradeHomeRamCost = serverMethods.getUpgradeHomeRamCost;\n this.getUpgradeHomeCoresCost = serverMethods.getUpgradeHomeCoresCost;\n this.createHacknetServer = serverMethods.createHacknetServer;\n\n this.canAccessCotMG = generalMethods.canAccessCotMG;\n this.sourceFileLvl = generalMethods.sourceFileLvl;\n\n this.applyEntropy = augmentationMethods.applyEntropy;\n this.focusPenalty = generalMethods.focusPenalty;\n }\n\n whoAmI(): string {\n return \"Player\";\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"PlayerObject\", this);\n }\n\n /**\n * Initiatizes a PlayerObject object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): PlayerObject {\n return Generic_fromJSON(PlayerObject, value.data);\n }\n}\n\nReviver.constructors.PlayerObject = PlayerObject;\n","import React, { useState, useEffect } from \"react\";\nimport { joinFaction } from \"../FactionHelpers\";\nimport { Faction } from \"../Faction\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport { EventEmitter } from \"../../utils/EventEmitter\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nexport const InvitationEvent = new EventEmitter<[Faction]>();\n\nexport function InvitationModal(): React.ReactElement {\n const [faction, setFaction] = useState(null);\n const player = use.Player();\n function join(): void {\n if (faction === null) return;\n //Remove from invited factions\n const i = player.factionInvitations.findIndex((facName) => facName === faction.name);\n if (i === -1) {\n console.error(\"Could not find faction in Player.factionInvitations\");\n }\n joinFaction(faction);\n setFaction(null);\n }\n\n useEffect(() => InvitationEvent.subscribe((faction) => setFaction(faction)), []);\n\n return (\n setFaction(null)}>\n You have received a faction invitation.\n \n Would you like to join {(faction || { name: \"\" }).name}?
    \n
    \n Warning: Joining this faction may prevent you from joining other factions during this run!\n
    \n \n \n
    \n );\n}\n","import * as acorn from \"acorn\";\n/**\n * @license\n * JavaScript Interpreter\n *\n * Copyright 2013 Google Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @fileoverview Interpreting JavaScript in JavaScript.\n * @author fraser@google.com (Neil Fraser)\n */\n(\"use strict\");\n\n/**\n * Create a new interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n * @param {Function=} opt_initFunc Optional initialization function. Used to\n * define APIs. When called it is passed the interpreter object and the\n * global scope object.\n * @param {Number} Bitburner-specific number used for determining exception line numbers\n * @constructor\n */\nvar Interpreter = function (code, opt_initFunc, lineOffset = 0) {\n this.sourceCode = code;\n this.sourceCodeLineOffset = lineOffset;\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n this.ast = code;\n this.initFunc_ = opt_initFunc;\n this.paused_ = false;\n this.polyfills_ = [];\n // Unique identifier for native functions. Used in serialization.\n this.functionCounter_ = 0;\n // Map node types to our step function names; a property lookup is faster\n // than string concatenation with \"step\" prefix.\n this.stepFunctions_ = Object.create(null);\n var stepMatch = /^step([A-Z]\\w*)$/;\n var m;\n for (var methodName in this) {\n if (typeof this[methodName] === \"function\" && (m = methodName.match(stepMatch))) {\n this.stepFunctions_[m[1]] = this[methodName].bind(this);\n }\n }\n // Create and initialize the global scope.\n this.global = this.createScope(this.ast, null);\n // Run the polyfills.\n this.ast = acorn.parse(this.polyfills_.join(\"\\n\"), Interpreter.PARSE_OPTIONS);\n this.polyfills_ = undefined; // Allow polyfill strings to garbage collect.\n this.stripLocations_(this.ast, undefined, undefined);\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack = [state];\n this.run();\n this.value = undefined;\n // Point at the main program.\n this.ast = code;\n var state = new Interpreter.State(this.ast, this.global);\n state.done = false;\n this.stateStack.length = 0;\n this.stateStack[0] = state;\n // Get a handle on Acorn's node_t object. It's tricky to access.\n this.nodeConstructor = state.node.constructor;\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"stateStack\"] = this.stateStack;\n};\n\n/**\n * @const {!Object} Configuration used for all Acorn parsing.\n */\nInterpreter.PARSE_OPTIONS = {\n ecmaVersion: 5,\n locations: true,\n};\n\n/**\n * Property descriptor of readonly properties.\n */\nInterpreter.READONLY_DESCRIPTOR = {\n configurable: true,\n enumerable: true,\n writable: false,\n};\n\n/**\n * Property descriptor of non-enumerable properties.\n */\nInterpreter.NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: true,\n};\n\n/**\n * Property descriptor of readonly, non-enumerable properties.\n */\nInterpreter.READONLY_NONENUMERABLE_DESCRIPTOR = {\n configurable: true,\n enumerable: false,\n writable: false,\n};\n\n/**\n * Property descriptor of variables.\n */\nInterpreter.VARIABLE_DESCRIPTOR = {\n configurable: false,\n enumerable: true,\n writable: true,\n};\n\n/**\n * Unique symbol for indicating that a step has encountered an error, has\n * added it to the stack, and will be thrown within the user's program.\n * When STEP_ERROR is thrown in the JS-Interpreter, the error can be ignored.\n */\nInterpreter.STEP_ERROR = {};\n\n/**\n * Unique symbol for indicating that a reference is a variable on the scope,\n * not an object property.\n */\nInterpreter.SCOPE_REFERENCE = {};\n\n/**\n * Unique symbol for indicating, when used as the value of the value\n * parameter in calls to setProperty and friends, that the value\n * should be taken from the property descriptor instead.\n */\nInterpreter.VALUE_IN_DESCRIPTOR = {};\n\n/**\n * For cycle detection in array to string and error conversion;\n * see spec bug github.com/tc39/ecma262/issues/289\n * Since this is for atomic actions only, it can be a class property.\n */\nInterpreter.toStringCycles_ = [];\n\n/**\n * Determine error/exception line number in Bitburner source code\n * @param {Object} AST Node that causes Error/Exception\n */\nInterpreter.prototype.getErrorLineNumber = function (node) {\n var code = this.sourceCode;\n if (node == null || node.start == null) {\n return NaN;\n }\n try {\n code = code.substring(0, node.start);\n return (code.match(/\\n/g) || []).length + 1 - this.sourceCodeLineOffset;\n } catch (e) {\n return NaN;\n }\n};\n\n/**\n * Generate the appropriate line number error message for Bitburner\n * @param {Number} lineNumber\n */\nInterpreter.prototype.getErrorLineNumberMessage = function (lineNumber) {\n if (isNaN(lineNumber)) {\n return \" (Unknown line number)\";\n } else if (lineNumber <= 0) {\n return \" (Error occurred in an imported function)\";\n } else {\n return (\n \" (Line Number \" +\n lineNumber +\n \". This line number is probably incorrect \" +\n \"if your script is importing any functions. This is being worked on)\"\n );\n }\n};\n\n/**\n * Add more code to the interpreter.\n * @param {string|!Object} code Raw JavaScript text or AST.\n */\nInterpreter.prototype.appendCode = function (code) {\n var state = this.stateStack[0];\n if (!state || state.node[\"type\"] !== \"Program\") {\n throw Error(\"Expecting original AST to start with a Program node.\");\n }\n if (typeof code === \"string\") {\n code = acorn.parse(code, Interpreter.PARSE_OPTIONS);\n }\n if (!code || code[\"type\"] !== \"Program\") {\n throw Error(\"Expecting new AST to start with a Program node.\");\n }\n this.populateScope_(code, state.scope);\n // Append the new program to the old one.\n for (var i = 0, node; (node = code[\"body\"][i]); i++) {\n state.node[\"body\"].push(node);\n }\n state.done = false;\n};\n\n/**\n * Execute one step of the interpreter.\n * @return {boolean} True if a step was executed, false if no more instructions.\n */\nInterpreter.prototype.step = function () {\n var stack = this.stateStack;\n var state = stack[stack.length - 1];\n if (!state) {\n return false;\n }\n var node = state.node,\n type = node[\"type\"];\n if (type === \"Program\" && state.done) {\n return false;\n } else if (this.paused_) {\n return true;\n }\n try {\n var nextState = this.stepFunctions_[type](stack, state, node);\n } catch (e) {\n // Eat any step errors. They have been thrown on the stack.\n if (e !== Interpreter.STEP_ERROR) {\n // Uh oh. This is a real error in the JS-Interpreter. Rethrow.\n throw e;\n }\n }\n if (nextState) {\n stack.push(nextState);\n }\n if (!node[\"end\"]) {\n // This is polyfill code. Keep executing until we arrive at user code.\n return this.step();\n }\n return true;\n};\n\n/**\n * Execute the interpreter to program completion. Vulnerable to infinite loops.\n * @return {boolean} True if a execution is asynchronously blocked,\n * false if no more instructions.\n */\nInterpreter.prototype.run = function () {\n while (!this.paused_ && this.step()) {}\n return this.paused_;\n};\n\n/**\n * Initialize the global scope with buitin properties and functions.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initGlobalScope = function (scope) {\n // Initialize uneditable global properties.\n this.setProperty(scope, \"NaN\", NaN, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"Infinity\", Infinity, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"undefined\", undefined, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"window\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"this\", scope, Interpreter.READONLY_DESCRIPTOR);\n this.setProperty(scope, \"self\", scope); // Editable.\n\n // Create the objects which will become Object.prototype and\n // Function.prototype, which are needed to bootstrap everything else.\n this.OBJECT_PROTO = new Interpreter.Object(null);\n this.FUNCTION_PROTO = new Interpreter.Object(this.OBJECT_PROTO);\n // Initialize global objects.\n this.initFunction(scope);\n this.initObject(scope);\n // Unable to set scope's parent prior (OBJECT did not exist).\n // Note that in a browser this would be 'Window', whereas in Node.js it would\n // be 'Object'. This interpreter is closer to Node in that it has no DOM.\n scope.proto = this.OBJECT_PROTO;\n this.setProperty(scope, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.initArray(scope);\n this.initString(scope);\n this.initBoolean(scope);\n this.initNumber(scope);\n this.initDate(scope);\n this.initRegExp(scope);\n this.initError(scope);\n this.initMath(scope);\n this.initJSON(scope);\n\n // Initialize global functions.\n var thisInterpreter = this;\n var func = this.createNativeFunction(function (x) {\n throw EvalError(\"Can't happen\");\n }, false);\n func.eval = true;\n this.setProperty(scope, \"eval\", func);\n\n this.setProperty(scope, \"parseInt\", this.createNativeFunction(parseInt, false));\n this.setProperty(scope, \"parseFloat\", this.createNativeFunction(parseFloat, false));\n\n this.setProperty(scope, \"isNaN\", this.createNativeFunction(isNaN, false));\n\n this.setProperty(scope, \"isFinite\", this.createNativeFunction(isFinite, false));\n\n var strFunctions = [\n [escape, \"escape\"],\n [unescape, \"unescape\"],\n [decodeURI, \"decodeURI\"],\n [decodeURIComponent, \"decodeURIComponent\"],\n [encodeURI, \"encodeURI\"],\n [encodeURIComponent, \"encodeURIComponent\"],\n ];\n for (var i = 0; i < strFunctions.length; i++) {\n var wrapper = (function (nativeFunc) {\n return function (str) {\n try {\n return nativeFunc(str);\n } catch (e) {\n // decodeURI('%xy') will throw an error. Catch and rethrow.\n thisInterpreter.throwException(thisInterpreter.URI_ERROR, e.message);\n }\n };\n })(strFunctions[i][0]);\n this.setProperty(\n scope,\n strFunctions[i][1],\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n // Preserve publicly properties from being pruned/renamed by JS compilers.\n // Add others as needed.\n this[\"OBJECT\"] = this.OBJECT;\n this[\"OBJECT_PROTO\"] = this.OBJECT_PROTO;\n this[\"FUNCTION\"] = this.FUNCTION;\n this[\"FUNCTION_PROTO\"] = this.FUNCTION_PROTO;\n this[\"ARRAY\"] = this.ARRAY;\n this[\"ARRAY_PROTO\"] = this.ARRAY_PROTO;\n this[\"REGEXP\"] = this.REGEXP;\n this[\"REGEXP_PROTO\"] = this.REGEXP_PROTO;\n this[\"DATE\"] = this.DATE;\n this[\"DATE_PROTO\"] = this.DATE_PROTO;\n // The following properties are obsolete. Do not use.\n this[\"UNDEFINED\"] = undefined;\n this[\"NULL\"] = null;\n this[\"NAN\"] = NaN;\n this[\"TRUE\"] = true;\n this[\"FALSE\"] = false;\n this[\"STRING_EMPTY\"] = \"\";\n this[\"NUMBER_ZERO\"] = 0;\n this[\"NUMBER_ONE\"] = 1;\n\n // Run any user-provided initialization.\n if (this.initFunc_) {\n this.initFunc_(this, scope);\n }\n};\n\n/**\n * Initialize the Function class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initFunction = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n var identifierRegexp = /^[A-Za-z_$][\\w$]*$/;\n // Function constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Function().\n var newFunc = this;\n } else {\n // Called as Function().\n var newFunc = thisInterpreter.createObjectProto(thisInterpreter.FUNCTION_PROTO);\n }\n if (arguments.length) {\n var code = String(arguments[arguments.length - 1]);\n } else {\n var code = \"\";\n }\n var argsStr = Array.prototype.slice.call(arguments, 0, -1).join(\",\").trim();\n if (argsStr) {\n var args = argsStr.split(/\\s*,\\s*/);\n for (var i = 0; i < args.length; i++) {\n var name = args[i];\n if (!identifierRegexp.test(name)) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid function argument: \" + name);\n }\n }\n argsStr = args.join(\", \");\n }\n // Interestingly, the scope for constructed functions is the global scope,\n // even if they were constructed in some other scope.\n newFunc.parentScope = thisInterpreter.global;\n // Acorn needs to parse code in the context of a function or else 'return'\n // statements will be syntax errors.\n try {\n var ast = acorn.parse(\"(function(\" + argsStr + \") {\" + code + \"})\", Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code: \" + e.message);\n }\n if (ast[\"body\"].length !== 1) {\n // Function('a', 'return a + 6;}; {alert(1);');\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, \"Invalid code in function body.\");\n }\n newFunc.node = ast[\"body\"][0][\"expression\"];\n thisInterpreter.setProperty(newFunc, \"length\", newFunc.node[\"length\"], Interpreter.READONLY_DESCRIPTOR);\n return newFunc;\n };\n wrapper.id = this.functionCounter_++;\n this.FUNCTION = this.createObjectProto(this.FUNCTION_PROTO);\n\n this.setProperty(scope, \"Function\", this.FUNCTION);\n // Manually setup type and prototype because createObj doesn't recognize\n // this object as a function (this.FUNCTION did not exist).\n this.setProperty(this.FUNCTION, \"prototype\", this.FUNCTION_PROTO);\n this.FUNCTION.nativeFunc = wrapper;\n\n // Configure Function.prototype.\n this.setProperty(this.FUNCTION_PROTO, \"constructor\", this.FUNCTION, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.FUNCTION_PROTO.nativeFunc = function () {};\n this.FUNCTION_PROTO.nativeFunc.id = this.functionCounter_++;\n this.setProperty(this.FUNCTION_PROTO, \"length\", 0, Interpreter.READONLY_DESCRIPTOR);\n\n var boxThis = function (value) {\n // In non-strict mode 'this' must be an object.\n if ((!value || !value.isObject) && !thisInterpreter.getScope().strict) {\n if (value === undefined || value === null) {\n // 'Undefined' and 'null' are changed to global object.\n value = thisInterpreter.global;\n } else {\n // Primitives must be boxed in non-strict mode.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n value = box;\n }\n }\n return value;\n };\n\n wrapper = function (thisArg, args) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to apply a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n if (args !== null && args !== undefined) {\n if (args.isObject) {\n state.arguments_ = thisInterpreter.arrayPseudoToNative(args);\n } else {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"CreateListFromArrayLike called on non-object\");\n }\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"apply\", wrapper);\n\n wrapper = function (thisArg /*, var_args */) {\n var state = thisInterpreter.stateStack[thisInterpreter.stateStack.length - 1];\n // Rewrite the current 'CallExpression' to call a different function.\n state.func_ = this;\n // Assign the 'this' object.\n state.funcThis_ = boxThis(thisArg);\n // Bind any provided arguments.\n state.arguments_ = [];\n for (var i = 1; i < arguments.length; i++) {\n state.arguments_.push(arguments[i]);\n }\n state.doneExec_ = false;\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"call\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_objects/Function/bind\n \"Object.defineProperty(Function.prototype, 'bind',\",\n \"{configurable: true, writable: true, value:\",\n \"function(oThis) {\",\n \"if (typeof this !== 'function') {\",\n \"throw TypeError('What is trying to be bound is not callable');\",\n \"}\",\n \"var aArgs = Array.prototype.slice.call(arguments, 1),\",\n \"fToBind = this,\",\n \"fNOP = function() {},\",\n \"fBound = function() {\",\n \"return fToBind.apply(this instanceof fNOP\",\n \"? this\",\n \": oThis,\",\n \"aArgs.concat(Array.prototype.slice.call(arguments)));\",\n \"};\",\n \"if (this.prototype) {\",\n \"fNOP.prototype = this.prototype;\",\n \"}\",\n \"fBound.prototype = new fNOP();\",\n \"return fBound;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n // Function has no parent to inherit from, so it needs its own mandatory\n // toString and valueOf functions.\n wrapper = function () {\n return this.toString();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"toString\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"toString\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n wrapper = function () {\n return this.valueOf();\n };\n this.setNativeFunctionPrototype(this.FUNCTION, \"valueOf\", wrapper);\n this.setProperty(\n this.FUNCTION,\n \"valueOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Initialize the Object class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initObject = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Object constructor.\n wrapper = function (value) {\n if (value === undefined || value === null) {\n // Create a new object.\n if (thisInterpreter.calledWithNew()) {\n // Called as new Object().\n return this;\n } else {\n // Called as Object().\n return thisInterpreter.createObjectProto(thisInterpreter.OBJECT_PROTO);\n }\n }\n if (!value.isObject) {\n // Wrap the value as an object.\n var box = thisInterpreter.createObjectProto(thisInterpreter.getPrototype(value));\n box.data = value;\n return box;\n }\n // Return the provided object.\n return value;\n };\n this.OBJECT = this.createNativeFunction(wrapper, true);\n // Throw away the created prototype and use the root prototype.\n this.setProperty(this.OBJECT, \"prototype\", this.OBJECT_PROTO);\n this.setProperty(this.OBJECT_PROTO, \"constructor\", this.OBJECT, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(scope, \"Object\", this.OBJECT);\n\n /**\n * Checks if the provided value is null or undefined.\n * If so, then throw an error in the call stack.\n * @param {Interpreter.Value} value Value to check.\n */\n var throwIfNullUndefined = function (value) {\n if (value === undefined || value === null) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Cannot convert '\" + value + \"' to object\");\n }\n };\n\n // Static methods on Object.\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n var props = obj.isObject ? obj.properties : obj;\n return thisInterpreter.arrayNativeToPseudo(Object.getOwnPropertyNames(props));\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyNames\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n if (obj.isObject) {\n obj = obj.properties;\n }\n return thisInterpreter.arrayNativeToPseudo(Object.keys(obj));\n };\n this.setProperty(\n this.OBJECT,\n \"keys\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (proto) {\n // Support for the second argument is the responsibility of a polyfill.\n if (proto === null) {\n return thisInterpreter.createObjectProto(null);\n }\n if (proto === undefined || !proto.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object prototype may only be an Object or null\");\n }\n return thisInterpreter.createObjectProto(proto);\n };\n this.setProperty(\n this.OBJECT,\n \"create\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Add a polyfill to handle create's second argument.\n this.polyfills_.push(\n \"(function() {\",\n \"var create_ = Object.create;\",\n \"Object.create = function(proto, props) {\",\n \"var obj = create_(proto);\",\n \"props && Object.defineProperties(obj, props);\",\n \"return obj;\",\n \"};\",\n \"})();\",\n \"\",\n );\n\n wrapper = function (obj, prop, descriptor) {\n prop = String(prop);\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Object.defineProperty called on non-object\");\n }\n if (!descriptor || !descriptor.isObject) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, \"Property description must be an object\");\n }\n if (!obj.properties[prop] && obj.preventExtensions) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Can't define property '\" + prop + \"', object is not extensible\",\n );\n }\n // The polyfill guarantees no inheritance and no getter functions.\n // Therefore the descriptor properties map is the native object needed.\n thisInterpreter.setProperty(obj, prop, Interpreter.VALUE_IN_DESCRIPTOR, descriptor.properties);\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"defineProperty\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.polyfills_.push(\n // Flatten the descriptor to remove any inheritance or getter functions.\n \"(function() {\",\n \"var defineProperty_ = Object.defineProperty;\",\n \"Object.defineProperty = function(obj, prop, d1) {\",\n \"var d2 = {};\",\n \"if ('configurable' in d1) d2.configurable = d1.configurable;\",\n \"if ('enumerable' in d1) d2.enumerable = d1.enumerable;\",\n \"if ('writable' in d1) d2.writable = d1.writable;\",\n \"if ('value' in d1) d2.value = d1.value;\",\n \"if ('get' in d1) d2.get = d1.get;\",\n \"if ('set' in d1) d2.set = d1.set;\",\n \"return defineProperty_(obj, prop, d2);\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Object, 'defineProperties',\",\n \"{configurable: true, writable: true, value:\",\n \"function(obj, props) {\",\n \"var keys = Object.keys(props);\",\n \"for (var i = 0; i < keys.length; i++) {\",\n \"Object.defineProperty(obj, keys[i], props[keys[i]]);\",\n \"}\",\n \"return obj;\",\n \"}\",\n \"});\",\n \"\",\n );\n\n wrapper = function (obj, prop) {\n if (!obj || !obj.isObject) {\n thisInterpreter.throwException(\n thisInterpreter.TYPE_ERROR,\n \"Object.getOwnPropertyDescriptor called on non-object\",\n );\n }\n prop = String(prop);\n if (!(prop in obj.properties)) {\n return undefined;\n }\n var descriptor = Object.getOwnPropertyDescriptor(obj.properties, prop);\n var getter = obj.getter[prop];\n var setter = obj.setter[prop];\n\n if (getter || setter) {\n descriptor.get = getter;\n descriptor.set = setter;\n delete descriptor.value;\n delete descriptor.writable;\n }\n // Preserve value, but remove it for the nativeToPseudo call.\n var value = descriptor.value;\n var hasValue = \"value\" in descriptor;\n delete descriptor.value;\n var pseudoDescriptor = thisInterpreter.nativeToPseudo(descriptor);\n if (hasValue) {\n thisInterpreter.setProperty(pseudoDescriptor, \"value\", value);\n }\n return pseudoDescriptor;\n };\n this.setProperty(\n this.OBJECT,\n \"getOwnPropertyDescriptor\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n throwIfNullUndefined(obj);\n return thisInterpreter.getPrototype(obj);\n };\n this.setProperty(\n this.OBJECT,\n \"getPrototypeOf\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n return Boolean(obj) && !obj.preventExtensions;\n };\n this.setProperty(\n this.OBJECT,\n \"isExtensible\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (obj) {\n if (obj && obj.isObject) {\n obj.preventExtensions = true;\n }\n return obj;\n };\n this.setProperty(\n this.OBJECT,\n \"preventExtensions\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Object.\n this.setNativeFunctionPrototype(this.OBJECT, \"toString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"toLocaleString\", Interpreter.Object.prototype.toString);\n this.setNativeFunctionPrototype(this.OBJECT, \"valueOf\", Interpreter.Object.prototype.valueOf);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.hasOwnProperty(prop);\n }\n return String(prop) in this.properties;\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"hasOwnProperty\", wrapper);\n\n wrapper = function (prop) {\n throwIfNullUndefined(this);\n if (!this.isObject) {\n return this.propertyIsEnumerable(prop);\n }\n return Object.prototype.propertyIsEnumerable.call(this.properties, prop);\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"propertyIsEnumerable\", wrapper);\n\n wrapper = function (obj) {\n while (true) {\n // Note, circular loops shouldn't be possible.\n obj = thisInterpreter.getPrototype(obj);\n if (!obj) {\n // No parent; reached the top.\n return false;\n }\n if (obj === this) {\n return true;\n }\n }\n };\n this.setNativeFunctionPrototype(this.OBJECT, \"isPrototypeOf\", wrapper);\n};\n\n/**\n * Initialize the Array class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initArray = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Array constructor.\n wrapper = function (var_args) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Array().\n var newArray = this;\n } else {\n // Called as Array().\n var newArray = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n }\n var first = arguments[0];\n if (arguments.length === 1 && typeof first === \"number\") {\n if (isNaN(Interpreter.legalArrayLength(first))) {\n thisInterpreter.throwException(thisInterpreter.RANGE_ERROR, \"Invalid array length\");\n }\n newArray.properties.length = first;\n } else {\n for (var i = 0; i < arguments.length; i++) {\n newArray.properties[i] = arguments[i];\n }\n newArray.properties.length = i;\n }\n return newArray;\n };\n this.ARRAY = this.createNativeFunction(wrapper, true);\n this.ARRAY_PROTO = this.ARRAY.properties[\"prototype\"];\n this.setProperty(scope, \"Array\", this.ARRAY);\n\n // Static methods on Array.\n wrapper = function (obj) {\n return obj && obj.class === \"Array\";\n };\n this.setProperty(\n this.ARRAY,\n \"isArray\",\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on Array.\n wrapper = function () {\n return Array.prototype.pop.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"pop\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.push.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"push\", wrapper);\n\n wrapper = function () {\n return Array.prototype.shift.call(this.properties);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"shift\", wrapper);\n\n wrapper = function (var_args) {\n return Array.prototype.unshift.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"unshift\", wrapper);\n\n wrapper = function () {\n Array.prototype.reverse.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"reverse\", wrapper);\n\n wrapper = function (index, howmany /*, var_args*/) {\n var list = Array.prototype.splice.apply(this.properties, arguments);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"splice\", wrapper);\n\n wrapper = function (opt_begin, opt_end) {\n var list = Array.prototype.slice.call(this.properties, opt_begin, opt_end);\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"slice\", wrapper);\n\n wrapper = function (opt_separator) {\n return Array.prototype.join.call(this.properties, opt_separator);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"join\", wrapper);\n\n wrapper = function (var_args) {\n var list = [];\n var length = 0;\n // Start by copying the current array.\n var iLength = thisInterpreter.getProperty(this, \"length\");\n for (var i = 0; i < iLength; i++) {\n if (thisInterpreter.hasProperty(this, i)) {\n var element = thisInterpreter.getProperty(this, i);\n list[length] = element;\n }\n length++;\n }\n // Loop through all arguments and copy them in.\n for (var i = 0; i < arguments.length; i++) {\n var value = arguments[i];\n if (thisInterpreter.isa(value, thisInterpreter.ARRAY)) {\n var jLength = thisInterpreter.getProperty(value, \"length\");\n for (var j = 0; j < jLength; j++) {\n if (thisInterpreter.hasProperty(value, j)) {\n list[length] = thisInterpreter.getProperty(value, j);\n }\n length++;\n }\n } else {\n list[length] = value;\n }\n }\n return thisInterpreter.arrayNativeToPseudo(list);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"concat\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.indexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"indexOf\", wrapper);\n\n wrapper = function (searchElement, opt_fromIndex) {\n return Array.prototype.lastIndexOf.apply(this.properties, arguments);\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"lastIndexOf\", wrapper);\n\n wrapper = function () {\n Array.prototype.sort.call(this.properties);\n return this;\n };\n this.setNativeFunctionPrototype(this.ARRAY, \"sort\", wrapper);\n\n this.polyfills_.push(\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/every\n \"Object.defineProperty(Array.prototype, 'every',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callbackfn, thisArg) {\",\n \"if (!this || typeof callbackfn !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O && !callbackfn.call(T, O[k], k, O)) return false;\",\n \"k++;\",\n \"}\",\n \"return true;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter\n \"Object.defineProperty(Array.prototype, 'filter',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (this === void 0 || this === null || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var res = [];\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t) {\",\n \"var val = t[i];\",\n \"if (fun.call(thisArg, val, i, t)) res.push(val);\",\n \"}\",\n \"}\",\n \"return res;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.find\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n \"if (!Array.prototype.find) {\",\n \"Object.defineProperty(Array.prototype, 'find', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return kValue;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return undefined;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Poly fill copied from:\n // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/findIndex\n \"if (!Array.prototype.findIndex) {\",\n \"Object.defineProperty(Array.prototype, 'findIndex', {\",\n \"value: function(predicate) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"var o = Object(this);\",\n \"var len = o.length >>> 0;\",\n \"if (typeof predicate !== 'function') {\",\n \"throw new TypeError('predicate must be a function');\",\n \"}\",\n \"var thisArg = arguments[1];\",\n \"var k = 0;\",\n \"while (k < len) {\",\n \"var kValue = o[k];\",\n \"if (predicate.call(thisArg, kValue, k, o)) {\",\n \"return k;\",\n \"}\",\n \"k++;\",\n \"}\",\n \"return -1;\",\n \"},\",\n \"configurable: true,\",\n \"writable: true\",\n \"});\",\n \"}\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach\n \"Object.defineProperty(Array.prototype, 'forEach',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var T, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/includes#Polyfill\n \"Object.defineProperty(Array.prototype, 'includes', {\",\n \"value: function(searchElement, fromIndex) {\",\n \"if (this == null) {\",\n \"throw new TypeError('\\\"this\\\" is null or not defined');\",\n \"}\",\n \"// 1. Let O be ? ToObject(this value).\",\n \"var o = Object(this);\",\n '// 2. Let len be ? ToLength(? Get(O, \"length\")).',\n \"var len = o.length >>> 0;\",\n \"// 3. If len is 0, return false.\",\n \"if (len === 0) {\",\n \"return false;\",\n \"}\",\n \"// 4. Let n be ? ToInteger(fromIndex).\",\n \"// (If fromIndex is undefined, this step produces the value 0.)\",\n \"var n = fromIndex | 0;\",\n \"// 5. If n ≥ 0, then\",\n \"// a. Let k be n.\",\n \"// 6. Else n < 0,\",\n \"// a. Let k be len + n.\",\n \"// b. If k < 0, let k be 0.\",\n \"var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);\",\n \"function sameValueZero(x, y) {\",\n \"return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));\",\n \"}\",\n \"// 7. Repeat, while k < len\",\n \"while (k < len) {\",\n \"// a. Let elementK be the result of ? Get(O, ! ToString(k)).\",\n \"// b. If SameValueZero(searchElement, elementK) is true, return true.\",\n \"if (sameValueZero(o[k], searchElement)) {\",\n \"return true;\",\n \"}\",\n \"// c. Increase k by 1. \",\n \"k++;\",\n \"}\",\n \"// 8. Return false\",\n \"return false;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/map\n \"Object.defineProperty(Array.prototype, 'map',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback, thisArg) {\",\n \"if (!this || typeof callback !== 'function') new TypeError;\",\n \"var T, A, k;\",\n \"var O = Object(this);\",\n \"var len = O.length >>> 0;\",\n \"if (arguments.length > 1) T = thisArg;\",\n \"A = new Array(len);\",\n \"k = 0;\",\n \"while (k < len) {\",\n \"if (k in O) A[k] = callback.call(T, O[k], k, O);\",\n \"k++;\",\n \"}\",\n \"return A;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce\n \"Object.defineProperty(Array.prototype, 'reduce',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (!this || typeof callback !== 'function') throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = 0, value;\",\n \"if (arguments.length === 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k < len && !(k in t)) k++;\",\n \"if (k >= len) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k++];\",\n \"}\",\n \"for (; k < len; k++) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/ReduceRight\n \"Object.defineProperty(Array.prototype, 'reduceRight',\",\n \"{configurable: true, writable: true, value:\",\n \"function(callback /*, initialValue*/) {\",\n \"if (null === this || 'undefined' === typeof this || 'function' !== typeof callback) throw TypeError();\",\n \"var t = Object(this), len = t.length >>> 0, k = len - 1, value;\",\n \"if (arguments.length >= 2) {\",\n \"value = arguments[1];\",\n \"} else {\",\n \"while (k >= 0 && !(k in t)) k--;\",\n \"if (k < 0) {\",\n \"throw TypeError('Reduce of empty array with no initial value');\",\n \"}\",\n \"value = t[k--];\",\n \"}\",\n \"for (; k >= 0; k--) {\",\n \"if (k in t) value = callback(value, t[k], k, t);\",\n \"}\",\n \"return value;\",\n \"}\",\n \"});\",\n\n // Polyfill copied from:\n // developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/some\n \"Object.defineProperty(Array.prototype, 'some',\",\n \"{configurable: true, writable: true, value:\",\n \"function(fun/*, thisArg*/) {\",\n \"if (!this || typeof fun !== 'function') throw TypeError();\",\n \"var t = Object(this);\",\n \"var len = t.length >>> 0;\",\n \"var thisArg = arguments.length >= 2 ? arguments[1] : void 0;\",\n \"for (var i = 0; i < len; i++) {\",\n \"if (i in t && fun.call(thisArg, t[i], i, t)) {\",\n \"return true;\",\n \"}\",\n \"}\",\n \"return false;\",\n \"}\",\n \"});\",\n\n \"(function() {\",\n \"var sort_ = Array.prototype.sort;\",\n \"Array.prototype.sort = function(opt_comp) {\",\n // Fast native sort.\n \"if (typeof opt_comp !== 'function') {\",\n \"return sort_.call(this);\",\n \"}\",\n // Slow bubble sort.\n \"for (var i = 0; i < this.length; i++) {\",\n \"var changes = 0;\",\n \"for (var j = 0; j < this.length - i - 1; j++) {\",\n \"if (opt_comp(this[j], this[j + 1]) > 0) {\",\n \"var swap = this[j];\",\n \"this[j] = this[j + 1];\",\n \"this[j + 1] = swap;\",\n \"changes++;\",\n \"}\",\n \"}\",\n \"if (!changes) break;\",\n \"}\",\n \"return this;\",\n \"};\",\n \"})();\",\n\n \"Object.defineProperty(Array.prototype, 'toLocaleString',\",\n \"{configurable: true, writable: true, value:\",\n \"function() {\",\n \"var out = [];\",\n \"for (var i = 0; i < this.length; i++) {\",\n \"out[i] = (this[i] === null || this[i] === undefined) ? '' : this[i].toLocaleString();\",\n \"}\",\n \"return out.join(',');\",\n \"}\",\n \"});\",\n \"\",\n );\n};\n\n/**\n * Initialize the String class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initString = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // String constructor.\n wrapper = function (value) {\n value = String(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new String().\n this.data = value;\n return this;\n } else {\n // Called as String().\n return value;\n }\n };\n this.STRING = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"String\", this.STRING);\n\n // Static methods on String.\n this.setProperty(\n this.STRING,\n \"fromCharCode\",\n this.createNativeFunction(String.fromCharCode, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n // Instance methods on String.\n // Methods with exclusively primitive arguments.\n var functions = [\n \"charAt\",\n \"charCodeAt\",\n \"concat\",\n \"indexOf\",\n \"lastIndexOf\",\n \"slice\",\n \"substr\",\n \"substring\",\n \"toLocaleLowerCase\",\n \"toLocaleUpperCase\",\n \"toLowerCase\",\n \"toUpperCase\",\n \"trim\",\n ];\n for (var i = 0; i < functions.length; i++) {\n this.setNativeFunctionPrototype(this.STRING, functions[i], String.prototype[functions[i]]);\n }\n\n wrapper = function (compareString, locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return String(this).localeCompare(compareString, locales, options);\n };\n this.setNativeFunctionPrototype(this.STRING, \"localeCompare\", wrapper);\n\n wrapper = function (separator, limit) {\n if (thisInterpreter.isa(separator, thisInterpreter.REGEXP)) {\n separator = separator.data;\n }\n var jsList = String(this).split(separator, limit);\n return thisInterpreter.arrayNativeToPseudo(jsList);\n };\n this.setNativeFunctionPrototype(this.STRING, \"split\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n var m = String(this).match(regexp);\n return m && thisInterpreter.arrayNativeToPseudo(m);\n };\n this.setNativeFunctionPrototype(this.STRING, \"match\", wrapper);\n\n wrapper = function (regexp) {\n if (thisInterpreter.isa(regexp, thisInterpreter.REGEXP)) {\n regexp = regexp.data;\n }\n return String(this).search(regexp);\n };\n this.setNativeFunctionPrototype(this.STRING, \"search\", wrapper);\n\n wrapper = function (substr, newSubstr) {\n // Support for function replacements is the responsibility of a polyfill.\n if (thisInterpreter.isa(substr, thisInterpreter.REGEXP)) {\n substr = substr.data;\n }\n return String(this).replace(substr, newSubstr);\n };\n this.setNativeFunctionPrototype(this.STRING, \"replace\", wrapper);\n // Add a polyfill to handle replace's second argument being a function.\n this.polyfills_.push(\n \"(function() {\",\n \"var replace_ = String.prototype.replace;\",\n \"String.prototype.replace = function(substr, newSubstr) {\",\n \"if (typeof newSubstr !== 'function') {\",\n // string.replace(string|regexp, string)\n \"return replace_.call(this, substr, newSubstr);\",\n \"}\",\n \"var str = this;\",\n \"if (substr instanceof RegExp) {\", // string.replace(regexp, function)\n \"var subs = [];\",\n \"var m = substr.exec(str);\",\n \"while (m) {\",\n \"m.push(m.index, str);\",\n \"var inject = newSubstr.apply(null, m);\",\n \"subs.push([m.index, m[0].length, inject]);\",\n \"m = substr.global ? substr.exec(str) : null;\",\n \"}\",\n \"for (var i = subs.length - 1; i >= 0; i--) {\",\n \"str = str.substring(0, subs[i][0]) + subs[i][2] + \" + \"str.substring(subs[i][0] + subs[i][1]);\",\n \"}\",\n \"} else {\", // string.replace(string, function)\n \"var i = str.indexOf(substr);\",\n \"if (i !== -1) {\",\n \"var inject = newSubstr(str.substr(i, substr.length), i, str);\",\n \"str = str.substring(0, i) + inject + \" + \"str.substring(i + substr.length);\",\n \"}\",\n \"}\",\n \"return str;\",\n \"};\",\n \"})();\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/endsWith\n \"if (!String.prototype.endsWith) {\",\n \"String.prototype.endsWith = function(search, this_len) {\",\n \"if (this_len === undefined || this_len > this.length) {\",\n \"this_len = this.length;\",\n \"}\",\n \"return this.substring(this_len - search.length, this_len) === search;\",\n \"};\",\n \"}\",\n\n //Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/includes\n \"if (!String.prototype.includes) {\",\n \"String.prototype.includes = function(search, start) {\",\n \"'use strict';\",\n \"if (typeof start !== 'number') {\",\n \"start = 0;\",\n \"}\",\n \" \",\n \"if (start + search.length > this.length) {\",\n \"return false;\",\n \"} else {\",\n \"return this.indexOf(search, start) !== -1;\",\n \"}\",\n \"};\",\n \"}\",\n\n // Polyfill copied from:\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith\n \"if (!String.prototype.startsWith) {\",\n \"String.prototype.startsWith = function(search, pos) {\",\n \"return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\",\n \"};\",\n \"}\",\n\n \"\",\n );\n};\n\n/**\n * Initialize the Boolean class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initBoolean = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Boolean constructor.\n wrapper = function (value) {\n value = Boolean(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Boolean().\n this.data = value;\n return this;\n } else {\n // Called as Boolean().\n return value;\n }\n };\n this.BOOLEAN = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Boolean\", this.BOOLEAN);\n};\n\n/**\n * Initialize the Number class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initNumber = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Number constructor.\n wrapper = function (value) {\n value = Number(value);\n if (thisInterpreter.calledWithNew()) {\n // Called as new Number().\n this.data = value;\n return this;\n } else {\n // Called as Number().\n return value;\n }\n };\n this.NUMBER = this.createNativeFunction(wrapper, true);\n this.setProperty(scope, \"Number\", this.NUMBER);\n\n var numConsts = [\"MAX_VALUE\", \"MIN_VALUE\", \"NaN\", \"NEGATIVE_INFINITY\", \"POSITIVE_INFINITY\"];\n for (var i = 0; i < numConsts.length; i++) {\n this.setProperty(this.NUMBER, numConsts[i], Number[numConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n\n // Instance methods on Number.\n wrapper = function (fractionDigits) {\n try {\n return Number(this).toExponential(fractionDigits);\n } catch (e) {\n // Throws if fractionDigits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toExponential\", wrapper);\n\n wrapper = function (digits) {\n try {\n return Number(this).toFixed(digits);\n } catch (e) {\n // Throws if digits isn't within 0-20.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toFixed\", wrapper);\n\n wrapper = function (precision) {\n try {\n return Number(this).toPrecision(precision);\n } catch (e) {\n // Throws if precision isn't within range (depends on implementation).\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toPrecision\", wrapper);\n\n wrapper = function (radix) {\n try {\n return Number(this).toString(radix);\n } catch (e) {\n // Throws if radix isn't within 2-36.\n thisInterpreter.throwException(thisInterpreter.ERROR, e.message);\n }\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toString\", wrapper);\n\n wrapper = function (locales, options) {\n locales = locales ? thisInterpreter.pseudoToNative(locales) : undefined;\n options = options ? thisInterpreter.pseudoToNative(options) : undefined;\n return Number(this).toLocaleString(locales, options);\n };\n this.setNativeFunctionPrototype(this.NUMBER, \"toLocaleString\", wrapper);\n};\n\n/**\n * Initialize the Date class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initDate = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // Date constructor.\n wrapper = function (value, var_args) {\n if (!thisInterpreter.calledWithNew()) {\n // Called as Date().\n // Calling Date() as a function returns a string, no arguments are heeded.\n return Date();\n }\n // Called as new Date().\n var args = [null].concat(Array.from(arguments));\n this.data = new (Function.prototype.bind.apply(Date, args))();\n return this;\n };\n this.DATE = this.createNativeFunction(wrapper, true);\n this.DATE_PROTO = this.DATE.properties[\"prototype\"];\n this.setProperty(scope, \"Date\", this.DATE);\n\n // Static methods on Date.\n this.setProperty(this.DATE, \"now\", this.createNativeFunction(Date.now, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n this.setProperty(\n this.DATE,\n \"parse\",\n this.createNativeFunction(Date.parse, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n\n this.setProperty(this.DATE, \"UTC\", this.createNativeFunction(Date.UTC, false), Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n // Instance methods on Date.\n var functions = [\n \"getDate\",\n \"getDay\",\n \"getFullYear\",\n \"getHours\",\n \"getMilliseconds\",\n \"getMinutes\",\n \"getMonth\",\n \"getSeconds\",\n \"getTime\",\n \"getTimezoneOffset\",\n \"getUTCDate\",\n \"getUTCDay\",\n \"getUTCFullYear\",\n \"getUTCHours\",\n \"getUTCMilliseconds\",\n \"getUTCMinutes\",\n \"getUTCMonth\",\n \"getUTCSeconds\",\n \"getYear\",\n \"setDate\",\n \"setFullYear\",\n \"setHours\",\n \"setMilliseconds\",\n \"setMinutes\",\n \"setMonth\",\n \"setSeconds\",\n \"setTime\",\n \"setUTCDate\",\n \"setUTCFullYear\",\n \"setUTCHours\",\n \"setUTCMilliseconds\",\n \"setUTCMinutes\",\n \"setUTCMonth\",\n \"setUTCSeconds\",\n \"setYear\",\n \"toDateString\",\n \"toISOString\",\n \"toJSON\",\n \"toGMTString\",\n \"toLocaleDateString\",\n \"toLocaleString\",\n \"toLocaleTimeString\",\n \"toTimeString\",\n \"toUTCString\",\n ];\n for (var i = 0; i < functions.length; i++) {\n wrapper = (function (nativeFunc) {\n return function (var_args) {\n var args = [];\n for (var i = 0; i < arguments.length; i++) {\n args[i] = thisInterpreter.pseudoToNative(arguments[i]);\n }\n return this.data[nativeFunc].apply(this.data, args);\n };\n })(functions[i]);\n this.setNativeFunctionPrototype(this.DATE, functions[i], wrapper);\n }\n};\n\n/**\n * Initialize Regular Expression object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initRegExp = function (scope) {\n var thisInterpreter = this;\n var wrapper;\n // RegExp constructor.\n wrapper = function (pattern, flags) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new RegExp().\n var rgx = this;\n } else {\n // Called as RegExp().\n var rgx = thisInterpreter.createObjectProto(thisInterpreter.REGEXP_PROTO);\n }\n pattern = pattern ? pattern.toString() : \"\";\n flags = flags ? flags.toString() : \"\";\n thisInterpreter.populateRegExp(rgx, new RegExp(pattern, flags));\n return rgx;\n };\n this.REGEXP = this.createNativeFunction(wrapper, true);\n this.REGEXP_PROTO = this.REGEXP.properties[\"prototype\"];\n this.setProperty(scope, \"RegExp\", this.REGEXP);\n\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"global\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"ignoreCase\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"multiline\",\n undefined,\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n this.setProperty(\n this.REGEXP.properties[\"prototype\"],\n \"source\",\n \"(?:)\",\n Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR,\n );\n\n wrapper = function (str) {\n return this.data.test(str);\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"test\", wrapper);\n\n wrapper = function (str) {\n str = str.toString();\n // Get lastIndex from wrapped regex, since this is settable.\n this.data.lastIndex = Number(thisInterpreter.getProperty(this, \"lastIndex\"));\n var match = this.data.exec(str);\n thisInterpreter.setProperty(this, \"lastIndex\", this.data.lastIndex);\n\n if (match) {\n var result = thisInterpreter.createObjectProto(thisInterpreter.ARRAY_PROTO);\n for (var i = 0; i < match.length; i++) {\n thisInterpreter.setProperty(result, i, match[i]);\n }\n // match has additional properties.\n thisInterpreter.setProperty(result, \"index\", match.index);\n thisInterpreter.setProperty(result, \"input\", match.input);\n return result;\n }\n return null;\n };\n this.setNativeFunctionPrototype(this.REGEXP, \"exec\", wrapper);\n};\n\n/**\n * Initialize the Error class.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initError = function (scope) {\n var thisInterpreter = this;\n // Error constructor.\n this.ERROR = this.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new Error().\n var newError = this;\n } else {\n // Called as Error().\n var newError = thisInterpreter.createObject(thisInterpreter.ERROR);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n this.setProperty(scope, \"Error\", this.ERROR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"message\", \"\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(this.ERROR.properties[\"prototype\"], \"name\", \"Error\", Interpreter.NONENUMERABLE_DESCRIPTOR);\n\n var createErrorSubclass = function (name) {\n var constructor = thisInterpreter.createNativeFunction(function (opt_message) {\n if (thisInterpreter.calledWithNew()) {\n // Called as new XyzError().\n var newError = this;\n } else {\n // Called as XyzError().\n var newError = thisInterpreter.createObject(constructor);\n }\n if (opt_message) {\n thisInterpreter.setProperty(newError, \"message\", String(opt_message), Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n return newError;\n }, true);\n thisInterpreter.setProperty(constructor, \"prototype\", thisInterpreter.createObject(thisInterpreter.ERROR));\n thisInterpreter.setProperty(\n constructor.properties[\"prototype\"],\n \"name\",\n name,\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n thisInterpreter.setProperty(scope, name, constructor);\n\n return constructor;\n };\n\n this.EVAL_ERROR = createErrorSubclass(\"EvalError\");\n this.RANGE_ERROR = createErrorSubclass(\"RangeError\");\n this.REFERENCE_ERROR = createErrorSubclass(\"ReferenceError\");\n this.SYNTAX_ERROR = createErrorSubclass(\"SyntaxError\");\n this.TYPE_ERROR = createErrorSubclass(\"TypeError\");\n this.URI_ERROR = createErrorSubclass(\"URIError\");\n};\n\n/**\n * Initialize Math object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initMath = function (scope) {\n var thisInterpreter = this;\n var myMath = this.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"Math\", myMath);\n var mathConsts = [\"E\", \"LN2\", \"LN10\", \"LOG2E\", \"LOG10E\", \"PI\", \"SQRT1_2\", \"SQRT2\"];\n for (var i = 0; i < mathConsts.length; i++) {\n this.setProperty(myMath, mathConsts[i], Math[mathConsts[i]], Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n }\n var numFunctions = [\n \"abs\",\n \"acos\",\n \"asin\",\n \"atan\",\n \"atan2\",\n \"ceil\",\n \"cos\",\n \"exp\",\n \"floor\",\n \"log\",\n \"max\",\n \"min\",\n \"pow\",\n \"random\",\n \"round\",\n \"sin\",\n \"sqrt\",\n \"tan\",\n ];\n for (var i = 0; i < numFunctions.length; i++) {\n this.setProperty(\n myMath,\n numFunctions[i],\n this.createNativeFunction(Math[numFunctions[i]], false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n }\n};\n\n/**\n * Initialize JSON object.\n * @param {!Interpreter.Object} scope Global scope.\n */\nInterpreter.prototype.initJSON = function (scope) {\n var thisInterpreter = this;\n var myJSON = thisInterpreter.createObjectProto(this.OBJECT_PROTO);\n this.setProperty(scope, \"JSON\", myJSON);\n\n var wrapper = function (text) {\n try {\n var nativeObj = JSON.parse(text.toString());\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.SYNTAX_ERROR, e.message);\n }\n return thisInterpreter.nativeToPseudo(nativeObj);\n };\n this.setProperty(myJSON, \"parse\", this.createNativeFunction(wrapper, false));\n\n wrapper = function (value) {\n var nativeObj = thisInterpreter.pseudoToNative(value);\n try {\n var str = JSON.stringify(nativeObj);\n } catch (e) {\n thisInterpreter.throwException(thisInterpreter.TYPE_ERROR, e.message);\n }\n return str;\n };\n this.setProperty(myJSON, \"stringify\", this.createNativeFunction(wrapper, false));\n};\n\n/**\n * Is an object of a certain class?\n * @param {Interpreter.Value} child Object to check.\n * @param {Interpreter.Object} constructor Constructor of object.\n * @return {boolean} True if object is the class or inherits from it.\n * False otherwise.\n */\nInterpreter.prototype.isa = function (child, constructor) {\n if (child === null || child === undefined || !constructor) {\n return false;\n }\n var proto = constructor.properties[\"prototype\"];\n if (child === proto) {\n return true;\n }\n // The first step up the prototype chain is harder since the child might be\n // a primitive value. Subsequent steps can just follow the .proto property.\n child = this.getPrototype(child);\n while (child) {\n if (child === proto) {\n return true;\n }\n child = child.proto;\n }\n return false;\n};\n\n/**\n * Is a value a legal integer for an array length?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayLength = function (x) {\n var n = x >>> 0;\n // Array length must be between 0 and 2^32-1 (inclusive).\n return n === Number(x) ? n : NaN;\n};\n\n/**\n * Is a value a legal integer for an array index?\n * @param {Interpreter.Value} x Value to check.\n * @return {number} Zero, or a positive integer if the value can be\n * converted to such. NaN otherwise.\n */\nInterpreter.legalArrayIndex = function (x) {\n var n = x >>> 0;\n // Array index cannot be 2^32-1, otherwise length would be 2^32.\n // 0xffffffff is 2^32-1.\n return String(n) === String(x) && n !== 0xffffffff ? n : NaN;\n};\n\n/**\n * Typedef for JS values.\n * @typedef {!Interpreter.Object|boolean|number|string|undefined|null}\n */\nInterpreter.Value;\n\n/**\n * Class for an object.\n * @param {Interpreter.Object} proto Prototype object or null.\n * @constructor\n */\nInterpreter.Object = function (proto) {\n this.getter = Object.create(null);\n this.setter = Object.create(null);\n this.properties = Object.create(null);\n this.proto = proto;\n};\n\n/** @type {Interpreter.Object} */\nInterpreter.Object.prototype.proto = null;\n\n/** @type {boolean} */\nInterpreter.Object.prototype.isObject = true;\n\n/** @type {string} */\nInterpreter.Object.prototype.class = \"Object\";\n\n/** @type {Date|RegExp|boolean|number|string|undefined|null} */\nInterpreter.Object.prototype.data = null;\n\n/**\n * Convert this object into a string.\n * @return {string} String value.\n * @override\n */\nInterpreter.Object.prototype.toString = function () {\n if (this.class === \"Array\") {\n // Array\n var cycles = Interpreter.toStringCycles_;\n cycles.push(this);\n try {\n var strs = [];\n for (var i = 0; i < this.properties.length; i++) {\n var value = this.properties[i];\n strs[i] = value && value.isObject && cycles.indexOf(value) !== -1 ? \"...\" : value;\n }\n } finally {\n cycles.pop();\n }\n return strs.join(\",\");\n }\n if (this.class === \"Error\") {\n var cycles = Interpreter.toStringCycles_;\n if (cycles.indexOf(this) !== -1) {\n return \"[object Error]\";\n }\n var name, message;\n // Bug: Does not support getters and setters for name or message.\n var obj = this;\n do {\n if (\"name\" in obj.properties) {\n name = obj.properties[\"name\"];\n break;\n }\n } while ((obj = obj.proto));\n var obj = this;\n do {\n if (\"message\" in obj.properties) {\n message = obj.properties[\"message\"];\n break;\n }\n } while ((obj = obj.proto));\n cycles.push(this);\n try {\n name = name && name.toString();\n message = message && message.toString();\n } finally {\n cycles.pop();\n }\n return message ? name + \": \" + message : String(name);\n }\n\n // RegExp, Date, and boxed primitives.\n if (this.data !== null) {\n return String(this.data);\n }\n\n return \"[object \" + this.class + \"]\";\n};\n\n/**\n * Return the object's value.\n * @return {Interpreter.Value} Value.\n * @override\n */\nInterpreter.Object.prototype.valueOf = function () {\n if (this.data === undefined || this.data === null || this.data instanceof RegExp) {\n return this; // An Object.\n }\n if (this.data instanceof Date) {\n return this.data.valueOf(); // Milliseconds.\n }\n return /** @type {(boolean|number|string)} */ (this.data); // Boxed primitive.\n};\n\n/**\n * Create a new data object based on a constructor's prototype.\n * @param {Interpreter.Object} constructor Parent constructor function,\n * or null if scope object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObject = function (constructor) {\n return this.createObjectProto(constructor && constructor.properties[\"prototype\"]);\n};\n\n/**\n * Create a new data object based on a prototype.\n * @param {Interpreter.Object} proto Prototype object.\n * @return {!Interpreter.Object} New data object.\n */\nInterpreter.prototype.createObjectProto = function (proto) {\n if (typeof proto !== \"object\") {\n throw Error(\"Non object prototype\");\n }\n var obj = new Interpreter.Object(proto);\n // Functions have prototype objects.\n if (this.isa(obj, this.FUNCTION)) {\n this.setProperty(obj, \"prototype\", this.createObjectProto(this.OBJECT_PROTO || null));\n obj.class = \"Function\";\n }\n // Arrays have length.\n if (this.isa(obj, this.ARRAY)) {\n this.setProperty(obj, \"length\", 0, {\n configurable: false,\n enumerable: false,\n writable: true,\n });\n obj.class = \"Array\";\n }\n if (this.isa(obj, this.ERROR)) {\n obj.class = \"Error\";\n }\n return obj;\n};\n\n/**\n * Initialize a pseudo regular expression object based on a native regular\n * expression object.\n * @param {!Interpreter.Object} pseudoRegexp The existing object to set.\n * @param {!RegExp} nativeRegexp The native regular expression.\n */\nInterpreter.prototype.populateRegExp = function (pseudoRegexp, nativeRegexp) {\n pseudoRegexp.data = nativeRegexp;\n // lastIndex is settable, all others are read-only attributes\n this.setProperty(pseudoRegexp, \"lastIndex\", nativeRegexp.lastIndex, Interpreter.NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"source\", nativeRegexp.source, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"global\", nativeRegexp.global, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"ignoreCase\", nativeRegexp.ignoreCase, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n this.setProperty(pseudoRegexp, \"multiline\", nativeRegexp.multiline, Interpreter.READONLY_NONENUMERABLE_DESCRIPTOR);\n};\n\n/**\n * Create a new function.\n * @param {!Object} node AST node defining the function.\n * @param {!Object} scope Parent scope.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createFunction = function (node, scope) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.parentScope = scope;\n func.node = node;\n this.setProperty(func, \"length\", func.node[\"params\"].length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Create a new native function.\n * @param {!Function} nativeFunc JavaScript function.\n * @param {boolean=} opt_constructor If true, the function's\n * prototype will have its constructor property set to the function.\n * If false, the function cannot be called as a constructor (e.g. escape).\n * Defaults to undefined.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createNativeFunction = function (nativeFunc, opt_constructor) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.nativeFunc = nativeFunc;\n nativeFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", nativeFunc.length, Interpreter.READONLY_DESCRIPTOR);\n if (opt_constructor) {\n this.setProperty(func.properties[\"prototype\"], \"constructor\", func, Interpreter.NONENUMERABLE_DESCRIPTOR);\n } else if (opt_constructor === false) {\n func.illegalConstructor = true;\n this.setProperty(func, \"prototype\", undefined);\n }\n return func;\n};\n\n/**\n * Create a new native asynchronous function.\n * @param {!Function} asyncFunc JavaScript function.\n * @return {!Interpreter.Object} New function.\n */\nInterpreter.prototype.createAsyncFunction = function (asyncFunc) {\n var func = this.createObjectProto(this.FUNCTION_PROTO);\n func.asyncFunc = asyncFunc;\n asyncFunc.id = this.functionCounter_++;\n this.setProperty(func, \"length\", asyncFunc.length, Interpreter.READONLY_DESCRIPTOR);\n return func;\n};\n\n/**\n * Converts from a native JS object or value to a JS interpreter object.\n * Can handle JSON-style values, does NOT handle cycles.\n * @param {*} nativeObj The native JS object to be converted.\n * @return {Interpreter.Value} The equivalent JS interpreter object.\n */\nInterpreter.prototype.nativeToPseudo = function (nativeObj) {\n if ((typeof nativeObj !== \"object\" && typeof nativeObj !== \"function\") || nativeObj === null) {\n return nativeObj;\n }\n\n if (nativeObj instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, nativeObj);\n return pseudoRegexp;\n }\n\n if (nativeObj instanceof Date) {\n var pseudoDate = this.createObjectProto(this.DATE_PROTO);\n pseudoDate.data = nativeObj;\n return pseudoDate;\n }\n\n if (nativeObj instanceof Function) {\n var interpreter = this;\n var wrapper = function () {\n return interpreter.nativeToPseudo(\n nativeObj.apply(\n interpreter,\n Array.prototype.slice.call(arguments).map(function (i) {\n return interpreter.pseudoToNative(i);\n }),\n ),\n );\n };\n return this.createNativeFunction(wrapper, undefined);\n }\n\n var pseudoObj;\n if (Array.isArray(nativeObj)) {\n // Array.\n pseudoObj = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < nativeObj.length; i++) {\n if (i in nativeObj) {\n this.setProperty(pseudoObj, i, this.nativeToPseudo(nativeObj[i]));\n }\n }\n } else {\n // Object.\n pseudoObj = this.createObjectProto(this.OBJECT_PROTO);\n for (var key in nativeObj) {\n this.setProperty(pseudoObj, key, this.nativeToPseudo(nativeObj[key]));\n }\n }\n return pseudoObj;\n};\n\n/**\n * Converts from a JS interpreter object to native JS object.\n * Can handle JSON-style values, plus cycles.\n * @param {Interpreter.Value} pseudoObj The JS interpreter object to be\n * converted.\n * @param {Object=} opt_cycles Cycle detection (used in recursive calls).\n * @return {*} The equivalent native JS object or value.\n */\nInterpreter.prototype.pseudoToNative = function (pseudoObj, opt_cycles) {\n if ((typeof pseudoObj !== \"object\" && typeof pseudoObj !== \"function\") || pseudoObj === null) {\n return pseudoObj;\n }\n\n if (this.isa(pseudoObj, this.REGEXP)) {\n // Regular expression.\n return pseudoObj.data;\n }\n\n if (this.isa(pseudoObj, this.DATE)) {\n // Date.\n return pseudoObj.data;\n }\n\n var cycles = opt_cycles || {\n pseudo: [],\n native: [],\n };\n var i = cycles.pseudo.indexOf(pseudoObj);\n if (i !== -1) {\n return cycles.native[i];\n }\n cycles.pseudo.push(pseudoObj);\n var nativeObj;\n if (this.isa(pseudoObj, this.ARRAY)) {\n // Array.\n nativeObj = [];\n cycles.native.push(nativeObj);\n var length = this.getProperty(pseudoObj, \"length\");\n for (var i = 0; i < length; i++) {\n if (this.hasProperty(pseudoObj, i)) {\n nativeObj[i] = this.pseudoToNative(this.getProperty(pseudoObj, i), cycles);\n }\n }\n } else {\n // Object.\n nativeObj = {};\n cycles.native.push(nativeObj);\n var val;\n for (var key in pseudoObj.properties) {\n val = pseudoObj.properties[key];\n nativeObj[key] = this.pseudoToNative(val, cycles);\n }\n }\n cycles.pseudo.pop();\n cycles.native.pop();\n return nativeObj;\n};\n\n/**\n * Converts from a native JS array to a JS interpreter array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Array} nativeArray The JS array to be converted.\n * @return {!Interpreter.Object} The equivalent JS interpreter array.\n */\nInterpreter.prototype.arrayNativeToPseudo = function (nativeArray) {\n var pseudoArray = this.createObjectProto(this.ARRAY_PROTO);\n var props = Object.getOwnPropertyNames(nativeArray);\n for (var i = 0; i < props.length; i++) {\n this.setProperty(pseudoArray, props[i], nativeArray[props[i]]);\n }\n return pseudoArray;\n};\n\n/**\n * Converts from a JS interpreter array to native JS array.\n * Does handle non-numeric properties (like str.match's index prop).\n * Does NOT recurse into the array's contents.\n * @param {!Interpreter.Object} pseudoArray The JS interpreter array,\n * or JS interpreter object pretending to be an array.\n * @return {!Array} The equivalent native JS array.\n */\nInterpreter.prototype.arrayPseudoToNative = function (pseudoArray) {\n var nativeArray = [];\n for (var key in pseudoArray.properties) {\n nativeArray[key] = this.getProperty(pseudoArray, key);\n }\n // pseudoArray might be an object pretending to be an array. In this case\n // it's possible that length is non-existent, invalid, or smaller than the\n // largest defined numeric property. Set length explicitly here.\n nativeArray.length = Interpreter.legalArrayLength(this.getProperty(pseudoArray, \"length\")) || 0;\n return nativeArray;\n};\n\n/**\n * Look up the prototype for this value.\n * @param {Interpreter.Value} value Data object.\n * @return {Interpreter.Object} Prototype object, null if none.\n */\nInterpreter.prototype.getPrototype = function (value) {\n switch (typeof value) {\n case \"number\":\n return this.NUMBER.properties[\"prototype\"];\n case \"boolean\":\n return this.BOOLEAN.properties[\"prototype\"];\n case \"string\":\n return this.STRING.properties[\"prototype\"];\n }\n if (value) {\n return value.proto;\n }\n return null;\n};\n\n/**\n * Fetch a property value from a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line numbers\n * @return {Interpreter.Value} Property value (may be undefined).\n */\nInterpreter.prototype.getProperty = function (obj, name, node) {\n name = String(name);\n if (obj === undefined || obj === null) {\n let lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.TYPE_ERROR, \"Cannot read property '\" + name + \"' of \" + obj, lineNum);\n }\n if (name === \"length\") {\n // Special cases for magic length property.\n if (this.isa(obj, this.STRING)) {\n return String(obj).length;\n }\n } else if (name.charCodeAt(0) < 0x40) {\n // Might have numbers in there?\n // Special cases for string array indexing\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return String(obj)[n];\n }\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n var getter = obj.getter[name];\n if (getter) {\n // Flag this function as being a getter and thus needing immediate\n // execution (rather than being the value of the property).\n getter.isGetter = true;\n return getter;\n }\n return obj.properties[name];\n }\n } while ((obj = this.getPrototype(obj)));\n return undefined;\n};\n\n/**\n * Does the named property exist on a data object.\n * @param {Interpreter.Value} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @return {boolean} True if property exists.\n */\nInterpreter.prototype.hasProperty = function (obj, name) {\n if (!obj.isObject) {\n throw TypeError(\"Primitive data type has no properties\");\n }\n name = String(name);\n if (name === \"length\" && this.isa(obj, this.STRING)) {\n return true;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (!isNaN(n) && n < String(obj).length) {\n return true;\n }\n }\n do {\n if (obj.properties && name in obj.properties) {\n return true;\n }\n } while ((obj = this.getPrototype(obj)));\n return false;\n};\n\n/**\n * Set a property value on a data object.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {Interpreter.Value} value New property value.\n * Use Interpreter.VALUE_IN_DESCRIPTOR if value is handled by\n * descriptor instead.\n * @param {Object=} opt_descriptor Optional descriptor object.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setProperty = function (obj, name, value, opt_descriptor) {\n name = String(name);\n if (obj === undefined || obj === null) {\n this.throwException(this.TYPE_ERROR, \"Cannot set property '\" + name + \"' of \" + obj);\n }\n if (\n opt_descriptor &&\n (\"get\" in opt_descriptor || \"set\" in opt_descriptor) &&\n (\"value\" in opt_descriptor || \"writable\" in opt_descriptor)\n ) {\n this.throwException(\n this.TYPE_ERROR,\n \"Invalid property descriptor. \" + \"Cannot both specify accessors and a value or writable attribute\",\n );\n }\n var strict = !this.stateStack || this.getScope().strict;\n if (!obj.isObject) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't create property '\" + name + \"' on '\" + obj + \"'\");\n }\n return;\n }\n if (this.isa(obj, this.STRING)) {\n var n = Interpreter.legalArrayIndex(name);\n if (name === \"length\" || (!isNaN(n) && n < String(obj).length)) {\n // Can't set length or letters on String objects.\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of String '\" + obj.data + \"'\",\n );\n }\n return;\n }\n }\n if (obj.class === \"Array\") {\n // Arrays have a magic length variable that is bound to the elements.\n var length = obj.properties.length;\n var i;\n if (name === \"length\") {\n // Delete elements if length is smaller.\n if (opt_descriptor) {\n if (!(\"value\" in opt_descriptor)) {\n return;\n }\n value = opt_descriptor.value;\n }\n value = Interpreter.legalArrayLength(value);\n if (isNaN(value)) {\n this.throwException(this.RANGE_ERROR, \"Invalid array length\");\n }\n if (value < length) {\n for (i in obj.properties) {\n i = Interpreter.legalArrayIndex(i);\n if (!isNaN(i) && value <= i) {\n delete obj.properties[i];\n }\n }\n }\n } else if (!isNaN((i = Interpreter.legalArrayIndex(name)))) {\n // Increase length if this index is larger.\n obj.properties.length = Math.max(length, i + 1);\n }\n }\n if (obj.preventExtensions && !(name in obj.properties)) {\n if (strict) {\n this.throwException(this.TYPE_ERROR, \"Can't add property '\" + name + \"', object is not extensible\");\n }\n return;\n }\n if (opt_descriptor) {\n // Define the property.\n if (\"get\" in opt_descriptor) {\n if (opt_descriptor.get) {\n obj.getter[name] = opt_descriptor.get;\n } else {\n delete obj.getter[name];\n }\n }\n if (\"set\" in opt_descriptor) {\n if (opt_descriptor.set) {\n obj.setter[name] = opt_descriptor.set;\n } else {\n delete obj.setter[name];\n }\n }\n var descriptor = {};\n if (\"configurable\" in opt_descriptor) {\n descriptor.configurable = opt_descriptor.configurable;\n }\n if (\"enumerable\" in opt_descriptor) {\n descriptor.enumerable = opt_descriptor.enumerable;\n }\n if (\"writable\" in opt_descriptor) {\n descriptor.writable = opt_descriptor.writable;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n if (\"value\" in opt_descriptor) {\n descriptor.value = opt_descriptor.value;\n delete obj.getter[name];\n delete obj.setter[name];\n } else if (value !== Interpreter.VALUE_IN_DESCRIPTOR) {\n descriptor.value = value;\n delete obj.getter[name];\n delete obj.setter[name];\n }\n try {\n Object.defineProperty(obj.properties, name, descriptor);\n } catch (e) {\n this.throwException(this.TYPE_ERROR, \"Cannot redefine property: \" + name);\n }\n } else {\n // Set the property.\n if (value === Interpreter.VALUE_IN_DESCRIPTOR) {\n throw ReferenceError(\"Value not specified.\");\n }\n // Determine the parent (possibly self) where the property is defined.\n var defObj = obj;\n while (!(name in defObj.properties)) {\n defObj = this.getPrototype(defObj);\n if (!defObj) {\n // This is a new property.\n defObj = obj;\n break;\n }\n }\n if (defObj.setter && defObj.setter[name]) {\n return defObj.setter[name];\n }\n if (defObj.getter && defObj.getter[name]) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot set property '\" + name + \"' of object '\" + obj + \"' which only has a getter\",\n );\n }\n } else {\n // No setter, simple assignment.\n try {\n obj.properties[name] = value;\n } catch (e) {\n if (strict) {\n this.throwException(\n this.TYPE_ERROR,\n \"Cannot assign to read only \" + \"property '\" + name + \"' of object '\" + obj + \"'\",\n );\n }\n }\n }\n }\n};\n\n/**\n * Convenience method for adding a native function as a non-enumerable property\n * onto an object's prototype.\n * @param {!Interpreter.Object} obj Data object.\n * @param {Interpreter.Value} name Name of property.\n * @param {!Function} wrapper Function object.\n */\nInterpreter.prototype.setNativeFunctionPrototype = function (obj, name, wrapper) {\n this.setProperty(\n obj.properties[\"prototype\"],\n name,\n this.createNativeFunction(wrapper, false),\n Interpreter.NONENUMERABLE_DESCRIPTOR,\n );\n};\n\n/**\n * Returns the current scope from the stateStack.\n * @return {!Interpreter.Object} Current scope dictionary.\n */\nInterpreter.prototype.getScope = function () {\n var scope = this.stateStack[this.stateStack.length - 1].scope;\n if (!scope) {\n throw Error(\"No scope found.\");\n }\n return scope;\n};\n\n/**\n * Create a new scope dictionary.\n * @param {!Object} node AST node defining the scope container\n * (e.g. a function).\n * @param {Interpreter.Object} parentScope Scope to link to.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createScope = function (node, parentScope) {\n var scope = this.createObjectProto(null);\n scope.parentScope = parentScope;\n if (!parentScope) {\n this.initGlobalScope(scope);\n }\n this.populateScope_(node, scope);\n\n // Determine if this scope starts with 'use strict'.\n scope.strict = false;\n if (parentScope && parentScope.strict) {\n scope.strict = true;\n } else {\n var firstNode = node[\"body\"] && node[\"body\"][0];\n if (\n firstNode &&\n firstNode.expression &&\n firstNode.expression[\"type\"] === \"Literal\" &&\n firstNode.expression.value === \"use strict\"\n ) {\n scope.strict = true;\n }\n }\n return scope;\n};\n\n/**\n * Create a new special scope dictionary. Similar to createScope(), but\n * doesn't assume that the scope is for a function body.\n * This is used for 'catch' clauses and 'with' statements.\n * @param {!Interpreter.Object} parentScope Scope to link to.\n * @param {Interpreter.Object=} opt_scope Optional object to transform into\n * scope.\n * @return {!Interpreter.Object} New scope.\n */\nInterpreter.prototype.createSpecialScope = function (parentScope, opt_scope) {\n if (!parentScope) {\n throw Error(\"parentScope required\");\n }\n var scope = opt_scope || this.createObjectProto(null);\n scope.parentScope = parentScope;\n scope.strict = parentScope.strict;\n return scope;\n};\n\n/**\n * Retrieves a value from the scope chain.\n * @param {string} name Name of variable.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValueFromScope = function (name, node) {\n var scope = this.getScope();\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n return scope.properties[name];\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has inherited properties and\n // could also have getters.\n if (scope === this.global && this.hasProperty(scope, name)) {\n return this.getProperty(scope, name);\n }\n // Typeof operator is unique: it can safely look at non-defined variables.\n var prevNode = this.stateStack[this.stateStack.length - 1].node;\n if (prevNode[\"type\"] === \"UnaryExpression\" && prevNode[\"operator\"] === \"typeof\") {\n return undefined;\n }\n\n var lineNum;\n if (node != null && node.loc != null && node.loc.start != null) {\n lineNum = node.loc.start.line;\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\", lineNum);\n};\n\n/**\n * Sets a value to the current scope.\n * @param {string} name Name of variable.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValueToScope = function (name, value) {\n var scope = this.getScope();\n var strict = scope.strict;\n while (scope && scope !== this.global) {\n if (name in scope.properties) {\n scope.properties[name] = value;\n return undefined;\n }\n scope = scope.parentScope;\n }\n // The root scope is also an object which has readonly properties and\n // could also have setters.\n if (scope === this.global && (!strict || this.hasProperty(scope, name))) {\n return this.setProperty(scope, name, value);\n }\n this.throwException(this.REFERENCE_ERROR, name + \" is not defined\");\n};\n\n/**\n * Create a new scope for the given node.\n * @param {!Object} node AST node (program or function).\n * @param {!Interpreter.Object} scope Scope dictionary to populate.\n * @private\n */\nInterpreter.prototype.populateScope_ = function (node, scope) {\n if (node[\"type\"] === \"VariableDeclaration\") {\n for (var i = 0; i < node[\"declarations\"].length; i++) {\n this.setProperty(scope, node[\"declarations\"][i][\"id\"][\"name\"], undefined, Interpreter.VARIABLE_DESCRIPTOR);\n }\n } else if (node[\"type\"] === \"FunctionDeclaration\") {\n this.setProperty(scope, node[\"id\"][\"name\"], this.createFunction(node, scope), Interpreter.VARIABLE_DESCRIPTOR);\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"FunctionExpression\") {\n return; // Do not recurse into function.\n } else if (node[\"type\"] === \"ExpressionStatement\") {\n return; // Expressions can't contain variable/function declarations.\n }\n var nodeClass = node[\"constructor\"];\n for (var name in node) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n if (Array.isArray(prop)) {\n for (var i = 0; i < prop.length; i++) {\n if (prop[i] && prop[i].constructor === nodeClass) {\n this.populateScope_(prop[i], scope);\n }\n }\n } else {\n if (prop.constructor === nodeClass) {\n this.populateScope_(prop, scope);\n }\n }\n }\n }\n};\n\n/**\n * Remove start and end values from AST, or set start and end values to a\n * constant value. Used to remove highlighting from polyfills and to set\n * highlighting in an eval to cover the entire eval expression.\n * @param {!Object} node AST node.\n * @param {number=} start Starting character of all nodes, or undefined.\n * @param {number=} end Ending character of all nodes, or undefined.\n * @private\n */\nInterpreter.prototype.stripLocations_ = function (node, start, end) {\n if (start) {\n node[\"start\"] = start;\n } else {\n delete node[\"start\"];\n }\n if (end) {\n node[\"end\"] = end;\n } else {\n delete node[\"end\"];\n }\n for (var name in node) {\n if (node.hasOwnProperty(name)) {\n var prop = node[name];\n if (prop && typeof prop === \"object\") {\n this.stripLocations_(prop, start, end);\n }\n }\n }\n};\n\n/**\n * Is the current state directly being called with as a construction with 'new'.\n * @return {boolean} True if 'new foo()', false if 'foo()'.\n */\nInterpreter.prototype.calledWithNew = function () {\n return this.stateStack[this.stateStack.length - 1].isConstructor;\n};\n\n/**\n * Gets a value from the scope chain or from an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Acorn AST Node} node Node that triggered this function. Used by Bitburner for getting error line number\n * @return {Interpreter.Value} Any value.\n * May be flagged as being a getter and thus needing immediate execution\n * (rather than being the value of the property).\n */\nInterpreter.prototype.getValue = function (ref, node) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.getValueFromScope(ref[1], node);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.getProperty(ref[0], ref[1], node);\n }\n};\n\n/**\n * Sets a value to the scope chain or to an object property.\n * @param {!Array} ref Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value.\n * @return {!Interpreter.Object|undefined} Returns a setter function if one\n * needs to be called, otherwise undefined.\n */\nInterpreter.prototype.setValue = function (ref, value) {\n if (ref[0] === Interpreter.SCOPE_REFERENCE) {\n // A null/varname variable lookup.\n return this.setValueToScope(ref[1], value);\n } else {\n // An obj/prop components tuple (foo.bar).\n return this.setProperty(ref[0], ref[1], value);\n }\n};\n\n/**\n * Completion Value Types.\n * @enum {number}\n */\nInterpreter.Completion = {\n NORMAL: 0,\n BREAK: 1,\n CONTINUE: 2,\n RETURN: 3,\n THROW: 4,\n};\n\n/**\n * Throw an exception in the interpreter that can be handled by an\n * interpreter try/catch statement. If unhandled, a real exception will\n * be thrown. Can be called with either an error class and a message, or\n * with an actual object to be thrown.\n * @param {!Interpreter.Object} errorClass Type of error (if message is\n * provided) or the value to throw (if no message).\n * @param {string=} opt_message Message being thrown.\n */\nInterpreter.prototype.throwException = function (errorClass, opt_message, lineNumber) {\n if (opt_message === undefined) {\n var error = errorClass; // This is a value to throw, not an error class.\n } else {\n var error = this.createObject(errorClass);\n this.setProperty(error, \"message\", opt_message, Interpreter.NONENUMERABLE_DESCRIPTOR);\n }\n var lineNumErrorMsg;\n if (lineNumber != null) {\n lineNumErrorMsg = this.getErrorLineNumberMessage(lineNumber);\n }\n this.unwind(Interpreter.Completion.THROW, error, undefined, lineNumErrorMsg);\n // Abort anything related to the current step.\n throw Interpreter.STEP_ERROR;\n};\n\n/**\n * Unwind the stack to the innermost relevant enclosing TryStatement,\n * For/ForIn/WhileStatement or Call/NewExpression. If this results in\n * the stack being completely unwound the thread will be terminated\n * and the appropriate error being thrown.\n * @param {Interpreter.Completion} type Completion type.\n * @param {Interpreter.Value=} value Value computed, returned or thrown.\n * @param {string=} label Target label for break or return.\n */\nInterpreter.prototype.unwind = function (type, value, label, lineNumberMsg = \"\") {\n if (type === Interpreter.Completion.NORMAL) {\n throw TypeError(\"Should not unwind for NORMAL completions\");\n }\n\n for (var stack = this.stateStack; stack.length > 0; stack.pop()) {\n var state = stack[stack.length - 1];\n switch (state.node[\"type\"]) {\n case \"TryStatement\":\n state.cv = { type: type, value: value, label: label };\n return;\n case \"CallExpression\":\n case \"NewExpression\":\n if (type === Interpreter.Completion.RETURN) {\n state.value = value;\n return;\n } else if (type !== Interpreter.Completion.THROW) {\n throw Error(\"Unsynatctic break/continue not rejected by Acorn\");\n }\n }\n if (type === Interpreter.Completion.BREAK) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop || state.isSwitch) {\n stack.pop();\n return;\n }\n } else if (type === Interpreter.Completion.CONTINUE) {\n if (label ? state.labels && state.labels.indexOf(label) !== -1 : state.isLoop) {\n return;\n }\n }\n }\n\n // Unhandled completion. Throw a real error.\n var realError;\n if (this.isa(value, this.ERROR)) {\n var errorTable = {\n EvalError: EvalError,\n RangeError: RangeError,\n ReferenceError: ReferenceError,\n SyntaxError: SyntaxError,\n TypeError: TypeError,\n URIError: URIError,\n };\n var name = this.getProperty(value, \"name\").toString();\n var message = this.getProperty(value, \"message\").valueOf();\n var type = errorTable[name] || Error;\n realError = type(message + lineNumberMsg);\n } else {\n realError = String(value) + lineNumberMsg;\n }\n throw realError;\n};\n\n/**\n * Create a call to a getter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @private\n */\nInterpreter.prototype.createGetter_ = function (func, left) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is explicitly provided (o).\n var funcThis = Array.isArray(left) ? left[0] : left;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [];\n return state;\n};\n\n/**\n * Create a call to a setter function.\n * @param {!Interpreter.Object} func Function to execute.\n * @param {!Interpreter.Object|!Array} left\n * Name of variable or object/propname tuple.\n * @param {Interpreter.Value} value Value to set.\n * @private\n */\nInterpreter.prototype.createSetter_ = function (func, left, value) {\n // Normally 'this' will be specified as the object component (o.x).\n // Sometimes 'this' is implicitly the global object (x).\n var funcThis = Array.isArray(left) ? left[0] : this.global;\n var node = new this.nodeConstructor();\n node[\"type\"] = \"CallExpression\";\n var state = new Interpreter.State(node, this.stateStack[this.stateStack.length - 1].scope);\n state.doneCallee_ = true;\n state.funcThis_ = funcThis;\n state.func_ = func;\n state.doneArgs_ = true;\n state.arguments_ = [value];\n return state;\n};\n\n/**\n * Class for a state.\n * @param {!Object} node AST node for the state.\n * @param {!Interpreter.Object} scope Scope object for the state.\n * @constructor\n */\nInterpreter.State = function (node, scope) {\n this.node = node;\n this.scope = scope;\n};\n\n///////////////////////////////////////////////////////////////////////////////\n// Functions to handle each node type.\n///////////////////////////////////////////////////////////////////////////////\n\nInterpreter.prototype[\"stepArrayExpression\"] = function (stack, state, node) {\n var elements = node[\"elements\"];\n var n = state.n_ || 0;\n if (!state.array_) {\n state.array_ = this.createObjectProto(this.ARRAY_PROTO);\n state.array_.properties.length = elements.length;\n } else {\n this.setProperty(state.array_, n, state.value);\n n++;\n }\n while (n < elements.length) {\n // Skip missing elements - they're not defined, not undefined.\n if (elements[n]) {\n state.n_ = n;\n return new Interpreter.State(elements[n], state.scope);\n }\n n++;\n }\n stack.pop();\n stack[stack.length - 1].value = state.array_;\n};\n\nInterpreter.prototype[\"stepAssignmentExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"left\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.doneRight_) {\n if (!state.leftReference_) {\n state.leftReference_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_ && node[\"operator\"] !== \"=\") {\n var leftValue = this.getValue(state.leftReference_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftReference_);\n }\n }\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var value = state.leftValue_;\n var rightValue = state.value;\n switch (node[\"operator\"]) {\n case \"=\":\n value = rightValue;\n break;\n case \"+=\":\n value += rightValue;\n break;\n case \"-=\":\n value -= rightValue;\n break;\n case \"*=\":\n value *= rightValue;\n break;\n case \"/=\":\n value /= rightValue;\n break;\n case \"%=\":\n value %= rightValue;\n break;\n case \"<<=\":\n value <<= rightValue;\n break;\n case \">>=\":\n value >>= rightValue;\n break;\n case \">>>=\":\n value >>>= rightValue;\n break;\n case \"&=\":\n value &= rightValue;\n break;\n case \"^=\":\n value ^= rightValue;\n break;\n case \"|=\":\n value |= rightValue;\n break;\n default:\n throw SyntaxError(\"Unknown assignment expression: \" + node[\"operator\"]);\n }\n var setter = this.setValue(state.leftReference_, value);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = value;\n return this.createSetter_(setter, state.leftReference_, value);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBinaryExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n state.doneRight_ = true;\n state.leftValue_ = state.value;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n stack.pop();\n var leftValue = state.leftValue_;\n var rightValue = state.value;\n var value;\n switch (node[\"operator\"]) {\n case \"==\":\n value = leftValue == rightValue;\n break;\n case \"!=\":\n value = leftValue != rightValue;\n break;\n case \"===\":\n value = leftValue === rightValue;\n break;\n case \"!==\":\n value = leftValue !== rightValue;\n break;\n case \">\":\n value = leftValue > rightValue;\n break;\n case \">=\":\n value = leftValue >= rightValue;\n break;\n case \"<\":\n value = leftValue < rightValue;\n break;\n case \"<=\":\n value = leftValue <= rightValue;\n break;\n case \"+\":\n value = leftValue + rightValue;\n break;\n case \"-\":\n value = leftValue - rightValue;\n break;\n case \"*\":\n value = leftValue * rightValue;\n break;\n case \"/\":\n value = leftValue / rightValue;\n break;\n case \"%\":\n value = leftValue % rightValue;\n break;\n case \"&\":\n value = leftValue & rightValue;\n break;\n case \"|\":\n value = leftValue | rightValue;\n break;\n case \"^\":\n value = leftValue ^ rightValue;\n break;\n case \"<<\":\n value = leftValue << rightValue;\n break;\n case \">>\":\n value = leftValue >> rightValue;\n break;\n case \">>>\":\n value = leftValue >>> rightValue;\n break;\n case \"in\":\n if (!rightValue || !rightValue.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"'in' expects an object, not '\" + rightValue + \"'\", lineNum);\n }\n value = this.hasProperty(rightValue, leftValue);\n break;\n case \"instanceof\":\n if (!this.isa(rightValue, this.FUNCTION)) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, \"Right-hand side of instanceof is not an object\", lineNum);\n }\n value = leftValue.isObject ? this.isa(leftValue, rightValue) : false;\n break;\n default:\n throw SyntaxError(\"Unknown binary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepBlockStatement\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepBreakStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.BREAK, undefined, label);\n};\n\nInterpreter.prototype[\"stepCallExpression\"] = function (stack, state, node) {\n if (!state.doneCallee_) {\n state.doneCallee_ = 1;\n // Components needed to determine value of 'this'.\n var nextState = new Interpreter.State(node[\"callee\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (state.doneCallee_ === 1) {\n // Determine value of the function.\n state.doneCallee_ = 2;\n var func = state.value;\n if (Array.isArray(func)) {\n state.func_ = this.getValue(func, node);\n if (func[0] === Interpreter.SCOPE_REFERENCE) {\n // (Globally or locally) named function. Is it named 'eval'?\n state.directEval_ = func[1] === \"eval\";\n } else {\n // Method function, 'this' is object (ignored if invoked as 'new').\n state.funcThis_ = func[0];\n }\n func = state.func_;\n if (func && typeof func === \"object\" && func.isGetter) {\n // Clear the getter flag and call the getter function.\n func.isGetter = false;\n state.doneCallee_ = 1;\n return this.createGetter_(/** @type {!Interpreter.Object} */ (func), state.value);\n }\n } else {\n // Already evaluated function: (function(){...})();\n state.func_ = func;\n }\n state.arguments_ = [];\n state.n_ = 0;\n }\n var func = state.func_;\n if (!state.doneArgs_) {\n if (state.n_ !== 0) {\n state.arguments_.push(state.value);\n }\n if (node[\"arguments\"][state.n_]) {\n return new Interpreter.State(node[\"arguments\"][state.n_++], state.scope);\n }\n // Determine value of 'this' in function.\n if (node[\"type\"] === \"NewExpression\") {\n if (func.illegalConstructor) {\n // Illegal: new escape();\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a constructor\", lineNum);\n }\n // Constructor, 'this' is new object.\n var proto = func.properties[\"prototype\"];\n if (typeof proto !== \"object\" || proto === null) {\n // Non-object prototypes default to Object.prototype.\n proto = this.OBJECT_PROTO;\n }\n state.funcThis_ = this.createObjectProto(proto);\n state.isConstructor = true;\n } else if (state.funcThis_ === undefined) {\n // Global function, 'this' is global object (or 'undefined' if strict).\n state.funcThis_ = state.scope.strict ? undefined : this.global;\n }\n state.doneArgs_ = true;\n }\n if (!state.doneExec_) {\n state.doneExec_ = true;\n if (!func || !func.isObject) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func + \" is not a function\", lineNum);\n }\n var funcNode = func.node;\n if (funcNode) {\n var scope = this.createScope(funcNode[\"body\"], func.parentScope);\n // Add all arguments.\n for (var i = 0; i < funcNode[\"params\"].length; i++) {\n var paramName = funcNode[\"params\"][i][\"name\"];\n var paramValue = state.arguments_.length > i ? state.arguments_[i] : undefined;\n this.setProperty(scope, paramName, paramValue);\n }\n // Build arguments variable.\n var argsList = this.createObjectProto(this.ARRAY_PROTO);\n for (var i = 0; i < state.arguments_.length; i++) {\n this.setProperty(argsList, i, state.arguments_[i]);\n }\n this.setProperty(scope, \"arguments\", argsList);\n // Add the function's name (var x = function foo(){};)\n var name = funcNode[\"id\"] && funcNode[\"id\"][\"name\"];\n if (name) {\n this.setProperty(scope, name, func);\n }\n this.setProperty(scope, \"this\", state.funcThis_, Interpreter.READONLY_DESCRIPTOR);\n state.value = undefined; // Default value if no explicit return.\n return new Interpreter.State(funcNode[\"body\"], scope);\n } else if (func.eval) {\n var code = state.arguments_[0];\n if (typeof code !== \"string\") {\n // JS does not parse String objects:\n // eval(new String('1 + 1')) -> '1 + 1'\n state.value = code;\n } else {\n try {\n var ast = acorn.parse(code.toString(), Interpreter.PARSE_OPTIONS);\n } catch (e) {\n // Acorn threw a SyntaxError. Rethrow as a trappable error.\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.SYNTAX_ERROR, \"Invalid code: \" + e.message, lineNum);\n }\n var evalNode = new this.nodeConstructor();\n evalNode[\"type\"] = \"EvalProgram_\";\n evalNode[\"body\"] = ast[\"body\"];\n this.stripLocations_(evalNode, node[\"start\"], node[\"end\"]);\n // Create new scope and update it with definitions in eval().\n var scope = state.directEval_ ? state.scope : this.global;\n if (scope.strict) {\n // Strict mode get its own scope in eval.\n scope = this.createScope(ast, scope);\n } else {\n // Non-strict mode pollutes the current scope.\n this.populateScope_(ast, scope);\n }\n this.value = undefined; // Default value if no code.\n return new Interpreter.State(evalNode, scope);\n }\n } else if (func.nativeFunc) {\n state.value = func.nativeFunc.apply(state.funcThis_, state.arguments_);\n } else if (func.asyncFunc) {\n var thisInterpreter = this;\n var callback = function (value) {\n state.value = value;\n thisInterpreter.paused_ = false;\n };\n var argsWithCallback = state.arguments_.concat(callback);\n this.paused_ = true;\n func.asyncFunc.apply(state.funcThis_, argsWithCallback);\n return;\n } else {\n /* A child of a function is a function but is not callable. For example:\n var F = function() {};\n F.prototype = escape;\n var f = new F();\n f();\n */\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(this.TYPE_ERROR, func.class + \" is not a function\", lineNum);\n }\n } else {\n // Execution complete. Put the return value on the stack.\n stack.pop();\n if (state.isConstructor && typeof state.value !== \"object\") {\n stack[stack.length - 1].value = state.funcThis_;\n } else {\n stack[stack.length - 1].value = state.value;\n }\n }\n};\n\nInterpreter.prototype[\"stepCatchClause\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n // Create an empty scope.\n var scope = this.createSpecialScope(state.scope);\n // Add the argument.\n this.setProperty(scope, node[\"param\"][\"name\"], state.throwValue);\n // Execute catch clause.\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepConditionalExpression\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (mode === 1) {\n state.mode_ = 2;\n var value = Boolean(state.value);\n if (value && node[\"consequent\"]) {\n // Execute 'if' block.\n return new Interpreter.State(node[\"consequent\"], state.scope);\n } else if (!value && node[\"alternate\"]) {\n // Execute 'else' block.\n return new Interpreter.State(node[\"alternate\"], state.scope);\n }\n // eval('1;if(false){2}') -> undefined\n this.value = undefined;\n }\n stack.pop();\n if (node[\"type\"] === \"ConditionalExpression\") {\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepContinueStatement\"] = function (stack, state, node) {\n var label = node[\"label\"] && node[\"label\"][\"name\"];\n this.unwind(Interpreter.Completion.CONTINUE, undefined, label);\n};\n\nInterpreter.prototype[\"stepDebuggerStatement\"] = function (stack, state, node) {\n // Do nothing. May be overridden by developers.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepDoWhileStatement\"] = function (stack, state, node) {\n if (node[\"type\"] === \"DoWhileStatement\" && state.test_ === undefined) {\n // First iteration of do/while executes without checking test.\n state.value = true;\n state.test_ = true;\n }\n if (!state.test_) {\n state.test_ = true;\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n if (!state.value) {\n // Done, exit loop.\n stack.pop();\n } else if (node[\"body\"]) {\n // Execute the body.\n state.test_ = false;\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepEmptyStatement\"] = function (stack, state, node) {\n stack.pop();\n};\n\nInterpreter.prototype[\"stepEvalProgram_\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"body\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = this.value;\n};\n\nInterpreter.prototype[\"stepExpressionStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"expression\"], state.scope);\n }\n stack.pop();\n // Save this value to interpreter.value for use as a return value if\n // this code is inside an eval function.\n this.value = state.value;\n};\n\nInterpreter.prototype[\"stepForInStatement\"] = function (stack, state, node) {\n // First, initialize a variable if exists. Only do so once, ever.\n if (!state.doneInit_) {\n state.doneInit_ = true;\n if (node[\"left\"][\"declarations\"] && node[\"left\"][\"declarations\"][0][\"init\"]) {\n if (state.scope.strict) {\n let lineNum = this.getErrorLineNumber(node);\n this.throwException(\n this.SYNTAX_ERROR,\n \"for-in loop variable declaration may not have an initializer.\",\n lineNum,\n );\n }\n // Variable initialization: for (var x = 4 in y)\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n }\n // Second, look up the object. Only do so once, ever.\n if (!state.doneObject_) {\n state.doneObject_ = true;\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n if (!state.isLoop) {\n // First iteration.\n state.isLoop = true;\n state.object_ = state.value;\n state.visited_ = Object.create(null);\n }\n // Third, find the property name for this iteration.\n if (state.name_ === undefined) {\n gotPropName: while (true) {\n if (state.object_ && state.object_.isObject) {\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_.properties);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this object's properties.\n }\n if (!Object.prototype.hasOwnProperty.call(state.object_.properties, prop)) {\n continue; // Property has been deleted in the loop.\n }\n if (state.visited_[prop]) {\n continue; // Already seen this property on a child.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_.properties, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n } else if (state.object_ !== null && state.object_ !== undefined) {\n // Primitive value (other than null or undefined).\n if (!state.props_) {\n state.props_ = Object.getOwnPropertyNames(state.object_);\n }\n while (true) {\n var prop = state.props_.shift();\n if (prop === undefined) {\n break; // Reached end of this value's properties.\n }\n state.visited_[prop] = true;\n if (!Object.prototype.propertyIsEnumerable.call(state.object_, prop)) {\n continue; // Skip non-enumerable property.\n }\n state.name_ = prop;\n break gotPropName;\n }\n }\n state.object_ = this.getPrototype(state.object_);\n state.props_ = null;\n if (state.object_ === null) {\n // Done, exit loop.\n stack.pop();\n return;\n }\n }\n }\n // Fourth, find the variable\n if (!state.doneVariable_) {\n state.doneVariable_ = true;\n var left = node[\"left\"];\n if (left[\"type\"] === \"VariableDeclaration\") {\n // Inline variable declaration: for (var x in y)\n state.variable_ = [Interpreter.SCOPE_REFERENCE, left[\"declarations\"][0][\"id\"][\"name\"]];\n } else {\n // Arbitrary left side: for (foo().bar in y)\n state.variable_ = null;\n var nextState = new Interpreter.State(left, state.scope);\n nextState.components = true;\n return nextState;\n }\n }\n if (!state.variable_) {\n state.variable_ = state.value;\n }\n // Fifth, set the variable.\n if (!state.doneSetter_) {\n state.doneSetter_ = true;\n var value = state.name_;\n var setter = this.setValue(state.variable_, value);\n if (setter) {\n return this.createSetter_(setter, state.variable_, value);\n }\n }\n // Next step will be step three.\n state.name_ = undefined;\n // Reevaluate the variable since it could be a setter on the global object.\n state.doneVariable_ = false;\n state.doneSetter_ = false;\n // Sixth and finally, execute the body if there was one. this.\n if (node[\"body\"]) {\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n};\n\nInterpreter.prototype[\"stepForStatement\"] = function (stack, state, node) {\n var mode = state.mode_ || 0;\n if (mode === 0) {\n state.mode_ = 1;\n if (node[\"init\"]) {\n return new Interpreter.State(node[\"init\"], state.scope);\n }\n } else if (mode === 1) {\n state.mode_ = 2;\n if (node[\"test\"]) {\n return new Interpreter.State(node[\"test\"], state.scope);\n }\n } else if (mode === 2) {\n state.mode_ = 3;\n if (node[\"test\"] && !state.value) {\n // Done, exit loop.\n stack.pop();\n } else {\n // Execute the body.\n state.isLoop = true;\n return new Interpreter.State(node[\"body\"], state.scope);\n }\n } else if (mode === 3) {\n state.mode_ = 1;\n if (node[\"update\"]) {\n return new Interpreter.State(node[\"update\"], state.scope);\n }\n }\n};\n\nInterpreter.prototype[\"stepFunctionDeclaration\"] = function (stack, state, node) {\n // This was found and handled when the scope was populated.\n stack.pop();\n};\n\nInterpreter.prototype[\"stepFunctionExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.createFunction(node, state.scope);\n};\n\nInterpreter.prototype[\"stepIdentifier\"] = function (stack, state, node) {\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [Interpreter.SCOPE_REFERENCE, node[\"name\"]];\n return;\n }\n var value = this.getValueFromScope(node[\"name\"], node);\n // An identifier could be a getter if it's a property on the global object.\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var scope = state.scope;\n while (!this.hasProperty(scope, node[\"name\"])) {\n scope = scope.parentScope;\n }\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, this.global);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepIfStatement\"] = Interpreter.prototype[\"stepConditionalExpression\"];\n\nInterpreter.prototype[\"stepLabeledStatement\"] = function (stack, state, node) {\n // No need to hit this node again on the way back up the stack.\n stack.pop();\n // Note that a statement might have multiple labels.\n var labels = state.labels || [];\n labels.push(node[\"label\"][\"name\"]);\n var nextState = new Interpreter.State(node[\"body\"], state.scope);\n nextState.labels = labels;\n return nextState;\n};\n\nInterpreter.prototype[\"stepLiteral\"] = function (stack, state, node) {\n stack.pop();\n var value = node[\"value\"];\n if (value instanceof RegExp) {\n var pseudoRegexp = this.createObjectProto(this.REGEXP_PROTO);\n this.populateRegExp(pseudoRegexp, value);\n value = pseudoRegexp;\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepLogicalExpression\"] = function (stack, state, node) {\n if (node[\"operator\"] !== \"&&\" && node[\"operator\"] !== \"||\") {\n throw SyntaxError(\"Unknown logical operator: \" + node[\"operator\"]);\n }\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n return new Interpreter.State(node[\"left\"], state.scope);\n }\n if (!state.doneRight_) {\n if ((node[\"operator\"] === \"&&\" && !state.value) || (node[\"operator\"] === \"||\" && state.value)) {\n // Shortcut evaluation.\n stack.pop();\n stack[stack.length - 1].value = state.value;\n } else {\n state.doneRight_ = true;\n return new Interpreter.State(node[\"right\"], state.scope);\n }\n } else {\n stack.pop();\n stack[stack.length - 1].value = state.value;\n }\n};\n\nInterpreter.prototype[\"stepMemberExpression\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n }\n var propName;\n if (!node[\"computed\"]) {\n state.object_ = state.value;\n // obj.foo -- Just access 'foo' directly.\n propName = node[\"property\"][\"name\"];\n } else if (!state.doneProperty_) {\n state.object_ = state.value;\n // obj[foo] -- Compute value of 'foo'.\n state.doneProperty_ = true;\n return new Interpreter.State(node[\"property\"], state.scope);\n } else {\n propName = state.value;\n }\n stack.pop();\n if (state.components) {\n stack[stack.length - 1].value = [state.object_, propName];\n } else {\n var value = this.getProperty(state.object_, propName);\n if (value && typeof value === \"object\" && value.isGetter) {\n // Clear the getter flag and call the getter function.\n value.isGetter = false;\n var func = /** @type {!Interpreter.Object} */ (value);\n return this.createGetter_(func, state.object_);\n }\n stack[stack.length - 1].value = value;\n }\n};\n\nInterpreter.prototype[\"stepNewExpression\"] = Interpreter.prototype[\"stepCallExpression\"];\n\nInterpreter.prototype[\"stepObjectExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var property = node[\"properties\"][n];\n if (!state.object_) {\n // First execution.\n state.object_ = this.createObjectProto(this.OBJECT_PROTO);\n state.properties_ = Object.create(null);\n } else {\n // Determine property name.\n var key = property[\"key\"];\n if (key[\"type\"] === \"Identifier\") {\n var propName = key[\"name\"];\n } else if (key[\"type\"] === \"Literal\") {\n var propName = key[\"value\"];\n } else {\n throw SyntaxError(\"Unknown object structure: \" + key[\"type\"]);\n }\n // Set the property computed in the previous execution.\n if (!state.properties_[propName]) {\n // Create temp object to collect value, getter, and/or setter.\n state.properties_[propName] = {};\n }\n state.properties_[propName][property[\"kind\"]] = state.value;\n state.n_ = ++n;\n property = node[\"properties\"][n];\n }\n if (property) {\n return new Interpreter.State(property[\"value\"], state.scope);\n }\n for (var key in state.properties_) {\n var kinds = state.properties_[key];\n if (\"get\" in kinds || \"set\" in kinds) {\n // Set a property with a getter or setter.\n var descriptor = {\n configurable: true,\n enumerable: true,\n get: kinds[\"get\"],\n set: kinds[\"set\"],\n };\n this.setProperty(state.object_, key, null, descriptor);\n } else {\n // Set a normal property with a value.\n this.setProperty(state.object_, key, kinds[\"init\"]);\n }\n }\n stack.pop();\n stack[stack.length - 1].value = state.object_;\n};\n\nInterpreter.prototype[\"stepProgram\"] = function (stack, state, node) {\n var expression = node[\"body\"].shift();\n if (expression) {\n state.done = false;\n return new Interpreter.State(expression, state.scope);\n }\n state.done = true;\n // Don't pop the stateStack.\n // Leave the root scope on the tree in case the program is appended to.\n};\n\nInterpreter.prototype[\"stepReturnStatement\"] = function (stack, state, node) {\n if (node[\"argument\"] && !state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n }\n this.unwind(Interpreter.Completion.RETURN, state.value, undefined);\n};\n\nInterpreter.prototype[\"stepSequenceExpression\"] = function (stack, state, node) {\n var n = state.n_ || 0;\n var expression = node[\"expressions\"][n];\n if (expression) {\n state.n_ = n + 1;\n return new Interpreter.State(expression, state.scope);\n }\n stack.pop();\n stack[stack.length - 1].value = state.value;\n};\n\nInterpreter.prototype[\"stepSwitchStatement\"] = function (stack, state, node) {\n if (!state.test_) {\n state.test_ = 1;\n return new Interpreter.State(node[\"discriminant\"], state.scope);\n }\n if (state.test_ === 1) {\n state.test_ = 2;\n // Preserve switch value between case tests.\n state.switchValue_ = state.value;\n state.defaultCase_ = -1;\n }\n\n while (true) {\n var index = state.index_ || 0;\n var switchCase = node[\"cases\"][index];\n if (!state.matched_ && switchCase && !switchCase[\"test\"]) {\n // Test on the default case is null.\n // Bypass (but store) the default case, and get back to it later.\n state.defaultCase_ = index;\n state.index_ = index + 1;\n continue;\n }\n if (!switchCase && !state.matched_ && state.defaultCase_ !== -1) {\n // Ran through all cases, no match. Jump to the default.\n state.matched_ = true;\n state.index_ = state.defaultCase_;\n continue;\n }\n if (switchCase) {\n if (!state.matched_ && !state.tested_ && switchCase[\"test\"]) {\n state.tested_ = true;\n return new Interpreter.State(switchCase[\"test\"], state.scope);\n }\n if (state.matched_ || state.value === state.switchValue_) {\n state.matched_ = true;\n var n = state.n_ || 0;\n if (switchCase[\"consequent\"][n]) {\n state.isSwitch = true;\n state.n_ = n + 1;\n return new Interpreter.State(switchCase[\"consequent\"][n], state.scope);\n }\n }\n // Move on to next case.\n state.tested_ = false;\n state.n_ = 0;\n state.index_ = index + 1;\n } else {\n stack.pop();\n return;\n }\n }\n};\n\nInterpreter.prototype[\"stepThisExpression\"] = function (stack, state, node) {\n stack.pop();\n stack[stack.length - 1].value = this.getValueFromScope(\"this\", node);\n};\n\nInterpreter.prototype[\"stepThrowStatement\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n return new Interpreter.State(node[\"argument\"], state.scope);\n } else {\n this.throwException(state.value);\n }\n};\n\nInterpreter.prototype[\"stepTryStatement\"] = function (stack, state, node) {\n if (!state.doneBlock_) {\n state.doneBlock_ = true;\n return new Interpreter.State(node[\"block\"], state.scope);\n }\n if (state.cv && state.cv.type === Interpreter.Completion.THROW && !state.doneHandler_ && node[\"handler\"]) {\n state.doneHandler_ = true;\n var nextState = new Interpreter.State(node[\"handler\"], state.scope);\n nextState.throwValue = state.cv.value;\n state.cv = undefined; // This error has been handled, don't rethrow.\n return nextState;\n }\n if (!state.doneFinalizer_ && node[\"finalizer\"]) {\n state.doneFinalizer_ = true;\n return new Interpreter.State(node[\"finalizer\"], state.scope);\n }\n stack.pop();\n if (state.cv) {\n // There was no catch handler, or the catch/finally threw an error.\n // Throw the error up to a higher try.\n this.unwind(state.cv.type, state.cv.value, state.cv.label);\n }\n};\n\nInterpreter.prototype[\"stepUnaryExpression\"] = function (stack, state, node) {\n if (!state.done_) {\n state.done_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = node[\"operator\"] === \"delete\";\n return nextState;\n }\n stack.pop();\n var value = state.value;\n if (node[\"operator\"] === \"-\") {\n value = -value;\n } else if (node[\"operator\"] === \"+\") {\n value = +value;\n } else if (node[\"operator\"] === \"!\") {\n value = !value;\n } else if (node[\"operator\"] === \"~\") {\n value = ~value;\n } else if (node[\"operator\"] === \"delete\") {\n var result = true;\n // If value is not an array, then it is a primitive, or some other value.\n // If so, skip the delete and return true.\n if (Array.isArray(value)) {\n var obj = value[0];\n if (obj === Interpreter.SCOPE_REFERENCE) {\n // 'delete foo;' is the same as 'delete window.foo'.\n obj = state.scope;\n }\n var name = String(value[1]);\n try {\n delete obj.properties[name];\n } catch (e) {\n if (state.scope.strict) {\n this.throwException(this.TYPE_ERROR, \"Cannot delete property '\" + name + \"' of '\" + obj + \"'\");\n } else {\n result = false;\n }\n }\n }\n value = result;\n } else if (node[\"operator\"] === \"typeof\") {\n value = value && value.class === \"Function\" ? \"function\" : typeof value;\n } else if (node[\"operator\"] === \"void\") {\n value = undefined;\n } else {\n throw SyntaxError(\"Unknown unary operator: \" + node[\"operator\"]);\n }\n stack[stack.length - 1].value = value;\n};\n\nInterpreter.prototype[\"stepUpdateExpression\"] = function (stack, state, node) {\n if (!state.doneLeft_) {\n state.doneLeft_ = true;\n var nextState = new Interpreter.State(node[\"argument\"], state.scope);\n nextState.components = true;\n return nextState;\n }\n if (!state.leftSide_) {\n state.leftSide_ = state.value;\n }\n if (state.doneGetter_) {\n state.leftValue_ = state.value;\n }\n if (!state.doneGetter_) {\n var leftValue = this.getValue(state.leftSide_, node);\n state.leftValue_ = leftValue;\n if (leftValue && typeof leftValue === \"object\" && leftValue.isGetter) {\n // Clear the getter flag and call the getter function.\n leftValue.isGetter = false;\n state.doneGetter_ = true;\n var func = /** @type {!Interpreter.Object} */ (leftValue);\n return this.createGetter_(func, state.leftSide_);\n }\n }\n if (state.doneSetter_) {\n // Return if setter function.\n // Setter method on property has completed.\n // Ignore its return value, and use the original set value instead.\n stack.pop();\n stack[stack.length - 1].value = state.setterValue_;\n return;\n }\n var leftValue = Number(state.leftValue_);\n var changeValue;\n if (node[\"operator\"] === \"++\") {\n changeValue = leftValue + 1;\n } else if (node[\"operator\"] === \"--\") {\n changeValue = leftValue - 1;\n } else {\n throw SyntaxError(\"Unknown update expression: \" + node[\"operator\"]);\n }\n var returnValue = node[\"prefix\"] ? changeValue : leftValue;\n var setter = this.setValue(state.leftSide_, changeValue);\n if (setter) {\n state.doneSetter_ = true;\n state.setterValue_ = returnValue;\n return this.createSetter_(setter, state.leftSide_, changeValue);\n }\n // Return if no setter function.\n stack.pop();\n stack[stack.length - 1].value = returnValue;\n};\n\nInterpreter.prototype[\"stepVariableDeclaration\"] = function (stack, state, node) {\n var declarations = node[\"declarations\"];\n var n = state.n_ || 0;\n var declarationNode = declarations[n];\n if (state.init_ && declarationNode) {\n // This setValue call never needs to deal with calling a setter function.\n // Note that this is setting the init value, not defining the variable.\n // Variable definition is done when scope is populated.\n this.setValueToScope(declarationNode[\"id\"][\"name\"], state.value);\n state.init_ = false;\n declarationNode = declarations[++n];\n }\n while (declarationNode) {\n // Skip any declarations that are not initialized. They have already\n // been defined as undefined in populateScope_.\n if (declarationNode[\"init\"]) {\n state.n_ = n;\n state.init_ = true;\n return new Interpreter.State(declarationNode[\"init\"], state.scope);\n }\n declarationNode = declarations[++n];\n }\n stack.pop();\n};\n\nInterpreter.prototype[\"stepWithStatement\"] = function (stack, state, node) {\n if (!state.doneObject_) {\n state.doneObject_ = true;\n return new Interpreter.State(node[\"object\"], state.scope);\n } else if (!state.doneBody_) {\n state.doneBody_ = true;\n var scope = this.createSpecialScope(state.scope, state.value);\n return new Interpreter.State(node[\"body\"], scope);\n } else {\n stack.pop();\n }\n};\n\nInterpreter.prototype[\"stepWhileStatement\"] = Interpreter.prototype[\"stepDoWhileStatement\"];\n\n// Preserve top-level API functions from being pruned/renamed by JS compilers.\n// Add others as needed.\n// The global object ('window' in a browser, 'global' in node.js) is 'this'.\n//this['Interpreter'] = Interpreter;\nInterpreter.prototype[\"step\"] = Interpreter.prototype.step;\nInterpreter.prototype[\"run\"] = Interpreter.prototype.run;\nInterpreter.prototype[\"appendCode\"] = Interpreter.prototype.appendCode;\nInterpreter.prototype[\"createObject\"] = Interpreter.prototype.createObject;\nInterpreter.prototype[\"createObjectProto\"] = Interpreter.prototype.createObjectProto;\nInterpreter.prototype[\"createAsyncFunction\"] = Interpreter.prototype.createAsyncFunction;\nInterpreter.prototype[\"createNativeFunction\"] = Interpreter.prototype.createNativeFunction;\nInterpreter.prototype[\"getProperty\"] = Interpreter.prototype.getProperty;\nInterpreter.prototype[\"setProperty\"] = Interpreter.prototype.setProperty;\nInterpreter.prototype[\"nativeToPseudo\"] = Interpreter.prototype.nativeToPseudo;\nInterpreter.prototype[\"pseudoToNative\"] = Interpreter.prototype.pseudoToNative;\n// Obsolete. Do not use.\nInterpreter.prototype[\"createPrimitive\"] = function (x) {\n return x;\n};\n\nexport { Interpreter };\n","import $ from \"jquery\";\nimport { vsprintf, sprintf } from \"sprintf-js\";\nimport { WorkerScriptStartStopEventEmitter } from \"./Netscript/WorkerScriptStartStopEventEmitter\";\nimport { BitNodeMultipliers } from \"./BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"./Constants\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"./Hacking\";\nimport { netscriptCanGrow, netscriptCanWeaken } from \"./Hacking/netscriptCanHack\";\nimport { Terminal } from \"./Terminal\";\nimport { Player } from \"./Player\";\nimport { Programs } from \"./Programs/Programs\";\nimport { Script } from \"./Script/Script\";\nimport { isScriptFilename } from \"./Script/isScriptFilename\";\nimport { PromptEvent } from \"./ui/React/PromptManager\";\nimport { GetServer, DeleteServer, AddToAllServers, createUniqueRandomIp } from \"./Server/AllServers\";\nimport {\n getServerOnNetwork,\n numCycleForGrowth,\n numCycleForGrowthCorrected,\n processSingleServerGrowth,\n safetlyCreateUniqueServer,\n} from \"./Server/ServerHelpers\";\nimport { getPurchaseServerCost, getPurchaseServerLimit, getPurchaseServerMaxRam } from \"./Server/ServerPurchases\";\nimport { Server } from \"./Server/Server\";\nimport { influenceStockThroughServerGrow } from \"./StockMarket/PlayerInfluencing\";\nimport { isValidFilePath, removeLeadingSlash } from \"./Terminal/DirectoryHelpers\";\nimport { TextFile, getTextFile, createTextFile } from \"./TextFile\";\nimport { NetscriptPorts, runScriptFromScript } from \"./NetscriptWorker\";\nimport { killWorkerScript } from \"./Netscript/killWorkerScript\";\nimport { workerScripts } from \"./Netscript/WorkerScripts\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { helpers } from \"./Netscript/NetscriptHelpers\";\nimport { numeralWrapper } from \"./ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { LogBoxEvents, LogBoxCloserEvents, LogBoxPositionEvents, LogBoxSizeEvents } from \"./ui/React/LogBoxManager\";\nimport { arrayToString } from \"./utils/helpers/arrayToString\";\nimport { isString } from \"./utils/helpers/isString\";\nimport { NetscriptGang } from \"./NetscriptFunctions/Gang\";\nimport { NetscriptSleeve } from \"./NetscriptFunctions/Sleeve\";\nimport { NetscriptExtra } from \"./NetscriptFunctions/Extra\";\nimport { NetscriptHacknet } from \"./NetscriptFunctions/Hacknet\";\nimport { NetscriptStanek } from \"./NetscriptFunctions/Stanek\";\nimport { NetscriptInfiltration } from \"./NetscriptFunctions/Infiltration\";\nimport { NetscriptUserInterface } from \"./NetscriptFunctions/UserInterface\";\nimport { NetscriptBladeburner } from \"./NetscriptFunctions/Bladeburner\";\nimport { NetscriptCodingContract } from \"./NetscriptFunctions/CodingContract\";\nimport { NetscriptCorporation } from \"./NetscriptFunctions/Corporation\";\nimport { NetscriptFormulas } from \"./NetscriptFunctions/Formulas\";\nimport { NetscriptStockMarket } from \"./NetscriptFunctions/StockMarket\";\nimport { NetscriptGrafting } from \"./NetscriptFunctions/Grafting\";\nimport { IPort } from \"./NetscriptPort\";\nimport {\n NS,\n Player as INetscriptPlayer,\n RecentScript as IRecentScript,\n BasicHGWOptions,\n ProcessInfo,\n HackingMultipliers,\n HacknetMultipliers,\n BitNodeMultipliers as IBNMults,\n Server as IServerDef,\n RunningScript as IRunningScriptDef,\n} from \"./ScriptEditor/NetscriptDefinitions\";\nimport { NetscriptSingularity } from \"./NetscriptFunctions/Singularity\";\n\nimport { dialogBoxCreate } from \"./ui/React/DialogBox\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\nimport { checkEnum } from \"./utils/helpers/checkEnum\";\n\nimport { Flags } from \"./NetscriptFunctions/Flags\";\nimport { calculateIntelligenceBonus } from \"./PersonObjects/formulas/intelligence\";\nimport { CalculateShareMult, StartSharing } from \"./NetworkShare/Share\";\nimport { recentScripts } from \"./Netscript/RecentScripts\";\nimport { InternalAPI, NetscriptContext, wrapAPI } from \"./Netscript/APIWrapper\";\nimport { INetscriptExtra } from \"./NetscriptFunctions/Extra\";\n\nexport type NSFull = NS & INetscriptExtra;\n\nexport function NetscriptFunctions(workerScript: WorkerScript): NSFull {\n return wrapAPI(workerScript, ns, workerScript.args.slice());\n}\n\nconst base: InternalAPI = {\n args: [],\n enums: {\n toast: ToastVariant,\n },\n\n singularity: NetscriptSingularity(),\n gang: NetscriptGang(),\n bladeburner: NetscriptBladeburner(),\n codingcontract: NetscriptCodingContract(),\n sleeve: NetscriptSleeve(),\n corporation: NetscriptCorporation(),\n stanek: NetscriptStanek(),\n infiltration: NetscriptInfiltration(),\n ui: NetscriptUserInterface(),\n formulas: NetscriptFormulas(),\n stock: NetscriptStockMarket(),\n grafting: NetscriptGrafting(),\n hacknet: NetscriptHacknet(),\n sprintf: () => sprintf,\n vsprintf: () => vsprintf,\n scan:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): string[] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const out = [];\n for (let i = 0; i < server.serversOnNetwork.length; i++) {\n const s = getServerOnNetwork(server, i);\n if (s === null) continue;\n const entry = s.hostname;\n if (entry === null) continue;\n out.push(entry);\n }\n helpers.log(ctx, () => `returned ${server.serversOnNetwork.length} connections for ${server.hostname}`);\n return out;\n },\n hack:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, { threads: requestedThreads, stock }: BasicHGWOptions = {}): Promise => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n return helpers.hack(ctx, hostname, false, { threads: requestedThreads, stock: stock });\n },\n hackAnalyzeThreads:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _hackAmount: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const hackAmount = helpers.number(ctx, \"hackAmount\", _hackAmount);\n\n // Check argument validity\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return -1;\n }\n if (isNaN(hackAmount)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid hackAmount argument passed into hackAnalyzeThreads: ${hackAmount}. Must be numeric.`,\n );\n }\n\n if (hackAmount < 0 || hackAmount > server.moneyAvailable) {\n return -1;\n } else if (hackAmount === 0) {\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n if (percentHacked === 0 || server.moneyAvailable === 0) {\n return 0; // To prevent returning infinity below\n }\n\n return hackAmount / Math.floor(server.moneyAvailable * percentHacked);\n },\n hackAnalyze:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculatePercentMoneyHacked(server, Player);\n },\n hackAnalyzeSecurity:\n (ctx: NetscriptContext) =>\n (_threads: unknown, _hostname?: unknown): number => {\n let threads = helpers.number(ctx, \"threads\", _threads);\n if (_hostname) {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const percentHacked = calculatePercentMoneyHacked(server, Player);\n\n if (percentHacked > 0) {\n // thread count is limited to the maximum number of threads needed\n threads = Math.min(threads, Math.ceil(1 / percentHacked));\n }\n }\n\n return CONSTANTS.ServerFortifyAmount * threads;\n },\n hackAnalyzeChance:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n return calculateHackingChance(server, Player);\n },\n sleep:\n (ctx: NetscriptContext) =>\n async (_time: unknown = 0): Promise => {\n const time = helpers.number(ctx, \"time\", _time);\n if (time === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);\n return helpers.netscriptDelay(ctx, time).then(function () {\n return Promise.resolve(true);\n });\n },\n asleep: (ctx: NetscriptContext) =>\n function (_time: unknown = 0): Promise {\n const time = helpers.number(ctx, \"time\", _time);\n helpers.log(ctx, () => `Sleeping for ${time} milliseconds`);\n return new Promise((resolve) => setTimeout(() => resolve(true), time));\n },\n grow:\n (ctx: NetscriptContext) =>\n async (_hostname: unknown, { threads: requestedThreads, stock }: BasicHGWOptions = {}): Promise => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const threads = helpers.resolveNetscriptRequestedThreads(\n ctx,\n requestedThreads ?? ctx.workerScript.scriptRef.threads,\n );\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n const host = GetServer(ctx.workerScript.hostname);\n if (host === null) {\n throw new Error(\"Workerscript host is null\");\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanGrow(server);\n if (!canHack.res) {\n throw helpers.makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n const growTime = calculateGrowTime(server, Player);\n helpers.log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n growTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n return helpers.netscriptDelay(ctx, growTime * 1000).then(function () {\n const moneyBefore = server.moneyAvailable <= 0 ? 1 : server.moneyAvailable;\n processSingleServerGrowth(server, threads, Player, host.cpuCores);\n const moneyAfter = server.moneyAvailable;\n ctx.workerScript.scriptRef.recordGrow(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n const logGrowPercent = moneyAfter / moneyBefore - 1;\n helpers.log(\n ctx,\n () =>\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n logGrowPercent,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)}).`,\n );\n ctx.workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n if (stock) {\n influenceStockThroughServerGrow(server, moneyAfter - moneyBefore);\n }\n return Promise.resolve(moneyAfter / moneyBefore);\n });\n },\n growthAnalyze:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _growth: unknown, _cores: unknown = 1): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const growth = helpers.number(ctx, \"growth\", _growth);\n const cores = helpers.number(ctx, \"cores\", _cores);\n\n // Check argument validity\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (typeof growth !== \"number\" || isNaN(growth) || growth < 1 || !isFinite(growth)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: growth must be numeric and >= 1, is ${growth}.`);\n }\n\n return numCycleForGrowth(server, Number(growth), Player, cores);\n },\n growthAnalyzeSecurity:\n (ctx: NetscriptContext) =>\n (_threads: unknown, _hostname?: unknown, _cores?: unknown): number => {\n let threads = helpers.number(ctx, \"threads\", _threads);\n if (_hostname) {\n const cores = helpers.number(ctx, \"cores\", _cores) || 1;\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n\n const maxThreadsNeeded = Math.ceil(\n numCycleForGrowthCorrected(server, server.moneyMax, server.moneyAvailable, Player, cores),\n );\n\n threads = Math.min(threads, maxThreadsNeeded);\n }\n\n return 2 * CONSTANTS.ServerFortifyAmount * threads;\n },\n weaken:\n (ctx: NetscriptContext) =>\n async (_hostname: unknown, { threads: requestedThreads }: BasicHGWOptions = {}): Promise => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const threads = helpers.resolveNetscriptRequestedThreads(\n ctx,\n requestedThreads ?? ctx.workerScript.scriptRef.threads,\n );\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return Promise.resolve(0);\n }\n\n // No root access or skill level too low\n const canHack = netscriptCanWeaken(server);\n if (!canHack.res) {\n throw helpers.makeRuntimeErrorMsg(ctx, canHack.msg || \"\");\n }\n\n const weakenTime = calculateWeakenTime(server, Player);\n helpers.log(\n ctx,\n () =>\n `Executing on '${server.hostname}' in ${convertTimeMsToTimeElapsedString(\n weakenTime * 1000,\n true,\n )} (t=${numeralWrapper.formatThreads(threads)})`,\n );\n return helpers.netscriptDelay(ctx, weakenTime * 1000).then(function () {\n const host = GetServer(ctx.workerScript.hostname);\n if (host === null) {\n helpers.log(ctx, () => \"Server is null, did it die?\");\n return Promise.resolve(0);\n }\n const coreBonus = 1 + (host.cpuCores - 1) / 16;\n server.weaken(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n ctx.workerScript.scriptRef.recordWeaken(server.hostname, threads);\n const expGain = calculateHackingExpGain(server, Player) * threads;\n helpers.log(\n ctx,\n () =>\n `'${server.hostname}' security level weakened to ${\n server.hackDifficulty\n }. Gained ${numeralWrapper.formatExp(expGain)} hacking exp (t=${numeralWrapper.formatThreads(threads)})`,\n );\n ctx.workerScript.scriptRef.onlineExpGained += expGain;\n Player.gainHackingExp(expGain);\n return Promise.resolve(CONSTANTS.ServerWeakenAmount * threads * coreBonus);\n });\n },\n weakenAnalyze:\n (ctx: NetscriptContext) =>\n (_threads: unknown, _cores: unknown = 1): number => {\n const threads = helpers.number(ctx, \"threads\", _threads);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const coreBonus = 1 + (cores - 1) / 16;\n return CONSTANTS.ServerWeakenAmount * threads * coreBonus * BitNodeMultipliers.ServerWeakenRate;\n },\n share: (ctx: NetscriptContext) => async (): Promise => {\n helpers.log(ctx, () => \"Sharing this computer.\");\n const end = StartSharing(\n ctx.workerScript.scriptRef.threads * calculateIntelligenceBonus(Player.skills.intelligence, 2),\n );\n return helpers.netscriptDelay(ctx, 10000).finally(function () {\n helpers.log(ctx, () => \"Finished sharing this computer.\");\n end();\n });\n },\n getSharePower: () => (): number => {\n return CalculateShareMult();\n },\n print:\n (ctx: NetscriptContext) =>\n (...args: unknown[]): void => {\n if (args.length === 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes at least 1 argument.\");\n }\n ctx.workerScript.print(helpers.argsToString(args));\n },\n printf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: unknown[]): void => {\n const format = helpers.string(ctx, \"format\", _format);\n if (typeof format !== \"string\") {\n throw helpers.makeRuntimeErrorMsg(ctx, \"First argument must be string for the format.\");\n }\n ctx.workerScript.print(vsprintf(format, args));\n },\n tprint:\n (ctx: NetscriptContext) =>\n (...args: unknown[]): void => {\n if (args.length === 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes at least 1 argument.\");\n }\n const str = helpers.argsToString(args);\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n return;\n }\n Terminal.print(`${ctx.workerScript.scriptRef.filename}: ${str}`);\n },\n tprintf:\n (ctx: NetscriptContext) =>\n (_format: unknown, ...args: unknown[]): void => {\n const format = helpers.string(ctx, \"format\", _format);\n const str = vsprintf(format, args);\n\n if (str.startsWith(\"ERROR\") || str.startsWith(\"FAIL\")) {\n Terminal.error(`${str}`);\n return;\n }\n if (str.startsWith(\"SUCCESS\")) {\n Terminal.success(`${str}`);\n return;\n }\n if (str.startsWith(\"WARN\")) {\n Terminal.warn(`${str}`);\n return;\n }\n if (str.startsWith(\"INFO\")) {\n Terminal.info(`${str}`);\n return;\n }\n Terminal.print(`${str}`);\n },\n clearLog: (ctx: NetscriptContext) => (): void => {\n ctx.workerScript.scriptRef.clearLog();\n },\n disableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n ctx.workerScript.disableLogs[fn] = true;\n }\n helpers.log(ctx, () => `Disabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n } else {\n ctx.workerScript.disableLogs[fn] = true;\n helpers.log(ctx, () => `Disabled logging for ${fn}`);\n }\n },\n enableLog:\n (ctx: NetscriptContext) =>\n (_fn: unknown): void => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (fn === \"ALL\") {\n for (const fn of Object.keys(possibleLogs)) {\n delete ctx.workerScript.disableLogs[fn];\n }\n helpers.log(ctx, () => `Enabled logging for all functions`);\n } else if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n }\n delete ctx.workerScript.disableLogs[fn];\n helpers.log(ctx, () => `Enabled logging for ${fn}`);\n },\n isLogEnabled:\n (ctx: NetscriptContext) =>\n (_fn: unknown): boolean => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n if (possibleLogs[fn] === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${fn}.`);\n }\n return !ctx.workerScript.disableLogs[fn];\n },\n getScriptLogs:\n (ctx: NetscriptContext) =>\n (scriptID: unknown, hostname: unknown, ...scriptArgs: unknown[]): string[] => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n const runningScriptObj = helpers.getRunningScript(ctx, ident);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return [];\n }\n\n return runningScriptObj.logs.slice();\n },\n tail:\n (ctx: NetscriptContext) =>\n (scriptID: unknown, hostname: unknown, ...scriptArgs: unknown[]): void => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n const runningScriptObj = helpers.getRunningScript(ctx, ident);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return;\n }\n\n LogBoxEvents.emit(runningScriptObj);\n },\n moveTail:\n (ctx: NetscriptContext) =>\n (_x: unknown, _y: unknown, _pid: unknown = ctx.workerScript.scriptRef.pid) => {\n const x = helpers.number(ctx, \"x\", _x);\n const y = helpers.number(ctx, \"y\", _y);\n const pid = helpers.number(ctx, \"pid\", _pid);\n LogBoxPositionEvents.emit({ pid, data: { x, y } });\n },\n resizeTail:\n (ctx: NetscriptContext) =>\n (_w: unknown, _h: unknown, _pid: unknown = ctx.workerScript.scriptRef.pid) => {\n const w = helpers.number(ctx, \"w\", _w);\n const h = helpers.number(ctx, \"h\", _h);\n const pid = helpers.number(ctx, \"pid\", _pid);\n LogBoxSizeEvents.emit({ pid, data: { w, h } });\n },\n closeTail:\n (ctx: NetscriptContext) =>\n (_pid: unknown = ctx.workerScript.scriptRef.pid): void => {\n const pid = helpers.number(ctx, \"pid\", _pid);\n //Emit an event to tell the game to close the tail window if it exists\n LogBoxCloserEvents.emit(pid);\n },\n nuke:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (server.hasAdminRights) {\n helpers.log(ctx, () => `Already have root access to '${server.hostname}'.`);\n return true;\n }\n if (!Player.hasProgram(Programs.NukeProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the NUKE.exe virus!\");\n }\n if (server.openPortCount < server.numOpenPortsRequired) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Not enough ports opened to use NUKE.exe virus.\");\n }\n server.hasAdminRights = true;\n helpers.log(ctx, () => `Executed NUKE.exe virus on '${server.hostname}' to gain root access.`);\n return true;\n },\n brutessh:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.BruteSSHProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the BruteSSH.exe program!\");\n }\n if (!server.sshPortOpen) {\n helpers.log(ctx, () => `Executed BruteSSH.exe on '${server.hostname}' to open SSH port (22).`);\n server.sshPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SSH Port (22) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n ftpcrack:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.FTPCrackProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the FTPCrack.exe program!\");\n }\n if (!server.ftpPortOpen) {\n helpers.log(ctx, () => `Executed FTPCrack.exe on '${server.hostname}' to open FTP port (21).`);\n server.ftpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `FTP Port (21) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n relaysmtp:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.RelaySMTPProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the relaySMTP.exe program!\");\n }\n if (!server.smtpPortOpen) {\n helpers.log(ctx, () => `Executed relaySMTP.exe on '${server.hostname}' to open SMTP port (25).`);\n server.smtpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SMTP Port (25) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n httpworm:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.HTTPWormProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the HTTPWorm.exe program!\");\n }\n if (!server.httpPortOpen) {\n helpers.log(ctx, () => `Executed HTTPWorm.exe on '${server.hostname}' to open HTTP port (80).`);\n server.httpPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `HTTP Port (80) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n sqlinject:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Takes 1 argument.\");\n }\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return false;\n }\n if (!Player.hasProgram(Programs.SQLInjectProgram.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have the SQLInject.exe program!\");\n }\n if (!server.sqlPortOpen) {\n helpers.log(ctx, () => `Executed SQLInject.exe on '${server.hostname}' to open SQL port (1433).`);\n server.sqlPortOpen = true;\n ++server.openPortCount;\n } else {\n helpers.log(ctx, () => `SQL Port (1433) already opened on '${server.hostname}'.`);\n }\n return true;\n },\n run:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _threads: unknown = 1, ..._args: unknown[]): number => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (scriptname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: run(scriptname, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev.\");\n }\n\n return runScriptFromScript(\"run\", scriptServer, scriptname, args, ctx.workerScript, threads);\n },\n exec:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown, _threads: unknown = 1, ..._args: unknown[]): number => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (scriptname === undefined || hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: exec(scriptname, server, [numThreads], [arg1], [arg2]...)\");\n }\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const server = helpers.getServer(ctx, hostname);\n return runScriptFromScript(\"exec\", server, scriptname, args, ctx.workerScript, threads);\n },\n spawn:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _threads: unknown = 1, ..._args: unknown[]): void => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const args = helpers.scriptArgs(ctx, _args);\n if (!scriptname || !threads) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: spawn(scriptname, threads)\");\n }\n\n const spawnDelay = 10;\n setTimeout(() => {\n if (isNaN(threads) || threads <= 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid thread count. Must be numeric and > 0, is ${threads}`);\n }\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev\");\n }\n\n return runScriptFromScript(\"spawn\", scriptServer, scriptname, args, ctx.workerScript, threads);\n }, spawnDelay * 1e3);\n\n helpers.log(ctx, () => `Will execute '${scriptname}' in ${spawnDelay} seconds`);\n\n if (killWorkerScript(ctx.workerScript)) {\n helpers.log(ctx, () => \"Exiting...\");\n }\n },\n kill:\n (ctx: NetscriptContext) =>\n (scriptID: unknown, hostname: unknown, ...scriptArgs: unknown[]): boolean => {\n const ident = helpers.scriptIdentifier(ctx, scriptID, hostname, scriptArgs);\n let res;\n const killByPid = typeof ident === \"number\";\n if (killByPid) {\n // Kill by pid\n res = killWorkerScript(ident);\n } else {\n // Kill by filename/hostname\n if (scriptID === undefined || hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: kill(scriptname, server, [arg1], [arg2]...)\");\n }\n\n const server = helpers.getServer(ctx, ident.hostname);\n const runningScriptObj = helpers.getRunningScriptByArgs(ctx, ident.scriptname, ident.hostname, ident.args);\n if (runningScriptObj == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return false;\n }\n\n res = killWorkerScript({ runningScript: runningScriptObj, hostname: server.hostname });\n }\n\n if (res) {\n if (killByPid) {\n helpers.log(ctx, () => `Killing script with PID ${ident}`);\n } else {\n helpers.log(ctx, () => `Killing '${scriptID}' on '${hostname}' with args: ${arrayToString(scriptArgs)}.`);\n }\n return true;\n } else {\n if (killByPid) {\n helpers.log(ctx, () => `No script with PID ${ident}`);\n } else {\n helpers.log(\n ctx,\n () => `No such script '${scriptID}' on '${hostname}' with args: ${arrayToString(scriptArgs)}`,\n );\n }\n return false;\n }\n },\n killall:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname, _safetyguard: unknown = true): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const safetyguard = !!_safetyguard;\n if (hostname === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: killall(hostname, [safetyguard boolean])\");\n }\n const server = helpers.getServer(ctx, hostname);\n\n let scriptsKilled = 0;\n\n for (let i = server.runningScripts.length - 1; i >= 0; --i) {\n if (safetyguard === true && server.runningScripts[i].pid == ctx.workerScript.pid) continue;\n killWorkerScript({ runningScript: server.runningScripts[i], hostname: server.hostname });\n ++scriptsKilled;\n }\n WorkerScriptStartStopEventEmitter.emit();\n helpers.log(\n ctx,\n () => `Killing all scripts on '${server.hostname}'. May take a few minutes for the scripts to die.`,\n );\n\n return scriptsKilled > 0;\n },\n exit: (ctx: NetscriptContext) => (): void => {\n if (killWorkerScript(ctx.workerScript)) {\n helpers.log(ctx, () => \"Exiting...\");\n } else {\n helpers.log(ctx, () => \"Failed. This is a bug. Report to dev.\");\n }\n },\n scp:\n (ctx: NetscriptContext) =>\n (_files: unknown, _destination: unknown, _source: unknown = ctx.workerScript.hostname): boolean => {\n const destination = helpers.string(ctx, \"destination\", _destination);\n const source = helpers.string(ctx, \"source\", _source);\n const destServer = helpers.getServer(ctx, destination);\n const sourceServ = helpers.getServer(ctx, source);\n const files = Array.isArray(_files) ? _files : [_files];\n\n //First loop through filenames to find all errors before moving anything.\n for (const file of files) {\n // Not a string\n if (typeof file !== \"string\")\n throw helpers.makeRuntimeErrorMsg(ctx, \"files should be a string or an array of strings.\");\n\n // Invalid file name\n if (!isValidFilePath(file)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${file}'`);\n\n // Invalid file type\n if (!file.endsWith(\".lit\") && !isScriptFilename(file) && !file.endsWith(\"txt\")) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Only works for scripts, .lit and .txt files.\");\n }\n }\n\n let noFailures = true;\n //ts detects files as any[] here even though we would have thrown in the above loop if it wasn't string[]\n for (const file of files as string[]) {\n // Scp for lit files\n if (file.endsWith(\".lit\")) {\n const sourceMessage = sourceServ.messages.find((message) => message === file);\n if (!sourceMessage) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n const destMessage = destServer.messages.find((message) => message === file);\n if (destMessage) {\n helpers.log(ctx, () => `File '${file}' was already on '${destServer?.hostname}'.`);\n continue;\n }\n\n destServer.messages.push(file);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n continue;\n }\n\n // Scp for text files\n if (file.endsWith(\".txt\")) {\n const sourceTextFile = sourceServ.textFiles.find((textFile) => textFile.fn === file);\n if (!sourceTextFile) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n const destTextFile = destServer.textFiles.find((textFile) => textFile.fn === file);\n if (destTextFile) {\n destTextFile.text = sourceTextFile.text;\n helpers.log(ctx, () => `File '${file}' overwritten on '${destServer?.hostname}'.`);\n continue;\n }\n\n const newFile = new TextFile(sourceTextFile.fn, sourceTextFile.text);\n destServer.textFiles.push(newFile);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n continue;\n }\n\n // Scp for script files\n const sourceScript = sourceServ.scripts.find((script) => script.filename === file);\n if (!sourceScript) {\n helpers.log(ctx, () => `File '${file}' does not exist.`);\n noFailures = false;\n continue;\n }\n\n // Overwrite script if it already exists\n const destScript = destServer.scripts.find((script) => script.filename === file);\n if (destScript) {\n if (destScript.code === sourceScript.code) {\n helpers.log(ctx, () => `Identical file '${file}' was already on '${destServer?.hostname}'`);\n continue;\n }\n destScript.code = sourceScript.code;\n destScript.ramUsage = destScript.ramUsage;\n destScript.markUpdated();\n helpers.log(ctx, () => `WARNING: File '${file}' overwritten on '${destServer?.hostname}'`);\n continue;\n }\n\n // Create new script if it does not already exist\n const newScript = new Script(Player, file);\n newScript.code = sourceScript.code;\n newScript.ramUsage = sourceScript.ramUsage;\n newScript.server = destServer.hostname;\n destServer.scripts.push(newScript);\n helpers.log(ctx, () => `File '${file}' copied over to '${destServer?.hostname}'.`);\n newScript.updateRamUsage(Player, destServer.scripts);\n }\n\n return noFailures;\n },\n ls:\n (ctx: NetscriptContext) =>\n (_hostname: unknown, _grep: unknown = \"\"): string[] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const grep = helpers.string(ctx, \"grep\", _grep);\n\n const server = helpers.getServer(ctx, hostname);\n\n // Get the grep filter, if one exists\n let filter = \"\";\n if (_grep !== undefined) {\n filter = grep.toString();\n }\n\n const allFiles = [];\n for (let i = 0; i < server.programs.length; i++) {\n if (filter) {\n if (server.programs[i].includes(filter)) {\n allFiles.push(server.programs[i]);\n }\n } else {\n allFiles.push(server.programs[i]);\n }\n }\n for (let i = 0; i < server.scripts.length; i++) {\n if (filter) {\n if (server.scripts[i].filename.includes(filter)) {\n allFiles.push(server.scripts[i].filename);\n }\n } else {\n allFiles.push(server.scripts[i].filename);\n }\n }\n for (let i = 0; i < server.messages.length; i++) {\n if (filter) {\n const msg = server.messages[i];\n if (msg.includes(filter)) {\n allFiles.push(msg);\n }\n } else {\n allFiles.push(server.messages[i]);\n }\n }\n\n for (let i = 0; i < server.textFiles.length; i++) {\n if (filter) {\n if (server.textFiles[i].fn.includes(filter)) {\n allFiles.push(server.textFiles[i].fn);\n }\n } else {\n allFiles.push(server.textFiles[i].fn);\n }\n }\n\n for (let i = 0; i < server.contracts.length; ++i) {\n if (filter) {\n if (server.contracts[i].fn.includes(filter)) {\n allFiles.push(server.contracts[i].fn);\n }\n } else {\n allFiles.push(server.contracts[i].fn);\n }\n }\n\n // Sort the files alphabetically then print each\n allFiles.sort();\n return allFiles;\n },\n getRecentScripts: () => (): IRecentScript[] => {\n return recentScripts.map((rs) => ({\n timeOfDeath: rs.timeOfDeath,\n ...helpers.createPublicRunningScript(rs.runningScript),\n }));\n },\n ps:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): ProcessInfo[] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const processes = [];\n for (const script of server.runningScripts) {\n processes.push({\n filename: script.filename,\n threads: script.threads,\n args: script.args.slice(),\n pid: script.pid,\n });\n }\n return processes;\n },\n hasRootAccess:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n\n const server = helpers.getServer(ctx, hostname);\n return server.hasAdminRights;\n },\n getHostname: (ctx: NetscriptContext) => (): string => {\n const scriptServer = GetServer(ctx.workerScript.hostname);\n if (scriptServer == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Could not find server. This is a bug. Report to dev.\");\n }\n return scriptServer.hostname;\n },\n getHackingLevel: (ctx: NetscriptContext) => (): number => {\n Player.updateSkillLevels();\n helpers.log(ctx, () => `returned ${Player.skills.hacking}`);\n return Player.skills.hacking;\n },\n getHackingMultipliers: () => (): HackingMultipliers => {\n return {\n chance: Player.mults.hacking_chance,\n speed: Player.mults.hacking_speed,\n money: Player.mults.hacking_money,\n growth: Player.mults.hacking_grow,\n };\n },\n getHacknetMultipliers: () => (): HacknetMultipliers => {\n return {\n production: Player.mults.hacknet_node_money,\n purchaseCost: Player.mults.hacknet_node_purchase_cost,\n ramCost: Player.mults.hacknet_node_ram_cost,\n coreCost: Player.mults.hacknet_node_core_cost,\n levelCost: Player.mults.hacknet_node_level_cost,\n };\n },\n getBitNodeMultipliers: (ctx: NetscriptContext) => (): IBNMults => {\n if (Player.sourceFileLvl(5) <= 0 && Player.bitNodeN !== 5) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Requires Source-File 5 to run.\");\n }\n const copy = Object.assign({}, BitNodeMultipliers);\n return copy;\n },\n getServer:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): IServerDef => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n const copy = Object.assign({}, server) as Server;\n // These fields should be hidden.\n copy.contracts = [];\n copy.messages = [];\n copy.runningScripts = [];\n copy.scripts = [];\n copy.textFiles = [];\n copy.programs = [];\n copy.serversOnNetwork = [];\n if (!copy.baseDifficulty) copy.baseDifficulty = 0;\n if (!copy.hackDifficulty) copy.hackDifficulty = 0;\n if (!copy.minDifficulty) copy.minDifficulty = 0;\n if (!copy.moneyAvailable) copy.moneyAvailable = 0;\n if (!copy.moneyMax) copy.moneyMax = 0;\n if (!copy.numOpenPortsRequired) copy.numOpenPortsRequired = 0;\n if (!copy.openPortCount) copy.openPortCount = 0;\n if (!copy.requiredHackingSkill) copy.requiredHackingSkill = 0;\n if (!copy.serverGrowth) copy.serverGrowth = 0;\n return copy;\n },\n getServerMoneyAvailable:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerMoneyAvailable\")) {\n return 0;\n }\n if (server.hostname == \"home\") {\n // Return player's money\n helpers.log(ctx, () => `returned player's money: ${numeralWrapper.formatMoney(Player.money)}`);\n return Player.money;\n }\n helpers.log(ctx, () => `returned ${numeralWrapper.formatMoney(server.moneyAvailable)} for '${server.hostname}'`);\n return server.moneyAvailable;\n },\n getServerSecurityLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerSecurityLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.hackDifficulty)} for '${server.hostname}'`,\n );\n return server.hackDifficulty;\n },\n getServerBaseSecurityLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n helpers.log(ctx, () => `getServerBaseSecurityLevel is deprecated because it's not useful.`);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerBaseSecurityLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.baseDifficulty)} for '${server.hostname}'`,\n );\n return server.baseDifficulty;\n },\n getServerMinSecurityLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerMinSecurityLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatServerSecurity(server.minDifficulty)} for ${server.hostname}`,\n );\n return server.minDifficulty;\n },\n getServerRequiredHackingLevel:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerRequiredHackingLevel\")) {\n return 1;\n }\n helpers.log(\n ctx,\n () => `returned ${numeralWrapper.formatSkill(server.requiredHackingSkill)} for '${server.hostname}'`,\n );\n return server.requiredHackingSkill;\n },\n getServerMaxMoney:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 0;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerMaxMoney\")) {\n return 0;\n }\n helpers.log(ctx, () => `returned ${numeralWrapper.formatMoney(server.moneyMax)} for '${server.hostname}'`);\n return server.moneyMax;\n },\n getServerGrowth:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 1;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerGrowth\")) {\n return 1;\n }\n helpers.log(ctx, () => `returned ${server.serverGrowth} for '${server.hostname}'`);\n return server.serverGrowth;\n },\n getServerNumPortsRequired:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"Cannot be executed on this server.\");\n return 5;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getServerNumPortsRequired\")) {\n return 5;\n }\n helpers.log(ctx, () => `returned ${server.numOpenPortsRequired} for '${server.hostname}'`);\n return server.numOpenPortsRequired;\n },\n getServerRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): [number, number] => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n helpers.log(ctx, () => `getServerRam is deprecated in favor of getServerMaxRam / getServerUsedRam`);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(\n ctx,\n () => `returned [${numeralWrapper.formatRAM(server.maxRam)}, ${numeralWrapper.formatRAM(server.ramUsed)}]`,\n );\n return [server.maxRam, server.ramUsed];\n },\n getServerMaxRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(ctx, () => `returned ${numeralWrapper.formatRAM(server.maxRam)}`);\n return server.maxRam;\n },\n getServerUsedRam:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n helpers.log(ctx, () => `returned ${numeralWrapper.formatRAM(server.ramUsed)}`);\n return server.ramUsed;\n },\n serverExists:\n (ctx: NetscriptContext) =>\n (_hostname: unknown): boolean => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n return GetServer(hostname) !== null;\n },\n fileExists:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): boolean => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (filename === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Usage: fileExists(scriptname, [server])\");\n }\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.scripts.length; ++i) {\n if (filename == server.scripts[i].filename) {\n return true;\n }\n }\n for (let i = 0; i < server.programs.length; ++i) {\n if (filename.toLowerCase() == server.programs[i].toLowerCase()) {\n return true;\n }\n }\n for (let i = 0; i < server.messages.length; ++i) {\n if (filename.toLowerCase() === server.messages[i].toLowerCase()) {\n return true;\n }\n }\n const txtFile = getTextFile(filename, server);\n return txtFile != null;\n },\n isRunning:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...scriptArgs: unknown[]): boolean => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, scriptArgs);\n return helpers.getRunningScript(ctx, ident) !== null;\n },\n getPurchasedServerLimit: () => (): number => {\n return getPurchaseServerLimit();\n },\n getPurchasedServerMaxRam: () => (): number => {\n return getPurchaseServerMaxRam();\n },\n getPurchasedServerCost:\n (ctx: NetscriptContext) =>\n (_ram: unknown): number => {\n const ram = helpers.number(ctx, \"ram\", _ram);\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}'`);\n return Infinity;\n }\n\n return cost;\n },\n purchaseServer:\n (ctx: NetscriptContext) =>\n (_name: unknown, _ram: unknown): string => {\n const name = helpers.string(ctx, \"name\", _name);\n const ram = helpers.number(ctx, \"ram\", _ram);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s+/g, \"\");\n if (hostnameStr == \"\") {\n helpers.log(ctx, () => `Invalid argument: hostname='${hostnameStr}'`);\n return \"\";\n }\n\n if (Player.purchasedServers.length >= getPurchaseServerLimit()) {\n helpers.log(\n ctx,\n () =>\n `You have reached the maximum limit of ${getPurchaseServerLimit()} servers. You cannot purchase any more.`,\n );\n return \"\";\n }\n\n const cost = getPurchaseServerCost(ram);\n if (cost === Infinity) {\n if (ram > getPurchaseServerMaxRam()) {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}' must not be greater than getPurchaseServerMaxRam`);\n } else {\n helpers.log(ctx, () => `Invalid argument: ram='${ram}' must be a positive power of 2`);\n }\n\n return \"\";\n }\n\n if (Player.money < cost) {\n helpers.log(ctx, () => `Not enough money to purchase server. Need ${numeralWrapper.formatMoney(cost)}`);\n return \"\";\n }\n const newServ = safetlyCreateUniqueServer({\n ip: createUniqueRandomIp(),\n hostname: hostnameStr,\n organizationName: \"\",\n isConnectedTo: false,\n adminRights: true,\n purchasedByPlayer: true,\n maxRam: ram,\n });\n AddToAllServers(newServ);\n\n Player.purchasedServers.push(newServ.hostname);\n const homeComputer = Player.getHomeComputer();\n homeComputer.serversOnNetwork.push(newServ.hostname);\n newServ.serversOnNetwork.push(homeComputer.hostname);\n Player.loseMoney(cost, \"servers\");\n helpers.log(\n ctx,\n () => `Purchased new server with hostname '${newServ.hostname}' for ${numeralWrapper.formatMoney(cost)}`,\n );\n return newServ.hostname;\n },\n deleteServer:\n (ctx: NetscriptContext) =>\n (_name: unknown): boolean => {\n const name = helpers.string(ctx, \"name\", _name);\n let hostnameStr = String(name);\n hostnameStr = hostnameStr.replace(/\\s\\s+/g, \"\");\n const server = GetServer(hostnameStr);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => `Invalid argument: hostname='${hostnameStr}'`);\n return false;\n }\n\n if (!server.purchasedByPlayer || server.hostname === \"home\") {\n helpers.log(ctx, () => \"Cannot delete non-purchased server.\");\n return false;\n }\n\n const hostname = server.hostname;\n\n // Can't delete server you're currently connected to\n if (server.isConnectedTo) {\n helpers.log(ctx, () => \"You are currently connected to the server you are trying to delete.\");\n return false;\n }\n\n // A server cannot delete itself\n if (hostname === ctx.workerScript.hostname) {\n helpers.log(ctx, () => \"Cannot delete the server this script is running on.\");\n return false;\n }\n\n // Delete all scripts running on server\n if (server.runningScripts.length > 0) {\n helpers.log(ctx, () => `Cannot delete server '${hostname}' because it still has scripts running.`);\n return false;\n }\n\n // Delete from player's purchasedServers array\n let found = false;\n for (let i = 0; i < Player.purchasedServers.length; ++i) {\n if (hostname == Player.purchasedServers[i]) {\n found = true;\n Player.purchasedServers.splice(i, 1);\n break;\n }\n }\n\n if (!found) {\n helpers.log(\n ctx,\n () => `Could not identify server ${hostname} as a purchased server. This is a bug. Report to dev.`,\n );\n return false;\n }\n\n // Delete from all servers\n DeleteServer(hostname);\n\n // Delete from home computer\n found = false;\n const homeComputer = Player.getHomeComputer();\n for (let i = 0; i < homeComputer.serversOnNetwork.length; ++i) {\n if (hostname == homeComputer.serversOnNetwork[i]) {\n homeComputer.serversOnNetwork.splice(i, 1);\n helpers.log(ctx, () => `Deleted server '${hostnameStr}`);\n return true;\n }\n }\n // Wasn't found on home computer\n helpers.log(ctx, () => `Could not find server ${hostname} as a purchased server. This is a bug. Report to dev.`);\n return false;\n },\n getPurchasedServers: () => (): string[] => {\n const res: string[] = [];\n Player.purchasedServers.forEach(function (hostname) {\n res.push(hostname);\n });\n return res;\n },\n writePort:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: unknown = \"\"): Promise => {\n const port = helpers.number(ctx, \"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\n const iport = helpers.getValidPort(ctx, port);\n return Promise.resolve(iport.write(data));\n },\n write:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _data: unknown = \"\", _mode: unknown = \"a\"): void => {\n let fn = helpers.string(ctx, \"handle\", _filename);\n const data = helpers.string(ctx, \"data\", _data);\n const mode = helpers.string(ctx, \"mode\", _mode);\n if (!isValidFilePath(fn)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filepath: ${fn}`);\n\n if (fn.lastIndexOf(\"/\") === 0) fn = removeLeadingSlash(fn);\n\n const server = helpers.getServer(ctx, ctx.workerScript.hostname);\n\n if (isScriptFilename(fn)) {\n // Write to script\n let script = ctx.workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n // Create a new script\n script = new Script(Player, fn, String(data), server.hostname, server.scripts);\n server.scripts.push(script);\n return script.updateRamUsage(Player, server.scripts);\n }\n mode === \"w\" ? (script.code = String(data)) : (script.code += data);\n return script.updateRamUsage(Player, server.scripts);\n } else {\n // Write to text file\n if (!fn.endsWith(\".txt\")) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: ${fn}`);\n const txtFile = getTextFile(fn, server);\n if (txtFile == null) {\n createTextFile(fn, String(data), server);\n return;\n }\n if (mode === \"w\") {\n txtFile.write(String(data));\n } else {\n txtFile.append(String(data));\n }\n }\n return;\n },\n tryWritePort:\n (ctx: NetscriptContext) =>\n (_port: unknown, data: unknown = \"\"): Promise => {\n let port = helpers.number(ctx, \"port\", _port);\n if (typeof data !== \"string\" && typeof data !== \"number\") {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Trying to write invalid data to a port: only strings and numbers are valid.`,\n );\n }\n if (!isNaN(port)) {\n port = Math.round(port);\n if (port < 1 || port > CONSTANTS.NumNetscriptPorts) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid port: ${port}. Only ports 1-${CONSTANTS.NumNetscriptPorts} are valid.`,\n );\n }\n const iport = NetscriptPorts[port - 1];\n if (iport == null || !(iport instanceof Object)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Could not find port: ${port}. This is a bug. Report to dev.`);\n }\n return Promise.resolve(iport.tryWrite(data));\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${port}`);\n }\n },\n readPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): unknown => {\n const port = helpers.number(ctx, \"port\", _port);\n // Read from port\n const iport = helpers.getValidPort(ctx, port);\n const x = iport.read();\n return x;\n },\n read:\n (ctx: NetscriptContext) =>\n (_filename: unknown): string => {\n const fn = helpers.string(ctx, \"filename\", _filename);\n const server = GetServer(ctx.workerScript.hostname);\n if (server == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Error getting Server. This is a bug. Report to dev.\");\n }\n if (isScriptFilename(fn)) {\n // Read from script\n const script = ctx.workerScript.getScriptOnServer(fn, server);\n if (script == null) {\n return \"\";\n }\n return script.code;\n } else {\n // Read from text file\n const txtFile = getTextFile(fn, server);\n if (txtFile !== null) {\n return txtFile.text;\n } else {\n return \"\";\n }\n }\n },\n peek:\n (ctx: NetscriptContext) =>\n (_port: unknown): unknown => {\n const port = helpers.number(ctx, \"port\", _port);\n const iport = helpers.getValidPort(ctx, port);\n const x = iport.peek();\n return x;\n },\n clear:\n (ctx: NetscriptContext) =>\n (_file: unknown): void => {\n const file = helpers.string(ctx, \"file\", _file);\n if (isString(file)) {\n // Clear text file\n const fn = file;\n const server = GetServer(ctx.workerScript.hostname);\n if (server == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Error getting Server. This is a bug. Report to dev.\");\n }\n const txtFile = getTextFile(fn, server);\n if (txtFile != null) {\n txtFile.write(\"\");\n }\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid argument: ${file}`);\n }\n },\n clearPort:\n (ctx: NetscriptContext) =>\n (_port: unknown): void => {\n const port = helpers.number(ctx, \"port\", _port);\n // Clear port\n const iport = helpers.getValidPort(ctx, port);\n iport.clear();\n },\n getPortHandle:\n (ctx: NetscriptContext) =>\n (_port: unknown): IPort => {\n const port = helpers.number(ctx, \"port\", _port);\n const iport = helpers.getValidPort(ctx, port);\n return iport;\n },\n rm:\n (ctx: NetscriptContext) =>\n (_fn: unknown, _hostname: unknown = ctx.workerScript.hostname): boolean => {\n const fn = helpers.string(ctx, \"fn\", _fn);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const s = helpers.getServer(ctx, hostname);\n\n const status = s.removeFile(fn);\n if (!status.res) {\n helpers.log(ctx, () => status.msg + \"\");\n }\n\n return status.res;\n },\n scriptRunning:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown): boolean => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.runningScripts.length; ++i) {\n if (server.runningScripts[i].filename == scriptname) {\n return true;\n }\n }\n return false;\n },\n scriptKill:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown): boolean => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n let suc = false;\n for (let i = 0; i < server.runningScripts.length; i++) {\n if (server.runningScripts[i].filename == scriptname) {\n killWorkerScript({ runningScript: server.runningScripts[i], hostname: server.hostname });\n suc = true;\n i--;\n }\n }\n return suc;\n },\n getScriptName: (ctx: NetscriptContext) => (): string => {\n return ctx.workerScript.name;\n },\n getScriptRam:\n (ctx: NetscriptContext) =>\n (_scriptname: unknown, _hostname: unknown = ctx.workerScript.hostname): number => {\n const scriptname = helpers.string(ctx, \"scriptname\", _scriptname);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename == scriptname) {\n return server.scripts[i].ramUsage;\n }\n }\n return 0;\n },\n getRunningScript:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...args: unknown[]): IRunningScriptDef | null => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript === null) return null;\n return helpers.createPublicRunningScript(runningScript);\n },\n getHackTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getHackTime\")) {\n return Infinity;\n }\n\n return calculateHackingTime(server, Player) * 1000;\n },\n getGrowTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getGrowTime\")) {\n return Infinity;\n }\n\n return calculateGrowTime(server, Player) * 1000;\n },\n getWeakenTime:\n (ctx: NetscriptContext) =>\n (_hostname: unknown = ctx.workerScript.hostname): number => {\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const server = helpers.getServer(ctx, hostname);\n if (!(server instanceof Server)) {\n helpers.log(ctx, () => \"invalid for this kind of server\");\n return Infinity;\n }\n if (helpers.failOnHacknetServer(ctx, server, \"getWeakenTime\")) {\n return Infinity;\n }\n\n return calculateWeakenTime(server, Player) * 1000;\n },\n getTotalScriptIncome: () => (): [number, number] => {\n // First element is total income of all currently running scripts\n let total = 0;\n for (const script of workerScripts.values()) {\n total += script.scriptRef.onlineMoneyMade / script.scriptRef.onlineRunningTime;\n }\n\n return [total, Player.scriptProdSinceLastAug / (Player.playtimeSinceLastAug / 1000)];\n },\n getScriptIncome:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...args: unknown[]): number => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return -1;\n }\n return runningScript.onlineMoneyMade / runningScript.onlineRunningTime;\n },\n getTotalScriptExpGain: () => (): number => {\n let total = 0;\n for (const ws of workerScripts.values()) {\n total += ws.scriptRef.onlineExpGained / ws.scriptRef.onlineRunningTime;\n }\n return total;\n },\n getScriptExpGain:\n (ctx: NetscriptContext) =>\n (fn: unknown, hostname: unknown, ...args: unknown[]): number => {\n const ident = helpers.scriptIdentifier(ctx, fn, hostname, args);\n const runningScript = helpers.getRunningScript(ctx, ident);\n if (runningScript == null) {\n helpers.log(ctx, () => helpers.getCannotFindRunningScriptErrorMessage(ident));\n return -1;\n }\n return runningScript.onlineExpGained / runningScript.onlineRunningTime;\n },\n nFormat:\n (ctx: NetscriptContext) =>\n (_n: unknown, _format: unknown): string => {\n const n = helpers.number(ctx, \"n\", _n);\n const format = helpers.string(ctx, \"format\", _format);\n if (isNaN(n)) {\n return \"\";\n }\n\n return numeralWrapper.format(n, format);\n },\n tFormat:\n (ctx: NetscriptContext) =>\n (_milliseconds: unknown, _milliPrecision: unknown = false): string => {\n const milliseconds = helpers.number(ctx, \"milliseconds\", _milliseconds);\n const milliPrecision = !!_milliPrecision;\n return convertTimeMsToTimeElapsedString(milliseconds, milliPrecision);\n },\n getTimeSinceLastAug: () => (): number => {\n return Player.playtimeSinceLastAug;\n },\n alert:\n (ctx: NetscriptContext) =>\n (_message: unknown): void => {\n const message = helpers.string(ctx, \"message\", _message);\n dialogBoxCreate(message);\n },\n toast:\n (ctx: NetscriptContext) =>\n (_message: unknown, _variant: unknown = ToastVariant.SUCCESS, _duration: unknown = 2000): void => {\n const message = helpers.string(ctx, \"message\", _message);\n const variant = helpers.string(ctx, \"variant\", _variant);\n const duration = _duration === null ? null : helpers.number(ctx, \"duration\", _duration);\n if (!checkEnum(ToastVariant, variant))\n throw new Error(`variant must be one of ${Object.values(ToastVariant).join(\", \")}`);\n SnackbarEvents.emit(message, variant, duration);\n },\n prompt:\n (ctx: NetscriptContext) =>\n (_txt: unknown, options?: { type?: string; options?: string[] }): Promise => {\n const txt = helpers.string(ctx, \"txt\", _txt);\n\n return new Promise(function (resolve) {\n PromptEvent.emit({\n txt: txt,\n options,\n resolve: resolve,\n });\n });\n },\n wget:\n (ctx: NetscriptContext) =>\n async (_url: unknown, _target: unknown, _hostname: unknown = ctx.workerScript.hostname): Promise => {\n const url = helpers.string(ctx, \"url\", _url);\n const target = helpers.string(ctx, \"target\", _target);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n if (!isScriptFilename(target) && !target.endsWith(\".txt\")) {\n helpers.log(ctx, () => `Invalid target file: '${target}'. Must be a script or text file.`);\n return Promise.resolve(false);\n }\n const s = helpers.getServer(ctx, hostname);\n return new Promise(function (resolve) {\n $.get(\n url,\n function (data) {\n let res;\n if (isScriptFilename(target)) {\n res = s.writeToScriptFile(Player, target, data);\n } else {\n res = s.writeToTextFile(target, data);\n }\n if (!res.success) {\n helpers.log(ctx, () => \"Failed.\");\n return resolve(false);\n }\n if (res.overwritten) {\n helpers.log(ctx, () => `Successfully retrieved content and overwrote '${target}' on '${hostname}'`);\n return resolve(true);\n }\n helpers.log(ctx, () => `Successfully retrieved content to new file '${target}' on '${hostname}'`);\n return resolve(true);\n },\n \"text\",\n ).fail(function (e) {\n helpers.log(ctx, () => JSON.stringify(e));\n return resolve(false);\n });\n });\n },\n getFavorToDonate: () => (): number => {\n return Math.floor(CONSTANTS.BaseFavorToDonate * BitNodeMultipliers.RepToDonateToFaction);\n },\n getPlayer: () => (): INetscriptPlayer => {\n const data = {\n hp: JSON.parse(JSON.stringify(Player.hp)),\n skills: JSON.parse(JSON.stringify(Player.skills)),\n exp: JSON.parse(JSON.stringify(Player.exp)),\n mults: JSON.parse(JSON.stringify(Player.mults)),\n numPeopleKilled: Player.numPeopleKilled,\n money: Player.money,\n city: Player.city,\n location: Player.location,\n bitNodeN: Player.bitNodeN,\n totalPlaytime: Player.totalPlaytime,\n playtimeSinceLastAug: Player.playtimeSinceLastAug,\n playtimeSinceLastBitnode: Player.playtimeSinceLastBitnode,\n jobs: {},\n factions: Player.factions.slice(),\n tor: Player.hasTorRouter(),\n inBladeburner: Player.inBladeburner(),\n hasCorporation: Player.hasCorporation(),\n entropy: Player.entropy,\n };\n Object.assign(data.jobs, Player.jobs);\n return data;\n },\n atExit:\n (ctx: NetscriptContext) =>\n (f: unknown): void => {\n if (typeof f !== \"function\") {\n throw helpers.makeRuntimeErrorMsg(ctx, \"argument should be function\");\n }\n ctx.workerScript.atExit = () => {\n f();\n }; // Wrap the user function to prevent WorkerScript leaking as 'this'\n },\n mv:\n (ctx: NetscriptContext) =>\n (_host: unknown, _source: unknown, _destination: unknown): void => {\n const host = helpers.string(ctx, \"host\", _host);\n const source = helpers.string(ctx, \"source\", _source);\n const destination = helpers.string(ctx, \"destination\", _destination);\n\n if (!isValidFilePath(source)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${source}'`);\n if (!isValidFilePath(destination)) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid filename: '${destination}'`);\n\n const source_is_txt = source.endsWith(\".txt\");\n const dest_is_txt = destination.endsWith(\".txt\");\n\n if (!isScriptFilename(source) && !source_is_txt)\n throw helpers.makeRuntimeErrorMsg(ctx, `'mv' can only be used on scripts and text files (.txt)`);\n if (source_is_txt != dest_is_txt)\n throw helpers.makeRuntimeErrorMsg(ctx, `Source and destination files must have the same type`);\n\n if (source === destination) {\n return;\n }\n\n const destServer = helpers.getServer(ctx, host);\n\n if (!source_is_txt && destServer.isRunning(source))\n throw helpers.makeRuntimeErrorMsg(ctx, `Cannot use 'mv' on a script that is running`);\n\n interface File {\n filename: string;\n }\n\n const files = source_is_txt ? destServer.textFiles : destServer.scripts;\n let source_file: File | null = null;\n let dest_file: File | null = null;\n\n for (let i = 0; i < files.length; ++i) {\n const file = files[i];\n if (file.filename === source) {\n source_file = file;\n } else if (file.filename === destination) {\n dest_file = file;\n }\n }\n\n if (source_file == null) throw helpers.makeRuntimeErrorMsg(ctx, `Source file ${source} does not exist`);\n\n if (dest_file != null) {\n if (dest_file instanceof TextFile && source_file instanceof TextFile) {\n dest_file.text = source_file.text;\n } else if (dest_file instanceof Script && source_file instanceof Script) {\n dest_file.code = source_file.code;\n dest_file.markUpdated();\n }\n\n destServer.removeFile(source);\n } else {\n source_file.filename = destination;\n if (source_file instanceof Script) {\n source_file.markUpdated();\n }\n }\n },\n flags: Flags,\n};\n\n// add undocumented functions\nconst ns = {\n ...base,\n ...NetscriptExtra(),\n};\n\nconst possibleLogs = Object.fromEntries([...helpers.getFunctionNames(ns, \"\")].map((a) => [a, true]));\n","import { CONSTANTS } from \"../../Constants\";\nimport { Server } from \"../Server\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nexport function calculateServerGrowth(server: Server, threads: number, p: IPlayer, cores = 1): number {\n const numServerGrowthCycles = Math.max(Math.floor(threads), 0);\n\n //Get adjusted growth rate, which accounts for server security\n const growthRate = CONSTANTS.ServerBaseGrowthRate;\n let adjGrowthRate = 1 + (growthRate - 1) / server.hackDifficulty;\n if (adjGrowthRate > CONSTANTS.ServerMaxGrowthRate) {\n adjGrowthRate = CONSTANTS.ServerMaxGrowthRate;\n }\n\n //Calculate adjusted server growth rate based on parameters\n const serverGrowthPercentage = server.serverGrowth / 100;\n const numServerGrowthCyclesAdjusted =\n numServerGrowthCycles * serverGrowthPercentage * BitNodeMultipliers.ServerGrowthRate;\n\n //Apply serverGrowth for the calculated number of growth cycles\n const coreBonus = 1 + (cores - 1) / 16;\n return Math.pow(adjGrowthRate, numServerGrowthCyclesAdjusted * p.mults.hacking_grow * coreBonus);\n}\n","import { GangMemberTask } from \"./GangMemberTask\";\nimport { GangMemberTasks } from \"./GangMemberTasks\";\nimport { GangMemberUpgrade } from \"./GangMemberUpgrade\";\nimport { GangMemberUpgrades } from \"./GangMemberUpgrades\";\nimport { IAscensionResult } from \"./IAscensionResult\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IGang } from \"./IGang\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport {\n calculateRespectGain,\n calculateMoneyGain,\n calculateWantedLevelGain,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"./formulas/formulas\";\n\ninterface IMults {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n}\n\nexport class GangMember {\n name: string;\n task = \"Unassigned\";\n\n earnedRespect = 0;\n\n hack = 1;\n str = 1;\n def = 1;\n dex = 1;\n agi = 1;\n cha = 1;\n\n hack_exp = 0;\n str_exp = 0;\n def_exp = 0;\n dex_exp = 0;\n agi_exp = 0;\n cha_exp = 0;\n\n hack_mult = 1;\n str_mult = 1;\n def_mult = 1;\n dex_mult = 1;\n agi_mult = 1;\n cha_mult = 1;\n\n hack_asc_points = 0;\n str_asc_points = 0;\n def_asc_points = 0;\n dex_asc_points = 0;\n agi_asc_points = 0;\n cha_asc_points = 0;\n\n upgrades: string[] = []; // Names of upgrades\n augmentations: string[] = []; // Names of augmentations only\n\n constructor(name = \"\") {\n this.name = name;\n }\n\n calculateSkill(exp: number, mult = 1): number {\n return Math.max(Math.floor(mult * (32 * Math.log(exp + 534.5) - 200)), 1);\n }\n\n calculateAscensionMult(points: number): number {\n return calculateAscensionMult(points);\n }\n\n updateSkillLevels(): void {\n this.hack = this.calculateSkill(this.hack_exp, this.hack_mult * this.calculateAscensionMult(this.hack_asc_points));\n this.str = this.calculateSkill(this.str_exp, this.str_mult * this.calculateAscensionMult(this.str_asc_points));\n this.def = this.calculateSkill(this.def_exp, this.def_mult * this.calculateAscensionMult(this.def_asc_points));\n this.dex = this.calculateSkill(this.dex_exp, this.dex_mult * this.calculateAscensionMult(this.dex_asc_points));\n this.agi = this.calculateSkill(this.agi_exp, this.agi_mult * this.calculateAscensionMult(this.agi_asc_points));\n this.cha = this.calculateSkill(this.cha_exp, this.cha_mult * this.calculateAscensionMult(this.cha_asc_points));\n }\n\n calculatePower(): number {\n return (this.hack + this.str + this.def + this.dex + this.agi + this.cha) / 95;\n }\n\n assignToTask(taskName: string): boolean {\n if (!GangMemberTasks.hasOwnProperty(taskName)) {\n this.task = \"Unassigned\";\n return false;\n }\n this.task = taskName;\n return true;\n }\n\n unassignFromTask(): void {\n this.task = \"Unassigned\";\n }\n\n getTask(): GangMemberTask {\n // TODO(hydroflame): transfer that to a save file migration function\n // Backwards compatibility\n if ((this.task as any) instanceof GangMemberTask) {\n this.task = (this.task as any).name;\n }\n\n if (GangMemberTasks.hasOwnProperty(this.task)) {\n return GangMemberTasks[this.task];\n }\n return GangMemberTasks[\"Unassigned\"];\n }\n\n calculateRespectGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateRespectGain(g, this, task);\n }\n\n calculateWantedLevelGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateWantedLevelGain(g, this, task);\n }\n\n calculateMoneyGain(gang: IGang): number {\n const task = this.getTask();\n const g = {\n respect: gang.respect,\n wantedLevel: gang.wanted,\n territory: gang.getTerritory(),\n };\n return calculateMoneyGain(g, this, task);\n }\n\n expMult(): IMults {\n return {\n hack: (this.hack_mult - 1) / 4 + 1,\n str: (this.str_mult - 1) / 4 + 1,\n def: (this.def_mult - 1) / 4 + 1,\n dex: (this.dex_mult - 1) / 4 + 1,\n agi: (this.agi_mult - 1) / 4 + 1,\n cha: (this.cha_mult - 1) / 4 + 1,\n };\n }\n\n gainExperience(numCycles = 1): void {\n const task = this.getTask();\n if (task === GangMemberTasks[\"Unassigned\"]) return;\n const difficultyMult = Math.pow(task.difficulty, 0.9);\n const difficultyPerCycles = difficultyMult * numCycles;\n const weightDivisor = 1500;\n const expMult = this.expMult();\n this.hack_exp +=\n (task.hackWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.hack *\n this.calculateAscensionMult(this.hack_asc_points);\n this.str_exp +=\n (task.strWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.str *\n this.calculateAscensionMult(this.str_asc_points);\n this.def_exp +=\n (task.defWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.def *\n this.calculateAscensionMult(this.def_asc_points);\n this.dex_exp +=\n (task.dexWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.dex *\n this.calculateAscensionMult(this.dex_asc_points);\n this.agi_exp +=\n (task.agiWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.agi *\n this.calculateAscensionMult(this.agi_asc_points);\n this.cha_exp +=\n (task.chaWeight / weightDivisor) *\n difficultyPerCycles *\n expMult.cha *\n this.calculateAscensionMult(this.cha_asc_points);\n }\n\n recordEarnedRespect(numCycles = 1, gang: IGang): void {\n this.earnedRespect += this.calculateRespectGain(gang) * numCycles;\n }\n\n getGainedAscensionPoints(): IMults {\n return {\n hack: calculateAscensionPointsGain(this.hack_exp),\n str: calculateAscensionPointsGain(this.str_exp),\n def: calculateAscensionPointsGain(this.def_exp),\n dex: calculateAscensionPointsGain(this.dex_exp),\n agi: calculateAscensionPointsGain(this.agi_exp),\n cha: calculateAscensionPointsGain(this.cha_exp),\n };\n }\n\n canAscend(): boolean {\n const points = this.getGainedAscensionPoints();\n return points.hack > 0 || points.str > 0 || points.def > 0 || points.dex > 0 || points.agi > 0 || points.cha > 0;\n }\n\n getCurrentAscensionMults(): IMults {\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points),\n str: this.calculateAscensionMult(this.str_asc_points),\n def: this.calculateAscensionMult(this.def_asc_points),\n dex: this.calculateAscensionMult(this.dex_asc_points),\n agi: this.calculateAscensionMult(this.agi_asc_points),\n cha: this.calculateAscensionMult(this.cha_asc_points),\n };\n }\n\n getAscensionMultsAfterAscend(): IMults {\n const points = this.getGainedAscensionPoints();\n return {\n hack: this.calculateAscensionMult(this.hack_asc_points + points.hack),\n str: this.calculateAscensionMult(this.str_asc_points + points.str),\n def: this.calculateAscensionMult(this.def_asc_points + points.def),\n dex: this.calculateAscensionMult(this.dex_asc_points + points.dex),\n agi: this.calculateAscensionMult(this.agi_asc_points + points.agi),\n cha: this.calculateAscensionMult(this.cha_asc_points + points.cha),\n };\n }\n\n getAscensionResults(): IMults {\n const postAscend = this.getAscensionMultsAfterAscend();\n const preAscend = this.getCurrentAscensionMults();\n\n return {\n hack: postAscend.hack / preAscend.hack,\n str: postAscend.str / preAscend.str,\n def: postAscend.def / preAscend.def,\n dex: postAscend.dex / preAscend.dex,\n agi: postAscend.agi / preAscend.agi,\n cha: postAscend.cha / preAscend.cha,\n };\n }\n\n ascend(): IAscensionResult {\n const res = this.getAscensionResults();\n const points = this.getGainedAscensionPoints();\n this.hack_asc_points += points.hack;\n this.str_asc_points += points.str;\n this.def_asc_points += points.def;\n this.dex_asc_points += points.dex;\n this.agi_asc_points += points.agi;\n this.cha_asc_points += points.cha;\n\n // Remove upgrades. Then re-calculate multipliers and stats\n this.upgrades.length = 0;\n this.hack_mult = 1;\n this.str_mult = 1;\n this.def_mult = 1;\n this.dex_mult = 1;\n this.agi_mult = 1;\n this.cha_mult = 1;\n for (let i = 0; i < this.augmentations.length; ++i) {\n const aug = GangMemberUpgrades[this.augmentations[i]];\n this.applyUpgrade(aug);\n }\n\n // Clear exp and recalculate stats\n this.hack_exp = 0;\n this.str_exp = 0;\n this.def_exp = 0;\n this.dex_exp = 0;\n this.agi_exp = 0;\n this.cha_exp = 0;\n this.updateSkillLevels();\n\n const respectToDeduct = this.earnedRespect;\n this.earnedRespect = 0;\n return {\n respect: respectToDeduct,\n hack: res.hack,\n str: res.str,\n def: res.def,\n dex: res.dex,\n agi: res.agi,\n cha: res.cha,\n };\n }\n\n applyUpgrade(upg: GangMemberUpgrade): void {\n if (upg.mults.str != null) this.str_mult *= upg.mults.str;\n if (upg.mults.def != null) this.def_mult *= upg.mults.def;\n if (upg.mults.dex != null) this.dex_mult *= upg.mults.dex;\n if (upg.mults.agi != null) this.agi_mult *= upg.mults.agi;\n if (upg.mults.cha != null) this.cha_mult *= upg.mults.cha;\n if (upg.mults.hack != null) this.hack_mult *= upg.mults.hack;\n }\n\n buyUpgrade(upg: GangMemberUpgrade, player: IPlayer, gang: IGang): boolean {\n // Prevent purchasing of already-owned upgrades\n if (this.augmentations.includes(upg.name) || this.upgrades.includes(upg.name)) return false;\n\n if (player.money < gang.getUpgradeCost(upg)) return false;\n player.loseMoney(gang.getUpgradeCost(upg), \"gang\");\n if (upg.type === \"g\") {\n this.augmentations.push(upg.name);\n } else {\n this.upgrades.push(upg.name);\n }\n this.applyUpgrade(upg);\n return true;\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"GangMember\", this);\n }\n\n /**\n * Initiatizes a GangMember object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): GangMember {\n return Generic_fromJSON(GangMember, value.data);\n }\n}\n\nReviver.constructors.GangMember = GangMember;\n","import { Interpreter } from \"../ThirdParty/JSInterpreter\";\n\nconst defaultInterpreter = new Interpreter(\"\", () => undefined);\n\ninterface PseudoObject {\n properties: Record;\n class: string;\n}\n\nconst isPseudoObject = (v: unknown): v is PseudoObject =>\n !!v &&\n typeof v === \"object\" &&\n v.hasOwnProperty(\"properties\") &&\n v.hasOwnProperty(\"getter\") &&\n v.hasOwnProperty(\"setter\") &&\n v.hasOwnProperty(\"proto\");\n\n// the acorn interpreter has a bug where it doesn't convert arrays correctly.\n// so we have to more or less copy it here.\nexport function toNative(pseudoObj: unknown): unknown {\n if (pseudoObj == null) return null;\n if (!isPseudoObject(pseudoObj)) {\n return pseudoObj; // it wasn't a pseudo object anyway.\n }\n\n if (pseudoObj.hasOwnProperty(\"class\") && pseudoObj.class === \"Array\") {\n const arr: unknown[] = [];\n const length = defaultInterpreter.getProperty(pseudoObj, \"length\");\n if (typeof length === \"number\") {\n for (let i = 0; i < length; i++) {\n if (defaultInterpreter.hasProperty(pseudoObj, i)) {\n arr[i] = toNative(defaultInterpreter.getProperty(pseudoObj, i));\n }\n }\n }\n return arr;\n } else {\n // Object.\n const obj: Record = {};\n for (const key of Object.keys(pseudoObj.properties)) {\n const val = pseudoObj.properties[key];\n obj[key] = toNative(val);\n }\n return obj;\n }\n}\n","import { Typography } from \"@mui/material\";\nimport React from \"react\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport { Theme } from \"@mui/material/styles\";\n\n// This particular eslint-disable is correct.\n// In this super specific weird case we in fact do want a regex on an ANSII character.\n// eslint-disable-next-line no-control-regex\nconst ANSI_ESCAPE = new RegExp(\"\\u{001b}\\\\[(?.*?)m\", \"ug\");\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n success: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.colors.success,\n },\n error: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.error.main,\n },\n primary: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.primary.main,\n },\n info: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.info.main,\n },\n warning: {\n whiteSpace: \"pre-wrap\",\n overflowWrap: \"anywhere\",\n margin: theme.spacing(0),\n color: theme.palette.warning.main,\n },\n }),\n);\n\nconst lineClass = (classes: Record, s: string): string => {\n const lineClassMap: Record = {\n error: classes.error,\n success: classes.success,\n info: classes.info,\n warn: classes.warning,\n };\n return lineClassMap[s] || classes.primary;\n};\n\ninterface IProps {\n text: unknown;\n color: \"primary\" | \"error\" | \"success\" | \"info\" | \"warn\";\n}\n\nexport const ANSIITypography = React.memo((props: IProps): React.ReactElement => {\n const text = String(props.text);\n const classes = useStyles();\n const parts = [];\n\n // Build a look-alike regex match to place at the front of the matches list\n const INITIAL = {\n 0: \"\",\n index: 0,\n groups: { code: null },\n };\n const matches = [INITIAL, ...text.matchAll(ANSI_ESCAPE), null];\n if (matches.length > 2) {\n matches.slice(0, -1).forEach((m, i) => {\n const n = matches[i + 1];\n if (!m || m.index === undefined || m.groups === undefined) {\n return;\n }\n const startIndex = m.index + m[0].length;\n const stopIndex = n ? n.index : text.length;\n const partText = text.slice(startIndex, stopIndex);\n if (startIndex !== stopIndex) {\n // Don't generate \"empty\" spans\n parts.push({ code: m.groups.code, text: partText });\n }\n });\n }\n if (parts.length === 0) {\n // For example, if the string was empty or there were no escape sequence matches\n parts.push({ code: null, text: text });\n }\n return (\n \n {parts.map((part, i) => (\n \n {part.text}\n \n ))}\n \n );\n});\n\nfunction ansiCodeStyle(code: string | null): Record {\n // The ANSI colors actually have the dark color set as default and require extra work to get\n // bright colors. But these are rarely used or, if they are, are often re-mapped by the\n // terminal emulator to brighter colors. So for foreground colors we use the bright color set\n // and for background colors we use the dark color set. Of course, all colors are available\n // via the longer ESC[n8;5;c] sequence (n={3,4}, c=color). Ideally, these 8-bit maps could\n // be managed in the user preferences/theme.\n const COLOR_MAP_BRIGHT: Record = {\n 0: \"#404040\",\n 1: \"#ff0000\",\n 2: \"#00ff00\",\n 3: \"#ffff00\",\n 4: \"#0000ff\",\n 5: \"#ff00ff\",\n 6: \"#00ffff\",\n 7: \"#ffffff\",\n };\n const COLOR_MAP_DARK: Record = {\n 8: \"#000000\",\n 9: \"#800000\",\n 10: \"#008000\",\n 11: \"#808000\",\n 12: \"#000080\",\n 13: \"#800080\",\n 14: \"#008080\",\n 15: \"#c0c0c0\",\n };\n\n const ansi2rgb = (code: number): string => {\n /* eslint-disable yoda */\n if (0 <= code && code < 8) {\n // x8 RGB\n return COLOR_MAP_BRIGHT[code];\n }\n if (8 <= code && code < 16) {\n // x8 RGB - \"High Intensity\" (but here, actually the dark set)\n return COLOR_MAP_DARK[code];\n }\n if (16 <= code && code < 232) {\n // x216 RGB\n const base = code - 16;\n const ir = Math.floor(base / 36);\n const ig = Math.floor((base % 36) / 6);\n const ib = Math.floor((base % 6) / 1);\n const r = ir <= 0 ? 0 : 55 + ir * 40;\n const g = ig <= 0 ? 0 : 55 + ig * 40;\n const b = ib <= 0 ? 0 : 55 + ib * 40;\n return `rgb(${r}, ${g}, ${b})`;\n }\n if (232 <= code && code < 256) {\n // x32 greyscale\n const base = code - 232;\n const grey = base * 10 + 8;\n return `rgb(${grey}, ${grey}, ${grey})`;\n }\n // shouldn't get here (under normal circumstances), but just in case\n return \"initial\";\n };\n\n type styleKey = \"fontWeight\" | \"textDecoration\" | \"color\" | \"backgroundColor\" | \"padding\";\n const style: {\n fontWeight?: string;\n textDecoration?: string;\n color?: string;\n backgroundColor?: string;\n padding?: string;\n } = {};\n\n if (code === null || code === \"0\") {\n return style;\n }\n\n const codeParts = code\n .split(\";\")\n .map((p) => parseInt(p))\n .filter(\n (p, i, arr) =>\n // If the sequence is 38;5 (x256 foreground color) or 48;5 (x256 background color),\n // filter out the 5 so the next codePart after {38,48} is the color code.\n p != 5 || i == 0 || (arr[i - 1] != 38 && arr[i - 1] != 48),\n );\n\n let nextStyleKey: styleKey | null = null;\n codeParts.forEach((codePart) => {\n /* eslint-disable yoda */\n if (nextStyleKey !== null) {\n style[nextStyleKey] = ansi2rgb(codePart);\n nextStyleKey = null;\n }\n // Decorations\n else if (codePart == 1) {\n style.fontWeight = \"bold\";\n } else if (codePart == 4) {\n style.textDecoration = \"underline\";\n }\n // Forground Color (x8)\n else if (30 <= codePart && codePart < 38) {\n if (COLOR_MAP_BRIGHT[codePart % 10]) {\n style.color = COLOR_MAP_BRIGHT[codePart % 10];\n }\n }\n // Background Color (x8)\n else if (40 <= codePart && codePart < 48) {\n if (COLOR_MAP_DARK[codePart % 10]) {\n style.backgroundColor = COLOR_MAP_DARK[codePart % 10];\n }\n }\n // Forground Color (x256)\n else if (codePart == 38) {\n nextStyleKey = \"color\";\n }\n // Background Color (x256)\n else if (codePart == 48) {\n nextStyleKey = \"backgroundColor\";\n }\n });\n // If a background color is set, add slight padding to increase the background fill area.\n // This was previously display:inline-block, but that has display errors when line breaks are used.\n if (style.backgroundColor) {\n style.padding = \"0px 1px\";\n }\n return style;\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { Sleeve } from \"./Sleeve\";\n\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\nimport { StaticAugmentations } from \"../../Augmentation/StaticAugmentations\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { Multipliers } from \"../Multipliers\";\n\nexport function findSleevePurchasableAugs(sleeve: Sleeve, p: IPlayer): Augmentation[] {\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n\n const ownedAugNames: string[] = sleeve.augmentations.map((e) => {\n return e.name;\n });\n const availableAugs: Augmentation[] = [];\n\n // Helper function that helps filter out augs that are already owned\n // and augs that aren't allowed for sleeves\n function isAvailableForSleeve(aug: Augmentation): boolean {\n if (ownedAugNames.includes(aug.name)) {\n return false;\n }\n if (availableAugs.includes(aug)) {\n return false;\n }\n if (aug.isSpecial) {\n return false;\n }\n\n type MultKey = keyof Multipliers;\n const validMults: MultKey[] = [\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"company_rep\",\n \"faction_rep\",\n \"crime_money\",\n \"crime_success\",\n \"work_money\",\n ];\n for (const mult of validMults) {\n if (aug.mults[mult] !== 1) {\n return true;\n }\n }\n\n return false;\n }\n\n // If player is in a gang, then we return all augs that the player\n // has enough reputation for (since that gang offers all augs)\n if (p.inGang()) {\n const fac = p.getGangFaction();\n\n for (const augName of Object.keys(StaticAugmentations)) {\n const aug = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.getCost(p).repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n for (const facName of p.factions) {\n if (facName === FactionNames.Bladeburners) {\n continue;\n }\n if (facName === FactionNames.Netburners) {\n continue;\n }\n const fac: Faction | null = Factions[facName];\n if (fac == null) {\n continue;\n }\n\n for (const augName of fac.augmentations) {\n const aug: Augmentation = StaticAugmentations[augName];\n if (!isAvailableForSleeve(aug)) {\n continue;\n }\n\n if (fac.playerReputation > aug.getCost(p).repCost) {\n availableAugs.push(aug);\n }\n }\n }\n\n return availableAugs;\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Crime } from \"src/Crime/Crime\";\nimport { newWorkStats, scaleWorkStats, WorkStats } from \"../WorkStats\";\n\nexport const calculateCrimeWorkStats = (crime: Crime): WorkStats => {\n const gains = scaleWorkStats(\n newWorkStats({\n money: crime.money,\n hackExp: crime.hacking_exp * 2,\n strExp: crime.strength_exp * 2,\n defExp: crime.defense_exp * 2,\n dexExp: crime.dexterity_exp * 2,\n agiExp: crime.agility_exp * 2,\n chaExp: crime.charisma_exp * 2,\n intExp: crime.intelligence_exp * 2,\n }),\n BitNodeMultipliers.CrimeExpGain,\n false,\n );\n gains.money *= BitNodeMultipliers.CrimeMoney;\n return gains;\n};\n","import React from \"react\";\nimport { newWorkStats, WorkStats } from \"../../Work/WorkStats\";\n\ninterface IGeneral {\n desc: JSX.Element;\n exp: WorkStats;\n}\n\nexport const GeneralActions: {\n [key: string]: IGeneral | undefined;\n} = {\n Training: {\n desc: (\n <>\n Improve your abilities at the Bladeburner unit's specialized training center. Doing this gives experience for\n all combat stats and also increases your max stamina.\n \n ),\n exp: newWorkStats({\n strExp: 30,\n defExp: 30,\n dexExp: 30,\n agiExp: 30,\n }),\n },\n\n \"Field Analysis\": {\n desc: (\n <>\n Mine and analyze Synthoid-related data. This improves the Bladeburner unit's intelligence on Synthoid locations\n and activities. Completing this action will improve the accuracy of your Synthoid population estimated in the\n current city.\n
    \n
    \n Does NOT require stamina.\n \n ),\n exp: newWorkStats({\n hackExp: 20,\n chaExp: 20,\n }),\n },\n\n Recruitment: {\n desc: (\n <>\n Attempt to recruit members for your Bladeburner team. These members can help you conduct operations.\n
    \n
    \n Does NOT require stamina.\n \n ),\n exp: newWorkStats({\n chaExp: 120,\n }),\n },\n\n Diplomacy: {\n desc: (\n <>\n Improve diplomatic relations with the Synthoid population. Completing this action will reduce the Chaos level in\n your current city.\n
    \n
    \n Does NOT require stamina.\n \n ),\n exp: newWorkStats({\n chaExp: 120,\n }),\n },\n\n \"Hyperbolic Regeneration Chamber\": {\n desc: (\n <>\n Enter cryogenic stasis using the Bladeburner division's hi-tech Regeneration Chamber. This will slowly heal your\n wounds and slightly increase your stamina.\n
    \n
    \n \n ),\n exp: newWorkStats(),\n },\n \"Incite Violence\": {\n desc: (\n <>\n Purposefully stir trouble in the synthoid community in order to gain a political edge. This will generate\n additional contracts and operations, at the cost of increased Chaos.\n \n ),\n exp: newWorkStats({\n strExp: 10,\n defExp: 10,\n dexExp: 10,\n agiExp: 10,\n chaExp: 10,\n }),\n },\n};\n","import { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport { Company } from \"../../Company/Company\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { WorkStats } from \"../WorkStats\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPerson } from \"src/PersonObjects/IPerson\";\n\nexport const calculateCompanyWorkStats = (player: IPlayer, worker: IPerson, company: Company): WorkStats => {\n const companyPositionName = player.jobs[company.name];\n const companyPosition = CompanyPositions[companyPositionName];\n\n // If player has SF-11, calculate salary multiplier from favor\n let favorMult = 1 + company.favor / 100;\n if (isNaN(favorMult)) {\n favorMult = 1;\n }\n\n let bn11Mult = 1;\n if (player.sourceFileLvl(11) > 0) {\n bn11Mult = favorMult;\n }\n\n let jobPerformance = companyPosition.calculateJobPerformance(\n worker.skills.hacking,\n worker.skills.strength,\n worker.skills.defense,\n worker.skills.dexterity,\n worker.skills.agility,\n worker.skills.charisma,\n );\n\n jobPerformance += worker.skills.intelligence / CONSTANTS.MaxSkillLevel;\n\n return {\n money:\n companyPosition.baseSalary *\n company.salaryMultiplier *\n worker.mults.work_money *\n BitNodeMultipliers.CompanyWorkMoney *\n bn11Mult,\n reputation: jobPerformance * worker.mults.company_rep * favorMult,\n hackExp:\n companyPosition.hackingExpGain *\n company.expMultiplier *\n worker.mults.hacking_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n strExp:\n companyPosition.strengthExpGain *\n company.expMultiplier *\n worker.mults.strength_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n defExp:\n companyPosition.defenseExpGain *\n company.expMultiplier *\n worker.mults.defense_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n dexExp:\n companyPosition.dexterityExpGain *\n company.expMultiplier *\n worker.mults.dexterity_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n agiExp:\n companyPosition.agilityExpGain *\n company.expMultiplier *\n worker.mults.agility_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n chaExp:\n companyPosition.charismaExpGain *\n company.expMultiplier *\n worker.mults.charisma_exp *\n BitNodeMultipliers.CompanyWorkExpGain,\n intExp: 0,\n };\n};\n","import { EventEmitter } from \"../utils/EventEmitter\";\nexport const StaneksGiftEvents = new EventEmitter<[]>();\n","/**\n * Metadata for constructing Location objects for all Locations\n * in the game\n */\nimport { CityName } from \"./CityNames\";\nimport { LocationName } from \"./LocationNames\";\nimport { IConstructorParams } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nexport const LocationsMetadata: IConstructorParams[] = [\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.AevumAeroCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 8.19,\n },\n name: LocationName.AevumBachmanAndAssociates,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 9.55,\n },\n name: LocationName.AevumClarkeIncorporated,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 3,\n expMult: 2,\n name: LocationName.AevumCrushFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 37,\n startingSecurityLevel: 17.02,\n },\n name: LocationName.AevumECorp,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 15.54,\n },\n name: LocationName.AevumFulcrumTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 256,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 7.89,\n },\n name: LocationName.AevumGalacticCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 3.29,\n },\n name: LocationName.AevumNetLinkTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 64,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 6,\n startingSecurityLevel: 5.35,\n },\n name: LocationName.AevumPolice,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.AevumRhoConstruction,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n costMult: 10,\n expMult: 5,\n name: LocationName.AevumSnapFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Aevum,\n costMult: 4,\n expMult: 3,\n name: LocationName.AevumSummitUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Aevum,\n infiltrationData: {\n maxClearanceLevel: 7,\n startingSecurityLevel: 5.85,\n },\n name: LocationName.AevumWatchdogSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Aevum,\n name: LocationName.AevumCasino,\n types: [LocationType.Casino],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 16.25,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n types: [LocationType.Company],\n },\n {\n city: CityName.Chongqing,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 12.59,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.02,\n },\n name: LocationName.IshimaNovaMedical,\n types: [LocationType.Company],\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.2,\n },\n name: LocationName.IshimaOmegaSoftware,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 128,\n techVendorMinRam: 4,\n },\n {\n city: CityName.Ishima,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.38,\n },\n name: LocationName.IshimaStormTechnologies,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 512,\n techVendorMinRam: 32,\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 7.18,\n },\n name: LocationName.NewTokyoDefComm,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 20,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n types: [LocationType.Company],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 2.5,\n },\n name: LocationName.NewTokyoNoodleBar,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 5.52,\n },\n name: LocationName.NewTokyoVitaLife,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.NewTokyo,\n name: LocationName.NewTokyoArcade,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 10,\n startingSecurityLevel: 3.62,\n },\n name: LocationName.Sector12AlphaEnterprises,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 8,\n techVendorMinRam: 2,\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 10.59,\n },\n name: LocationName.Sector12BladeIndustries,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CIA,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.66,\n },\n name: LocationName.Sector12CarmichaelSecurity,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12CityHall,\n types: [LocationType.Special],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12DeltaOne,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12FoodNStuff,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 8.18,\n },\n name: LocationName.Sector12FourSigma,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 17,\n startingSecurityLevel: 6.02,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n expMult: 1,\n costMult: 1,\n name: LocationName.Sector12IronGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 5,\n startingSecurityLevel: 3.13,\n },\n name: LocationName.Sector12JoesGuns,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 31,\n startingSecurityLevel: 16.36,\n },\n name: LocationName.Sector12MegaCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Sector12,\n name: LocationName.Sector12NSA,\n types: [LocationType.Company, LocationType.Special],\n },\n {\n city: CityName.Sector12,\n costMult: 20,\n expMult: 10,\n name: LocationName.Sector12PowerhouseGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Sector12,\n costMult: 3,\n expMult: 2,\n name: LocationName.Sector12RothmanUniversity,\n types: [LocationType.University],\n },\n {\n city: CityName.Sector12,\n infiltrationData: {\n maxClearanceLevel: 12,\n startingSecurityLevel: 5.9,\n },\n name: LocationName.Sector12UniversalEnergy,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 3.59,\n },\n name: LocationName.VolhavenCompuTek,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 256,\n techVendorMinRam: 8,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 7.28,\n },\n name: LocationName.VolhavenHeliosLabs,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 15,\n startingSecurityLevel: 4.35,\n },\n name: LocationName.VolhavenLexoCorp,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 7,\n expMult: 4,\n name: LocationName.VolhavenMilleniumFitnessGym,\n types: [LocationType.Gym],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 50,\n startingSecurityLevel: 8.53,\n },\n name: LocationName.VolhavenNWO,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 25,\n startingSecurityLevel: 7.74,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n types: [LocationType.Company, LocationType.TechVendor],\n techVendorMaxRam: 1024,\n techVendorMinRam: 128,\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 22,\n startingSecurityLevel: 6,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n infiltrationData: {\n maxClearanceLevel: 18,\n startingSecurityLevel: 4.77,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n types: [LocationType.Company],\n },\n {\n city: CityName.Volhaven,\n costMult: 5,\n expMult: 4,\n name: LocationName.VolhavenZBInstituteOfTechnology,\n types: [LocationType.University],\n },\n {\n city: null,\n name: LocationName.Hospital,\n types: [LocationType.Hospital],\n },\n {\n city: null,\n name: LocationName.Slums,\n types: [LocationType.Slums],\n },\n {\n city: null,\n name: LocationName.TravelAgency,\n types: [LocationType.TravelAgency],\n },\n {\n city: null,\n name: LocationName.WorldStockExchange,\n types: [LocationType.StockMarket],\n },\n {\n city: CityName.Chongqing,\n name: LocationName.ChongqingChurchOfTheMachineGod,\n types: [LocationType.Special],\n },\n {\n city: CityName.Ishima,\n name: LocationName.IshimaGlitch,\n types: [LocationType.Special],\n },\n];\n","import { ITerminal } from \"../ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport FileSaver from \"file-saver\";\nimport JSZip from \"jszip\";\n\nexport function exportScripts(pattern: string, server: BaseServer): void {\n const matchEnding = pattern.length == 1 || pattern === \"*.*\" ? null : pattern.slice(1); // Treat *.* the same as *\n const zip = new JSZip();\n // Helper function to zip any file contents whose name matches the pattern\n const zipFiles = (fileNames: string[], fileContents: string[]): void => {\n for (let i = 0; i < fileContents.length; ++i) {\n let name = fileNames[i];\n if (name.startsWith(\"/\")) name = name.slice(1);\n if (!matchEnding || name.endsWith(matchEnding))\n zip.file(name, new Blob([fileContents[i]], { type: \"text/plain\" }));\n }\n };\n // In the case of script files, we pull from the server.scripts array\n if (!matchEnding || isScriptFilename(matchEnding))\n zipFiles(\n server.scripts.map((s) => s.filename),\n server.scripts.map((s) => s.code),\n );\n // In the case of text files, we pull from the server.scripts array\n if (!matchEnding || matchEnding.endsWith(\".txt\"))\n zipFiles(\n server.textFiles.map((s) => s.fn),\n server.textFiles.map((s) => s.text),\n );\n\n // Return an error if no files matched, rather than an empty zip folder\n if (Object.keys(zip.files).length == 0) throw new Error(`No files match the pattern ${pattern}`);\n const zipFn = `bitburner${isScriptFilename(pattern) ? \"Scripts\" : pattern === \"*.txt\" ? \"Texts\" : \"Files\"}.zip`;\n zip.generateAsync({ type: \"blob\" }).then((content: Blob) => FileSaver.saveAs(content, zipFn));\n}\n\nexport function download(\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n): void {\n try {\n if (args.length !== 1) {\n terminal.error(\"Incorrect usage of download command. Usage: download [script/text file]\");\n return;\n }\n const fn = args[0] + \"\";\n // If the parameter starts with *, download all files that match the wildcard pattern\n if (fn.startsWith(\"*\")) {\n try {\n exportScripts(fn, server);\n return;\n } catch (e: unknown) {\n let msg = String(e);\n if (e !== null && typeof e == \"object\" && e.hasOwnProperty(\"message\")) {\n msg = String((e as { message: unknown }).message);\n }\n return terminal.error(msg);\n }\n } else if (isScriptFilename(fn)) {\n // Download a single script\n const script = terminal.getScript(player, fn);\n if (script != null) {\n return script.download();\n }\n } else if (fn.endsWith(\".txt\")) {\n // Download a single text file\n const txt = terminal.getTextFile(player, fn);\n if (txt != null) {\n return txt.download();\n }\n } else {\n terminal.error(`Cannot download this filetype`);\n return;\n }\n terminal.error(`${fn} does not exist`);\n return;\n } catch (e) {\n terminal.error(e + \"\");\n return;\n }\n}\n","import { Button, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { Modal } from \"../ui/React/Modal\";\n\nlet v2ModalOpen = false;\n\nexport const openV2Modal = (): void => {\n v2ModalOpen = true;\n};\n\nexport const V2Modal = (): React.ReactElement => {\n const [open, setOpen] = useState(v2ModalOpen);\n return (\n undefined}>\n Welcome to bitburner v2.0.0!{\" \"}\n While this version does not change the game a lot, it does have quite a few API breaks.{\" \"}\n \n A file was added to your home computer called V2_0_0_API_BREAK.txt and it is highly recommended you take a look\n at this file. It explains where most of the API break have occured.\n {\" \"}\n \n You should also take a look at{\" \"}\n \n {\" \"}\n the migration guide\n {\" \"}\n as well as{\" \"}\n \n the changelog\n \n \n \n \n );\n};\n","export class PlayerOwnedSourceFile {\n // Source-File level\n lvl = 1;\n\n // Source-File number\n n = 1;\n\n constructor(n: number, level: number) {\n this.n = n;\n this.lvl = level;\n }\n}\n\nexport interface IPlayerOwnedSourceFile {\n lvl: number;\n n: number;\n}\n","import * as React from \"react\";\n\nexport const stealthIcon = (\n \n \n \n \n \n \n);\nexport const killIcon = (\n \n \n \n \n \n \n);\n","import React from \"react\";\nimport { IAction } from \"../IAction\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { use } from \"../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\n\ninterface IProps {\n action: IAction;\n isActive: boolean;\n bladeburner: IBladeburner;\n rerender: () => void;\n}\n\nexport function ActionLevel({ action, isActive, bladeburner, rerender }: IProps): React.ReactElement {\n const player = use.Player();\n\n const canIncrease = action.level < action.maxLevel;\n const canDecrease = action.level > 1;\n\n function increaseLevel(): void {\n if (!canIncrease) return;\n ++action.level;\n if (isActive) bladeburner.startAction(player, bladeburner.action);\n rerender();\n }\n\n function decreaseLevel(): void {\n if (!canDecrease) return;\n --action.level;\n if (isActive) bladeburner.startAction(player, bladeburner.action);\n rerender();\n }\n\n return (\n \n \n \n {action.getSuccessesNeededForNextLevel(BladeburnerConstants.ContractSuccessesPerLevel)} successes needed\n for next level\n \n }\n >\n \n Level: {action.level} / {action.maxLevel}\n \n \n \n WARNING: changing the level will restart the Operation : \"\"}>\n \n \n \n \n \n \n WARNING: changing the level will restart the Operation : \"\"}>\n \n \n \n \n \n \n \n );\n}\n","import React from \"react\";\nimport { IAction } from \"../IAction\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface IProps {\n action: IAction;\n rerender: () => void;\n}\n\nexport function Autolevel(props: IProps): React.ReactElement {\n function onAutolevel(event: React.ChangeEvent): void {\n props.action.autoLevel = event.target.checked;\n props.rerender();\n }\n return (\n \n Automatically increase operation level when possible}>\n Autolevel:\n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { Operation } from \"../Operation\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { TeamSizeModal } from \"./TeamSizeModal\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport Button from \"@mui/material/Button\";\ninterface IProps {\n action: Operation;\n bladeburner: IBladeburner;\n}\nexport function TeamSizeButton(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n return (\n <>\n \n setOpen(false)} action={props.action} bladeburner={props.bladeburner} />\n \n );\n}\n","import { CheckBox, CheckBoxOutlineBlank, Construction } from \"@mui/icons-material\";\nimport { Box, Button, Container, List, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { GraftingWork } from \"../../../Work/GraftingWork\";\nimport { Augmentation } from \"../../../Augmentation/Augmentation\";\nimport { AugmentationNames } from \"../../../Augmentation/data/AugmentationNames\";\nimport { StaticAugmentations } from \"../../../Augmentation/StaticAugmentations\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { hasAugmentationPrereqs } from \"../../../Faction/FactionHelpers\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { Locations } from \"../../../Locations/Locations\";\nimport { PurchaseAugmentationsOrderSetting } from \"../../../Settings/SettingEnums\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { use } from \"../../../ui/Context\";\nimport { ConfirmationModal } from \"../../../ui/React/ConfirmationModal\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { convertTimeMsToTimeElapsedString, formatNumber } from \"../../../utils/StringHelperFunctions\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { GraftableAugmentation } from \"../GraftableAugmentation\";\nimport { calculateGraftingTimeWithBonus, getGraftingAvailableAugs } from \"../GraftingHelpers\";\n\nexport const GraftableAugmentations = (): Record => {\n const gAugs: Record = {};\n for (const aug of Object.values(StaticAugmentations)) {\n const name = aug.name;\n const graftableAug = new GraftableAugmentation(aug);\n gAugs[name] = graftableAug;\n }\n return gAugs;\n};\n\nconst canGraft = (player: IPlayer, aug: GraftableAugmentation): boolean => {\n if (player.money < aug.cost) {\n return false;\n }\n return hasAugmentationPrereqs(aug.augmentation);\n};\n\ninterface IProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst AugPreReqsChecklist = (props: IProps): React.ReactElement => {\n const aug = props.aug,\n player = props.player;\n\n return (\n \n Pre-Requisites:\n
    \n {aug.prereqs.map((preAug) => (\n \n {player.hasAugmentation(preAug) ? : }\n {preAug}\n \n ))}\n
    \n );\n};\n\nexport const GraftingRoot = (): React.ReactElement => {\n const player = use.Player();\n const router = use.Router();\n\n const graftableAugmentations = useState(GraftableAugmentations())[0];\n\n const [selectedAug, setSelectedAug] = useState(getGraftingAvailableAugs(player)[0]);\n const [graftOpen, setGraftOpen] = useState(false);\n const selectedAugmentation = StaticAugmentations[selectedAug];\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n const getAugsSorted = (): string[] => {\n const augs = getGraftingAvailableAugs(player);\n switch (Settings.PurchaseAugmentationsOrder) {\n case PurchaseAugmentationsOrderSetting.Cost:\n return augs.sort((a, b) => graftableAugmentations[a].cost - graftableAugmentations[b].cost);\n default:\n return augs;\n }\n };\n\n const switchSortOrder = (newOrder: PurchaseAugmentationsOrderSetting): void => {\n Settings.PurchaseAugmentationsOrder = newOrder;\n rerender();\n };\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n \n \n Grafting Laboratory\n \n You find yourself in a secret laboratory, owned by a mysterious researcher.\n
    \n The scientist explains that they've been studying Augmentation grafting, the process of applying Augmentations\n without requiring a body reset.\n
    \n
    \n Through legally questionable connections, the scientist has access to a vast array of Augmentation blueprints,\n even private designs. They offer to build and graft the Augmentations to you, in exchange for both a hefty sum\n of money, and being a lab rat.\n
    \n\n \n \n Graft Augmentations\n \n \n \n \n \n {getGraftingAvailableAugs(player).length > 0 ? (\n \n \n {getAugsSorted().map((k, i) => (\n setSelectedAug(k)} selected={selectedAug === k}>\n \n {k}\n \n \n ))}\n \n \n \n {selectedAug}\n \n setGraftOpen(true)}\n sx={{ width: \"100%\" }}\n disabled={!canGraft(player, graftableAugmentations[selectedAug])}\n >\n Graft Augmentation (\n \n \n \n )\n \n setGraftOpen(false)}\n onConfirm={() => {\n player.startWork(\n new GraftingWork({\n augmentation: selectedAug,\n singularity: false,\n player: player,\n }),\n );\n player.startFocusing();\n router.toWork();\n }}\n confirmationText={\n <>\n Cancelling grafting will not save grafting progress, and the money you spend will not{\" \"}\n be returned.\n {!player.hasAugmentation(AugmentationNames.CongruityImplant) && (\n <>\n
    \n
    \n Additionally, grafting an Augmentation will increase the potency of the Entropy virus.\n \n )}\n \n }\n />\n \n \n Time to Graft:{\" \"}\n {convertTimeMsToTimeElapsedString(\n calculateGraftingTimeWithBonus(player, graftableAugmentations[selectedAug]),\n )}\n {/* Use formula so the displayed creation time is accurate to player bonus */}\n \n\n {selectedAugmentation.prereqs.length > 0 && (\n \n )}\n\n
    \n\n \n {(() => {\n const info =\n typeof selectedAugmentation.info === \"string\" ? (\n {selectedAugmentation.info}\n ) : (\n selectedAugmentation.info\n );\n const tooltip = (\n <>\n {info}\n
    \n
    \n {selectedAugmentation.stats}\n \n );\n return tooltip;\n })()}\n
    \n
    \n
    \n
    \n ) : (\n All Augmentations owned\n )}\n
    \n\n \n Entropy Virus\n\n \n \n Entropy strength: {player.entropy}\n
    \n All multipliers decreased by:{\" \"}\n {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}% (multiplicative)\n
    \n
    \n\n \n When installed on an unconscious individual, Augmentations are scanned by the body on awakening, eliminating\n hidden malware. However, grafted Augmentations do not provide this security measure.\n
    \n
    \n Individuals who tested Augmentation grafting have reported symptoms of an unknown virus, which they've dubbed\n \"Entropy\". This virus seems to grow more potent with each grafted Augmentation...\n
    \n
    \n
    \n );\n};\n","import React, { useEffect, useState } from \"react\";\n\nexport function BlinkingCursor(): React.ReactElement {\n const [on, setOn] = useState(true);\n useEffect(() => {\n const i = setInterval(() => setOn((old) => !old), 1000);\n return () => clearInterval(i);\n });\n return <>{on ? \"|\" : <> };\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport TextFormatIcon from \"@mui/icons-material/TextFormat\";\nimport { StyleEditorModal } from \"./StyleEditorModal\";\n\nexport function StyleEditorButton(): React.ReactElement {\n const [styleEditorOpen, setStyleEditorOpen] = useState(false);\n return (\n <>\n \n \n \n setStyleEditorOpen(false)} />\n \n );\n}\n","import React, { useState } from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { ThemeEditorModal } from \"./ThemeEditorModal\";\nimport { IRouter } from \"../../ui/Router\";\nimport ColorizeIcon from \"@mui/icons-material/Colorize\";\n\ninterface IProps {\n router: IRouter;\n}\n\nexport function ThemeEditorButton({ router }: IProps): React.ReactElement {\n const [themeEditorOpen, setThemeEditorOpen] = useState(false);\n return (\n <>\n \n \n \n setThemeEditorOpen(false)} router={router} />\n \n );\n}\n","import React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { Link } from \"@mui/material\";\n\nexport function ThemeCollaborate(): React.ReactElement {\n return (\n <>\n \n If you've created a theme that you believe should be added in game's theme browser, feel free to{\" \"}\n \n create a pull request\n \n .\n \n \n Head over to the{\" \"}\n \n theme-sharing\n {\" \"}\n discord channel for more.\n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { deleteGame } from \"../../db\";\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from \"@mui/material\";\n\nimport DeleteIcon from \"@mui/icons-material/Delete\";\nimport { pushDisableRestore } from \"../../Electron\";\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n}\n\nexport function DeleteGameButton({ color = \"primary\" }: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n return (\n <>\n \n \n \n {\n setModalOpened(false);\n deleteGame()\n .then(() => {\n pushDisableRestore();\n setTimeout(() => location.reload(), 1000);\n })\n .catch((r) => console.error(`Could not delete game: ${r}`));\n }}\n open={modalOpened}\n onClose={() => setModalOpened(false)}\n confirmationText={\"Really delete your game? (It's permanent!)\"}\n />\n \n );\n}\n","import React, { useState } from \"react\";\n\nimport { ConfirmationModal } from \"./ConfirmationModal\";\nimport Button from \"@mui/material/Button\";\nimport { Tooltip } from \"@mui/material\";\nimport RestartAltIcon from \"@mui/icons-material/RestartAlt\";\n\ninterface IProps {\n color?: \"primary\" | \"warning\" | \"error\";\n noConfirmation?: boolean;\n onTriggered: () => void;\n}\n\nexport function SoftResetButton({\n color = \"primary\",\n noConfirmation = false,\n onTriggered,\n}: IProps): React.ReactElement {\n const [modalOpened, setModalOpened] = useState(false);\n\n function handleButtonClick(): void {\n if (noConfirmation) {\n onTriggered();\n } else {\n setModalOpened(true);\n }\n }\n\n return (\n <>\n \n \n \n setModalOpened(false)}\n confirmationText={\"This will perform the same action as installing Augmentations, are you sure?\"}\n />\n \n );\n}\n","export default \"/**\\n * @public\\n */\\nexport interface HP {\\n current: number;\\n max: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface Skills {\\n hacking: number;\\n strength: number;\\n defense: number;\\n dexterity: number;\\n agility: number;\\n charisma: number;\\n intelligence: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface PossibleInfiltrationLocation {\\n city: string;\\n name: string;\\n}\\n\\n/**\\n * Coding contract data will differ depending on coding contract.\\n * @public\\n */\\ntype CodingContractData = any;\\n\\n/**\\n * @public\\n */\\ntype PortData = string | number;\\n\\n/**\\n * @public\\n */\\ntype ScriptArg = string | number | boolean;\\n\\n/**\\n * @public\\n */\\ntype FilenameOrPID = number | string;\\n\\n/**\\n * @public\\n */\\ninterface Player {\\n hp: HP;\\n skills: Skills;\\n exp: Skills;\\n mults: Multipliers;\\n numPeopleKilled: number;\\n money: number;\\n city: string;\\n location: string;\\n bitNodeN: number;\\n totalPlaytime: number;\\n playtimeSinceLastAug: number;\\n playtimeSinceLastBitnode: number;\\n jobs: Record;\\n factions: string[];\\n tor: boolean;\\n hasCorporation: boolean;\\n inBladeburner: boolean;\\n entropy: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface Multipliers {\\n hacking_chance: number;\\n hacking_speed: number;\\n hacking_money: number;\\n hacking_grow: number;\\n hacking: number;\\n hacking_exp: number;\\n strength: number;\\n strength_exp: number;\\n defense: number;\\n defense_exp: number;\\n dexterity: number;\\n dexterity_exp: number;\\n agility: number;\\n agility_exp: number;\\n charisma: number;\\n charisma_exp: number;\\n hacknet_node_money: number;\\n hacknet_node_purchase_cost: number;\\n hacknet_node_ram_cost: number;\\n hacknet_node_core_cost: number;\\n hacknet_node_level_cost: number;\\n company_rep: number;\\n faction_rep: number;\\n work_money: number;\\n crime_success: number;\\n crime_money: number;\\n bladeburner_max_stamina: number;\\n bladeburner_stamina_gain: number;\\n bladeburner_analysis: number;\\n bladeburner_success_chance: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface RunningScript {\\n /** Arguments the script was called with */\\n args: (string | number | boolean)[];\\n /** Filename of the script */\\n filename: string;\\n /**\\n * Script logs as an array. The newest log entries are at the bottom.\\n * Timestamps, if enabled, are placed inside `[brackets]` at the start of each line.\\n **/\\n logs: string[];\\n /** Total amount of hacking experience earned from this script when offline */\\n offlineExpGained: number;\\n /** Total amount of money made by this script when offline */\\n offlineMoneyMade: number;\\n /** Number of seconds that the script has been running offline */\\n offlineRunningTime: number;\\n /** Total amount of hacking experience earned from this script when online */\\n onlineExpGained: number;\\n /** Total amount of money made by this script when online */\\n onlineMoneyMade: number;\\n /** Number of seconds that this script has been running online */\\n onlineRunningTime: number;\\n /** Process ID. Must be an integer */\\n pid: number;\\n /** How much RAM this script uses for ONE thread */\\n ramUsage: number;\\n /** Hostname of the server on which this script runs */\\n server: string;\\n /** Number of threads that this script runs with */\\n threads: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface RecentScript extends RunningScript {\\n /** Timestamp of when the script was killed */\\n timeOfDeath: Date;\\n}\\n\\n/**\\n * Data representing the internal values of a crime.\\n * @public\\n */\\nexport interface CrimeStats {\\n /** Number representing the difficulty of the crime. Used for success chance calculations */\\n difficulty: number;\\n /** Amount of karma lost for successfully committing this crime */\\n karma: number;\\n /** How many people die as a result of this crime */\\n kills: number;\\n /** How much money is given */\\n money: number;\\n /** Name of crime */\\n name: string;\\n /** Milliseconds it takes to attempt the crime */\\n time: number;\\n /** Description of the crime activity */\\n type: string;\\n /** hacking level impact on success change of the crime */\\n hacking_success_weight: number;\\n /** strength level impact on success change of the crime */\\n strength_success_weight: number;\\n /** defense level impact on success change of the crime */\\n defense_success_weight: number;\\n /** dexterity level impact on success change of the crime */\\n dexterity_success_weight: number;\\n /** agility level impact on success change of the crime */\\n agility_success_weight: number;\\n /** charisma level impact on success change of the crime */\\n charisma_success_weight: number;\\n /** hacking exp gained from crime */\\n hacking_exp: number;\\n /** strength exp gained from crime */\\n strength_exp: number;\\n /** defense exp gained from crime */\\n defense_exp: number;\\n /** dexterity exp gained from crime */\\n dexterity_exp: number;\\n /** agility exp gained from crime */\\n agility_exp: number;\\n /** charisma exp gained from crime */\\n charisma_exp: number;\\n /** intelligence exp gained from crime */\\n intelligence_exp: number;\\n}\\n\\n/**\\n * Data representing the internal values of an Augmentation.\\n * @public\\n */\\nexport interface AugmentationStats {\\n /** Multiplier to hacking skill */\\n hacking?: number;\\n /** Multiplier to strength skill */\\n strength?: number;\\n /** Multiplier to defense skill */\\n defense?: number;\\n /** Multiplier to dexterity skill */\\n dexterity?: number;\\n /** Multiplier to agility skill */\\n agility?: number;\\n /** Multiplier to charisma skill */\\n charisma?: number;\\n /** Multiplier to hacking experience gain rate */\\n hacking_exp?: number;\\n /** Multiplier to strength experience gain rate */\\n strength_exp?: number;\\n /** Multiplier to defense experience gain rate */\\n defense_exp?: number;\\n /** Multiplier to dexterity experience gain rate */\\n dexterity_exp?: number;\\n /** Multiplier to agility experience gain rate */\\n agility_exp?: number;\\n /** Multiplier to charisma experience gain rate */\\n charisma_exp?: number;\\n /** Multiplier to chance of successfully performing a hack */\\n hacking_chance?: number;\\n /** Multiplier to hacking speed */\\n hacking_speed?: number;\\n /** Multiplier to amount of money the player gains from hacking */\\n hacking_money?: number;\\n /** Multiplier to amount of money injected into servers using grow */\\n hacking_grow?: number;\\n /** Multiplier to amount of reputation gained when working */\\n company_rep?: number;\\n /** Multiplier to amount of reputation gained when working */\\n faction_rep?: number;\\n /** Multiplier to amount of money gained from crimes */\\n crime_money?: number;\\n /** Multiplier to crime success rate */\\n crime_success?: number;\\n /** Multiplier to amount of money gained from working */\\n work_money?: number;\\n /** Multiplier to amount of money produced by Hacknet Nodes */\\n hacknet_node_money?: number;\\n /** Multiplier to cost of purchasing a Hacknet Node */\\n hacknet_node_purchase_cost?: number;\\n /** Multiplier to cost of ram for a Hacknet Node */\\n hacknet_node_ram_cost?: number;\\n /** Multiplier to cost of core for a Hacknet Node */\\n hacknet_node_core_cost?: number;\\n /** Multiplier to cost of leveling up a Hacknet Node */\\n hacknet_node_level_cost?: number;\\n /** Multiplier to Bladeburner max stamina */\\n bladeburner_max_stamina?: number;\\n /** Multiplier to Bladeburner stamina gain rate */\\n bladeburner_stamina_gain?: number;\\n /** Multiplier to effectiveness in Bladeburner Field Analysis */\\n bladeburner_analysis?: number;\\n /** Multiplier to success chance in Bladeburner contracts/operations */\\n bladeburner_success_chance?: number;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link NS.hack | hack}, {@link NS.grow | grow}, and {@link NS.weaken | weaken}.\\n * @public\\n */\\nexport interface BasicHGWOptions {\\n /** Number of threads to use for this function. Must be less than or equal to the number of threads the script is running with. */\\n threads?: number;\\n /** Set to true this action will affect the stock market. */\\n stock?: boolean;\\n}\\n\\n/**\\n * Options to affect the behavior of {@link CodingContract} attempt.\\n * @public\\n */\\nexport interface CodingAttemptOptions {\\n /** If truthy, then the function will return a string that states the contract’s reward when it is successfully solved. */\\n returnReward: boolean;\\n}\\n\\n/**\\n * Return value of {@link Sleeve.getSleevePurchasableAugs | getSleevePurchasableAugs}\\n * @public\\n */\\nexport interface AugmentPair {\\n /** augmentation name */\\n name: string;\\n /** augmentation cost */\\n cost: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport enum PositionTypes {\\n Long = \\\"L\\\",\\n Short = \\\"S\\\",\\n}\\n\\n/**\\n * @public\\n */\\nexport enum OrderTypes {\\n LimitBuy = \\\"Limit Buy Order\\\",\\n LimitSell = \\\"Limit Sell Order\\\",\\n StopBuy = \\\"Stop Buy Order\\\",\\n StopSell = \\\"Stop Sell Order\\\",\\n}\\n\\n/**\\n * Value in map of {@link StockOrder}\\n * @public\\n */\\nexport interface StockOrderObject {\\n /** Number of shares */\\n shares: number;\\n /** Price per share */\\n price: number;\\n /** Order type */\\n type: OrderTypes;\\n /** Order position */\\n position: PositionTypes;\\n}\\n\\n/**\\n * Return value of {@link TIX.getOrders | getOrders}\\n *\\n * Keys are stock symbols, properties are arrays of {@link StockOrderObject}\\n * @public\\n */\\nexport interface StockOrder {\\n [key: string]: StockOrderObject[];\\n}\\n\\n/**\\n * A single process on a server.\\n * @public\\n */\\nexport interface ProcessInfo {\\n /** Script name. */\\n filename: string;\\n /** Number of threads script is running with */\\n threads: number;\\n /** Script's arguments */\\n args: (string | number | boolean)[];\\n /** Process ID */\\n pid: number;\\n}\\n\\n/**\\n * Hack related multipliers.\\n * @public\\n */\\nexport interface HackingMultipliers {\\n /** Player's hacking chance multiplier. */\\n chance: number;\\n /** Player's hacking speed multiplier. */\\n speed: number;\\n /** Player's hacking money stolen multiplier. */\\n money: number;\\n /** Player's hacking growth multiplier */\\n growth: number;\\n}\\n\\n/**\\n * Hacknet related multipliers.\\n * @public\\n */\\nexport interface HacknetMultipliers {\\n /** Player's hacknet production multiplier */\\n production: number;\\n /** Player's hacknet purchase cost multiplier */\\n purchaseCost: number;\\n /** Player's hacknet ram cost multiplier */\\n ramCost: number;\\n /** Player's hacknet core cost multiplier */\\n coreCost: number;\\n /** Player's hacknet level cost multiplier */\\n levelCost: number;\\n}\\n\\n/**\\n * Hacknet node related constants\\n * @public\\n */\\nexport interface HacknetNodeConstants {\\n /** Amount of money gained per level */\\n MoneyGainPerLevel: number;\\n /** Base cost for a new node */\\n BaseCost: number;\\n /** Base cost per level */\\n LevelBaseCost: number;\\n /** Base cost to incrase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Multiplier to purchase new node */\\n PurchaseNextMult: number;\\n /** Multiplier to increase node level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Max node level */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n}\\n\\n/**\\n * Hacknet server related constants\\n * @public\\n */\\nexport interface HacknetServerConstants {\\n /** Number of hashes calculated per level */\\n HashesPerLevel: number;\\n /** Base cost for a new server */\\n BaseCost: number;\\n /** Base cost to increase RAM */\\n RamBaseCost: number;\\n /** Base cost to increase cores */\\n CoreBaseCost: number;\\n /** Base cost to upgrade cache */\\n CacheBaseCost: number;\\n /** Multiplier to purchase a new server */\\n PurchaseMult: number;\\n /** Multiplier to increase server level */\\n UpgradeLevelMult: number;\\n /** Multiplier to increase RAM */\\n UpgradeRamMult: number;\\n /** Multiplier to increase cores */\\n UpgradeCoreMult: number;\\n /** Multiplier to upgrade cache */\\n UpgradeCacheMult: number;\\n /** Max number of servers */\\n MaxServers: number;\\n /** Max level for a server */\\n MaxLevel: number;\\n /** Max amount of RAM in GB */\\n MaxRam: number;\\n /** Max number of cores */\\n MaxCores: number;\\n /** Max cache size */\\n MaxCache: number;\\n}\\n\\n/**\\n * A single server.\\n * @public\\n */\\nexport interface Server {\\n /**\\n * How many CPU cores this server has. Maximum of 8.\\n * Affects magnitude of grow and weaken.\\n */\\n cpuCores: number;\\n\\n /** Flag indicating whether the FTP port is open */\\n ftpPortOpen: boolean;\\n\\n /** Flag indicating whether player has admin/root access to this server */\\n hasAdminRights: boolean;\\n\\n /** Hostname. Must be unique */\\n hostname: string;\\n\\n /** Flag indicating whether HTTP Port is open */\\n httpPortOpen: boolean;\\n\\n /** IP Address. Must be unique */\\n ip: string;\\n\\n /** Flag indicating whether player is currently connected to this server */\\n isConnectedTo: boolean;\\n\\n /** RAM (GB) available on this server */\\n maxRam: number;\\n\\n /**\\n * Name of company/faction/etc. that this server belongs to.\\n * Optional, not applicable to all Servers\\n */\\n organizationName: string;\\n\\n /** RAM (GB) used. i.e. unavailable RAM */\\n ramUsed: number;\\n\\n /** Flag indicating whether SMTP Port is open */\\n smtpPortOpen: boolean;\\n\\n /** Flag indicating whether SQL Port is open */\\n sqlPortOpen: boolean;\\n\\n /** Flag indicating whether the SSH Port is open */\\n sshPortOpen: boolean;\\n\\n /** Flag indicating whether this is a purchased server */\\n purchasedByPlayer: boolean;\\n\\n /** Flag indicating whether this server has a backdoor installed by a player */\\n backdoorInstalled: boolean;\\n\\n /**\\n * Initial server security level\\n * (i.e. security level when the server was created)\\n */\\n baseDifficulty: number;\\n\\n /** Server Security Level */\\n hackDifficulty: number;\\n\\n /** Minimum server security level that this server can be weakened to */\\n minDifficulty: number;\\n\\n /** How much money currently resides on the server and can be hacked */\\n moneyAvailable: number;\\n\\n /** Maximum amount of money that this server can hold */\\n moneyMax: number;\\n\\n /** Number of open ports required in order to gain admin/root access */\\n numOpenPortsRequired: number;\\n\\n /** How many ports are currently opened on the server */\\n openPortCount: number;\\n\\n /** Hacking level required to hack this server */\\n requiredHackingSkill: number;\\n\\n /**\\n * Parameter that affects how effectively this server's money can\\n * be increased using the grow() Netscript function\\n */\\n serverGrowth: number;\\n}\\n\\n/**\\n * All multipliers affecting the difficulty of the current challenge.\\n * @public\\n */\\nexport interface BitNodeMultipliers {\\n /** Influences how quickly the player's agility level (not exp) scales */\\n AgilityLevelMultiplier: number;\\n /** Influences the base cost to purchase an augmentation. */\\n AugmentationMoneyCost: number;\\n /** Influences the base rep the player must have with a faction to purchase an augmentation. */\\n AugmentationRepCost: number;\\n /** Influences how quickly the player can gain rank within Bladeburner. */\\n BladeburnerRank: number;\\n /** Influences the cost of skill levels from Bladeburner. */\\n BladeburnerSkillCost: number;\\n /** Influences how quickly the player's charisma level (not exp) scales */\\n CharismaLevelMultiplier: number;\\n /** Influences the experience gained for each ability when a player completes a class. */\\n ClassGymExpGain: number;\\n /** Influences the amount of money gained from completing Coding Contracts */\\n CodingContractMoney: number;\\n /** Influences the experience gained for each ability when the player completes working their job. */\\n CompanyWorkExpGain: number;\\n /** Influences how much money the player earns when completing working their job. */\\n CompanyWorkMoney: number;\\n /** Influences the money gain from dividends of corporations created by the player. */\\n CorporationSoftcap: number;\\n /** Influences the valuation of corporations created by the player. */\\n CorporationValuation: number;\\n /** Influences the base experience gained for each ability when the player commits a crime. */\\n CrimeExpGain: number;\\n /** Influences the base money gained when the player commits a crime. */\\n CrimeMoney: number;\\n /** Influences how many Augmentations you need in order to get invited to the Daedalus faction */\\n DaedalusAugsRequirement: number;\\n /** Influences how quickly the player's defense level (not exp) scales */\\n DefenseLevelMultiplier: number;\\n /** Influences how quickly the player's dexterity level (not exp) scales */\\n DexterityLevelMultiplier: number;\\n /** Influences how much rep the player gains in each faction simply by being a member. */\\n FactionPassiveRepGain: number;\\n /** Influences the experience gained for each ability when the player completes work for a Faction. */\\n FactionWorkExpGain: number;\\n /** Influences how much rep the player gains when performing work for a faction. */\\n FactionWorkRepGain: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data API */\\n FourSigmaMarketDataApiCost: number;\\n /** Influences how much it costs to unlock the stock market's 4S Market Data (NOT API) */\\n FourSigmaMarketDataCost: number;\\n /** Influences the respect gain and money gain of your gang. */\\n GangSoftcap: number;\\n /** Influences the experienced gained when hacking a server. */\\n HackExpGain: number;\\n /** Influences how quickly the player's hacking level (not experience) scales */\\n HackingLevelMultiplier: number;\\n /** Influences how much money is produced by Hacknet Nodes and the hash rate of Hacknet Servers (unlocked in BitNode-9) */\\n HacknetNodeMoney: number;\\n /** Influences how much money it costs to upgrade your home computer's RAM */\\n HomeComputerRamCost: number;\\n /** Influences how much money is gained when the player infiltrates a company. */\\n InfiltrationMoney: number;\\n /** Influences how much rep the player can gain from factions when selling stolen documents and secrets */\\n InfiltrationRep: number;\\n /** Influences how much money can be stolen from a server when the player performs a hack against it through the Terminal. */\\n ManualHackMoney: number;\\n /** Influence how much it costs to purchase a server */\\n PurchasedServerCost: number;\\n /** Influences the maximum number of purchased servers you can have */\\n PurchasedServerLimit: number;\\n /** Influences the maximum allowed RAM for a purchased server */\\n PurchasedServerMaxRam: number;\\n /** Influences cost of any purchased server at or above 128GB */\\n PurchasedServerSoftcap: number;\\n /** Influences the minimum favor the player must have with a faction before they can donate to gain rep. */\\n RepToDonateToFaction: number;\\n /** Influences how much the money on a server can be reduced when a script performs a hack against it. */\\n ScriptHackMoney: number;\\n /** Influences how much of the money stolen by a scripted hack will be added to the player's money. */\\n ScriptHackMoneyGain: number;\\n /** Influences the growth percentage per cycle against a server. */\\n ServerGrowthRate: number;\\n /** Influences the maximum money that a server can grow to. */\\n ServerMaxMoney: number;\\n /** Influences the initial money that a server starts with. */\\n ServerStartingMoney: number;\\n /** Influences the initial security level (hackDifficulty) of a server. */\\n ServerStartingSecurity: number;\\n /** Influences the weaken amount per invocation against a server. */\\n ServerWeakenRate: number;\\n /** Influences how quickly the player's strength level (not exp) scales */\\n StrengthLevelMultiplier: number;\\n /** Influences the power of the gift */\\n StaneksGiftPowerMultiplier: number;\\n /** Influences the size of the gift */\\n StaneksGiftExtraSize: number;\\n /** Influences the hacking skill required to backdoor the world daemon. */\\n WorldDaemonDifficulty: number;\\n}\\n\\n/**\\n * Object representing all the values related to a hacknet node.\\n * @public\\n */\\nexport interface NodeStats {\\n /** Node's name */\\n name: string;\\n /** Node's level */\\n level: number;\\n /** Node's RAM (GB) */\\n ram: number;\\n /** Node's used RAM (GB) */\\n ramUsed?: number;\\n /** Node's number of cores */\\n cores: number;\\n /** Cache level. Only applicable for Hacknet Servers */\\n cache?: number;\\n /** Hash Capacity provided by this Node. Only applicable for Hacknet Servers */\\n hashCapacity?: number;\\n /** Node's production per second */\\n production: number;\\n /** Number of seconds since Node has been purchased */\\n timeOnline: number;\\n /** Total number of money Node has produced */\\n totalProduction: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface CharacterMult {\\n /** Agility stat */\\n agility: number;\\n /** Agility exp */\\n agilityExp: number;\\n /** Charisma stat */\\n charisma: number;\\n /** Charisma exp */\\n charismaExp: number;\\n /** Company reputation */\\n companyRep: number;\\n /** Money earned from crimes */\\n crimeMoney: number;\\n /** Crime success chance */\\n crimeSuccess: number;\\n /** Defense stat */\\n defense: number;\\n /** Defense exp */\\n defenseExp: number;\\n /** Dexterity stat */\\n dexterity: number;\\n /** Dexterity exp */\\n dexterityExp: number;\\n /** Faction reputation */\\n factionRep: number;\\n /** Hacking stat */\\n hacking: number;\\n /** Hacking exp */\\n hackingExp: number;\\n /** Strength stat */\\n strength: number;\\n /** Strength exp */\\n strengthExp: number;\\n /** Money earned from jobs */\\n workMoney: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface SleeveWorkGains {\\n /** Hacking exp gained from work */\\n workHackExpGain: number;\\n /** Strength exp gained from work */\\n workStrExpGain: number;\\n /** Defense exp gained from work, */\\n workDefExpGain: number;\\n /** Dexterity exp gained from work */\\n workDexExpGain: number;\\n /** Agility exp gained from work */\\n workAgiExpGain: number;\\n /** Charisma exp gained from work */\\n workChaExpGain: number;\\n /** Money gained from work */\\n workMoneyGain: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface SourceFileLvl {\\n /** The number of the source file */\\n n: number;\\n /** The level of the source file */\\n lvl: number;\\n}\\n\\n/**\\n * Bladeburner current action.\\n * @public\\n */\\nexport interface BladeburnerCurAction {\\n /** Type of Action */\\n type: string;\\n /** Name of Action */\\n name: string;\\n}\\n\\n/**\\n * Gang general info.\\n * @public\\n */\\nexport interface GangGenInfo {\\n /** Name of faction that the gang belongs to (\\\"Slum Snakes\\\", etc.) */\\n faction: string;\\n /** Indicating whether or not it's a hacking gang */\\n isHacking: boolean;\\n /** Money earned per game cycle */\\n moneyGainRate: number;\\n /** Gang's power for territory warfare */\\n power: number;\\n /** Gang's respect */\\n respect: number;\\n /** Respect earned per game cycle */\\n respectGainRate: number;\\n /** Amount of territory held */\\n territory: number;\\n /** Clash chance */\\n territoryClashChance: number;\\n /** Gang's wanted level */\\n wantedLevel: number;\\n /** Wanted level gained/lost per game cycle (negative for losses) */\\n wantedLevelGainRate: number;\\n /** Indicating if territory warfare is enabled */\\n territoryWarfareEngaged: boolean;\\n /** Number indicating the current wanted penalty */\\n wantedPenalty: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangOtherInfoObject {\\n /** Gang power */\\n power: number;\\n /** Gang territory, in decimal form */\\n territory: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangOtherInfo {\\n [key: string]: GangOtherInfoObject;\\n}\\n\\n/**\\n * Object representing data representing a gang member task.\\n * @public\\n */\\nexport interface GangTaskStats {\\n /** Task name */\\n name: string;\\n /** Task Description */\\n desc: string;\\n /** Is a task of a hacking gang */\\n isHacking: boolean;\\n /** Is a task of a combat gang */\\n isCombat: boolean;\\n /** Base respect earned */\\n baseRespect: number;\\n /** Base wanted earned */\\n baseWanted: number;\\n /** Base money earned */\\n baseMoney: number;\\n /** Hacking skill impact on task scaling */\\n hackWeight: number;\\n /** Strength skill impact on task scaling */\\n strWeight: number;\\n /** Defense skill impact on task scaling */\\n defWeight: number;\\n /** Dexterity skill impact on task scaling */\\n dexWeight: number;\\n /** Agility skill impact on task scaling */\\n agiWeight: number;\\n /** Charisma skill impact on task scaling */\\n chaWeight: number;\\n /** Number representing the difficulty of the task */\\n difficulty: number;\\n /** Territory impact on task scaling */\\n territory: GangTerritory;\\n}\\n\\n/**\\n * Object representing data representing a gang member equipment.\\n * @public\\n */\\nexport interface EquipmentStats {\\n /** Strength multiplier */\\n str?: number;\\n /** Defense multiplier */\\n def?: number;\\n /** Dexterity multiplier */\\n dex?: number;\\n /** Agility multiplier */\\n agi?: number;\\n /** Charisma multiplier */\\n cha?: number;\\n /** Hacking multiplier */\\n hack?: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangTerritory {\\n /** Money gain impact on task scaling */\\n money: number;\\n /** Respect gain impact on task scaling */\\n respect: number;\\n /** Wanted gain impact on task scaling */\\n wanted: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangMemberInfo {\\n /** Name of the gang member */\\n name: string;\\n /** Currently assigned task */\\n task: string;\\n earnedRespect: number;\\n\\n /** Hack skill level */\\n hack: number;\\n /** Strength skill level */\\n str: number;\\n /** Defense skill level */\\n def: number;\\n /** Dexterity skill level */\\n dex: number;\\n /** Agility skill level */\\n agi: number;\\n /** Charisma skill level */\\n cha: number;\\n\\n /** Current hack experience */\\n hack_exp: number;\\n /** Current strength experience */\\n str_exp: number;\\n /** Current defense experience */\\n def_exp: number;\\n /** Current dexterity experience */\\n dex_exp: number;\\n /** Current agility experience */\\n agi_exp: number;\\n /** Current charisma experience */\\n cha_exp: number;\\n\\n /** Hack multiplier from equipment */\\n hack_mult: number;\\n /** Strength multiplier from equipment */\\n str_mult: number;\\n /** Defense multiplier from equipment */\\n def_mult: number;\\n /** Dexterity multiplier from equipment */\\n dex_mult: number;\\n /** Agility multiplier from equipment */\\n agi_mult: number;\\n /** Charisma multiplier from equipment */\\n cha_mult: number;\\n\\n /** Hack multiplier from ascensions */\\n hack_asc_mult: number;\\n /** Strength multiplier from ascensions */\\n str_asc_mult: number;\\n /** Defense multiplier from ascensions */\\n def_asc_mult: number;\\n /** Dexterity multiplier from ascensions */\\n dex_asc_mult: number;\\n /** Agility multiplier from ascensions */\\n agi_asc_mult: number;\\n /** Charisma multiplier from ascensions */\\n cha_asc_mult: number;\\n\\n /** Total earned hack experience */\\n hack_asc_points: number;\\n /** Total earned strength experience */\\n str_asc_points: number;\\n /** Total earned defense experience */\\n def_asc_points: number;\\n /** Total earned dexterity experience */\\n dex_asc_points: number;\\n /** Total earned agility experience */\\n agi_asc_points: number;\\n /** Total earned charisma experience */\\n cha_asc_points: number;\\n\\n upgrades: string[];\\n augmentations: string[];\\n\\n respectGain: number;\\n wantedLevelGain: number;\\n moneyGain: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface GangMemberAscension {\\n /** Amount of respect lost from ascending */\\n respect: number;\\n /** Hacking multiplier gained from ascending */\\n hack: number;\\n /** Strength multiplier gained from ascending */\\n str: number;\\n /** Defense multiplier gained from ascending */\\n def: number;\\n /** Dexterity multiplier gained from ascending */\\n dex: number;\\n /** Agility multiplier gained from ascending */\\n agi: number;\\n /** Charisma multiplier gained from ascending */\\n cha: number;\\n}\\n\\n/**\\n * Object representing a sleeve stats.\\n * @public\\n */\\nexport interface SleeveSkills {\\n /** Current shock of the sleeve [0-100] */\\n shock: number;\\n /** Current sync of the sleeve [0-100] */\\n sync: number;\\n /** Current memory of the sleeve [1-100] */\\n memory: number;\\n /** Current hacking skill of the sleeve */\\n hacking: number;\\n /** Current strength of the sleeve */\\n strength: number;\\n /** Current defense of the sleeve */\\n defense: number;\\n /** Current dexterity of the sleeve */\\n dexterity: number;\\n /** Current agility of the sleeve */\\n agility: number;\\n /** Current charisma of the sleeve */\\n charisma: number;\\n}\\n\\n/**\\n * Object representing sleeve information.\\n * @public\\n */\\nexport interface SleeveInformation {\\n /** Location of the sleeve */\\n city: string;\\n /** hp of the sleeve */\\n hp: HP;\\n /** Jobs available to the sleeve */\\n jobs: string[];\\n /** Job titles available to the sleeve */\\n jobTitle: string[];\\n /** Does this sleeve have access to the tor router */\\n tor: boolean;\\n /** Sleeve multipliers */\\n mult: CharacterMult;\\n}\\n\\n/**\\n * Object representing a sleeve current task.\\n * @public\\n */\\nexport type SleeveTask = any;\\n\\n/**\\n * Object representing a port. A port is a serialized queue.\\n * @public\\n */\\nexport interface NetscriptPort {\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns The data popped off the queue if it was full.\\n */\\n write(value: string | number): null | string | number;\\n\\n /**\\n * Attempt to write data to the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns True if the data was added to the port, false if the port was full\\n */\\n tryWrite(value: string | number): boolean;\\n\\n /**\\n * Shift an element out of the port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function will remove the first element from the port and return it.\\n * If the port is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n read(): string | number;\\n\\n /**\\n * Retrieve the first element from the port without removing it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n * @returns the data read\\n */\\n peek(): string | number;\\n\\n /**\\n * Check if the port is full.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is full, otherwise false\\n */\\n full(): boolean;\\n\\n /**\\n * Check if the port is empty.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns true if the port is empty, otherwise false\\n */\\n empty(): boolean;\\n\\n /**\\n * Empties all data from the port.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clear(): void;\\n}\\n\\n/**\\n * Stock market API\\n * @public\\n */\\nexport interface TIX {\\n /**\\n * Returns true if the player has access to a WSE Account\\n * @remarks RAM cost: 0.05 GB\\n */\\n hasWSEAccount(): boolean;\\n /**\\n * Returns true if the player has access to the TIX API\\n * @remarks RAM cost: 0.05 GB\\n */\\n hasTIXAPIAccess(): boolean;\\n /**\\n * Returns true if the player has access to the 4S Data\\n * @remarks RAM cost: 0.05 GB\\n */\\n has4SData(): boolean;\\n /**\\n * Returns true if the player has access to the 4SData TIX API\\n * @remarks RAM cost: 0.05 GB\\n */\\n has4SDataTIXAPI(): boolean;\\n /**\\n * Returns an array of the symbols of the tradable stocks\\n *\\n * @remarks RAM cost: 2 GB\\n * @returns Array of the symbols of the tradable stocks.\\n */\\n getSymbols(): string[];\\n\\n /**\\n * Returns the price of a stock\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n * The stock’s price is the average of its bid and ask price.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * stock.getPrice(\\\"FISG\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.stock.getPrice(\\\"FISG\\\");\\n * ```\\n * @param sym - Stock symbol.\\n * @returns The price of a stock.\\n */\\n getPrice(sym: string): number;\\n\\n /**\\n * Returns the ask price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The ask price of a stock.\\n */\\n getAskPrice(sym: string): number;\\n\\n /**\\n * Returns the bid price of that stock.\\n * @remarks RAM cost: 2 GB\\n *\\n * @param sym - Stock symbol.\\n * @returns The bid price of a stock.\\n */\\n getBidPrice(sym: string): number;\\n\\n /**\\n * Returns the player’s position in a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * Returns an array of four elements that represents the player’s position in a stock.\\n *\\n * The first element is the returned array is the number of shares the player owns of\\n * the stock in the Long position. The second element in the array is the average price\\n * of the player’s shares in the Long position.\\n *\\n * The third element in the array is the number of shares the player owns of the stock\\n * in the Short position. The fourth element in the array is the average price of the\\n * player’s Short position.\\n *\\n * All elements in the returned array are numeric.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * var pos = stock.getPosition(\\\"ECP\\\");\\n * var shares = pos[0];\\n * var avgPx = pos[1];\\n * var sharesShort = pos[2];\\n * var avgPxShort = pos[3];\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * const [shares, avgPx, sharesShort, avgPxShort] = ns.stock.getPosition(\\\"ECP\\\");\\n * ```\\n * @param sym - Stock symbol.\\n * @returns Array of four elements that represents the player’s position in a stock.\\n */\\n getPosition(sym: string): [number, number, number, number];\\n\\n /**\\n * Returns the maximum number of shares of a stock.\\n * @remarks\\n * RAM cost: 2 GB\\n * This is the maximum amount of the stock that can be purchased\\n * in both the Long and Short positions combined.\\n *\\n * @param sym - Stock symbol.\\n * @returns Maximum number of shares that the stock has.\\n */\\n getMaxShares(sym: string): number;\\n\\n /**\\n * Calculates cost of buying stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much it would cost to buy a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchase.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Cost to buy a given number of shares of a stock.\\n */\\n getPurchaseCost(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Calculate profit of selling stocks.\\n * @remarks\\n * RAM cost: 2 GB\\n * Calculates and returns how much you would gain from selling a given number of shares of a stock.\\n * This takes into account spread, large transactions influencing the price of the stock and commission fees.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell.\\n * @param posType - Specifies whether the order is a “Long” or “Short” position.\\n * @returns Gain from selling a given number of shares of a stock.\\n */\\n getSaleGain(sym: string, shares: number, posType: string): number;\\n\\n /**\\n * Buy stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase shares of a stock using a Market Order.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If this function successfully purchases the shares, it will return the stock price at which\\n * each share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to purchased. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n buyStock(sym: string, shares: number): number;\\n\\n /**\\n * Sell stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell shares of a stock using a Market Order.\\n *\\n * If the specified number of shares in the function exceeds the amount that the player\\n * actually owns, then this function will sell all owned shares. Remember that every\\n * transaction on the stock exchange costs a certain commission fee.\\n *\\n * The net profit made from selling stocks with this function is reflected in the script’s\\n * statistics. This net profit is calculated as:\\n *\\n * shares * (sell_price - average_price_of_purchased_shares)\\n *\\n * If the sale is successful, this function will return the stock price at\\n * which each share was sold. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sellStock(sym: string, shares: number): number;\\n\\n /**\\n * Short stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to purchase a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the player does not have enough money to purchase the specified number of shares,\\n * then no shares will be purchased. Remember that every transaction on the stock exchange\\n * costs a certain commission fee.\\n *\\n * If the purchase is successful, this function will return the stock price at which each\\n * share was purchased. Otherwise, it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to short. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was purchased, otherwise 0 if the shares weren't purchased.\\n */\\n buyShort(sym: string, shares: number): number;\\n\\n /**\\n * Sell short stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Attempts to sell a short position of a stock using a Market Order.\\n *\\n * The ability to short a stock is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * If the specified number of shares exceeds the amount that the player actually owns,\\n * then this function will sell all owned shares. Remember that every transaction on\\n * the stock exchange costs a certain commission fee.\\n *\\n * If the sale is successful, this function will return the stock price at which each\\n * share was sold. Otherwise it will return 0.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares to sell. Must be positive. Will be rounded to nearest integer.\\n * @returns The stock price at which each share was sold, otherwise 0 if the shares weren't sold.\\n */\\n sellShort(sym: string, shares: number): number;\\n\\n /**\\n * Place order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Places an order on the stock market. This function only works for Limit and Stop Orders.\\n *\\n * The ability to place limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * Returns true if the order is successfully placed, and false otherwise.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n * @returns True if the order is successfully placed, and false otherwise.\\n */\\n placeOrder(sym: string, shares: number, price: number, type: string, pos: string): boolean;\\n\\n /**\\n * Cancel order for stocks.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Cancels an oustanding Limit or Stop order on the stock market.\\n *\\n * The ability to use limit and stop orders is **not** immediately available to the player and\\n * must be unlocked later on in the game.\\n *\\n * @param sym - Stock symbol.\\n * @param shares - Number of shares for order. Must be positive. Will be rounded to nearest integer.\\n * @param price - Execution price for the order.\\n * @param type - Type of order.\\n * @param pos - Specifies whether the order is a “Long” or “Short” position.\\n */\\n cancelOrder(sym: string, shares: number, price: number, type: string, pos: string): void;\\n\\n /**\\n * Returns your order book for the stock market.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * This is an object containing information for all the Limit and Stop Orders you have in the stock market.\\n * For each symbol you have a position in, the returned object will have a key with that symbol's name.\\n * The object's properties are each an array of {@link StockOrderObject}\\n * The object has the following structure:\\n *\\n * ```ts\\n * {\\n * string1: [ // Array of orders for this stock\\n * {\\n * shares: Order quantity\\n * price: Order price\\n * type: Order type\\n * position: Either \\\"L\\\" or \\\"S\\\" for Long or Short position\\n * },\\n * {\\n * ...\\n * },\\n * ...\\n * ],\\n * string2: [ // Array of orders for this stock\\n * ...\\n * ],\\n * ...\\n * }\\n * ```\\n * The “Order type” property can have one of the following four values: \\\"Limit Buy Order\\\", \\\"Limit Sell Order\\\", \\\"Stop Buy Order\\\", \\\"Stop Sell Order\\\".\\n * Note that the order book will only contain information for stocks that you actually have orders in.\\n *\\n * @example\\n * ```ts\\n * \\\"If you do not have orders in Nova Medical (NVMD), then the returned object will not have a “NVMD” property.\\\"\\n * {\\n * ECP: [\\n * {\\n * shares: 5,\\n * price: 100,000\\n * type: \\\"Stop Buy Order\\\",\\n * position: \\\"S\\\",\\n * },\\n * {\\n * shares: 25,\\n * price: 125,000\\n * type: \\\"Limit Sell Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * SYSC: [\\n * {\\n * shares: 100,\\n * price: 10,000\\n * type: \\\"Limit Buy Order\\\",\\n * position: \\\"L\\\",\\n * },\\n * ],\\n * }\\n * ```\\n * @returns Object containing information for all the Limit and Stop Orders you have in the stock market.\\n */\\n getOrders(): StockOrder;\\n\\n /**\\n * Returns the volatility of the specified stock.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * Volatility represents the maximum percentage by which a stock’s price can change every tick.\\n * The volatility is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a volatility of 3%, then this function will return 0.03, NOT 3).\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Volatility of the specified stock.\\n */\\n getVolatility(sym: string): number;\\n\\n /**\\n * Returns the probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n * @remarks\\n * RAM cost: 2.5 GB\\n * The probability is returned as a decimal value, NOT a percentage\\n * (e.g. if a stock has a 60% chance of increasing, then this function will return 0.6, NOT 60).\\n *\\n * In other words, if this function returned 0.30 for a stock, then this means that the stock’s price has a\\n * 30% chance of increasing and a 70% chance of decreasing during the next tick.\\n *\\n * In order to use this function, you must first purchase access to the Four Sigma (4S) Market Data TIX API.\\n *\\n * @param sym - Stock symbol.\\n * @returns Probability that the specified stock’s price will increase (as opposed to decrease) during the next tick.\\n */\\n getForecast(sym: string): number;\\n\\n /**\\n * Purchase 4S Market Data Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketData(): boolean;\\n\\n /**\\n * Purchase 4S Market Data TIX API Access.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchase4SMarketDataTixApi(): boolean;\\n\\n /**\\n * Purchase WSE Account.\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchaseWseAccount(): boolean;\\n\\n /**\\n * Purchase TIX API Access\\n * @remarks RAM cost: 2.5 GB\\n * @returns True if you successfully purchased it or if you already have access, false otherwise.\\n */\\n purchaseTixApi(): boolean;\\n}\\n\\n/**\\n * Singularity API\\n * @remarks\\n * This API requires Source-File 4 to use. The RAM cost of all these functions is multiplied by 16/4/1 based on Source-File 4 levels.\\n * @public\\n */\\nexport interface Singularity {\\n /**\\n * Take university class.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start taking a course at a university.\\n * If you are already in the middle of some “working” action (such as working at a\\n * company, for a faction, or on a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these universities and classes are the same as\\n * if you were to manually visit and take these classes.\\n *\\n * @param universityName - Name of university. You must be in the correct city for whatever university you specify.\\n * @param courseName - Name of course.\\n * @param focus - Acquire player focus on this class. Optional. Defaults to true.\\n * @returns True if action is successfully started, false otherwise.\\n */\\n universityCourse(universityName: string, courseName: string, focus?: boolean): boolean;\\n\\n /**\\n * Workout at the gym.\\n *\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n\\n * This function will automatically set you to start working out at a gym to train\\n * a particular stat. If you are already in the middle of some “working” action\\n * (such as working at a company, for a faction, or on a program), then running\\n * this function will automatically cancel that action and give you your earnings.\\n *\\n * The cost and experience gains for all of these gyms are the same as if you were\\n * to manually visit these gyms and train\\n *\\n * @param gymName - Name of gym. You must be in the correct city for whatever gym you specify.\\n * @param stat - The stat you want to train.\\n * @param focus - Acquire player focus on this gym workout. Optional. Defaults to true.\\n * @returns True if actions is successfully started, false otherwise.\\n */\\n gymWorkout(gymName: string, stat: string, focus?: boolean): boolean;\\n\\n /**\\n * Travel to another city.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows the player to travel to any city. The cost for using this\\n * function is the same as the cost for traveling through the Travel Agency.\\n *\\n * @param city - City to travel to.\\n * @returns True if action is successful, false otherwise.\\n */\\n travelToCity(city: string): boolean;\\n\\n /**\\n * Purchase the TOR router.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase a TOR router. The cost for\\n * purchasing a TOR router using this function is the same as if you were to\\n * manually purchase one.\\n *\\n * @returns True if actions is successful or you already own TOR router, false otherwise.\\n */\\n purchaseTor(): boolean;\\n\\n /**\\n * Purchase a program from the dark web.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * This function allows you to automatically purchase programs. You MUST have a\\n * TOR router in order to use this function. The cost of purchasing programs\\n * using this function is the same as if you were purchasing them through the Dark\\n * Web using the Terminal buy command.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.purchaseProgram(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to purchase.\\n * @returns True if the specified program is purchased, and false otherwise.\\n */\\n purchaseProgram(programName: string): boolean;\\n\\n /**\\n * Check if the player is busy.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * Returns a boolean indicating whether or not the player is currently performing an\\n * ‘action’. These actions include working for a company/faction, studying at a university,\\n * working out at a gym, creating a program, committing a crime, or carrying out a Hacking Mission.\\n *\\n * @returns True if the player is currently performing an ‘action’, false otherwise.\\n */\\n isBusy(): boolean;\\n\\n /**\\n * Stop the current action.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function is used to end whatever ‘action’ the player is currently performing.\\n * The player will receive whatever money/experience/etc. he has earned from that action.\\n *\\n * The actions that can be stopped with this function are:\\n *\\n * * Studying at a university\\n * * Working out at a gym\\n * * Working for a company/faction\\n * * Creating a program\\n * * Committing a crime\\n *\\n * This function will return true if the player’s action was ended.\\n * It will return false if the player was not performing an action when this function was called.\\n *\\n * @returns True if the player’s action was ended, false if the player was not performing an action.\\n */\\n stopAction(): boolean;\\n\\n /**\\n * Upgrade home computer RAM.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of RAM on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer RAM is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeRam(): boolean;\\n\\n /**\\n * Upgrade home computer cores.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will upgrade amount of cores on the player’s home computer. The cost is\\n * the same as if you were to do it manually.\\n *\\n * This function will return true if the player’s home computer cores is successfully upgraded, and false otherwise.\\n *\\n * @returns True if the player’s home computer cores is successfully upgraded, and false otherwise.\\n */\\n upgradeHomeCores(): boolean;\\n\\n /**\\n * Get the price of upgrading home RAM.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer RAM.\\n *\\n * @returns Cost of upgrading the player’s home computer RAM.\\n */\\n getUpgradeHomeRamCost(): number;\\n\\n /**\\n * Get the price of upgrading home cores.\\n * @remarks\\n * RAM cost: 1.5 GB * 16/4/1\\n *\\n *\\n * Returns the cost of upgrading the player’s home computer cores.\\n *\\n * @returns Cost of upgrading the player’s home computer cores.\\n */\\n getUpgradeHomeCoresCost(): number;\\n\\n /**\\n * Work for a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working at the company\\n * at which you are employed. If you are already in the middle of some “working”\\n * action (such as working for a faction, training at a gym, or creating a program),\\n * then running this function will automatically cancel that action and give you\\n * your earnings.\\n *\\n * This function will return true if the player starts working, and false otherwise.\\n *\\n * Note that when you are working for a company, you will not actually receive your earnings (reputation, money, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getCompanyRep(COMPANY HERE) < VALUE) {\\n * workForCompany();\\n * sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 company reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getCompanyRep(COMPANY HERE) < VALUE) {\\n * ns.workForCompany();\\n * await ns.sleep(60000);\\n * }\\n * //This way, your company reputation will be updated every minute.\\n * ```\\n * @param companyName - Name of company to work for. Must be an exact match. Optional. If not specified, this argument defaults to the last job that you worked\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForCompany(companyName: string, focus?: boolean): boolean;\\n\\n /**\\n * Quit jobs by company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will finish work with the company provided and quit any jobs.\\n *\\n * @param companyName - Name of the company.\\n */\\n quitJob(companyName?: string): void;\\n\\n /**\\n * Apply for a job at a company.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically try to apply to the specified company\\n * for a position in the specified field. This function can also be used to\\n * apply for promotions by specifying the company and field you are already\\n * employed at.\\n *\\n * This function will return true if you successfully get a job/promotion,\\n * and false otherwise. Note that if you are trying to use this function to\\n * apply for a promotion and you don’t get one, it will return false.\\n *\\n * @param companyName - Name of company to apply to.\\n * @param field - Field to which you want to apply.\\n * @returns True if the player successfully get a job/promotion, and false otherwise.\\n */\\n applyToCompany(companyName: string, field: string): boolean;\\n\\n /**\\n * Get company reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of reputation you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of reputation you have at the specified company.\\n */\\n getCompanyRep(companyName: string): number;\\n\\n /**\\n * Get company favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you have at the specified company.\\n * If the company passed in as an argument is invalid, -1 will be returned.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you have at the specified company.\\n */\\n getCompanyFavor(companyName: string): number;\\n\\n /**\\n * Get company favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function will return the amount of favor you will gain for the specified\\n * company when you reset by installing Augmentations.\\n *\\n * @param companyName - Name of the company.\\n * @returns Amount of favor you gain at the specified company when you reset by installing Augmentations.\\n */\\n getCompanyFavorGain(companyName: string): number;\\n\\n /**\\n * List all current faction invitations.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * Returns an array with the name of all Factions you currently have oustanding invitations from.\\n *\\n * @returns Array with the name of all Factions you currently have oustanding invitations from.\\n */\\n checkFactionInvitations(): string[];\\n\\n /**\\n * Join a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically accept an invitation from a faction and join it.\\n *\\n * @param faction - Name of faction to join.\\n * @returns True if player joined the faction, and false otherwise.\\n */\\n joinFaction(faction: string): boolean;\\n\\n /**\\n * Work for a faction.\\n * @remarks\\n * RAM cost: 3 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working for the specified faction.\\n * Obviously, you must be a member of the faction or else this function will fail. If\\n * you are already in the middle of some “working” action (such as working for a company,\\n * training at a gym, or creating a program), then running this function will automatically\\n * cancel that action and give you your earnings.\\n *\\n * This function will return true if you successfully start working for the specified faction, and false otherwise.\\n *\\n * Note that when you are working for a faction, you will not actually receive your earnings (reputation, experience) until you FINISH the action.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (getFactionRep(FACTION NAME) < VALUE) {\\n * workForFaction(FACNAME, WORKTYPE);\\n * sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //If you only want to work until you get 100,000 faction reputation. One small hack to get around this is to continuously restart the action to receive your earnings:\\n * while (ns.getFactionRep(FACTION NAME) < VALUE) {\\n * ns.workForFaction(FACNAME, WORKTYPE);\\n * await ns.sleep(60000);\\n * }\\n * //This way, your faction reputation will be updated every minute.\\n * ```\\n * @param faction - Name of faction to work for.\\n * @param workType - Type of work to perform for the faction.\\n * @param focus - Acquire player focus on this work operation. Optional. Defaults to true.\\n * @returns True if the player starts working, and false otherwise.\\n */\\n workForFaction(faction: string, workType: string, focus?: boolean): boolean;\\n\\n /**\\n * Get faction reputation.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of reputation you have for the specified faction.\\n *\\n * @param faction - Name of faction to work for.\\n * @returns Amount of reputation you have for the specified faction.\\n */\\n getFactionRep(faction: string): number;\\n\\n /**\\n * Get faction favor.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you have for the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you have for the specified faction.\\n */\\n getFactionFavor(faction: string): number;\\n\\n /**\\n * Get faction favor gain.\\n * @remarks\\n * RAM cost: 0.75 GB * 16/4/1\\n *\\n *\\n * This function returns the amount of favor you will gain for the specified\\n * faction when you reset by installing Augmentations.\\n *\\n * @param faction - Name of faction.\\n * @returns Amount of favor you will gain for the specified faction when you reset by installing Augmentations.\\n */\\n getFactionFavorGain(faction: string): number;\\n\\n /**\\n * Donate to a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Attempts to donate money to the specified faction in exchange for reputation.\\n * Returns true if you successfully donate the money, and false otherwise.\\n *\\n * @param faction - Name of faction to donate to.\\n * @param amount - Amount of money to donate.\\n * @returns True if the money was donated, and false otherwise.\\n */\\n donateToFaction(faction: string, amount: number): boolean;\\n\\n /**\\n * Create a program.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically set you to start working on creating the\\n * specified program. If you are already in the middle of some “working” action\\n * (such as working for a company, training at a gym, or taking a course), then\\n * running this function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns true if you successfully start working on the specified program, and false otherwise.\\n *\\n * Note that creating a program using this function has the same hacking level requirements as it normally would. These level requirements are:\\n * * BruteSSH.exe: 50\\n * * FTPCrack.exe: 100\\n * * relaySMTP.exe: 250\\n * * HTTPWorm.exe: 500\\n * * SQLInject.exe: 750\\n * * DeepscanV1.exe: 75\\n * * DeepscanV2.exe: 400\\n * * ServerProfiler.exe: 75\\n * * AutoLink.exe: 25\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * createProgram(“relaysmtp.exe”);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.createProgram(“relaysmtp.exe”);\\n * ```\\n * @param program - Name of program to create.\\n * @param focus - Acquire player focus on this program creation. Optional. Defaults to true.\\n * @returns True if you successfully start working on the specified program, and false otherwise.\\n */\\n createProgram(program: string, focus?: boolean): boolean;\\n\\n /**\\n * Commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function is used to automatically attempt to commit crimes.\\n * If you are already in the middle of some ‘working’ action (such\\n * as working for a company or training at a gym), then running this\\n * function will automatically cancel that action and give you your\\n * earnings.\\n *\\n * This function returns the number of milliseconds it takes to attempt the\\n * specified crime (e.g It takes 60 seconds to attempt the ‘Rob Store’ crime,\\n * so running `commitCrime('rob store')` will return 60,000).\\n *\\n * Warning: I do not recommend using the time returned from this function to try\\n * and schedule your crime attempts. Instead, I would use the isBusy Singularity\\n * function to check whether you have finished attempting a crime. This is because\\n * although the game sets a certain crime to be X amount of seconds, there is no\\n * guarantee that your browser will follow that time limit.\\n *\\n * @param crime - Name of crime to attempt.\\n * @param focus - Acquire player focus on this program creation. Optional. Defaults to true.\\n * @returns The number of milliseconds it takes to attempt the specified crime.\\n */\\n commitCrime(crime: string, focus?: boolean): number;\\n\\n /**\\n * Get chance to successfully commit a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns your chance of success at commiting the specified crime.\\n *\\n * @param crime - Name of crime.\\n * @returns Chance of success at commiting the specified crime.\\n */\\n getCrimeChance(crime: string): number;\\n\\n /**\\n * Get stats related to a crime.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns the stats of the crime.\\n *\\n * @param crime - Name of crime. Not case-sensitive\\n * @returns The stats of the crime.\\n */\\n getCrimeStats(crime: string): CrimeStats;\\n\\n /**\\n * Get a list of owned augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array containing the names (as strings) of all Augmentations you have.\\n *\\n * @param purchased - Specifies whether the returned array should include Augmentations you have purchased but not yet installed. By default, this argument is false which means that the return value will NOT have the purchased Augmentations.\\n * @returns Array containing the names (as strings) of all Augmentations you have.\\n */\\n getOwnedAugmentations(purchased?: boolean): string[];\\n\\n /**\\n * Get a list of acquired Source-Files.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns an array of source files\\n *\\n * @returns Array containing an object with number and level of the source file.\\n */\\n getOwnedSourceFiles(): SourceFileLvl[];\\n\\n /**\\n * Get a list of augmentation available from a faction.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Returns an array containing the names (as strings) of all Augmentations\\n * that are available from the specified faction.\\n *\\n * @param faction - Name of faction.\\n * @returns Array containing the names of all Augmentations.\\n */\\n getAugmentationsFromFaction(faction: string): string[];\\n\\n /**\\n * Get the pre-requisite of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n * If there are no prerequisites, a blank array is returned.\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with the names of the prerequisite Augmentation(s) for the specified Augmentation.\\n */\\n getAugmentationPrereq(augName: string): string[];\\n\\n /**\\n * Get the price and reputation of an augmentation.\\n * @deprecated use getAugmentationPrice getAugmentationRepCost\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns an array with two elements that gives the cost for\\n * the specified Augmentation. The first element in the returned array is the\\n * reputation requirement of the Augmentation, and the second element is the\\n * money cost.\\n *\\n * If an invalid Augmentation name is passed in for the augName argument, this\\n * function will return the array [-1, -1].\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Array with first element as a reputation requirement and second element as the money cost.\\n */\\n getAugmentationCost(augName: string): [number, number];\\n\\n /**\\n * Get price of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Price of the augmentation.\\n */\\n getAugmentationPrice(augName: string): number;\\n\\n /**\\n * Get base price of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Base price of the augmentation, before price multiplier.\\n */\\n getAugmentationBasePrice(augName: string): number;\\n\\n /**\\n * Get reputation requirement of an augmentation.\\n * @remarks\\n * RAM cost: 2.5 GB * 16/4/1\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Reputation requirement of the augmentation.\\n */\\n getAugmentationRepReq(augName: string): number;\\n\\n /**\\n * Purchase an augmentation\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will try to purchase the specified Augmentation through the given Faction.\\n *\\n * This function will return true if the Augmentation is successfully purchased, and false otherwise.\\n *\\n * @param faction - Name of faction to purchase Augmentation from.\\n * @param augmentation - Name of Augmentation to purchase.\\n * @returns True if the Augmentation is successfully purchased, and false otherwise.\\n */\\n purchaseAugmentation(faction: string, augmentation: string): boolean;\\n\\n /**\\n * Get the stats of an augmentation.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function returns augmentation stats.\\n *\\n * @param name - Name of Augmentation. CASE-SENSITIVE.\\n * @returns Augmentation stats.\\n */\\n getAugmentationStats(name: string): AugmentationStats;\\n\\n /**\\n * Install your purchased augmentations.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will automatically install your Augmentations, resetting the game as usual. If you do not own uninstalled Augmentations then the game will not reset.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n installAugmentations(cbScript?: string): void;\\n\\n /**\\n * Hospitalize the player.\\n * @remarks\\n * RAM cost: 0.25 GB * 16/4/1\\n */\\n hospitalize(): void;\\n\\n /**\\n * Soft reset the game.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * This function will perform a reset even if you don’t have any augmentation installed.\\n *\\n * @param cbScript - This is a script that will automatically be run after Augmentations are installed (after the reset). This script will be run with no arguments and 1 thread. It must be located on your home computer.\\n */\\n softReset(cbScript: string): void;\\n\\n /**\\n * Go to a location.\\n * @remarks\\n * RAM cost: 5 GB * 16/4/1\\n *\\n *\\n * Move the player to a specific location.\\n *\\n * @param locationName - Name of the location.\\n * @returns True if the player was moved there, false otherwise.\\n */\\n goToLocation(locationName: string): boolean;\\n\\n /**\\n * Get the current server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Name of the current server.\\n */\\n getCurrentServer(): string;\\n\\n /**\\n * Connect to a server.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * Run the connect HOSTNAME command in the terminal. Can only connect to neighbors.\\n *\\n * @returns True if the connect command was successful, false otherwise.\\n */\\n connect(hostname: string): boolean;\\n\\n /**\\n * Run the hack command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Amount of money stolen by manual hacking.\\n */\\n manualHack(): Promise;\\n\\n /**\\n * Run the backdoor command in the terminal.\\n * @remarks\\n * RAM cost: 2 GB * 16/4/1\\n *\\n *\\n * @returns Promise waiting for the installation to finish.\\n */\\n installBackdoor(): Promise;\\n\\n /**\\n * Check if the player is focused.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n *\\n * @returns True if the player is focused.\\n */\\n isFocused(): boolean;\\n\\n /**\\n * Set the players focus.\\n * @remarks\\n * RAM cost: 0.1 GB * 16/4/1\\n *\\n * @returns True if the focus was changed.\\n */\\n setFocus(focus: boolean): boolean;\\n\\n /**\\n * Get a list of programs offered on the dark web.\\n * @remarks\\n * RAM cost: 1 GB * 16/4/1\\n *\\n *\\n * This function allows the player to get a list of programs available for purchase\\n * on the dark web. Players MUST have purchased Tor to get the list of programs\\n * available. If Tor has not been purchased yet, this function will return an\\n * empty list.\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebPrograms();\\n * // returns ['BruteSSH.exe', 'FTPCrack.exe'...etc]\\n * ```\\n * @returns - a list of programs available for purchase on the dark web, or [] if Tor has not\\n * been purchased\\n */\\n getDarkwebPrograms(): string[];\\n\\n /**\\n * Check the price of an exploit on the dark web\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n *\\n * This function allows you to check the price of a darkweb exploit/program.\\n * You MUST have a TOR router in order to use this function. The price returned\\n * by this function is the same price you would see with buy -l from the terminal.\\n * Returns the cost of the program if it has not been purchased yet, 0 if it\\n * has already been purchased, or -1 if Tor has not been purchased (and thus\\n * the program/exploit is not available for purchase).\\n *\\n * If the program does not exist, an error is thrown.\\n *\\n *\\n * @example\\n * ```ts\\n * // NS1\\n * getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2\\n * ns.getDarkwebProgramCost(\\\"brutessh.exe\\\");\\n * ```\\n * @param programName - Name of program to check the price of\\n * @returns Price of the specified darkweb program\\n * (if not yet purchased), 0 if it has already been purchased, or -1 if Tor has not been\\n * purchased. Throws an error if the specified program/exploit does not exist\\n */\\n getDarkwebProgramCost(programName: string): number;\\n\\n /**\\n * b1t_flum3 into a different BN.\\n * @remarks\\n * RAM cost: 16 GB * 16/4/1\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n b1tflum3(nextBN: number, callbackScript?: string): void;\\n\\n /**\\n * Destroy the w0r1d_d43m0n and move on to the next BN.\\n * @remarks\\n * RAM cost: 32 GB * 16/4/1\\n *\\n * You must have the special augment installed and the required hacking level\\n * OR\\n * Completed the final black op.\\n *\\n * @param nextBN - BN number to jump to\\n * @param callbackScript - Name of the script to launch in the next BN.\\n */\\n destroyW0r1dD43m0n(nextBN: number, callbackScript?: string): void;\\n\\n /**\\n * Get the current work the player is doing.\\n * @remarks\\n * RAM cost: 0.5 GB * 16/4/1\\n *\\n * @returns - An object representing the current work. Fields depend on the kind of work.\\n */\\n getCurrentWork(): any | null;\\n}\\n\\n/**\\n * Hacknet API\\n * @remarks\\n * Not all these functions are immediately available.\\n * @public\\n */\\nexport interface Hacknet {\\n /**\\n * Get the number of hacknet nodes you own.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the number of Hacknet Nodes you own.\\n *\\n * @returns Number of hacknet nodes.\\n */\\n numNodes(): number;\\n\\n /**\\n * Get the maximum number of hacknet nodes.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns Maximum number of hacknet nodes.\\n */\\n maxNumNodes(): number;\\n\\n /**\\n * Purchase a new hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Purchases a new Hacknet Node. Returns a number with the index of the\\n * Hacknet Node. This index is equivalent to the number at the end of\\n * the Hacknet Node’s name (e.g The Hacknet Node named `hacknet-node-4`\\n * will have an index of 4).\\n *\\n * If the player cannot afford to purchase a new Hacknet Node then the function will return -1.\\n *\\n * @returns The index of the Hacknet Node or if the player cannot afford to purchase a new Hacknet Node the function will return -1.\\n */\\n purchaseNode(): number;\\n\\n /**\\n * Get the price of the next hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of purchasing a new Hacknet Node.\\n *\\n * @returns Cost of purchasing a new Hacknet Node.\\n */\\n getPurchaseNodeCost(): number;\\n\\n /**\\n * Get the stats of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns an object containing a variety of stats about the specified Hacknet Node.\\n *\\n * Note that for Hacknet Nodes, production refers to the amount of money the node generates.\\n * For Hacknet Servers (the upgraded version of Hacknet Nodes), production refers to the\\n * amount of hashes the node generates.\\n *\\n * @param index - Index/Identifier of Hacknet Node\\n * @returns Object containing a variety of stats about the specified Hacknet Node.\\n */\\n getNodeStats(index: number): NodeStats;\\n\\n /**\\n * Upgrade the level of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the level of the specified Hacknet Node by n.\\n *\\n * Returns true if the Hacknet Node’s level is successfully upgraded by n\\n * or if it is upgraded by some positive amount and the Node reaches its max level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s level is successfully upgraded, false otherwise.\\n */\\n upgradeLevel(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the RAM of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to upgrade the specified Hacknet Node’s RAM n times.\\n * Note that each upgrade doubles the Node’s RAM.\\n * So this is equivalent to multiplying the Node’s RAM by 2 n.\\n *\\n * Returns true if the Hacknet Node’s RAM is successfully upgraded n times\\n * or if it is upgraded some positive number of times and the Node reaches its max RAM.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s RAM is successfully upgraded, false otherwise.\\n */\\n upgradeRam(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the core of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Tries to purchase n cores for the specified Hacknet Node.\\n *\\n * Returns true if it successfully purchases n cores for the Hacknet Node\\n * or if it purchases some positive amount and the Node reaches its max number of cores.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cores to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cores are successfully purchased, false otherwise.\\n */\\n upgradeCore(index: number, n: number): boolean;\\n\\n /**\\n * Upgrade the cache of a hacknet node.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Tries to upgrade the specified Hacknet Server’s cache n times.\\n *\\n * Returns true if it successfully upgrades the Server’s cache n times,\\n * or if it purchases some positive amount and the Server reaches its max cache level.\\n *\\n * Returns false otherwise.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of cache levels to purchase. Must be positive. Rounded to nearest integer.\\n * @returns True if the Hacknet Node’s cache level is successfully upgraded, false otherwise.\\n */\\n upgradeCache(index: number, n: number): boolean;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node levels.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the specified Hacknet Node by n levels.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of levels to upgrade. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node.\\n */\\n getLevelUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node RAM.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the RAM of the specified Hacknet Node n times.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node already has max RAM, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade RAM. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's RAM.\\n */\\n getRamUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cores.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the cost of upgrading the number of cores of the specified Hacknet Node by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cores. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's number of cores.\\n */\\n getCoreUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Calculate the cost of upgrading hacknet node cache.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the cost of upgrading the cache level of the specified Hacknet Server by n.\\n *\\n * If an invalid value for n is provided, then this function returns 0.\\n * If the specified Hacknet Node is already at max level, then Infinity is returned.\\n *\\n * @param index - Index/Identifier of Hacknet Node.\\n * @param n - Number of times to upgrade cache. Must be positive. Rounded to nearest integer.\\n * @returns Cost of upgrading the specified Hacknet Node's cache.\\n */\\n getCacheUpgradeCost(index: number, n: number): number;\\n\\n /**\\n * Get the total number of hashes stored.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you have.\\n *\\n * @returns Number of hashes you have.\\n */\\n numHashes(): number;\\n\\n /**\\n * Get the maximum number of hashes you can store.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes you can store.\\n *\\n * @returns Number of hashes you can store.\\n */\\n hashCapacity(): number;\\n\\n /**\\n * Get the cost of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the number of hashes required for the specified upgrade. The name of the upgrade must be an exact match.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {\\n * hacknet.spendHashes(upgradeName);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgradeName = \\\"Sell for Corporation Funds\\\";\\n * if (ns.hacknet.numHashes() > ns.hacknet.hashCost(upgradeName)) {\\n * ns.hacknet.spendHashes(upgradeName);\\n * }\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.\\n * @returns Number of hashes required for the specified upgrade.\\n */\\n hashCost(upgName: string, count?: number): number;\\n\\n /**\\n * Purchase a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Spend the hashes generated by your Hacknet Servers on an upgrade.\\n * Returns a boolean value - true if the upgrade is successfully purchased, and false otherwise.\\n *\\n * The name of the upgrade must be an exact match.\\n * The `upgTarget` argument is used for upgrades such as `Reduce Minimum Security`, which applies to a specific server.\\n * In this case, the `upgTarget` argument must be the hostname of the server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * NS2:\\n * ns.hacknet.spendHashes(\\\"Sell for Corporation Funds\\\");\\n * ns.hacknet.spendHashes(\\\"Increase Maximum Money\\\", \\\"foodnstuff\\\");\\n * ```\\n * @param upgName - Name of the upgrade of Hacknet Node.\\n * @param upgTarget - Object to which upgrade applies. Required for certain upgrades.\\n * @param count - Number of upgrades to buy at once. Defaults to 1 if not specified.\\n * For compatability reasons, upgTarget must be specified, even if it is not used, in order to specify count.\\n * @returns True if the upgrade is successfully purchased, and false otherwise.\\n */\\n spendHashes(upgName: string, upgTarget?: string, count?: number): boolean;\\n\\n /**\\n * Get the list of hash upgrades\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * Returns the list of all available hash upgrades that can be used in the spendHashes function.\\n * @example\\n * ```ts\\n * // NS1:\\n * var upgrades = hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const upgrades = ns.hacknet.getHashUpgrades(); // [\\\"Sell for Money\\\",\\\"Sell for Corporation Funds\\\",...]\\n * ```\\n * @returns An array containing the available upgrades\\n */\\n getHashUpgrades(): string[];\\n\\n /**\\n * Get the level of a hash upgrade.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Level of the upgrade.\\n */\\n getHashUpgradeLevel(upgName: string): number;\\n\\n /**\\n * Get the multiplier to study.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getStudyMult(): number;\\n\\n /**\\n * Get the multiplier to training.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).\\n *\\n * @returns Multiplier.\\n */\\n getTrainingMult(): number;\\n}\\n\\n/**\\n * Bladeburner API\\n * @remarks\\n * You have to be employed in the Bladeburner division and be in BitNode-7\\n * or have Source-File 7 in order to use this API.\\n * @public\\n */\\nexport interface Bladeburner {\\n /**\\n * List all contracts.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner contracts.\\n *\\n * @returns Array of strings containing the names of all Bladeburner contracts.\\n */\\n getContractNames(): string[];\\n\\n /**\\n * List all operations.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner operations.\\n *\\n * @returns Array of strings containing the names of all Bladeburner operations.\\n */\\n getOperationNames(): string[];\\n\\n /**\\n * List all black ops.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all Bladeburner Black Ops.\\n *\\n * @returns Array of strings containing the names of all Bladeburner Black Ops.\\n */\\n getBlackOpNames(): string[];\\n\\n /**\\n * List all general actions.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner actions.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner actions.\\n */\\n getGeneralActionNames(): string[];\\n\\n /**\\n * List all skills.\\n * @remarks\\n * RAM cost: 0.4 GB\\n *\\n * Returns an array of strings containing the names of all general Bladeburner skills.\\n *\\n * @returns Array of strings containing the names of all general Bladeburner skills.\\n */\\n getSkillNames(): string[];\\n\\n /**\\n * Start an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to start the specified Bladeburner action.\\n * Returns true if the action was started successfully, and false otherwise.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match\\n * @returns True if the action was started successfully, and false otherwise.\\n */\\n startAction(type: string, name: string): boolean;\\n\\n /**\\n * Stop current action.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Stops the current Bladeburner action.\\n *\\n */\\n stopBladeburnerAction(): void;\\n\\n /**\\n * Get current action.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns an object that represents the player’s current Bladeburner action.\\n * If the player is not performing an action, the function will return an object with the ‘type’ property set to “Idle”.\\n *\\n * @returns Object that represents the player’s current Bladeburner action.\\n */\\n getCurrentAction(): BladeburnerCurAction;\\n\\n /**\\n * Get the time to complete an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of milliseconds it takes to complete the specified action\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of milliseconds it takes to complete the specified action.\\n */\\n getActionTime(type: string, name: string): number;\\n\\n /**\\n * Get the time elapsed on current action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of milliseconds already spent on the current action.\\n *\\n * @returns Number of milliseconds already spent on the current action.\\n */\\n getActionCurrentTime(): number;\\n\\n /**\\n * Get estimate success chance of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated success chance for the specified action.\\n * This chance is returned as a decimal value, NOT a percentage\\n * (e.g. if you have an estimated success chance of 80%, then this function will return 0.80, NOT 80).\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Estimated success chance for the specified action.\\n */\\n getActionEstimatedSuccessChance(type: string, name: string): [number, number];\\n\\n /**\\n * Get the reputation gain of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the average Bladeburner reputation gain for successfully\\n * completing the specified action.\\n * Note that this value is an ‘average’ and the real reputation gain may vary slightly from this value.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Optional action level at which to calculate the gain\\n * @returns Average Bladeburner reputation gain for successfully completing the specified action.\\n */\\n getActionRepGain(type: string, name: string, level: number): number;\\n\\n /**\\n * Get action count remaining.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the remaining count of the specified action.\\n *\\n * Note that this is meant to be used for Contracts and Operations.\\n * This function will return ‘Infinity’ for actions such as Training and Field Analysis.\\n * This function will return 1 for BlackOps not yet completed regardless of whether\\n * the player has the required rank to attempt the mission or not.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Remaining count of the specified action.\\n */\\n getActionCountRemaining(type: string, name: string): number;\\n\\n /**\\n * Get the maximum level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the maximum level for this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Maximum level of the specified action.\\n */\\n getActionMaxLevel(type: string, name: string): number;\\n\\n /**\\n * Get the current level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the current level of this action.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Current level of the specified action.\\n */\\n getActionCurrentLevel(type: string, name: string): number;\\n\\n /**\\n * Get whether an action is set to autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action is currently set to autolevel.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns True if the action is set to autolevel, and false otherwise.\\n */\\n getActionAutolevel(type: string, name: string): boolean;\\n\\n /**\\n * Set an action autolevel.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Enable/disable autoleveling for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param autoLevel - Whether or not to autolevel this action\\n */\\n setActionAutolevel(type: string, name: string, autoLevel: boolean): void;\\n\\n /**\\n * Set the level of an action.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the level for the specified action.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param level - Level to set this action to.\\n */\\n setActionLevel(type: string, name: string, level: number): void;\\n\\n /**\\n * Get player bladeburner rank.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the player’s Bladeburner Rank.\\n *\\n * @returns Player’s Bladeburner Rank.\\n */\\n getRank(): number;\\n\\n /**\\n * Get black op required rank.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Returns the rank required to complete this BlackOp.\\n *\\n * Returns -1 if an invalid action is specified.\\n *\\n * @param name - Name of BlackOp. Must be an exact match.\\n * @returns Rank required to complete this BlackOp.\\n */\\n getBlackOpRank(name: string): number;\\n\\n /**\\n * Get bladeburner skill points.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner skill points you have.\\n *\\n * @returns Number of Bladeburner skill points you have.\\n */\\n getSkillPoints(): number;\\n\\n /**\\n * Get skill level.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns your level in the specified skill.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @returns Level in the specified skill.\\n */\\n getSkillLevel(name: string): number;\\n\\n /**\\n * Get cost to upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * This function returns the number of skill points needed to upgrade the specified skill the specified number of times.\\n *\\n * The function returns -1 if an invalid skill name is passed in.\\n *\\n * @param skillName - Name of skill. Case-sensitive and must be an exact match\\n * @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.\\n * @returns Number of skill points needed to upgrade the specified skill.\\n */\\n getSkillUpgradeCost(name: string, count?: number): number;\\n\\n /**\\n * Upgrade skill.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to upgrade the specified Bladeburner skill the specified number of times.\\n *\\n * Returns true if the skill is successfully upgraded, and false otherwise.\\n *\\n * @param skillName - Name of skill to be upgraded. Case-sensitive and must be an exact match\\n * @param count - Number of times to upgrade the skill. Defaults to 1 if not specified.\\n * @returns true if the skill is successfully upgraded, and false otherwise.\\n */\\n upgradeSkill(name: string, count?: number): boolean;\\n\\n /**\\n * Get team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the number of Bladeburner team members you have assigned to the specified action.\\n *\\n * Setting a team is only applicable for Operations and BlackOps. This function will return 0 for other action types.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @returns Number of Bladeburner team members that were assigned to the specified action.\\n */\\n getTeamSize(type: string, name: string): number;\\n\\n /**\\n * Set team size.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Set the team size for the specified Bladeburner action.\\n *\\n * Returns the team size that was set, or -1 if the function failed.\\n *\\n * @param type - Type of action.\\n * @param name - Name of action. Must be an exact match.\\n * @param size - Number of team members to set. Will be converted using Math.round().\\n * @returns Number of Bladeburner team members you assigned to the specified action.\\n */\\n setTeamSize(type: string, name: string, size: number): number;\\n\\n /**\\n * Get estimated population in city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoids in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Estimated number of Synthoids in the specified city.\\n */\\n getCityEstimatedPopulation(name: string): number;\\n\\n /**\\n * Get number of communities in a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the estimated number of Synthoid communities in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Number of Synthoids communities in the specified city.\\n */\\n getCityCommunities(name: string): number;\\n\\n /**\\n * Get chaos of a city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chaos in the specified city,\\n * or -1 if an invalid city was specified.\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns Chaos in the specified city.\\n */\\n getCityChaos(name: string): number;\\n\\n /**\\n * Get current city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the city that the player is currently in (for Bladeburner).\\n *\\n * @returns City that the player is currently in (for Bladeburner).\\n */\\n getCity(): string;\\n\\n /**\\n * Travel to another city in bladeburner.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to switch to the specified city (for Bladeburner only).\\n *\\n * Returns true if successful, and false otherwise\\n *\\n * @param cityName - Name of city. Case-sensitive\\n * @returns true if successful, and false otherwise\\n */\\n switchCity(name: string): boolean;\\n\\n /**\\n * Get bladeburner stamina.\\n * @remarks\\n * RAM cost: 4 GB\\n * Returns an array with two elements:\\n * * [Current stamina, Max stamina]\\n * @example\\n * ```ts\\n * // NS1:\\n * function getStaminaPercentage() {\\n * var res = bladeburner.getStamina();\\n * return res[0] / res[1];\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * function getStaminaPercentage() {\\n * const [current, max] = ns.bladeburner.getStamina();\\n * return current / max;\\n * }\\n * ```\\n * @returns Array containing current stamina and max stamina.\\n */\\n getStamina(): [number, number];\\n\\n /**\\n * Join the bladeburner faction.\\n * @remarks\\n * RAM cost: 4 GB\\n * Attempts to join the Bladeburner faction.\\n *\\n * Returns true if you successfully join the Bladeburner faction, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner faction, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerFaction(): boolean;\\n\\n /**\\n * Join the bladeburner division.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempts to join the Bladeburner division.\\n *\\n * Returns true if you successfully join the Bladeburner division, or if you are already a member.\\n *\\n * Returns false otherwise.\\n *\\n * @returns True if you successfully join the Bladeburner division, or if you are already a member, false otherwise.\\n */\\n joinBladeburnerDivision(): boolean;\\n\\n /**\\n * Get bladeburner bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 5x the normal speed.\\n * For example, if an action takes 30 seconds to complete but you’ve accumulated over\\n * 30 seconds in bonus time, then the action will only take 6 seconds in real life to complete.\\n *\\n * @returns Amount of accumulated “bonus time” (milliseconds) for the Bladeburner mechanic.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Coding Contract API\\n * @public\\n */\\nexport interface CodingContract {\\n /**\\n * Attempts a coding contract.\\n * @remarks\\n * RAM cost: 10 GB\\n *\\n * Attempts to solve the Coding Contract with the provided solution.\\n *\\n * @param answer - Solution for the contract.\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns True if the solution was correct, false otherwise. If the returnReward option is configured, then the function will instead return a string. If the contract is successfully solved, the string will contain a description of the contract’s reward. Otherwise, it will be an empty string.\\n */\\n attempt(\\n answer: string | number | any[],\\n filename: string,\\n host?: string,\\n opts?: CodingAttemptOptions,\\n ): boolean | string;\\n\\n /**\\n * Get the type of a coding contract.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Returns a name describing the type of problem posed by the Coding Contract.\\n * (e.g. Find Largest Prime Factor, Total Ways to Sum, etc.)\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Name describing the type of problem posed by the Coding Contract.\\n */\\n getContractType(filename: string, host?: string): string;\\n\\n /**\\n * Get the description.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the full text description for the problem posed by the Coding Contract.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns Contract’s text description.\\n */\\n getDescription(filename: string, host?: string): string;\\n\\n /**\\n * Get the input data.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Get the data associated with the specific Coding Contract.\\n * Note that this is not the same as the contract’s description.\\n * This is just the data that the contract wants you to act on in order to solve the contract.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Host of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns The specified contract’s data, data type depends on contract type.\\n */\\n getData(filename: string, host?: string): CodingContractData;\\n\\n /**\\n * Get the number of attempts remaining.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the number of tries remaining on the contract before it self-destructs.\\n *\\n * @param filename - Filename of the contract.\\n * @param host - Hostname of the server containing the contract. Optional. Defaults to current server if not provided.\\n * @returns How many attempts are remaining for the contract.\\n */\\n getNumTriesRemaining(filename: string, host?: string): number;\\n}\\n\\n/**\\n * Gang API\\n * @remarks\\n * If you are not in BitNode-2, then you must have Source-File 2 in order to use this API.\\n * @public\\n */\\nexport interface Gang {\\n /**\\n * Create a gang.\\n * @remarks\\n * RAM cost: 1GB\\n *\\n * Create a gang with the specified faction.\\n * @returns True if the gang was created, false otherwise.\\n */\\n createGang(faction: string): boolean;\\n\\n /**\\n * Check if you're in a gang.\\n * @remarks\\n * RAM cost: 1GB\\n * @returns True if you're in a gang, false otherwise.\\n */\\n inGang(): boolean;\\n\\n /**\\n * List all gang members.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the names of all Gang members\\n *\\n * @returns Names of all Gang members.\\n */\\n getMemberNames(): string[];\\n\\n /**\\n * Get information about your gang.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get general information about the gang.\\n *\\n * @returns Object containing general information about the gang.\\n */\\n getGangInformation(): GangGenInfo;\\n\\n /**\\n * Get information about the other gangs.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get territory and power information about all gangs.\\n *\\n * @returns Object containing territory and power information about all gangs.\\n */\\n getOtherGangInformation(): GangOtherInfo;\\n\\n /**\\n * Get information about a specific gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get stat and equipment-related information about a Gang Member\\n *\\n * @param name - Name of member.\\n * @returns Object containing stat and equipment-related information about a Gang Member.\\n */\\n getMemberInformation(name: string): GangMemberInfo;\\n\\n /**\\n * Check if you can recruit a new gang member.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns boolean indicating whether a member can currently be recruited\\n *\\n * @returns True if a member can currently be recruited, false otherwise.\\n */\\n canRecruitMember(): boolean;\\n\\n /**\\n * Recruit a new gang member.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempt to recruit a new gang member.\\n *\\n * Possible reasons for failure:\\n * * Cannot currently recruit a new member\\n * * There already exists a member with the specified name\\n *\\n * @param name - Name of member to recruit.\\n * @returns True if the member was successfully recruited, false otherwise.\\n */\\n recruitMember(name: string): boolean;\\n\\n /**\\n * List member task names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all valid tasks that Gang members can be assigned to.\\n *\\n * @returns All valid tasks that Gang members can be assigned to.\\n */\\n getTaskNames(): string[];\\n\\n /**\\n * Set gang member to task.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Attempts to assign the specified Gang Member to the specified task.\\n * If an invalid task is specified, the Gang member will be set to idle (“Unassigned”).\\n *\\n * @param memberName - Name of Gang member to assign.\\n * @param taskName - Task to assign.\\n * @returns True if the Gang Member was successfully assigned to the task, false otherwise.\\n */\\n setMemberTask(memberName: string, taskName: string): boolean;\\n\\n /**\\n * Get stats of a task.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the stats of a gang task stats. This is typically used to evaluate which action should be executed next.\\n *\\n * @param name - Name of the task.\\n * @returns Detailed stats of a task.\\n */\\n getTaskStats(name: string): GangTaskStats;\\n\\n /**\\n * List equipment names.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Get the name of all possible equipment/upgrades you can purchase for your Gang Members.\\n * This includes Augmentations.\\n *\\n * @returns Names of all Equipments/Augmentations.\\n */\\n getEquipmentNames(): string[];\\n\\n /**\\n * Get cost of equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the amount of money it takes to purchase a piece of Equipment or an Augmentation.\\n * If an invalid Equipment/Augmentation is specified, this function will return Infinity.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Cost to purchase the specified Equipment/Augmentation (number). Infinity for invalid arguments\\n */\\n getEquipmentCost(equipName: string): number;\\n\\n /**\\n * Get type of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment type.\\n *\\n * @param equipName - Name of equipment.\\n * @returns Type of the equipment.\\n */\\n getEquipmentType(equipName: string): string;\\n\\n /**\\n * Get stats of an equipment.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the specified equipment stats.\\n *\\n * @param equipName - Name of equipment.\\n * @returns A dictionary containing the stats of the equipment.\\n */\\n getEquipmentStats(equipName: string): EquipmentStats;\\n\\n /**\\n * Purchase an equipment for a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Attempt to purchase the specified Equipment/Augmentation for the specified Gang member.\\n *\\n * @param memberName - Name of Gang member to purchase the equipment for.\\n * @param equipName - Name of Equipment/Augmentation to purchase.\\n * @returns True if the equipment was successfully purchased. False otherwise\\n */\\n purchaseEquipment(memberName: string, equipName: string): boolean;\\n\\n /**\\n * Ascend a gang member.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Ascend the specified Gang Member.\\n *\\n * @param memberName - Name of member to ascend.\\n * @returns Object with info about the ascension results. undefined if ascension did not occur.\\n */\\n ascendMember(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Get the result of an ascension without ascending.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Get the result of an ascension without ascending.\\n *\\n * @param memberName - Name of member.\\n * @returns Object with info about the ascension results. undefined if ascension is impossible.\\n */\\n getAscensionResult(memberName: string): GangMemberAscension | undefined;\\n\\n /**\\n * Enable/Disable territory warfare.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Set whether or not the gang should engage in territory warfare\\n *\\n * @param engage - Whether or not to engage in territory warfare.\\n */\\n setTerritoryWarfare(engage: boolean): void;\\n\\n /**\\n * Get chance to win clash with other gang.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns the chance you have to win a clash with the specified gang. The chance is returned in decimal form, not percentage\\n *\\n * @param gangName - Target gang\\n * @returns Chance you have to win a clash with the specified gang.\\n */\\n getChanceToWinClash(gangName: string): number;\\n\\n /**\\n * Get bonus time.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns the amount of accumulated “bonus time” (milliseconds) for the Gang mechanic.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster, up to 10x the normal speed.\\n *\\n * @returns Bonus time for the Gang mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * Sleeve API\\n * @remarks\\n * If you are not in BitNode-10, then you must have Source-File 10 in order to use this API.\\n * @public\\n */\\nexport interface Sleeve {\\n /**\\n * Get the number of sleeves you own.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the number of duplicate sleeves the player has.\\n *\\n * @returns number of duplicate sleeves the player has.\\n */\\n getNumSleeves(): number;\\n\\n /**\\n * Get the stats of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a structure containing the stats of the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to get stats of.\\n * @returns Object containing the stats of the sleeve.\\n */\\n getSleeveStats(sleeveNumber: number): SleeveSkills;\\n\\n /**\\n * Get information about a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a struct containing tons of information about this sleeve\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve information.\\n * @returns Object containing tons of information about this sleeve.\\n */\\n getInformation(sleeveNumber: number): SleeveInformation;\\n\\n /**\\n * Get task of a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return the current task that the sleeve is performing. type is set to “Idle” if the sleeve isn’t doing anything.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve task from.\\n * @returns Object containing information the current task that the sleeve is performing.\\n */\\n getTask(sleeveNumber: number): SleeveTask;\\n\\n /**\\n * Set a sleeve to shock recovery.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start recovery.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToShockRecovery(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to synchronize.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start synchronizing.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToSynchronize(sleeveNumber: number): boolean;\\n\\n /**\\n * Set a sleeve to commit crime.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * Returns false if an invalid action is specified.\\n *\\n * @param sleeveNumber - Index of the sleeve to start commiting crime.\\n * @param name - Name of the crime. Must be an exact match.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToCommitCrime(sleeveNumber: number, name: string): boolean;\\n\\n /**\\n * Set a sleeve to work for a faction.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this faction.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the faction.\\n * @param factionName - Name of the faction to work for.\\n * @param factionWorkType - Name of the action to perform for this faction.\\n * @returns True if the sleeve started working on this faction, false otherwise, can also throw on errors\\n */\\n setToFactionWork(sleeveNumber: number, factionName: string, factionWorkType: string): boolean | undefined;\\n\\n /**\\n * Set a sleeve to work for a company.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working or this company.\\n *\\n * @param sleeveNumber - Index of the sleeve to work for the company.\\n * @param companyName - Name of the company to work for.\\n * @returns True if the sleeve started working on this company, false otherwise.\\n */\\n setToCompanyWork(sleeveNumber: number, companyName: string): boolean;\\n\\n /**\\n * Set a sleeve to take a class at a university.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not this action was set successfully.\\n *\\n * @param sleeveNumber - Index of the sleeve to start taking class.\\n * @param university - Name of the university to attend.\\n * @param className - Name of the class to follow.\\n * @returns True if this action was set successfully, false otherwise.\\n */\\n setToUniversityCourse(sleeveNumber: number, university: string, className: string): boolean;\\n\\n /**\\n * Set a sleeve to workout at the gym.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working out.\\n *\\n * @param sleeveNumber - Index of the sleeve to workout at the gym.\\n * @param gymName - Name of the gym.\\n * @param stat - Name of the stat to train.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToGymWorkout(sleeveNumber: number, gymName: string, stat: string): boolean;\\n\\n /**\\n * Make a sleeve travel to another city.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve reached destination.\\n *\\n * @param sleeveNumber - Index of the sleeve to travel.\\n * @param cityName - Name of the destination city.\\n * @returns True if the sleeve reached destination, false otherwise.\\n */\\n travel(sleeveNumber: number, cityName: string): boolean;\\n\\n /**\\n * Get augmentations installed on a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentation names that this sleeve has installed.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve augmentations from.\\n * @returns List of augmentation names that this sleeve has installed.\\n */\\n getSleeveAugmentations(sleeveNumber: number): string[];\\n\\n /**\\n * Get price of an augmentation.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Price of the augmentation.\\n */\\n getSleeveAugmentationPrice(augName: string): number;\\n\\n /**\\n * Get reputation requirement of an augmentation.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n *\\n * @param augName - Name of Augmentation.\\n * @returns Reputation requirement of the augmentation.\\n */\\n getSleeveAugmentationRepReq(augName: string): number;\\n\\n /**\\n * List purchasable augs for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a list of augmentations that the player can buy for this sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to retrieve purchasable augmentations from.\\n * @returns List of augmentations that the player can buy for this sleeve.\\n */\\n getSleevePurchasableAugs(sleeveNumber: number): AugmentPair[];\\n\\n /**\\n * Purchase an aug for a sleeve.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return true if the aug was purchased and installed on the sleeve.\\n *\\n * @param sleeveNumber - Index of the sleeve to buy an aug for.\\n * @param augName - Name of the aug to buy. Must be an exact match.\\n * @returns True if the aug was purchased and installed on the sleeve, false otherwise.\\n */\\n purchaseSleeveAug(sleeveNumber: number, augName: string): boolean;\\n\\n /**\\n * Set a sleeve to perform bladeburner actions.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Return a boolean indicating whether or not the sleeve started working out.\\n *\\n * @param sleeveNumber - Index of the sleeve to workout at the gym.\\n * @param action - Name of the action to be performed.\\n * @param contract - Name of the contract if applicable.\\n * @returns True if the sleeve started working out, false otherwise.\\n */\\n setToBladeburnerAction(sleeveNumber: number, action: string, contract?: string): boolean;\\n}\\n\\n/**\\n * Grafting API\\n * @remarks\\n * This API requires Source-File 10 to use.\\n * @public\\n */\\nexport interface Grafting {\\n /**\\n * Retrieve the grafting cost of an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the price of. Must be an exact match.\\n * @returns The cost required to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftPrice(augName: string): number;\\n\\n /**\\n * Retrieves the time required to graft an aug.\\n * @remarks\\n * RAM cost: 3.75 GB\\n *\\n * @param augName - Name of the aug to check the grafting time of. Must be an exact match.\\n * @returns The time required, in millis, to graft the named augmentation.\\n * @throws Will error if an invalid Augmentation name is provided.\\n */\\n getAugmentationGraftTime(augName: string): number;\\n\\n /**\\n * Retrieves a list of Augmentations that can be grafted.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * Note that this function returns a list of currently graftable Augmentations,\\n * based off of the Augmentations that you already own.\\n *\\n * @returns An array of graftable Augmentations.\\n */\\n getGraftableAugmentations(): string[];\\n\\n /**\\n * Begins grafting the named aug. You must be in New Tokyo to use this.\\n * @remarks\\n * RAM cost: 7.5 GB\\n *\\n * @param augName - The name of the aug to begin grafting. Must be an exact match.\\n * @param focus - Acquire player focus on this Augmentation grafting. Optional. Defaults to true.\\n * @returns True if the aug successfully began grafting, false otherwise (e.g. not enough money, or\\n * invalid Augmentation name provided).\\n * @throws Will error if called while you are not in New Tokyo.\\n */\\n graftAugmentation(augName: string, focus?: boolean): boolean;\\n}\\n\\n/**\\n * Skills formulas\\n * @public\\n */\\ninterface SkillsFormulas {\\n /**\\n * Calculate skill level.\\n * @param exp - experience for that skill\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated skill level.\\n */\\n calculateSkill(exp: number, skillMult?: number): number;\\n /**\\n * Calculate exp for skill level.\\n * @param skill - target skill level\\n * @param skillMult - Multiplier for that skill, defaults to 1.\\n * @returns The calculated exp required.\\n */\\n calculateExp(skill: number, skillMult?: number): number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface WorkStats {\\n money: number;\\n reputation: number;\\n hackExp: number;\\n strExp: number;\\n defExp: number;\\n dexExp: number;\\n agiExp: number;\\n chaExp: number;\\n intExp: number;\\n}\\n\\n/**\\n * Work formulas\\n * @public\\n */\\ninterface WorkFormulas {\\n crimeGains(crimeType: string): WorkStats;\\n classGains(player: Player, classType: string, locationName: string): WorkStats;\\n factionGains(player: Player, workType: string, favor: number): WorkStats;\\n}\\n\\n/**\\n * Reputation formulas\\n * @public\\n */\\ninterface ReputationFormulas {\\n /**\\n * Calculate the total required amount of faction reputation to reach a target favor.\\n * @param favor - target faction favor.\\n * @returns The calculated faction reputation required.\\n */\\n calculateFavorToRep(favor: number): number;\\n /**\\n * Calculate the resulting faction favor of a total amount of reputation.\\n * (Faction favor is gained whenever you install an Augmentation.)\\n * @param rep - amount of reputation.\\n * @returns The calculated faction favor.\\n */\\n calculateRepToFavor(rep: number): number;\\n\\n /**\\n * Calculate how much rep would be gained.\\n * @param amount - Amount of money donated\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n */\\n repFromDonation(amount: number, player: Player): number;\\n}\\n\\n/**\\n * Hacking formulas\\n * @public\\n */\\ninterface HackingFormulas {\\n /**\\n * Calculate hack chance.\\n * (Ex: 0.25 would indicate a 25% chance of success.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack chance.\\n */\\n hackChance(server: Server, player: Player): number;\\n /**\\n * Calculate hack exp for one thread.\\n * @remarks\\n * Multiply by thread to get total exp\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack exp.\\n */\\n hackExp(server: Server, player: Player): number;\\n /**\\n * Calculate hack percent for one thread.\\n * (Ex: 0.25 would steal 25% of the server's current value.)\\n * @remarks\\n * Multiply by thread to get total percent hacked.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack percent.\\n */\\n hackPercent(server: Server, player: Player): number;\\n /**\\n * Calculate the percent a server would grow to.\\n * (Ex: 3.0 would would grow the server to 300% of its current value.)\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param threads - Amount of thread.\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @param cores - Number of cores on the computer that will execute grow.\\n * @returns The calculated grow percent.\\n */\\n growPercent(server: Server, threads: number, player: Player, cores?: number): number;\\n /**\\n * Calculate hack time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated hack time.\\n */\\n hackTime(server: Server, player: Player): number;\\n /**\\n * Calculate grow time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated grow time.\\n */\\n growTime(server: Server, player: Player): number;\\n /**\\n * Calculate weaken time.\\n * @param server - Server info from {@link NS.getServer | getServer}\\n * @param player - Player info from {@link NS.getPlayer | getPlayer}\\n * @returns The calculated weaken time.\\n */\\n weakenTime(server: Server, player: Player): number;\\n}\\n\\n/**\\n * Hacknet Node formulas\\n * @public\\n */\\ninterface HacknetNodesFormulas {\\n /**\\n * Calculate money gain rate.\\n * @param level - level of the node.\\n * @param ram - ram of the node.\\n * @param cores - cores of the node.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated money gain rate.\\n */\\n moneyGainRate(level: number, ram: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet node cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate the cost of a hacknet node.\\n * @param n - number of the hacknet node\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetNodeCost(n: number, mult: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet node constants used by the game.\\n */\\n constants(): HacknetNodeConstants;\\n}\\n\\n/**\\n * Hacknet Server formulas\\n * @public\\n */\\ninterface HacknetServersFormulas {\\n /**\\n * Calculate hash gain rate.\\n * @param level - level of the server.\\n * @param ramUsed - ramUsed of the server.\\n * @param maxRam - maxRam of the server.\\n * @param cores - cores of the server.\\n * @param mult - player production mult (default to 1)\\n * @returns The calculated hash gain rate.\\n */\\n hashGainRate(level: number, ramUsed: number, maxRam: number, cores: number, mult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server level.\\n * @param startingLevel - starting level\\n * @param extraLevels - amount of level to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n levelUpgradeCost(startingLevel: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server ram.\\n * @param startingRam - starting ram\\n * @param extraLevels - amount of level of ram to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n ramUpgradeCost(startingRam: number, extraLevels?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cores.\\n * @param startingCore - starting cores\\n * @param extraCores - amount of cores to purchase (defaults to 1)\\n * @param costMult - player cost reduction (default to 1)\\n * @returns The calculated cost.\\n */\\n coreUpgradeCost(startingCore: number, extraCores?: number, costMult?: number): number;\\n /**\\n * Calculate cost of upgrading hacknet server cache.\\n * @param startingCache - starting cache level\\n * @param extraCache - amount of levels of cache to purchase (defaults to 1)\\n * @returns The calculated cost.\\n */\\n cacheUpgradeCost(startingCache: number, extraCache?: number): number;\\n /**\\n * Calculate hash cost of an upgrade.\\n * @param upgName - name of the upgrade\\n * @param level - level of the upgrade\\n * @returns The calculated hash cost.\\n */\\n hashUpgradeCost(upgName: number, level: number): number;\\n /**\\n * Calculate the cost of a hacknet server.\\n * @param n - number of the hacknet server\\n * @param mult - player cost reduction (defaults to 1)\\n * @returns The calculated cost.\\n */\\n hacknetServerCost(n: number, mult?: number): number;\\n /**\\n * All constants used by the game.\\n * @returns An object with all hacknet server constants used by the game.\\n */\\n constants(): HacknetServerConstants;\\n}\\n\\n/**\\n * Gang formulas\\n * @public\\n */\\ninterface GangFormulas {\\n /**\\n * Calculate the wanted penalty.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @returns The calculated wanted penalty.\\n */\\n wantedPenalty(gang: GangGenInfo): number;\\n /**\\n * Calculate respect gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Gang info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Gang info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated respect gain.\\n */\\n respectGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate wanted gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated wanted gain.\\n */\\n wantedLevelGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n /**\\n * Calculate money gain per tick.\\n * @param gang - Gang info from {@link Gang.getGangInformation | getGangInformation}\\n * @param member - Member info from {@link Gang.getMemberInformation | getMemberInformation}\\n * @param task - Task info from {@link Gang.getTaskStats | getTaskStats}\\n * @returns The calculated money gain.\\n */\\n moneyGain(gang: GangGenInfo, member: GangMemberInfo, task: GangTaskStats): number;\\n\\n /**\\n * Calculate ascension point gain.\\n * @param exp - Experience point before ascension.\\n * @returns The calculated ascension point gain.\\n */\\n ascensionPointsGain(exp: number): number;\\n\\n /**\\n * Calculate ascension mult.\\n * @param points - Amount of ascension points.\\n * @returns The calculated ascension mult.\\n */\\n ascensionMultiplier(points: number): number;\\n}\\n\\n/**\\n * Formulas API\\n * @remarks\\n * You need Formulas.exe on your home computer to use this API.\\n * @public\\n */\\nexport interface Formulas {\\n mockServer(): Server;\\n mockPlayer(): Player;\\n /** Reputation formulas */\\n reputation: ReputationFormulas;\\n /** Skills formulas */\\n skills: SkillsFormulas;\\n /** Hacking formulas */\\n hacking: HackingFormulas;\\n /** Hacknet Nodes formulas */\\n hacknetNodes: HacknetNodesFormulas;\\n /** Hacknet Servers formulas */\\n hacknetServers: HacknetServersFormulas;\\n /** Gang formulas */\\n gang: GangFormulas;\\n /** Work formulas */\\n work: WorkFormulas;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface Fragment {\\n id: number;\\n shape: boolean[][];\\n type: number;\\n power: number;\\n limit: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface ActiveFragment {\\n id: number;\\n highestCharge: number;\\n numCharge: number;\\n rotation: number;\\n x: number;\\n y: number;\\n}\\n\\n/**\\n * Stanek's Gift API.\\n * @public\\n */\\ninterface Stanek {\\n /**\\n * Stanek's Gift width.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The width of the gift.\\n */\\n giftWidth(): number;\\n /**\\n * Stanek's Gift height.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @returns The height of the gift.\\n */\\n giftHeight(): number;\\n\\n /**\\n * Charge a fragment, increasing its power.\\n * @remarks\\n * RAM cost: 0.4 GB\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @returns Promise that lasts until the charge action is over.\\n */\\n chargeFragment(rootX: number, rootY: number): Promise;\\n\\n /**\\n * List possible fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns List of possible fragments.\\n */\\n fragmentDefinitions(): Fragment[];\\n\\n /**\\n * List of fragments in Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns List of active fragments placed on Stanek's Gift.\\n */\\n activeFragments(): ActiveFragment[];\\n\\n /**\\n * Clear the board of all fragments.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clearGift(): void;\\n\\n /**\\n * Check if fragment can be placed at specified location.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * @param rootX - rootX Root X against which to align the top left of the fragment.\\n * @param rootY - rootY Root Y against which to align the top left of the fragment.\\n * @param rotation - rotation A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - fragmentId ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n canPlaceFragment(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Place fragment on Stanek's Gift.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @param rotation - A number from 0 to 3, the mount of 90 degree turn to take.\\n * @param fragmentId - ID of the fragment to place.\\n * @returns true if the fragment can be placed at that position. false otherwise.\\n */\\n placeFragment(rootX: number, rootY: number, rotation: number, fragmentId: number): boolean;\\n /**\\n * Get placed fragment at location.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n getFragment(rootX: number, rootY: number): ActiveFragment | undefined;\\n\\n /**\\n * Remove fragment at location.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * @param rootX - X against which to align the top left of the fragment.\\n * @param rootY - Y against which to align the top left of the fragment.\\n * @returns The fragment at [rootX, rootY], if any.\\n */\\n removeFragment(rootX: number, rootY: number): boolean;\\n\\n /**\\n * Accept Stanek's Gift by joining the Church of the Machine God\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * @returns true if the player is a member of the church and has the gift installed,\\n * false otherwise.\\n */\\n acceptGift(): boolean;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface InfiltrationReward {\\n tradeRep: number;\\n sellCash: number;\\n SoARep: number;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface ILocation {\\n city: string;\\n name: string;\\n}\\n\\n/**\\n * @public\\n */\\nexport interface InfiltrationLocation {\\n location: ILocation;\\n reward: InfiltrationReward;\\n difficulty: number;\\n}\\n\\n/**\\n * Infiltration API.\\n * @public\\n */\\ninterface Infiltration {\\n /**\\n * Get all locations that can be infiltrated.\\n * @remarks\\n * RAM cost: 5 GB\\n *\\n * @returns all locations that can be infiltrated.\\n */\\n getPossibleLocations(): PossibleInfiltrationLocation[];\\n /**\\n * Get all infiltrations with difficulty, location and rewards.\\n * @remarks\\n * RAM cost: 15 GB\\n *\\n * @returns Infiltration data for given location.\\n */\\n getInfiltration(location: string): InfiltrationLocation;\\n}\\n\\n/**\\n * User Interface API.\\n * @public\\n */\\ninterface UserInterface {\\n /**\\n * Get the current window size\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An array of 2 value containing the window width and height.\\n */\\n windowSize(): [number, number];\\n\\n /**\\n * Get the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the theme's colors\\n */\\n getTheme(): UserInterfaceTheme;\\n\\n /**\\n * Sets the current theme\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const theme = ns.ui.getTheme();\\n * theme.primary = '#ff5500';\\n * ns.ui.setTheme(theme);\\n * ```\\n */\\n setTheme(newTheme: UserInterfaceTheme): void;\\n\\n /**\\n * Resets the player's theme to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetTheme(): void;\\n\\n /**\\n * Get the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @returns An object containing the player's styles\\n */\\n getStyles(): IStyleSettings;\\n\\n /**\\n * Sets the current styles\\n * @remarks\\n * RAM cost: 0 GB\\n * @example\\n * Usage example (NS2)\\n * ```ts\\n * const styles = ns.ui.getStyles();\\n * styles.fontFamily = 'Comic Sans Ms';\\n * ns.ui.setStyles(styles);\\n * ```\\n */\\n setStyles(newStyles: IStyleSettings): void;\\n\\n /**\\n * Resets the player's styles to the default values\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n resetStyles(): void;\\n\\n /**\\n * Gets the current game information (version, commit, ...)\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n getGameInfo(): GameInfo;\\n\\n /**\\n * Clear the Terminal window, as if the player ran `clear` in the terminal\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n clearTerminal(): void;\\n}\\n\\n/**\\n * Collection of all functions passed to scripts\\n * @public\\n * @remarks\\n * Basic ns1 usage example:\\n * ```ts\\n * // Basic ns functions can be used directly\\n * getHostname();\\n * // Some related functions are gathered within a common namespace\\n * stock.getPrice();\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscript1.html| ns1 in-game docs}\\n *
    \\n * Basic ns2 usage example:\\n * ```ts\\n * export async function main(ns) {\\n * // Basic ns functions can be accessed on the ns object\\n * ns.getHostname();\\n * // Some related functions are gathered under a sub-property of the ns object\\n * ns.stock.getPrice();\\n * // Some functions need to be awaited\\n * await ns.hack('n00dles');\\n * }\\n * ```\\n * {@link https://bitburner.readthedocs.io/en/latest/netscript/netscriptjs.html| ns2 in-game docs}\\n *
    \\n */\\nexport interface NS {\\n /**\\n * Namespace for hacknet functions.\\n * @remarks RAM cost: 4 GB\\n */\\n readonly hacknet: Hacknet;\\n /**\\n *\\n * Namespace for bladeburner functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly bladeburner: Bladeburner;\\n /**\\n *\\n * Namespace for codingcontract functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly codingcontract: CodingContract;\\n /**\\n *\\n * Namespace for gang functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly gang: Gang;\\n /**\\n *\\n * Namespace for sleeve functions.\\n * @remarks RAM cost: 0 GB\\n */\\n readonly sleeve: Sleeve;\\n /**\\n *\\n * Namespace for stock functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly stock: TIX;\\n /**\\n *\\n * Namespace for formulas functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly formulas: Formulas;\\n /**\\n * Namespace for stanek functions.\\n * RAM cost: 0 GB\\n */\\n readonly stanek: Stanek;\\n /**\\n * Namespace for infiltration functions.\\n * RAM cost: 0 GB\\n */\\n readonly infiltration: Infiltration;\\n /**\\n * Namespace for corporation functions.\\n * RAM cost: 1022.4 GB\\n */\\n readonly corporation: Corporation;\\n\\n /**\\n * Namespace for user interface functions.\\n * RAM cost: 0 GB\\n */\\n readonly ui: UserInterface;\\n\\n /**\\n * Namespace for singularity functions.\\n * RAM cost: 0 GB\\n */\\n readonly singularity: Singularity;\\n\\n /**\\n * Namespace for grafting functions.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n readonly grafting: Grafting;\\n\\n /**\\n * Arguments passed into the script.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Arguments passed into a script can be accessed using a normal\\n * array using the [] operator (args[0], args[1], etc…).\\n *\\n * It is also possible to get the number of arguments that was passed into a script using: 'args.length'\\n * WARNING: Do not try to modify the args array. This will break the game.\\n */\\n readonly args: (string | number | boolean)[];\\n\\n /**\\n * Steal a servers money.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Function that is used to try and hack servers to steal money and gain hacking experience.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level when this function is called. In order to hack a server you must first gain root access to that server\\n * and also have the required hacking level.\\n *\\n * A script can hack a server from anywhere. It does not need to be running on the same\\n * server to hack that server. For example, you can create a script that hacks the `foodnstuff`\\n * server and run that script on any server in the game.\\n *\\n * A successful `hack()` on a server will raise that server’s security level by 0.002.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var earnedMoney = hack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let earnedMoney = await ns.hack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to hack.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount of money stolen if the hack is successful, and zero otherwise.\\n */\\n hack(host: string, opts?: BasicHGWOptions): Promise;\\n\\n /**\\n * Spoof money in a servers bank account, increasing the amount available.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to increase the amount of money available on a server.\\n * The runtime for this command depends on your hacking level and the target server’s\\n * security level. When `grow` completes, the money available on a target server will\\n * be increased by a certain, fixed percentage. This percentage is determined by the\\n * target server’s growth rate (which varies between servers) and security level. Generally,\\n * higher-level servers have higher growth rates. The getServerGrowth() function can be used\\n * to obtain a server’s growth rate.\\n *\\n * Like hack, `grow` can be called on any server, regardless of where the script is running.\\n * The grow() command requires root access to the target server, but there is no required hacking\\n * level to run the command. It also raises the security level of the target server by 0.004.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentMoney = getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney = currentMoney * (1 + grow(\\\"foodnstuff\\\"));\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentMoney = ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * currentMoney *= (1 + await ns.grow(\\\"foodnstuff\\\"));\\n * ```\\n * @param host - Hostname of the target server to grow.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The number by which the money on the server was multiplied for the growth.\\n */\\n grow(host: string, opts?: BasicHGWOptions): Promise;\\n\\n /**\\n * Reduce a server security level.\\n * @remarks\\n * RAM cost: 0.15 GB\\n *\\n * Use your hacking skills to attack a server’s security, lowering the server’s security level.\\n * The runtime for this command depends on your hacking level and the target server’s security\\n * level when this function is called. This function lowers the security level of the target server by 0.05.\\n *\\n * Like hack and grow, `weaken` can be called on any server, regardless of\\n * where the script is running. This command requires root access to the target server, but\\n * there is no required hacking level to run the command.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var currentSecurity = getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity = currentSecurity - weaken(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * let currentSecurity = ns.getServerSecurityLevel(\\\"foodnstuff\\\");\\n * currentSecurity -= await ns.weaken(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server to weaken.\\n * @param opts - Optional parameters for configuring function behavior.\\n * @returns The amount by which the target server’s security level was decreased. This is equivalent to 0.05 multiplied by the number of script threads.\\n */\\n weaken(host: string, opts?: BasicHGWOptions): Promise;\\n\\n /**\\n * Predict the effect of weaken.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security decrease that would occur if a weaken with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param cores - Optional. The number of cores of the server that would run weaken.\\n * @returns The security decrease.\\n */\\n weakenAnalyze(threads: number, cores?: number): number;\\n\\n /**\\n * Predict the effect of hack.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of script threads you need when running the hack command\\n * to steal the specified amount of money from the target server.\\n * If hackAmount is less than zero or greater than the amount of money available on the server,\\n * then this function returns -1.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * //For example, let’s say the foodnstuff server has $10m and you run:\\n * hackAnalyzeThreads(\\\"foodnstuff\\\", 1e6);\\n * //If this function returns 50, this means that if your next hack call is run on a script with 50 threads, it will steal $1m from the foodnstuff server.\\n * ```\\n * @param host - Hostname of the target server to analyze.\\n * @param hackAmount - Amount of money you want to hack from the server.\\n * @returns The number of threads needed to hack the server for hackAmount money.\\n */\\n hackAnalyzeThreads(host: string, hackAmount: number): number;\\n\\n /**\\n * Get the part of money stolen with a single thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the part of the specified server’s money you will steal with a single thread hack.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, assume the following returns 0.01:\\n * var hackAmount = hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, assume the following returns 0.01:\\n * const hackAmount = ns.hackAnalyze(\\\"foodnstuff\\\");\\n * //This means that if hack the foodnstuff server using a single thread, then you will steal 1%, or 0.01 of its total money. If you hack using N threads, then you will steal N*0.01 times its total money.\\n * ```\\n * @param host - Hostname of the target server.\\n * @returns The part of money you will steal from the target server with a single thread hack.\\n */\\n hackAnalyze(host: string): number;\\n\\n /**\\n * Get the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a hack with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param hostname - Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @returns The security increase.\\n */\\n hackAnalyzeSecurity(threads: number, hostname?: string): number;\\n\\n /**\\n * Get the chance of successfully hacking a server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the chance you have of successfully hacking the specified server.\\n *\\n * This returned value is in decimal form, not percentage.\\n *\\n * @param host - Hostname of the target server.\\n * @returns The chance you have of successfully hacking the target server.\\n */\\n hackAnalyzeChance(host: string): number;\\n\\n /**\\n * Calculate the number of grow thread needed to grow a server by a certain multiplier.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * This function returns the number of “growths” needed in order to increase\\n * the amount of money available on the specified server by the specified amount.\\n * The specified amount is multiplicative and is in decimal form, not percentage.\\n *\\n * Warning: The value returned by this function isn’t necessarily a whole number.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * var growTimes = growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //For example, if you want to determine how many grow calls you need to double the amount of money on foodnstuff, you would use:\\n * const growTimes = ns.growthAnalyze(\\\"foodnstuff\\\", 2);\\n * //If this returns 100, then this means you need to call grow 100 times in order to double the money (or once with 100 threads).\\n * ```\\n * @param host - Hostname of the target server.\\n * @param growthAmount - Multiplicative factor by which the server is grown. Decimal form..\\n * @returns The amount of grow calls needed to grow the specified server by the specified amount\\n */\\n growthAnalyze(host: string, growthAmount: number, cores?: number): number;\\n\\n /**\\n * Calculate the security increase for a number of thread.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns the security increase that would occur if a grow with this many threads happened.\\n *\\n * @param threads - Amount of threads that will be used.\\n * @param hostname - Optional. Hostname of the target server. The number of threads is limited to the number needed to hack the servers maximum amount of money.\\n * @param cores - Optional. The number of cores of the server that would run grow.\\n * @returns The security increase.\\n */\\n growthAnalyzeSecurity(threads: number, hostname?: string, cores?: number): number;\\n\\n /**\\n * Suspends the script for n milliseconds.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @example\\n * ```ts\\n * // NS1:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * tprint(i + 1);\\n * sleep(5000);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // This will count from 1 to 10 in your terminal, with one number every 5 seconds\\n * for (var i=0; i<10; i++) {\\n * ns.tprint(i + 1);\\n * await ns.sleep(5000);\\n * }\\n * ```\\n * @returns\\n */\\n sleep(millis: number): Promise;\\n\\n /**\\n * Suspends the script for n milliseconds. Doesn't block with concurrent calls.\\n * You should prefer 'sleep' over 'asleep' except when doing very complex UI work.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param millis - Number of milliseconds to sleep.\\n * @returns\\n */\\n asleep(millis: number): Promise;\\n\\n /**\\n * Prints one or move values or variables to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param args - Value(s) to be printed.\\n */\\n print(...args: any[]): void;\\n\\n /**\\n * Prints a formatted string to the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - format of the message\\n * @param args - Value(s) to be printed.\\n */\\n printf(format: string, ...args: any[]): void;\\n\\n /**\\n * Prints one or more values or variables to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param args - Value(s) to be printed.\\n */\\n tprint(...args: any[]): void;\\n\\n /**\\n * Prints a raw value or a variable to the Terminal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - format of the message\\n * @param msg - Value to be printed.\\n */\\n tprintf(format: string, ...values: any[]): void;\\n\\n /**\\n * Clears the script’s logs.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n clearLog(): void;\\n\\n /**\\n * Disables logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Logging can be disabled for all functions by passing `ALL` as the argument.\\n *\\n * Note that this does not completely remove all logging functionality.\\n * This only stops a function from logging when the function is successful.\\n * If the function fails, it will still log the reason for failure.\\n *\\n * @param fn - Name of function for which to disable logging.\\n */\\n disableLog(fn: string): void;\\n\\n /**\\n * Enable logging for a certain function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Re-enables logging for the given function. If `ALL` is passed into this\\n * function as an argument, then it will revert the effects of disableLog(`ALL`).\\n *\\n * @param fn - Name of function for which to enable logging.\\n */\\n enableLog(fn: string): void;\\n\\n /**\\n * Checks the status of the logging for the given function.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param fn - Name of function to check.\\n * @returns Returns a boolean indicating whether or not logging is enabled for that function (or `ALL`)\\n */\\n isLogEnabled(fn: string): boolean;\\n\\n /**\\n * Get all the logs of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Returns a script’s logs. The logs are returned as an array, where each line is an element in the array.\\n * The most recently logged line is at the end of the array.\\n * Note that there is a maximum number of lines that a script stores in its logs. This is configurable in the game’s options.\\n * If the function is called with no arguments, it will return the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Get logs from foo.script on the current server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Get logs from foo.script on the current server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with no args\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Open logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.getScriptLogs(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename of script to get logs from.\\n * @param host - Optional. Hostname of the server that the script is on.\\n * @param args - Arguments to identify which scripts to get logs for.\\n * @returns Returns an string array, where each line is an element in the array. The most recently logged line is at the end of the array.\\n */\\n getScriptLogs(fn?: string, host?: string, ...args: (string | number | boolean)[]): string[];\\n\\n /**\\n * Get an array of recently killed scripts across all servers.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * The most recently killed script is the first element in the array.\\n * Note that there is a maximum number of recently killed scripts which are tracked.\\n * This is configurable in the game's options as `Recently killed scripts size`.\\n *\\n * @example\\n * ```ts\\n * let recentScripts = ns.getRecentScripts();\\n * let mostRecent = recentScripts.shift()\\n * if (mostRecent)\\n * ns.tprint(mostRecent.logs.join('\\\\n'))\\n * ```\\n *\\n * @returns Array with information about previously killed scripts.\\n */\\n getRecentScripts(): RecentScript[];\\n\\n /**\\n * Open the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Opens a script’s logs. This is functionally the same as the tail Terminal command.\\n *\\n * If the function is called with no arguments, it will open the current script’s logs.\\n *\\n * Otherwise, the fn, hostname/ip, and args… arguments can be used to get the logs from another script.\\n * Remember that scripts are uniquely identified by both their names and arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Open logs from foo.script on the current server that was run with no args\\n * tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Open logs from foo.script on the current server that was run with no args\\n * ns.tail(\\\"foo.script\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with no args\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //Get logs from foo.script on the foodnstuff server that was run with the arguments [1, \\\"test\\\"]\\n * ns.tail(\\\"foo.script\\\", \\\"foodnstuff\\\", 1, \\\"test\\\");\\n * ```\\n * @param fn - Optional. Filename or PID of the script being tailed. If omitted, the current script is tailed.\\n * @param host - Optional. Hostname of the script being tailed. Defaults to the server this script is running on. If args are specified, this is not optional.\\n * @param args - Arguments for the script being tailed.\\n */\\n tail(fn?: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): void;\\n\\n /**\\n * Move a tail window\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Moves a tail window. Coordinates are in screenspace pixels (top left is 0,0)\\n *\\n * @param x - x coordinate.\\n * @param y - y coordinate.\\n * @param pid - Optional. PID of the script having its tail moved. If omitted, the current script is used.\\n */\\n moveTail(x: number, y: number, pid?: number): void;\\n\\n /**\\n * Resize a tail window\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Resize a tail window. Size are in pixel\\n *\\n * @param width - width of the window.\\n * @param height - height of the window.\\n * @param pid - Optional. PID of the script having its tail resized. If omitted, the current script is used.\\n */\\n resizeTail(width: number, height: number, pid?: number): void;\\n\\n /**\\n * Close the tail window of a script.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Closes a script’s logs. This is functionally the same pressing the \\\"Close\\\" button on the tail window.\\n *\\n * If the function is called with no arguments, it will close the current script’s logs.\\n *\\n * Otherwise, the pid argument can be used to close the logs from another script.\\n *\\n * @param pid - Optional. PID of the script having its tail closed. If omitted, the current script is used.\\n */\\n closeTail(pid?: number): void;\\n\\n /**\\n * Get the list of servers connected to a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array containing the hostnames of all servers that are one\\n * node way from the specified target server. The hostnames in the returned\\n * array are strings.\\n *\\n * @param host - Optional, Hostname of the server to scan, default to current server.\\n * @returns Returns an string of hostnames.\\n */\\n scan(host?: string): string[];\\n\\n /**\\n * Runs NUKE.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Running NUKE.exe on a target server gives you root access which means you can executes scripts on said server. NUKE.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * nuke(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.nuke(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n nuke(host: string): void;\\n\\n /**\\n * Runs BruteSSH.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the BruteSSH.exe program on the target server. BruteSSH.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.brutessh(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n brutessh(host: string): void;\\n\\n /**\\n * Runs FTPCrack.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the FTPCrack.exe program on the target server. FTPCrack.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.ftpcrack(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n ftpcrack(host: string): void;\\n\\n /**\\n * Runs relaySMTP.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the relaySMTP.exe program on the target server. relaySMTP.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.relaysmtp(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n relaysmtp(host: string): void;\\n\\n /**\\n * Runs HTTPWorm.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the HTTPWorm.exe program on the target server. HTTPWorm.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.httpworm(\\\"foodnstuff\\\");\\n * ```\\n * @param host - Hostname of the target server.\\n */\\n httpworm(host: string): void;\\n\\n /**\\n * Runs SQLInject.exe on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Runs the SQLInject.exe program on the target server. SQLInject.exe must exist on your home computer.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.sqlinject(\\\"foodnstuff\\\");\\n * ```\\n * @remarks RAM cost: 0.05 GB\\n * @param host - Hostname of the target server.\\n */\\n sqlinject(host: string): void;\\n\\n /**\\n * Start another script on the current server.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Run a script as a separate process. This function can only be used to run scripts located on the\\n * current server (the server running the script that calls this function). Requires a significant\\n * amount of RAM to run this command.\\n *\\n * If the script was successfully started, then this functions returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The simplest way to use the run command is to call it with just the script name. The following example will run ‘foo.script’ single-threaded with no arguments:\\n * ns.run(\\\"foo.script\\\");\\n *\\n * //The following example will run ‘foo.script’ but with 5 threads instead of single-threaded:\\n * ns.run(\\\"foo.script\\\", 5);\\n *\\n * //This next example will run ‘foo.script’ single-threaded, and will pass the string ‘foodnstuff’ into the script as an argument:\\n * ns.run(\\\"foo.script\\\", 1, 'foodnstuff');\\n * ```\\n * @param script - Filename of script to run.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the second argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n run(script: string, numThreads?: number, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Start another script on any server.\\n * @remarks\\n * RAM cost: 1.3 GB\\n *\\n * Run a script as a separate process on a specified server. This is similar to the run function\\n * except that it can be used to run a script on any server, instead of just the current server.\\n *\\n * If the script was successfully started, then this functions returns the PID of that script.\\n * Otherwise, it returns 0.\\n *\\n * PID stands for Process ID. The PID is a unique identifier for each script.\\n * The PID will always be a positive integer.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The simplest way to use the exec command is to call it with just the script name and the target server. The following example will try to run generic-hack.script on the foodnstuff server:\\n * exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following example will try to run the script generic-hack.script on the joesguns server with 10 threads:\\n * exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * //This last example will try to run the script foo.script on the foodnstuff server with 5 threads. It will also pass the number 1 and the string “test” in as arguments to the script:\\n * exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * //The simplest way to use the exec command is to call it with just the script name and the target server. The following example will try to run generic-hack.script on the foodnstuff server:\\n * ns.exec(\\\"generic-hack.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following example will try to run the script generic-hack.script on the joesguns server with 10 threads:\\n * ns.exec(\\\"generic-hack.script\\\", \\\"joesguns\\\", 10);\\n *\\n * //This last example will try to run the script foo.script on the foodnstuff server with 5 threads. It will also pass the number 1 and the string “test” in as arguments to the script:\\n * ns.exec(\\\"foo.script\\\", \\\"foodnstuff\\\", 5, 1, \\\"test\\\");\\n * ```\\n * @param script - Filename of script to execute.\\n * @param host - Hostname of the `target server` on which to execute the script.\\n * @param numThreads - Optional thread count for new script. Set to 1 by default. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run. Note that if any arguments are being passed into the new script, then the third argument numThreads must be filled in with a value.\\n * @returns Returns the PID of a successfully started script, and 0 otherwise.\\n */\\n exec(script: string, host: string, numThreads?: number, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Terminate current script and start another in 10s.\\n * @remarks\\n * RAM cost: 2 GB\\n *\\n * Terminates the current script, and then after a delay of about 10 seconds it will execute the\\n * newly-specified script. The purpose of this function is to execute a new script without being\\n * constrained by the RAM usage of the current one. This function can only be used to run scripts\\n * on the local server.\\n *\\n * Because this function immediately terminates the script, it does not have a return value.\\n *\\n * Running this function with a numThreads argument of 0 or less will cause a runtime error.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will execute the script ‘foo.script’ with 10 threads and the arguments ‘foodnstuff’ and 90:\\n * ns.spawn('foo.script', 10, 'foodnstuff', 90);\\n * ```\\n * @param script - Filename of script to execute.\\n * @param numThreads - Number of threads to spawn new script with. Will be rounded to nearest integer.\\n * @param args - Additional arguments to pass into the new script that is being run.\\n */\\n spawn(script: string, numThreads?: number, ...args: (string | number | boolean)[]): void;\\n\\n /**\\n * Terminate another script.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills the script on the target server specified by the script’s name and arguments.\\n * Remember that scripts are uniquely identified by both their name and arguments.\\n * For example, if `foo.script` is run with the argument 1, then this is not the same as\\n * `foo.script` run with the argument 2, even though they have the same code.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * ns.kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @param script - Filename or pid of the script to kill\\n * @param host - Hostname of the server on which to kill the script.\\n * @param args - Arguments to identify which script to kill.\\n * @returns True if the script is successfully killed, and false otherwise.\\n */\\n kill(script: number): boolean;\\n\\n /**\\n * {@inheritDoc NS.(kill:1)}\\n * @example\\n * ```ts\\n * // NS1:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The following example will try to kill a script named foo.script on the foodnstuff server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with no arguments:\\n * ns.kill(\\\"foo.script\\\", getHostname());\\n *\\n * //The following will try to kill a script named foo.script on the current server that was ran with the arguments 1 and “foodnstuff”:\\n * ns.kill(\\\"foo.script\\\", getHostname(), 1, \\\"foodnstuff\\\");\\n * ```\\n */\\n kill(script: string, host: string, ...args: (string | number | boolean)[]): boolean;\\n\\n /**\\n * Terminate all scripts on a server.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Kills all running scripts on the specified server. This function returns true\\n * if any scripts were killed, and false otherwise. In other words, it will return\\n * true if there are any scripts running on the target server.\\n * If no host is defined, it will kill all scripts, where the script is running.\\n *\\n * @param host - IP or hostname of the server on which to kill all scripts.\\n * @param safetyguard - Skips the script that calls this function\\n * @returns True if any scripts were killed, and false otherwise.\\n */\\n killall(host?: string, safetyguard?: boolean): boolean;\\n\\n /**\\n * Terminates the current script immediately.\\n * @remarks\\n * RAM cost: 0 GB\\n */\\n exit(): void;\\n\\n /**\\n * Copy file between servers.\\n * @remarks\\n * RAM cost: 0.6 GB\\n *\\n * Copies a script or literature (.lit) file(s) to another server. The files argument can be either a string\\n * specifying a single file to copy, or an array of strings specifying multiple files to copy.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //Copies foo.lit from the helios server to the home computer:\\n * scp(\\\"foo.lit\\\", \\\"home\\\", \\\"helios\\\");\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * scp(files, \\\"home\\\", \\\"rothman-uni\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //Copies foo.lit from the helios server to the home computer:\\n * ns.scp(\\\"foo.lit\\\", \\\"home\\\", \\\"helios\\\" );\\n *\\n * //Tries to copy three files from rothman-uni to home computer:\\n * files = [\\\"foo1.lit\\\", \\\"foo2.script\\\", \\\"foo3.script\\\"];\\n * ns.scp(files, \\\"home\\\", \\\"rothman-uni\\\");\\n * ```\\n * @example\\n * ```ts\\n * //ns2, copies files from home to a target server\\n * const server = ns.args[0];\\n * const files = [\\\"hack.js\\\",\\\"weaken.js\\\",\\\"grow.js\\\"];\\n * ns.scp(files, server, \\\"home\\\");\\n * ```\\n * @param files - Filename or an array of filenames of script/literature files to copy.\\n * @param destination - Host of the destination server, which is the server to which the file will be copied.\\n * @param source - Host of the source server, which is the server from which the file will be copied. This argument is optional and if it’s omitted the source will be the current server.\\n * @returns True if the file is successfully copied over and false otherwise. If the files argument is an array then this function will return false if any of the operations failed.\\n */\\n scp(files: string | string[], destination: string, source?: string): boolean;\\n\\n /**\\n * List files on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with the filenames of all files on the specified server\\n * (as strings). The returned array is sorted in alphabetic order.\\n *\\n * @param host - Host of the target server.\\n * @param grep - A substring to search for in the filename.\\n * @returns Array with the filenames of all files on the specified server.\\n */\\n ls(host: string, grep?: string): string[];\\n\\n /**\\n * List running scripts on a server.\\n * @remarks\\n * RAM cost: 0.2 GB\\n *\\n * Returns an array with general information about all scripts running on the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var scripts = ps(\\\"home\\\");\\n * for (var i = 0; i < scripts.length; ++i) {\\n * tprint(scripts[i].filename + ' ' + scripts[i].threads);\\n * tprint(scripts[i].args);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ps = ns.ps(\\\"home\\\");\\n * for (let script of ps) {\\n * ns.tprint(`${script.filename} ${script.threads}`);\\n * ns.tprint(script.args);\\n * }\\n * ```\\n * @param host - Host address of the target server. If not specified, it will be the current server’s IP by default.\\n * @returns Array with general information about all scripts running on the specified target server.\\n */\\n ps(host?: string): ProcessInfo[];\\n\\n /**\\n * Check if your have root access on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns a boolean indicating whether or not the player has root access to the specified target server.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * if (hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * if (ns.hasRootAccess(\\\"foodnstuff\\\") == false) {\\n * ns.nuke(\\\"foodnstuff\\\");\\n * }\\n * ```\\n * @param host - Host of the target server\\n * @returns True if player has root access to the specified target server, and false otherwise.\\n */\\n hasRootAccess(host: string): boolean;\\n\\n /**\\n * Returns a string with the hostname of the server that the script is running on.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Hostname of the server that the script is on.\\n */\\n getHostname(): string;\\n\\n /**\\n * Returns the player’s current hacking level.\\n *\\n * @remarks\\n * RAM cost: 0.05 GB\\n * @returns Player’s current hacking level\\n */\\n getHackingLevel(): number;\\n\\n /**\\n * Get hacking related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacking related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHackingMultipliers();\\n * print(mults.chance);\\n * print(mults.growth);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {chance, growth} = ns.getHackingMultipliers();\\n * print(chance);\\n * print(growth);\\n * ```\\n * @returns Object containing the Player’s hacking related multipliers.\\n */\\n getHackingMultipliers(): HackingMultipliers;\\n\\n /**\\n * Get hacknet related multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the Player’s hacknet related multipliers.\\n * These multipliers are returned in fractional forms, not percentages\\n * (e.g. 1.5 instead of 150%).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * // Example of how this can be used:\\n * var mults = getHacknetMultipliers();\\n * print(mults.production);\\n * print(mults.purchaseCost);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * // Example of how this can be used:\\n * const {production, purchaseCost} = ns.getHacknetMultipliers();\\n * print(production);\\n * print(purchaseCost);\\n * ```\\n * @returns Object containing the Player’s hacknet related multipliers.\\n */\\n getHacknetMultipliers(): HacknetMultipliers;\\n\\n /**\\n * Returns a server object for the given server. Defaults to the running script's server if host is not specified.\\n *\\n * @remarks\\n * RAM cost: 2 GB\\n * @param host - Optional. Hostname for the requested server object.\\n * @returns The requested server object.\\n */\\n getServer(host?: string): Server;\\n\\n /**\\n * Get money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of money available on a server.\\n * Running this function on the home computer will return the player’s money.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * getServerMoneyAvailable(\\\"home\\\"); //Returns player's money\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * ns.getServerMoneyAvailable(\\\"foodnstuff\\\");\\n * ns.getServerMoneyAvailable(\\\"home\\\"); // Returns player's money\\n * ```\\n * @param host - Host of target server\\n * @returns Amount of money available on the server.\\n */\\n getServerMoneyAvailable(host: string): number;\\n\\n /**\\n * Get maximum money available on a server.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the maximum amount of money that can be available on a server.\\n *\\n * @param host - Host of target server.\\n * @returns Maximum amount of money available on the server.\\n */\\n getServerMaxMoney(host: string): number;\\n\\n /**\\n * Get a server growth parameter.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the server’s intrinsic “growth parameter”. This growth\\n * parameter is a number typically between 0 and 100 that represents\\n * how quickly the server’s money grows. This parameter affects the\\n * percentage by which the server’s money is increased when using the\\n * grow function. A higher growth parameter will result in a\\n * higher percentage increase from grow.\\n *\\n * @param host - Host of target server.\\n * @returns Parameter that affects the percentage by which the server’s money is increased when using the grow function.\\n */\\n getServerGrowth(host: string): number;\\n\\n /**\\n * Get server security level.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the security level of the target server. A server’s security\\n * level is denoted by a number, typically between 1 and 100\\n * (but it can go above 100).\\n *\\n * @param host - Host of target server.\\n * @returns Security level of the target server.\\n */\\n getServerSecurityLevel(host: string): number;\\n\\n /**\\n * Returns the minimum security level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns Minimum security level of the target server.\\n */\\n getServerMinSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated useless\\n * @remarks\\n * RAM cost: 0.1 GB\\n * Returns the base security level of the target server. This is the security\\n * level that the server starts out with. This is different than\\n * getServerSecurityLevel because getServerSecurityLevel returns\\n * the current security level of a server, which can constantly change due to\\n * hack, grow, and weaken, calls on that server.\\n * The base security level will stay the same until you reset by\\n * installing an Augmentation(s).\\n *\\n * @param host - Host of target server.\\n * @returns Base security level of the target server.\\n */\\n getServerBaseSecurityLevel(host: string): number;\\n\\n /**\\n * @deprecated use getServerMaxRam / getServerUsedRam\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns an array with two elements that gives information about a server’s memory (RAM).\\n * The first element in the array is the amount of RAM that the server has total (in GB).\\n * The second element in the array is the amount of RAM that is currently being used on\\n * the server (in GB).\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var serverRam = getServerRam(\\\"helios\\\");\\n * var totalRam = serverRam[0];\\n * var ramUsed = serverRam[1];\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const [totalRam, ramUsed] = ns.getServerRam(\\\"helios\\\");\\n * ```\\n * @param host - Host of target server.\\n * @returns Array with total and used memory on the specified server, in GB.\\n */\\n getServerRam(host: string): [number, number];\\n\\n /**\\n * Get the max RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns max ram (GB)\\n */\\n getServerMaxRam(host: string): number;\\n /**\\n * Get the used RAM on a server.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * @param host - Hostname of the target server.\\n * @returns used ram (GB)\\n */\\n getServerUsedRam(host: string): number;\\n\\n /**\\n * Returns the required hacking level of the target server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The required hacking level of the target server.\\n */\\n getServerRequiredHackingLevel(host: string): number;\\n\\n /**\\n * Returns the number of open ports required to successfully run NUKE.exe on the specified server.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns The number of open ports required to successfully run NUKE.exe on the specified server.\\n */\\n getServerNumPortsRequired(host: string): number;\\n\\n /**\\n * Returns a boolean denoting whether or not the specified server exists.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @param host - Host of target server.\\n * @returns True if specified server exists, and false otherwise.\\n */\\n serverExists(host: string): boolean;\\n\\n /**\\n * Check if a file exists.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified file exists on the target server.\\n * The filename for scripts is case-sensitive, but for other types of files it is not.\\n * For example, fileExists(“brutessh.exe”) will work fine, even though the actual program\\n * is named 'BruteSSH.exe'.\\n *\\n * If the hostname/ip argument is omitted, then the function will search through the current\\n * server (the server running the script that calls this function) for the file.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * // The function call will return true if the script named foo.script exists on the foodnstuff server, and false otherwise.\\n * ns.fileExists(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * // The function call will return true if the current server contains the FTPCrack.exe program, and false otherwise.\\n * ns.fileExists(\\\"ftpcrack.exe\\\");\\n * ```\\n * @param filename - Filename of file to check.\\n * @param host - Host of target server. This is optional. If it is not specified then the function will use the current server as the target server.\\n * @returns True if specified file exists, and false otherwise.\\n */\\n fileExists(filename: string, host?: string): boolean;\\n\\n /**\\n * Check if a script is running.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns a boolean indicating whether the specified script is running on the target server.\\n * If you use a PID instead of a filename, the hostname and args parameters are unnecessary.\\n * Remember that a script is uniquely identified by both its name and its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is a script named foo.script with no arguments running on the foodnstuff server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is a script named foo.script with no arguments running on the current server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", ns.getHostname());\\n *\\n * //The function call will return true if there is a script named foo.script running with the arguments 1, 5, and “test” (in that order) on the joesguns server, and false otherwise:\\n * ns.isRunning(\\\"foo.script\\\", \\\"joesguns\\\", 1, 5, \\\"test\\\");\\n * ```\\n * @param script - Filename or PID of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @param args - Arguments to specify/identify which scripts to search for.\\n * @returns True if specified script is running on the target server, and false otherwise.\\n */\\n isRunning(script: FilenameOrPID, host?: string, ...args: (string | number | boolean)[]): boolean;\\n\\n /**\\n * Get general info about a running script.\\n * @remarks\\n * RAM cost: 0.3 GB\\n *\\n * Running with no args returns current script.\\n * If you use a PID as the first parameter, the hostname and args parameters are unnecessary.\\n *\\n * @param filename - Optional. Filename or PID of the script.\\n * @param hostname - Optional. Name of host server the script is running on.\\n * @param args - Arguments to identify the script\\n * @returns The info about the running script if found, and null otherwise.\\n */\\n getRunningScript(\\n filename?: FilenameOrPID,\\n hostname?: string,\\n ...args: (string | number | boolean)[]\\n ): RunningScript | null;\\n\\n /**\\n * Get cost of purchasing a server.\\n * @remarks\\n * RAM cost: 0.25 GB\\n *\\n * Returns the cost to purchase a server with the specified amount of ram.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * for (i = 1; i <= 20; i++) {\\n * tprint(i + \\\" -- \\\" + getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * for (i = 1; i <= 20; i++) {\\n * ns.tprint(i + \\\" -- \\\" + ns.getPurchasedServerCost(Math.pow(2, i)));\\n * }\\n * ```\\n * @param ram - Amount of RAM of a potential purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The cost to purchase a server with the specified amount of ram.\\n */\\n getPurchasedServerCost(ram: number): number;\\n\\n /**\\n * Purchase a server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Purchased a server with the specified hostname and amount of RAM.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string\\n * and have whitespace removed. Anything that resolves to an empty string will cause\\n * the function to fail. If there is already a server with the specified hostname,\\n * then the function will automatically append a number at the end of the hostname\\n * argument value until it finds a unique hostname. For example, if the script calls\\n * `purchaseServer(“foo”, 4)` but a server named “foo” already exists, the it will\\n * automatically change the hostname to `foo-0`. If there is already a server with the\\n * hostname `foo-0`, then it will change the hostname to `foo-1`, and so on.\\n *\\n * Note that there is a maximum limit to the amount of servers you can purchase.\\n *\\n * Returns the hostname of the newly purchased server as a string. If the function\\n * fails to purchase a server, then it will return an empty string. The function will\\n * fail if the arguments passed in are invalid, if the player does not have enough\\n * money to purchase the specified server, or if the player has exceeded the maximum\\n * amount of servers.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var ram = 64;\\n * var prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const ram = 64;\\n * const prefix = \\\"pserv-\\\";\\n * for (i = 0; i < 5; ++i) {\\n * ns.purchaseServer(prefix + i, ram);\\n * }\\n * ```\\n * @param hostname - Host of the purchased server.\\n * @param ram - Amount of RAM of the purchased server, in GB. Must be a power of 2 (2, 4, 8, 16, etc.). Maximum value of 1048576 (2^20).\\n * @returns The hostname of the newly purchased server.\\n */\\n purchaseServer(hostname: string, ram: number): string;\\n\\n /**\\n * Delete a purchased server.\\n * @remarks\\n * 2.25 GB\\n *\\n * Deletes one of your purchased servers, which is specified by its hostname.\\n *\\n * The hostname argument can be any data type, but it will be converted to a string.\\n * Whitespace is automatically removed from the string. This function will not delete a\\n * server that still has scripts running on it.\\n *\\n * @param host - Host of the server to delete.\\n * @returns True if successful, and false otherwise.\\n */\\n deleteServer(host: string): boolean;\\n\\n /**\\n * Returns an array with the hostnames of all of the servers you have purchased.\\n *\\n * @remarks 2.25 GB\\n * @returns Returns an array with the hostnames of all of the servers you have purchased.\\n */\\n getPurchasedServers(): string[];\\n\\n /**\\n * Returns the maximum number of servers you can purchase.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum number of servers you can purchase.\\n */\\n getPurchasedServerLimit(): number;\\n\\n /**\\n * Returns the maximum RAM that a purchased server can have.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Returns the maximum RAM (in GB) that a purchased server can have.\\n */\\n getPurchasedServerMaxRam(): number;\\n\\n /**\\n * Write data to a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function can be used to write data to a text file (.txt) or a script (.js or .script).\\n *\\n * This function will write data to that file. If the specified file does not exist,\\n * then it will be created. The third argument mode, defines how the data will be written to\\n * the file. If *mode is set to “w”, then the data is written in “write” mode which means\\n * that it will overwrite all existing data on the file. If mode is set to any other value\\n * then the data will be written in “append” mode which means that the data will be added at the\\n * end of the file.\\n *\\n * @param filename - Name of the file to be written to.\\n * @param data - Data to write.\\n * @param mode - Defines the write mode.\\n */\\n write(filename: string, data?: string[] | number | string, mode?: \\\"w\\\" | \\\"a\\\"): void;\\n\\n /**\\n * Attempt to write to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Attempts to write data to the specified Netscript Port.\\n * If the port is full, the data will not be written.\\n * Otherwise, the data will be written normally.\\n *\\n * @param port - Port or text file that will be written to.\\n * @param data - Data to write.\\n * @returns True if the data is successfully written to the port, and false otherwise.\\n */\\n tryWritePort(port: number, data: string | number): Promise;\\n\\n /**\\n * Read content of a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to read data from a text file (.txt) or script (.script, .js).\\n *\\n * This function will return the data in the specified file.\\n * If the file does not exist, an empty string will be returned.\\n *\\n * @param filename - Name of the file to be read.\\n * @returns Data in the specified text file.\\n */\\n read(filename: string): string;\\n\\n /**\\n * Get a copy of the data from a port without popping it.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * This function is used to peek at the data from a port. It returns the\\n * first element in the specified port without removing that element. If\\n * the port is empty, the string “NULL PORT DATA” will be returned.\\n *\\n * @param port - Port to peek. Must be an integer between 1 and 20.\\n * @returns Data in the specified port.\\n */\\n peek(port: number): PortData;\\n\\n /**\\n * Clear data from a file.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Delete all data from that text file.\\n *\\n * @param handle - Text file to clear.\\n */\\n clear(handle: string): void;\\n\\n /**\\n * Clear data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Deleta all data from the underlying queue.\\n *\\n * @param handle - Port to clear.\\n */\\n clearPort(handle: number): void;\\n\\n /**\\n * Write data to a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Write data to that netscript port.\\n * @returns The data popped off the queue if it was full.\\n */\\n writePort(port: number, data: string | number): Promise;\\n /**\\n * Read data from a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Read data from that port. A port is a serialized queue.\\n * This function will remove the first element from that queue and return it.\\n * If the queue is empty, then the string “NULL PORT DATA” will be returned.\\n * @returns the data read.\\n */\\n readPort(port: number): PortData;\\n\\n /**\\n * Get all data on a port.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Get a handle to a Netscript Port.\\n *\\n * WARNING: Port Handles only work in NetscriptJS (Netscript 2.0). They will not work in Netscript 1.0.\\n *\\n * @see https://bitburner.readthedocs.io/en/latest/netscript/netscriptmisc.html#netscript-ports\\n * @param port - Port number. Must be an integer between 1 and 20.\\n */\\n getPortHandle(port: number): NetscriptPort;\\n\\n /**\\n * Delete a file.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Removes the specified file from the current server. This function works for every file\\n * type except message (.msg) files.\\n *\\n * @param name - Filename of file to remove. Must include the extension.\\n * @param host - Host Address of the server on which to delete the file. Optional. Defaults to current server.\\n * @returns True if it successfully deletes the file, and false otherwise.\\n */\\n rm(name: string, host?: string): boolean;\\n\\n /**\\n * Check if any script with a filename is running.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Returns a boolean indicating whether any instance of the specified script is running\\n * on the target server, regardless of its arguments.\\n *\\n * This is different than the isRunning function because it does not try to\\n * identify a specific instance of a running script by its arguments.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * scriptRunning(\\\"foo.script\\\", getHostname());\\n * ```\\n * * @example\\n * ```ts\\n * // NS2:\\n * //The function call will return true if there is any script named foo.script running on the foodnstuff server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", \\\"foodnstuff\\\");\\n *\\n * //The function call will return true if there is any script named “foo.script” running on the current server, and false otherwise:\\n * ns.scriptRunning(\\\"foo.script\\\", ns.getHostname());\\n * ```\\n * @param script - Filename of script to check. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns True if the specified script is running, and false otherwise.\\n */\\n scriptRunning(script: string, host: string): boolean;\\n\\n /**\\n * Kill all scripts with a filename.\\n * @remarks\\n * RAM cost: 1 GB\\n *\\n * Kills all scripts with the specified filename on the target server specified by hostname,\\n * regardless of arguments.\\n *\\n * @param script - Filename of script to kill. This is case-sensitive.\\n * @param host - Host of target server.\\n * @returns true if one or more scripts were successfully killed, and false if none were.\\n */\\n scriptKill(script: string, host: string): boolean;\\n\\n /**\\n * Returns the current script name.\\n *\\n * @remarks RAM cost: 0 GB\\n * @returns Current script name.\\n */\\n getScriptName(): string;\\n\\n /**\\n * Get the ram cost of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of RAM required to run the specified script on the target server.\\n * Returns 0 if the script does not exist.\\n *\\n * @param script - Filename of script. This is case-sensitive.\\n * @param host - Host of target server the script is located on. This is optional, if it is not specified then the function will use the current server as the target server.\\n * @returns Amount of RAM (in GB) required to run the specified script on the target server, and 0 if the script does not exist.\\n */\\n getScriptRam(script: string, host?: string): number;\\n\\n /**\\n * Get the execution time of a hack() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * When `hack` completes an amount of money is stolen depending on the player's skills.\\n * Returns the amount of time in milliseconds it takes to execute the hack Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the hack Netscript function.\\n */\\n getHackTime(host: string): number;\\n\\n /**\\n * Get the execution time of a grow() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the grow Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the grow Netscript function.\\n */\\n getGrowTime(host: string): number;\\n\\n /**\\n * Get the execution time of a weaken() call.\\n * @remarks\\n * RAM cost: 0.05 GB\\n *\\n * Returns the amount of time in milliseconds it takes to execute the weaken Netscript function on the target server.\\n * The required time is increased by the security level of the target server and decreased by the player's hacking level.\\n *\\n * @param host - Host of target server.\\n * @returns Returns the amount of time in milliseconds it takes to execute the weaken Netscript function.\\n */\\n getWeakenTime(host: string): number;\\n\\n /**\\n * Get the income of all script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * @returns an array of two values.\\n * The first value is the total income (dollar / second) of all of your active scripts\\n * (scripts that are currently running on any server).\\n * The second value is the total income (dollar / second) that you’ve earned from scripts\\n * since you last installed Augmentations.\\n */\\n getTotalScriptIncome(): [number, number];\\n\\n /**\\n * Get the income of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of income the specified script generates while online\\n * (when the game is open, does not apply for offline income). Remember that\\n * a script is uniquely identified by both its name and its arguments. So for\\n * example if you ran a script with the arguments “foodnstuff” and “5” then\\n * in order to use this function to get that script’s income you must specify\\n * those same arguments in the same order in this function call.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of income the specified script generates while online.\\n */\\n getScriptIncome(script: string, host: string, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Get the exp gain of all script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * @returns total experience gain rate of all of your active scripts.\\n */\\n getTotalScriptExpGain(): number;\\n\\n /**\\n * Get the exp gain of a script.\\n * @remarks\\n * RAM cost: 0.1 GB\\n *\\n * Returns the amount of hacking experience the specified script generates while online\\n * (when the game is open, does not apply for offline experience gains). Remember that a\\n * script is uniquely identified by both its name and its arguments.\\n *\\n * This function can also return the total experience gain rate of all of your active\\n * scripts by running the function with no arguments.\\n *\\n * @param script - Filename of script.\\n * @param host - Server on which script is running.\\n * @param args - Arguments that the script is running with.\\n * @returns Amount of hacking experience the specified script generates while online.\\n */\\n getScriptExpGain(script: string, host: string, ...args: (string | number | boolean)[]): number;\\n\\n /**\\n * Returns the amount of time in milliseconds that have passed since you last installed Augmentations.\\n *\\n * @remarks RAM cost: 0.05 GB\\n * @returns Time in milliseconds that have passed since you last installed Augmentations.\\n */\\n getTimeSinceLastAug(): number;\\n\\n /**\\n * Format a string.\\n *\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formating arguments.\\n * @returns Formated text.\\n */\\n sprintf(format: string, ...args: any[]): string;\\n\\n /**\\n * Format a string with an array of arguments.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * see: https://github.com/alexei/sprintf.js\\n * @param format - String to format.\\n * @param args - Formating arguments.\\n * @returns Formated text.\\n */\\n vsprintf(format: string, args: any[]): string;\\n\\n /**\\n * Format a number\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Converts a number into a string with the specified formatter.\\n * This uses the numeraljs library, so the formatters must be compatible with that.\\n * This is the same function that the game itself uses to display numbers.\\n *\\n * see: http://numeraljs.com/\\n * @param n - Number to format.\\n * @param format - Formatter.\\n * @returns Formated number.\\n */\\n nFormat(n: number, format: string): string;\\n\\n /**\\n * Format time to readable string\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * @param milliseconds - Number of millisecond to format.\\n * @param milliPrecision - Format time with subsecond precision, defaults to false.\\n * @returns The formatted time.\\n */\\n tFormat(milliseconds: number, milliPrecision?: boolean): string;\\n\\n /**\\n * Prompt the player with an input modal.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Prompts the player with a dialog box. If `options.type` is undefined or \\\"boolean\\\",\\n * the player is shown \\\"Yes\\\" and \\\"No\\\" prompts, which return true and false respectively.\\n * Passing a type of \\\"text\\\" will give the player a text field and a value of \\\"select\\\"\\n * will show a drop-down field. Choosing type \\\"select\\\" will require an array or object\\n * to be passed via the `options.choices` property.\\n * The script’s execution is halted until the player selects one of the options.\\n *\\n * @param txt - Text to appear in the prompt dialog box.\\n * @param options - Options to modify the prompt the player is shown.\\n * @returns True if the player click “Yes”; false if the player clicks “No”; or the value entered by the player.\\n */\\n prompt(\\n txt: string,\\n options?: { type?: \\\"boolean\\\" | \\\"text\\\" | \\\"select\\\" | undefined; choices?: string[] },\\n ): Promise;\\n\\n /**\\n * Open up a message box.\\n * @param msg - Message to alert.\\n */\\n alert(msg: string): void;\\n\\n /**\\n * Queue a toast (bottom-right notification).\\n * @param msg - Message in the toast.\\n * @param variant - Type of toast, must be one of success, info, warning, error. Defaults to success.\\n * @param duration - Duration of toast in ms. Can also be `null` to create a persistent toast. Defaults to 2000\\n */\\n toast(msg: string, variant?: ToastVariantValues, duration?: number | null): void;\\n\\n /**\\n * Download a file from the internet.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Retrieves data from a URL and downloads it to a file on the specified server.\\n * The data can only be downloaded to a script (.script, .js) or a text file (.txt).\\n * If the file already exists, it will be overwritten by this command.\\n * Note that it will not be possible to download data from many websites because they\\n * do not allow cross-origin resource sharing (CORS).\\n *\\n * IMPORTANT: This is an asynchronous function that returns a Promise.\\n * The Promise’s resolved value will be a boolean indicating whether or not the data was\\n * successfully retrieved from the URL. Because the function is async and returns a Promise,\\n * it is recommended you use wget in NetscriptJS (Netscript 2.0).\\n *\\n * In NetscriptJS, you must preface any call to wget with the await keyword (like you would hack or sleep).\\n * wget will still work in Netscript 1.0, but the functions execution will not be synchronous\\n * (i.e. it may not execute when you expect/want it to).\\n * Furthermore, since Promises are not supported in ES5,\\n * you will not be able to process the returned value of wget in Netscript 1.0.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * await ns.wget(\\\"https://raw.githubusercontent.com/danielyxie/bitburner/master/README.md\\\", \\\"game_readme.txt\\\");\\n * ```\\n * @param url - URL to pull data from.\\n * @param target - Filename to write data to. Must be script or text file.\\n * @param host - Optional hostname/ip of server for target file.\\n * @returns True if the data was successfully retrieved from the URL, false otherwise.\\n */\\n wget(url: string, target: string, host?: string): Promise;\\n\\n /**\\n * Returns the amount of Faction favor required to be able to donate to a faction.\\n *\\n * @remarks RAM cost: 0.1 GB\\n * @returns Amount of Faction favor required to be able to donate to a faction.\\n */\\n getFavorToDonate(): number;\\n\\n /**\\n * Get the current Bitnode multipliers.\\n * @remarks\\n * RAM cost: 4 GB\\n *\\n * Returns an object containing the current BitNode multipliers.\\n * This function requires you to be in Bitnode 5 or have Source-File 5 in order to run.\\n * The multipliers are returned in decimal forms (e.g. 1.5 instead of 150%).\\n * The multipliers represent the difference between the current BitNode and\\n * the original BitNode (BitNode-1).\\n *\\n * For example, if the CrimeMoney multiplier has a value of 0.1, then that means\\n * that committing crimes in the current BitNode will only give 10% of the money\\n * you would have received in BitNode-1.\\n *\\n * @example\\n * ```ts\\n * // NS1:\\n * var mults = getBitNodeMultipliers();\\n * print(mults.ServerMaxMoney);\\n * print(mults.HackExpGain);\\n * ```\\n * @example\\n * ```ts\\n * // NS2:\\n * const {ServerMaxMoney, HackExpGain} = ns.getBitNodeMultipliers();\\n * print(ServerMaxMoney);\\n * print(HackExpGain);\\n * ```\\n * @returns Object containing the current BitNode multipliers.\\n */\\n getBitNodeMultipliers(): BitNodeMultipliers;\\n\\n /**\\n * Get information about the player.\\n * @remarks\\n * RAM cost: 0.5 GB\\n *\\n * Returns an object with information on the current player.\\n *\\n * @returns Player info\\n */\\n getPlayer(): Player;\\n\\n /**\\n * Add callback function when the script dies\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Add callback to be executed when the script dies.\\n */\\n atExit(f: () => void): void;\\n\\n /**\\n * Move a file on the target server.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * NS2 exclusive\\n *\\n * Move the source file to the specified destination on the target server.\\n *\\n * This command only works for scripts and text files (.txt). It cannot, however, be used\\n * to convert from script to text file, or vice versa.\\n *\\n * This function can also be used to rename files.\\n *\\n * @param host - Host of target server.\\n * @param source - Filename of the source file.\\n * @param destination - Filename of the destination file.\\n */\\n mv(host: string, source: string, destination: string): void;\\n\\n /**\\n * Parse command line flags.\\n * @remarks\\n * RAM cost: 0 GB\\n *\\n * Allows unix like flag parsing.\\n * @example\\n * ```ts\\n * // example.script\\n * var data = flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * tprint(data);\\n *\\n * // example.js\\n * export async function main(ns) {\\n * const data = ns.flags([\\n * ['delay', 0], // a default number means this flag is a number\\n * ['server', 'foodnstuff'], // a default string means this flag is a string\\n * ['exclude', []], // a default array means this flag is a default array of string\\n * ['help', false], // a default boolean means this flag is a boolean\\n * ]);\\n * ns.tprint(data);\\n * }\\n *\\n * // [home ~/]> run example.script\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false}\\n * // [home ~/]> run example.script --delay 3000\\n * // {\\\"_\\\":[],\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi\\n * // {\\\"_\\\":[],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"exclude\\\":[],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\"}\\n * // [home ~/]> run example.script --delay 3000 --server harakiri-sushi hello world --exclude a --exclude b\\n * // {\\\"_\\\":[\\\"hello\\\",\\\"world\\\"],\\\"help\\\":false,\\\"delay\\\":3000,\\\"server\\\":\\\"harakiri-sushi\\\",\\\"exclude\\\":[\\\"a\\\",\\\"b\\\"]}\\n * // [home ~/]> run example.script --help\\n * // {\\\"_\\\":[],\\\"delay\\\":0,\\\"server\\\":\\\"foodnstuff\\\",\\\"exclude\\\":[],\\\"help\\\":true}\\n * ```\\n */\\n flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };\\n\\n /**\\n * Share your computer with your factions.\\n * @remarks\\n * RAM cost: 2.4 GB\\n *\\n * Increases your rep gain of hacking contracts while share is called.\\n * Scales with thread count.\\n */\\n share(): Promise;\\n\\n /**\\n * Calculate your share power. Based on all the active share calls.\\n * @remarks\\n * RAM cost: 0.2 GB\\n */\\n getSharePower(): number;\\n\\n enums: NSEnums;\\n}\\n\\n/** @public */\\nexport enum ToastVariant {\\n SUCCESS = \\\"success\\\",\\n WARNING = \\\"warning\\\",\\n ERROR = \\\"error\\\",\\n INFO = \\\"info\\\",\\n}\\n\\n/** @public */\\nexport type ToastVariantValues = `${ToastVariant}`;\\n\\n/** @public */\\nexport interface NSEnums {\\n toast: typeof ToastVariant;\\n}\\n\\n/**\\n * Corporation Office API\\n * @remarks\\n * Requires the Office API upgrade from your corporation.\\n * @public\\n */\\nexport interface OfficeAPI {\\n /**\\n * Assign an employee to a job.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - name of the employee\\n * @param job - Name of the job.\\n */\\n assignJob(divisionName: string, cityName: string, employeeName: string, job: string): void;\\n /**\\n * Hire an employee.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns The newly hired employee, if any\\n */\\n hireEmployee(divisionName: string, cityName: string): Employee | undefined;\\n /**\\n * Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n */\\n upgradeOfficeSize(divisionName: string, cityName: string, size: number): void;\\n /**\\n * Throw a party for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param costPerEmployee - Amount to spend per employee.\\n * @returns Multiplier for happiness and morale, or zero on failure\\n */\\n throwParty(divisionName: string, cityName: string, costPerEmployee: number): number;\\n /**\\n * Buy coffee for your employees\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns true if buying coffee was successful, false otherwise\\n */\\n buyCoffee(divisionName: string, cityName: string): boolean;\\n /**\\n * Hire AdVert.\\n * @param divisionName - Name of the division\\n */\\n hireAdVert(divisionName: string): void;\\n /**\\n * Purchase a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n */\\n research(divisionName: string, researchName: string): void;\\n /**\\n * Get data about an office\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns Office data\\n */\\n getOffice(divisionName: string, cityName: string): Office;\\n /**\\n * Get data about an employee\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param employeeName - Name of the employee\\n * @returns Employee data\\n */\\n getEmployee(divisionName: string, cityName: string, employeeName: string): Employee;\\n /**\\n * Get the cost to Hire AdVert\\n * @param divisionName - Name of the division\\n * @returns Cost\\n */\\n getHireAdVertCost(divisionName: string): number;\\n /**\\n * Get the number of times you have Hired AdVert\\n * @param divisionName - Name of the division\\n * @returns Number of times you have Hired AdVert\\n */\\n getHireAdVertCount(adivisionName: string): number;\\n /**\\n * Get the cost to unlock research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns cost\\n */\\n getResearchCost(divisionName: string, researchName: string): number;\\n /**\\n * Gets if you have unlocked a research\\n * @param divisionName - Name of the division\\n * @param researchName - Name of the research\\n * @returns true is unlocked, false if not\\n */\\n hasResearched(divisionName: string, researchName: string): boolean;\\n /**\\n * Set the auto job assignment for a job\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param job - Name of the job\\n * @param amount - Number of employees to assign to that job\\n * @returns true if the employee count reached the target amount, false if not\\n */\\n setAutoJobAssignment(divisionName: string, cityName: string, job: string, amount: number): boolean;\\n /**\\n * Cost to Upgrade office size.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param size - Amount of positions to open\\n * @returns Cost of upgrading the office\\n */\\n getOfficeSizeUpgradeCost(divisionName: string, cityName: string, asize: number): number;\\n}\\n\\n/**\\n * Corporation Warehouse API\\n * @remarks\\n * Requires the Warehouse API upgrade from your corporation.\\n * @public\\n */\\nexport interface WarehouseAPI {\\n /**\\n * Set material sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n */\\n sellMaterial(divisionName: string, cityName: string, materialName: string, amt: string, price: string): void;\\n /**\\n * Set product sell data.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param amt - Amount to sell, can be \\\"MAX\\\"\\n * @param price - Price to sell, can be \\\"MP\\\"\\n * @param all - Sell in all city\\n */\\n sellProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n amt: string,\\n price: string,\\n all: boolean,\\n ): void;\\n /**\\n * Discontinue a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n */\\n discontinueProduct(divisionName: string, productName: string): void;\\n /**\\n * Set smart supply\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param enabled - smart supply enabled\\n */\\n setSmartSupply(divisionName: string, cityName: string, enabled: boolean): void;\\n /**\\n * Set whether smart supply uses leftovers before buying\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param enabled - smart supply use leftovers enabled\\n */\\n setSmartSupplyUseLeftovers(divisionName: string, cityName: string, materialName: string, enabled: boolean): void;\\n /**\\n * Set material buy data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to buy\\n */\\n buyMaterial(divisionName: string, cityName: string, materialName: string, amt: number): void;\\n /**\\n * Set material to bulk buy\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to buy\\n */\\n bulkPurchase(divisionName: string, cityName: string, materialName: string, amt: number): void;\\n /**\\n * Get warehouse data\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @returns warehouse data\\n */\\n getWarehouse(divisionName: string, cityName: string): Warehouse;\\n /**\\n * Get product data\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @returns product data\\n */\\n getProduct(divisionName: string, productName: string): Product;\\n /**\\n * Get material data\\n * @param divisionName - Name of the division\\n * @param materialName - Name of the material\\n * @returns material data\\n */\\n getMaterial(divisionName: string, cityName: string, materialName: string): Material;\\n /**\\n * Set market TA 1 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA1(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a material.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param on - market ta enabled\\n */\\n setMaterialMarketTA2(divisionName: string, cityName: string, materialName: string, on: boolean): void;\\n /**\\n * Set market TA 1 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA1(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set market TA 2 for a product.\\n * @param divisionName - Name of the division\\n * @param productName - Name of the product\\n * @param on - market ta enabled\\n */\\n setProductMarketTA2(divisionName: string, productName: string, on: boolean): void;\\n /**\\n * Set material export data\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n exportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Cancel material export\\n * @param sourceDivision - Source division\\n * @param sourceCity - Source city\\n * @param targetDivision - Target division\\n * @param targetCity - Target city\\n * @param materialName - Name of the material\\n * @param amt - Amount of material to export.\\n */\\n cancelExportMaterial(\\n sourceDivision: string,\\n sourceCity: string,\\n targetDivision: string,\\n targetCity: string,\\n materialName: string,\\n amt: number,\\n ): void;\\n /**\\n * Purchase warehouse for a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n purchaseWarehouse(divisionName: string, cityName: string): void;\\n /**\\n * Upgrade warehouse\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param amt - amount of upgrades defaults to 1\\n */\\n upgradeWarehouse(divisionName: string, cityName: string, amt?: number): void;\\n /**\\n * Create a new product\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param designInvest - Amount to invest for the design of the product.\\n * @param marketingInvest - Amount to invest for the marketing of the product.\\n */\\n makeProduct(\\n divisionName: string,\\n cityName: string,\\n productName: string,\\n designInvest: number,\\n marketingInvest: number,\\n ): void;\\n /**\\n * Limit Material Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param materialName - Name of the material\\n * @param qty - Amount to limit to\\n */\\n limitMaterialProduction(divisionName: string, cityName: string, materialName: string, qty: number): void;\\n /**\\n * Limit Product Production.\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param productName - Name of the product\\n * @param qty - Amount to limit to\\n */\\n limitProductProduction(divisionName: string, cityName: string, productName: string, qty: number): void;\\n /**\\n * Gets the cost to purchase a warehouse\\n * @returns cost\\n */\\n getPurchaseWarehouseCost(): number;\\n /**\\n * Gets the cost to upgrade a warehouse to the next level\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n * @param amt - amount of upgrades defaults to 1\\n * @returns cost to upgrade\\n */\\n getUpgradeWarehouseCost(adivisionName: string, acityName: string, amt?: number): number;\\n /**\\n * Check if you have a warehouse in city\\n * @returns true if warehouse is present, false if not\\n */\\n hasWarehouse(adivisionName: string, acityName: string): boolean;\\n}\\n\\n/**\\n * Corporation API\\n * @public\\n */\\nexport interface Corporation extends WarehouseAPI, OfficeAPI {\\n /**\\n * Create a Corporation\\n * @param divisionName - Name of the division\\n * @param selfFund - If you should self fund, defaults to true, false will only work on Bitnode 3\\n * @returns true if created and false if not\\n */\\n createCorporation(corporationName: string, selfFund: boolean): boolean;\\n /**\\n * Check if you have a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns true if unlocked and false if not\\n */\\n hasUnlockUpgrade(upgradeName: string): boolean;\\n /**\\n * Gets the cost to unlock a one time unlockable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUnlockUpgradeCost(upgradeName: string): number;\\n /**\\n * Get the level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns the level of the upgrade\\n */\\n getUpgradeLevel(upgradeName: string): number;\\n /**\\n * Gets the cost to unlock the next level of a levelable upgrade\\n * @param upgradeName - Name of the upgrade\\n * @returns cost of the upgrade\\n */\\n getUpgradeLevelCost(upgradeName: string): number;\\n /**\\n * Gets the cost to expand into a new industry\\n * @param industryName - Name of the industry\\n * @returns cost\\n */\\n getExpandIndustryCost(industryName: string): number;\\n /**\\n * Gets the cost to expand into a new city\\n * @returns cost\\n */\\n getExpandCityCost(): number;\\n /**\\n * Get an offer for investment based on you companies current valuation\\n * @returns An offer of investment\\n */\\n getInvestmentOffer(): InvestmentOffer;\\n /**\\n * Get list of materials\\n * @returns material names\\n */\\n getMaterialNames(): string[];\\n /**\\n * Get list of industry types\\n * @returns industry names\\n */\\n getIndustryTypes(): string[];\\n /**\\n * Get list of one-time unlockable upgrades\\n * @returns unlockable upgrades names\\n */\\n getUnlockables(): string[];\\n /**\\n * Get list of upgrade names\\n * @returns upgrade names\\n */\\n getUpgradeNames(): string[];\\n /**\\n * Get list of research names\\n * @returns research names\\n */\\n getResearchNames(): string[];\\n /**\\n * Accept investment based on you companies current valuation\\n * @remarks\\n * Is based on current valuation and will not honer a specific Offer\\n * @returns An offer of investment\\n */\\n acceptInvestmentOffer(): boolean;\\n /**\\n * Go public\\n * @param numShares - number of shares you would like to issue for your IPO\\n * @returns true if you successfully go public, false if not\\n */\\n goPublic(numShares: number): boolean;\\n /**\\n * Bribe a faction\\n * @param factionName - Faction name\\n * @param amountCash - Amount of money to bribe\\n * @returns True if successful, false if not\\n */\\n bribe(factionName: string, amountCash: number): boolean;\\n /**\\n * Get corporation data\\n * @returns Corporation data\\n */\\n getCorporation(): CorporationInfo;\\n /**\\n * Get division data\\n * @param divisionName - Name of the division\\n * @returns Division data\\n */\\n getDivision(divisionName: string): Division;\\n /**\\n * Expand to a new industry\\n * @param industryType - Name of the industry\\n * @param divisionName - Name of the division\\n */\\n expandIndustry(industryType: string, divisionName: string): void;\\n /**\\n * Expand to a new city\\n * @param divisionName - Name of the division\\n * @param cityName - Name of the city\\n */\\n expandCity(divisionName: string, cityName: string): void;\\n /**\\n * Unlock an upgrade\\n * @param upgradeName - Name of the upgrade\\n */\\n unlockUpgrade(upgradeName: string): void;\\n /**\\n * Level an upgrade.\\n * @param upgradeName - Name of the upgrade\\n */\\n levelUpgrade(upgradeName: string): void;\\n /**\\n * Issue dividends\\n * @param rate - Fraction of profit to issue as dividends.\\n */\\n issueDividends(rate: number): void;\\n /**\\n * Buyback Shares\\n * @param amount - Amount of shares to buy back.\\n *\\n */\\n buyBackShares(amount: number): void;\\n /**\\n * Sell Shares\\n * @param amount - Amount of shares to sell.\\n *\\n */\\n sellShares(amount: number): void;\\n /**\\n * Get bonus time.\\n *\\n * “Bonus time” is accumulated when the game is offline or if the game is inactive in the browser.\\n *\\n * “Bonus time” makes the game progress faster.\\n *\\n * @returns Bonus time for the Corporation mechanic in milliseconds.\\n */\\n getBonusTime(): number;\\n}\\n\\n/**\\n * General info about a corporation\\n * @public\\n */\\ninterface CorporationInfo {\\n /** Name of the corporation */\\n name: string;\\n /** Funds available */\\n funds: number;\\n /** Revenue per second this cycle */\\n revenue: number;\\n /** Expenses per second this cycle */\\n expenses: number;\\n /** Indicating if the company is public */\\n public: boolean;\\n /** Total number of shares issues by this corporation */\\n totalShares: number;\\n /** Amount of share owned */\\n numShares: number;\\n /** Cooldown until shares can be sold again */\\n shareSaleCooldown: number;\\n /** Amount of shares issued */\\n issuedShares: number;\\n /** Price of the shares */\\n sharePrice: number;\\n /** Fraction of profits issued as dividends */\\n dividendRate: number;\\n /** Tax applied on your earnings as a shareholder */\\n dividendTax: number;\\n /** Your earnings as a shareholder per second this cycle */\\n dividendEarnings: number;\\n /** State of the corporation. Possible states are START, PURCHASE, PRODUCTION, SALE, EXPORT. */\\n state: string;\\n /** Array of all divisions */\\n divisions: Division[];\\n}\\n\\n/**\\n * Employee in an office\\n * @public\\n */\\nexport interface Employee {\\n /** Name of the employee */\\n name: string;\\n /** Morale of the employee */\\n mor: number;\\n /** Happiness of the employee */\\n hap: number;\\n /** Energy of the employee */\\n ene: number;\\n /** Intelligence of the employee */\\n int: number;\\n /** Charisma of the employee */\\n cha: number;\\n /** Experience of the employee */\\n exp: number;\\n /** Creativity of the employee */\\n cre: number;\\n /** Efficiency of the employee */\\n eff: number;\\n /** Salary of the employee */\\n sal: number;\\n /** Current Location (city) */\\n loc: string;\\n /** Current job position */\\n pos: string;\\n}\\n\\n/**\\n * Product in a warehouse\\n * @public\\n */\\ninterface Product {\\n /** Name of the product */\\n name: string;\\n /** Demand for the product, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the product, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Product Rating */\\n rat: number;\\n /** Product Properties. The data is \\\\{qlt, per, dur, rel, aes, fea\\\\} */\\n properties: { [key: string]: number };\\n /** Production cost */\\n pCost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | number;\\n /** Data refers to the production, sale, and quantity of the products\\n * These values are specific to a city\\n * For each city, the data is [qty, prod, sell] */\\n cityData: { [key: string]: number[] };\\n /** Creation progress - A number between 0-100 representing percentage */\\n developmentProgress: number;\\n}\\n\\n/**\\n * Material in a warehouse\\n * @public\\n */\\ninterface Material {\\n /** Name of the material */\\n name: string;\\n /** Amount of material */\\n qty: number;\\n /** Quality of the material */\\n qlt: number;\\n /** Demand for the material, only present if \\\"Market Research - Demand\\\" unlocked */\\n dmd: number | undefined;\\n /** Competition for the material, only present if \\\"Market Research - Competition\\\" unlocked */\\n cmp: number | undefined;\\n /** Amount of material produced */\\n prod: number;\\n /** Amount of material sold */\\n sell: number;\\n /** cost to buy material */\\n cost: number;\\n /** Sell cost, can be \\\"MP+5\\\" */\\n sCost: string | number;\\n}\\n\\n/**\\n * Warehouse for a division in a city\\n * @public\\n */\\ninterface Warehouse {\\n /** Amount of size upgrade bought */\\n level: number;\\n /** City in which the warehouse is located */\\n loc: string;\\n /** Total space in the warehouse */\\n size: number;\\n /** Used space in the warehouse */\\n sizeUsed: number;\\n /** Smart Supply status in the warehouse */\\n smartSupplyEnabled: boolean;\\n}\\n\\n/**\\n * Office for a division in a city.\\n * @public\\n */\\nexport interface Office {\\n /** City of the office */\\n loc: string;\\n /** Maximum number of employee */\\n size: number;\\n /** Minimum amount of energy of the employees */\\n minEne: number;\\n /** Maximum amount of energy of the employees */\\n maxEne: number;\\n /** Minimum happiness of the employees */\\n minHap: number;\\n /** Maximum happiness of the employees */\\n maxHap: number;\\n /** Minimum morale of the employees */\\n minMor: number;\\n /** Maximum morale of the employees */\\n maxMor: number;\\n /** Name of all the employees */\\n employees: string[];\\n /** Production of the employees */\\n employeeProd: EmployeeJobs;\\n /** Positions of the employees */\\n employeeJobs: EmployeeJobs;\\n}\\n\\n/**\\n * Object representing the number of employee in each job.\\n * @public\\n */\\ninterface EmployeeJobs {\\n Operations: number;\\n Engineer: number;\\n Business: number;\\n Management: number;\\n \\\"Research & Development\\\": number;\\n Training: number;\\n Unassigned: number;\\n}\\n\\n/**\\n * Corporation division\\n * @public\\n */\\ninterface Division {\\n /** Name of the division */\\n name: string;\\n /** Type of division, like Agriculture */\\n type: string;\\n /** Awareness of the division */\\n awareness: number;\\n /** Popularity of the division */\\n popularity: number;\\n /** Production multiplier */\\n prodMult: number;\\n /** Amount of research in that division */\\n research: number;\\n /** Revenue last cycle */\\n lastCycleRevenue: number;\\n /** Expenses last cycle */\\n lastCycleExpenses: number;\\n /** Revenue this cycle */\\n thisCycleRevenue: number;\\n /** Expenses this cycle */\\n thisCycleExpenses: number;\\n /** All research bought */\\n upgrades: number[];\\n /** Cities in which this division has expanded */\\n cities: string[];\\n /** Products developed by this division */\\n products: string[];\\n /** Whether the industry this division is in is capable of making products */\\n makesProducts: boolean;\\n}\\n\\n/**\\n * Corporation investment offer\\n * @public\\n */\\ninterface InvestmentOffer {\\n /** Amount of funds you will get from this investment */\\n funds: number;\\n /** Amount of share you will give in exchange for this investment */\\n shares: number;\\n /** Current round of funding (max 4) */\\n round: number;\\n}\\n\\n/**\\n * Interface Theme\\n * @internal\\n */\\ninterface UserInterfaceTheme {\\n [key: string]: string | undefined;\\n primarylight: string;\\n primary: string;\\n primarydark: string;\\n successlight: string;\\n success: string;\\n successdark: string;\\n errorlight: string;\\n error: string;\\n errordark: string;\\n secondarylight: string;\\n secondary: string;\\n secondarydark: string;\\n warninglight: string;\\n warning: string;\\n warningdark: string;\\n infolight: string;\\n info: string;\\n infodark: string;\\n welllight: string;\\n well: string;\\n white: string;\\n black: string;\\n hp: string;\\n money: string;\\n hack: string;\\n combat: string;\\n cha: string;\\n int: string;\\n rep: string;\\n disabled: string;\\n backgroundprimary: string;\\n backgroundsecondary: string;\\n button: string;\\n}\\n\\n/**\\n * Interface Styles\\n * @internal\\n */\\ninterface IStyleSettings {\\n fontFamily: string;\\n lineHeight: number;\\n}\\n\\n/**\\n * Game Information\\n * @internal\\n */\\ninterface GameInfo {\\n version: string;\\n commit: string;\\n platform: string;\\n}\\n\\n/**\\n * Used for autocompletion\\n * @public\\n */\\ninterface AutocompleteData {\\n servers: string[];\\n scripts: string[];\\n txts: string[];\\n flags(schema: [string, string | number | boolean | string[]][]): { [key: string]: ScriptArg | string[] };\\n}\\n\";","/**\n * React component for displaying a single augmentation for purchase through\n * the faction UI\n */\nimport { CheckBox, CheckBoxOutlineBlank, CheckCircle, NewReleases, Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Augmentation } from \"../Augmentation\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { PurchaseAugmentationModal } from \"./PurchaseAugmentationModal\";\n\ninterface IPreReqsProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst PreReqs = (props: IPreReqsProps): React.ReactElement => {\n const ownedPreReqs = props.aug.prereqs.filter((aug) => props.player.hasAugmentation(aug));\n const hasPreReqs = props.aug.prereqs.length > 0 && ownedPreReqs.length === props.aug.prereqs.length;\n\n return (\n \n \n This Augmentation has the following pre-requisite(s):\n \n {props.aug.prereqs.map((preAug) => (\n \n ))}\n \n }\n >\n \n {hasPreReqs ? (\n <>\n \n Pre-requisites Owned\n \n ) : (\n <>\n \n Missing {props.aug.prereqs.length - ownedPreReqs.length} pre-requisite(s)\n \n )}\n \n \n );\n};\n\ninterface IExclusiveProps {\n player: IPlayer;\n aug: Augmentation;\n}\n\nconst Exclusive = (props: IExclusiveProps): React.ReactElement => {\n return (\n \n \n This Augmentation can only be acquired from the following source(s):\n \n
      \n \n
    • \n {props.aug.factions[0]} faction\n
    • \n {props.player.isAwareOfGang() && !props.aug.isSpecial && (\n
    • \n Certain gangs\n
    • \n )}\n {props.player.canAccessGrafting() &&\n !props.aug.isSpecial &&\n props.aug.name !== AugmentationNames.TheRedPill && (\n
    • \n Grafting\n
    • \n )}\n
      \n
    \n \n }\n >\n \n \n );\n};\n\ninterface IReqProps {\n value: string;\n color: string;\n fulfilled: boolean;\n}\n\nconst Requirement = (props: IReqProps): React.ReactElement => {\n return (\n \n {props.fulfilled ? : }\n {props.value}\n \n );\n};\n\ninterface IPurchasableAugsProps {\n augNames: string[];\n ownedAugNames: string[];\n player: IPlayer;\n\n canPurchase: (player: IPlayer, aug: Augmentation) => boolean;\n purchaseAugmentation: (player: IPlayer, aug: Augmentation, showModal: (open: boolean) => void) => void;\n\n rep?: number;\n sleeveAugs?: boolean;\n faction?: Faction;\n}\n\nexport const PurchasableAugmentations = (props: IPurchasableAugsProps): React.ReactElement => {\n return (\n \n {props.augNames.map((augName: string) => (\n \n ))}\n {props.ownedAugNames.map((augName: string) => (\n \n ))}\n \n );\n};\n\ninterface IPurchasableAugProps {\n parent: IPurchasableAugsProps;\n augName: string;\n owned: boolean;\n}\n\nexport function PurchasableAugmentation(props: IPurchasableAugProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n\n const aug = StaticAugmentations[props.augName];\n const augCosts = aug.getCost(props.parent.player);\n const cost = props.parent.sleeveAugs ? aug.baseCost : augCosts.moneyCost;\n const repCost = augCosts.repCost;\n const info = typeof aug.info === \"string\" ? {aug.info} : aug.info;\n const description = (\n <>\n {info}\n
    \n
    \n {aug.stats}\n \n );\n\n return (\n \n <>\n \n \n props.parent.purchaseAugmentation(props.parent.player, aug, (open): void => {\n setOpen(open);\n })\n }\n disabled={!props.parent.canPurchase(props.parent.player, aug) || props.owned}\n sx={{ width: \"48px\", height: \"36px\", float: \"left\", clear: \"none\", mr: 1 }}\n >\n {props.owned ? \"Owned\" : \"Buy\"}\n \n\n \n \n \n \n {props.augName}\n {props.augName === AugmentationNames.NeuroFluxGovernor &&\n ` - Level ${aug.getLevel(props.parent.player)}`}\n \n {description}\n \n }\n >\n \n {aug.name}\n {aug.name === AugmentationNames.NeuroFluxGovernor && ` - Level ${aug.getLevel(props.parent.player)}`}\n \n \n\n {aug.factions.length === 1 && !props.parent.sleeveAugs && (\n \n )}\n {aug.prereqs.length > 0 && !props.parent.sleeveAugs && }\n \n \n \n\n {props.owned || (\n \n cost}\n value={numeralWrapper.formatMoney(cost)}\n color={Settings.theme.money}\n />\n {props.parent.rep !== undefined && (\n = repCost}\n value={`${numeralWrapper.formatReputation(repCost)} rep`}\n color={Settings.theme.rep}\n />\n )}\n \n )}\n\n {Settings.SuppressBuyAugmentationConfirmation || (\n setOpen(false)}\n faction={props.parent.faction}\n aug={aug}\n />\n )}\n \n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a Travel Agency\n *\n * TThis subcomponent renders all of the buttons for traveling to different cities\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { CityName } from \"../data/CityNames\";\nimport { TravelConfirmationModal } from \"./TravelConfirmationModal\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { use } from \"../../ui/Context\";\nimport { Money } from \"../../ui/React/Money\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\n\ntype IProps = {\n p: IPlayer;\n router: IRouter;\n};\n\nfunction travel(p: IPlayer, router: IRouter, to: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!p.canAfford(cost)) {\n return;\n }\n\n p.loseMoney(cost, \"other\");\n p.travel(to);\n dialogBoxCreate(<>You are now in {to}!);\n router.toCity();\n}\n\nexport function TravelAgencyRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n const [open, setOpen] = useState(false);\n const [destination, setDestination] = useState(CityName.Sector12);\n function rerender(): void {\n setRerender((o) => !o);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => clearInterval(id);\n }, []);\n\n function startTravel(city: CityName): void {\n const cost = CONSTANTS.TravelCost;\n if (!player.canAfford(cost)) {\n return;\n }\n if (Settings.SuppressTravelConfirmation) {\n travel(player, router, city);\n return;\n }\n setOpen(true);\n setDestination(city);\n }\n\n return (\n <>\n Travel Agency\n \n \n From here, you can travel to any other city! A ticket costs{\" \"}\n .\n \n {Settings.DisableASCIIArt ? (\n <>\n {Object.values(CityName)\n .filter((city: string) => city != props.p.city)\n .map((city: string) => {\n const match = Object.entries(CityName).find((entry) => entry[1] === city);\n if (match === undefined) throw new Error(`could not find key for city '${city}'`);\n return (\n \n \n
    \n
    \n );\n })}\n \n ) : (\n startTravel(city)} />\n )}\n
    \n travel(player, router, destination)}\n open={open}\n onClose={() => setOpen(false)}\n />\n \n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Editor, { Monaco } from \"@monaco-editor/react\";\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\ntype ITextModel = monaco.editor.ITextModel;\nimport { OptionsModal } from \"./OptionsModal\";\nimport { Options } from \"./Options\";\nimport { isValidFilePath } from \"../../Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { isScriptFilename } from \"../../Script/isScriptFilename\";\nimport { Script } from \"../../Script/Script\";\nimport { TextFile } from \"../../TextFile\";\nimport { calculateRamUsage, checkInfiniteLoop } from \"../../Script/RamCalculations\";\nimport { RamCalculationErrorCode } from \"../../Script/RamCalculationErrorCodes\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { DragDropContext, Droppable, Draggable } from \"react-beautiful-dnd\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { NetscriptFunctions } from \"../../NetscriptFunctions\";\nimport { WorkerScript } from \"../../Netscript/WorkerScript\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { iTutorialNextStep, ITutorial, iTutorialSteps } from \"../../InteractiveTutorial\";\nimport { debounce } from \"lodash\";\nimport { saveObject } from \"../../SaveObject\";\nimport { loadThemes, makeTheme, sanitizeTheme } from \"./themes\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport Link from \"@mui/material/Link\";\nimport Box from \"@mui/material/Box\";\nimport SettingsIcon from \"@mui/icons-material/Settings\";\nimport SyncIcon from \"@mui/icons-material/Sync\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport Table from \"@mui/material/Table\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableRow from \"@mui/material/TableRow\";\nimport TableBody from \"@mui/material/TableBody\";\nimport { PromptEvent } from \"../../ui/React/PromptManager\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport libSource from \"!!raw-loader!../NetscriptDefinitions.d.ts\";\nimport { TextField, Tooltip } from \"@mui/material\";\n\ninterface IProps {\n // Map of filename -> code\n files: Record;\n hostname: string;\n player: IPlayer;\n router: IRouter;\n vim: boolean;\n}\n\n// TODO: try to remove global symbols\nlet symbolsLoaded = false;\nlet symbols: string[] = [];\nexport function SetupTextEditor(): void {\n const ns = NetscriptFunctions({ args: [] } as unknown as WorkerScript);\n\n // Populates symbols for text editor\n function populate(ns: any): string[] {\n let symbols: string[] = [];\n const keys = Object.keys(ns);\n for (const key of keys) {\n if (typeof ns[key] === \"object\") {\n symbols.push(key);\n symbols = symbols.concat(populate(ns[key]));\n }\n if (typeof ns[key] === \"function\") {\n symbols.push(key);\n }\n }\n\n return symbols;\n }\n\n symbols = populate(ns);\n\n const exclude = [\"heart\", \"break\", \"exploit\", \"bypass\", \"corporation\", \"alterReality\"];\n symbols = symbols.filter((symbol: string) => !exclude.includes(symbol)).sort();\n}\n\n// Holds all the data for a open script\nclass OpenScript {\n fileName: string;\n code: string;\n hostname: string;\n lastPosition: monaco.Position;\n model: ITextModel;\n isTxt: boolean;\n\n constructor(fileName: string, code: string, hostname: string, lastPosition: monaco.Position, model: ITextModel) {\n this.fileName = fileName;\n this.code = code;\n this.hostname = hostname;\n this.lastPosition = lastPosition;\n this.model = model;\n this.isTxt = fileName.endsWith(\".txt\");\n }\n}\n\nconst openScripts: OpenScript[] = [];\nlet currentScript: OpenScript | null = null;\n\n// Called every time script editor is opened\nexport function Root(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n const editorRef = useRef(null);\n const monacoRef = useRef(null);\n const vimStatusRef = useRef(null);\n const [vimEditor, setVimEditor] = useState(null);\n const [editor, setEditor] = useState(null);\n const [filter, setFilter] = useState(\"\");\n const [searchExpanded, setSearchExpanded] = useState(false);\n\n const [ram, setRAM] = useState(\"RAM: ???\");\n const [ramEntries, setRamEntries] = useState([[\"???\", \"\"]]);\n const [updatingRam, setUpdatingRam] = useState(false);\n const [decorations, setDecorations] = useState([]);\n\n const [optionsOpen, setOptionsOpen] = useState(false);\n const [options, setOptions] = useState({\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: props.vim || Settings.MonacoVim,\n });\n\n const [ramInfoOpen, setRamInfoOpen] = useState(false);\n\n // Prevent Crash if script is open on deleted server\n for (let i = openScripts.length - 1; i >= 0; i--) {\n GetServer(openScripts[i].hostname) === null && openScripts.splice(i, 1);\n }\n if (currentScript && GetServer(currentScript.hostname) === null) {\n currentScript = openScripts[0];\n if (currentScript === undefined) currentScript = null;\n }\n\n useEffect(() => {\n if (currentScript !== null) {\n updateRAM(currentScript.code);\n }\n }, []);\n\n useEffect(() => {\n function keydown(event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n //Ctrl + b\n if (event.code == \"KeyB\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n props.router.toTerminal();\n }\n\n // CTRL/CMD + S\n if (event.code == \"KeyS\" && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n event.stopPropagation();\n save();\n }\n }\n document.addEventListener(\"keydown\", keydown);\n return () => document.removeEventListener(\"keydown\", keydown);\n });\n\n useEffect(() => {\n // setup monaco-vim\n if (options.vim && editor && !vimEditor) {\n try {\n // This library is not typed\n // @ts-expect-error\n window.require([\"monaco-vim\"], function (MonacoVim: any) {\n setVimEditor(MonacoVim.initVimMode(editor, vimStatusRef.current));\n MonacoVim.VimMode.Vim.defineEx(\"write\", \"w\", function () {\n // your own implementation on what you want to do when :w is pressed\n save();\n });\n MonacoVim.VimMode.Vim.defineEx(\"quit\", \"q\", function () {\n props.router.toTerminal();\n });\n\n const saveNQuit = (): void => {\n save();\n props.router.toTerminal();\n };\n // \"wqriteandquit\" & \"xriteandquit\" are not typos, prefix must be found in full string\n MonacoVim.VimMode.Vim.defineEx(\"wqriteandquit\", \"wq\", saveNQuit);\n MonacoVim.VimMode.Vim.defineEx(\"xriteandquit\", \"x\", saveNQuit);\n\n // Setup \"go to next tab\" and \"go to previous tab\". This is a little more involved\n // since these aren't Ex commands (they run in normal mode, not after typing `:`)\n MonacoVim.VimMode.Vim.defineAction(\"nextTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the next tab (to the right). Wraps around when at the rightmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n const nextIndex = (currIndex + nTabs) % openScripts.length;\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.defineAction(\"prevTabs\", function (_cm: any, args: { repeat?: number }) {\n const nTabs = args.repeat ?? 1;\n // Go to the previous tab (to the left). Wraps around when at the leftmost tab\n const currIndex = currentTabIndex();\n if (currIndex !== undefined) {\n let nextIndex = currIndex - nTabs;\n while (nextIndex < 0) {\n nextIndex += openScripts.length;\n }\n onTabClick(nextIndex);\n }\n });\n MonacoVim.VimMode.Vim.mapCommand(\"gt\", \"action\", \"nextTabs\", {}, { context: \"normal\" });\n MonacoVim.VimMode.Vim.mapCommand(\"gT\", \"action\", \"prevTabs\", {}, { context: \"normal\" });\n editor.focus();\n });\n } catch {}\n } else if (!options.vim) {\n // Whem vim mode is disabled\n vimEditor?.dispose();\n setVimEditor(null);\n }\n\n return () => {\n vimEditor?.dispose();\n };\n }, [options, editorRef, editor, vimEditor]);\n\n // Generates a new model for the script\n function regenerateModel(script: OpenScript): void {\n if (monacoRef.current !== null) {\n script.model = monacoRef.current.editor.createModel(script.code, script.isTxt ? \"plaintext\" : \"javascript\");\n }\n }\n\n const debouncedUpdateRAM = debounce((newCode: string) => {\n updateRAM(newCode);\n setUpdatingRam(false);\n }, 300);\n\n function updateRAM(newCode: string): void {\n if (currentScript != null && currentScript.isTxt) {\n setRAM(\"N/A\");\n setRamEntries([[\"N/A\", \"\"]]);\n return;\n }\n const codeCopy = newCode + \"\";\n const ramUsage = calculateRamUsage(props.player, codeCopy, props.player.getCurrentServer().scripts);\n if (ramUsage.cost > 0) {\n const entries = ramUsage.entries?.sort((a, b) => b.cost - a.cost) ?? [];\n const entriesDisp = [];\n for (const entry of entries) {\n entriesDisp.push([`${entry.name} (${entry.type})`, numeralWrapper.formatRAM(entry.cost)]);\n }\n\n setRAM(\"RAM: \" + numeralWrapper.formatRAM(ramUsage.cost));\n setRamEntries(entriesDisp);\n return;\n }\n let RAM = \"\";\n const entriesDisp = [];\n switch (ramUsage.cost) {\n case RamCalculationErrorCode.ImportError: {\n RAM = \"RAM: Import Error\";\n entriesDisp.push([\"Import Error\", \"\"]);\n break;\n }\n case RamCalculationErrorCode.SyntaxError:\n default: {\n RAM = \"RAM: Syntax Error\";\n entriesDisp.push([\"Syntax Error\", \"\"]);\n break;\n }\n }\n setRAM(RAM);\n setRamEntries(entriesDisp);\n return;\n }\n\n // Formats the code\n function beautify(): void {\n if (editorRef.current === null) return;\n editorRef.current.getAction(\"editor.action.formatDocument\").run();\n }\n\n // How to load function definition in monaco\n // https://github.com/Microsoft/monaco-editor/issues/1415\n // https://microsoft.github.io/monaco-editor/api/modules/monaco.languages.html\n // https://www.npmjs.com/package/@monaco-editor/react#development-playground\n // https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages\n // https://github.com/threehams/typescript-error-guide/blob/master/stories/components/Editor.tsx#L11-L39\n // https://blog.checklyhq.com/customizing-monaco/\n // Before the editor is mounted\n function beforeMount(monaco: any): void {\n if (symbolsLoaded) return;\n // Setup monaco auto completion\n symbolsLoaded = true;\n monaco.languages.registerCompletionItemProvider(\"javascript\", {\n provideCompletionItems: () => {\n const suggestions = [];\n for (const symbol of symbols) {\n suggestions.push({\n label: symbol,\n kind: monaco.languages.CompletionItemKind.Function,\n insertText: symbol,\n insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,\n });\n }\n return { suggestions: suggestions };\n },\n });\n\n (async function () {\n // We have to improve the default js language otherwise theme sucks\n const l = await monaco.languages\n .getLanguages()\n .find((l: any) => l.id === \"javascript\")\n .loader();\n // replaced the bare tokens with regexes surrounded by \\b, e.g. \\b{token}\\b which matches a word-break on either side\n // this prevents the highlighter from highlighting pieces of variables that start with a reserved token name\n l.language.tokenizer.root.unshift([new RegExp(\"\\\\bns\\\\b\"), { token: \"ns\" }]);\n for (const symbol of symbols)\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${symbol}\\\\b`), { token: \"netscriptfunction\" }]);\n const otherKeywords = [\"let\", \"const\", \"var\", \"function\"];\n const otherKeyvars = [\"true\", \"false\", \"null\", \"undefined\"];\n otherKeywords.forEach((k) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeywords\" }]),\n );\n otherKeyvars.forEach((k) =>\n l.language.tokenizer.root.unshift([new RegExp(`\\\\b${k}\\\\b`), { token: \"otherkeyvars\" }]),\n );\n l.language.tokenizer.root.unshift([new RegExp(\"\\\\bthis\\\\b\"), { token: \"this\" }]);\n })();\n\n const source = (libSource + \"\").replace(/export /g, \"\");\n monaco.languages.typescript.javascriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n monaco.languages.typescript.typescriptDefaults.addExtraLib(source, \"netscript.d.ts\");\n loadThemes(monaco);\n sanitizeTheme(Settings.EditorTheme);\n monaco.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n }\n\n // When the editor is mounted\n function onMount(editor: IStandaloneCodeEditor, monaco: Monaco): void {\n // Required when switching between site navigation (e.g. from Script Editor -> Terminal and back)\n // the `useEffect()` for vim mode is called before editor is mounted.\n setEditor(editor);\n\n editorRef.current = editor;\n monacoRef.current = monaco;\n\n if (editorRef.current === null || monacoRef.current === null) return;\n\n if (!props.files && currentScript !== null) {\n // Open currentscript\n regenerateModel(currentScript);\n editorRef.current.setModel(currentScript.model);\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n updateRAM(currentScript.code);\n editorRef.current.focus();\n return;\n }\n if (props.files) {\n const files = Object.entries(props.files);\n\n if (!files.length) {\n editorRef.current.focus();\n return;\n }\n\n for (const [filename, code] of files) {\n // Check if file is already opened\n const openScript = openScripts.find(\n (script) => script.fileName === filename && script.hostname === props.hostname,\n );\n if (openScript) {\n // Script is already opened\n if (openScript.model === undefined || openScript.model === null || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n\n currentScript = openScript;\n editorRef.current.setModel(openScript.model);\n editorRef.current.setPosition(openScript.lastPosition);\n editorRef.current.revealLineInCenter(openScript.lastPosition.lineNumber);\n updateRAM(openScript.code);\n } else {\n // Open script\n const newScript = new OpenScript(\n filename,\n code,\n props.hostname,\n new monacoRef.current.Position(0, 0),\n monacoRef.current.editor.createModel(code, filename.endsWith(\".txt\") ? \"plaintext\" : \"javascript\"),\n );\n openScripts.push(newScript);\n currentScript = newScript;\n editorRef.current.setModel(newScript.model);\n updateRAM(newScript.code);\n }\n }\n }\n\n editorRef.current.focus();\n }\n\n function infLoop(newCode: string): void {\n if (editorRef.current === null || currentScript === null) return;\n if (!currentScript.fileName.endsWith(\".js\")) return;\n const awaitWarning = checkInfiniteLoop(newCode);\n if (awaitWarning !== -1) {\n const newDecorations = editorRef.current.deltaDecorations(decorations, [\n {\n range: {\n startLineNumber: awaitWarning,\n startColumn: 1,\n endLineNumber: awaitWarning,\n endColumn: 10,\n },\n options: {\n isWholeLine: true,\n glyphMarginClassName: \"myGlyphMarginClass\",\n glyphMarginHoverMessage: {\n value: \"Possible infinite loop, await something.\",\n },\n },\n },\n ]);\n setDecorations(newDecorations);\n } else {\n const newDecorations = editorRef.current.deltaDecorations(decorations, []);\n setDecorations(newDecorations);\n }\n }\n\n // When the code is updated within the editor\n function updateCode(newCode?: string): void {\n if (newCode === undefined) return;\n setUpdatingRam(true);\n debouncedUpdateRAM(newCode);\n if (editorRef.current === null) return;\n const newPos = editorRef.current.getPosition();\n if (newPos === null) return;\n if (currentScript !== null) {\n currentScript.code = newCode;\n currentScript.lastPosition = newPos;\n }\n try {\n infLoop(newCode);\n } catch (err) {}\n }\n\n function saveScript(scriptToSave: OpenScript): void {\n const server = GetServer(scriptToSave.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(scriptToSave.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (scriptToSave.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(\n props.player,\n scriptToSave.fileName,\n scriptToSave.code,\n props.player.currentServer,\n server.scripts,\n );\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(\n props.player,\n scriptToSave.fileName,\n scriptToSave.code,\n props.player.currentServer,\n server.scripts,\n );\n server.scripts.push(script);\n } else if (scriptToSave.isTxt) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === scriptToSave.fileName) {\n server.textFiles[i].write(scriptToSave.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n return;\n }\n }\n const textFile = new TextFile(scriptToSave.fileName, scriptToSave.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script or .js) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n props.router.toTerminal();\n }\n\n function save(): void {\n if (currentScript === null) {\n console.error(\"currentScript is null when it shouldn't be. Unable to save script\");\n return;\n }\n // this is duplicate code with saving later.\n if (ITutorial.isRunning && ITutorial.currStep === iTutorialSteps.TerminalTypeScript) {\n //Make sure filename + code properly follow tutorial\n if (currentScript.fileName !== \"n00dles.script\" && currentScript.fileName !== \"n00dles.js\") {\n dialogBoxCreate(\"Don't change the script name for now.\");\n return;\n }\n const cleanCode = currentScript.code.replace(/\\s/g, \"\");\n const ns1 = \"while(true){hack('n00dles');}\";\n const ns2 = `exportasyncfunctionmain(ns){while(true){awaitns.hack('n00dles');}}`;\n if (cleanCode.indexOf(ns1) == -1 && cleanCode.indexOf(ns2) == -1) {\n dialogBoxCreate(\"Please copy and paste the code from the tutorial!\");\n return;\n }\n\n //Save the script\n saveScript(currentScript);\n\n iTutorialNextStep();\n\n return;\n }\n\n if (currentScript.fileName == \"\") {\n dialogBoxCreate(\"You must specify a filename!\");\n return;\n }\n\n if (!isValidFilePath(currentScript.fileName)) {\n dialogBoxCreate(\n \"Script filename can contain only alphanumerics, hyphens, and underscores, and must end with an extension.\",\n );\n return;\n }\n\n const server = GetServer(currentScript.hostname);\n if (server === null) throw new Error(\"Server should not be null but it is.\");\n if (isScriptFilename(currentScript.fileName)) {\n //If the current script already exists on the server, overwrite it\n for (let i = 0; i < server.scripts.length; i++) {\n if (currentScript.fileName == server.scripts[i].filename) {\n server.scripts[i].saveScript(\n props.player,\n currentScript.fileName,\n currentScript.code,\n props.player.currentServer,\n server.scripts,\n );\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n return;\n }\n }\n\n //If the current script does NOT exist, create a new one\n const script = new Script();\n script.saveScript(\n props.player,\n currentScript.fileName,\n currentScript.code,\n props.player.currentServer,\n server.scripts,\n );\n server.scripts.push(script);\n } else if (currentScript.isTxt) {\n for (let i = 0; i < server.textFiles.length; ++i) {\n if (server.textFiles[i].fn === currentScript.fileName) {\n server.textFiles[i].write(currentScript.code);\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n return;\n }\n }\n const textFile = new TextFile(currentScript.fileName, currentScript.code);\n server.textFiles.push(textFile);\n } else {\n dialogBoxCreate(\"Invalid filename. Must be either a script (.script or .js) or a text file (.txt)\");\n return;\n }\n\n if (Settings.SaveGameOnFileSave) saveObject.saveGame();\n rerender();\n }\n\n function reorder(list: OpenScript[], startIndex: number, endIndex: number): void {\n const [removed] = list.splice(startIndex, 1);\n list.splice(endIndex, 0, removed);\n }\n\n function onDragEnd(result: any): void {\n // Dropped outside of the list\n if (!result.destination) return;\n reorder(openScripts, result.source.index, result.destination.index);\n }\n\n function currentTabIndex(): number | undefined {\n if (currentScript !== null) {\n return openScripts.findIndex(\n (script) =>\n currentScript !== null &&\n script.fileName === currentScript.fileName &&\n script.hostname === currentScript.hostname,\n );\n }\n\n return undefined;\n }\n\n function onTabClick(index: number): void {\n if (currentScript !== null) {\n // Save currentScript to openScripts\n const curIndex = currentTabIndex();\n if (curIndex !== undefined) {\n openScripts[curIndex] = currentScript;\n }\n }\n\n currentScript = openScripts[index];\n\n if (editorRef.current !== null && openScripts[index] !== null) {\n if (currentScript.model === undefined || currentScript.model.isDisposed()) {\n regenerateModel(currentScript);\n }\n editorRef.current.setModel(currentScript.model);\n\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n updateRAM(currentScript.code);\n editorRef.current.focus();\n }\n }\n\n function onTabClose(index: number): void {\n // See if the script on the server is up to date\n const closingScript = openScripts[index];\n const savedScriptCode = closingScript.code;\n const wasCurrentScript = openScripts[index] === currentScript;\n\n if (dirty(index)) {\n PromptEvent.emit({\n txt: `Do you want to save changes to ${closingScript.fileName} on ${closingScript.hostname}?`,\n resolve: (result: boolean | string) => {\n if (result) {\n // Save changes\n closingScript.code = savedScriptCode;\n saveScript(closingScript);\n }\n },\n });\n }\n\n openScripts.splice(index, 1);\n if (openScripts.length === 0) {\n currentScript = null;\n props.router.toTerminal();\n return;\n }\n\n // Change current script if we closed it\n if (wasCurrentScript) {\n //Keep the same index unless we were on the last script\n const indexOffset = openScripts.length === index ? -1 : 0;\n currentScript = openScripts[index + indexOffset];\n if (editorRef.current !== null) {\n if (currentScript.model.isDisposed() || !currentScript.model) {\n regenerateModel(currentScript);\n }\n editorRef.current.setModel(currentScript.model);\n editorRef.current.setPosition(currentScript.lastPosition);\n editorRef.current.revealLineInCenter(currentScript.lastPosition.lineNumber);\n editorRef.current.focus();\n }\n }\n rerender();\n }\n\n function onTabUpdate(index: number): void {\n const openScript = openScripts[index];\n const serverScriptCode = getServerCode(index);\n if (serverScriptCode === null) return;\n\n if (openScript.code !== serverScriptCode) {\n PromptEvent.emit({\n txt:\n \"Do you want to overwrite the current editor content with the contents of \" +\n openScript.fileName +\n \" on the server? This cannot be undone.\",\n resolve: (result: boolean | string) => {\n if (result) {\n // Save changes\n openScript.code = serverScriptCode;\n\n // Switch to target tab\n onTabClick(index);\n\n if (editorRef.current !== null && openScript !== null) {\n if (openScript.model === undefined || openScript.model.isDisposed()) {\n regenerateModel(openScript);\n }\n editorRef.current.setModel(openScript.model);\n\n editorRef.current.setValue(openScript.code);\n updateRAM(openScript.code);\n editorRef.current.focus();\n }\n }\n },\n });\n }\n }\n\n function dirty(index: number): string {\n const openScript = openScripts[index];\n const serverData = getServerCode(index);\n if (serverData === null) return \" *\";\n // For scripts, server code is stored with its starting & trailing whitespace removed\n const code = openScript.isTxt ? openScript.code : Script.formatCode(openScript.code);\n return serverData !== code ? \" *\" : \"\";\n }\n function getServerCode(index: number): string | null {\n const openScript = openScripts[index];\n const server = GetServer(openScript.hostname);\n if (server === null) throw new Error(`Server '${openScript.hostname}' should not be null, but it is.`);\n const data = openScript.isTxt\n ? server.textFiles.find((t) => t.filename === openScript.fileName)?.text\n : server.scripts.find((s) => s.filename === openScript.fileName)?.code;\n return data ?? null;\n }\n function handleFilterChange(event: React.ChangeEvent): void {\n setFilter(event.target.value);\n }\n function handleExpandSearch(): void {\n setFilter(\"\");\n setSearchExpanded(!searchExpanded);\n }\n const filteredOpenScripts = Object.values(openScripts).filter(\n (script) => script.hostname.includes(filter) || script.fileName.includes(filter),\n );\n\n const tabsMaxWidth = 1640;\n const tabMargin = 5;\n const tabMaxWidth = filteredOpenScripts.length ? tabsMaxWidth / filteredOpenScripts.length - tabMargin : 0;\n const tabIconWidth = 25;\n const tabTextWidth = tabMaxWidth - tabIconWidth * 2;\n return (\n <>\n
    \n \n \n {(provided, snapshot) => (\n \n \n {searchExpanded ? (\n ,\n spellCheck: false,\n endAdornment: ,\n }}\n />\n ) : (\n \n )}\n \n {filteredOpenScripts.map(({ fileName, hostname }, index) => {\n const editingCurrentScript =\n currentScript?.fileName === filteredOpenScripts[index].fileName &&\n currentScript?.hostname === filteredOpenScripts[index].hostname;\n const externalScript = hostname !== \"home\";\n const colorProps = editingCurrentScript\n ? {\n background: Settings.theme.button,\n borderColor: Settings.theme.button,\n color: Settings.theme.primary,\n }\n : {\n background: Settings.theme.backgroundsecondary,\n borderColor: Settings.theme.backgroundsecondary,\n color: Settings.theme.secondary,\n };\n\n if (externalScript) {\n colorProps.color = Settings.theme.info;\n }\n const iconButtonStyle = {\n maxWidth: `${tabIconWidth}px`,\n minWidth: `${tabIconWidth}px`,\n minHeight: \"38.5px\",\n maxHeight: \"38.5px\",\n ...colorProps,\n };\n\n const scriptTabText = `${hostname}:~/${fileName} ${dirty(index)}`;\n return (\n \n {(provided) => (\n \n \n onTabClick(index)}\n onMouseDown={(e) => {\n e.preventDefault();\n if (e.button === 1) onTabClose(index);\n }}\n style={{\n maxWidth: `${tabTextWidth}px`,\n minHeight: \"38.5px\",\n overflow: \"hidden\",\n ...colorProps,\n }}\n >\n \n {scriptTabText}\n \n \n \n \n \n \n \n
    \n )}\n \n );\n })}\n {provided.placeholder}\n \n )}\n \n \n
    \n Loading script editor!}\n height={`calc(100vh - ${130 + (options.vim ? 34 : 0)}px)`}\n defaultLanguage=\"javascript\"\n defaultValue={\"\"}\n onChange={updateCode}\n theme={options.theme}\n options={{ ...options, glyphMargin: true }}\n />\n\n \n\n \n \n \n {\n setRamInfoOpen(true);\n }}\n >\n {ram}\n \n \n \n \n {\" \"}\n Documentation:{\" \"}\n \n Basic\n \n {\" | \"}\n \n Full\n \n \n \n {\n sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n setOptionsOpen(false);\n }}\n options={{\n theme: Settings.MonacoTheme,\n insertSpaces: Settings.MonacoInsertSpaces,\n fontSize: Settings.MonacoFontSize,\n wordWrap: Settings.MonacoWordWrap,\n vim: Settings.MonacoVim,\n }}\n save={(options: Options) => {\n sanitizeTheme(Settings.EditorTheme);\n monacoRef.current?.editor.defineTheme(\"customTheme\", makeTheme(Settings.EditorTheme));\n setOptions(options);\n Settings.MonacoTheme = options.theme;\n Settings.MonacoInsertSpaces = options.insertSpaces;\n Settings.MonacoFontSize = options.fontSize;\n Settings.MonacoWordWrap = options.wordWrap;\n Settings.MonacoVim = options.vim;\n }}\n />\n setRamInfoOpen(false)}>\n \n \n {ramEntries.map(([n, r]) => (\n \n \n {n}\n \n {r}\n \n \n \n ))}\n \n
    \n
    \n
    \n \n \n No open files\n \n Use nano FILENAME in\n
    \n the terminal to open files\n
    \n
    \n \n \n );\n}\n","/**\n * Helper functions that implement \"directory\" functionality in the Terminal.\n * These aren't \"real\" directories, it's more of a pseudo-directory implementation\n * that uses mainly string manipulation.\n *\n * This file contains function that deal with Server-related directory things.\n * Functions that deal with the string manipulation can be found in\n * ./DirectoryHelpers.ts\n */\nimport { isValidDirectoryPath, isInRootDirectory, getFirstParentDirectory } from \"./DirectoryHelpers\";\nimport { BaseServer } from \"../Server/BaseServer\";\n\n/**\n * Given a directory (by the full directory path) and a server, returns all\n * subdirectories of that directory. This is only for FIRST-LEVEl/immediate subdirectories\n */\nexport function getSubdirectories(serv: BaseServer, dir: string): string[] {\n const res: string[] = [];\n\n if (!isValidDirectoryPath(dir)) {\n return res;\n }\n\n let t_dir = dir;\n if (!t_dir.endsWith(\"/\")) {\n t_dir += \"/\";\n }\n\n function processFile(fn: string): void {\n if (t_dir === \"/\" && isInRootDirectory(fn)) {\n const subdir = getFirstParentDirectory(fn);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n } else if (fn.startsWith(t_dir)) {\n const remaining = fn.slice(t_dir.length);\n const subdir = getFirstParentDirectory(remaining);\n if (subdir !== \"/\" && !res.includes(subdir)) {\n res.push(subdir);\n }\n }\n }\n\n for (const script of serv.scripts) {\n processFile(script.filename);\n }\n\n for (const txt of serv.textFiles) {\n processFile(txt.fn);\n }\n\n return res;\n}\n\n/**\n * Returns true, if the server's directory itself or one of its subdirectory contains files.\n */\nexport function containsFiles(server: BaseServer, dir: string): boolean {\n const dirWithTrailingSlash = dir + (dir.slice(-1) === \"/\" ? \"\" : \"/\");\n\n return [...server.scripts.map((s) => s.filename), ...server.textFiles.map((t) => t.fn)].some((filename) =>\n filename.startsWith(dirWithTrailingSlash),\n );\n}\n","/**\n * Uses the acorn.js library to parse a script's code into an AST and\n * recursively walk through that AST to replace import urls with blobs\n */\nimport * as walk from \"acorn-walk\";\nimport { parse } from \"acorn\";\n\nimport { helpers } from \"./Netscript/NetscriptHelpers\";\nimport { ScriptUrl } from \"./Script/ScriptUrl\";\nimport { WorkerScript } from \"./Netscript/WorkerScript\";\nimport { Script } from \"./Script/Script\";\nimport { areImportsEquals } from \"./Terminal/DirectoryHelpers\";\nimport { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { ScriptModule } from \"./Script/ScriptModule\";\n\n// Acorn type def is straight up incomplete so we have to fill with our own.\nexport type Node = any;\n\n// Makes a blob that contains the code of a given script.\nfunction makeScriptBlob(code: string): Blob {\n return new Blob([code], { type: \"text/javascript\" });\n}\n\nexport async function compile(player: IPlayer, script: Script, scripts: Script[]): Promise {\n //!shouldCompile ensures that script.module is non-null, hence the \"as\".\n if (!shouldCompile(script, scripts)) return script.module as Promise;\n script.queueCompile = true;\n //If we're already in the middle of compiling (script.module has not resolved yet), wait for the previous compilation to finish\n //If script.module is null, this does nothing.\n await script.module;\n //If multiple compiles were called on the same script before a compilation could be completed this ensures only one complilation is actually performed.\n if (!script.queueCompile) return script.module as Promise;\n script.queueCompile = false;\n script.updateRamUsage(player, scripts);\n const uurls = _getScriptUrls(script, scripts, []);\n const url = uurls[uurls.length - 1].url;\n if (script.url && script.url !== url) URL.revokeObjectURL(script.url);\n\n if (script.dependencies.length > 0) script.dependencies.forEach((dep) => URL.revokeObjectURL(dep.url));\n script.url = uurls[uurls.length - 1].url;\n // The URL at the top is the one we want to import. It will\n // recursively import all the other modules in the urlStack.\n //\n // Webpack likes to turn the import into a require, which sort of\n // but not really behaves like import. Particularly, it cannot\n // load fully dynamic content. So we hide the import from webpack\n // by placing it inside an eval call.\n script.module = new Promise((resolve) => resolve(eval(\"import(uurls[uurls.length - 1].url)\")));\n script.dependencies = uurls;\n return script.module;\n}\n\n// Begin executing a user JS script, and return a promise that resolves\n// or rejects when the script finishes.\n// - script is a script to execute (see Script.js). We depend only on .filename and .code.\n// scripts is an array of other scripts on the server.\n// env is the global environment that should be visible to all the scripts\n// (i.e. hack, grow, etc.).\n// When the promise returned by this resolves, we'll have finished\n// running the main function of the script.\nexport async function executeJSScript(\n player: IPlayer,\n scripts: Script[] = [],\n workerScript: WorkerScript,\n): Promise {\n const script = workerScript.getScript();\n if (script === null) throw new Error(\"script is null\");\n const loadedModule = await compile(player, script, scripts);\n workerScript.ramUsage = script.ramUsage;\n\n const ns = workerScript.env.vars;\n\n if (!loadedModule) {\n throw helpers.makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because the script module won't load`,\n );\n }\n // TODO: putting await in a non-async function yields unhelpful\n // \"SyntaxError: unexpected reserved word\" with no line number information.\n if (!loadedModule.main) {\n throw helpers.makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because it does not have a main function.`,\n );\n }\n if (!ns) {\n throw helpers.makeRuntimeRejectMsg(\n workerScript,\n `${script.filename} cannot be run because the NS object hasn't been constructed properly.`,\n );\n }\n return loadedModule.main(ns);\n}\n\nfunction isDependencyOutOfDate(filename: string, scripts: Script[], scriptModuleSequenceNumber: number): boolean {\n const depScript = scripts.find((s) => s.filename == filename);\n\n // If the script is not present on the server, we should recompile, if only to get any necessary\n // compilation errors.\n if (!depScript) return true;\n\n const depIsMoreRecent = depScript.moduleSequenceNumber > scriptModuleSequenceNumber;\n return depIsMoreRecent;\n}\n/** Returns whether we should compile the script parameter.\n *\n * @param {Script} script\n * @param {Script[]} scripts\n */\nfunction shouldCompile(script: Script, scripts: Script[]): boolean {\n if (!script.module) return true;\n if (script.dependencies.some((dep) => isDependencyOutOfDate(dep.filename, scripts, script.moduleSequenceNumber))) {\n script.module = null;\n return true;\n }\n return false;\n}\n\n// Gets a stack of blob urls, the top/right-most element being\n// the blob url for the named script on the named server.\n//\n// - script -- the script for whom we are getting a URL.\n// - scripts -- all the scripts available on this server\n// - seen -- The modules above this one -- to prevent mutual dependency.\n//\n// TODO We don't make any effort to cache a given module when it is imported at\n// different parts of the tree. That hasn't presented any problem with during\n// testing, but it might be an idea for the future. Would require a topo-sort\n// then url-izing from leaf-most to root-most.\n/**\n * @param {Script} script\n * @param {Script[]} scripts\n * @param {Script[]} seen\n * @returns {ScriptUrl[]} All of the compiled scripts, with the final one\n * in the list containing the blob corresponding to\n * the script parameter.\n */\n// BUG: apparently seen is never consulted. Oops.\nfunction _getScriptUrls(script: Script, scripts: Script[], seen: Script[]): ScriptUrl[] {\n // Inspired by: https://stackoverflow.com/a/43834063/91401\n const urlStack: ScriptUrl[] = [];\n // Seen contains the dependents of the current script. Make sure we include that in the script dependents.\n for (const dependent of seen) {\n if (!script.dependents.some((s) => s.server === dependent.server && s.filename == dependent.filename)) {\n script.dependents.push({ server: dependent.server, filename: dependent.filename });\n }\n }\n seen.push(script);\n try {\n // Replace every import statement with an import to a blob url containing\n // the corresponding script. E.g.\n //\n // import {foo} from \"bar.js\";\n //\n // becomes\n //\n // import {foo} from \"blob://\"\n //\n // Where the blob URL contains the script content.\n\n // Parse the code into an ast tree\n const ast = parse(script.code, { sourceType: \"module\", ecmaVersion: \"latest\", ranges: true });\n interface importNode {\n filename: string;\n start: number;\n end: number;\n }\n const importNodes: importNode[] = [];\n // Walk the nodes of this tree and find any import declaration statements.\n walk.simple(ast, {\n ImportDeclaration(node: Node) {\n // Push this import onto the stack to replace\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n ExportNamedDeclaration(node: Node) {\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n ExportAllDeclaration(node: Node) {\n if (!node.source) return;\n importNodes.push({\n filename: node.source.value,\n start: node.source.range[0] + 1,\n end: node.source.range[1] - 1,\n });\n },\n });\n // Sort the nodes from last start index to first. This replaces the last import with a blob first,\n // preventing the ranges for other imports from being shifted.\n importNodes.sort((a, b) => b.start - a.start);\n let transformedCode = script.code;\n // Loop through each node and replace the script name with a blob url.\n for (const node of importNodes) {\n const filename = node.filename.startsWith(\"./\") ? node.filename.substring(2) : node.filename;\n\n // Find the corresponding script.\n const matchingScripts = scripts.filter((s) => areImportsEquals(s.filename, filename));\n if (matchingScripts.length === 0) continue;\n\n const [importedScript] = matchingScripts;\n\n const urls = _getScriptUrls(importedScript, scripts, seen);\n\n // The top url in the stack is the replacement import file for this script.\n urlStack.push(...urls);\n const blob = urls[urls.length - 1].url;\n\n // Replace the blob inside the import statement.\n transformedCode = transformedCode.substring(0, node.start) + blob + transformedCode.substring(node.end);\n }\n\n // We automatically define a print function() in the NetscriptJS module so that\n // accidental calls to window.print() do not bring up the \"print screen\" dialog\n transformedCode += `\\n//# sourceURL=${script.server}/${script.filename}`;\n\n const blob = URL.createObjectURL(makeScriptBlob(transformedCode));\n // Push the blob URL onto the top of the stack.\n urlStack.push(new ScriptUrl(script.filename, blob, script.moduleSequenceNumber));\n return urlStack;\n } catch (err) {\n // If there is an error, we need to clean up the URLs.\n for (const url of urlStack) URL.revokeObjectURL(url.url);\n throw err;\n } finally {\n seen.pop();\n }\n}\n","import { toNative } from \"./toNative\";\nimport libarg from \"arg\";\nimport { ScriptArg } from \"../Netscript/ScriptArg\";\nimport { NetscriptContext } from \"../Netscript/APIWrapper\";\n\ntype FlagType = StringConstructor | NumberConstructor | BooleanConstructor | StringConstructor[];\ntype FlagsRet = { [key: string]: ScriptArg | string[] };\nexport function Flags(ctx: NetscriptContext | string[]): (data: unknown) => FlagsRet {\n const vargs = Array.isArray(ctx) ? ctx : ctx.workerScript.args;\n return (schema: unknown): FlagsRet => {\n schema = toNative(schema);\n if (!Array.isArray(schema)) throw new Error(\"flags schema passed in is invalid.\");\n const args: {\n [key: string]: FlagType;\n } = {};\n\n for (const d of schema) {\n let t: FlagType = String;\n if (typeof d[1] === \"number\") {\n t = Number;\n } else if (typeof d[1] === \"boolean\") {\n t = Boolean;\n } else if (Array.isArray(d[1])) {\n t = [String];\n }\n const numDashes = d[0].length > 1 ? 2 : 1;\n args[\"-\".repeat(numDashes) + d[0]] = t;\n }\n const ret: FlagsRet = libarg(args, { argv: vargs });\n for (const d of schema) {\n if (!ret.hasOwnProperty(\"--\" + d[0]) || !ret.hasOwnProperty(\"-\" + d[0])) ret[d[0]] = d[1];\n }\n for (const key of Object.keys(ret)) {\n if (!key.startsWith(\"-\")) continue;\n const value = ret[key];\n delete ret[key];\n const numDashes = key.length === 2 ? 1 : 2;\n ret[key.slice(numDashes)] = value;\n }\n return ret;\n };\n}\n","import * as React from \"react\";\nimport { useTheme } from \"@mui/material/styles\";\nimport Box from \"@mui/material/Box\";\nimport IconButton from \"@mui/material/IconButton\";\nimport FirstPageIcon from \"@mui/icons-material/FirstPage\";\nimport KeyboardArrowLeft from \"@mui/icons-material/KeyboardArrowLeft\";\nimport KeyboardArrowRight from \"@mui/icons-material/KeyboardArrowRight\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\n\ninterface TablePaginationActionsProps {\n count: number;\n page: number;\n rowsPerPage: number;\n onPageChange: (event: React.MouseEvent, newPage: number) => void;\n}\n\nexport function TablePaginationActionsAll(props: TablePaginationActionsProps): React.ReactElement {\n const theme = useTheme();\n const { count, page, rowsPerPage, onPageChange } = props;\n\n const handleFirstPageButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, 0);\n };\n\n const handleBackButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, page - 1);\n };\n\n const handleNextButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, page + 1);\n };\n\n const handleLastPageButtonClick = (event: React.MouseEvent): void => {\n onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return (\n \n \n {theme.direction === \"rtl\" ? : }\n \n \n {theme.direction === \"rtl\" ? : }\n \n = Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? : }\n \n = Math.ceil(count / rowsPerPage) - 1}>\n {theme.direction === \"rtl\" ? : }\n \n \n );\n}\n","import ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport { Box, Collapse, ListItemButton, ListItemText, Paper, Table, TableBody, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React from \"react\";\nimport { SpecialServers } from \"../../Server/data/SpecialServers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { defaultMultipliers, getBitNodeMultipliers } from \"../BitNode\";\nimport { IBitNodeMultipliers } from \"../BitNodeMultipliers\";\n\ninterface IProps {\n n: number;\n level?: number;\n}\n\nexport function BitnodeMultiplierDescription({ n, level }: IProps): React.ReactElement {\n const [open, setOpen] = React.useState(false);\n if (n === 1) return <>;\n\n return (\n \n setOpen((old) => !old)}>\n Bitnode Multipliers} />\n {open ? : }\n \n \n \n \n \n );\n}\n\nexport const BitNodeMultipliersDisplay = ({ n, level }: IProps): React.ReactElement => {\n const player = use.Player();\n // If a level argument has been provided, use that as the multiplier level\n // If not, then we have to assume that we want the next level up from the\n // current node's source file, so we get the min of that, the SF's max level,\n // or if it's BN12, ∞\n const maxSfLevel = n === 12 ? Infinity : 3;\n const mults = getBitNodeMultipliers(n, level ?? Math.min(player.sourceFileLvl(n) + 1, maxSfLevel));\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\ninterface IBNMultRows {\n [mult: string]: {\n name: string;\n content?: string;\n color?: string;\n };\n}\n\ninterface IBNMultTableProps {\n sectionName: string;\n rowData: IBNMultRows;\n mults: IBitNodeMultipliers;\n}\n\nconst BNMultTable = (props: IBNMultTableProps): React.ReactElement => {\n const rowsArray = Object.entries(props.rowData)\n .filter(([key]) => props.mults[key] !== defaultMultipliers[key])\n .map(([key, value]) => (\n \n ));\n\n return rowsArray.length > 0 ? (\n \n {props.sectionName}\n \n {rowsArray}\n
    \n
    \n ) : (\n <>\n );\n};\n\ninterface IMultsProps {\n n: number;\n mults: IBitNodeMultipliers;\n}\n\nfunction GeneralMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n WorldDaemonDifficulty: { name: `${SpecialServers.WorldDaemon} Difficulty` },\n DaedalusAugsRequirement: {\n name: \"Daedalus Augs Requirement\",\n content: String(mults.DaedalusAugsRequirement),\n },\n HacknetNodeMoney: { name: \"Hacknet Production\" },\n CodingContractMoney: { name: \"Coding Contract Reward\" },\n ClassGymExpGain: { name: \"Class/Gym Exp\" },\n };\n\n return ;\n}\n\nfunction AugmentationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n AugmentationMoneyCost: { name: \"Money Cost\" },\n AugmentationRepCost: {\n name: \"Reputation Cost\",\n color: Settings.theme.rep,\n },\n };\n\n return ;\n}\n\nfunction CompanyMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CompanyWorkMoney: {\n name: \"Work Money\",\n color: Settings.theme.money,\n },\n CompanyWorkExpGain: { name: \"Work Exp\" },\n };\n\n return ;\n}\n\nfunction StockMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n FourSigmaMarketDataCost: { name: \"Market Data Cost\" },\n FourSigmaMarketDataApiCost: { name: \"Market Data API Cost\" },\n };\n\n return ;\n}\n\nfunction FactionMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n RepToDonateToFaction: { name: \"Favor to Donate\" },\n FactionWorkRepGain: {\n name: \"Work Reputation\",\n color: Settings.theme.rep,\n },\n FactionWorkExpGain: { name: \"Work Exp\" },\n FactionPassiveRepGain: {\n name: \"Passive Rep\",\n color: Settings.theme.rep,\n },\n };\n\n return ;\n}\n\nfunction CrimeMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n CrimeExpGain: {\n name: \"Crime Exp\",\n color: Settings.theme.combat,\n },\n CrimeMoney: {\n name: \"Crime Money\",\n color: Settings.theme.combat,\n },\n };\n\n return ;\n}\n\nfunction SkillMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackingLevelMultiplier: {\n name: \"Hacking Level\",\n color: Settings.theme.hack,\n },\n StrengthLevelMultiplier: {\n name: \"Strength Level\",\n color: Settings.theme.combat,\n },\n DefenseLevelMultiplier: {\n name: \"Defense Level\",\n color: Settings.theme.combat,\n },\n DexterityLevelMultiplier: {\n name: \"Dexterity Level\",\n color: Settings.theme.combat,\n },\n AgilityLevelMultiplier: {\n name: \"Agility Level\",\n color: Settings.theme.combat,\n },\n CharismaLevelMultiplier: {\n name: \"Charisma Level\",\n color: Settings.theme.cha,\n },\n };\n\n return ;\n}\n\nfunction HackingMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n HackExpGain: {\n name: \"Hacking Exp\",\n color: Settings.theme.hack,\n },\n ServerGrowthRate: { name: \"Server Growth Rate\" },\n ServerMaxMoney: { name: \"Server Max Money\" },\n ServerStartingMoney: { name: \"Server Starting Money\" },\n ServerStartingSecurity: { name: \"Server Starting Security\" },\n ServerWeakenRate: { name: \"Server Weaken Rate\" },\n ManualHackMoney: {\n name: \"Manual Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoney: {\n name: \"Script Hack Money\",\n color: Settings.theme.money,\n },\n ScriptHackMoneyGain: {\n name: \"Money Gained From Hack\",\n color: Settings.theme.money,\n },\n };\n\n return ;\n}\n\nfunction PurchasedServersMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n PurchasedServerCost: {\n name: \"Base Cost\",\n content: mults.PurchasedServerCost.toFixed(3),\n },\n PurchasedServerSoftcap: {\n name: \"Softcap Cost\",\n content: mults.PurchasedServerSoftcap.toFixed(3),\n },\n PurchasedServerLimit: { name: \"Server Limit\" },\n PurchasedServerMaxRam: { name: \"Max RAM\" },\n HomeComputerRamCost: { name: \"Home RAM Cost\" },\n };\n\n return ;\n}\n\nfunction InfiltrationMults({ mults }: IMultsProps): React.ReactElement {\n const rows: IBNMultRows = {\n InfiltrationMoney: {\n name: \"Infiltration Money\",\n color: Settings.theme.money,\n },\n InfiltrationRep: {\n name: \"Infiltration Reputation\",\n color: Settings.theme.rep,\n },\n };\n\n return ;\n}\n\nfunction BladeburnerMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessBladeburner()) return <>;\n\n const rows: IBNMultRows = {\n BladeburnerRank: { name: \"Rank Gain\" },\n BladeburnerSkillCost: { name: \"Skill Cost\" },\n };\n\n return ;\n}\n\nfunction StanekMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessCotMG()) return <>;\n\n const extraSize = mults.StaneksGiftExtraSize.toFixed(3);\n const rows: IBNMultRows = {\n StnakesGiftPowerMultiplier: { name: \"Gift Power\" },\n StaneksGiftExtraSize: {\n name: \"Base Size Modifier\",\n content: `${mults.StaneksGiftExtraSize > defaultMultipliers.StaneksGiftExtraSize ? `+${extraSize}` : extraSize}`,\n },\n };\n\n return ;\n}\n\nfunction GangMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (player.bitNodeN !== 2 && player.sourceFileLvl(2) <= 0) return <>;\n\n const rows: IBNMultRows = {\n GangSoftcap: {\n name: \"Gang Softcap\",\n content: mults.GangSoftcap.toFixed(3),\n },\n GangUniqueAugs: { name: \"Unique Augmentations\" },\n };\n\n return ;\n}\n\nfunction CorporationMults({ mults }: IMultsProps): React.ReactElement {\n const player = use.Player();\n if (!player.canAccessCorporation()) return <>;\n\n const rows: IBNMultRows = {\n CorporationSoftcap: {\n name: \"Corporation Softcap\",\n content: mults.CorporationSoftcap.toFixed(3),\n },\n CorporationValuation: { name: \"Valuation\" },\n };\n\n return ;\n}\n","import * as React from \"react\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport { TableCell as MuiTableCell, TableCellProps } from \"@mui/material\";\n\nconst useStyles = makeStyles({\n root: {\n border: \"1px solid white\",\n width: \"5px\",\n height: \"5px\",\n },\n});\n\nexport const TableCell: React.FC = (props: TableCellProps) => {\n return (\n \n );\n};\n\ntype IProps = {\n onMouseEnter?: () => void;\n onClick?: () => void;\n color: string;\n};\n\nexport function Cell(cellProps: IProps): React.ReactElement {\n return (\n \n );\n}\n","import { TableBody, TableRow } from \"@mui/material\";\nimport * as React from \"react\";\nimport { ActiveFragment } from \"../ActiveFragment\";\nimport { calculateGrid } from \"../Helper\";\nimport { IStaneksGift } from \"../IStaneksGift\";\nimport { Cell } from \"./Cell\";\n\ninterface IProps {\n width: number;\n height: number;\n ghostGrid: number[][];\n gift: IStaneksGift;\n enter(i: number, j: number): void;\n click(i: number, j: number): void;\n}\n\nfunction randomColor(fragment: ActiveFragment): string {\n // Can't set Math.random seed so copy casino. TODO refactor both RNG later.\n let s1 = Math.pow((fragment.x + 1) * (fragment.y + 1), 10);\n let s2 = s1;\n let s3 = s1;\n\n const colors = [];\n for (let i = 0; i < 3; i++) {\n s1 = (171 * s1) % 30269;\n s2 = (172 * s2) % 30307;\n s3 = (170 * s3) % 30323;\n colors.push((s1 / 30269.0 + s2 / 30307.0 + s3 / 30323.0) % 1.0);\n }\n\n return `rgb(${colors[0] * 256}, ${colors[1] * 256}, ${colors[2] * 256})`;\n}\n\nexport function Grid(props: IProps): React.ReactElement {\n const activeGrid = calculateGrid(props.gift);\n\n function color(worldX: number, worldY: number): string {\n if (props.ghostGrid[worldX][worldY] && activeGrid[worldX][worldY]) return \"red\";\n if (props.ghostGrid[worldX][worldY]) return \"white\";\n\n if (activeGrid[worldX][worldY]) {\n const fragment = props.gift.fragmentAt(worldX, worldY);\n if (!fragment) throw new Error(\"ActiveFragment should not be null\");\n return randomColor(fragment);\n }\n return \"\";\n }\n\n // switch the width/length to make axis consistent.\n const elems = [];\n for (let j = 0; j < props.height; j++) {\n const cells = [];\n for (let i = 0; i < props.width; i++) {\n cells.push(\n props.enter(i, j)} onClick={() => props.click(i, j)} color={color(i, j)} />,\n );\n }\n elems.push({cells});\n }\n\n return {elems};\n}\n","import { GetServer } from \"../Server/AllServers\";\nimport { RunningScript } from \"./RunningScript\";\n\nexport function getRamUsageFromRunningScript(script: RunningScript): number {\n if (script.ramUsage != null && script.ramUsage > 0) {\n return script.ramUsage; // Use cached value\n }\n\n const server = GetServer(script.server);\n if (server == null) {\n return 0;\n }\n for (let i = 0; i < server.scripts.length; ++i) {\n if (server.scripts[i].filename === script.filename) {\n // Cache the ram usage for the next call\n script.ramUsage = server.scripts[i].ramUsage;\n return script.ramUsage;\n }\n }\n\n return 0;\n}\n","import { ITerminal } from \"../../ITerminal\";\nimport { removeLeadingSlash, removeTrailingSlash } from \"../../DirectoryHelpers\";\nimport { IRouter, ScriptEditorRouteOptions } from \"../../../ui/Router\";\nimport { IPlayer } from \"../../../PersonObjects/IPlayer\";\nimport { BaseServer } from \"../../../Server/BaseServer\";\nimport { isScriptFilename } from \"../../../Script/isScriptFilename\";\nimport { CursorPositions } from \"../../../ScriptEditor/CursorPositions\";\nimport { Script } from \"../../../Script/Script\";\nimport { isEmpty } from \"lodash\";\n\ninterface EditorParameters {\n terminal: ITerminal;\n router: IRouter;\n player: IPlayer;\n server: BaseServer;\n args: (string | number | boolean)[];\n}\n\nfunction isNs2(filename: string): boolean {\n return filename.endsWith(\".js\");\n}\n\nconst newNs2Template = `/** @param {NS} ns */\nexport async function main(ns) {\n\n}`;\n\ninterface ISimpleScriptGlob {\n glob: string;\n preGlob: string;\n postGlob: string;\n globError: string;\n globMatches: string[];\n globAgainst: Script[];\n}\n\nfunction containsSimpleGlob(filename: string): boolean {\n return filename.includes(\"*\");\n}\n\nfunction detectSimpleScriptGlob(\n args: EditorParameters[\"args\"],\n player: IPlayer,\n terminal: ITerminal,\n): ISimpleScriptGlob | null {\n if (args.length == 1 && containsSimpleGlob(`${args[0]}`)) {\n const filename = `${args[0]}`;\n const scripts = player.getCurrentServer().scripts;\n const parsedGlob = parseSimpleScriptGlob(filename, scripts, terminal);\n return parsedGlob;\n }\n return null;\n}\n\nfunction parseSimpleScriptGlob(globString: string, globDatabase: Script[], terminal: ITerminal): ISimpleScriptGlob {\n const parsedGlob: ISimpleScriptGlob = {\n glob: globString,\n preGlob: \"\",\n postGlob: \"\",\n globError: \"\",\n globMatches: [],\n globAgainst: globDatabase,\n };\n\n // Ensure deep globs are minified to simple globs, which act as deep globs in this impl\n globString = globString.replace(\"**\", \"*\");\n\n // Ensure only a single glob is present\n if (globString.split(\"\").filter((c) => c == \"*\").length !== 1) {\n parsedGlob.globError = \"Only a single glob is supported per command.\\nexample: `nano my-dir/*.js`\";\n return parsedGlob;\n }\n\n // Split arg around glob, normalize preGlob path\n [parsedGlob.preGlob, parsedGlob.postGlob] = globString.split(\"*\");\n parsedGlob.preGlob = removeLeadingSlash(parsedGlob.preGlob);\n\n // Add CWD to preGlob path\n const cwd = removeTrailingSlash(terminal.cwd());\n parsedGlob.preGlob = `${cwd}/${parsedGlob.preGlob}`;\n\n // For every script on the current server, filter matched scripts per glob values & persist\n globDatabase.forEach((script) => {\n const filename = script.filename.startsWith(\"/\") ? script.filename : `/${script.filename}`;\n if (filename.startsWith(parsedGlob.preGlob) && filename.endsWith(parsedGlob.postGlob)) {\n parsedGlob.globMatches.push(filename);\n }\n });\n\n // Rebuild glob for potential error reporting\n parsedGlob.glob = `${parsedGlob.preGlob}*${parsedGlob.postGlob}`;\n\n return parsedGlob;\n}\n\nexport function commonEditor(\n command: string,\n { terminal, router, player, args }: EditorParameters,\n scriptEditorRouteOptions?: ScriptEditorRouteOptions,\n): void {\n if (args.length < 1) {\n terminal.error(`Incorrect usage of ${command} command. Usage: ${command} [scriptname]`);\n return;\n }\n\n let filesToLoadOrCreate = args;\n try {\n const globSearch = detectSimpleScriptGlob(args, player, terminal);\n if (globSearch) {\n if (isEmpty(globSearch.globError) === false) throw new Error(globSearch.globError);\n filesToLoadOrCreate = globSearch.globMatches;\n }\n\n const files = filesToLoadOrCreate.map((arg) => {\n const filename = `${arg}`;\n\n if (isScriptFilename(filename)) {\n const filepath = terminal.getFilepath(filename);\n const script = terminal.getScript(player, filename);\n const fileIsNs2 = isNs2(filename);\n const code = script !== null ? script.code : fileIsNs2 ? newNs2Template : \"\";\n\n if (code === newNs2Template) {\n CursorPositions.saveCursor(filename, {\n row: 3,\n column: 5,\n });\n }\n\n return [filepath, code];\n }\n\n if (filename.endsWith(\".txt\")) {\n const filepath = terminal.getFilepath(filename);\n const txt = terminal.getTextFile(player, filename);\n return [filepath, txt === null ? \"\" : txt.text];\n }\n\n throw new Error(\n `Invalid file. Only scripts (.script or .js), or text files (.txt) can be edited with ${command}`,\n );\n });\n\n if (globSearch && files.length === 0) {\n throw new Error(`Could not find any valid files to open with ${command} using glob: \\`${globSearch.glob}\\``);\n }\n\n router.toScriptEditor(Object.fromEntries(files), scriptEditorRouteOptions);\n } catch (e) {\n terminal.error(`${e}`);\n }\n}\n","export function HammingEncode(data: number): string {\n const enc: Array = [0];\n const data_bits: Array = data.toString(2).split(\"\").reverse();\n\n data_bits.forEach((e, i, a) => {\n a[i] = parseInt(e);\n });\n\n let k = data_bits.length;\n\n /* NOTE: writing the data like this flips the endianness, this is what the\n * original implementation by Hedrauta did so I'm keeping it like it was. */\n for (let i = 1; k > 0; i++) {\n if ((i & (i - 1)) != 0) {\n enc[i] = data_bits[--k];\n } else {\n enc[i] = 0;\n }\n }\n\n let parity: any = 0;\n\n /* Figure out the subsection parities */\n for (let i = 0; i < enc.length; i++) {\n if (enc[i]) {\n parity ^= i;\n }\n }\n\n parity = parity.toString(2).split(\"\").reverse();\n parity.forEach((e: any, i: any, a: any) => {\n a[i] = parseInt(e);\n });\n\n /* Set the parity bits accordingly */\n for (let i = 0; i < parity.length; i++) {\n enc[2 ** i] = parity[i] ? 1 : 0;\n }\n\n parity = 0;\n /* Figure out the overall parity for the entire block */\n for (let i = 0; i < enc.length; i++) {\n if (enc[i]) {\n parity++;\n }\n }\n\n /* Finally set the overall parity bit */\n enc[0] = parity % 2 == 0 ? 0 : 1;\n\n return enc.join(\"\");\n}\n\nexport function HammingEncodeProperly(data: number): string {\n /* How many bits do we need?\n * n = 2^m\n * k = 2^m - m - 1\n * where k is the number of data bits, m the number\n * of parity bits and n the number of total bits. */\n\n let m = 1;\n\n while (2 ** (2 ** m - m - 1) - 1 < data) {\n m++;\n }\n\n const n: number = 2 ** m;\n const k: number = 2 ** m - m - 1;\n\n const enc: Array = [0];\n const data_bits: Array = data.toString(2).split(\"\").reverse();\n\n data_bits.forEach((e, i, a) => {\n a[i] = parseInt(e);\n });\n\n /* Flip endianness as in the original implementation by Hedrauta\n * and write the data back to front\n * XXX why do we do this? */\n for (let i = 1, j = k; i < n; i++) {\n if ((i & (i - 1)) != 0) {\n enc[i] = data_bits[--j] ? data_bits[j] : 0;\n }\n }\n\n let parity: any = 0;\n\n /* Figure out the subsection parities */\n for (let i = 0; i < n; i++) {\n if (enc[i]) {\n parity ^= i;\n }\n }\n\n parity = parity.toString(2).split(\"\").reverse();\n parity.forEach((e: any, i: any, a: any) => {\n a[i] = parseInt(e);\n });\n\n /* Set the parity bits accordingly */\n for (let i = 0; i < m; i++) {\n enc[2 ** i] = parity[i] ? 1 : 0;\n }\n\n parity = 0;\n /* Figure out the overall parity for the entire block */\n for (let i = 0; i < n; i++) {\n if (enc[i]) {\n parity++;\n }\n }\n\n /* Finally set the overall parity bit */\n enc[0] = parity % 2 == 0 ? 0 : 1;\n\n return enc.join(\"\");\n}\n\nexport function HammingDecode(data: string): number {\n let err = 0;\n const bits: Array = [];\n\n /* TODO why not just work with an array of digits from the start? */\n for (const i in data.split(\"\")) {\n const bit = parseInt(data[i]);\n bits[i] = bit;\n\n if (bit) {\n err ^= +i;\n }\n }\n\n /* If err != 0 then it spells out the index of the bit that was flipped */\n if (err) {\n /* Flip to correct */\n bits[err] = bits[err] ? 0 : 1;\n }\n\n /* Now we have to read the message, bit 0 is unused (it's the overall parity bit\n * which we don't care about). Each bit at an index that is a power of 2 is\n * a parity bit and not part of the actual message. */\n\n let ans = \"\";\n\n for (let i = 1; i < bits.length; i++) {\n /* i is not a power of two so it's not a parity bit */\n if ((i & (i - 1)) != 0) {\n ans += bits[i];\n }\n }\n\n /* TODO to avoid ambiguity about endianness why not let the player return the extracted (and corrected)\n * data bits, rather than guessing at how to convert it to a decimal string? */\n return parseInt(ans, 2);\n}\n","import { IBladeburner } from \"./IBladeburner\";\nimport { Action, IActionParams } from \"./Action\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Contract extends Action {\n constructor(params: IActionParams | null = null) {\n super(params);\n }\n\n getActionTypeSkillSuccessBonus(inst: IBladeburner): number {\n return inst.skillMultipliers.successChanceContract;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Contract\", this);\n }\n\n static fromJSON(value: IReviverValue): Contract {\n return Generic_fromJSON(Contract, value.data);\n }\n}\n\nReviver.constructors.Contract = Contract;\n","export const ConsoleHelpText: {\n [key: string]: string[];\n helpList: string[];\n automate: string[];\n clear: string[];\n cls: string[];\n help: string[];\n log: string[];\n skill: string[];\n start: string[];\n stop: string[];\n} = {\n helpList: [\n \"Use 'help [command]' to get more information about a particular Bladeburner console command.\",\n \" \",\n \" automate [var] [val] [hi/low] Configure simple automation for Bladeburner tasks\",\n \" clear/cls Clear the console\",\n \" help [cmd] Display this help text, or help text for a specific command\",\n \" log [en/dis] [type] Enable or disable logging for events and actions\",\n \" skill [action] [name] Level or display info about your Bladeburner skills\",\n \" start [type] [name] Start a Bladeburner action/task\",\n \" stop Stops your current Bladeburner action/task\",\n \" \",\n ],\n automate: [\n \"Usage: automate [var] [val] [hi/low]\",\n \" \",\n \"A simple way to automate your Bladeburner actions. This console command can be used \" +\n \"to automatically start an action when your stamina rises above a certain threshold, and \" +\n \"automatically switch to another action when your stamina drops below another threshold.\",\n \" \",\n \" automate status - Check the current status of your automation and get a brief description of what it'll do\",\n \" automate en - Enable the automation feature\",\n \" automate dis - Disable the automation feature\",\n \" \",\n \"There are four properties that must be set for this automation to work properly. Here is how to set them:\",\n \" \",\n \" automate stamina 100 high\",\n \" automate contract Tracking high\",\n \" automate stamina 50 low\",\n \" automate general 'Field Analysis' low\",\n \" \",\n \"Using the four console commands above will set the automation to perform Tracking contracts \" +\n \"if your stamina is 100 or higher, and then switch to Field Analysis if your stamina drops below \" +\n \"50. Note that when setting the action, the name of the action is CASE-SENSITIVE. It must \" +\n \"exactly match whatever the name is in the UI.\",\n \" \",\n ],\n clear: [\"Usage: clear\", \" \", \"Clears the console\", \" \"],\n cls: [\"Usage: cls\", \" \", \"Clears the console\", \" \"],\n help: [\n \"Usage: help [command]\",\n \" \",\n \"Running 'help' with no arguments displays the general help text, which lists all console commands \" +\n \"and a brief description of what they do. A command can be specified to get more specific help text \" +\n \"about that particular command. For example:\",\n \" \",\n \" help automate\",\n \" \",\n \"will display specific information about using the automate console command\",\n \" \",\n ],\n log: [\n \"Usage: log [en/dis] [type]\",\n \" \",\n \"Enable or disable logging. By default, the results of completing actions such as contracts/operations are logged \" +\n \"in the console. There are also random events that are logged in the console as well. The five categories of \" +\n \"things that get logged are:\",\n \" \",\n \"[general, contracts, ops, blackops, events]\",\n \" \",\n \"The logging for these categories can be enabled or disabled like so:\",\n \" \",\n \" log dis contracts - Disables logging that occurs when contracts are completed\",\n \" log en contracts - Enables logging that occurs when contracts are completed\",\n \" log dis events - Disables logging for Bladeburner random events\",\n \" \",\n \"Logging can be universally enabled/disabled using the 'all' keyword:\",\n \" \",\n \" log dis all\",\n \" log en all\",\n \" \",\n ],\n skill: [\n \"Usage: skill [action] [name]\",\n \" \",\n \"Level or display information about your skills.\",\n \" \",\n \"To display information about all of your skills and your multipliers, use:\",\n \" \",\n \" skill list\",\n \" \",\n \"To display information about a specific skill, specify the name of the skill afterwards. \" +\n \"Note that the name of the skill is case-sensitive. Enter it exactly as seen in the UI. If \" +\n \"the name of the skill has whitespace, enclose the name of the skill in double quotation marks:\",\n \" \",\n \" skill list Reaper\",\n \" skill list 'Digital Observer'\",\n \" \",\n \"This console command can also be used to level up skills:\",\n \" \",\n \" skill level [skill name]\",\n \" \",\n ],\n start: [\n \"Usage: start [type] [name]\",\n \" \",\n \"Start an action. An action is specified by its type and its name. The \" +\n \"name is case-sensitive. It must appear exactly as it does in the UI. If \" +\n \"the name of the action has whitespace, enclose it in double quotation marks. \" +\n \"Valid action types include:\",\n \" \",\n \"[general, contract, op, blackop]\",\n \" \",\n \"Examples:\",\n \" \",\n \" start contract Tracking\",\n \" start op 'Undercover Operation'\",\n \" \",\n ],\n stop: [\"Usage: stop\", \" \", \"Stop your current action and go idle.\", \" \"],\n};\n","// Defines a \"Research Tree\"\n// Each Industry has a unique Research Tree\n// Each Node in the Research Trees only holds the name(s) of Research,\n// not an actual Research object. The name can be used to obtain a reference\n// to the corresponding Research object using the ResearchMap\nimport { Research } from \"./Research\";\nimport { ResearchMap } from \"./ResearchMap\";\n\nimport { IMap } from \"../types\";\n\ninterface IConstructorParams {\n children?: Node[];\n cost: number;\n text: string;\n parent?: Node | null;\n}\n\nexport class Node {\n // All child Nodes in the tree\n // The Research held in this Node is a prerequisite for all Research in\n // child Nodes\n children: Node[] = [];\n\n // How much Scientific Research is needed for this\n // Necessary to show it on the UI\n cost = 0;\n\n // Whether or not this Research has been unlocked\n researched = false;\n\n // Parent node in the tree\n // The parent node defines the prerequisite Research (there can only be one)\n // Set as null for no prerequisites\n parent: Node | null = null;\n\n // Name of the Research held in this Node\n text = \"\";\n\n constructor(p: IConstructorParams = { cost: 0, text: \"\" }) {\n if (ResearchMap[p.text] == null) {\n throw new Error(`Invalid Research name used when constructing ResearchTree Node: ${p.text}`);\n }\n\n this.text = p.text;\n this.cost = p.cost;\n\n if (p.children && p.children.length > 0) {\n this.children = p.children;\n }\n\n if (p.parent != null) {\n this.parent = p.parent;\n }\n }\n\n addChild(n: Node): void {\n this.children.push(n);\n n.parent = this;\n }\n\n // Recursive function for finding a Node with the specified text\n findNode(text: string): Node | null {\n // Is this the Node?\n if (this.text === text) {\n return this;\n }\n\n // Recursively search chilren\n let res = null;\n for (let i = 0; i < this.children.length; ++i) {\n res = this.children[i].findNode(text);\n if (res != null) {\n return res;\n }\n }\n\n return null;\n }\n\n setParent(n: Node): void {\n this.parent = n;\n }\n}\n\n// A ResearchTree defines all available Research in an Industry\n// The root node in a Research Tree must always be the \"Hi-Tech R&D Laboratory\"\nexport class ResearchTree {\n // Object containing names of all acquired Research by name\n researched: IMap = {};\n\n // Root Node\n root: Node | null = null;\n\n // Gets an array with the 'text' values of ALL Nodes in the Research Tree\n getAllNodes(): string[] {\n const res: string[] = [];\n const queue: Node[] = [];\n\n if (this.root == null) {\n return res;\n }\n\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n res.push(node.text);\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Get total multipliers from this Research Tree\n getAdvertisingMultiplier(): number {\n return this.getMultiplierHelper(\"advertisingMult\");\n }\n\n getEmployeeChaMultiplier(): number {\n return this.getMultiplierHelper(\"employeeChaMult\");\n }\n\n getEmployeeCreMultiplier(): number {\n return this.getMultiplierHelper(\"employeeCreMult\");\n }\n\n getEmployeeEffMultiplier(): number {\n return this.getMultiplierHelper(\"employeeEffMult\");\n }\n\n getEmployeeIntMultiplier(): number {\n return this.getMultiplierHelper(\"employeeIntMult\");\n }\n\n getProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productionMult\");\n }\n\n getProductProductionMultiplier(): number {\n return this.getMultiplierHelper(\"productProductionMult\");\n }\n\n getSalesMultiplier(): number {\n return this.getMultiplierHelper(\"salesMult\");\n }\n\n getScientificResearchMultiplier(): number {\n return this.getMultiplierHelper(\"sciResearchMult\");\n }\n\n getStorageMultiplier(): number {\n return this.getMultiplierHelper(\"storageMult\");\n }\n\n // Helper function for all the multiplier getter fns\n getMultiplierHelper(propName: string): number {\n let res = 1;\n if (this.root == null) {\n return res;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n\n // If the Node has not been researched, there's no need to\n // process it or its children\n if (node == null || !node.researched) {\n continue;\n }\n\n const research: Research | null = ResearchMap[node.text];\n\n // Safety checks\n if (research == null) {\n console.warn(`Invalid Research name in node: ${node.text}`);\n continue;\n }\n\n const mult =\n {\n advertisingMult: research.advertisingMult,\n employeeChaMult: research.employeeChaMult,\n employeeCreMult: research.employeeCreMult,\n employeeEffMult: research.employeeEffMult,\n employeeIntMult: research.employeeIntMult,\n productionMult: research.productionMult,\n productProductionMult: research.productProductionMult,\n salesMult: research.salesMult,\n sciResearchMult: research.sciResearchMult,\n storageMult: research.storageMult,\n }[propName] ?? null;\n\n if (mult == null) {\n console.warn(`Invalid propName specified in ResearchTree.getMultiplierHelper: ${propName}`);\n continue;\n }\n\n res *= mult;\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n return res;\n }\n\n // Search for a Node with the given name ('text' property on the Node)\n // Returns 'null' if it cannot be found\n findNode(name: string): Node | null {\n if (this.root == null) {\n return null;\n }\n return this.root.findNode(name);\n }\n\n // Marks a Node as researched\n research(name: string): void {\n if (this.root == null) {\n return;\n }\n\n const queue: Node[] = [];\n queue.push(this.root);\n while (queue.length !== 0) {\n const node: Node | undefined = queue.shift();\n if (node == null) {\n continue;\n }\n\n if (node.text === name) {\n node.researched = true;\n this.researched[name] = true;\n return;\n }\n\n for (let i = 0; i < node.children.length; ++i) {\n queue.push(node.children[i]);\n }\n }\n\n console.warn(`ResearchTree.research() did not find the specified Research node for: ${name}`);\n }\n\n // Set the tree's Root Node\n setRoot(root: Node): void {\n this.root = root;\n }\n}\n","/**\n * How many stock market 'ticks' before a 'cycle' is triggered.\n * A 'tick' is whenver stock prices update\n */\nexport const TicksPerCycle = 75;\n","export const StanekConstants: {\n RAMBonus: number;\n BaseSize: number;\n MaxSize: number;\n} = {\n RAMBonus: 0.1,\n BaseSize: 9,\n MaxSize: 25,\n};\n","import { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { PlayerOwnedAugmentation } from \"../Augmentation/PlayerOwnedAugmentation\";\nimport { Player } from \"../Player\";\nimport { Script } from \"../Script/Script\";\nimport { GetAllServers } from \"../Server/AllServers\";\n\nconst detect: [string, string][] = [\n [\"getHackTime\", \"returns milliseconds\"],\n [\"getGrowTime\", \"returns milliseconds\"],\n [\"getWeakenTime\", \"returns milliseconds\"],\n [\"getActionTime\", \"returns milliseconds\"],\n [\"hackAnalyzePercent\", \"renamed 'hackAnalyze' and returns decimal\"],\n [\"hackChance\", \"renamed 'hackAnalyzeChance'\"],\n [\"basic.calculateSkill\", \"renamed 'skills.calculateSkill'\"],\n [\"basic.calculateExp\", \"renamed 'skills.calculateExp'\"],\n [\"basic.hackChance\", \"renamed 'hacking.hackChance'\"],\n [\"basic.hackExp\", \"renamed 'hacking.hackExp'\"],\n [\"basic.hackPercent\", \"renamed 'hacking.hackPercent'\"],\n [\"basic.growPercent\", \"renamed 'hacking.growPercent'\"],\n [\"basic.hackTime\", \"renamed 'hacking.hackTime'\"],\n [\"basic.growTime\", \"renamed 'hacking.growTime'\"],\n [\"basic.weakenTime\", \"renamed 'hacking.weakenTime'\"],\n [\"write\", \"needs to be awaited\"],\n [\"scp\", \"needs to be awaited\"],\n [\"sleep\", \"Can no longer be called simultenaously.\"],\n [\"hacking_skill\", \"renamed 'hacking'\"],\n [\"tryWrite\", \"renamed 'tryWritePort'\"],\n];\n\nconst changes: [RegExp, string][] = [\n [/ns.getHackTime/g, \"((...a)=>ns.getHackTime(...a)/1000)\"],\n [/ns.getGrowTime/g, \"((...a)=>ns.getGrowTime(...a)/1000)\"],\n [/ns.getWeakenTime/g, \"((...a)=>ns.getWeakenTime(...a)/1000)\"],\n [/ns.bladeburner.getActionTime/g, \"((...a)=>ns.bladeburner.getActionTime(...a)/1000)\"],\n [/ns.hackAnalyzePercent/g, \"((...a)=>ns.hackAnalyze(...a)*100)\"],\n [/ns.hackChance/g, \"ns.hackAnalyzeChance\"],\n [/ns.tryWrite/g, \"ns.tryWritePort\"],\n [/formulas.basic.calculateSkill/g, \"formulas.skills.calculateSkill\"],\n [/formulas.basic.calculateExp/g, \"formulas.skills.calculateExp\"],\n [/formulas.basic.hackChance/g, \"formulas.hacking.hackChance\"],\n [/formulas.basic.hackExp/g, \"formulas.hacking.hackExp\"],\n [/formulas.basic.hackPercent/g, \"formulas.hacking.hackPercent\"],\n [/formulas.basic.growPercent/g, \"formulas.hacking.growPercent\"],\n [/formulas.basic.hackTime/g, \"formulas.hacking.hackTime\"],\n [/formulas.basic.growTime/g, \"formulas.hacking.growTime\"],\n [/formulas.basic.weakenTime/g, \"formulas.hacking.weakenTime\"],\n];\nfunction hasChanges(code: string): boolean {\n for (const change of changes) {\n if (code.match(change[0])) return true;\n }\n return false;\n}\n\nfunction convert(code: string): string {\n const lines = code.split(\"\\n\");\n const out: string[] = [];\n for (let i = 0; i < lines.length; i++) {\n const orig = lines[i];\n let line = lines[i];\n for (const change of changes) {\n line = line.replace(change[0], change[1]);\n }\n if (line != orig) {\n out.push(`// =============================== original line ===============================`);\n out.push(`/**`);\n out.push(` * ${orig}`);\n out.push(\" */\");\n out.push(`// =============================================================================`);\n }\n out.push(line);\n }\n return out.join(\"\\n\");\n}\n\nexport function AwardNFG(n = 1): void {\n const nf = Player.augmentations.find((a) => a.name === AugmentationNames.NeuroFluxGovernor);\n if (nf) {\n nf.level += n;\n } else {\n const nf = new PlayerOwnedAugmentation(AugmentationNames.NeuroFluxGovernor);\n nf.level = n;\n Player.augmentations.push(nf);\n }\n}\n\nexport interface IFileLine {\n file: string;\n line: number;\n content: string;\n}\n\nexport function v1APIBreak(): void {\n let txt = \"\";\n for (const server of GetAllServers()) {\n for (const change of detect) {\n const s: IFileLine[] = [];\n for (const script of server.scripts) {\n const lines = script.code.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].includes(change[0])) {\n s.push({\n file: script.filename,\n line: i + 1,\n content: \"\",\n });\n }\n }\n }\n\n if (s.length === 0) continue;\n\n txt += `// Detected change ${change[0]}, reason: ${change[1]}\\n`;\n for (const fl of s) {\n txt += `${fl.file}:${fl.line}\\n`;\n }\n }\n }\n if (txt !== \"\") {\n const home = Player.getHomeComputer();\n home.writeToTextFile(\"v1_DETECTED_CHANGES.txt\", txt);\n }\n\n for (const server of GetAllServers()) {\n const backups: Script[] = [];\n for (const script of server.scripts) {\n if (!hasChanges(script.code)) continue;\n const prefix = script.filename.includes(\"/\") ? \"/BACKUP_\" : \"BACKUP_\";\n backups.push(new Script(Player, prefix + script.filename, script.code, script.server));\n script.code = convert(script.code);\n }\n server.scripts = server.scripts.concat(backups);\n }\n}\n","// Function that returns the next Company Position in the \"ladder\"\n// i.e. the next position to get promoted to\nimport { CompanyPosition } from \"./CompanyPosition\";\nimport { CompanyPositions } from \"./CompanyPositions\";\n\nexport function getNextCompanyPositionHelper(currPos: CompanyPosition | null): CompanyPosition | null {\n if (currPos == null) {\n return null;\n }\n\n const nextPosName: string | null = currPos.nextPosition;\n if (nextPosName == null) {\n return null;\n }\n\n return CompanyPositions[nextPosName];\n}\n","import { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessBladeburner(this: IPlayer): boolean {\n if (this.bitNodeN === 8) {\n return false;\n }\n\n return this.bitNodeN === 6 || this.bitNodeN === 7 || this.sourceFileLvl(6) > 0 || this.sourceFileLvl(7) > 0;\n}\n\nexport function inBladeburner(this: IPlayer): boolean {\n if (this.bladeburner == null) {\n return false;\n }\n return this.bladeburner instanceof Bladeburner;\n}\n\nexport function startBladeburner(this: IPlayer): void {\n this.bladeburner = new Bladeburner(this);\n}\n","import { Corporation } from \"../../Corporation/Corporation\";\nimport {\n CorporationUnlockUpgradeIndex,\n CorporationUnlockUpgrades,\n} from \"../../Corporation/data/CorporationUnlockUpgrades\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function canAccessCorporation(this: IPlayer): boolean {\n return this.bitNodeN === 3 || this.sourceFileLvl(3) > 0;\n}\n\nexport function hasCorporation(this: IPlayer): boolean {\n if (this.corporation == null) {\n return false;\n }\n return this.corporation instanceof Corporation;\n}\n\nexport function startCorporation(this: IPlayer, corpName: string, additionalShares = 0): void {\n this.corporation = new Corporation({\n name: corpName,\n });\n\n if (this.sourceFileLvl(3) === 3) {\n const warehouseApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.WarehouseAPI].index;\n const OfficeApi = CorporationUnlockUpgrades[CorporationUnlockUpgradeIndex.OfficeAPI].index;\n\n this.corporation.unlockUpgrades[warehouseApi] = 1;\n this.corporation.unlockUpgrades[OfficeApi] = 1;\n }\n\n this.corporation.totalShares += additionalShares;\n}\n","import { Work } from \"../../Work/Work\";\nimport { IPlayer } from \"../IPlayer\";\n\nexport function start(this: IPlayer, w: Work): void {\n if (this.currentWork !== null) {\n this.currentWork.finish(this, true);\n }\n this.currentWork = w;\n}\nexport function process(this: IPlayer, cycles = 1): void {\n if (this.currentWork === null) return;\n const finished = this.currentWork.process(this, cycles);\n if (finished) {\n this.finishWork(false);\n }\n}\nexport function finish(this: IPlayer, cancelled: boolean): void {\n if (this.currentWork === null) return;\n this.currentWork.finish(this, cancelled);\n this.currentWork = null;\n this.focus = false;\n}\n","/**\n * Game engine. Handles the main game loop.\n */\nimport { convertTimeMsToTimeElapsedString } from \"./utils/StringHelperFunctions\";\nimport { initAugmentations } from \"./Augmentation/AugmentationHelpers\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\nimport { initBitNodeMultipliers } from \"./BitNode/BitNode\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { generateRandomContract } from \"./CodingContractGenerator\";\nimport { initCompanies } from \"./Company/Companies\";\nimport { Corporation } from \"./Corporation/Corporation\";\nimport { CONSTANTS } from \"./Constants\";\nimport { Factions, initFactions } from \"./Faction/Factions\";\nimport { staneksGift } from \"./CotMG/Helper\";\nimport { processPassiveFactionRepGain, inviteToFaction } from \"./Faction/FactionHelpers\";\nimport { Router } from \"./ui/GameRoot\";\nimport { Page } from \"./ui/Router\";\nimport { SetupTextEditor } from \"./ScriptEditor/ui/ScriptEditorRoot\";\n\nimport {\n getHackingWorkRepGain,\n getFactionSecurityWorkRepGain,\n getFactionFieldWorkRepGain,\n} from \"./PersonObjects/formulas/reputation\";\nimport { hasHacknetServers, processHacknetEarnings } from \"./Hacknet/HacknetHelpers\";\nimport { iTutorialStart } from \"./InteractiveTutorial\";\nimport { checkForMessagesToSend } from \"./Message/MessageHelpers\";\nimport { loadAllRunningScripts, updateOnlineScriptTimes } from \"./NetscriptWorker\";\nimport { Player } from \"./Player\";\nimport { saveObject, loadGame } from \"./SaveObject\";\nimport { initForeignServers } from \"./Server/AllServers\";\nimport { Settings } from \"./Settings/Settings\";\nimport { ThemeEvents } from \"./Themes/ui/Theme\";\nimport { initSymbolToStockMap, processStockPrices } from \"./StockMarket/StockMarket\";\nimport { Terminal } from \"./Terminal\";\n\nimport { Money } from \"./ui/React/Money\";\nimport { Hashes } from \"./ui/React/Hashes\";\nimport { Reputation } from \"./ui/React/Reputation\";\n\nimport { AlertEvents } from \"./ui/React/AlertManager\";\nimport { exceptionAlert } from \"./utils/helpers/exceptionAlert\";\n\nimport { startExploits } from \"./Exploits/loops\";\nimport { calculateAchievements } from \"./Achievements/Achievements\";\n\nimport React from \"react\";\nimport { setupUncaughtPromiseHandler } from \"./UncaughtPromiseHandler\";\nimport { Button, Typography } from \"@mui/material\";\nimport { SnackbarEvents, ToastVariant } from \"./ui/React/Snackbar\";\n\nconst Engine: {\n _lastUpdate: number;\n updateGame: (numCycles?: number) => void;\n Counters: {\n [key: string]: number | undefined;\n autoSaveCounter: number;\n updateSkillLevelsCounter: number;\n updateDisplays: number;\n updateDisplaysLong: number;\n updateActiveScriptsDisplay: number;\n createProgramNotifications: number;\n augmentationsNotifications: number;\n checkFactionInvitations: number;\n passiveFactionGrowth: number;\n messages: number;\n mechanicProcess: number;\n contractGeneration: number;\n achievementsCounter: number;\n };\n decrementAllCounters: (numCycles?: number) => void;\n checkCounters: () => void;\n load: (saveString: string) => void;\n start: () => void;\n} = {\n // Time variables (milliseconds unix epoch time)\n _lastUpdate: new Date().getTime(),\n\n updateGame: function (numCycles = 1) {\n const time = numCycles * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Terminal.process(Router, Player, numCycles);\n\n Player.processWork(numCycles);\n\n // Update stock prices\n if (Player.hasWseAccount) {\n processStockPrices(numCycles);\n }\n\n // Gang, if applicable\n if (Player.inGang() && Player.gang !== null) {\n Player.gang.process(numCycles, Player);\n }\n\n // Staneks gift\n staneksGift.process(Player, numCycles);\n\n // Corporation\n if (Player.corporation instanceof Corporation) {\n // Stores cycles in a \"buffer\". Processed separately using Engine Counters\n Player.corporation.storeCycles(numCycles);\n }\n\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.storeCycles(numCycles);\n }\n\n // Sleeves\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].process(Player, numCycles);\n }\n\n // Counters\n Engine.decrementAllCounters(numCycles);\n Engine.checkCounters();\n\n // Update the running time of all active scripts\n updateOnlineScriptTimes(numCycles);\n\n // Hacknet Nodes\n processHacknetEarnings(Player, numCycles);\n },\n\n /**\n * Counters for the main event loop. Represent the number of game cycles that\n * are required for something to happen. These counters are in game cycles,\n * which is once every 200ms\n */\n Counters: {\n autoSaveCounter: 300,\n updateSkillLevelsCounter: 10,\n updateDisplays: 3,\n updateDisplaysLong: 15,\n updateActiveScriptsDisplay: 5,\n createProgramNotifications: 10,\n augmentationsNotifications: 10,\n checkFactionInvitations: 100,\n passiveFactionGrowth: 5,\n messages: 150,\n mechanicProcess: 5, // Processes certain mechanics (Corporation, Bladeburner)\n contractGeneration: 3000, // Generate Coding Contracts\n achievementsCounter: 60, // Check if we have new achievements\n },\n\n decrementAllCounters: function (numCycles = 1) {\n for (const counterName of Object.keys(Engine.Counters)) {\n const counter = Engine.Counters[counterName];\n if (counter === undefined) throw new Error(\"counter should not be undefined\");\n Engine.Counters[counterName] = counter - numCycles;\n }\n },\n\n /**\n * Checks if any counters are 0. If they are, executes whatever\n * is necessary and then resets the counter\n */\n checkCounters: function () {\n if (Engine.Counters.autoSaveCounter <= 0) {\n if (Settings.AutosaveInterval == null) {\n Settings.AutosaveInterval = 60;\n }\n if (Settings.AutosaveInterval === 0) {\n warnAutosaveDisabled();\n Engine.Counters.autoSaveCounter = 60 * 5; // Let's check back in a bit\n } else {\n Engine.Counters.autoSaveCounter = Settings.AutosaveInterval * 5;\n saveObject.saveGame(!Settings.SuppressSavedGameToast);\n }\n }\n\n if (Engine.Counters.checkFactionInvitations <= 0) {\n const invitedFactions = Player.checkForFactionInvitations();\n if (invitedFactions.length > 0) {\n const randFaction = invitedFactions[Math.floor(Math.random() * invitedFactions.length)];\n inviteToFaction(randFaction);\n }\n Engine.Counters.checkFactionInvitations = 100;\n }\n\n if (Engine.Counters.passiveFactionGrowth <= 0) {\n const adjustedCycles = Math.floor(5 - Engine.Counters.passiveFactionGrowth);\n processPassiveFactionRepGain(adjustedCycles);\n Engine.Counters.passiveFactionGrowth = 5;\n }\n\n if (Engine.Counters.messages <= 0) {\n checkForMessagesToSend();\n if (Player.hasAugmentation(AugmentationNames.TheRedPill)) {\n Engine.Counters.messages = 4500; // 15 minutes for Red pill message\n } else {\n Engine.Counters.messages = 150;\n }\n }\n if (Player.corporation instanceof Corporation) {\n Player.corporation.process(Player);\n }\n if (Engine.Counters.mechanicProcess <= 0) {\n if (Player.bladeburner instanceof Bladeburner) {\n try {\n Player.bladeburner.process(Router, Player);\n } catch (e) {\n exceptionAlert(\"Exception caught in Bladeburner.process(): \" + e);\n }\n }\n Engine.Counters.mechanicProcess = 5;\n }\n\n if (Engine.Counters.contractGeneration <= 0) {\n // X% chance of a contract being generated\n if (Math.random() <= 0.25) {\n generateRandomContract();\n }\n Engine.Counters.contractGeneration = 3000;\n }\n\n if (Engine.Counters.achievementsCounter <= 0) {\n calculateAchievements();\n Engine.Counters.achievementsCounter = 300;\n }\n },\n\n load: function (saveString) {\n startExploits();\n setupUncaughtPromiseHandler();\n // Load game from save or create new game\n\n if (loadGame(saveString)) {\n ThemeEvents.emit();\n\n initBitNodeMultipliers(Player);\n initAugmentations(); // Also calls Player.reapplyAllAugmentations()\n Player.reapplyAllSourceFiles();\n if (Player.hasWseAccount) {\n initSymbolToStockMap();\n }\n\n // Apply penalty for entropy accumulation\n Player.applyEntropy(Player.entropy);\n\n // Calculate the number of cycles have elapsed while offline\n Engine._lastUpdate = new Date().getTime();\n const lastUpdate = Player.lastUpdate;\n const timeOffline = Engine._lastUpdate - lastUpdate;\n const numCyclesOffline = Math.floor(timeOffline / CONSTANTS._idleSpeed);\n\n // Generate coding contracts\n if (Player.sourceFiles.length > 0) {\n let numContracts = 0;\n if (numCyclesOffline < 3000 * 100) {\n // if we have less than 100 rolls, just roll them exactly.\n for (let i = 0; i < numCyclesOffline / 3000; i++) {\n if (Math.random() < 0.25) numContracts++;\n }\n } else {\n // just average it.\n numContracts = (numCyclesOffline / 3000) * 0.25;\n }\n for (let i = 0; i < numContracts; i++) {\n generateRandomContract();\n }\n }\n\n let offlineReputation = 0;\n const offlineHackingIncome = (Player.moneySourceA.hacking / Player.playtimeSinceLastAug) * timeOffline * 0.75;\n Player.gainMoney(offlineHackingIncome, \"hacking\");\n // Process offline progress\n\n loadAllRunningScripts(); // This also takes care of offline production for those scripts\n\n if (Player.currentWork !== null) {\n Player.focus = true;\n Player.processWork(numCyclesOffline);\n } else {\n for (let i = 0; i < Player.factions.length; i++) {\n const facName = Player.factions[i];\n if (!Factions.hasOwnProperty(facName)) continue;\n const faction = Factions[facName];\n if (!faction.isMember) continue;\n // No rep for special factions.\n const info = faction.getInfo();\n if (!info.offersWork()) continue;\n // No rep for gangs.\n if (Player.getGangName() === facName) continue;\n\n const hRep = getHackingWorkRepGain(Player, faction.favor);\n const sRep = getFactionSecurityWorkRepGain(Player, faction.favor);\n const fRep = getFactionFieldWorkRepGain(Player, faction.favor);\n // can be infinite, doesn't matter.\n const reputationRate = Math.max(hRep, sRep, fRep) / Player.factions.length;\n\n const rep = reputationRate * numCyclesOffline;\n faction.playerReputation += rep;\n offlineReputation += rep;\n }\n }\n\n // Hacknet Nodes offline progress\n const offlineProductionFromHacknetNodes = processHacknetEarnings(Player, numCyclesOffline);\n const hacknetProdInfo = hasHacknetServers(Player) ? (\n <>\n hashes\n \n ) : (\n \n );\n\n // Passive faction rep gain offline\n processPassiveFactionRepGain(numCyclesOffline);\n\n // Stock Market offline progress\n if (Player.hasWseAccount) {\n processStockPrices(numCyclesOffline);\n }\n\n // Gang progress for BitNode 2\n const gang = Player.gang;\n if (Player.inGang() && gang !== null) {\n gang.process(numCyclesOffline, Player);\n }\n\n // Corporation offline progress\n if (Player.corporation instanceof Corporation) {\n Player.corporation.storeCycles(numCyclesOffline);\n }\n\n // Bladeburner offline progress\n if (Player.bladeburner instanceof Bladeburner) {\n Player.bladeburner.storeCycles(numCyclesOffline);\n }\n\n staneksGift.process(Player, numCyclesOffline);\n\n // Sleeves offline progress\n for (let i = 0; i < Player.sleeves.length; ++i) {\n Player.sleeves[i].process(Player, numCyclesOffline);\n }\n\n // Update total playtime\n const time = numCyclesOffline * CONSTANTS._idleSpeed;\n if (Player.totalPlaytime == null) {\n Player.totalPlaytime = 0;\n }\n if (Player.playtimeSinceLastAug == null) {\n Player.playtimeSinceLastAug = 0;\n }\n if (Player.playtimeSinceLastBitnode == null) {\n Player.playtimeSinceLastBitnode = 0;\n }\n Player.totalPlaytime += time;\n Player.playtimeSinceLastAug += time;\n Player.playtimeSinceLastBitnode += time;\n\n Player.lastUpdate = Engine._lastUpdate;\n Engine.start(); // Run main game loop and Scripts loop\n const timeOfflineString = convertTimeMsToTimeElapsedString(time);\n setTimeout(\n () =>\n AlertEvents.emit(\n <>\n Offline for {timeOfflineString}. While you were offline:\n
      \n
    • \n \n Your scripts generated \n \n
    • \n
    • \n Your Hacknet Nodes generated {hacknetProdInfo}\n
    • \n
    • \n \n You gained reputation divided amongst your factions\n \n
    • \n
    \n ,\n ),\n 250,\n );\n } else {\n // No save found, start new game\n initBitNodeMultipliers(Player);\n Engine.start(); // Run main game loop and Scripts loop\n Player.init();\n initForeignServers(Player.getHomeComputer());\n initCompanies();\n initFactions();\n initAugmentations();\n\n // Start interactive tutorial\n iTutorialStart();\n }\n SetupTextEditor();\n },\n\n start: function () {\n // Get time difference\n const _thisUpdate = new Date().getTime();\n let diff = _thisUpdate - Engine._lastUpdate;\n const offset = diff % CONSTANTS._idleSpeed;\n\n // Divide this by cycle time to determine how many cycles have elapsed since last update\n diff = Math.floor(diff / CONSTANTS._idleSpeed);\n\n if (diff > 0) {\n // Update the game engine by the calculated number of cycles\n Engine._lastUpdate = _thisUpdate - offset;\n Player.lastUpdate = _thisUpdate - offset;\n Engine.updateGame(diff);\n }\n window.requestAnimationFrame(Engine.start);\n },\n};\n\n/**\n * Shows a toast warning that lets the player know that auto-saves are disabled, with an button to re-enable them.\n */\nfunction warnAutosaveDisabled(): void {\n // If the player has suppressed those warnings let's just exit right away.\n if (Settings.SuppressAutosaveDisabledWarnings) return;\n\n // We don't want this warning to show up on certain pages.\n // When in recovery or importing we want to keep autosave disabled.\n const ignoredPages = [Page.Recovery, Page.ImportSave];\n if (ignoredPages.includes(Router.page())) return;\n\n const warningToast = (\n <>\n Auto-saves are disabled!\n {\n // We reset the value to a default\n Settings.AutosaveInterval = 60;\n }}\n >\n Enable\n \n \n );\n SnackbarEvents.emit(warningToast, ToastVariant.WARNING, 5000);\n}\n\nexport { Engine };\n","export { Theme as Default } from \"./default\";\nexport { Theme as DefaultLite } from \"./default-lite\";\nexport { Theme as Monokai } from \"./monokai-ish\";\nexport { Theme as Warmer } from \"./warmer\";\nexport { Theme as DarkPlus } from \"./dark-plus\";\nexport { Theme as MayukaiDark } from \"./mayukai-dark\";\nexport { Theme as Purple } from \"./purple\";\nexport { Theme as SmoothGreen } from \"./smooth-green\";\nexport { Theme as Dracula } from \"./dracula\";\nexport { Theme as DarkBlue } from \"./dark-blue\";\nexport { Theme as DiscordLike } from \"./discord-like\";\nexport { Theme as OneDark } from \"./one-dark\";\nexport { Theme as MutedGoldBlue } from \"./muted-gold-blue\";\nexport { Theme as Light } from \"./light\";\n","import React, { useState, useEffect } from \"react\";\nimport CircularProgress from \"@mui/material/CircularProgress\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\n\nimport { Terminal } from \"../Terminal\";\nimport { load } from \"../db\";\nimport { Player } from \"../Player\";\nimport { Engine } from \"../engine\";\nimport { GameRoot } from \"./GameRoot\";\n\nimport { CONSTANTS } from \"../Constants\";\nimport { ActivateRecoveryMode } from \"./React/RecoveryRoot\";\nimport { hash } from \"../hash/hash\";\nimport { pushGameReady } from \"../Electron\";\n\nexport function LoadingScreen(): React.ReactElement {\n const [show, setShow] = useState(false);\n const [loaded, setLoaded] = useState(false);\n\n const version = `v${CONSTANTS.VersionString} (${hash()})`;\n if (process.env.NODE_ENV === \"development\") {\n document.title = `[dev] Bitburner ${version}`;\n } else {\n document.title = `Bitburner ${version}`;\n }\n\n useEffect(() => {\n const id = setTimeout(() => {\n if (!loaded) setShow(true);\n }, 2000);\n return () => clearTimeout(id);\n });\n\n useEffect(() => {\n async function doLoad(): Promise {\n await load()\n .then((saveString) => {\n try {\n Engine.load(saveString);\n } catch (err: unknown) {\n ActivateRecoveryMode();\n setLoaded(true);\n throw err;\n }\n\n pushGameReady();\n setLoaded(true);\n })\n .catch((reason) => {\n console.error(reason);\n Engine.load(\"\");\n setLoaded(true);\n });\n }\n doLoad();\n }, []);\n\n return loaded ? (\n \n ) : (\n \n \n \n \n \n Loading Bitburner {version}\n \n {show && (\n \n \n If the game fails to load, consider killing all scripts\n \n \n )}\n \n );\n}\n","/**\n * Augmentation-related methods for the Player class (PlayerObject)\n */\nimport { IPlayer } from \"../IPlayer\";\n\nimport { Augmentation } from \"../../Augmentation/Augmentation\";\n\nimport { calculateEntropy } from \"../Grafting/EntropyAccumulation\";\n\nexport function hasAugmentation(this: IPlayer, aug: string | Augmentation, ignoreQueued = false): boolean {\n const augName: string = aug instanceof Augmentation ? aug.name : aug;\n\n for (const owned of this.augmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n\n if (!ignoreQueued) {\n for (const owned of this.queuedAugmentations) {\n if (owned.name === augName) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nexport function applyEntropy(this: IPlayer, stacks = 1): void {\n // Re-apply all multipliers\n this.reapplyAllAugmentations();\n this.reapplyAllSourceFiles();\n\n this.mults = calculateEntropy(this, stacks);\n}\n","/**\n * Checks that a variable is a valid number. A valid number\n * must be a \"number\" type and cannot be NaN\n */\nexport function isValidNumber(n: number): boolean {\n return typeof n === \"number\" && !isNaN(n);\n}\n","/**\n * Represents a Limit or Buy Order on the stock market. Does not represent\n * a Market Order since those are just executed immediately\n */\nimport { OrderTypes } from \"./data/OrderTypes\";\nimport { PositionTypes } from \"./data/PositionTypes\";\n\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\n\nexport class Order {\n readonly pos: PositionTypes;\n readonly price: number;\n shares: number;\n readonly stockSymbol: string;\n readonly type: OrderTypes;\n\n constructor(\n stockSymbol = \"\",\n shares = 0,\n price = 0,\n typ: OrderTypes = OrderTypes.LimitBuy,\n pos: PositionTypes = PositionTypes.Long,\n ) {\n // Validate arguments\n let invalidArgs = false;\n if (typeof shares !== \"number\" || typeof price !== \"number\") {\n invalidArgs = true;\n }\n if (isNaN(shares) || isNaN(price)) {\n invalidArgs = true;\n }\n if (typeof stockSymbol !== \"string\") {\n invalidArgs = true;\n }\n if (invalidArgs) {\n throw new Error(`Invalid constructor paramters for Order`);\n }\n\n this.stockSymbol = stockSymbol;\n this.shares = shares;\n this.price = price;\n this.type = typ;\n this.pos = pos;\n }\n\n /**\n * Serialize the Order to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Order\", this);\n }\n\n /**\n * Initializes a Order from a JSON save state\n */\n static fromJSON(value: IReviverValue): Order {\n return Generic_fromJSON(Order, value.data);\n }\n}\n\nReviver.constructors.Order = Order;\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Fragment } from \"./Fragment\";\nimport { ActiveFragment } from \"./ActiveFragment\";\nimport { FragmentType } from \"./FragmentType\";\nimport { IStaneksGift } from \"./IStaneksGift\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { CalculateEffect } from \"./formulas/effect\";\nimport { StaneksGiftEvents } from \"./StaneksGiftEvents\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { CONSTANTS } from \"../Constants\";\nimport { StanekConstants } from \"./data/Constants\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../Player\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\n\nexport class StaneksGift implements IStaneksGift {\n storedCycles = 0;\n fragments: ActiveFragment[] = [];\n\n baseSize(): number {\n return StanekConstants.BaseSize + BitNodeMultipliers.StaneksGiftExtraSize + Player.sourceFileLvl(13);\n }\n\n width(): number {\n return Math.max(2, Math.min(Math.floor(this.baseSize() / 2 + 1), StanekConstants.MaxSize));\n }\n height(): number {\n return Math.max(3, Math.min(Math.floor(this.baseSize() / 2 + 0.6), StanekConstants.MaxSize));\n }\n\n charge(player: IPlayer, af: ActiveFragment, threads: number): void {\n if (threads > af.highestCharge) {\n af.numCharge = (af.highestCharge * af.numCharge) / threads + 1;\n af.highestCharge = threads;\n } else {\n af.numCharge += threads / af.highestCharge;\n }\n\n const cotmg = Factions[FactionNames.ChurchOfTheMachineGod];\n cotmg.playerReputation += (player.mults.faction_rep * (Math.pow(threads, 0.95) * (cotmg.favor + 100))) / 1000;\n }\n\n inBonus(): boolean {\n return (this.storedCycles * CONSTANTS._idleSpeed) / 1000 > 1;\n }\n\n process(p: IPlayer, numCycles = 1): void {\n if (!p.hasAugmentation(AugmentationNames.StaneksGift1)) return;\n this.storedCycles += numCycles;\n this.storedCycles -= 10;\n this.storedCycles = Math.max(0, this.storedCycles);\n this.updateMults(p);\n StaneksGiftEvents.emit();\n }\n\n effect(fragment: ActiveFragment): number {\n // Find all the neighbooring cells\n const cells = fragment.neighboors();\n // find the neighbooring active fragments.\n const maybeFragments = cells.map((n) => this.fragmentAt(n[0], n[1]));\n\n // Filter out undefined with typescript \"Type guard\". Whatever\n let neighboors = maybeFragments.filter((v: ActiveFragment | undefined): v is ActiveFragment => !!v);\n\n neighboors = neighboors.filter((fragment) => fragment.fragment().type === FragmentType.Booster);\n let boost = 1;\n\n neighboors = neighboors.filter((v, i, s) => s.indexOf(v) === i);\n for (const neighboor of neighboors) {\n boost *= neighboor.fragment().power;\n }\n return CalculateEffect(fragment.highestCharge, fragment.numCharge, fragment.fragment().power, boost);\n }\n\n canPlace(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (rootX < 0 || rootY < 0) return false;\n if (rootX + fragment.width(rotation) > this.width()) return false;\n if (rootY + fragment.height(rotation) > this.height()) return false;\n if (this.count(fragment) >= fragment.limit) return false;\n const newFrag = new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment });\n for (const aFrag of this.fragments) {\n if (aFrag.collide(newFrag)) return false;\n }\n return true;\n }\n\n place(rootX: number, rootY: number, rotation: number, fragment: Fragment): boolean {\n if (!this.canPlace(rootX, rootY, rotation, fragment)) return false;\n this.fragments.push(new ActiveFragment({ x: rootX, y: rootY, rotation: rotation, fragment: fragment }));\n return true;\n }\n\n findFragment(rootX: number, rootY: number): ActiveFragment | undefined {\n return this.fragments.find((f) => f.x === rootX && f.y === rootY);\n }\n\n fragmentAt(worldX: number, worldY: number): ActiveFragment | undefined {\n for (const aFrag of this.fragments) {\n if (aFrag.fullAt(worldX, worldY)) {\n return aFrag;\n }\n }\n\n return undefined;\n }\n\n count(fragment: Fragment): number {\n let amt = 0;\n for (const aFrag of this.fragments) {\n if (aFrag.fragment().id === fragment.id) amt++;\n }\n return amt;\n }\n\n delete(rootX: number, rootY: number): boolean {\n for (let i = 0; i < this.fragments.length; i++) {\n if (this.fragments[i].x === rootX && this.fragments[i].y === rootY) {\n this.fragments.splice(i, 1);\n return true;\n }\n }\n\n return false;\n }\n\n clear(): void {\n this.fragments = [];\n }\n\n clearCharge(): void {\n this.fragments.forEach((f) => {\n f.highestCharge = 0;\n f.numCharge = 0;\n });\n }\n\n updateMults(p: IPlayer): void {\n // applyEntropy also reapplies all augmentations and source files\n // This wraps up the reset nicely\n p.applyEntropy(p.entropy);\n\n for (const aFrag of this.fragments) {\n const fragment = aFrag.fragment();\n\n const power = this.effect(aFrag);\n switch (fragment.type) {\n case FragmentType.HackingChance:\n p.mults.hacking_chance *= power;\n break;\n case FragmentType.HackingSpeed:\n p.mults.hacking_speed *= power;\n break;\n case FragmentType.HackingMoney:\n p.mults.hacking_money *= power;\n break;\n case FragmentType.HackingGrow:\n p.mults.hacking_grow *= power;\n break;\n case FragmentType.Hacking:\n p.mults.hacking *= power;\n p.mults.hacking_exp *= power;\n break;\n case FragmentType.Strength:\n p.mults.strength *= power;\n p.mults.strength_exp *= power;\n break;\n case FragmentType.Defense:\n p.mults.defense *= power;\n p.mults.defense_exp *= power;\n break;\n case FragmentType.Dexterity:\n p.mults.dexterity *= power;\n p.mults.dexterity_exp *= power;\n break;\n case FragmentType.Agility:\n p.mults.agility *= power;\n p.mults.agility_exp *= power;\n break;\n case FragmentType.Charisma:\n p.mults.charisma *= power;\n p.mults.charisma_exp *= power;\n break;\n case FragmentType.HacknetMoney:\n p.mults.hacknet_node_money *= power;\n break;\n case FragmentType.HacknetCost:\n p.mults.hacknet_node_purchase_cost /= power;\n p.mults.hacknet_node_ram_cost /= power;\n p.mults.hacknet_node_core_cost /= power;\n p.mults.hacknet_node_level_cost /= power;\n break;\n case FragmentType.Rep:\n p.mults.company_rep *= power;\n p.mults.faction_rep *= power;\n break;\n case FragmentType.WorkMoney:\n p.mults.work_money *= power;\n break;\n case FragmentType.Crime:\n p.mults.crime_success *= power;\n p.mults.crime_money *= power;\n break;\n case FragmentType.Bladeburner:\n p.mults.bladeburner_max_stamina *= power;\n p.mults.bladeburner_stamina_gain *= power;\n p.mults.bladeburner_analysis *= power;\n p.mults.bladeburner_success_chance *= power;\n break;\n }\n }\n p.updateSkillLevels();\n }\n\n prestigeAugmentation(): void {\n this.clearCharge();\n }\n\n prestigeSourceFile(): void {\n this.clear();\n this.storedCycles = 0;\n }\n\n /**\n * Serialize Staneks Gift to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"StaneksGift\", this);\n }\n\n /**\n * Initializes Staneks Gift from a JSON save state\n */\n static fromJSON(value: IReviverValue): StaneksGift {\n return Generic_fromJSON(StaneksGift, value.data);\n }\n}\n\nReviver.constructors.StaneksGift = StaneksGift;\n","/**\n * Class representing a visitable location in the world\n */\nimport { CityName } from \"./data/CityNames\";\nimport { LocationName } from \"./data/LocationNames\";\nimport { LocationType } from \"./LocationTypeEnum\";\n\ninterface IInfiltrationMetadata {\n maxClearanceLevel: number;\n startingSecurityLevel: number;\n}\n\nexport interface IConstructorParams {\n city?: CityName | null;\n costMult?: number;\n expMult?: number;\n infiltrationData?: IInfiltrationMetadata;\n name?: LocationName;\n types?: LocationType[];\n techVendorMaxRam?: number;\n techVendorMinRam?: number;\n}\n\nexport class Location {\n /**\n * Name of city this location is in. If this property is null, it means this i\n * is a generic location that is available in all cities\n */\n city: CityName | null = null;\n\n /**\n * Cost multiplier that influences how expensive a gym/university is\n */\n costMult = 0;\n\n /**\n * Exp multiplier that influences how effective a gym/university is\n */\n expMult = 0;\n\n /**\n * Companies can be infiltrated. This contains the data required for that\n * infiltration event\n */\n infiltrationData?: IInfiltrationMetadata;\n\n /**\n * Identifier for location\n */\n name: LocationName = LocationName.Void;\n\n /**\n * List of what type(s) this location is. A location can be multiple types\n * (e.g. company and tech vendor)\n */\n types: LocationType[] = [];\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMaxRam = 0;\n\n /**\n * Tech vendors allow you to purchase servers.\n * This property defines the max RAM server you can purchase from this vendor\n */\n techVendorMinRam = 0;\n\n constructor(p: IConstructorParams) {\n if (p.city) {\n this.city = p.city;\n }\n if (p.costMult) {\n this.costMult = p.costMult;\n }\n if (p.expMult) {\n this.expMult = p.expMult;\n }\n if (p.infiltrationData) {\n this.infiltrationData = p.infiltrationData;\n }\n if (p.name) {\n this.name = p.name;\n }\n if (p.types) {\n this.types = p.types;\n }\n if (p.techVendorMaxRam) {\n this.techVendorMaxRam = p.techVendorMaxRam;\n }\n if (p.techVendorMinRam) {\n this.techVendorMinRam = p.techVendorMinRam;\n }\n }\n}\n","import { Player } from \"../Player\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { isValidFilePath } from \"../Terminal/DirectoryHelpers\";\nimport { TextFile } from \"../TextFile\";\nimport {\n RFAMessage,\n FileData,\n FileContent,\n isFileServer,\n isFileLocation,\n FileLocation,\n isFileData,\n} from \"./MessageDefinitions\";\n\nimport libSource from \"!!raw-loader!../ScriptEditor/NetscriptDefinitions.d.ts\";\n\nfunction error(errorMsg: string, { id }: RFAMessage): RFAMessage {\n return new RFAMessage({ error: errorMsg, id: id });\n}\n\nexport const RFARequestHandler: Record void | RFAMessage> = {\n pushFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileData(msg.params)) return error(\"Misses parameters\", msg);\n\n const fileData: FileData = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (isScriptFilename(fileData.filename)) server.writeToScriptFile(Player, fileData.filename, fileData.content);\n // Assume it's a text file\n else server.writeToTextFile(fileData.filename, fileData.content);\n\n // If and only if the content is actually changed correctly, send back an OK.\n const savedCorrectly =\n server.getScript(fileData.filename)?.code === fileData.content ||\n server.textFiles.filter((t: TextFile) => t.filename == fileData.filename).at(0)?.text === fileData.content;\n\n if (!savedCorrectly) return error(\"File wasn't saved correctly\", msg);\n\n return new RFAMessage({ result: \"OK\", id: msg.id });\n },\n\n getFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (isScriptFilename(fileData.filename)) {\n const scriptContent = server.getScript(fileData.filename);\n if (!scriptContent) return error(\"File doesn't exist\", msg);\n return new RFAMessage({ result: scriptContent.code, id: msg.id });\n } else {\n // Assume it's a text file\n const file = server.textFiles.filter((t: TextFile) => t.filename == fileData.filename).at(0);\n if (!file) return error(\"File doesn't exist\", msg);\n return new RFAMessage({ result: file.text, id: msg.id });\n }\n },\n\n deleteFile: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileExists = (): boolean =>\n !!server.getScript(fileData.filename) || server.textFiles.some((t: TextFile) => t.filename === fileData.filename);\n\n if (!fileExists()) return error(\"File doesn't exist\", msg);\n server.removeFile(fileData.filename);\n if (fileExists()) return error(\"Failed to delete the file\", msg);\n\n return new RFAMessage({ result: \"OK\", id: msg.id });\n },\n\n getFileNames: function (msg: RFAMessage): RFAMessage {\n if (!isFileServer(msg.params)) return error(\"Message misses parameters\", msg);\n\n const server = GetServer(msg.params.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileNameList: string[] = [\n ...server.textFiles.map((txt): string => txt.filename),\n ...server.scripts.map((scr): string => scr.filename),\n ];\n\n return new RFAMessage({ result: fileNameList, id: msg.id });\n },\n\n getAllFiles: function (msg: RFAMessage): RFAMessage {\n if (!isFileServer(msg.params)) return error(\"Message misses parameters\", msg);\n\n const server = GetServer(msg.params.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n const fileList: FileContent[] = [\n ...server.textFiles.map((txt): FileContent => {\n return { filename: txt.filename, content: txt.text };\n }),\n ...server.scripts.map((scr): FileContent => {\n return { filename: scr.filename, content: scr.code };\n }),\n ];\n\n return new RFAMessage({ result: fileList, id: msg.id });\n },\n\n calculateRam: function (msg: RFAMessage): RFAMessage {\n if (!isFileLocation(msg.params)) return error(\"Message misses parameters\", msg);\n const fileData: FileLocation = msg.params;\n if (!isValidFilePath(fileData.filename)) return error(\"Invalid filename\", msg);\n\n const server = GetServer(fileData.server);\n if (!server) return error(\"Server hostname invalid\", msg);\n\n if (!isScriptFilename(fileData.filename)) return error(\"Filename isn't a script filename\", msg);\n const script = server.getScript(fileData.filename);\n if (!script) return error(\"File doesn't exist\", msg);\n const ramUsage = script.ramUsage;\n\n return new RFAMessage({ result: ramUsage, id: msg.id });\n },\n\n getDefinitionFile: function (msg: RFAMessage): RFAMessage {\n return new RFAMessage({ result: libSource + \"\", id: msg.id });\n },\n};\n","import React from \"react\";\n\nimport { Typography, Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { StatsRow } from \"../../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../../ui/React/CharacterOverview\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { MoneyRate } from \"../../../ui/React/MoneyRate\";\nimport { ReputationRate } from \"../../../ui/React/ReputationRate\";\nimport { use } from \"../../../ui/Context\";\n\nimport { Sleeve } from \"../Sleeve\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\nimport { BitNodeMultipliers } from \"../../../BitNode/BitNodeMultipliers\";\n\ninterface IProps {\n sleeve: Sleeve;\n}\n\nexport function StatsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n
    \n
    \n
    \n \n \n \n
    \n
    \n );\n}\n\nexport function EarningsElement(props: IProps): React.ReactElement {\n const classes = useStyles();\n const player = use.Player();\n\n let data: (string | JSX.Element)[][] = [];\n if (isSleeveCrimeWork(props.sleeve.currentWork)) {\n const gains = props.sleeve.currentWork.getExp();\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * gains.hackExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * gains.strExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * gains.defExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * gains.dexExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * gains.agiExp * BitNodeMultipliers.CrimeExpGain)}`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * gains.chaExp * BitNodeMultipliers.CrimeExpGain)}`],\n ];\n }\n if (isSleeveClassWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.calculateRates(player, props.sleeve);\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n ];\n }\n if (isSleeveFactionWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.getExpRates(props.sleeve);\n const repGain = props.sleeve.currentWork.getReputationRate(props.sleeve);\n data = [\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n [`Reputation:`, ],\n ];\n }\n\n if (isSleeveCompanyWork(props.sleeve.currentWork)) {\n const rates = props.sleeve.currentWork.getGainRates(player, props.sleeve);\n data = [\n [`Money:`, ],\n [`Hacking Exp:`, `${numeralWrapper.formatExp(5 * rates.hackExp)} / sec`],\n [`Strength Exp:`, `${numeralWrapper.formatExp(5 * rates.strExp)} / sec`],\n [`Defense Exp:`, `${numeralWrapper.formatExp(5 * rates.defExp)} / sec`],\n [`Dexterity Exp:`, `${numeralWrapper.formatExp(5 * rates.dexExp)} / sec`],\n [`Agility Exp:`, `${numeralWrapper.formatExp(5 * rates.agiExp)} / sec`],\n [`Charisma Exp:`, `${numeralWrapper.formatExp(5 * rates.chaExp)} / sec`],\n [`Reputation:`, ],\n ];\n }\n\n return (\n \n \n \n \n Earnings {props.sleeve.storedCycles > 50 ? \"(overclock)\" : \"\"}\n \n \n {data.map(([a, b]) => (\n \n \n {a}\n \n \n {b}\n \n \n ))}\n \n
    \n );\n}\n","/**\n * Creates a dropdown (select HTML element) with server hostnames as options\n *\n * Configurable to only contain certain types of servers\n */\nimport React from \"react\";\nimport { GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport { BaseServer } from \"../../Server/BaseServer\";\n\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Button from \"@mui/material/Button\";\n\n// TODO make this an enum when this gets converted to TypeScript\nexport const ServerType = {\n All: 0,\n Foreign: 1, // Hackable, non-owned servers\n Owned: 2, // Home Computer, Purchased Servers, and Hacknet Servers\n Purchased: 3, // Everything from Owned except home computer\n};\n\ninterface IProps {\n purchase: () => void;\n canPurchase: boolean;\n serverType: number;\n onChange: (event: SelectChangeEvent) => void;\n value: string;\n}\n\nexport function ServerDropdown(props: IProps): React.ReactElement {\n /**\n * Checks if the server should be shown in the dropdown menu, based on the\n * 'serverType' property\n */\n function isValidServer(s: BaseServer): boolean {\n const purchased = s instanceof Server && s.purchasedByPlayer;\n const type = props.serverType;\n switch (type) {\n case ServerType.All:\n return true;\n case ServerType.Foreign:\n return s.hostname !== \"home\" && !purchased;\n case ServerType.Owned:\n return purchased || s instanceof HacknetServer || s.hostname === \"home\";\n case ServerType.Purchased:\n return purchased || s instanceof HacknetServer;\n default:\n console.warn(`Invalid ServerType specified for ServerDropdown component: ${type}`);\n return false;\n }\n }\n\n const servers = [];\n for (const server of GetAllServers().sort((a, b) => a.hostname.localeCompare(b.hostname))) {\n if (isValidServer(server)) {\n servers.push(\n \n {server.hostname}\n ,\n );\n }\n }\n\n return (\n \n Buy\n \n }\n sx={{ mx: 1 }}\n value={props.value}\n onChange={props.onChange}\n >\n {servers}\n \n );\n}\n","import * as React from \"react\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Money } from \"../ui/React/Money\";\nimport { Game, reachedLimit } from \"./Game\";\nimport { Deck } from \"./CardDeck/Deck\";\nimport { Hand } from \"./CardDeck/Hand\";\nimport { InputAdornment } from \"@mui/material\";\nimport { ReactCard } from \"./CardDeck/ReactCard\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\n\nconst MAX_BET = 100e6;\nexport const DECK_COUNT = 5; // 5-deck multideck\n\nenum Result {\n Pending = \"\",\n PlayerWon = \"You won!\",\n PlayerWonByBlackjack = \"You Won! Blackjack!\",\n DealerWon = \"You lost!\",\n Tie = \"Push! (Tie)\",\n}\n\ntype Props = {\n p: IPlayer;\n};\n\ntype State = {\n playerHand: Hand;\n dealerHand: Hand;\n bet: number;\n betInput: string;\n gameInProgress: boolean;\n result: Result;\n gains: number; // Track gains only for this session\n wagerInvalid: boolean;\n wagerInvalidHelperText: string;\n};\n\nexport class Blackjack extends Game {\n deck: Deck;\n\n constructor(props: Props) {\n super(props);\n\n this.deck = new Deck(DECK_COUNT);\n\n const initialBet = 1e6;\n\n this.state = {\n playerHand: new Hand([]),\n dealerHand: new Hand([]),\n bet: initialBet,\n betInput: String(initialBet),\n gameInProgress: false,\n result: Result.Pending,\n gains: 0,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n };\n }\n\n canStartGame = (): boolean => {\n const { p } = this.props;\n const { bet } = this.state;\n\n return p.canAfford(bet);\n };\n\n startGame = (): void => {\n if (!this.canStartGame() || reachedLimit(this.props.p)) {\n return;\n }\n\n // Take money from player right away so that player's dont just \"leave\" to avoid the loss (I mean they could\n // always reload without saving but w.e) TODO: Save/Restore the RNG state to limit the value of save-scumming.\n this.props.p.loseMoney(this.state.bet, \"casino\");\n\n const playerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n const dealerHand = new Hand([this.deck.safeDrawCard(), this.deck.safeDrawCard()]);\n\n this.setState({\n playerHand,\n dealerHand,\n gameInProgress: true,\n result: Result.Pending,\n });\n\n // If the player is dealt a blackjack and the dealer is not, then the player\n // immediately wins\n if (this.getTrueHandValue(playerHand) === 21) {\n if (this.getTrueHandValue(dealerHand) === 21) {\n this.finishGame(Result.Tie);\n } else {\n this.finishGame(Result.PlayerWonByBlackjack);\n }\n } else if (this.getTrueHandValue(dealerHand) === 21) {\n // Check if dealer won by blackjack. We know at this point that the player does not also have blackjack.\n this.finishGame(Result.DealerWon);\n }\n };\n\n // Returns an array of numbers representing all possible values of the given Hand. The reason it needs to be\n // an array is because an Ace can count as both 1 and 11.\n getHandValue = (hand: Hand): number[] => {\n let result: number[] = [0];\n\n for (let i = 0; i < hand.cards.length; ++i) {\n const value = hand.cards[i].value;\n if (value >= 10) {\n result = result.map((x) => x + 10);\n } else if (value === 1) {\n result = result.flatMap((x) => [x + 1, x + 11]);\n } else {\n result = result.map((x) => x + value);\n }\n }\n\n return result;\n };\n\n // Returns the single hand value used for determine things like victory and whether or not\n // the dealer has to hit. Essentially this uses the biggest value that's 21 or under. If no such value exists,\n // then it means the hand is busted and we can just return whatever\n getTrueHandValue = (hand: Hand): number => {\n const handValues = this.getHandValue(hand);\n const valuesUnder21 = handValues.filter((x) => x <= 21);\n\n if (valuesUnder21.length > 0) {\n valuesUnder21.sort((a, b) => a - b);\n return valuesUnder21[valuesUnder21.length - 1];\n } else {\n // Just return the first value. It doesnt really matter anyways since hand is buted\n return handValues[0];\n }\n };\n\n // Returns all hand values that are 21 or under. If no values are 21 or under, then the first value is returned.\n getHandDisplayValues = (hand: Hand): number[] => {\n const handValues = this.getHandValue(hand);\n if (this.isHandBusted(hand)) {\n // Hand is busted so just return the 1st value, doesn't really matter\n return [...new Set([handValues[0]])];\n } else {\n return [...new Set(handValues.filter((x) => x <= 21))];\n }\n };\n\n isHandBusted = (hand: Hand): boolean => {\n return this.getTrueHandValue(hand) > 21;\n };\n\n playerHit = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n const newHand = this.state.playerHand.addCards(this.deck.safeDrawCard());\n\n this.setState({\n playerHand: newHand,\n });\n\n // Check if player busted, and finish the game if so\n if (this.isHandBusted(newHand)) {\n this.finishGame(Result.DealerWon);\n }\n };\n\n playerStay = (event: React.MouseEvent): void => {\n if (!event.isTrusted) {\n return;\n }\n\n // Determine if Dealer needs to hit. A dealer must hit if they have 16 or lower.\n // If the dealer has a Soft 17 (Ace + 6), then they stay.\n let newDealerHand = this.state.dealerHand;\n while (true) {\n // The dealer's \"true\" hand value is the 2nd one if its 21 or less (the 2nd value is always guaranteed\n // to be equal or larger). Otherwise its the 1st.\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n\n if (dealerHandValue <= 16) {\n newDealerHand = newDealerHand.addCards(this.deck.safeDrawCard());\n } else {\n break;\n }\n }\n\n this.setState({\n dealerHand: newDealerHand,\n });\n\n // If dealer has busted, then player wins\n if (this.isHandBusted(newDealerHand)) {\n this.finishGame(Result.PlayerWon);\n } else {\n const dealerHandValue = this.getTrueHandValue(newDealerHand);\n const playerHandValue = this.getTrueHandValue(this.state.playerHand);\n\n // We expect nobody to have busted. If someone busted, there is an error\n // in our game logic\n if (dealerHandValue > 21 || playerHandValue > 21) {\n throw new Error(\"Someone busted when not expected to\");\n }\n\n if (playerHandValue > dealerHandValue) {\n this.finishGame(Result.PlayerWon);\n } else if (playerHandValue < dealerHandValue) {\n this.finishGame(Result.DealerWon);\n } else {\n this.finishGame(Result.Tie);\n }\n }\n };\n\n finishGame = (result: Result): void => {\n const gains =\n result === Result.DealerWon\n ? 0 // We took away the bet at the start, don't need to take more\n : result === Result.Tie\n ? this.state.bet // We took away the bet at the start, give it back\n : result === Result.PlayerWon\n ? 2 * this.state.bet // Give back their bet plus their winnings\n : result === Result.PlayerWonByBlackjack\n ? 2.5 * this.state.bet // Blackjack pays out 1.5x bet!\n : (() => {\n throw new Error(`Unexpected result: ${result}`);\n })(); // This can't happen, right?\n this.win(this.props.p, gains);\n this.setState({\n gameInProgress: false,\n result,\n gains: this.state.gains + gains - this.state.bet, // Not updated upfront - only tracks the final outcome\n });\n };\n\n wagerOnChange = (event: React.ChangeEvent): void => {\n const { p } = this.props;\n const betInput = event.target.value;\n const wager = Math.round(parseFloat(betInput));\n if (isNaN(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not a valid number\",\n });\n } else if (wager <= 0) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Must bet a postive amount\",\n });\n } else if (wager > MAX_BET) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Exceeds max bet\",\n });\n } else if (!p.canAfford(wager)) {\n this.setState({\n bet: 0,\n betInput,\n wagerInvalid: true,\n wagerInvalidHelperText: \"Not enough money\",\n });\n } else {\n // Valid wager\n this.setState({\n bet: wager,\n betInput,\n wagerInvalid: false,\n wagerInvalidHelperText: \"\",\n result: Result.Pending, // Reset previous game status to clear the win/lose text UI\n });\n }\n };\n\n // Start game button\n startOnClick = (event: React.MouseEvent): void => {\n // Protect against scripting...although maybe this would be fun to automate\n if (!event.isTrusted) {\n return;\n }\n\n if (!this.state.wagerInvalid) {\n this.startGame();\n }\n };\n\n render(): React.ReactNode {\n const { betInput, playerHand, dealerHand, gameInProgress, result, wagerInvalid, wagerInvalidHelperText, gains } =\n this.state;\n\n // Get the player totals to display.\n const playerHandValues = this.getHandDisplayValues(playerHand);\n const dealerHandValues = this.getHandDisplayValues(dealerHand);\n\n return (\n <>\n {/* Wager input */}\n \n \n {\"Wager (Max: \"}\n \n {\")\"}\n \n }\n disabled={gameInProgress}\n onChange={this.wagerOnChange}\n error={wagerInvalid}\n helperText={wagerInvalid ? wagerInvalidHelperText : \"\"}\n type=\"number\"\n style={{\n width: \"200px\",\n }}\n InputProps={{\n startAdornment: (\n \n $\n \n ),\n }}\n />\n\n \n {\"Total earnings this session: \"}\n \n \n \n\n {/* Buttons */}\n {!gameInProgress ? (\n \n ) : (\n <>\n \n \n \n )}\n\n {/* Main game part. Displays both if the game is in progress OR if there's a result so you can see\n * the cards that led to that result. */}\n {(gameInProgress || result !== Result.Pending) && (\n <>\n \n \n Player\n {playerHand.cards.map((card, i) => (\n \n ))}\n\n \n Count:{\" \"}\n {playerHandValues\n .map((value, i) => {value})\n .reduce((prev, curr) => [prev, \" or \", curr])}\n \n \n \n\n
    \n\n \n \n Dealer\n {dealerHand.cards.map((card, i) => (\n // Hide every card except the first while game is in progress\n \n \n \n )}\n\n {/* Results from previous round */}\n {result !== Result.Pending && (\n \n {result} \n {result === Result.PlayerWon && }\n {result === Result.PlayerWonByBlackjack && }\n {result === Result.DealerWon && }\n \n )}\n \n );\n }\n}\n","import React, { FC } from \"react\";\nimport { Card, Suit } from \"./Card\";\n\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport Paper from \"@mui/material/Paper\";\n\ntype Props = {\n card: Card;\n hidden?: boolean;\n};\n\nconst useStyles = makeStyles(() =>\n createStyles({\n card: {\n padding: \"10px\",\n border: \"solid 1px #808080\",\n backgroundColor: \"white\",\n display: \"inline-block\",\n borderRadius: \"10px\",\n fontSize: \"18.5px\",\n textAlign: \"center\",\n margin: \"3px\",\n fontWeight: \"bold\",\n },\n red: {\n color: \"red\",\n },\n\n black: {\n color: \"black\",\n },\n value: {\n fontSize: \"20px\",\n fontFamily: \"sans-serif\",\n },\n }),\n);\n\nexport const ReactCard: FC = ({ card, hidden }) => {\n const classes = useStyles();\n let suit: React.ReactNode;\n switch (card.suit) {\n case Suit.Clubs:\n suit = ;\n break;\n case Suit.Diamonds:\n suit = ;\n break;\n case Suit.Hearts:\n suit = ;\n break;\n case Suit.Spades:\n suit = ;\n break;\n default:\n throw new Error(`MissingCaseException: ${card.suit}`);\n }\n return (\n \n <>\n {hidden ? \" - \" : card.formatValue()}\n {hidden ? \" - \" : suit}\n \n \n );\n};\n","import { Milestone } from \"./Milestone\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { Factions } from \"../Faction/Factions\";\nimport { Faction } from \"../Faction/Faction\";\nimport { GetServer } from \"../Server/AllServers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Server } from \"../Server/Server\";\n\nfunction allFactionAugs(p: IPlayer, f: Faction): boolean {\n const factionAugs = f.augmentations.slice().filter((aug) => aug !== \"NeuroFlux Governor\");\n for (const factionAug of factionAugs) {\n if (\n !p.augmentations.some((aug) => {\n return aug.name == factionAug;\n })\n )\n return false;\n }\n return true;\n}\n\nexport const Milestones: Milestone[] = [\n {\n title: \"Gain root access on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"hasAdminRights\")) return false;\n return server instanceof Server && server.hasAdminRights;\n },\n },\n {\n title: \"Install the backdoor on CSEC\",\n fulfilled: (): boolean => {\n const server = GetServer(\"CSEC\");\n if (!server || !server.hasOwnProperty(\"backdoorInstalled\")) return false;\n return server instanceof Server && server.backdoorInstalled;\n },\n },\n {\n title: \"Join the faction hinted at in csec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.CyberSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.CyberSec}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.CyberSec]);\n },\n },\n {\n title: \"Join the faction hinted at in nitesec-test.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.NiteSec);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.NiteSec}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.NiteSec]);\n },\n },\n {\n title: \"Join the faction hinted at in j3.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.TheBlackHand);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.TheBlackHand}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.TheBlackHand]);\n },\n },\n {\n title: \"Join the faction hinted at in 19dfj3l1nd.msg\",\n fulfilled: (p: IPlayer): boolean => {\n return p.factions.includes(FactionNames.BitRunners);\n },\n },\n {\n title: `Install all the Augmentations from ${FactionNames.BitRunners}`,\n fulfilled: (p: IPlayer): boolean => {\n return allFactionAugs(p, Factions[FactionNames.BitRunners]);\n },\n },\n {\n title: \"Complete fl1ght.exe\",\n fulfilled: (p: IPlayer): boolean => {\n // technically wrong but whatever\n return p.factions.includes(FactionNames.Daedalus);\n },\n },\n {\n title: `Install the special Augmentation from ${FactionNames.Daedalus}`,\n fulfilled: (p: IPlayer): boolean => {\n return p.augmentations.some((aug) => aug.name == \"The Red Pill\");\n },\n },\n {\n title: \"Install the final backdoor and free yourself.\",\n fulfilled: (): boolean => {\n return false;\n },\n },\n];\n","import { StockSymbols } from \"./StockSymbols\";\n\nexport const TickerHeaderFormatData = {\n longestName: 0,\n longestSymbol: 0,\n};\n\nfor (const key of Object.keys(StockSymbols)) {\n TickerHeaderFormatData.longestName = Math.max(key.length, TickerHeaderFormatData.longestName);\n TickerHeaderFormatData.longestSymbol = Math.max(StockSymbols[key].length, TickerHeaderFormatData.longestSymbol);\n}\n","import React from \"react\";\n\nimport { Box, Typography } from \"@mui/material\";\n\nimport { Achievement } from \"./Achievements\";\nimport { Settings } from \"../Settings/Settings\";\nimport { AchievementIcon } from \"./AchievementIcon\";\n\ninterface IProps {\n achievement: Achievement;\n unlockedOn?: number;\n cssFiltersUnlocked: string;\n cssFiltersLocked: string;\n}\n\nexport function AchievementEntry({\n achievement,\n unlockedOn,\n cssFiltersUnlocked,\n cssFiltersLocked,\n}: IProps): JSX.Element {\n if (!achievement) return <>;\n const isUnlocked = !!unlockedOn;\n\n const mainColor = isUnlocked ? Settings.theme.primary : Settings.theme.secondarylight;\n\n let achievedOn = \"\";\n if (unlockedOn) {\n achievedOn = new Date(unlockedOn).toLocaleString();\n }\n\n return (\n \n \n \n \n \n {achievement.Name}\n \n \n {achievement.Description}\n \n {isUnlocked && (\n \n Acquired on {achievedOn}\n \n )}\n \n \n \n );\n}\n","// @ts-nocheck\n/* tslint:disable */\n/* eslint-disable */\n\n/*\n Taken from:\n https://codepen.io/sosuke/pen/Pjoqqp\n --------------------------------------------------------\n This utility transform an hex color into css filter rules.\n Useful to change color of a black image to match a given color\n*/\n\nclass Color {\n constructor(r, g, b) {\n this.set(r, g, b);\n }\n\n toString() {\n return `rgb(${Math.round(this.r)}, ${Math.round(this.g)}, ${Math.round(this.b)})`;\n }\n\n set(r, g, b) {\n this.r = this.clamp(r);\n this.g = this.clamp(g);\n this.b = this.clamp(b);\n }\n\n hueRotate(angle = 0) {\n angle = (angle / 180) * Math.PI;\n const sin = Math.sin(angle);\n const cos = Math.cos(angle);\n\n this.multiply([\n 0.213 + cos * 0.787 - sin * 0.213,\n 0.715 - cos * 0.715 - sin * 0.715,\n 0.072 - cos * 0.072 + sin * 0.928,\n 0.213 - cos * 0.213 + sin * 0.143,\n 0.715 + cos * 0.285 + sin * 0.14,\n 0.072 - cos * 0.072 - sin * 0.283,\n 0.213 - cos * 0.213 - sin * 0.787,\n 0.715 - cos * 0.715 + sin * 0.715,\n 0.072 + cos * 0.928 + sin * 0.072,\n ]);\n }\n\n grayscale(value = 1) {\n this.multiply([\n 0.2126 + 0.7874 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 + 0.2848 * (1 - value),\n 0.0722 - 0.0722 * (1 - value),\n 0.2126 - 0.2126 * (1 - value),\n 0.7152 - 0.7152 * (1 - value),\n 0.0722 + 0.9278 * (1 - value),\n ]);\n }\n\n sepia(value = 1) {\n this.multiply([\n 0.393 + 0.607 * (1 - value),\n 0.769 - 0.769 * (1 - value),\n 0.189 - 0.189 * (1 - value),\n 0.349 - 0.349 * (1 - value),\n 0.686 + 0.314 * (1 - value),\n 0.168 - 0.168 * (1 - value),\n 0.272 - 0.272 * (1 - value),\n 0.534 - 0.534 * (1 - value),\n 0.131 + 0.869 * (1 - value),\n ]);\n }\n\n saturate(value = 1) {\n this.multiply([\n 0.213 + 0.787 * value,\n 0.715 - 0.715 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 + 0.285 * value,\n 0.072 - 0.072 * value,\n 0.213 - 0.213 * value,\n 0.715 - 0.715 * value,\n 0.072 + 0.928 * value,\n ]);\n }\n\n multiply(matrix) {\n const newR = this.clamp(this.r * matrix[0] + this.g * matrix[1] + this.b * matrix[2]);\n const newG = this.clamp(this.r * matrix[3] + this.g * matrix[4] + this.b * matrix[5]);\n const newB = this.clamp(this.r * matrix[6] + this.g * matrix[7] + this.b * matrix[8]);\n this.r = newR;\n this.g = newG;\n this.b = newB;\n }\n\n brightness(value = 1) {\n this.linear(value);\n }\n contrast(value = 1) {\n this.linear(value, -(0.5 * value) + 0.5);\n }\n\n linear(slope = 1, intercept = 0) {\n this.r = this.clamp(this.r * slope + intercept * 255);\n this.g = this.clamp(this.g * slope + intercept * 255);\n this.b = this.clamp(this.b * slope + intercept * 255);\n }\n\n invert(value = 1) {\n this.r = this.clamp((value + (this.r / 255) * (1 - 2 * value)) * 255);\n this.g = this.clamp((value + (this.g / 255) * (1 - 2 * value)) * 255);\n this.b = this.clamp((value + (this.b / 255) * (1 - 2 * value)) * 255);\n }\n\n hsl() {\n // Code taken from https://stackoverflow.com/a/9493060/2688027, licensed under CC BY-SA.\n const r = this.r / 255;\n const g = this.g / 255;\n const b = this.b / 255;\n const max = Math.max(r, g, b);\n const min = Math.min(r, g, b);\n let h,\n s,\n l = (max + min) / 2;\n\n if (max === min) {\n h = s = 0;\n } else {\n const d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n\n case g:\n h = (b - r) / d + 2;\n break;\n\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n\n return {\n h: h * 100,\n s: s * 100,\n l: l * 100,\n };\n }\n\n clamp(value) {\n if (value > 255) {\n value = 255;\n } else if (value < 0) {\n value = 0;\n }\n return value;\n }\n}\n\nexport class Solver {\n constructor(target) {\n this.target = target;\n this.targetHSL = target.hsl();\n this.reusedColor = new Color(0, 0, 0);\n }\n\n solve() {\n const result = this.solveNarrow(this.solveWide());\n return {\n values: result.values,\n loss: result.loss,\n filter: this.css(result.values),\n };\n }\n\n solveWide() {\n const A = 5;\n const c = 15;\n const a = [60, 180, 18000, 600, 1.2, 1.2];\n\n let best = { loss: Infinity };\n for (let i = 0; best.loss > 25 && i < 3; i++) {\n const initial = [50, 20, 3750, 50, 100, 100];\n const result = this.spsa(A, a, c, initial, 1000);\n if (result.loss < best.loss) {\n best = result;\n }\n }\n return best;\n }\n\n solveNarrow(wide) {\n const A = wide.loss;\n const c = 2;\n const A1 = A + 1;\n const a = [0.25 * A1, 0.25 * A1, A1, 0.25 * A1, 0.2 * A1, 0.2 * A1];\n return this.spsa(A, a, c, wide.values, 500);\n }\n\n spsa(A, a, c, values, iters) {\n const alpha = 1;\n const gamma = 0.16666666666666666;\n\n let best = null;\n let bestLoss = Infinity;\n const deltas = new Array(6);\n const highArgs = new Array(6);\n const lowArgs = new Array(6);\n\n for (let k = 0; k < iters; k++) {\n const ck = c / Math.pow(k + 1, gamma);\n for (let i = 0; i < 6; i++) {\n deltas[i] = Math.random() > 0.5 ? 1 : -1;\n highArgs[i] = values[i] + ck * deltas[i];\n lowArgs[i] = values[i] - ck * deltas[i];\n }\n\n const lossDiff = this.loss(highArgs) - this.loss(lowArgs);\n for (let i = 0; i < 6; i++) {\n const g = (lossDiff / (2 * ck)) * deltas[i];\n const ak = a[i] / Math.pow(A + k + 1, alpha);\n values[i] = fix(values[i] - ak * g, i);\n }\n\n const loss = this.loss(values);\n if (loss < bestLoss) {\n best = values.slice(0);\n bestLoss = loss;\n }\n }\n return { values: best, loss: bestLoss };\n\n function fix(value, idx) {\n let max = 100;\n if (idx === 2 /* saturate */) {\n max = 7500;\n } else if (idx === 4 /* brightness */ || idx === 5 /* contrast */) {\n max = 200;\n }\n\n if (idx === 3 /* hue-rotate */) {\n if (value > max) {\n value %= max;\n } else if (value < 0) {\n value = max + (value % max);\n }\n } else if (value < 0) {\n value = 0;\n } else if (value > max) {\n value = max;\n }\n return value;\n }\n }\n\n loss(filters) {\n // Argument is array of percentages.\n const color = this.reusedColor;\n color.set(0, 0, 0);\n\n color.invert(filters[0] / 100);\n color.sepia(filters[1] / 100);\n color.saturate(filters[2] / 100);\n color.hueRotate(filters[3] * 3.6);\n color.brightness(filters[4] / 100);\n color.contrast(filters[5] / 100);\n\n const colorHSL = color.hsl();\n return (\n Math.abs(color.r - this.target.r) +\n Math.abs(color.g - this.target.g) +\n Math.abs(color.b - this.target.b) +\n Math.abs(colorHSL.h - this.targetHSL.h) +\n Math.abs(colorHSL.s - this.targetHSL.s) +\n Math.abs(colorHSL.l - this.targetHSL.l)\n );\n }\n\n css(filters) {\n function fmt(idx, multiplier = 1) {\n return Math.round(filters[idx] * multiplier);\n }\n return `invert(${fmt(0)}%) sepia(${fmt(1)}%) saturate(${fmt(2)}%) hue-rotate(${fmt(3, 3.6)}deg) brightness(${fmt(\n 4,\n )}%) contrast(${fmt(5)}%)`;\n }\n}\n\nfunction hexToRgb(hex): number[] {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n const shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, (m, r, g, b) => {\n return r + r + g + g + b + b;\n });\n\n const result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? [parseInt(result[1], 16), parseInt(result[2], 16), parseInt(result[3], 16)] : null;\n}\n\nexport function getFiltersFromHex(hex): string {\n const rgb = hexToRgb(hex);\n if (!rgb) return \"\";\n\n const [r, g, b] = rgb;\n const color = new Color(r, g, b);\n const solver = new Solver(color);\n return solver.solve().filter;\n}\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Default\",\n description: \"Default game theme, most supported\",\n credit: \"hydroflame\",\n screenshot: img1,\n colors: {\n primarylight: \"#0f0\",\n primary: \"#0c0\",\n primarydark: \"#090\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Default-lite\",\n description: \"Less eye-straining default theme\",\n credit: \"NmuGmu\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/925263801564151888\",\n screenshot: img1,\n colors: {\n primarylight: \"#28CF28\",\n primary: \"#21A821\",\n primarydark: \"#177317\",\n successlight: \"#1CFF1C\",\n success: \"#16CA16\",\n successdark: \"#0D910D\",\n errorlight: \"#FF3B3B\",\n error: \"#C32D2D\",\n errordark: \"#8E2121\",\n secondarylight: \"#B3B3B3\",\n secondary: \"#838383\",\n secondarydark: \"#676767\",\n warninglight: \"#FFFF3A\",\n warning: \"#C3C32A\",\n warningdark: \"#8C8C1E\",\n infolight: \"#64CBFF\",\n info: \"#3399CC\",\n infodark: \"#246D91\",\n welllight: \"#404040\",\n well: \"#1C1C1C\",\n white: \"#C3C3C3\",\n black: \"#0A0B0B\",\n hp: \"#C62E2E\",\n money: \"#D6BB27\",\n hack: \"#ADFF2F\",\n combat: \"#E8EDCD\",\n cha: \"#8B5FAF\",\n int: \"#537CC8\",\n rep: \"#E8EDCD\",\n disabled: \"#5AB5A5\",\n backgroundprimary: \"#0C0D0E\",\n backgroundsecondary: \"#121415\",\n button: \"#252829\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Monokai'ish\",\n description: \"Monokai'ish\",\n credit: \"eltea\",\n screenshot: img1,\n colors: {\n primarylight: \"#FFF\",\n primary: \"#F8F8F2\",\n primarydark: \"#FAFAEB\",\n successlight: \"#ADE146\",\n success: \"#A6E22E\",\n successdark: \"#98E104\",\n errorlight: \"#FF69A0\",\n error: \"#F92672\",\n errordark: \"#D10F56\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E1D992\",\n warning: \"#E6DB74\",\n warningdark: \"#EDDD54\",\n infolight: \"#92E1F1\",\n info: \"#66D9EF\",\n infodark: \"#31CDED\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#F92672\",\n money: \"#E6DB74\",\n hack: \"#A6E22E\",\n combat: \"#75715E\",\n cha: \"#AE81FF\",\n int: \"#66D9EF\",\n rep: \"#E69F66\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#272822\",\n backgroundsecondary: \"#1B1C18\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Warmer\",\n credit: \"hexnaught\",\n description: \"Warmer, softer theme\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999581020028938\",\n screenshot: img1,\n colors: {\n primarylight: \"#EA9062\",\n primary: \"#DD7B4A\",\n primarydark: \"#D3591C\",\n successlight: \"#6ACF6A\",\n success: \"#43BF43\",\n successdark: \"#3E913E\",\n errorlight: \"#C15757\",\n error: \"#B34141\",\n errordark: \"#752525\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E6E69D\",\n warning: \"#DADA56\",\n warningdark: \"#A1A106\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#AD84CF\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#76C6B7\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark+\",\n credit: \"LoganMD\",\n description: \"VSCode Dark+\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/921999975867617310\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#CCCCAE\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#00D200\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#C80000\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#969090\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#C8C800\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Mayukai Dark\",\n description: \"Mayukai Dark-esque\",\n credit: \"Festive Noire\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922037502334889994\",\n screenshot: img1,\n colors: {\n primarylight: \"#DDDFC5\",\n primary: \"#CDCFB6\",\n primarydark: \"#9D9F8C\",\n successlight: \"#00EF00\",\n success: \"#00A500\",\n successdark: \"#007A00\",\n errorlight: \"#F92672\",\n error: \"#CA1C5C\",\n errordark: \"#90274A\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#D3D300\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#00010A\",\n white: \"#fff\",\n black: \"#020509\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#8CCF27\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#080C11\",\n backgroundsecondary: \"#03080F\",\n button: \"#00010A\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Purple\",\n credit: \"zer0ney\",\n description: \"Essentially all defaults except for purple replacing the main colors\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922091815849570395\",\n screenshot: img1,\n colors: {\n primarylight: \"#BA55D3\",\n primary: \"#9370DB\",\n primarydark: \"#8A2BE2\",\n successlight: \"#BA55D3\",\n success: \"#9370DB\",\n successdark: \"#8A2BE2\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#222\",\n white: \"#fff\",\n black: \"#000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#000\",\n backgroundsecondary: \"#000\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Smooth Green\",\n description: \"A nice green theme that doesn't hurt your eyes.\",\n credit: \"Swidt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922243957986033725\",\n screenshot: img1,\n colors: {\n primarylight: \"#E0E0BC\",\n primary: \"#B0D9A3\",\n primarydark: \"#B8B89C\",\n successlight: \"#00F000\",\n success: \"#6BC16B\",\n successdark: \"#00B400\",\n errorlight: \"#F00000\",\n error: \"#3D713D\",\n errordark: \"#A00000\",\n secondarylight: \"#B4AEAE\",\n secondary: \"#8FAF85\",\n secondarydark: \"#787272\",\n warninglight: \"#F0F000\",\n warning: \"#38F100\",\n warningdark: \"#A0A000\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#2F3C2B\",\n white: \"#fff\",\n black: \"#1E1E1E\",\n hp: \"#dd3434\",\n money: \"#4AA52E\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#35A135\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#1E1E1E\",\n backgroundsecondary: \"#252525\",\n button: \"#2F3C2B\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dracula\",\n description: \"Dracula Look-alike\",\n credit: \"H3draut3r\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/922296307836678144\",\n screenshot: img1,\n colors: {\n primarylight: \"#7082B8\",\n primary: \"#F8F8F2\",\n primarydark: \"#FF79C6\",\n successlight: \"#0f0\",\n success: \"#0c0\",\n successdark: \"#090\",\n errorlight: \"#FD4545\",\n error: \"#FF2D2D\",\n errordark: \"#C62424\",\n secondarylight: \"#AAA\",\n secondary: \"#8BE9FD\",\n secondarydark: \"#666\",\n warninglight: \"#FFC281\",\n warning: \"#FFB86C\",\n warningdark: \"#E6A055\",\n infolight: \"#A0A0FF\",\n info: \"#7070FF\",\n infodark: \"#4040FF\",\n welllight: \"#44475A\",\n well: \"#363948\",\n white: \"#fff\",\n black: \"#282A36\",\n hp: \"#D34448\",\n money: \"#50FA7B\",\n hack: \"#F1FA8C\",\n combat: \"#BD93F9\",\n cha: \"#FF79C6\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#282A36\",\n backgroundsecondary: \"#21222C\",\n button: \"#21222C\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Dark Blue\",\n description: \"Very dark with a blue/purplelly primary\",\n credit: \"Saynt_Garmo\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/923084732718264340\",\n screenshot: img1,\n colors: {\n primarylight: \"#023DDE\",\n primary: \"#4A41C8\",\n primarydark: \"#005299\",\n successlight: \"#00FF00\",\n success: \"#D1DAD1\",\n successdark: \"#BFCABF\",\n errorlight: \"#f00\",\n error: \"#c00\",\n errordark: \"#900\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#040505\",\n white: \"#fff\",\n black: \"#000000\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#091419\",\n backgroundsecondary: \"#000000\",\n button: \"#000000\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Discord-like\",\n description: \"Discord inspired theme\",\n credit: \"Thermite\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924305252017143818\",\n screenshot: img1,\n colors: {\n primarylight: \"#7389DC\",\n primary: \"#7389DC\",\n primarydark: \"#5964F1\",\n successlight: \"#00CC00\",\n success: \"#20DF20\",\n successdark: \"#0CB80C\",\n errorlight: \"#EA5558\",\n error: \"#EC4145\",\n errordark: \"#E82528\",\n secondarylight: \"#C3C3C3\",\n secondary: \"#9C9C9C\",\n secondarydark: \"#4E4E4E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#1C4FB3\",\n welllight: \"#999999\",\n well: \"#35383C\",\n white: \"#FFFFFF\",\n black: \"#202225\",\n hp: \"#FF5656\",\n money: \"#43FF43\",\n hack: \"#FFAB3D\",\n combat: \"#8A90FD\",\n cha: \"#FF51D9\",\n int: \"#6495ed\",\n rep: \"#FFFF30\",\n disabled: \"#474B51\",\n backgroundprimary: \"#2F3136\",\n backgroundsecondary: \"#35393E\",\n button: \"#333\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"One Dark\",\n description: \"Dark with a greenish tint\",\n credit: \"Dexalt142\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924650660694208512\",\n screenshot: img1,\n colors: {\n primarylight: \"#98C379\",\n primary: \"#98C379\",\n primarydark: \"#98C379\",\n successlight: \"#98C379\",\n success: \"#98C379\",\n successdark: \"#98C379\",\n errorlight: \"#E06C75\",\n error: \"#BE5046\",\n errordark: \"#BE5046\",\n secondarylight: \"#AAA\",\n secondary: \"#888\",\n secondarydark: \"#666\",\n warninglight: \"#E5C07B\",\n warning: \"#E5C07B\",\n warningdark: \"#D19A66\",\n infolight: \"#61AFEF\",\n info: \"#61AFEF\",\n infodark: \"#61AFEF\",\n welllight: \"#4B5263\",\n well: \"#282C34\",\n white: \"#ABB2BF\",\n black: \"#282C34\",\n hp: \"#E06C75\",\n money: \"#E5C07B\",\n hack: \"#98C379\",\n combat: \"#ABB2BF\",\n cha: \"#C678DD\",\n int: \"#61AFEF\",\n rep: \"#ABB2BF\",\n disabled: \"#56B6C2\",\n backgroundprimary: \"#282C34\",\n backgroundsecondary: \"#21252B\",\n button: \"#4B5263\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Muted Gold & Blue\",\n description: \"Muted gold with blue accents.\",\n credit: \"Sloth\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/924672660758208563\",\n screenshot: img1,\n colors: {\n primarylight: \"#E3B54A\",\n primary: \"#CAA243\",\n primarydark: \"#7E6937\",\n successlight: \"#82FF82\",\n success: \"#6FDA6F\",\n successdark: \"#64C364\",\n errorlight: \"#FD5555\",\n error: \"#D84A4A\",\n errordark: \"#AC3939\",\n secondarylight: \"#D8D0B8\",\n secondary: \"#B1AA95\",\n secondarydark: \"#736E5E\",\n warninglight: \"#ff0\",\n warning: \"#cc0\",\n warningdark: \"#990\",\n infolight: \"#69f\",\n info: \"#36c\",\n infodark: \"#039\",\n welllight: \"#444\",\n well: \"#111111\",\n white: \"#fff\",\n black: \"#070300\",\n hp: \"#dd3434\",\n money: \"#ffd700\",\n hack: \"#adff2f\",\n combat: \"#faffdf\",\n cha: \"#a671d1\",\n int: \"#6495ed\",\n rep: \"#faffdf\",\n disabled: \"#66cfbc\",\n backgroundprimary: \"#0A0A0E\",\n backgroundsecondary: \"#0E0E10\",\n button: \"#222222\",\n },\n};\n","import { IPredefinedTheme } from \"../../Themes\";\nimport img1 from \"./screenshot.png\";\n\nexport const Theme: IPredefinedTheme = {\n name: \"Light\",\n description: \"Cobbled Together Light Theme\",\n credit: \"matt\",\n reference: \"https://discord.com/channels/415207508303544321/921991895230611466/926114005456658432\",\n screenshot: img1,\n colors: {\n primarylight: \"#535353\",\n primary: \"#1A1A1A\",\n primarydark: \"#0d0d0d\",\n successlight: \"#63c439\",\n success: \"#428226\",\n successdark: \"#2E5A1B\",\n errorlight: \"#df7051\",\n error: \"#C94824\",\n errordark: \"#91341B\",\n secondarylight: \"#b3b3b3\",\n secondary: \"#9B9B9B\",\n secondarydark: \"#7A7979\",\n warninglight: \"#e8d464\",\n warning: \"#C6AD20\",\n warningdark: \"#9F8A16\",\n infolight: \"#6299cf\",\n info: \"#3778B7\",\n infodark: \"#30689C\",\n welllight: \"#f9f9f9\",\n well: \"#eaeaea\",\n white: \"#F7F7F7\",\n black: \"#F7F7F7\",\n hp: \"#BF5C41\",\n money: \"#E1B121\",\n hack: \"#47BC38\",\n combat: \"#656262\",\n cha: \"#A568AC\",\n int: \"#889BCF\",\n rep: \"#656262\",\n disabled: \"#70B4BF\",\n backgroundprimary: \"#F7F7F7\",\n backgroundsecondary: \"#f9f9f9\",\n button: \"#eaeaea\",\n },\n};\n","export default \"dist/images/83b2443ab7e7d346766c8f6bc5afc7a7.png\";","export default \"dist/images/6caf35202b10b52e1fc2743f674c33e8.png\";","export default \"dist/images/cb88977ea837bccb9cceb727adc78302.png\";","export default \"dist/images/4e0e750f2f09de58219773edd46cbbf5.png\";","export default \"dist/images/e97de4daa946331c7e99dee9c05d629c.png\";","export default \"dist/images/9f96a5084f4e5f1a6c0041b41b34d62d.png\";","export default \"dist/images/85a7b2896acb62be76f3ea7100fe9012.png\";","export default \"dist/images/5aa87b7de67a77c914088783b055e1cf.png\";","export default \"dist/images/c7164b072d62c91c27c6d607b5207e7b.png\";","export default \"dist/images/66f4b86d86164fc117bd6d648e4eaa6f.png\";","export default \"dist/images/a1110d6c8d16a14c4570411750248399.png\";","export default \"dist/images/447bc31e61f55e7eff875be3e9a81f1a.png\";","export default \"dist/images/297df8c0e47764ea113951318b2acf55.png\";","export default \"dist/images/e66b0c327f97d08e4253f52234d659eb.png\";","import { ITerminal, Output, Link, RawOutput, TTimer } from \"./ITerminal\";\nimport { IRouter } from \"../ui/Router\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { BaseServer } from \"../Server/BaseServer\";\nimport { Server } from \"../Server/Server\";\nimport { Programs } from \"../Programs/Programs\";\nimport { CodingContractResult } from \"../CodingContracts\";\nimport { TerminalEvents, TerminalClearEvents } from \"./TerminalEvents\";\n\nimport { TextFile } from \"../TextFile\";\nimport { Script } from \"../Script/Script\";\nimport { isScriptFilename } from \"../Script/isScriptFilename\";\nimport { CONSTANTS } from \"../Constants\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\n\nimport { removeLeadingSlash, isInRootDirectory, evaluateFilePath } from \"./DirectoryHelpers\";\nimport { checkIfConnectedToDarkweb } from \"../DarkWeb/DarkWeb\";\nimport { iTutorialNextStep, iTutorialSteps, ITutorial } from \"../InteractiveTutorial\";\nimport { getServerOnNetwork, processSingleServerGrowth } from \"../Server/ServerHelpers\";\nimport { ParseCommand, ParseCommands } from \"./Parser\";\nimport { SpecialServers } from \"../Server/data/SpecialServers\";\nimport { Settings } from \"../Settings/Settings\";\nimport { createProgressBarText } from \"../utils/helpers/createProgressBarText\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\n\nimport { alias } from \"./commands/alias\";\nimport { analyze } from \"./commands/analyze\";\nimport { backdoor } from \"./commands/backdoor\";\nimport { buy } from \"./commands/buy\";\nimport { cat } from \"./commands/cat\";\nimport { cd } from \"./commands/cd\";\nimport { check } from \"./commands/check\";\nimport { connect } from \"./commands/connect\";\nimport { cp } from \"./commands/cp\";\nimport { download } from \"./commands/download\";\nimport { expr } from \"./commands/expr\";\nimport { free } from \"./commands/free\";\nimport { grow } from \"./commands/grow\";\nimport { hack } from \"./commands/hack\";\nimport { help } from \"./commands/help\";\nimport { history } from \"./commands/history\";\nimport { home } from \"./commands/home\";\nimport { hostname } from \"./commands/hostname\";\nimport { kill } from \"./commands/kill\";\nimport { killall } from \"./commands/killall\";\nimport { ls } from \"./commands/ls\";\nimport { lscpu } from \"./commands/lscpu\";\nimport { mem } from \"./commands/mem\";\nimport { mv } from \"./commands/mv\";\nimport { nano } from \"./commands/nano\";\nimport { ps } from \"./commands/ps\";\nimport { rm } from \"./commands/rm\";\nimport { run } from \"./commands/run\";\nimport { scan } from \"./commands/scan\";\nimport { scananalyze } from \"./commands/scananalyze\";\nimport { scp } from \"./commands/scp\";\nimport { sudov } from \"./commands/sudov\";\nimport { tail } from \"./commands/tail\";\nimport { top } from \"./commands/top\";\nimport { unalias } from \"./commands/unalias\";\nimport { vim } from \"./commands/vim\";\nimport { weaken } from \"./commands/weaken\";\nimport { wget } from \"./commands/wget\";\nimport { hash } from \"../hash/hash\";\nimport { apr1 } from \"./commands/apr1\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\n\nexport class Terminal implements ITerminal {\n // Flags to determine whether the player is currently running a hack or an analyze\n action: TTimer | null = null;\n\n commandHistory: string[] = [];\n commandHistoryIndex = 0;\n\n outputHistory: (Output | Link | RawOutput)[] = [\n new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\"),\n ];\n\n // True if a Coding Contract prompt is opened\n contractOpen = false;\n\n // Full Path of current directory\n // Excludes the trailing forward slash\n currDir = \"/\";\n\n process(router: IRouter, player: IPlayer, cycles: number): void {\n if (this.action === null) return;\n this.action.timeLeft -= (CONSTANTS._idleSpeed * cycles) / 1000;\n if (this.action.timeLeft < 0.01) this.finishAction(router, player, false);\n TerminalEvents.emit();\n }\n\n append(item: Output | Link | RawOutput): void {\n this.outputHistory.push(item);\n if (this.outputHistory.length > Settings.MaxTerminalCapacity) {\n this.outputHistory.splice(0, this.outputHistory.length - Settings.MaxTerminalCapacity);\n }\n TerminalEvents.emit();\n }\n\n print(s: string): void {\n this.append(new Output(s, \"primary\"));\n }\n\n printRaw(node: React.ReactNode): void {\n this.append(new RawOutput(node));\n }\n\n error(s: string): void {\n this.append(new Output(s, \"error\"));\n }\n\n success(s: string): void {\n this.append(new Output(s, \"success\"));\n }\n\n info(s: string): void {\n this.append(new Output(s, \"info\"));\n }\n\n warn(s: string): void {\n this.append(new Output(s, \"warn\"));\n }\n\n startHack(player: IPlayer): void {\n // Hacking through Terminal should be faster than hacking through a script\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, player) / 4, \"h\", server);\n }\n\n startGrow(player: IPlayer): void {\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateGrowTime(server, player) / 16, \"g\", server);\n }\n startWeaken(player: IPlayer): void {\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateWeakenTime(server, player) / 16, \"w\", server);\n }\n\n startBackdoor(player: IPlayer): void {\n // Backdoor should take the same amount of time as hack\n const server = player.getCurrentServer();\n if (server instanceof HacknetServer) {\n this.error(\"Cannot backdoor this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n this.startAction(calculateHackingTime(server, player) / 4, \"b\", server);\n }\n\n startAnalyze(player: IPlayer): void {\n this.print(\"Analyzing system...\");\n const server = player.getCurrentServer();\n this.startAction(1, \"a\", server);\n }\n\n startAction(n: number, action: \"h\" | \"b\" | \"a\" | \"g\" | \"w\", server?: BaseServer): void {\n this.action = new TTimer(n, action, server);\n }\n\n // Complete the hack/analyze command\n finishHack(router: IRouter, player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n\n // Calculate whether hack was successful\n const hackChance = calculateHackingChance(server, player);\n const rand = Math.random();\n const expGainedOnSuccess = calculateHackingExpGain(server, player);\n const expGainedOnFailure = expGainedOnSuccess / 4;\n if (rand < hackChance) {\n // Success!\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n router.toBitVerse(false, false);\n return;\n }\n let moneyGained = calculatePercentMoneyHacked(server, player) * BitNodeMultipliers.ManualHackMoney;\n moneyGained = Math.floor(server.moneyAvailable * moneyGained);\n\n if (moneyGained <= 0) {\n moneyGained = 0;\n } // Safety check\n\n server.moneyAvailable -= moneyGained;\n player.gainMoney(moneyGained, \"hacking\");\n player.gainHackingExp(expGainedOnSuccess);\n player.gainIntelligenceExp(expGainedOnSuccess / CONSTANTS.IntelligenceTerminalHackBaseExpGain);\n\n const oldSec = server.hackDifficulty;\n server.fortify(CONSTANTS.ServerFortifyAmount);\n const newSec = server.hackDifficulty;\n\n this.print(\n `Hack successful on '${server.hostname}'! Gained ${numeralWrapper.formatMoney(\n moneyGained,\n )} and ${numeralWrapper.formatExp(expGainedOnSuccess)} hacking exp`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n } else {\n // Failure\n player.gainHackingExp(expGainedOnFailure);\n this.print(\n `Failed to hack '${server.hostname}'. Gained ${numeralWrapper.formatExp(expGainedOnFailure)} hacking exp`,\n );\n }\n }\n\n finishGrow(player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot grow this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, player);\n const oldSec = server.hackDifficulty;\n const growth = processSingleServerGrowth(server, 25, player, server.cpuCores) - 1;\n const newSec = server.hackDifficulty;\n\n player.gainHackingExp(expGain);\n this.print(\n `Available money on '${server.hostname}' grown by ${numeralWrapper.formatPercentage(\n growth,\n 6,\n )}. Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n this.print(\n `Security increased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)}`,\n );\n }\n\n finishWeaken(player: IPlayer, server: BaseServer, cancelled = false): void {\n if (cancelled) return;\n\n if (server instanceof HacknetServer) {\n this.error(\"Cannot weaken this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n const expGain = calculateHackingExpGain(server, player);\n const oldSec = server.hackDifficulty;\n server.weaken(CONSTANTS.ServerWeakenAmount);\n const newSec = server.hackDifficulty;\n\n player.gainHackingExp(expGain);\n this.print(\n `Security decreased on '${server.hostname}' from ${numeralWrapper.formatSecurity(\n oldSec,\n )} to ${numeralWrapper.formatSecurity(newSec)} (min: ${numeralWrapper.formatSecurity(server.minDifficulty)})` +\n ` and Gained ${numeralWrapper.formatExp(expGain)} hacking exp.`,\n );\n }\n\n finishBackdoor(router: IRouter, player: IPlayer, server: BaseServer, cancelled = false): void {\n if (!cancelled) {\n if (server instanceof HacknetServer) {\n this.error(\"Cannot hack this kind of server\");\n return;\n }\n if (!(server instanceof Server)) throw new Error(\"server should be normal server\");\n server.backdoorInstalled = true;\n if (SpecialServers.WorldDaemon === server.hostname) {\n if (player.bitNodeN == null) {\n player.bitNodeN = 1;\n }\n router.toBitVerse(false, false);\n return;\n }\n this.print(`Backdoor on '${server.hostname}' successful!`);\n }\n }\n\n finishAnalyze(player: IPlayer, currServ: BaseServer, cancelled = false): void {\n if (!cancelled) {\n const isHacknet = currServ instanceof HacknetServer;\n this.print(currServ.hostname + \": \");\n const org = currServ.organizationName;\n this.print(\"Organization name: \" + (!isHacknet ? org : \"player\"));\n const hasAdminRights = (!isHacknet && currServ.hasAdminRights) || isHacknet;\n this.print(\"Root Access: \" + (hasAdminRights ? \"YES\" : \"NO\"));\n const canRunScripts = hasAdminRights && currServ.maxRam > 0;\n this.print(\"Can run scripts on this host: \" + (canRunScripts ? \"YES\" : \"NO\"));\n this.print(\"RAM: \" + numeralWrapper.formatRAM(currServ.maxRam));\n if (currServ instanceof Server) {\n this.print(\"Backdoor: \" + (currServ.backdoorInstalled ? \"YES\" : \"NO\"));\n const hackingSkill = currServ.requiredHackingSkill;\n this.print(\"Required hacking skill for hack() and backdoor: \" + (!isHacknet ? hackingSkill : \"N/A\"));\n const security = currServ.hackDifficulty;\n this.print(\"Server security level: \" + (!isHacknet ? numeralWrapper.formatServerSecurity(security) : \"N/A\"));\n const hackingChance = calculateHackingChance(currServ, player);\n this.print(\"Chance to hack: \" + (!isHacknet ? numeralWrapper.formatPercentage(hackingChance) : \"N/A\"));\n const hackingTime = calculateHackingTime(currServ, player) * 1000;\n this.print(\"Time to hack: \" + (!isHacknet ? convertTimeMsToTimeElapsedString(hackingTime, true) : \"N/A\"));\n }\n this.print(\n `Total money available on server: ${\n currServ instanceof Server ? numeralWrapper.formatMoney(currServ.moneyAvailable) : \"N/A\"\n }`,\n );\n if (currServ instanceof Server) {\n const numPort = currServ.numOpenPortsRequired;\n this.print(\"Required number of open ports for NUKE: \" + (!isHacknet ? numPort : \"N/A\"));\n this.print(\"SSH port: \" + (currServ.sshPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"FTP port: \" + (currServ.ftpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SMTP port: \" + (currServ.smtpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"HTTP port: \" + (currServ.httpPortOpen ? \"Open\" : \"Closed\"));\n this.print(\"SQL port: \" + (currServ.sqlPortOpen ? \"Open\" : \"Closed\"));\n }\n }\n }\n\n finishAction(router: IRouter, player: IPlayer, cancelled = false): void {\n if (this.action === null) {\n if (!cancelled) throw new Error(\"Finish action called when there was no action\");\n return;\n }\n\n if (!this.action.server) throw new Error(\"Missing action target server\");\n\n this.print(this.getProgressText());\n if (this.action.action === \"h\") {\n this.finishHack(router, player, this.action.server, cancelled);\n } else if (this.action.action === \"g\") {\n this.finishGrow(player, this.action.server, cancelled);\n } else if (this.action.action === \"w\") {\n this.finishWeaken(player, this.action.server, cancelled);\n } else if (this.action.action === \"b\") {\n this.finishBackdoor(router, player, this.action.server, cancelled);\n } else if (this.action.action === \"a\") {\n this.finishAnalyze(player, this.action.server, cancelled);\n }\n\n if (cancelled) {\n this.print(\"Cancelled\");\n }\n this.action = null;\n TerminalEvents.emit();\n }\n\n getFile(player: IPlayer, filename: string): Script | TextFile | string | null {\n if (isScriptFilename(filename)) {\n return this.getScript(player, filename);\n }\n\n if (filename.endsWith(\".lit\")) {\n return this.getLitFile(player, filename);\n }\n\n if (filename.endsWith(\".txt\")) {\n return this.getTextFile(player, filename);\n }\n\n return null;\n }\n\n getFilepath(filename: string): string {\n const path = evaluateFilePath(filename, this.cwd());\n if (path == null) {\n throw new Error(`Invalid file path specified: ${filename}`);\n }\n\n if (isInRootDirectory(path)) {\n return removeLeadingSlash(path);\n }\n\n return path;\n }\n\n getScript(player: IPlayer, filename: string): Script | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const script of s.scripts) {\n if (filepath === script.filename) {\n return script;\n }\n }\n\n return null;\n }\n\n getTextFile(player: IPlayer, filename: string): TextFile | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const txt of s.textFiles) {\n if (filepath === txt.fn) {\n return txt;\n }\n }\n\n return null;\n }\n\n getLitFile(player: IPlayer, filename: string): string | null {\n const s = player.getCurrentServer();\n const filepath = this.getFilepath(filename);\n for (const lit of s.messages) {\n if (typeof lit === \"string\" && filepath === lit) {\n return lit;\n }\n }\n\n return null;\n }\n\n cwd(): string {\n return this.currDir;\n }\n\n setcwd(dir: string): void {\n this.currDir = dir;\n TerminalEvents.emit();\n }\n\n async runContract(player: IPlayer, contractName: string): Promise {\n // There's already an opened contract\n if (this.contractOpen) {\n return this.error(\"There's already a Coding Contract in Progress\");\n }\n\n const serv = player.getCurrentServer();\n const contract = serv.getContract(contractName);\n if (contract == null) {\n return this.error(\"No such contract\");\n }\n\n this.contractOpen = true;\n const res = await contract.prompt();\n\n //Check if the contract still exists by the time the promise is fullfilled\n if (serv.getContract(contractName) == null) {\n this.contractOpen = false;\n return this.error(\"Contract no longer exists (Was it solved by a script?)\");\n }\n\n switch (res) {\n case CodingContractResult.Success:\n if (contract.reward !== null) {\n const reward = player.gainCodingContractReward(contract.reward, contract.getDifficulty());\n this.print(`Contract SUCCESS - ${reward}`);\n }\n serv.removeContract(contract);\n break;\n case CodingContractResult.Failure:\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n this.error(\"Contract FAILED - Contract is now self-destructing\");\n serv.removeContract(contract);\n } else {\n this.error(`Contract FAILED - ${contract.getMaxNumTries() - contract.tries} tries remaining`);\n }\n break;\n case CodingContractResult.Cancelled:\n default:\n this.print(\"Contract cancelled\");\n break;\n }\n this.contractOpen = false;\n }\n\n executeScanAnalyzeCommand(player: IPlayer, depth = 1, all = false): void {\n // TODO Using array as stack for now, can make more efficient\n this.print(\"~~~~~~~~~~ Beginning scan-analyze ~~~~~~~~~~\");\n this.print(\" \");\n\n // Map of all servers to keep track of which have been visited\n const visited: {\n [key: string]: number | undefined;\n } = {};\n for (const server of GetAllServers()) {\n visited[server.hostname] = 0;\n }\n\n const stack: BaseServer[] = [];\n const depthQueue: number[] = [0];\n const currServ = player.getCurrentServer();\n stack.push(currServ);\n while (stack.length != 0) {\n const s = stack.pop();\n if (!s) continue;\n const d = depthQueue.pop();\n if (d === undefined) continue;\n const isHacknet = s instanceof HacknetServer;\n if (!all && s.purchasedByPlayer && s.hostname != \"home\") {\n continue; // Purchased server\n } else if (visited[s.hostname] || d > depth) {\n continue; // Already visited or out-of-depth\n } else if (!all && isHacknet) {\n continue; // Hacknet Server\n } else {\n visited[s.hostname] = 1;\n }\n for (let i = s.serversOnNetwork.length - 1; i >= 0; --i) {\n const newS = getServerOnNetwork(s, i);\n if (newS === null) continue;\n stack.push(newS);\n depthQueue.push(d + 1);\n }\n if (d == 0) {\n continue;\n } // Don't print current server\n const titleDashes = Array((d - 1) * 4 + 1).join(\"-\");\n if (player.hasProgram(Programs.AutoLink.name)) {\n this.append(new Link(titleDashes, s.hostname));\n } else {\n this.print(titleDashes + s.hostname);\n }\n\n const dashes = titleDashes + \"--\";\n let c = \"NO\";\n if (s.hasAdminRights) {\n c = \"YES\";\n }\n if (s instanceof Server) {\n this.print(\n `${dashes}Root Access: ${c}${!isHacknet ? \", Required hacking skill: \" + s.requiredHackingSkill : \"\"}`,\n );\n\n if (s.hasOwnProperty(\"numOpenPortsRequired\")) {\n this.print(dashes + \"Number of open ports required to NUKE: \" + s.numOpenPortsRequired);\n }\n }\n this.print(dashes + \"RAM: \" + numeralWrapper.formatRAM(s.maxRam));\n this.print(\" \");\n }\n }\n\n connectToServer(player: IPlayer, server: string): void {\n const serv = GetServer(server);\n if (serv == null) {\n this.error(\"Invalid server. Connection failed.\");\n return;\n }\n player.getCurrentServer().isConnectedTo = false;\n player.currentServer = serv.hostname;\n player.getCurrentServer().isConnectedTo = true;\n this.print(\"Connected to \" + serv.hostname);\n this.setcwd(\"/\");\n if (player.getCurrentServer().hostname == \"darkweb\") {\n checkIfConnectedToDarkweb(); // Posts a 'help' message if connecting to dark web\n }\n }\n\n executeCommands(router: IRouter, player: IPlayer, commands: string): void {\n // Sanitize input\n commands = commands.trim();\n commands = commands.replace(/\\s\\s+/g, \" \"); // Replace all extra whitespace in command with a single space\n\n // Handle Terminal History - multiple commands should be saved as one\n if (this.commandHistory[this.commandHistory.length - 1] != commands) {\n this.commandHistory.push(commands);\n if (this.commandHistory.length > 50) {\n this.commandHistory.splice(0, 1);\n }\n player.terminalCommandHistory = this.commandHistory;\n }\n this.commandHistoryIndex = this.commandHistory.length;\n const allCommands = ParseCommands(commands);\n\n for (let i = 0; i < allCommands.length; i++) {\n this.executeCommand(router, player, allCommands[i]);\n }\n }\n\n clear(): void {\n this.outputHistory = [new Output(`Bitburner v${CONSTANTS.VersionString} (${hash()})`, \"primary\")];\n TerminalEvents.emit();\n TerminalClearEvents.emit();\n }\n\n prestige(): void {\n this.action = null;\n this.clear();\n }\n\n executeCommand(router: IRouter, player: IPlayer, command: string): void {\n if (this.action !== null) {\n this.error(`Cannot execute command (${command}) while an action is in progress`);\n return;\n }\n // Allow usage of ./\n if (command.startsWith(\"./\")) {\n command = \"run \" + command.slice(2);\n }\n // Only split the first space\n const commandArray = ParseCommand(command);\n if (commandArray.length == 0) {\n return;\n }\n const s = player.getCurrentServer();\n /****************** Interactive Tutorial Terminal Commands ******************/\n if (ITutorial.isRunning) {\n const n00dlesServ = GetServer(\"n00dles\");\n if (n00dlesServ == null) {\n throw new Error(\"Could not get n00dles server\");\n }\n switch (ITutorial.currStep) {\n case iTutorialSteps.TerminalHelp:\n if (commandArray.length === 1 && commandArray[0] == \"help\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalLs:\n if (commandArray.length === 1 && commandArray[0] == \"ls\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScan:\n if (commandArray.length === 1 && commandArray[0] == \"scan\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze1:\n if (commandArray.length == 1 && commandArray[0] == \"scan-analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalScanAnalyze2:\n if (commandArray.length == 2 && commandArray[0] == \"scan-analyze\" && commandArray[1] === 2) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalConnect:\n if (commandArray.length == 2) {\n if (\n commandArray[0] == \"connect\" &&\n (commandArray[1] == \"n00dles\" || commandArray[1] == n00dlesServ.hostname)\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Wrong command! Try again!\");\n return;\n }\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalAnalyze:\n if (commandArray.length === 1 && commandArray[0] === \"analyze\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalNuke:\n if (commandArray.length == 2 && commandArray[0] == \"run\" && commandArray[1] == \"NUKE.exe\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalManualHack:\n if (commandArray.length == 1 && commandArray[0] == \"hack\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalHackingMechanics:\n if (commandArray.length !== 1 || ![\"grow\", \"weaken\", \"hack\"].includes(commandArray[0] + \"\")) {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalGoHome:\n if (commandArray.length == 1 && commandArray[0] == \"home\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalCreateScript:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"nano\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalFree:\n if (commandArray.length == 1 && commandArray[0] == \"free\") {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.TerminalRunScript:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"run\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n case iTutorialSteps.ActiveScriptsToTerminal:\n if (\n commandArray.length == 2 &&\n commandArray[0] == \"tail\" &&\n (commandArray[1] == \"n00dles.script\" || commandArray[1] == \"n00dles.js\")\n ) {\n iTutorialNextStep();\n } else {\n this.error(\"Bad command. Please follow the tutorial\");\n return;\n }\n break;\n default:\n this.error(\"Please follow the tutorial, or click 'EXIT' if you'd like to skip it\");\n return;\n }\n }\n /****************** END INTERACTIVE TUTORIAL ******************/\n /* Command parser */\n const commandName = commandArray[0];\n if (typeof commandName === \"number\" || typeof commandName === \"boolean\") {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n const commands: {\n [key: string]: (\n terminal: ITerminal,\n router: IRouter,\n player: IPlayer,\n server: BaseServer,\n args: (string | number | boolean)[],\n ) => void;\n } = {\n \"scan-analyze\": scananalyze,\n alias: alias,\n analyze: analyze,\n backdoor: backdoor,\n buy: buy,\n cat: cat,\n cd: cd,\n check: check,\n clear: () => this.clear(),\n cls: () => this.clear(),\n connect: connect,\n cp: cp,\n download: download,\n expr: expr,\n free: free,\n grow: grow,\n hack: hack,\n help: help,\n history: history,\n home: home,\n hostname: hostname,\n kill: kill,\n killall: killall,\n ls: ls,\n lscpu: lscpu,\n mem: mem,\n mv: mv,\n nano: nano,\n ps: ps,\n rm: rm,\n run: run,\n scan: scan,\n scp: scp,\n sudov: sudov,\n tail: tail,\n apr1: apr1,\n top: top,\n unalias: unalias,\n vim: vim,\n weaken: weaken,\n wget: wget,\n };\n\n const f = commands[commandName.toLowerCase()];\n if (!f) {\n this.error(`Command ${commandArray[0]} not found`);\n return;\n }\n\n f(this, router, player, s, commandArray.slice(1));\n }\n\n getProgressText(): string {\n if (this.action === null) throw new Error(\"trying to get the progress text when there's no action\");\n return createProgressBarText({\n progress: (this.action.time - this.action.timeLeft) / this.action.time,\n totalTicks: 50,\n });\n }\n}\n","import { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { MinHeap } from \"../utils/Heap\";\n\nimport { comprGenChar, comprLZGenerate, comprLZEncode, comprLZDecode } from \"../utils/CompressionContracts\";\nimport { HammingEncode, HammingDecode, HammingEncodeProperly } from \"../utils/HammingCodeTools\";\n/* tslint:disable:completed-docs no-magic-numbers arrow-return-shorthand */\n\n/* Function that generates a valid 'data' for a contract type */\nexport type GeneratorFunc = () => unknown;\n\n/* Function that checks if the provided solution is the correct one */\nexport type SolverFunc = (data: unknown, answer: string) => boolean;\n\n/* Function that returns a string with the problem's description.\n Requires the 'data' of a Contract as input */\nexport type DescriptionFunc = (data: unknown) => string;\n\ninterface ICodingContractTypeMetadata {\n desc: DescriptionFunc;\n difficulty: number;\n gen: GeneratorFunc;\n name: string;\n numTries: number;\n solver: SolverFunc;\n}\n\n/* Helper functions for Coding Contract implementations */\nfunction removeBracketsFromArrayString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith(\"[\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith(\"]\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction removeQuotesFromString(str: string): string {\n let strCpy: string = str;\n if (strCpy.startsWith('\"') || strCpy.startsWith(\"'\")) {\n strCpy = strCpy.slice(1);\n }\n if (strCpy.endsWith('\"') || strCpy.endsWith(\"'\")) {\n strCpy = strCpy.slice(0, -1);\n }\n\n return strCpy;\n}\n\nfunction convert2DArrayToString(arr: unknown[][]): string {\n const components: string[] = [];\n arr.forEach((e: unknown) => {\n let s = String(e);\n s = [\"[\", s, \"]\"].join(\"\");\n components.push(s);\n });\n\n return components.join(\",\").replace(/\\s/g, \"\");\n}\n\nexport const codingContractTypesMetadata: ICodingContractTypeMetadata[] = [\n {\n desc: (n: unknown): string => {\n return [\"A prime factor is a factor that is a prime number.\", `What is the largest prime factor of ${n}?`].join(\n \" \",\n );\n },\n difficulty: 1,\n gen: (): number => {\n return getRandomInt(500, 1e9);\n },\n name: \"Find Largest Prime Factor\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n let fac = 2;\n let n: number = data;\n while (n > (fac - 1) * (fac - 1)) {\n while (n % fac === 0) {\n n = Math.round(n / fac);\n }\n ++fac;\n }\n\n return (n === 1 ? fac - 1 : n) === parseInt(ans, 10);\n },\n },\n {\n desc: (_n: unknown): string => {\n const n = _n as number[];\n return [\n \"Given the following integer array, find the contiguous subarray\",\n \"(containing at least one number) which has the largest sum and return that sum.\",\n \"'Sum' refers to the sum of all the numbers in the subarray.\\n\",\n `${n.toString()}`,\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(5, 40);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(-10, 10);\n }\n\n return arr;\n },\n name: \"Subarray with Maximum Sum\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const nums: number[] = data.slice();\n for (let i = 1; i < nums.length; i++) {\n nums[i] = Math.max(nums[i], nums[i] + nums[i - 1]);\n }\n\n return parseInt(ans, 10) === Math.max(...nums);\n },\n },\n {\n desc: (n: unknown): string => {\n if (typeof n !== \"number\") throw new Error(\"solver expected number\");\n return [\n \"It is possible write four as a sum in exactly four different ways:\\n\\n\",\n \"    3 + 1\\n\",\n \"    2 + 2\\n\",\n \"    2 + 1 + 1\\n\",\n \"    1 + 1 + 1 + 1\\n\\n\",\n `How many different distinct ways can the number ${n} be written as a sum of at least`,\n \"two positive integers?\",\n ].join(\" \");\n },\n difficulty: 1.5,\n gen: (): number => {\n return getRandomInt(8, 100);\n },\n name: \"Total Ways to Sum\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n const ways: number[] = [1];\n ways.length = data + 1;\n ways.fill(0, 1);\n for (let i = 1; i < data; ++i) {\n for (let j: number = i; j <= data; ++j) {\n ways[j] += ways[j - i];\n }\n }\n\n return ways[data] === parseInt(ans, 10);\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [number, number[]];\n const n: number = data[0];\n const s: number[] = data[1];\n return [\n `How many different distinct ways can the number ${n} be written`,\n \"as a sum of integers contained in the set:\\n\\n\",\n `[${s}]?\\n\\n`,\n \"You may use each integer in the set zero or more times.\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): [number, number[]] => {\n const n: number = getRandomInt(12, 200);\n const maxLen: number = getRandomInt(8, 12);\n const s: number[] = [];\n // Bias towards small numbers is intentional to have much bigger answers in general\n // to force people better optimize their solutions\n for (let i = 1; i <= n; i++) {\n if (s.length == maxLen) {\n break;\n }\n if (Math.random() < 0.6 || n - i < maxLen - s.length) {\n s.push(i);\n }\n }\n return [n, s];\n },\n name: \"Total Ways to Sum II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, number[]];\n // https://www.geeksforgeeks.org/coin-change-dp-7/?ref=lbp\n const n = data[0];\n const s = data[1];\n const ways: number[] = [1];\n ways.length = n + 1;\n ways.fill(0, 1);\n for (let i = 0; i < s.length; i++) {\n for (let j = s[i]; j <= n; j++) {\n ways[j] += ways[j - s[i]];\n }\n }\n return ways[n] === parseInt(ans, 10);\n },\n },\n {\n desc: (_n: unknown): string => {\n const n = _n as number[][];\n let d: string = [\n \"Given the following array of arrays of numbers representing a 2D matrix,\",\n \"return the elements of the matrix as an array in spiral order:\\n\\n\",\n ].join(\" \");\n // for (const line of n) {\n // d += `${line.toString()},\\n`;\n // }\n d += \"    [\\n\";\n d += n\n .map(\n (line: number[]) =>\n \"        [\" +\n line.map((x: number) => `${x}`.padStart(2, \" \")).join(\",\") +\n \"]\",\n )\n .join(\"\\n\");\n d += \"\\n    ]\\n\";\n d += [\n \"\\nHere is an example of what spiral order should be:\\n\\n\",\n \"    [\\n\",\n \"        [1, 2, 3]\\n\",\n \"        [4, 5, 6]\\n\",\n \"        [7, 8, 9]\\n\",\n \"    ]\\n\\n\",\n \"Answer: [1, 2, 3, 6, 9, 8 ,7, 4, 5]\\n\\n\",\n \"Note that the matrix will not always be square:\\n\\n\",\n \"    [\\n\",\n \"        [1,  2,  3,  4]\\n\",\n \"        [5,  6,  7,  8]\\n\",\n \"        [9, 10, 11, 12]\\n\",\n \"    ]\\n\\n\",\n \"Answer: [1, 2, 3, 4, 8, 12, 11, 10, 9, 5, 6, 7]\",\n ].join(\" \");\n\n return d;\n },\n difficulty: 2,\n gen: (): number[][] => {\n const m: number = getRandomInt(1, 15);\n const n: number = getRandomInt(1, 15);\n const matrix: number[][] = [];\n matrix.length = m;\n for (let i = 0; i < m; ++i) {\n matrix[i] = [];\n matrix[i].length = n;\n }\n\n for (let i = 0; i < m; ++i) {\n for (let j = 0; j < n; ++j) {\n matrix[i][j] = getRandomInt(1, 50);\n }\n }\n\n return matrix;\n },\n name: \"Spiralize Matrix\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const spiral: number[] = [];\n const m: number = data.length;\n const n: number = data[0].length;\n let u = 0;\n let d: number = m - 1;\n let l = 0;\n let r: number = n - 1;\n let k = 0;\n while (true) {\n // Up\n for (let col: number = l; col <= r; col++) {\n spiral[k] = data[u][col];\n ++k;\n }\n if (++u > d) {\n break;\n }\n\n // Right\n for (let row: number = u; row <= d; row++) {\n spiral[k] = data[row][r];\n ++k;\n }\n if (--r < l) {\n break;\n }\n\n // Down\n for (let col: number = r; col >= l; col--) {\n spiral[k] = data[d][col];\n ++k;\n }\n if (--d < u) {\n break;\n }\n\n // Left\n for (let row: number = d; row >= u; row--) {\n spiral[k] = data[row][l];\n ++k;\n }\n if (++l > r) {\n break;\n }\n }\n\n const sanitizedPlayerAns = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const playerAns = sanitizedPlayerAns.split(\",\").map((s) => parseInt(s));\n if (spiral.length !== playerAns.length) {\n return false;\n }\n for (let i = 0; i < spiral.length; ++i) {\n if (spiral[i] !== playerAns[i]) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[];\n return [\n \"You are given the following array of integers:\\n\\n\",\n `${arr}\\n\\n`,\n \"Each element in the array represents your MAXIMUM jump length\",\n \"at that position. This means that if you are at position i and your\",\n \"maximum jump length is n, you can jump to any position from\",\n \"i to i+n.\",\n \"\\n\\nAssuming you are initially positioned\",\n \"at the start of the array, determine whether you are\",\n \"able to reach the last index.\\n\\n\",\n \"Your answer should be submitted as 1 or 0, representing true and false respectively\",\n ].join(\" \");\n },\n difficulty: 2.5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; ++i) {\n if (Math.random() < 0.2) {\n arr[i] = 0; // 20% chance of being 0\n } else {\n arr[i] = getRandomInt(0, 10);\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game\",\n numTries: 1,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data.length;\n let i = 0;\n for (let reach = 0; i < n && i <= reach; ++i) {\n reach = Math.max(i + data[i], reach);\n }\n const solution: boolean = i === n;\n return (ans === \"1\" && solution) || (ans === \"0\" && !solution);\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[];\n return [\n \"You are given the following array of integers:\\n\\n\",\n `${arr}\\n\\n`,\n \"Each element in the array represents your MAXIMUM jump length\",\n \"at that position. This means that if you are at position i and your\",\n \"maximum jump length is n, you can jump to any position from\",\n \"i to i+n.\",\n \"\\n\\nAssuming you are initially positioned\",\n \"at the start of the array, determine the minimum number of\",\n \"jumps to reach the end of the array.\\n\\n\",\n \"If it's impossible to reach the end, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 25);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < 10; j++) {\n if (Math.random() <= j / 10 + 0.1) {\n arr[i] = j;\n break;\n }\n }\n }\n\n return arr;\n },\n name: \"Array Jumping Game II\",\n numTries: 3,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data.length;\n let reach = 0;\n let jumps = 0;\n let lastJump = -1;\n while (reach < n - 1) {\n let jumpedFrom = -1;\n for (let i = reach; i > lastJump; i--) {\n if (i + data[i] > reach) {\n reach = i + data[i];\n jumpedFrom = i;\n }\n }\n if (jumpedFrom === -1) {\n jumps = 0;\n break;\n }\n lastJump = jumpedFrom;\n jumps++;\n }\n return jumps === parseInt(ans, 10);\n },\n },\n {\n desc: (_arr: unknown): string => {\n const arr = _arr as number[][];\n return [\n \"Given the following array of arrays of numbers representing a list of\",\n \"intervals, merge all overlapping intervals.\\n\\n\",\n `[${convert2DArrayToString(arr)}]\\n\\n`,\n \"Example:\\n\\n\",\n \"[[1, 3], [8, 10], [2, 6], [10, 16]]\\n\\n\",\n \"would merge into [[1, 6], [8, 16]].\\n\\n\",\n \"The intervals must be returned in ASCENDING order.\",\n \"You can assume that in an interval, the first number will always be\",\n \"smaller than the second.\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[][] => {\n const intervals: number[][] = [];\n const numIntervals: number = getRandomInt(3, 20);\n for (let i = 0; i < numIntervals; ++i) {\n const start: number = getRandomInt(1, 25);\n const end: number = start + getRandomInt(1, 10);\n intervals.push([start, end]);\n }\n\n return intervals;\n },\n name: \"Merge Overlapping Intervals\",\n numTries: 15,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const intervals: number[][] = data.slice();\n intervals.sort((a: number[], b: number[]) => {\n return a[0] - b[0];\n });\n\n const result: number[][] = [];\n let start: number = intervals[0][0];\n let end: number = intervals[0][1];\n for (const interval of intervals) {\n if (interval[0] <= end) {\n end = Math.max(end, interval[1]);\n } else {\n result.push([start, end]);\n start = interval[0];\n end = interval[1];\n }\n }\n result.push([start, end]);\n\n const sanitizedResult: string = convert2DArrayToString(result);\n const sanitizedAns: string = ans.replace(/\\s/g, \"\");\n\n return sanitizedResult === sanitizedAns || sanitizedResult === removeBracketsFromArrayString(sanitizedAns);\n },\n },\n {\n desc: (data: unknown): string => {\n return [\n \"Given the following string containing only digits, return\",\n \"an array with all possible valid IP address combinations\",\n \"that can be created from the string:\\n\\n\",\n `${data}\\n\\n`,\n \"Note that an octet cannot begin with a '0' unless the number\",\n \"itself is actually 0. For example, '192.168.010.1' is not a valid IP.\\n\\n\",\n \"Examples:\\n\\n\",\n \"25525511135 -> [255.255.11.135, 255.255.111.35]\\n\",\n \"1938718066 -> [193.87.180.66]\",\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): string => {\n let str = \"\";\n for (let i = 0; i < 4; ++i) {\n const num: number = getRandomInt(0, 255);\n const convNum: string = num.toString();\n str += convNum;\n }\n\n return str;\n },\n name: \"Generate IP Addresses\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n const ret: string[] = [];\n for (let a = 1; a <= 3; ++a) {\n for (let b = 1; b <= 3; ++b) {\n for (let c = 1; c <= 3; ++c) {\n for (let d = 1; d <= 3; ++d) {\n if (a + b + c + d === data.length) {\n const A = parseInt(data.substring(0, a), 10);\n const B = parseInt(data.substring(a, a + b), 10);\n const C = parseInt(data.substring(a + b, a + b + c), 10);\n const D = parseInt(data.substring(a + b + c, a + b + c + d), 10);\n if (A <= 255 && B <= 255 && C <= 255 && D <= 255) {\n const ip: string = [A.toString(), \".\", B.toString(), \".\", C.toString(), \".\", D.toString()].join(\"\");\n if (ip.length === data.length + 3) {\n ret.push(ip);\n }\n }\n }\n }\n }\n }\n }\n\n const sanitizedAns: string = removeBracketsFromArrayString(ans).replace(/\\s/g, \"\");\n const ansArr: string[] = sanitizedAns.split(\",\");\n if (ansArr.length !== ret.length) {\n return false;\n }\n for (const ipInAns of ansArr) {\n if (!ret.includes(ipInAns)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"one transaction (i.e. you can only buy and sell the stock once). If no profit can be made\",\n \"then the answer should be 0. Note\",\n \"that you have to buy the stock before you can sell it\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader I\",\n numTries: 5,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let maxCur = 0;\n let maxSoFar = 0;\n for (let i = 1; i < data.length; ++i) {\n maxCur = Math.max(0, (maxCur += data[i] - data[i - 1]));\n maxSoFar = Math.max(maxCur, maxSoFar);\n }\n\n return maxSoFar.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using as many\",\n \"transactions as you'd like. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let profit = 0;\n for (let p = 1; p < data.length; ++p) {\n profit += Math.max(data[p] - data[p - 1], 0);\n }\n\n return profit.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n return [\n \"You are given the following array of stock prices (which are numbers)\",\n \"where the i-th element represents the stock price on day i:\\n\\n\",\n `${data}\\n\\n`,\n \"Determine the maximum possible profit you can earn using at most\",\n \"two transactions. A transaction is defined as buying\",\n \"and then selling one share of the stock. Note that you cannot\",\n \"engage in multiple transactions at once. In other words, you\",\n \"must sell the stock before you buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[] => {\n const len: number = getRandomInt(3, 50);\n const arr: number[] = [];\n arr.length = len;\n for (let i = 0; i < len; ++i) {\n arr[i] = getRandomInt(1, 200);\n }\n\n return arr;\n },\n name: \"Algorithmic Stock Trader III\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n let hold1 = Number.MIN_SAFE_INTEGER;\n let hold2 = Number.MIN_SAFE_INTEGER;\n let release1 = 0;\n let release2 = 0;\n for (const price of data) {\n release2 = Math.max(release2, hold2 + price);\n hold2 = Math.max(hold2, release1 - price);\n release1 = Math.max(release1, hold1 + price);\n hold1 = Math.max(hold1, price * -1);\n }\n\n return release2.toString() === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [number, number[]];\n const k = data[0];\n const prices = data[1];\n return [\n \"You are given the following array with two elements:\\n\\n\",\n `[${k}, [${prices}]]\\n\\n`,\n \"The first element is an integer k. The second element is an\",\n \"array of stock prices (which are numbers) where the i-th element\",\n \"represents the stock price on day i.\\n\\n\",\n \"Determine the maximum possible profit you can earn using at most\",\n \"k transactions. A transaction is defined as buying and then selling\",\n \"one share of the stock. Note that you cannot engage in multiple\",\n \"transactions at once. In other words, you must sell the stock before\",\n \"you can buy it again.\\n\\n\",\n \"If no profit can be made, then the answer should be 0.\",\n ].join(\" \");\n },\n difficulty: 8,\n gen: (): [number, number[]] => {\n const k = getRandomInt(2, 10);\n const len = getRandomInt(3, 50);\n const prices: number[] = [];\n prices.length = len;\n for (let i = 0; i < len; ++i) {\n prices[i] = getRandomInt(1, 200);\n }\n\n return [k, prices];\n },\n name: \"Algorithmic Stock Trader IV\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, number[]];\n const k: number = data[0];\n const prices: number[] = data[1];\n\n const len = prices.length;\n if (len < 2) {\n return parseInt(ans) === 0;\n }\n if (k > len / 2) {\n let res = 0;\n for (let i = 1; i < len; ++i) {\n res += Math.max(prices[i] - prices[i - 1], 0);\n }\n\n return parseInt(ans) === res;\n }\n\n const hold: number[] = [];\n const rele: number[] = [];\n hold.length = k + 1;\n rele.length = k + 1;\n for (let i = 0; i <= k; ++i) {\n hold[i] = Number.MIN_SAFE_INTEGER;\n rele[i] = 0;\n }\n\n let cur: number;\n for (let i = 0; i < len; ++i) {\n cur = prices[i];\n for (let j = k; j > 0; --j) {\n rele[j] = Math.max(rele[j], hold[j] + cur);\n hold[j] = Math.max(hold[j], rele[j - 1] - cur);\n }\n }\n\n return parseInt(ans) === rele[k];\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n function createTriangleRecurse(data: number[][], level = 0): string {\n const numLevels: number = data.length;\n if (level >= numLevels) {\n return \"\";\n }\n const numSpaces = numLevels - level + 1;\n\n let str: string = [\" \".repeat(numSpaces), \"[\", data[level].toString(), \"]\"].join(\"\");\n if (level < numLevels - 1) {\n str += \",\";\n }\n\n return str + \"\\n\" + createTriangleRecurse(data, level + 1);\n }\n\n function createTriangle(data: number[][]): string {\n return [\"[\\n\", createTriangleRecurse(data), \"]\"].join(\"\");\n }\n\n const triangle = createTriangle(data);\n\n return [\n \"Given a triangle, find the minimum path sum from top to bottom. In each step\",\n \"of the path, you may only move to adjacent numbers in the row below.\",\n \"The triangle is represented as a 2D array of numbers:\\n\\n\",\n `${triangle}\\n\\n`,\n \"Example: If you are given the following triangle:\\n\\n[\\n\",\n \"     [2],\\n\",\n \"    [3,4],\\n\",\n \"   [6,5,7],\\n\",\n \"  [4,1,8,3]\\n\",\n \"]\\n\\n\",\n \"The minimum path sum is 11 (2 -> 3 -> 5 -> 1).\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const triangle: number[][] = [];\n const levels: number = getRandomInt(3, 12);\n triangle.length = levels;\n\n for (let row = 0; row < levels; ++row) {\n triangle[row] = [];\n triangle[row].length = row + 1;\n for (let i = 0; i < triangle[row].length; ++i) {\n triangle[row][i] = getRandomInt(1, 9);\n }\n }\n\n return triangle;\n },\n name: \"Minimum Path Sum in a Triangle\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const n: number = data.length;\n const dp: number[] = data[n - 1].slice();\n for (let i = n - 2; i > -1; --i) {\n for (let j = 0; j < data[i].length; ++j) {\n dp[j] = Math.min(dp[j], dp[j + 1]) + data[i][j];\n }\n }\n\n return dp[0] === parseInt(ans);\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[];\n const numRows = data[0];\n const numColumns = data[1];\n return [\n \"You are in a grid with\",\n `${numRows} rows and ${numColumns} columns, and you are`,\n \"positioned in the top-left corner of that grid. You are trying to\",\n \"reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Determine how many\",\n \"unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an array\",\n \"with the number of rows and columns:\\n\\n\",\n `[${numRows}, ${numColumns}]`,\n ].join(\" \");\n },\n difficulty: 3,\n gen: (): number[] => {\n const numRows: number = getRandomInt(2, 14);\n const numColumns: number = getRandomInt(2, 14);\n\n return [numRows, numColumns];\n },\n name: \"Unique Paths in a Grid I\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[];\n const n: number = data[0]; // Number of rows\n const m: number = data[1]; // Number of columns\n const currentRow: number[] = [];\n currentRow.length = n;\n\n for (let i = 0; i < n; i++) {\n currentRow[i] = 1;\n }\n for (let row = 1; row < m; row++) {\n for (let i = 1; i < n; i++) {\n currentRow[i] += currentRow[i - 1];\n }\n }\n\n return parseInt(ans) === currentRow[n - 1];\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n let gridString = \"\";\n for (const line of data) {\n gridString += `${line.toString()},\\n`;\n }\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n `${gridString}\\n`,\n \"You are trying reach the bottom-right corner of the grid, but you can only\",\n \"move down or right on each step. Furthermore, there are obstacles on the grid\",\n \"that you cannot move onto. These obstacles are denoted by '1', while empty\",\n \"spaces are denoted by 0.\\n\\n\",\n \"Determine how many unique paths there are from start to finish.\\n\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\",\n ].join(\" \");\n },\n difficulty: 5,\n gen: (): number[][] => {\n const numRows: number = getRandomInt(2, 12);\n const numColumns: number = getRandomInt(2, 12);\n\n const grid: number[][] = [];\n grid.length = numRows;\n for (let i = 0; i < numRows; ++i) {\n grid[i] = [];\n grid[i].length = numColumns;\n grid[i].fill(0);\n }\n\n for (let r = 0; r < numRows; ++r) {\n for (let c = 0; c < numColumns; ++c) {\n if (r === 0 && c === 0) {\n continue;\n }\n if (r === numRows - 1 && c === numColumns - 1) {\n continue;\n }\n\n // 15% chance of an element being an obstacle\n if (Math.random() < 0.15) {\n grid[r][c] = 1;\n }\n }\n }\n\n return grid;\n },\n name: \"Unique Paths in a Grid II\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const obstacleGrid: number[][] = [];\n obstacleGrid.length = data.length;\n for (let i = 0; i < obstacleGrid.length; ++i) {\n obstacleGrid[i] = data[i].slice();\n }\n\n for (let i = 0; i < obstacleGrid.length; i++) {\n for (let j = 0; j < obstacleGrid[0].length; j++) {\n if (obstacleGrid[i][j] == 1) {\n obstacleGrid[i][j] = 0;\n } else if (i == 0 && j == 0) {\n obstacleGrid[0][0] = 1;\n } else {\n obstacleGrid[i][j] = (i > 0 ? obstacleGrid[i - 1][j] : 0) + (j > 0 ? obstacleGrid[i][j - 1] : 0);\n }\n }\n }\n\n return obstacleGrid[obstacleGrid.length - 1][obstacleGrid[0].length - 1] === parseInt(ans);\n },\n },\n {\n name: \"Shortest Path in a Grid\",\n desc: (_data: unknown): string => {\n const data = _data as number[][];\n return [\n \"You are located in the top-left corner of the following grid:\\n\\n\",\n `  [${data.map((line) => \"[\" + line + \"]\").join(\",\\n   \")}]\\n\\n`,\n \"You are trying to find the shortest path to the bottom-right corner of the grid,\",\n \"but there are obstacles on the grid that you cannot move onto.\",\n \"These obstacles are denoted by '1', while empty spaces are denoted by 0.\\n\\n\",\n \"Determine the shortest path from start to finish, if one exists.\",\n \"The answer should be given as a string of UDLR characters, indicating the moves along the path\\n\\n\",\n \"NOTE: If there are multiple equally short paths, any of them is accepted as answer.\",\n \"If there is no path, the answer should be an empty string.\\n\",\n \"NOTE: The data returned for this contract is an 2D array of numbers representing the grid.\\n\\n\",\n \"Examples:\\n\\n\",\n \"    [[0,1,0,0,0],\\n\",\n \"     [0,0,0,1,0]]\\n\",\n \"\\n\",\n \"Answer: 'DRRURRD'\\n\\n\",\n \"    [[0,1],\\n\",\n \"     [1,0]]\\n\",\n \"\\n\",\n \"Answer: ''\\n\\n\",\n ].join(\" \");\n },\n difficulty: 7,\n numTries: 10,\n gen: (): number[][] => {\n const height = getRandomInt(6, 12);\n const width = getRandomInt(6, 12);\n const dstY = height - 1;\n const dstX = width - 1;\n const minPathLength = dstY + dstX; // Math.abs(dstY - srcY) + Math.abs(dstX - srcX)\n\n const grid: number[][] = new Array(height);\n for (let y = 0; y < height; y++) grid[y] = new Array(width).fill(0);\n\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n if (y == 0 && x == 0) continue; // Don't block start\n if (y == dstY && x == dstX) continue; // Don't block destination\n\n // Generate more obstacles the farther a position is from start and destination.\n // Raw distance factor peaks at 50% at half-way mark. Rescale to 40% max.\n // Obstacle chance range of [15%, 40%] produces ~78% solvable puzzles\n const distanceFactor = (Math.min(y + x, dstY - y + dstX - x) / minPathLength) * 0.8;\n if (Math.random() < Math.max(0.15, distanceFactor)) grid[y][x] = 1;\n }\n }\n\n return grid;\n },\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as number[][];\n const width = data[0].length;\n const height = data.length;\n const dstY = height - 1;\n const dstX = width - 1;\n\n const distance: [number][] = new Array(height);\n //const prev: [[number, number] | undefined][] = new Array(height);\n const queue = new MinHeap<[number, number]>();\n\n for (let y = 0; y < height; y++) {\n distance[y] = new Array(width).fill(Infinity) as [number];\n //prev[y] = new Array(width).fill(undefined) as [undefined];\n }\n\n function validPosition(y: number, x: number): boolean {\n return y >= 0 && y < height && x >= 0 && x < width && data[y][x] == 0;\n }\n\n // List in-bounds and passable neighbors\n function* neighbors(y: number, x: number): Generator<[number, number]> {\n if (validPosition(y - 1, x)) yield [y - 1, x]; // Up\n if (validPosition(y + 1, x)) yield [y + 1, x]; // Down\n if (validPosition(y, x - 1)) yield [y, x - 1]; // Left\n if (validPosition(y, x + 1)) yield [y, x + 1]; // Right\n }\n\n // Prepare starting point\n distance[0][0] = 0;\n queue.push([0, 0], 0);\n\n // Take next-nearest position and expand potential paths from there\n while (queue.size > 0) {\n const [y, x] = queue.pop() as [number, number];\n for (const [yN, xN] of neighbors(y, x)) {\n const d = distance[y][x] + 1;\n if (d < distance[yN][xN]) {\n if (distance[yN][xN] == Infinity)\n // Not reached previously\n queue.push([yN, xN], d);\n // Found a shorter path\n else queue.changeWeight(([yQ, xQ]) => yQ == yN && xQ == xN, d);\n //prev[yN][xN] = [y, x];\n distance[yN][xN] = d;\n }\n }\n }\n\n // No path at all?\n if (distance[dstY][dstX] == Infinity) return ans == \"\";\n\n // There is a solution, require that the answer path is as short as the shortest\n // path we found\n if (ans.length > distance[dstY][dstX]) return false;\n\n // Further verify that the answer path is a valid path\n let ansX = 0;\n let ansY = 0;\n for (const direction of ans) {\n switch (direction) {\n case \"U\":\n ansY -= 1;\n break;\n case \"D\":\n ansY += 1;\n break;\n case \"L\":\n ansX -= 1;\n break;\n case \"R\":\n ansX += 1;\n break;\n default:\n return false; // Invalid character\n }\n if (!validPosition(ansY, ansX)) return false;\n }\n\n // Path was valid, finally verify that the answer path brought us to the end coordinates\n return ansY == dstY && ansX == dstX;\n },\n },\n {\n desc: (data: unknown): string => {\n return [\n \"Given the following string:\\n\\n\",\n `${data}\\n\\n`,\n \"remove the minimum number of invalid parentheses in order to validate\",\n \"the string. If there are multiple minimal ways to validate the string,\",\n \"provide all of the possible results. The answer should be provided\",\n \"as an array of strings. If it is impossible to validate the string\",\n \"the result should be an array with only an empty string.\\n\\n\",\n \"IMPORTANT: The string may contain letters, not just parentheses.\",\n `Examples:\\n`,\n `\"()())()\" -> [()()(), (())()]\\n`,\n `\"(a)())()\" -> [(a)()(), (a())()]\\n`,\n `\")(\" -> [\"\"]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): string => {\n const len: number = getRandomInt(6, 20);\n const chars: string[] = [];\n chars.length = len;\n\n // 80% chance of the first parenthesis being (\n Math.random() < 0.8 ? (chars[0] = \"(\") : (chars[0] = \")\");\n\n for (let i = 1; i < len; ++i) {\n const roll = Math.random();\n if (roll < 0.4) {\n chars[i] = \"(\";\n } else if (roll < 0.8) {\n chars[i] = \")\";\n } else {\n chars[i] = \"a\";\n }\n }\n\n return chars.join(\"\");\n },\n name: \"Sanitize Parentheses in Expression\",\n numTries: 10,\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n let left = 0;\n let right = 0;\n const res: string[] = [];\n\n for (let i = 0; i < data.length; ++i) {\n if (data[i] === \"(\") {\n ++left;\n } else if (data[i] === \")\") {\n left > 0 ? --left : ++right;\n }\n }\n\n function dfs(\n pair: number,\n index: number,\n left: number,\n right: number,\n s: string,\n solution: string,\n res: string[],\n ): void {\n if (s.length === index) {\n if (left === 0 && right === 0 && pair === 0) {\n for (let i = 0; i < res.length; i++) {\n if (res[i] === solution) {\n return;\n }\n }\n res.push(solution);\n }\n return;\n }\n\n if (s[index] === \"(\") {\n if (left > 0) {\n dfs(pair, index + 1, left - 1, right, s, solution, res);\n }\n dfs(pair + 1, index + 1, left, right, s, solution + s[index], res);\n } else if (s[index] === \")\") {\n if (right > 0) dfs(pair, index + 1, left, right - 1, s, solution, res);\n if (pair > 0) dfs(pair - 1, index + 1, left, right, s, solution + s[index], res);\n } else {\n dfs(pair, index + 1, left, right, s, solution + s[index], res);\n }\n }\n\n dfs(0, 0, left, right, data, \"\", res);\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (sanitizedPlayerAnsArr.length !== res.length) {\n return false;\n }\n for (const resultInAnswer of res) {\n if (!sanitizedPlayerAnsArr.includes(resultInAnswer)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n desc: (_data: unknown): string => {\n const data = _data as [string, number];\n const digits: string = data[0];\n const target: number = data[1];\n\n return [\n \"You are given the following string which contains only digits between 0 and 9:\\n\\n\",\n `${digits}\\n\\n`,\n `You are also given a target number of ${target}. Return all possible ways`,\n \"you can add the +(add), -(subtract), and *(multiply) operators to the string such\",\n \"that it evaluates to the target number. (Normal order of operations applies.)\\n\\n\",\n \"The provided answer should be an array of strings containing the valid expressions.\",\n \"The data provided by this problem is an array with two elements. The first element\",\n \"is the string of digits, while the second element is the target number:\\n\\n\",\n `[\"${digits}\", ${target}]\\n\\n`,\n \"NOTE: The order of evaluation expects script operator precedence\",\n \"NOTE: Numbers in the expression cannot have leading 0's. In other words,\",\n `\"1+01\" is not a valid expression`,\n \"Examples:\\n\\n\",\n `Input: digits = \"123\", target = 6\\n`,\n `Output: [1+2+3, 1*2*3]\\n\\n`,\n `Input: digits = \"105\", target = 5\\n`,\n `Output: [1*0+5, 10-5]`,\n ].join(\" \");\n },\n difficulty: 10,\n gen: (): [string, number] => {\n const numDigits = getRandomInt(4, 12);\n const digitsArray: string[] = [];\n digitsArray.length = numDigits;\n for (let i = 0; i < digitsArray.length; ++i) {\n if (i === 0) {\n digitsArray[i] = String(getRandomInt(1, 9));\n } else {\n digitsArray[i] = String(getRandomInt(0, 9));\n }\n }\n\n const target: number = getRandomInt(-100, 100);\n const digits: string = digitsArray.join(\"\");\n\n return [digits, target];\n },\n name: \"Find All Valid Math Expressions\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [string, number];\n const num = data[0];\n const target = data[1];\n\n function helper(\n res: string[],\n path: string,\n num: string,\n target: number,\n pos: number,\n evaluated: number,\n multed: number,\n ): void {\n if (pos === num.length) {\n if (target === evaluated) {\n res.push(path);\n }\n return;\n }\n\n for (let i = pos; i < num.length; ++i) {\n if (i != pos && num[pos] == \"0\") {\n break;\n }\n const cur = parseInt(num.substring(pos, i + 1));\n\n if (pos === 0) {\n helper(res, path + cur, num, target, i + 1, cur, cur);\n } else {\n helper(res, path + \"+\" + cur, num, target, i + 1, evaluated + cur, cur);\n helper(res, path + \"-\" + cur, num, target, i + 1, evaluated - cur, -cur);\n helper(res, path + \"*\" + cur, num, target, i + 1, evaluated - multed + multed * cur, multed * cur);\n }\n }\n }\n\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n for (let i = 0; i < sanitizedPlayerAnsArr.length; ++i) {\n sanitizedPlayerAnsArr[i] = removeQuotesFromString(sanitizedPlayerAnsArr[i]).replace(/\\s/g, \"\");\n }\n\n if (num == null || num.length === 0) {\n if (sanitizedPlayerAnsArr.length === 0) {\n return true;\n }\n if (sanitizedPlayerAnsArr.length === 1 && sanitizedPlayerAnsArr[0] === \"\") {\n return true;\n }\n return false;\n }\n\n const result: string[] = [];\n helper(result, \"\", num, target, 0, 0, 0);\n\n for (const expr of result) {\n if (!sanitizedPlayerAnsArr.includes(expr)) {\n return false;\n }\n }\n\n return true;\n },\n },\n {\n name: \"HammingCodes: Integer to Encoded Binary\",\n numTries: 10,\n difficulty: 5,\n desc: (n: unknown): string => {\n return [\n \"You are given the following decimal Value: \\n\",\n `${n} \\n`,\n \"Convert it to a binary representation and encode it as an 'extended Hamming code'. Eg:\\n \",\n \"Value 8 is expressed in binary as '1000', which will be encoded\",\n \"with the pattern 'pppdpddd', where p is a parity bit and d a data bit,\\n\",\n \"or '10101' (Value 21) will result into (pppdpdddpd) '1001101011'.\\n\",\n \"The answer should be given as a string containing only 1s and 0s.\\n\",\n \"NOTE: the endianness of the data bits is reversed in relation to the endianness of the parity bits.\\n\",\n \"NOTE: The bit at index zero is the overall parity bit, this should be set last.\\n\",\n \"NOTE 2: You should watch the Hamming Code video from 3Blue1Brown, which explains the 'rule' of encoding,\",\n \"including the first index parity bit mentioned in the previous note.\\n\\n\",\n \"Extra rule for encoding:\\n\",\n \"There should be no leading zeros in the 'data bit' section\",\n ].join(\" \");\n },\n gen: (): number => {\n return getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57)));\n },\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"number\") throw new Error(\"solver expected number\");\n return ans === HammingEncode(data);\n },\n },\n {\n name: \"HammingCodes: Encoded Binary to Integer\",\n difficulty: 8,\n numTries: 10,\n desc: (n: unknown): string => {\n return [\n \"You are given the following encoded binary string: \\n\",\n `'${n}' \\n\\n`,\n \"Treat it as an extended Hamming code with 1 'possible' error at a random index.\\n\",\n \"Find the 'possible' wrong bit, fix it and extract the decimal value, which is hidden inside the string.\\n\\n\",\n \"Note: The length of the binary string is dynamic, but it's encoding/decoding follows Hamming's 'rule'\\n\",\n \"Note 2: Index 0 is an 'overall' parity bit. Watch the Hamming code video from 3Blue1Brown for more information\\n\",\n \"Note 3: There's a ~55% chance for an altered Bit. So... MAYBE there is an altered Bit 😉\\n\",\n \"Note: The endianness of the encoded decimal value is reversed in relation to the endianness of the Hamming code. Where\",\n \"the Hamming code is expressed as little-endian (LSB at index 0), the decimal value encoded in it is expressed as big-endian\",\n \"(MSB at index 0).\\n\",\n \"Extra note for automation: return the decimal value as a string\",\n ].join(\" \");\n },\n gen: (): string => {\n const _alteredBit = Math.round(Math.random());\n const _buildArray: Array = HammingEncodeProperly(\n getRandomInt(Math.pow(2, 4), Math.pow(2, getRandomInt(1, 57))),\n ).split(\"\");\n if (_alteredBit) {\n const _randomIndex: number = getRandomInt(0, _buildArray.length - 1);\n _buildArray[_randomIndex] = _buildArray[_randomIndex] == \"0\" ? \"1\" : \"0\";\n }\n return _buildArray.join(\"\");\n },\n solver: (data: unknown, ans: string): boolean => {\n if (typeof data !== \"string\") throw new Error(\"solver expected string\");\n return parseInt(ans, 10) === HammingDecode(data);\n },\n },\n {\n name: \"Proper 2-Coloring of a Graph\",\n difficulty: 7,\n numTries: 5,\n desc: (_data: unknown): string => {\n const data = _data as [number, [number, number][]];\n return [\n `You are given the following data, representing a graph:\\n`,\n `${JSON.stringify(data)}\\n`,\n `Note that \"graph\", as used here, refers to the field of graph theory, and has`,\n `no relation to statistics or plotting.`,\n `The first element of the data represents the number of vertices in the graph.`,\n `Each vertex is a unique number between 0 and ${data[0] - 1}.`,\n `The next element of the data represents the edges of the graph.`,\n `Two vertices u,v in a graph are said to be adjacent if there exists an edge [u,v].`,\n `Note that an edge [u,v] is the same as an edge [v,u], as order does not matter.`,\n `You must construct a 2-coloring of the graph, meaning that you have to assign each`,\n `vertex in the graph a \"color\", either 0 or 1, such that no two adjacent vertices have`,\n `the same color. Submit your answer in the form of an array, where element i`,\n `represents the color of vertex i. If it is impossible to construct a 2-coloring of`,\n `the given graph, instead submit an empty array.\\n\\n`,\n `Examples:\\n\\n`,\n `Input: [4, [[0, 2], [0, 3], [1, 2], [1, 3]]]\\n`,\n `Output: [0, 0, 1, 1]\\n\\n`,\n `Input: [3, [[0, 1], [0, 2], [1, 2]]]\\n`,\n `Output: []`,\n ].join(\" \");\n },\n gen: (): [number, [number, number][]] => {\n //Generate two partite sets\n const n = Math.floor(Math.random() * 5) + 3;\n const m = Math.floor(Math.random() * 5) + 3;\n\n //50% chance of spawning any given valid edge in the bipartite graph\n const edges: [number, number][] = [];\n for (let i = 0; i < n; i++) {\n for (let j = 0; j < m; j++) {\n if (Math.random() > 0.5) {\n edges.push([i, n + j]);\n }\n }\n }\n\n //Add an edge at random with no regard to partite sets\n let a = Math.floor(Math.random() * (n + m));\n let b = Math.floor(Math.random() * (n + m));\n if (a > b) [a, b] = [b, a]; //Enforce lower numbers come first\n if (a != b && !edges.includes([a, b])) {\n edges.push([a, b]);\n }\n\n //Randomize array in-place using Durstenfeld shuffle algorithm.\n function shuffle(array: T[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [array[i], array[j]] = [array[j], array[i]];\n }\n }\n\n //Replace instances of the original vertex names in-place\n const vertexShuffler = Array.from(Array(n + m).keys());\n shuffle(vertexShuffler);\n for (let i = 0; i < edges.length; i++) {\n edges[i] = [vertexShuffler[edges[i][0]], vertexShuffler[edges[i][1]]];\n if (edges[i][0] > edges[i][1]) {\n //Enforce lower numbers come first\n [edges[i][0], edges[i][1]] = [edges[i][1], edges[i][0]];\n }\n }\n\n //Shuffle the order of the edges themselves, as well\n shuffle(edges);\n\n return [n + m, edges];\n },\n solver: (_data: unknown, ans: string): boolean => {\n const data = _data as [number, [number, number][]];\n\n //Sanitize player input\n const sanitizedPlayerAns: string = removeBracketsFromArrayString(ans);\n\n //Case where the player believes there is no solution.\n //Attempt to construct one to check if this is correct.\n if (sanitizedPlayerAns === \"\") {\n //Helper function to get neighbourhood of a vertex\n function neighbourhood(vertex: number): number[] {\n const adjLeft = data[1].filter(([a]) => a == vertex).map(([, b]) => b);\n const adjRight = data[1].filter(([, b]) => b == vertex).map(([a]) => a);\n return adjLeft.concat(adjRight);\n }\n\n //Verify that there is no solution by attempting to create a proper 2-coloring.\n const coloring: (number | undefined)[] = Array(data[0]).fill(undefined);\n while (coloring.some((val) => val === undefined)) {\n //Color a vertex in the graph\n const initialVertex: number = coloring.findIndex((val) => val === undefined);\n coloring[initialVertex] = 0;\n const frontier: number[] = [initialVertex];\n\n //Propogate the coloring throughout the component containing v greedily\n while (frontier.length > 0) {\n const v: number = frontier.pop() || 0;\n const neighbors: number[] = neighbourhood(v);\n\n //For each vertex u adjacent to v\n for (const id in neighbors) {\n const u: number = neighbors[id];\n\n //Set the color of u to the opposite of v's color if it is new,\n //then add u to the frontier to continue the algorithm.\n if (coloring[u] === undefined) {\n if (coloring[v] === 0) coloring[u] = 1;\n else coloring[u] = 0;\n\n frontier.push(u);\n }\n\n //Assert u,v do not have the same color\n else if (coloring[u] === coloring[v]) {\n //If u,v do have the same color, no proper 2-coloring exists, meaning\n //the player was correct to say there is no proper 2-coloring of the graph.\n return true;\n }\n }\n }\n }\n\n //If this code is reached, there exists a proper 2-coloring of the input\n //graph, and thus the player was incorrect in submitting no answer.\n return false;\n }\n\n //Solution provided case\n const sanitizedPlayerAnsArr: string[] = sanitizedPlayerAns.split(\",\");\n const coloring: number[] = sanitizedPlayerAnsArr.map((val) => parseInt(val));\n if (coloring.length == data[0]) {\n const edges = data[1];\n const validColors = [0, 1];\n //Check that the provided solution is a proper 2-coloring\n return edges.every(([a, b]) => {\n const aColor = coloring[a];\n const bColor = coloring[b];\n return (\n validColors.includes(aColor) && //Enforce the first endpoint is color 0 or 1\n validColors.includes(bColor) && //Enforce the second endpoint is color 0 or 1\n aColor != bColor //Enforce the endpoints are different colors\n );\n });\n }\n\n //Return false if the coloring is the wrong size\n else return false;\n },\n },\n {\n name: \"Compression I: RLE Compression\",\n difficulty: 2,\n numTries: 10,\n desc: (plaintext: unknown): string => {\n return [\n \"Run-length encoding (RLE) is a data compression technique which encodes data as a series of runs of\",\n \"a repeated single character. Runs are encoded as a length, followed by the character itself. Lengths\",\n \"are encoded as a single ASCII digit; runs of 10 characters or more are encoded by splitting them\",\n \"into multiple runs.\\n\\n\",\n \"You are given the following input string:\\n\",\n `    ${plaintext}\\n`,\n \"Encode it using run-length encoding with the minimum possible output length.\\n\\n\",\n \"Examples:\\n\",\n \"    aaaaabccc            ->  5a1b3c\\n\",\n \"    aAaAaA               ->  1a1A1a1A1a1A\\n\",\n \"    111112333            ->  511233\\n\",\n \"    zzzzzzzzzzzzzzzzzzz  ->  9z9z1z  (or 9z8z2z, etc.)\\n\",\n ].join(\" \");\n },\n gen: (): string => {\n const length = 50 + Math.floor(25 * (Math.random() + Math.random()));\n let plain = \"\";\n\n while (plain.length < length) {\n const r = Math.random();\n\n let n = 1;\n if (r < 0.3) {\n n = 1;\n } else if (r < 0.6) {\n n = 2;\n } else if (r < 0.9) {\n n = Math.floor(10 * Math.random());\n } else {\n n = 10 + Math.floor(5 * Math.random());\n }\n\n const c = comprGenChar();\n plain += c.repeat(n);\n }\n\n return plain.substring(0, length);\n },\n solver: (plain: unknown, ans: string): boolean => {\n if (typeof plain !== \"string\") throw new Error(\"solver expected string\");\n if (ans.length % 2 !== 0) {\n return false;\n }\n\n let ans_plain = \"\";\n for (let i = 0; i + 1 < ans.length; i += 2) {\n const length = ans.charCodeAt(i) - 0x30;\n if (length < 0 || length > 9) {\n return false;\n }\n\n ans_plain += ans[i + 1].repeat(length);\n }\n if (ans_plain !== plain) {\n return false;\n }\n\n let length = 0;\n for (let i = 0; i < plain.length; ) {\n let run_length = 1;\n while (i + run_length < plain.length && plain[i + run_length] === plain[i]) {\n ++run_length;\n }\n i += run_length;\n\n while (run_length > 0) {\n run_length -= 9;\n length += 2;\n }\n }\n\n return ans.length <= length;\n },\n },\n {\n name: \"Compression II: LZ Decompression\",\n difficulty: 4,\n numTries: 10,\n desc: (compressed: unknown): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following LZ-encoded string:\\n\",\n `    ${compressed}\\n`,\n \"Decode it and output the original string.\\n\\n\",\n \"Example: decoding '5aaabb450723abb' chunk-by-chunk\\n\",\n \"    5aaabb           ->  aaabb\\n\",\n \"    5aaabb45         ->  aaabbaaab\\n\",\n \"    5aaabb450        ->  aaabbaaab\\n\",\n \"    5aaabb45072      ->  aaabbaaababababa\\n\",\n \"    5aaabb450723abb  ->  aaabbaaababababaabb\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZEncode(comprLZGenerate());\n },\n solver: (compr: unknown, ans: string): boolean => {\n if (typeof compr !== \"string\") throw new Error(\"solver expected string\");\n return ans === comprLZDecode(compr);\n },\n },\n {\n name: \"Compression III: LZ Compression\",\n difficulty: 10,\n numTries: 10,\n desc: (plaintext: unknown): string => {\n return [\n \"Lempel-Ziv (LZ) compression is a data compression technique which encodes data using references to\",\n \"earlier parts of the data. In this variant of LZ, data is encoded in two types of chunk. Each chunk\",\n \"begins with a length L, encoded as a single ASCII digit from 1 to 9, followed by the chunk data,\",\n \"which is either:\\n\\n\",\n \"1. Exactly L characters, which are to be copied directly into the uncompressed data.\\n\",\n \"2. A reference to an earlier part of the uncompressed data. To do this, the length is followed\",\n \"by a second ASCII digit X: each of the L output characters is a copy of the character X\",\n \"places before it in the uncompressed data.\\n\\n\",\n \"For both chunk types, a length of 0 instead means the chunk ends immediately, and the next character\",\n \"is the start of a new chunk. The two chunk types alternate, starting with type 1, and the final\",\n \"chunk may be of either type.\\n\\n\",\n \"You are given the following input string:\\n\",\n `    ${plaintext}\\n`,\n \"Encode it using Lempel-Ziv encoding with the minimum possible output length.\\n\\n\",\n \"Examples (some have other possible encodings of minimal length):\\n\",\n \"    abracadabra     ->  7abracad47\\n\",\n \"    mississippi     ->  4miss433ppi\\n\",\n \"    aAAaAAaAaAA     ->  3aAA53035\\n\",\n \"    2718281828      ->  627182844\\n\",\n \"    abcdefghijk     ->  9abcdefghi02jk\\n\",\n \"    aaaaaaaaaaaa    ->  3aaa91\\n\",\n \"    aaaaaaaaaaaaa   ->  1a91031\\n\",\n \"    aaaaaaaaaaaaaa  ->  1a91041\",\n ].join(\" \");\n },\n gen: (): string => {\n return comprLZGenerate();\n },\n solver: (plain: unknown, ans: string): boolean => {\n if (typeof plain !== \"string\") throw new Error(\"solver expected string\");\n return comprLZDecode(ans) === plain && ans.length <= comprLZEncode(plain).length;\n },\n },\n {\n desc: (_data: unknown): string => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, number];\n return [\n \"Caesar cipher is one of the simplest encryption technique.\",\n \"It is a type of substitution cipher in which each letter in the plaintext \",\n \"is replaced by a letter some fixed number of positions down the alphabet.\",\n \"For example, with a left shift of 3, D would be replaced by A, \",\n \"E would become B, and A would become X (because of rotation).\\n\\n\",\n \"You are given an array with two elements:\\n\",\n `  [\"${data[0]}\", ${data[1]}]\\n`,\n \"The first element is the plaintext, the second element is the left shift value.\\n\\n\",\n \"Return the ciphertext as uppercase string. Spaces remains the same.\",\n ].join(\" \");\n },\n difficulty: 1,\n gen: (): [string, number] => {\n // return [plaintext, shift value]\n const words = [\n \"ARRAY\",\n \"CACHE\",\n \"CLOUD\",\n \"DEBUG\",\n \"EMAIL\",\n \"ENTER\",\n \"FLASH\",\n \"FRAME\",\n \"INBOX\",\n \"LINUX\",\n \"LOGIC\",\n \"LOGIN\",\n \"MACRO\",\n \"MEDIA\",\n \"MODEM\",\n \"MOUSE\",\n \"PASTE\",\n \"POPUP\",\n \"PRINT\",\n \"QUEUE\",\n \"SHELL\",\n \"SHIFT\",\n \"TABLE\",\n \"TRASH\",\n \"VIRUS\",\n ];\n return [\n words\n .sort(() => Math.random() - 0.5)\n .slice(0, 5)\n .join(\" \"),\n Math.floor(Math.random() * 25 + 1),\n ];\n },\n name: \"Encryption I: Caesar Cipher\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, number];\n // data = [plaintext, shift value]\n // build char array, shifting via map and join to final results\n const cipher = [...data[0]]\n .map((a) => (a === \" \" ? a : String.fromCharCode(((a.charCodeAt(0) - 65 - data[1] + 26) % 26) + 65)))\n .join(\"\");\n return cipher === ans;\n },\n },\n {\n desc: (_data: unknown): string => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, string];\n return [\n \"Vigenère cipher is a type of polyalphabetic substitution. It uses \",\n \"the Vigenère square to encrypt and decrypt plaintext with a keyword.\\n\\n\",\n \"  Vignenère square:\\n\",\n \"         A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \\n\",\n \"       +----------------------------------------------------\\n\",\n \"     A | A B C D E F G H I J K L M N O P Q R S T U V W X Y Z \\n\",\n \"     B | B C D E F G H I J K L M N O P Q R S T U V W X Y Z A \\n\",\n \"     C | C D E F G H I J K L M N O P Q R S T U V W X Y Z A B\\n\",\n \"     D | D E F G H I J K L M N O P Q R S T U V W X Y Z A B C\\n\",\n \"     E | E F G H I J K L M N O P Q R S T U V W X Y Z A B C D\\n\",\n \"                ...\\n\",\n \"     Y | Y Z A B C D E F G H I J K L M N O P Q R S T U V W X\\n\",\n \"     Z | Z A B C D E F G H I J K L M N O P Q R S T U V W X Y\\n\\n\",\n \"For encryption each letter of the plaintext is paired with the corresponding letter of a repeating keyword.\",\n \"For example, the plaintext DASHBOARD is encrypted with the keyword LINUX:\\n\",\n \"   Plaintext: DASHBOARD\\n\",\n \"   Keyword:   LINUXLINU\\n\",\n \"So, the first letter D is paired with the first letter of the key L. Therefore, row D and column L of the \",\n \"Vigenère square are used to get the first cipher letter O. This must be repeated for the whole ciphertext.\\n\\n\",\n \"You are given an array with two elements:\\n\",\n `  [\"${data[0]}\", \"${data[1]}\"]\\n`,\n \"The first element is the plaintext, the second element is the keyword.\\n\\n\",\n \"Return the ciphertext as uppercase string.\",\n ].join(\" \");\n },\n difficulty: 2,\n gen: (): [string, string] => {\n // return [plaintext, keyword]\n const words = [\n \"ARRAY\",\n \"CACHE\",\n \"CLOUD\",\n \"DEBUG\",\n \"EMAIL\",\n \"ENTER\",\n \"FLASH\",\n \"FRAME\",\n \"INBOX\",\n \"LINUX\",\n \"LOGIC\",\n \"LOGIN\",\n \"MACRO\",\n \"MEDIA\",\n \"MODEM\",\n \"MOUSE\",\n \"PASTE\",\n \"POPUP\",\n \"PRINT\",\n \"QUEUE\",\n \"SHELL\",\n \"SHIFT\",\n \"TABLE\",\n \"TRASH\",\n \"VIRUS\",\n ];\n const keys = [\n \"ALGORITHM\",\n \"BANDWIDTH\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BROADBAND\",\n \"BROWSER\",\n \"CAPTCHA\",\n \"CLIPBOARD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"DASHBOARD\",\n \"DATABASE\",\n \"DESKTOP\",\n \"DIGITAL\",\n \"DOCUMENT\",\n \"DOWNLOAD\",\n \"DYNAMIC\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"EXABYTE\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLOWCHART\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HARDWARE\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"ITERATION\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MONITOR\",\n \"NETWORK\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"OPERATING\",\n \"PASSWORD\",\n \"PHISHING\",\n \"PLATFORM\",\n \"PODCAST\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROTOCOL\",\n \"REALTIME\",\n \"RESTORE\",\n \"RUNTIME\",\n \"SCANNER\",\n \"SECURITY\",\n \"SHAREWARE\",\n \"SNAPSHOT\",\n \"SOFTWARE\",\n \"SPAMMER\",\n \"SPYWARE\",\n \"STORAGE\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TOOLBAR\",\n \"TYPEFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n ];\n return [\n words\n .sort(() => Math.random() - 0.5)\n .slice(0, 5)\n .join(\"\"),\n keys.sort(() => Math.random() - 0.5)[0],\n ];\n },\n name: \"Encryption II: Vigenère Cipher\",\n numTries: 10,\n solver: (_data: unknown, ans: string): boolean => {\n if (!Array.isArray(_data)) throw new Error(\"data should be array of string\");\n const data = _data as [string, string];\n // data = [plaintext, keyword]\n // build char array, shifting via map and corresponding keyword letter and join to final results\n const cipher = [...data[0]]\n .map((a, i) => {\n return a === \" \"\n ? a\n : String.fromCharCode(((a.charCodeAt(0) - 2 * 65 + data[1].charCodeAt(i % data[1].length)) % 26) + 65);\n })\n .join(\"\");\n return cipher === ans;\n },\n },\n];\n","/** Binary heap. */\nabstract class BinHeap {\n /**\n * Heap data array consisting of [weight, payload] pairs, arranged by weight\n * to satisfy heap condition.\n *\n * Encodes the binary tree by storing tree root at index 0 and\n * left child of element i at `i * 2 + 1` and\n * right child of element i at `i * 2 + 2`.\n */\n protected data: [number, T][];\n\n constructor() {\n this.data = [];\n }\n\n /** Get number of elements in the heap. */\n public get size(): number {\n return this.data.length;\n }\n\n /** Add a new element to the heap. */\n public push(value: T, weight: number): void {\n const i = this.data.length;\n this.data[i] = [weight, value];\n this.heapifyUp(i);\n }\n\n /** Get the value of the root-most element of the heap, without changing the heap. */\n public peek(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n return this.data[0][1];\n }\n\n /** Remove the root-most element of the heap and return the removed element's value. */\n public pop(): T | undefined {\n if (this.data.length == 0) return undefined;\n\n const value = this.data[0][1];\n\n this.data[0] = this.data[this.data.length - 1];\n this.data.length = this.data.length - 1;\n\n this.heapifyDown(0);\n\n return value;\n }\n\n /** Change the weight of an element in the heap. */\n public changeWeight(predicate: (value: T) => boolean, weight: number): void {\n // Find first element with matching value, if any\n const i = this.data.findIndex((e) => predicate(e[1]));\n if (i == -1) return;\n\n // Update that element's weight\n this.data[i][0] = weight;\n\n // And re-heapify if needed\n const p = Math.floor((i - 1) / 2);\n\n if (!this.heapOrderABeforeB(this.data[p][0], this.data[i][0]))\n // Needs to shift root-wards?\n this.heapifyUp(i);\n // Try shifting deeper\n else this.heapifyDown(i);\n }\n\n /** Restore heap condition, starting at index i and traveling towards root. */\n protected heapifyUp(i: number): void {\n // Swap the new element up towards root until it reaches root position or\n // settles under under a suitable parent\n while (i > 0) {\n const p = Math.floor((i - 1) / 2);\n\n // Reached heap-ordered state already?\n if (this.heapOrderABeforeB(this.data[p][0], this.data[i][0])) break;\n\n // Swap\n const tmp = this.data[p];\n this.data[p] = this.data[i];\n this.data[i] = tmp;\n\n // And repeat at parent index\n i = p;\n }\n }\n\n /** Restore heap condition, starting at index i and traveling away from root. */\n protected heapifyDown(i: number): void {\n // Swap the shifted element down in the heap until it either reaches the\n // bottom layer or is in correct order relative to it's children\n while (i < this.data.length) {\n const l = i * 2 + 1;\n const r = i * 2 + 2;\n let toSwap = i;\n\n // Find which one of element i and it's children should be closest to root\n if (l < this.data.length && this.heapOrderABeforeB(this.data[l][0], this.data[toSwap][0])) toSwap = l;\n if (r < this.data.length && this.heapOrderABeforeB(this.data[r][0], this.data[toSwap][0])) toSwap = r;\n\n // Already in order?\n if (i == toSwap) break;\n\n // Not in order. Swap child that should be closest to root up to 'i' and repeat\n const tmp = this.data[toSwap];\n this.data[toSwap] = this.data[i];\n this.data[i] = tmp;\n\n i = toSwap;\n }\n }\n\n /**\n * Should element with weight `weightA` be closer to root than element with\n * weight `weightB`?\n */\n protected abstract heapOrderABeforeB(weightA: number, weightB: number): boolean;\n}\n\n/** Binary max-heap. */\nexport class MaxHeap extends BinHeap {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA > weightB;\n }\n}\n\n/** Binary min-heap. */\nexport class MinHeap extends BinHeap {\n heapOrderABeforeB(weightA: number, weightB: number): boolean {\n return weightA < weightB;\n }\n}\n","// Function that generates a random gibberish string of length n\nconst chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\nexport function createRandomString(n: number): string {\n let str = \"\";\n\n for (let i = 0; i < n; ++i) {\n str += chars.charAt(Math.floor(Math.random() * chars.length));\n }\n\n return str;\n}\n","import { BaseServer } from \"../Server/BaseServer\";\nimport { ITerminal } from \"../Terminal/ITerminal\";\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\nimport { IRouter } from \"../ui/Router\";\n\nexport interface IProgramCreate {\n level: number;\n req(p: IPlayer): boolean; // Function that indicates whether player meets requirements\n time: number;\n tooltip: string;\n}\n\nexport class Program {\n name = \"\";\n create: IProgramCreate | null;\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;\n\n constructor(\n name: string,\n create: IProgramCreate | null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void,\n ) {\n this.name = name;\n this.create = create;\n this.run = run;\n }\n}\n","import { IProgramCreate } from \"../Program\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { BaseServer } from \"../../Server/BaseServer\";\nimport { Server } from \"../../Server/Server\";\nimport { ITerminal } from \"../../Terminal/ITerminal\";\nimport { IRouter } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { BitFlumeEvent } from \"../../BitNode/ui/BitFlumeModal\";\nimport { calculateHackingTime, calculateGrowTime, calculateWeakenTime } from \"../../Hacking\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nfunction requireHackingLevel(lvl: number) {\n return function (p: IPlayer) {\n return p.skills.hacking + p.skills.intelligence / 2 >= lvl;\n };\n}\n\nfunction bitFlumeRequirements() {\n return function (p: IPlayer) {\n return p.sourceFiles.length > 0 && p.skills.hacking >= 1;\n };\n}\n\ninterface IProgramCreationParams {\n key: string;\n name: string;\n create: IProgramCreate | null;\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]) => void;\n}\n\nexport const programsMetadata: IProgramCreationParams[] = [\n {\n key: \"NukeProgram\",\n name: \"NUKE.exe\",\n create: {\n level: 1,\n tooltip: \"This virus is used to gain root access to a machine if enough ports are opened.\",\n req: requireHackingLevel(1),\n time: CONSTANTS.MillisecondsPerFiveMinutes,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot nuke this kind of server.\");\n return;\n }\n if (server.hasAdminRights) {\n terminal.print(\"You already have root access to this computer. There is no reason to run NUKE.exe\");\n terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n if (server.openPortCount >= server.numOpenPortsRequired) {\n server.hasAdminRights = true;\n terminal.print(\"NUKE successful! Gained root access to \" + server.hostname);\n terminal.print(\"You can now run scripts on this server.\");\n return;\n }\n\n terminal.print(\"NUKE unsuccessful. Not enough ports have been opened\");\n },\n },\n {\n key: \"BruteSSHProgram\",\n name: \"BruteSSH.exe\",\n create: {\n level: 50,\n tooltip: \"This program executes a brute force attack that opens SSH ports\",\n req: requireHackingLevel(50),\n time: CONSTANTS.MillisecondsPerFiveMinutes * 2,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run BruteSSH.exe on this kind of server.\");\n return;\n }\n if (server.sshPortOpen) {\n terminal.print(\"SSH Port (22) is already open!\");\n return;\n }\n\n server.sshPortOpen = true;\n terminal.print(\"Opened SSH Port(22)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"FTPCrackProgram\",\n name: \"FTPCrack.exe\",\n create: {\n level: 100,\n tooltip: \"This program cracks open FTP ports\",\n req: requireHackingLevel(100),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run FTPCrack.exe on this kind of server.\");\n return;\n }\n if (server.ftpPortOpen) {\n terminal.print(\"FTP Port (21) is already open!\");\n return;\n }\n\n server.ftpPortOpen = true;\n terminal.print(\"Opened FTP Port (21)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"RelaySMTPProgram\",\n name: \"relaySMTP.exe\",\n create: {\n level: 250,\n tooltip: \"This program opens SMTP ports by redirecting data\",\n req: requireHackingLevel(250),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run relaySMTP.exe on this kind of server.\");\n return;\n }\n if (server.smtpPortOpen) {\n terminal.print(\"SMTP Port (25) is already open!\");\n return;\n }\n\n server.smtpPortOpen = true;\n terminal.print(\"Opened SMTP Port (25)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"HTTPWormProgram\",\n name: \"HTTPWorm.exe\",\n create: {\n level: 500,\n tooltip: \"This virus opens up HTTP ports\",\n req: requireHackingLevel(500),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run HTTPWorm.exe on this kind of server.\");\n return;\n }\n if (server.httpPortOpen) {\n terminal.print(\"HTTP Port (80) is already open!\");\n return;\n }\n\n server.httpPortOpen = true;\n terminal.print(\"Opened HTTP Port (80)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"SQLInjectProgram\",\n name: \"SQLInject.exe\",\n create: {\n level: 750,\n tooltip: \"This virus opens SQL ports\",\n req: requireHackingLevel(750),\n time: CONSTANTS.MillisecondsPer8Hours,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer): void => {\n if (!(server instanceof Server)) {\n terminal.error(\"Cannot run SQLInject.exe on this kind of server.\");\n return;\n }\n if (server.sqlPortOpen) {\n terminal.print(\"SQL Port (1433) is already open!\");\n return;\n }\n\n server.sqlPortOpen = true;\n terminal.print(\"Opened SQL Port (1433)!\");\n server.openPortCount++;\n },\n },\n {\n key: \"DeepscanV1\",\n name: \"DeepscanV1.exe\",\n create: {\n level: 75,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 5\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"DeepscanV1.exe lets you run 'scan-analyze' with a depth up to 5.\");\n },\n },\n {\n key: \"DeepscanV2\",\n name: \"DeepscanV2.exe\",\n create: {\n level: 400,\n tooltip: \"This program allows you to use the scan-analyze command with a depth up to 10\",\n req: requireHackingLevel(400),\n time: CONSTANTS.MillisecondsPer2Hours,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"DeepscanV2.exe lets you run 'scan-analyze' with a depth up to 10.\");\n },\n },\n {\n key: \"ServerProfiler\",\n name: \"ServerProfiler.exe\",\n create: {\n level: 75,\n tooltip: \"This program is used to display hacking and Netscript-related information about servers\",\n req: requireHackingLevel(75),\n time: CONSTANTS.MillisecondsPerHalfHour,\n },\n run: (router: IRouter, terminal: ITerminal, player: IPlayer, server: BaseServer, args: string[]): void => {\n if (args.length !== 1) {\n terminal.error(\"Must pass a server hostname or IP as an argument for ServerProfiler.exe\");\n return;\n }\n\n const targetServer = GetServer(args[0]);\n if (targetServer == null) {\n terminal.error(\"Invalid server IP/hostname\");\n return;\n }\n\n if (!(targetServer instanceof Server)) {\n terminal.error(`ServerProfiler.exe can only be run on normal servers.`);\n return;\n }\n\n terminal.print(targetServer.hostname + \":\");\n terminal.print(\"Server base security level: \" + targetServer.baseDifficulty);\n terminal.print(\"Server current security level: \" + targetServer.hackDifficulty);\n terminal.print(\"Server growth rate: \" + targetServer.serverGrowth);\n terminal.print(\n `Netscript hack() execution time: ${convertTimeMsToTimeElapsedString(\n calculateHackingTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n terminal.print(\n `Netscript grow() execution time: ${convertTimeMsToTimeElapsedString(\n calculateGrowTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n terminal.print(\n `Netscript weaken() execution time: ${convertTimeMsToTimeElapsedString(\n calculateWeakenTime(targetServer, player) * 1000,\n true,\n )}`,\n );\n },\n },\n {\n key: \"AutoLink\",\n name: \"AutoLink.exe\",\n create: {\n level: 25,\n tooltip: \"This program allows you to directly connect to other servers through the 'scan-analyze' command\",\n req: requireHackingLevel(25),\n time: CONSTANTS.MillisecondsPerQuarterHour,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"AutoLink.exe lets you automatically connect to other servers when using 'scan-analyze'.\");\n terminal.print(\"When using scan-analyze, click on a server's hostname to connect to it.\");\n },\n },\n {\n key: \"Formulas\",\n name: \"Formulas.exe\",\n create: {\n level: 1000,\n tooltip: \"This program allows you to use the formulas API\",\n req: requireHackingLevel(1000),\n time: CONSTANTS.MillisecondsPer4Hours,\n },\n run: (router: IRouter, terminal: ITerminal): void => {\n terminal.print(\"This executable cannot be run.\");\n terminal.print(\"Formulas.exe lets you use the formulas API.\");\n },\n },\n {\n key: \"BitFlume\",\n name: \"b1t_flum3.exe\",\n create: {\n level: 1,\n tooltip: \"This program creates a portal to the BitNode Nexus (allows you to restart and switch BitNodes)\",\n req: bitFlumeRequirements(),\n time: CONSTANTS.MillisecondsPerFiveMinutes / 20,\n },\n run: (): void => {\n BitFlumeEvent.emit();\n },\n },\n {\n key: \"Flight\",\n name: \"fl1ght.exe\",\n create: null,\n run: (router: IRouter, terminal: ITerminal, player: IPlayer): void => {\n const numAugReq = BitNodeMultipliers.DaedalusAugsRequirement;\n const fulfilled =\n player.augmentations.length >= numAugReq && player.money > 1e11 && player.skills.hacking >= 2500;\n if (!fulfilled) {\n terminal.print(`Augmentations: ${player.augmentations.length} / ${numAugReq}`);\n terminal.print(`Money: ${numeralWrapper.formatMoney(player.money)} / $100b`);\n terminal.print(`Hacking skill: ${player.skills.hacking} / 2500`);\n return;\n }\n\n terminal.print(\"We will contact you.\");\n terminal.print(`-- ${FactionNames.Daedalus} --`);\n },\n },\n];\n","/**\n * Checks whether a IP Address string is valid.\n * @param ipaddress A string representing a potential IP Address\n */\nexport function isValidIPAddress(ipaddress: string): boolean {\n const byteRange = \"(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\";\n const regexStr = `^${byteRange}\\.${byteRange}\\.${byteRange}\\.${byteRange}$`;\n const ipAddressRegex = new RegExp(regexStr);\n\n return ipAddressRegex.test(ipaddress);\n}\n","// Interface that defines a generic object used to track experience/money\n// earnings for tasks\nexport interface ITaskTracker {\n hack: number;\n str: number;\n def: number;\n dex: number;\n agi: number;\n cha: number;\n int: number;\n money: number;\n}\n\nexport function createTaskTracker(): ITaskTracker {\n return {\n hack: 0,\n str: 0,\n def: 0,\n dex: 0,\n agi: 0,\n cha: 0,\n int: 0,\n money: 0,\n };\n}\n","/**\n * Returns a MM/DD HH:MM timestamp for the current time\n */\nexport function getTimestamp(): string {\n const d: Date = new Date();\n // A negative slice value takes from the end of the string rather than the beginning.\n const stringWidth = -2;\n const formattedHours: string = `0${d.getHours()}`.slice(stringWidth);\n const formattedMinutes: string = `0${d.getMinutes()}`.slice(stringWidth);\n const formattedSeconds: string = `0${d.getSeconds()}`.slice(stringWidth);\n\n return `${d.getMonth() + 1}/${d.getDate()} ${formattedHours}:${formattedMinutes}:${formattedSeconds}`;\n}\n","export function CalculateShareMult(power: number): number {\n const x = 1 + Math.log(power) / 25;\n if (isNaN(x) || !isFinite(x)) return 1;\n return x;\n}\n","import * as posNames from \"./companypositionnames\";\nimport { IConstructorParams } from \"../Company\";\n\nimport { IMap } from \"../../types\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\n// Create Objects containing Company Positions by category\n// Will help in metadata construction later\nconst AllSoftwarePositions: IMap = {};\nconst AllITPositions: IMap = {};\nconst AllNetworkEngineerPositions: IMap = {};\nconst SecurityEngineerPositions: IMap = {};\nconst AllTechnologyPositions: IMap = {};\nconst AllBusinessPositions: IMap = {};\nconst AllAgentPositions: IMap = {};\nconst AllSecurityPositions: IMap = {};\nconst AllSoftwareConsultantPositions: IMap = {};\nconst AllBusinessConsultantPositions: IMap = {};\nconst SoftwarePositionsUpToHeadOfEngineering: IMap = {};\nconst SoftwarePositionsUpToLeadDeveloper: IMap = {};\nconst BusinessPositionsUpToOperationsManager: IMap = {};\nconst WaiterOnly: IMap = {};\nconst EmployeeOnly: IMap = {};\nconst PartTimeWaiterOnly: IMap = {};\nconst PartTimeEmployeeOnly: IMap = {};\nconst OperationsManagerOnly: IMap = {};\nconst CEOOnly: IMap = {};\n\nposNames.SoftwareCompanyPositions.forEach((e) => {\n AllSoftwarePositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.ITCompanyPositions.forEach((e) => {\n AllITPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nposNames.NetworkEngineerCompanyPositions.forEach((e) => {\n AllNetworkEngineerPositions[e] = true;\n AllTechnologyPositions[e] = true;\n});\n\nAllTechnologyPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\nSecurityEngineerPositions[posNames.SecurityEngineerCompanyPositions[0]] = true;\n\nposNames.BusinessCompanyPositions.forEach((e) => {\n AllBusinessPositions[e] = true;\n});\n\nposNames.SecurityCompanyPositions.forEach((e) => {\n AllSecurityPositions[e] = true;\n});\n\nposNames.AgentCompanyPositions.forEach((e) => {\n AllAgentPositions[e] = true;\n});\n\nposNames.SoftwareConsultantCompanyPositions.forEach((e) => {\n AllSoftwareConsultantPositions[e] = true;\n});\n\nposNames.BusinessConsultantCompanyPositions.forEach((e) => {\n AllBusinessConsultantPositions[e] = true;\n});\n\nfor (let i = 0; i < posNames.SoftwareCompanyPositions.length; ++i) {\n const e = posNames.SoftwareCompanyPositions[i];\n if (i <= 5) {\n SoftwarePositionsUpToHeadOfEngineering[e] = true;\n }\n if (i <= 3) {\n SoftwarePositionsUpToLeadDeveloper[e] = true;\n }\n}\nfor (let i = 0; i < posNames.BusinessCompanyPositions.length; ++i) {\n const e = posNames.BusinessCompanyPositions[i];\n if (i <= 3) {\n BusinessPositionsUpToOperationsManager[e] = true;\n }\n}\n\nWaiterOnly[posNames.MiscCompanyPositions[0]] = true;\nEmployeeOnly[posNames.MiscCompanyPositions[1]] = true;\nPartTimeWaiterOnly[posNames.PartTimeCompanyPositions[0]] = true;\nPartTimeEmployeeOnly[posNames.PartTimeCompanyPositions[1]] = true;\nOperationsManagerOnly[posNames.BusinessCompanyPositions[3]] = true;\nCEOOnly[posNames.BusinessCompanyPositions[5]] = true;\n\n// Metadata\nexport const companiesMetadata: IConstructorParams[] = [\n {\n name: LocationName.AevumECorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.Sector12MegaCorp,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 3,\n salaryMultiplier: 3,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumBachmanAndAssociates,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.6,\n salaryMultiplier: 2.6,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12BladeIndustries,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenNWO,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.75,\n salaryMultiplier: 2.75,\n jobStatReqOffset: 249,\n },\n {\n name: LocationName.AevumClarkeIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.VolhavenOmniTekIncorporated,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.25,\n salaryMultiplier: 2.25,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.Sector12FourSigma,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.5,\n salaryMultiplier: 2.5,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.ChongqingKuaiGongInternational,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSecurityPositions),\n expMultiplier: 2.2,\n salaryMultiplier: 2.2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.AevumFulcrumTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaStormTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllSoftwareConsultantPositions, AllBusinessPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoDefComm,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenHeliosLabs,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, AllTechnologyPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoVitaLife,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12IcarusMicrosystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12UniversalEnergy,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumGalacticCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions, AllBusinessPositions, AllSoftwareConsultantPositions),\n expMultiplier: 1.9,\n salaryMultiplier: 1.9,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.AevumAeroCorp,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.VolhavenOmniaCybersystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.ChongqingSolarisSpaceSystems,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.7,\n salaryMultiplier: 1.7,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12DeltaOne,\n info: \"\",\n companyPositions: Object.assign({}, CEOOnly, OperationsManagerOnly, AllTechnologyPositions, AllSecurityPositions),\n expMultiplier: 1.6,\n salaryMultiplier: 1.6,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.8,\n salaryMultiplier: 1.8,\n jobStatReqOffset: 224,\n },\n {\n name: LocationName.IshimaNovaMedical,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllBusinessPositions,\n AllSoftwareConsultantPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.75,\n salaryMultiplier: 1.75,\n jobStatReqOffset: 199,\n },\n {\n name: LocationName.Sector12CIA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.Sector12NSA,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n SecurityEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n ),\n expMultiplier: 2,\n salaryMultiplier: 2,\n jobStatReqOffset: 149,\n },\n {\n name: LocationName.AevumWatchdogSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToHeadOfEngineering,\n AllNetworkEngineerPositions,\n AllITPositions,\n AllSecurityPositions,\n AllAgentPositions,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenLexoCorp,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllBusinessPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.4,\n salaryMultiplier: 1.4,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumRhoConstruction,\n info: \"\",\n companyPositions: Object.assign({}, SoftwarePositionsUpToLeadDeveloper, BusinessPositionsUpToOperationsManager),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.Sector12AlphaEnterprises,\n info: \"\",\n companyPositions: Object.assign(\n {},\n SoftwarePositionsUpToLeadDeveloper,\n BusinessPositionsUpToOperationsManager,\n AllSoftwareConsultantPositions,\n ),\n expMultiplier: 1.5,\n salaryMultiplier: 1.5,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.AevumPolice,\n info: \"\",\n companyPositions: Object.assign({}, AllSecurityPositions, SoftwarePositionsUpToLeadDeveloper),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.VolhavenSysCoreSecurities,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.3,\n salaryMultiplier: 1.3,\n jobStatReqOffset: 124,\n },\n {\n name: LocationName.VolhavenCompuTek,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.AevumNetLinkTechnologies,\n info: \"\",\n companyPositions: Object.assign({}, AllTechnologyPositions),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 99,\n },\n {\n name: LocationName.Sector12CarmichaelSecurity,\n info: \"\",\n companyPositions: Object.assign(\n {},\n AllTechnologyPositions,\n AllSoftwareConsultantPositions,\n AllAgentPositions,\n AllSecurityPositions,\n ),\n expMultiplier: 1.2,\n salaryMultiplier: 1.2,\n jobStatReqOffset: 74,\n },\n {\n name: LocationName.Sector12FoodNStuff,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.Sector12JoesGuns,\n info: \"\",\n companyPositions: Object.assign({}, EmployeeOnly, PartTimeEmployeeOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n {\n name: LocationName.IshimaOmegaSoftware,\n info: \"\",\n companyPositions: Object.assign({}, AllSoftwarePositions, AllSoftwareConsultantPositions, AllITPositions),\n expMultiplier: 1.1,\n salaryMultiplier: 1.1,\n jobStatReqOffset: 49,\n },\n {\n name: LocationName.NewTokyoNoodleBar,\n info: \"\",\n companyPositions: Object.assign({}, WaiterOnly, PartTimeWaiterOnly),\n expMultiplier: 1,\n salaryMultiplier: 1,\n jobStatReqOffset: 0,\n },\n];\n","export interface IConstructorParams {\n name: string;\n cost: number;\n desc: string;\n advertisingMult?: number;\n employeeChaMult?: number;\n employeeCreMult?: number;\n employeeEffMult?: number;\n employeeIntMult?: number;\n productionMult?: number;\n productProductionMult?: number;\n salesMult?: number;\n sciResearchMult?: number;\n storageMult?: number;\n}\n\nexport class Research {\n // Name of research. This will be used to identify researches in the Research Tree\n name = \"\";\n\n // How much scientific research it costs to unlock this\n cost = 0;\n\n // Description of what the Research does\n desc = \"\";\n\n // All possible generic upgrades for the company, in the form of multipliers\n advertisingMult = 1;\n employeeChaMult = 1;\n employeeCreMult = 1;\n employeeEffMult = 1;\n employeeIntMult = 1;\n productionMult = 1;\n productProductionMult = 1;\n salesMult = 1;\n sciResearchMult = 1;\n storageMult = 1;\n\n constructor(p: IConstructorParams = { name: \"\", cost: 0, desc: \"\" }) {\n this.name = p.name;\n this.cost = p.cost;\n this.desc = p.desc;\n if (p.advertisingMult) {\n this.advertisingMult = p.advertisingMult;\n }\n if (p.employeeChaMult) {\n this.employeeChaMult = p.employeeChaMult;\n }\n if (p.employeeCreMult) {\n this.employeeCreMult = p.employeeCreMult;\n }\n if (p.employeeEffMult) {\n this.employeeEffMult = p.employeeEffMult;\n }\n if (p.employeeIntMult) {\n this.employeeIntMult = p.employeeIntMult;\n }\n if (p.productionMult) {\n this.productionMult = p.productionMult;\n }\n if (p.productProductionMult) {\n this.productProductionMult = p.productProductionMult;\n }\n if (p.salesMult) {\n this.salesMult = p.salesMult;\n }\n if (p.sciResearchMult) {\n this.sciResearchMult = p.sciResearchMult;\n }\n if (p.storageMult) {\n this.storageMult = p.storageMult;\n }\n }\n}\n","import { IConstructorParams } from \"../Research\";\n\nexport const researchMetadata: IConstructorParams[] = [\n {\n name: \"AutoBrew\",\n cost: 12e3,\n desc:\n \"Automatically keep your employees fully caffeinated with \" +\n \"coffee injections. This research will keep the energy of all \" +\n \"employees at its maximum possible value, for no cost. \" +\n \"This will also disable the Coffee upgrade.\",\n },\n {\n name: \"AutoPartyManager\",\n cost: 15e3,\n desc:\n \"Automatically analyzes your employees' happiness and morale \" +\n \"and boosts them whenever it detects a decrease. This research will \" +\n \"keep the morale and happiness of all employees at their maximum possible \" +\n \"values, for no cost. \" +\n \"This will also disable the 'Throw Party' feature.\",\n },\n {\n name: \"Automatic Drug Administration\",\n cost: 10e3,\n desc:\n \"Research how to automatically administer performance-enhacing drugs to all of \" +\n \"your employees. This unlocks Drug-related Research.\",\n },\n {\n name: \"Bulk Purchasing\",\n cost: 5e3,\n desc:\n \"Research the art of buying materials in bulk. This allows you to purchase \" +\n \"any amount of a material instantly.\",\n },\n {\n name: \"CPH4 Injections\",\n cost: 25e3,\n desc:\n \"Develop an advanced and harmless synthetic drug that is administered to \" +\n \"employees to increase all of their stats, except experience, by 10%.\",\n employeeCreMult: 1.1,\n employeeChaMult: 1.1,\n employeeEffMult: 1.1,\n employeeIntMult: 1.1,\n },\n {\n name: \"Drones\",\n cost: 5e3,\n desc:\n \"Acquire the knowledge needed to create advanced drones. This research does nothing \" +\n \"by itself, but unlocks other Drone-related research.\",\n },\n {\n name: \"Drones - Assembly\",\n cost: 25e3,\n desc:\n \"Manufacture and use Assembly Drones to improve the efficiency of \" +\n \"your production lines. This increases all production by 20%.\",\n productionMult: 1.2,\n },\n {\n name: \"Drones - Transport\",\n cost: 30e3,\n desc:\n \"Manufacture and use intelligent Transport Drones to optimize \" +\n \"your warehouses. This increases the storage space of all warehouses \" +\n \"by 50%.\",\n storageMult: 1.5,\n },\n {\n name: \"Go-Juice\",\n cost: 25e3,\n desc:\n \"Provide employees with Go-Juice, a coffee-derivative that further enhances \" +\n \"the brain's dopamine production. This increases the maximum energy of all \" +\n \"employees by 10.\",\n },\n {\n name: \"Hi-Tech R&D Laboratory\",\n cost: 5e3,\n desc:\n \"Construct a cutting edge facility dedicated to advanced research and \" +\n \"and development. This allows you to spend Scientific Research \" +\n \"on powerful upgrades. It also globally increases Scientific Research \" +\n \"production by 10%.\",\n sciResearchMult: 1.1,\n },\n {\n name: \"HRBuddy-Recruitment\",\n cost: 15e3,\n desc:\n \"Use automated software to handle the hiring of employees. With this \" +\n \"research, each office will automatically hire one employee per \" +\n \"market cycle if there is available space.\",\n },\n {\n name: \"HRBuddy-Training\",\n cost: 20e3,\n desc:\n \"Use automated software to handle the training of employees. With this \" +\n \"research, each employee hired with HRBuddy-Recruitment will automatically \" +\n \"be assigned to 'Training', rather than being unassigned.\",\n },\n {\n name: \"JoyWire\",\n cost: 20e3,\n desc: \"A brain implant which is installed in employees, increasing their maximum happiness by 10.\",\n },\n {\n name: \"Market-TA.I\",\n cost: 20e3,\n desc:\n \"Develop advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know what price to sell your Materials/Products \" +\n \"at in order to avoid losing sales due to having too high of a mark-up. \" +\n \"It also lets you automatically use that sale price.\",\n },\n {\n name: \"Market-TA.II\",\n cost: 50e3,\n desc:\n \"Develop double-advanced AI software that uses technical analysis to \" +\n \"help you understand and exploit the market. This research \" +\n \"allows you to know how many sales of a Material/Product you lose or gain \" +\n \"from having too high or too low or a sale price. It also lets you automatically \" +\n \"set the sale price of your Materials/Products at the optimal price such that \" +\n \"the amount sold matches the amount produced.\",\n },\n {\n name: \"Overclock\",\n cost: 15e3,\n desc:\n \"Equip employees with a headset that uses transcranial direct current \" +\n \"stimulation (tDCS) to increase the speed of their neurotransmitters. \" +\n \"This research increases the intelligence and efficiency of all \" +\n \"employees by 25%.\",\n employeeEffMult: 1.25,\n employeeIntMult: 1.25,\n },\n {\n name: \"Self-Correcting Assemblers\",\n cost: 25e3,\n desc:\n \"Create assemblers that can be used for universal production. \" +\n \"These assemblers use deep learning to improve their efficiency \" +\n \"at their tasks. This research increases all production by 10%\",\n productionMult: 1.1,\n },\n {\n name: \"Sti.mu\",\n cost: 30e3,\n desc:\n \"Upgrade the tDCS headset to stimulate regions of the brain that \" +\n \"control confidence and enthusiasm. This research increases the max \" +\n \"morale of all employees by 10.\",\n },\n {\n name: \"sudo.Assist\",\n cost: 15e3,\n desc: \"Develop a virtual assistant AI to handle and manage administrative issues for your corporation.\",\n },\n {\n name: \"uPgrade: Capacity.I\",\n cost: 20e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 3 to 4).\",\n },\n {\n name: \"uPgrade: Capacity.II\",\n cost: 30e3,\n desc:\n \"Expand the industry's capacity for designing and manufacturing its \" +\n \"various products. This increases the industry's maximum number of products \" +\n \"by 1 (from 4 to 5).\",\n },\n {\n name: \"uPgrade: Dashboard\",\n cost: 5e3,\n desc:\n \"Improve the software used to manage the industry's production line \" +\n \"for its various products. This allows you to manage the production and \" +\n \"sale of a product before it's finished being designed.\",\n },\n {\n name: \"uPgrade: Fulcrum\",\n cost: 10e3,\n desc:\n \"Streamline the manufacturing of this industry's various products. \" +\n \"This research increases the production of your products by 5%\",\n productProductionMult: 1.05,\n },\n];\n","/**\n * Object representing an upgrade that can be purchased with hashes\n */\nexport interface IConstructorParams {\n cost?: number;\n costPerLevel: number;\n desc: string;\n hasTargetServer?: boolean;\n name: string;\n value: number;\n effectText?: (level: number) => JSX.Element | null;\n}\n\nexport class HashUpgrade {\n /**\n * If the upgrade has a flat cost (never increases), it goes here\n * Otherwise, this property should be undefined\n *\n * This property overrides the 'costPerLevel' property\n */\n cost?: number;\n\n /**\n * Base cost for this upgrade. Every time the upgrade is purchased,\n * its cost increases by this same amount (so its 1x, 2x, 3x, 4x, etc.)\n */\n costPerLevel = 0;\n\n /**\n * Description of what the upgrade does\n */\n desc = \"\";\n\n /**\n * Boolean indicating that this upgrade's effect affects a single server,\n * the \"target\" server\n */\n hasTargetServer = false;\n\n // Name of upgrade\n name = \"\";\n\n // Generic value used to indicate the potency/amount of this upgrade's effect\n // The meaning varies between different upgrades\n value = 0;\n\n constructor(p: IConstructorParams) {\n if (p.cost != null) {\n this.cost = p.cost;\n }\n if (p.effectText != null) {\n this.effectText = p.effectText;\n }\n\n this.costPerLevel = p.costPerLevel;\n this.desc = p.desc;\n this.hasTargetServer = p.hasTargetServer ? p.hasTargetServer : false;\n this.name = p.name;\n this.value = p.value;\n }\n\n // Functions that returns the UI element to display the effect of this upgrade.\n effectText: (level: number) => JSX.Element | null = () => null;\n\n getCost(currentLevel: number, count = 1): number {\n if (typeof this.cost === \"number\") {\n return this.cost * count;\n }\n\n //This formula is equivalent to\n //(currentLevel + 1) * this.costPerLevel\n //being performed repeatedly\n const collapsedSum = 0.5 * count * (count + 2 * currentLevel + 1);\n return this.costPerLevel * collapsedSum;\n }\n}\n","// Metadata used to construct all Hash Upgrades\nimport React from \"react\";\nimport { IConstructorParams } from \"../HashUpgrade\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Money } from \"../../ui/React/Money\";\n\nexport const HashUpgradesMetadata: IConstructorParams[] = [\n {\n cost: 4,\n costPerLevel: 4,\n desc: \"Sell hashes for $1m\",\n name: \"Sell for Money\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for \n \n ),\n value: 1e6,\n },\n {\n costPerLevel: 100,\n desc: \"Sell hashes for $1b in Corporation funds\",\n name: \"Sell for Corporation Funds\",\n effectText: (level: number): JSX.Element | null => (\n <>\n Sold for Corporation funds.\n \n ),\n value: 1e9,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to decrease the minimum security of a single server by 2%. \" +\n \"Note that a server's minimum security cannot go below 1. This effect persists \" +\n \"until you install Augmentations (since servers are reset at that time).\",\n hasTargetServer: true,\n name: \"Reduce Minimum Security\",\n value: 0.98,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to increase the maximum amount of money on a single server by 2%. \" +\n \"Note that a server's maximum money is soft capped above $10t. \" +\n \"This effect persists until you install Augmentations (since servers \" +\n \"are reset at that time).\",\n hasTargetServer: true,\n name: \"Increase Maximum Money\",\n value: 1.02,\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when studying at a university by 20%. \" +\n \"This effect persists until you install Augmentations\",\n name: \"Improve Studying\",\n effectText: (level: number): JSX.Element | null => <>Improves studying by {level * 20}%,\n value: 20, // Improves studying by value%\n },\n {\n costPerLevel: 50,\n desc:\n \"Use hashes to improve the experience earned when training at the gym by 20%. This effect \" +\n \"persists until you install Augmentations\",\n name: \"Improve Gym Training\",\n effectText: (level: number): JSX.Element | null => <>Improves training by {level * 20}%,\n value: 20, // Improves training by value%\n },\n {\n costPerLevel: 200,\n desc: \"Exchange hashes for 1k Scientific Research in all of your Corporation's Industries\",\n name: \"Exchange for Corporation Research\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {level}k Scientific Research in your industries.\n ),\n value: 1000,\n },\n {\n costPerLevel: 250,\n desc: \"Exchange hashes for 100 Bladeburner Rank\",\n name: \"Exchange for Bladeburner Rank\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(100 * level, \"0a\")} Bladeburner rank\n ),\n value: 100,\n },\n {\n costPerLevel: 250,\n desc: \"Exchanges hashes for 10 Bladeburner Skill Points\",\n name: \"Exchange for Bladeburner SP\",\n effectText: (level: number): JSX.Element | null => (\n <>Acquired a total of {numeralWrapper.format(10 * level, \"0a\")} Bladeburner Skill Points\n ),\n value: 10,\n },\n {\n costPerLevel: 200,\n desc: \"Generate a random Coding Contract somewhere on the network\",\n name: \"Generate Coding Contract\",\n effectText: (level: number): JSX.Element | null => <>Generated {level} contracts.,\n value: 1,\n },\n];\n","import { NS } from \"../ScriptEditor/NetscriptDefinitions\";\n\n/**\n * The environment in which a script runs. The environment holds\n * Netscript functions and arguments for that script.\n */\nexport class Environment {\n /**\n * Whether or not the script that uses this Environment should stop running\n */\n stopFlag = false;\n\n /**\n * The currently running function\n */\n\n runningFn = \"\";\n\n /**\n * Environment variables (currently only Netscript functions)\n */\n vars: NS | null = null;\n}\n","/**\n * Determines if the number is a power of 2\n * @param n The number to check.\n */\nexport function isPowerOfTwo(n: number): boolean {\n if (isNaN(n)) {\n return false;\n }\n\n if (n === 0) {\n return false;\n }\n\n // Disabiling the bitwise rule because it's honestly the most effecient way to check for this.\n // tslint:disable-next-line:no-bitwise\n return (n & (n - 1)) === 0;\n}\n","import { ITaskParams } from \"../ITaskParams\";\n/* tslint:disable:max-line-length */\n\n/**\n * Defines the parameters that can be used to initialize and describe a GangMemberTask\n * (defined in Gang.js)\n */\ninterface IGangMemberTaskMetadata {\n /**\n * Description of the task\n */\n desc: string;\n\n /**\n * Whether or not this task is meant for Combat-type gangs\n */\n isCombat: boolean;\n\n /**\n * Whether or not this task is for Hacking-type gangs\n */\n isHacking: boolean;\n\n /**\n * Name of the task\n */\n name: string;\n\n /**\n * An object containing weighting parameters for the task. These parameters are used for\n * various calculations (respect gain, wanted gain, etc.)\n */\n params: ITaskParams;\n}\n\n/**\n * Array of metadata for all Gang Member tasks. Used to construct the global GangMemberTask\n * objects in Gang.js\n */\nexport const gangMemberTasksMetadata: IGangMemberTaskMetadata[] = [\n {\n desc: \"This gang member is currently idle\",\n isCombat: true,\n isHacking: true,\n name: \"Unassigned\",\n params: { hackWeight: 100 }, // This is just to get by the weight check in the GangMemberTask constructor\n },\n {\n desc: \"Assign this gang member to create and distribute ransomware

    Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ransomware\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.0001,\n baseMoney: 3,\n hackWeight: 100,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to attempt phishing scams and attacks

    Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Phishing\",\n params: {\n baseRespect: 0.00008,\n baseWanted: 0.003,\n baseMoney: 7.5,\n hackWeight: 85,\n chaWeight: 15,\n difficulty: 3.5,\n },\n },\n {\n desc: \"Assign this gang member to attempt identity theft

    Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Identity Theft\",\n params: {\n baseRespect: 0.0001,\n baseWanted: 0.075,\n baseMoney: 18,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 5,\n },\n },\n {\n desc: \"Assign this gang member to carry out DDoS attacks

    Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"DDoS Attacks\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.2,\n hackWeight: 100,\n difficulty: 8,\n },\n },\n {\n desc: \"Assign this gang member to create and distribute malicious viruses

    Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Plant Virus\",\n params: {\n baseRespect: 0.0006,\n baseWanted: 0.4,\n hackWeight: 100,\n difficulty: 12,\n },\n },\n {\n desc: \"Assign this gang member to commit financial fraud and digital counterfeiting

    Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Fraud & Counterfeiting\",\n params: {\n baseRespect: 0.0004,\n baseWanted: 0.3,\n baseMoney: 45,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to launder money

    Earns money - Increases respect - Increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Money Laundering\",\n params: {\n baseRespect: 0.001,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 75,\n chaWeight: 25,\n difficulty: 25,\n },\n },\n {\n desc: \"Assign this gang member to commit acts of cyberterrorism

    Greatly increases respect - Greatly increases wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Cyberterrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 80,\n chaWeight: 20,\n difficulty: 36,\n },\n },\n {\n desc: \"Assign this gang member to be an ethical hacker for corporations

    Earns money - Lowers wanted level\",\n isCombat: false,\n isHacking: true,\n name: \"Ethical Hacking\",\n params: {\n baseWanted: -0.001,\n baseMoney: 3,\n hackWeight: 90,\n chaWeight: 10,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to mug random people on the streets

    Earns money - Slightly increases respect - Very slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Mug People\",\n params: {\n baseRespect: 0.00005,\n baseWanted: 0.00005,\n baseMoney: 3.6,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 10,\n chaWeight: 15,\n difficulty: 1,\n },\n },\n {\n desc: \"Assign this gang member to sell drugs

    Earns money - Slightly increases respect - Slightly increases wanted level - Scales slightly with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Deal Drugs\",\n params: {\n baseRespect: 0.00006,\n baseWanted: 0.002,\n baseMoney: 15,\n agiWeight: 20,\n dexWeight: 20,\n chaWeight: 60,\n difficulty: 3.5,\n territory: {\n money: 1.2,\n respect: 1,\n wanted: 1.15,\n },\n },\n },\n {\n desc: \"Assign this gang member to extort civilians in your territory

    Earns money - Slightly increases respect - Increases wanted - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Strongarm Civilians\",\n params: {\n baseRespect: 0.00004,\n baseWanted: 0.02,\n baseMoney: 7.5,\n hackWeight: 10,\n strWeight: 25,\n defWeight: 25,\n dexWeight: 20,\n agiWeight: 10,\n chaWeight: 10,\n difficulty: 5,\n territory: {\n money: 1.6,\n respect: 1.1,\n wanted: 1.5,\n },\n },\n },\n {\n desc: \"Assign this gang member to run cons

    Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Run a Con\",\n params: {\n baseRespect: 0.00012,\n baseWanted: 0.05,\n baseMoney: 45,\n strWeight: 5,\n defWeight: 5,\n agiWeight: 25,\n dexWeight: 25,\n chaWeight: 40,\n difficulty: 14,\n },\n },\n {\n desc: \"Assign this gang member to commit armed robbery on stores, banks and armored cars

    Earns money - Increases respect - Increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Armed Robbery\",\n params: {\n baseRespect: 0.00014,\n baseWanted: 0.1,\n baseMoney: 114,\n hackWeight: 20,\n strWeight: 15,\n defWeight: 15,\n agiWeight: 10,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 20,\n },\n },\n {\n desc: \"Assign this gang member to traffick illegal arms

    Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Traffick Illegal Arms\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.24,\n baseMoney: 174,\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 25,\n difficulty: 32,\n territory: {\n money: 1.4,\n respect: 1.3,\n wanted: 1.25,\n },\n },\n },\n {\n desc: \"Assign this gang member to threaten and black mail high-profile targets

    Earns money - Slightly increases respect - Slightly increases wanted level\",\n isCombat: true,\n isHacking: false,\n name: \"Threaten & Blackmail\",\n params: {\n baseRespect: 0.0002,\n baseWanted: 0.125,\n baseMoney: 72,\n hackWeight: 25,\n strWeight: 25,\n dexWeight: 25,\n chaWeight: 25,\n difficulty: 28,\n },\n },\n {\n desc: \"Assign this gang member to engage in human trafficking operations

    Earns money - Increases respect - Increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Human Trafficking\",\n params: {\n baseRespect: 0.004,\n baseWanted: 1.25,\n baseMoney: 360,\n hackWeight: 30,\n strWeight: 5,\n defWeight: 5,\n dexWeight: 30,\n chaWeight: 30,\n difficulty: 36,\n territory: {\n money: 1.5,\n respect: 1.5,\n wanted: 1.6,\n },\n },\n },\n {\n desc: \"Assign this gang member to commit acts of terrorism

    Greatly increases respect - Greatly increases wanted level - Scales heavily with territory\",\n isCombat: true,\n isHacking: false,\n name: \"Terrorism\",\n params: {\n baseRespect: 0.01,\n baseWanted: 6,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n chaWeight: 20,\n difficulty: 36,\n territory: {\n money: 1,\n respect: 2,\n wanted: 2,\n },\n },\n },\n {\n desc: \"Assign this gang member to be a vigilante and protect the city from criminals

    Decreases wanted level\",\n isCombat: true,\n isHacking: true,\n name: \"Vigilante Justice\",\n params: {\n baseWanted: -0.001,\n hackWeight: 20,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n difficulty: 1,\n territory: {\n money: 1,\n respect: 1,\n wanted: 0.9, // Gets harder with more territory\n },\n },\n },\n {\n desc: \"Assign this gang member to increase their combat stats (str, def, dex, agi)\",\n isCombat: true,\n isHacking: true,\n name: \"Train Combat\",\n params: {\n strWeight: 25,\n defWeight: 25,\n dexWeight: 25,\n agiWeight: 25,\n difficulty: 100,\n },\n },\n {\n desc: \"Assign this gang member to train their hacking skills\",\n isCombat: true,\n isHacking: true,\n name: \"Train Hacking\",\n params: { hackWeight: 100, difficulty: 45 },\n },\n {\n desc: \"Assign this gang member to train their charisma\",\n isCombat: true,\n isHacking: true,\n name: \"Train Charisma\",\n params: { chaWeight: 100, difficulty: 8 },\n },\n {\n desc: \"Assign this gang member to engage in territorial warfare with other gangs. Members assigned to this task will help increase your gang's territory and will defend your territory from being taken.\",\n isCombat: true,\n isHacking: true,\n name: \"Territory Warfare\",\n params: {\n hackWeight: 15,\n strWeight: 20,\n defWeight: 20,\n dexWeight: 20,\n agiWeight: 20,\n chaWeight: 5,\n difficulty: 5,\n },\n },\n];\n","import { IMults, UpgradeType } from \"./data/upgrades\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nexport class GangMemberUpgrade {\n name: string;\n cost: number;\n type: UpgradeType;\n desc: string;\n mults: IMults;\n\n constructor(name = \"\", cost = 0, type: UpgradeType = UpgradeType.Weapon, mults: IMults = {}) {\n this.name = name;\n this.cost = cost;\n this.type = type;\n this.mults = mults;\n\n this.desc = this.createDescription();\n }\n\n createDescription(): string {\n const lines = [\"Effects:\"];\n if (this.mults.str != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.str - 1, 0)} strength skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.str - 1) / 4, 2)} strength exp`);\n }\n if (this.mults.def != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.def - 1, 0)} defense skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.def - 1) / 4, 2)} defense exp`);\n }\n if (this.mults.dex != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.dex - 1, 0)} dexterity skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.dex - 1) / 4, 2)} dexterity exp`);\n }\n if (this.mults.agi != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.agi - 1, 0)} agility skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.agi - 1) / 4, 2)} agility exp`);\n }\n if (this.mults.cha != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.cha - 1, 0)} charisma skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.cha - 1) / 4, 2)} charisma exp`);\n }\n if (this.mults.hack != null) {\n lines.push(`+${numeralWrapper.formatPercentage(this.mults.hack - 1, 0)} hacking skill`);\n lines.push(`+${numeralWrapper.formatPercentage((this.mults.hack - 1) / 4, 2)} hacking exp`);\n }\n return lines.join(\"
    \");\n }\n\n // User friendly version of type.\n getType(): string {\n switch (this.type) {\n case UpgradeType.Weapon:\n return \"Weapon\";\n case UpgradeType.Armor:\n return \"Armor\";\n case UpgradeType.Vehicle:\n return \"Vehicle\";\n case UpgradeType.Rootkit:\n return \"Rootkit\";\n case UpgradeType.Augmentation:\n return \"Augmentation\";\n default:\n return \"\";\n }\n }\n}\n","/**\n * Initialization metadata for all Stocks. This is used to generate the\n * stock parameter values upon a reset\n *\n * Some notes:\n * - Megacorporations have better otlkMags\n * - Higher volatility -> Bigger spread\n * - Lower price -> Bigger spread\n * - Share tx required for movement used for balancing\n */\nimport { StockSymbols } from \"./StockSymbols\";\nimport { IConstructorParams } from \"../Stock\";\nimport { LocationName } from \"../../Locations/data/LocationNames\";\n\nexport const InitStockMetadata: IConstructorParams[] = [\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 17e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.AevumECorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumECorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 34e3,\n min: 24e3,\n },\n marketCap: 2.4e12,\n mv: {\n divisor: 100,\n max: 50,\n min: 40,\n },\n name: LocationName.Sector12MegaCorp,\n otlkMag: 19,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12MegaCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 12e3,\n },\n marketCap: 1.6e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12BladeIndustries,\n otlkMag: 13,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12BladeIndustries],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 10e3,\n },\n marketCap: 1.5e12,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.AevumClarkeIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 5,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumClarkeIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 43e3,\n min: 32e3,\n },\n marketCap: 1.8e12,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.VolhavenOmniTekIncorporated,\n otlkMag: 12,\n spreadPerc: {\n divisor: 10,\n max: 6,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniTekIncorporated],\n },\n\n {\n b: true,\n initPrice: {\n max: 80e3,\n min: 50e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 110,\n min: 100,\n },\n name: LocationName.Sector12FourSigma,\n otlkMag: 17,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12FourSigma],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 16e3,\n },\n marketCap: 1.9e12,\n mv: {\n divisor: 100,\n max: 85,\n min: 75,\n },\n name: LocationName.ChongqingKuaiGongInternational,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 7,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.ChongqingKuaiGongInternational],\n },\n\n {\n b: true,\n initPrice: {\n max: 36e3,\n min: 29e3,\n },\n marketCap: 2e12,\n mv: {\n divisor: 100,\n max: 130,\n min: 120,\n },\n name: LocationName.AevumFulcrumTechnologies,\n otlkMag: 16,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 1,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.AevumFulcrumTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 25e3,\n min: 20e3,\n },\n marketCap: 1.2e12,\n mv: {\n divisor: 100,\n max: 90,\n min: 80,\n },\n name: LocationName.IshimaStormTechnologies,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.IshimaStormTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 19e3,\n min: 6e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.NewTokyoDefComm,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoDefComm],\n },\n\n {\n b: true,\n initPrice: {\n max: 18e3,\n min: 10e3,\n },\n marketCap: 825e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.VolhavenHeliosLabs,\n otlkMag: 9,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenHeliosLabs],\n },\n\n {\n b: true,\n initPrice: {\n max: 14e3,\n min: 8e3,\n },\n marketCap: 1e12,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.NewTokyoVitaLife,\n otlkMag: 7,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoVitaLife],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 800e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 60,\n },\n name: LocationName.Sector12IcarusMicrosystems,\n otlkMag: 7.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12IcarusMicrosystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 29e3,\n min: 16e3,\n },\n marketCap: 900e9,\n mv: {\n divisor: 100,\n max: 60,\n min: 50,\n },\n name: LocationName.Sector12UniversalEnergy,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.Sector12UniversalEnergy],\n },\n\n {\n b: true,\n initPrice: {\n max: 17e3,\n min: 8e3,\n },\n marketCap: 640e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.AevumAeroCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.AevumAeroCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 15e3,\n min: 6e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 75,\n min: 65,\n },\n name: LocationName.VolhavenOmniaCybersystems,\n otlkMag: 4.5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.VolhavenOmniaCybersystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 28e3,\n min: 14e3,\n },\n marketCap: 705e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.ChongqingSolarisSpaceSystems,\n otlkMag: 8.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.ChongqingSolarisSpaceSystems],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 12e3,\n },\n marketCap: 695e9,\n mv: {\n divisor: 100,\n max: 65,\n min: 55,\n },\n name: LocationName.NewTokyoGlobalPharmaceuticals,\n otlkMag: 10.5,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.NewTokyoGlobalPharmaceuticals],\n },\n\n {\n b: true,\n initPrice: {\n max: 27e3,\n min: 15e3,\n },\n marketCap: 600e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.IshimaNovaMedical,\n otlkMag: 5,\n spreadPerc: {\n divisor: 10,\n max: 11,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 42e3,\n },\n symbol: StockSymbols[LocationName.IshimaNovaMedical],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 450e9,\n mv: {\n divisor: 100,\n max: 260,\n min: 240,\n },\n name: LocationName.AevumWatchdogSecurity,\n otlkMag: 1.5,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 12e3,\n },\n symbol: StockSymbols[LocationName.AevumWatchdogSecurity],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 4.5e3,\n },\n marketCap: 300e9,\n mv: {\n divisor: 100,\n max: 135,\n min: 115,\n },\n name: LocationName.VolhavenLexoCorp,\n otlkMag: 6,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 108e3,\n min: 36e3,\n },\n symbol: StockSymbols[LocationName.VolhavenLexoCorp],\n },\n\n {\n b: true,\n initPrice: {\n max: 7e3,\n min: 2e3,\n },\n marketCap: 180e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: LocationName.AevumRhoConstruction,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.AevumRhoConstruction],\n },\n\n {\n b: true,\n initPrice: {\n max: 8.5e3,\n min: 4e3,\n },\n marketCap: 240e9,\n mv: {\n divisor: 100,\n max: 205,\n min: 175,\n },\n name: LocationName.Sector12AlphaEnterprises,\n otlkMag: 10,\n spreadPerc: {\n divisor: 10,\n max: 16,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.Sector12AlphaEnterprises],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 3e3,\n },\n marketCap: 200e9,\n mv: {\n divisor: 100,\n max: 170,\n min: 150,\n },\n name: LocationName.VolhavenSysCoreSecurities,\n otlkMag: 3,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 5,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.VolhavenSysCoreSecurities],\n },\n\n {\n b: true,\n initPrice: {\n max: 6e3,\n min: 1e3,\n },\n marketCap: 185e9,\n mv: {\n divisor: 100,\n max: 100,\n min: 80,\n },\n name: LocationName.VolhavenCompuTek,\n otlkMag: 4,\n spreadPerc: {\n divisor: 10,\n max: 12,\n min: 4,\n },\n shareTxForMovement: {\n max: 126e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.VolhavenCompuTek],\n },\n\n {\n b: true,\n initPrice: {\n max: 5e3,\n min: 1e3,\n },\n marketCap: 58e9,\n mv: {\n divisor: 100,\n max: 400,\n min: 200,\n },\n name: LocationName.AevumNetLinkTechnologies,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 20,\n min: 5,\n },\n shareTxForMovement: {\n max: 54e3,\n min: 18e3,\n },\n symbol: StockSymbols[LocationName.AevumNetLinkTechnologies],\n },\n\n {\n b: true,\n initPrice: {\n max: 8e3,\n min: 1e3,\n },\n marketCap: 60e9,\n mv: {\n divisor: 100,\n max: 110,\n min: 90,\n },\n name: LocationName.IshimaOmegaSoftware,\n otlkMag: 0.5,\n spreadPerc: {\n divisor: 10,\n max: 13,\n min: 4,\n },\n shareTxForMovement: {\n max: 90e3,\n min: 30e3,\n },\n symbol: StockSymbols[LocationName.IshimaOmegaSoftware],\n },\n\n {\n b: false,\n initPrice: {\n max: 4.5e3,\n min: 500,\n },\n marketCap: 45e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: LocationName.Sector12FoodNStuff,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 6,\n },\n shareTxForMovement: {\n max: 180e3,\n min: 60e3,\n },\n symbol: StockSymbols[LocationName.Sector12FoodNStuff],\n },\n\n {\n b: true,\n initPrice: {\n max: 3.5e3,\n min: 1.5e3,\n },\n marketCap: 30e9,\n mv: {\n divisor: 100,\n max: 275,\n min: 100,\n },\n name: \"Sigma Cosmetics\",\n otlkMag: 0,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 70e3,\n min: 20e3,\n },\n symbol: StockSymbols[\"Sigma Cosmetics\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 42e9,\n mv: {\n divisor: 100,\n max: 350,\n min: 200,\n },\n name: LocationName.Sector12JoesGuns,\n otlkMag: 1,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 6,\n },\n shareTxForMovement: {\n max: 52e3,\n min: 15e3,\n },\n symbol: StockSymbols[LocationName.Sector12JoesGuns],\n },\n\n {\n b: true,\n initPrice: {\n max: 1.5e3,\n min: 250,\n },\n marketCap: 100e9,\n mv: {\n divisor: 100,\n max: 175,\n min: 120,\n },\n name: \"Catalyst Ventures\",\n otlkMag: 13.5,\n spreadPerc: {\n divisor: 10,\n max: 14,\n min: 5,\n },\n shareTxForMovement: {\n max: 72e3,\n min: 24e3,\n },\n symbol: StockSymbols[\"Catalyst Ventures\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 30e3,\n min: 15e3,\n },\n marketCap: 360e9,\n mv: {\n divisor: 100,\n max: 80,\n min: 70,\n },\n name: \"Microdyne Technologies\",\n otlkMag: 8,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 3,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Microdyne Technologies\"],\n },\n\n {\n b: true,\n initPrice: {\n max: 24e3,\n min: 12e3,\n },\n marketCap: 420e9,\n mv: {\n divisor: 100,\n max: 70,\n min: 50,\n },\n name: \"Titan Laboratories\",\n otlkMag: 11,\n spreadPerc: {\n divisor: 10,\n max: 10,\n min: 2,\n },\n shareTxForMovement: {\n max: 216e3,\n min: 90e3,\n },\n symbol: StockSymbols[\"Titan Laboratories\"],\n },\n];\n","import { FactionNames } from \"../Faction/data/FactionNames\";\nimport { GangConstants } from \"../Gang/data/Constants\";\nimport { Player as player } from \"../Player\";\nimport { Gang } from \"../Gang/Gang\";\nimport { AllGangs } from \"../Gang/AllGangs\";\nimport { GangMemberTasks } from \"../Gang/GangMemberTasks\";\nimport { GangMemberUpgrades } from \"../Gang/GangMemberUpgrades\";\nimport { GangMember } from \"../Gang/GangMember\";\nimport { GangMemberTask } from \"../Gang/GangMemberTask\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nimport {\n Gang as IGang,\n GangGenInfo,\n GangOtherInfo,\n GangMemberInfo,\n GangMemberAscension,\n EquipmentStats,\n GangTaskStats,\n GangOtherInfoObject,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\n\nexport function NetscriptGang(): InternalAPI {\n const checkGangApiAccess = function (ctx: NetscriptContext): void {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n const hasAccess = gang instanceof Gang;\n if (!hasAccess) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You do not currently have a Gang`);\n }\n };\n\n const getGangMember = function (ctx: NetscriptContext, name: string): GangMember {\n const gang = player.gang;\n if (gang === null) throw new Error(\"Must have joined gang\");\n for (const member of gang.members) if (member.name === name) return member;\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid gang member: '${name}'`);\n };\n\n const getGangTask = function (ctx: NetscriptContext, name: string): GangMemberTask {\n const task = GangMemberTasks[name];\n if (!task) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid task: '${name}'`);\n }\n\n return task;\n };\n\n return {\n createGang:\n (ctx: NetscriptContext) =>\n (_faction: unknown): boolean => {\n const faction = helpers.string(ctx, \"faction\", _faction);\n // this list is copied from Faction/ui/Root.tsx\n\n if (!player.canAccessGang() || !GangConstants.Names.includes(faction)) return false;\n if (player.inGang()) return false;\n if (!player.factions.includes(faction)) return false;\n\n const isHacking = faction === FactionNames.NiteSec || faction === FactionNames.TheBlackHand;\n player.startGang(faction, isHacking);\n return true;\n },\n inGang: () => (): boolean => {\n return player.inGang();\n },\n getMemberNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.members.map((member) => member.name);\n },\n getGangInformation: (ctx: NetscriptContext) => (): GangGenInfo => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return {\n faction: gang.facName,\n isHacking: gang.isHackingGang,\n moneyGainRate: gang.moneyGainRate,\n power: gang.getPower(),\n respect: gang.respect,\n respectGainRate: gang.respectGainRate,\n territory: gang.getTerritory(),\n territoryClashChance: gang.territoryClashChance,\n territoryWarfareEngaged: gang.territoryWarfareEngaged,\n wantedLevel: gang.wanted,\n wantedLevelGainRate: gang.wantedGainRate,\n wantedPenalty: gang.getWantedPenalty(),\n };\n },\n getOtherGangInformation: (ctx: NetscriptContext) => (): GangOtherInfo => {\n checkGangApiAccess(ctx);\n const cpy: Record = {};\n for (const gang of Object.keys(AllGangs)) {\n cpy[gang] = Object.assign({}, AllGangs[gang]);\n }\n\n return cpy;\n },\n getMemberInformation:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberInfo => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n return {\n name: member.name,\n task: member.task,\n earnedRespect: member.earnedRespect,\n hack: member.hack,\n str: member.str,\n def: member.def,\n dex: member.dex,\n agi: member.agi,\n cha: member.cha,\n\n hack_exp: member.hack_exp,\n str_exp: member.str_exp,\n def_exp: member.def_exp,\n dex_exp: member.dex_exp,\n agi_exp: member.agi_exp,\n cha_exp: member.cha_exp,\n\n hack_mult: member.hack_mult,\n str_mult: member.str_mult,\n def_mult: member.def_mult,\n dex_mult: member.dex_mult,\n agi_mult: member.agi_mult,\n cha_mult: member.cha_mult,\n\n hack_asc_mult: member.calculateAscensionMult(member.hack_asc_points),\n str_asc_mult: member.calculateAscensionMult(member.str_asc_points),\n def_asc_mult: member.calculateAscensionMult(member.def_asc_points),\n dex_asc_mult: member.calculateAscensionMult(member.dex_asc_points),\n agi_asc_mult: member.calculateAscensionMult(member.agi_asc_points),\n cha_asc_mult: member.calculateAscensionMult(member.cha_asc_points),\n\n hack_asc_points: member.hack_asc_points,\n str_asc_points: member.str_asc_points,\n def_asc_points: member.def_asc_points,\n dex_asc_points: member.dex_asc_points,\n agi_asc_points: member.agi_asc_points,\n cha_asc_points: member.cha_asc_points,\n\n upgrades: member.upgrades.slice(),\n augmentations: member.augmentations.slice(),\n\n respectGain: member.calculateRespectGain(gang),\n wantedLevelGain: member.calculateWantedLevelGain(gang),\n moneyGain: member.calculateMoneyGain(gang),\n };\n },\n canRecruitMember: (ctx: NetscriptContext) => (): boolean => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return gang.canRecruitMember();\n },\n recruitMember:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): boolean => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const recruited = gang.recruitMember(memberName);\n if (recruited) {\n ctx.workerScript.log(\"gang.recruitMember\", () => `Successfully recruited Gang Member '${memberName}'`);\n } else {\n ctx.workerScript.log(\"gang.recruitMember\", () => `Failed to recruit Gang Member '${memberName}'`);\n }\n\n return recruited;\n },\n getTaskNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const tasks = gang.getAllTaskNames();\n tasks.unshift(\"Unassigned\");\n return tasks;\n },\n setMemberTask:\n (ctx: NetscriptContext) =>\n (_memberName: unknown, _taskName: unknown): boolean => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const taskName = helpers.string(ctx, \"taskName\", _taskName);\n checkGangApiAccess(ctx);\n const member = getGangMember(ctx, memberName);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (!gang.getAllTaskNames().includes(taskName)) {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () =>\n `Failed to assign Gang Member '${memberName}' to Invalid task '${taskName}'. '${memberName}' is now Unassigned`,\n );\n return member.assignToTask(\"Unassigned\");\n }\n const success = member.assignToTask(taskName);\n if (success) {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () => `Successfully assigned Gang Member '${memberName}' to '${taskName}' task`,\n );\n } else {\n ctx.workerScript.log(\n \"gang.setMemberTask\",\n () =>\n `Failed to assign Gang Member '${memberName}' to '${taskName}' task. '${memberName}' is now Unassigned`,\n );\n }\n\n return success;\n },\n getTaskStats:\n (ctx: NetscriptContext) =>\n (_taskName: unknown): GangTaskStats => {\n const taskName = helpers.string(ctx, \"taskName\", _taskName);\n checkGangApiAccess(ctx);\n const task = getGangTask(ctx, taskName);\n const copy = Object.assign({}, task);\n copy.territory = Object.assign({}, task.territory);\n return copy;\n },\n getEquipmentNames: (ctx: NetscriptContext) => (): string[] => {\n checkGangApiAccess(ctx);\n return Object.keys(GangMemberUpgrades);\n },\n getEquipmentCost:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): number => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const upg = GangMemberUpgrades[equipName];\n if (upg === null) return Infinity;\n return gang.getUpgradeCost(upg);\n },\n getEquipmentType:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): string => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const upg = GangMemberUpgrades[equipName];\n if (upg == null) return \"\";\n return upg.getType();\n },\n getEquipmentStats:\n (ctx: NetscriptContext) =>\n (_equipName: unknown): EquipmentStats => {\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid equipment: ${equipName}`);\n }\n const typecheck: EquipmentStats = equipment.mults;\n return Object.assign({}, typecheck) as any;\n },\n purchaseEquipment:\n (ctx: NetscriptContext) =>\n (_memberName: unknown, _equipName: unknown): boolean => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n const equipName = helpers.string(ctx, \"equipName\", _equipName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n const equipment = GangMemberUpgrades[equipName];\n if (!equipment) return false;\n const res = member.buyUpgrade(equipment, player, gang);\n if (res) {\n ctx.workerScript.log(\n \"gang.purchaseEquipment\",\n () => `Purchased '${equipName}' for Gang member '${memberName}'`,\n );\n } else {\n ctx.workerScript.log(\n \"gang.purchaseEquipment\",\n () => `Failed to purchase '${equipName}' for Gang member '${memberName}'`,\n );\n }\n\n return res;\n },\n ascendMember:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return gang.ascendMember(member, ctx.workerScript);\n },\n getAscensionResult:\n (ctx: NetscriptContext) =>\n (_memberName: unknown): GangMemberAscension | undefined => {\n const memberName = helpers.string(ctx, \"memberName\", _memberName);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n const member = getGangMember(ctx, memberName);\n if (!member.canAscend()) return;\n return {\n respect: member.earnedRespect,\n ...member.getAscensionResults(),\n };\n },\n setTerritoryWarfare:\n (ctx: NetscriptContext) =>\n (_engage: unknown): void => {\n const engage = !!_engage;\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (engage) {\n gang.territoryWarfareEngaged = true;\n ctx.workerScript.log(\"gang.setTerritoryWarfare\", () => \"Engaging in Gang Territory Warfare\");\n } else {\n gang.territoryWarfareEngaged = false;\n ctx.workerScript.log(\"gang.setTerritoryWarfare\", () => \"Disengaging in Gang Territory Warfare\");\n }\n },\n getChanceToWinClash:\n (ctx: NetscriptContext) =>\n (_otherGang: unknown): number => {\n const otherGang = helpers.string(ctx, \"otherGang\", _otherGang);\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n if (AllGangs[otherGang] == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid gang: ${otherGang}`);\n }\n\n const playerPower = AllGangs[gang.facName].power;\n const otherPower = AllGangs[otherGang].power;\n\n return playerPower / (otherPower + playerPower);\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkGangApiAccess(ctx);\n const gang = player.gang;\n if (gang === null) throw new Error(\"Should not be called without Gang\");\n return Math.round(gang.storedCycles / 5) * 1000;\n },\n };\n}\n","import { FactionNames } from \"../../Faction/data/FactionNames\";\nexport const PowerMultiplier: {\n [key: string]: number | undefined;\n} = {\n [FactionNames.SlumSnakes]: 1,\n [FactionNames.Tetrads]: 2,\n [FactionNames.TheSyndicate]: 2,\n [FactionNames.TheDarkArmy]: 2,\n [FactionNames.SpeakersForTheDead]: 5,\n [FactionNames.NiteSec]: 2,\n [FactionNames.TheBlackHand]: 5,\n};\n","import { Player as player } from \"../Player\";\nimport { findSleevePurchasableAugs } from \"../PersonObjects/Sleeve/SleeveHelpers\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { findCrime } from \"../Crime/CrimeHelpers\";\nimport { Augmentation } from \"../Augmentation/Augmentation\";\n\nimport {\n AugmentPair,\n Sleeve as ISleeve,\n SleeveInformation,\n SleeveSkills,\n SleeveTask,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { isSleeveBladeburnerWork } from \"../PersonObjects/Sleeve/Work/SleeveBladeburnerWork\";\nimport { isSleeveFactionWork } from \"../PersonObjects/Sleeve/Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../PersonObjects/Sleeve/Work/SleeveCompanyWork\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptSleeve(): InternalAPI {\n const checkSleeveAPIAccess = function (ctx: NetscriptContext): void {\n if (player.bitNodeN !== 10 && !player.sourceFileLvl(10)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You do not currently have access to the Sleeve API. This is either because you are not in BitNode-10 or because you do not have Source-File 10\",\n );\n }\n };\n\n const checkSleeveNumber = function (ctx: NetscriptContext, sleeveNumber: number): void {\n if (sleeveNumber >= player.sleeves.length || sleeveNumber < 0) {\n const msg = `Invalid sleeve number: ${sleeveNumber}`;\n helpers.log(ctx, () => msg);\n throw helpers.makeRuntimeErrorMsg(ctx, msg);\n }\n };\n\n const getSleeveStats = function (sleeveNumber: number): SleeveSkills {\n const sl = player.sleeves[sleeveNumber];\n return {\n shock: 100 - sl.shock,\n sync: sl.sync,\n memory: sl.memory,\n hacking: sl.skills.hacking,\n strength: sl.skills.strength,\n defense: sl.skills.defense,\n dexterity: sl.skills.dexterity,\n agility: sl.skills.agility,\n charisma: sl.skills.charisma,\n };\n };\n\n return {\n getNumSleeves: (ctx: NetscriptContext) => (): number => {\n checkSleeveAPIAccess(ctx);\n return player.sleeves.length;\n },\n setToShockRecovery:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].shockRecovery(player);\n },\n setToSynchronize:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].synchronize(player);\n },\n setToCommitCrime:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _crimeRoughName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const crimeRoughName = helpers.string(ctx, \"crimeName\", _crimeRoughName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n const crime = findCrime(crimeRoughName);\n if (crime === null) {\n return false;\n }\n return player.sleeves[sleeveNumber].commitCrime(player, crime.name);\n },\n setToUniversityCourse:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _universityName: unknown, _className: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const universityName = helpers.string(ctx, \"universityName\", _universityName);\n const className = helpers.string(ctx, \"className\", _className);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return player.sleeves[sleeveNumber].takeUniversityCourse(player, universityName, className);\n },\n travel:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _cityName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n if (checkEnum(CityName, cityName)) {\n return player.sleeves[sleeveNumber].travel(player, cityName);\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid city name: '${cityName}'.`);\n }\n },\n setToCompanyWork:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, acompanyName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const companyName = helpers.string(ctx, \"companyName\", acompanyName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot work at the same company that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (isSleeveCompanyWork(other.currentWork) && other.currentWork.companyName === companyName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for company ${companyName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n return player.sleeves[sleeveNumber].workForCompany(player, companyName);\n },\n setToFactionWork:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _factionName: unknown, _workType: unknown): boolean | undefined => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const factionName = helpers.string(ctx, \"factionName\", _factionName);\n const workType = helpers.string(ctx, \"workType\", _workType);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot work at the same faction that another sleeve is working at\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (isSleeveFactionWork(other.currentWork) && other.currentWork.factionName === factionName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because Sleeve ${i} is already working for them.`,\n );\n }\n }\n\n if (player.gang && player.gang.facName == factionName) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot work for faction ${factionName} because you have started a gang with them.`,\n );\n }\n\n return player.sleeves[sleeveNumber].workForFaction(player, factionName, workType);\n },\n setToGymWorkout:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _gymName: unknown, _stat: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const gymName = helpers.string(ctx, \"gymName\", _gymName);\n const stat = helpers.string(ctx, \"stat\", _stat);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n return player.sleeves[sleeveNumber].workoutAtGym(player, gymName, stat);\n },\n getSleeveStats:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveSkills => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n return getSleeveStats(sleeveNumber);\n },\n getTask:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveTask | null => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n if (sl.currentWork === null) return null;\n return sl.currentWork.APICopy();\n },\n getInformation:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): SleeveInformation => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const sl = player.sleeves[sleeveNumber];\n return {\n tor: false,\n city: sl.city,\n hp: sl.hp,\n jobs: Object.keys(player.jobs), // technically sleeves have the same jobs as the player.\n jobTitle: Object.values(player.jobs),\n\n mult: {\n agility: sl.mults.agility,\n agilityExp: sl.mults.agility_exp,\n charisma: sl.mults.charisma,\n charismaExp: sl.mults.charisma_exp,\n companyRep: sl.mults.company_rep,\n crimeMoney: sl.mults.crime_money,\n crimeSuccess: sl.mults.crime_success,\n defense: sl.mults.defense,\n defenseExp: sl.mults.defense_exp,\n dexterity: sl.mults.dexterity,\n dexterityExp: sl.mults.dexterity_exp,\n factionRep: sl.mults.faction_rep,\n hacking: sl.mults.hacking,\n hackingExp: sl.mults.hacking_exp,\n strength: sl.mults.strength,\n strengthExp: sl.mults.strength_exp,\n workMoney: sl.mults.work_money,\n },\n };\n },\n getSleeveAugmentations:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): string[] => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const augs = [];\n for (let i = 0; i < player.sleeves[sleeveNumber].augmentations.length; i++) {\n augs.push(player.sleeves[sleeveNumber].augmentations[i].name);\n }\n return augs;\n },\n getSleevePurchasableAugs:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown): AugmentPair[] => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n const purchasableAugs = findSleevePurchasableAugs(player.sleeves[sleeveNumber], player);\n const augs = [];\n for (let i = 0; i < purchasableAugs.length; i++) {\n const aug = purchasableAugs[i];\n augs.push({\n name: aug.name,\n cost: aug.baseCost,\n });\n }\n\n return augs;\n },\n purchaseSleeveAug:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _augName: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n if (getSleeveStats(sleeveNumber).shock > 0) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Sleeve shock too high: Sleeve ${sleeveNumber}`);\n }\n\n const aug = StaticAugmentations[augName];\n if (!aug) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n\n return player.sleeves[sleeveNumber].tryBuyAugmentation(player, aug);\n },\n getSleeveAugmentationPrice:\n (ctx: NetscriptContext) =>\n (_augName: unknown): number => {\n checkSleeveAPIAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug: Augmentation = StaticAugmentations[augName];\n return aug.baseCost;\n },\n getSleeveAugmentationRepReq:\n (ctx: NetscriptContext) =>\n (_augName: unknown): number => {\n checkSleeveAPIAccess(ctx);\n const augName = helpers.string(ctx, \"augName\", _augName);\n const aug: Augmentation = StaticAugmentations[augName];\n return aug.getCost(player).repCost;\n },\n setToBladeburnerAction:\n (ctx: NetscriptContext) =>\n (_sleeveNumber: unknown, _action: unknown, _contract?: unknown): boolean => {\n const sleeveNumber = helpers.number(ctx, \"sleeveNumber\", _sleeveNumber);\n const action = helpers.string(ctx, \"action\", _action);\n let contract: string;\n if (typeof _contract === \"undefined\") {\n contract = \"------\";\n } else {\n contract = helpers.string(ctx, \"contract\", _contract);\n }\n checkSleeveAPIAccess(ctx);\n checkSleeveNumber(ctx, sleeveNumber);\n\n // Cannot Take on Contracts if another sleeve is performing that action\n if (action === \"Take on contracts\") {\n for (let i = 0; i < player.sleeves.length; ++i) {\n if (i === sleeveNumber) {\n continue;\n }\n const other = player.sleeves[i];\n if (isSleeveBladeburnerWork(other.currentWork) && other.currentWork.actionName === contract) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Sleeve ${sleeveNumber} cannot take on contracts because Sleeve ${i} is already performing that action.`,\n );\n }\n }\n }\n\n return player.sleeves[sleeveNumber].bladeburner(player, action, contract);\n },\n };\n}\n","// Metadata used for constructing Company Positions\nimport { IConstructorParams } from \"../CompanyPosition\";\nimport * as posNames from \"./companypositionnames\";\n\nexport const companyPositionMetadata: IConstructorParams[] = [\n {\n name: posNames.SoftwareCompanyPositions[0], // Software Enginering Intern\n nextPosition: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n baseSalary: 33,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.05,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.SoftwareCompanyPositions[1], // Junior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n baseSalary: 80,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.1,\n reqdHacking: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SoftwareCompanyPositions[2], // Senior Software Engineer\n nextPosition: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n baseSalary: 165,\n charismaEffectiveness: 20,\n charismaExpGain: 0.08,\n hackingEffectiveness: 80,\n hackingExpGain: 0.4,\n reqdCharisma: 51,\n reqdHacking: 251,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.SoftwareCompanyPositions[3], // Lead Software Developer\n nextPosition: posNames.SoftwareCompanyPositions[4], // Head of Software\n baseSalary: 500,\n charismaEffectiveness: 25,\n charismaExpGain: 0.1,\n hackingEffectiveness: 75,\n hackingExpGain: 0.8,\n reqdCharisma: 151,\n reqdHacking: 401,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.SoftwareCompanyPositions[4], // Head of Software\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 800,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 400e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n nextPosition: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n baseSalary: 1650,\n charismaEffectiveness: 25,\n charismaExpGain: 0.5,\n hackingEffectiveness: 75,\n hackingExpGain: 1.1,\n reqdCharisma: 251,\n reqdHacking: 501,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.SoftwareCompanyPositions[6], // Vice President of Technology\n nextPosition: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n baseSalary: 2310,\n charismaEffectiveness: 30,\n charismaExpGain: 0.6,\n hackingEffectiveness: 70,\n hackingExpGain: 1.2,\n reqdCharisma: 401,\n reqdHacking: 601,\n reqdReputation: 1.6e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SoftwareCompanyPositions[7], // Chief Technology Officer\n nextPosition: null,\n baseSalary: 2640,\n charismaEffectiveness: 35,\n charismaExpGain: 1,\n hackingEffectiveness: 65,\n hackingExpGain: 1.5,\n reqdCharisma: 501,\n reqdHacking: 751,\n reqdReputation: 3.2e6,\n repMultiplier: 2,\n },\n {\n name: posNames.ITCompanyPositions[0], // IT Intern\n nextPosition: posNames.ITCompanyPositions[1], // IT Analyst\n baseSalary: 26,\n charismaEffectiveness: 10,\n charismaExpGain: 0.01,\n hackingEffectiveness: 90,\n hackingExpGain: 0.04,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.ITCompanyPositions[1], // IT Analyst\n nextPosition: posNames.ITCompanyPositions[2], // IT Manager\n baseSalary: 66,\n charismaEffectiveness: 15,\n charismaExpGain: 0.02,\n hackingEffectiveness: 85,\n hackingExpGain: 0.08,\n reqdHacking: 26,\n reqdReputation: 7e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.ITCompanyPositions[2], // IT Manager\n nextPosition: posNames.ITCompanyPositions[3], // Systems Administrator\n baseSalary: 132,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.3,\n reqdCharisma: 51,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.ITCompanyPositions[3], // Systems Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.2,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.SecurityEngineerCompanyPositions[0], // Security Engineer\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[0], // Network Engineer\n nextPosition: posNames.NetworkEngineerCompanyPositions[1], // Network Adminsitrator\n baseSalary: 121,\n charismaEffectiveness: 15,\n charismaExpGain: 0.05,\n hackingEffectiveness: 85,\n hackingExpGain: 0.4,\n reqdCharisma: 26,\n reqdHacking: 151,\n reqdReputation: 35e3,\n repMultiplier: 1.2,\n },\n {\n name: posNames.NetworkEngineerCompanyPositions[1], // Network Administrator\n nextPosition: posNames.SoftwareCompanyPositions[5], // Head of Engineering\n baseSalary: 410,\n charismaEffectiveness: 20,\n charismaExpGain: 0.1,\n hackingEffectiveness: 80,\n hackingExpGain: 0.5,\n reqdCharisma: 76,\n reqdHacking: 251,\n reqdReputation: 175e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[0], // Business Intern\n nextPosition: posNames.BusinessCompanyPositions[1], // Business Analyst\n baseSalary: 46,\n charismaEffectiveness: 90,\n charismaExpGain: 0.08,\n hackingEffectiveness: 10,\n hackingExpGain: 0.01,\n reqdCharisma: 1,\n reqdHacking: 1,\n repMultiplier: 0.9,\n },\n {\n name: posNames.BusinessCompanyPositions[1], // Business Analyst\n nextPosition: posNames.BusinessCompanyPositions[2], // Business Manager\n baseSalary: 100,\n charismaEffectiveness: 85,\n charismaExpGain: 0.15,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 51,\n reqdHacking: 6,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.BusinessCompanyPositions[2], // Business Manager\n nextPosition: posNames.BusinessCompanyPositions[3], // Operations Manager\n baseSalary: 200,\n charismaEffectiveness: 85,\n charismaExpGain: 0.3,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 101,\n reqdHacking: 51,\n reqdReputation: 40e3,\n repMultiplier: 1.3,\n },\n {\n name: posNames.BusinessCompanyPositions[3], // Operations Manager\n nextPosition: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n baseSalary: 660,\n charismaEffectiveness: 85,\n charismaExpGain: 0.4,\n hackingEffectiveness: 15,\n hackingExpGain: 0.02,\n reqdCharisma: 226,\n reqdHacking: 51,\n reqdReputation: 200e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.BusinessCompanyPositions[4], // Chief Financial Officer\n nextPosition: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n baseSalary: 1950,\n charismaEffectiveness: 90,\n charismaExpGain: 1,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 501,\n reqdHacking: 76,\n reqdReputation: 800e3,\n repMultiplier: 1.6,\n },\n {\n name: posNames.BusinessCompanyPositions[5], // Chief Executive Officer\n nextPosition: null,\n baseSalary: 3900,\n charismaEffectiveness: 90,\n charismaExpGain: 1.5,\n hackingEffectiveness: 10,\n hackingExpGain: 0.05,\n reqdCharisma: 751,\n reqdHacking: 101,\n reqdReputation: 3.2e6,\n repMultiplier: 1.75,\n },\n {\n name: posNames.SecurityCompanyPositions[0], // Police Officer\n nextPosition: posNames.SecurityCompanyPositions[1], // Police Chief\n baseSalary: 82,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.04,\n reqdHacking: 11,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[1], // Police Chief\n nextPosition: null,\n baseSalary: 460,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.1,\n reqdHacking: 101,\n reqdStrength: 301,\n reqdDefense: 301,\n reqdDexterity: 301,\n reqdAgility: 301,\n reqdCharisma: 151,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[2], // Security Guard\n nextPosition: posNames.SecurityCompanyPositions[3], // Security Officer\n baseSalary: 50,\n hackingEffectiveness: 5,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.01,\n strengthExpGain: 0.04,\n defenseExpGain: 0.04,\n dexterityExpGain: 0.04,\n agilityExpGain: 0.04,\n charismaExpGain: 0.02,\n reqdStrength: 51,\n reqdDefense: 51,\n reqdDexterity: 51,\n reqdAgility: 51,\n reqdCharisma: 1,\n repMultiplier: 1,\n },\n {\n name: posNames.SecurityCompanyPositions[3], // Security Officer\n nextPosition: posNames.SecurityCompanyPositions[4], // Security Supervisor\n baseSalary: 195,\n hackingEffectiveness: 10,\n strengthEffectiveness: 20,\n defenseEffectiveness: 20,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 10,\n hackingExpGain: 0.02,\n strengthExpGain: 0.1,\n defenseExpGain: 0.1,\n dexterityExpGain: 0.1,\n agilityExpGain: 0.1,\n charismaExpGain: 0.05,\n reqdHacking: 26,\n reqdStrength: 151,\n reqdDefense: 151,\n reqdDexterity: 151,\n reqdAgility: 151,\n reqdCharisma: 51,\n reqdReputation: 8e3,\n repMultiplier: 1.1,\n },\n {\n name: posNames.SecurityCompanyPositions[4], // Security Supervisor\n nextPosition: posNames.SecurityCompanyPositions[5], // Head of Security\n baseSalary: 660,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.02,\n strengthExpGain: 0.12,\n defenseExpGain: 0.12,\n dexterityExpGain: 0.12,\n agilityExpGain: 0.12,\n charismaExpGain: 0.1,\n reqdHacking: 26,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 101,\n reqdReputation: 36e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.SecurityCompanyPositions[5], // Head of Security\n nextPosition: null,\n baseSalary: 1320,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 15,\n agilityEffectiveness: 15,\n charismaEffectiveness: 30,\n hackingExpGain: 0.05,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.15,\n reqdHacking: 51,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 151,\n reqdReputation: 144e3,\n repMultiplier: 1.4,\n },\n {\n name: posNames.AgentCompanyPositions[0], // Field Agent\n nextPosition: posNames.AgentCompanyPositions[1], // Secret Agent\n baseSalary: 330,\n hackingEffectiveness: 10,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 20,\n hackingExpGain: 0.04,\n strengthExpGain: 0.08,\n defenseExpGain: 0.08,\n dexterityExpGain: 0.08,\n agilityExpGain: 0.08,\n charismaExpGain: 0.05,\n reqdHacking: 101,\n reqdStrength: 101,\n reqdDefense: 101,\n reqdDexterity: 101,\n reqdAgility: 101,\n reqdCharisma: 101,\n reqdReputation: 8e3,\n repMultiplier: 1,\n },\n {\n name: posNames.AgentCompanyPositions[1], // Secret Agent\n nextPosition: posNames.AgentCompanyPositions[2], // Special Operative\n baseSalary: 990,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.1,\n strengthExpGain: 0.15,\n defenseExpGain: 0.15,\n dexterityExpGain: 0.15,\n agilityExpGain: 0.15,\n charismaExpGain: 0.1,\n reqdHacking: 201,\n reqdStrength: 251,\n reqdDefense: 251,\n reqdDexterity: 251,\n reqdAgility: 251,\n reqdCharisma: 201,\n reqdReputation: 32e3,\n repMultiplier: 1.25,\n },\n {\n name: posNames.AgentCompanyPositions[2], // Special Operative\n nextPosition: null,\n baseSalary: 2000,\n hackingEffectiveness: 15,\n strengthEffectiveness: 15,\n defenseEffectiveness: 15,\n dexterityEffectiveness: 20,\n agilityEffectiveness: 20,\n charismaEffectiveness: 15,\n hackingExpGain: 0.15,\n strengthExpGain: 0.2,\n defenseExpGain: 0.2,\n dexterityExpGain: 0.2,\n agilityExpGain: 0.2,\n charismaExpGain: 0.15,\n reqdHacking: 251,\n reqdStrength: 501,\n reqdDefense: 501,\n reqdDexterity: 501,\n reqdAgility: 501,\n reqdCharisma: 251,\n reqdReputation: 162e3,\n repMultiplier: 1.5,\n },\n {\n name: posNames.MiscCompanyPositions[0], // Waiter\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.05,\n repMultiplier: 1,\n },\n {\n name: posNames.MiscCompanyPositions[1], // Employee\n nextPosition: null,\n baseSalary: 22,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.02,\n defenseExpGain: 0.02,\n dexterityExpGain: 0.02,\n agilityExpGain: 0.02,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[0], // Software Consultant\n nextPosition: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n baseSalary: 66,\n hackingEffectiveness: 80,\n charismaEffectiveness: 20,\n hackingExpGain: 0.08,\n charismaExpGain: 0.03,\n reqdHacking: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.SoftwareConsultantCompanyPositions[1], // Senior Software Consultant\n nextPosition: null,\n baseSalary: 132,\n hackingEffectiveness: 75,\n charismaEffectiveness: 25,\n hackingExpGain: 0.25,\n charismaExpGain: 0.06,\n reqdHacking: 251,\n reqdCharisma: 51,\n repMultiplier: 1.2,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[0], // Business Consultant\n nextPosition: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n baseSalary: 66,\n hackingEffectiveness: 20,\n charismaEffectiveness: 80,\n hackingExpGain: 0.015,\n charismaExpGain: 0.15,\n reqdHacking: 6,\n reqdCharisma: 51,\n repMultiplier: 1,\n },\n {\n name: posNames.BusinessConsultantCompanyPositions[1], // Senior Business Consultant\n nextPosition: null,\n baseSalary: 525,\n hackingEffectiveness: 15,\n charismaEffectiveness: 85,\n hackingExpGain: 0.015,\n charismaExpGain: 0.3,\n reqdHacking: 51,\n reqdCharisma: 226,\n repMultiplier: 1.2,\n },\n {\n name: posNames.PartTimeCompanyPositions[0], // Part-time waiter\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.04,\n repMultiplier: 1,\n },\n {\n name: posNames.PartTimeCompanyPositions[1], // Part-time employee\n nextPosition: null,\n baseSalary: 20,\n strengthEffectiveness: 10,\n dexterityEffectiveness: 10,\n agilityEffectiveness: 10,\n charismaEffectiveness: 70,\n strengthExpGain: 0.0075,\n defenseExpGain: 0.0075,\n dexterityExpGain: 0.0075,\n agilityExpGain: 0.0075,\n charismaExpGain: 0.03,\n repMultiplier: 1,\n },\n];\n","import { Player as player } from \"../Player\";\nimport { Exploit } from \"../Exploits/Exploit\";\nimport * as bcrypt from \"bcryptjs\";\nimport { Apr1Events as devMenu } from \"../ui/Apr1\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport interface INetscriptExtra {\n heart: {\n break(): number;\n };\n openDevMenu(): void;\n exploit(): void;\n bypass(doc: Document): void;\n alterReality(): void;\n rainbow(guess: string): void;\n}\n\nexport function NetscriptExtra(): InternalAPI {\n return {\n heart: {\n // Easter egg function\n break: () => (): number => {\n return player.karma;\n },\n },\n openDevMenu: () => (): void => {\n devMenu.emit();\n },\n exploit: () => (): void => {\n player.giveExploit(Exploit.UndocumentedFunctionCall);\n },\n bypass:\n (ctx: NetscriptContext) =>\n (doc: unknown): void => {\n // reset both fields first\n type temporary = { completely_unused_field: unknown };\n const d = doc as temporary;\n d.completely_unused_field = undefined;\n const real_document = document as unknown as temporary;\n real_document.completely_unused_field = undefined;\n // set one to true and check that it affected the other.\n real_document.completely_unused_field = true;\n if (d.completely_unused_field && ctx.workerScript.ramUsage === 1.6) {\n player.giveExploit(Exploit.Bypass);\n }\n d.completely_unused_field = undefined;\n real_document.completely_unused_field = undefined;\n },\n alterReality: () => (): void => {\n // We need to trick webpack into not optimizing a variable that is guaranteed to be false (and doesn't use prototypes)\n let x = false;\n const recur = function (depth: number): void {\n if (depth === 0) return;\n x = !x;\n recur(depth - 1);\n };\n recur(2);\n console.warn(\"I am sure that this variable is false.\");\n if (x !== false) {\n console.warn(\"Reality has been altered!\");\n player.giveExploit(Exploit.RealityAlteration);\n }\n },\n rainbow:\n (ctx: NetscriptContext) =>\n (guess: unknown): boolean => {\n function tryGuess(): boolean {\n // eslint-disable-next-line no-sync\n const verified = bcrypt.compareSync(\n helpers.string(ctx, \"guess\", guess),\n \"$2a$10$aertxDEkgor8baVtQDZsLuMwwGYmkRM/ohcA6FjmmzIHQeTCsrCcO\",\n );\n if (verified) {\n player.giveExploit(Exploit.INeedARainbow);\n return true;\n }\n return false;\n }\n return tryGuess();\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n purchaseHashUpgrade,\n updateHashManagerCapacity,\n} from \"../Hacknet/HacknetHelpers\";\nimport { HacknetServer } from \"../Hacknet/HacknetServer\";\nimport { HacknetNode } from \"../Hacknet/HacknetNode\";\nimport { HashUpgrades } from \"../Hacknet/HashUpgrades\";\nimport { HashUpgrade } from \"../Hacknet/HashUpgrade\";\nimport { GetServer } from \"../Server/AllServers\";\n\nimport { Hacknet as IHacknet, NodeStats } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptHacknet(): InternalAPI {\n // Utility function to get Hacknet Node object\n const getHacknetNode = function (ctx: NetscriptContext, i: number): HacknetNode | HacknetServer {\n if (i < 0 || i >= player.hacknetNodes.length) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Index specified for Hacknet Node is out-of-bounds: \" + i);\n }\n\n if (hasHacknetServers(player)) {\n const hi = player.hacknetNodes[i];\n if (typeof hi !== \"string\") throw new Error(\"hacknet node was not a string\");\n const hserver = GetServer(hi);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"hacknet server was not actually hacknet server\");\n if (hserver == null) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Could not get Hacknet Server for index ${i}. This is probably a bug, please report to game dev`,\n );\n }\n\n return hserver;\n } else {\n const node = player.hacknetNodes[i];\n if (!(node instanceof HacknetNode)) throw new Error(\"hacknet node was not node.\");\n return node;\n }\n };\n\n return {\n numNodes: () => (): number => {\n return player.hacknetNodes.length;\n },\n maxNumNodes: () => (): number => {\n if (hasHacknetServers(player)) {\n return HacknetServerConstants.MaxServers;\n }\n return Infinity;\n },\n purchaseNode: () => (): number => {\n return purchaseHacknet(player);\n },\n getPurchaseNodeCost: () => (): number => {\n if (hasHacknetServers(player)) {\n return getCostOfNextHacknetServer(player);\n } else {\n return getCostOfNextHacknetNode(player);\n }\n },\n getNodeStats:\n (ctx: NetscriptContext) =>\n (_i: unknown): NodeStats => {\n const i = helpers.number(ctx, \"i\", _i);\n const node = getHacknetNode(ctx, i);\n const hasUpgraded = hasHacknetServers(player);\n const res: NodeStats = {\n name: node instanceof HacknetServer ? node.hostname : node.name,\n level: node.level,\n ram: node instanceof HacknetServer ? node.maxRam : node.ram,\n cores: node.cores,\n production: node instanceof HacknetServer ? node.hashRate : node.moneyGainRatePerSecond,\n timeOnline: node.onlineTimeSeconds,\n totalProduction: node instanceof HacknetServer ? node.totalHashesGenerated : node.totalMoneyGenerated,\n };\n\n if (hasUpgraded && node instanceof HacknetServer) {\n res.cache = node.cache;\n res.hashCapacity = node.hashCapacity;\n res.ramUsed = node.ramUsed;\n }\n\n return res;\n },\n upgradeLevel:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseLevelUpgrade(player, node, n);\n },\n upgradeRam:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseRamUpgrade(player, node, n);\n },\n upgradeCore:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return purchaseCoreUpgrade(player, node, n);\n },\n upgradeCache:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): boolean => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n if (!hasHacknetServers(player)) {\n return false;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n helpers.log(ctx, () => \"Can only be called on hacknet servers\");\n return false;\n }\n const res = purchaseCacheUpgrade(player, node, n);\n if (res) {\n updateHashManagerCapacity(player);\n }\n return res;\n },\n getLevelUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateLevelUpgradeCost(n, player.mults.hacknet_node_level_cost);\n },\n getRamUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateRamUpgradeCost(n, player.mults.hacknet_node_ram_cost);\n },\n getCoreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n const node = getHacknetNode(ctx, i);\n return node.calculateCoreUpgradeCost(n, player.mults.hacknet_node_core_cost);\n },\n getCacheUpgradeCost:\n (ctx: NetscriptContext) =>\n (_i: unknown, _n: unknown = 1): number => {\n const i = helpers.number(ctx, \"i\", _i);\n const n = helpers.number(ctx, \"n\", _n);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n const node = getHacknetNode(ctx, i);\n if (!(node instanceof HacknetServer)) {\n helpers.log(ctx, () => \"Can only be called on hacknet servers\");\n return -1;\n }\n return node.calculateCacheUpgradeCost(n);\n },\n numHashes: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.hashes;\n },\n hashCapacity: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 0;\n }\n return player.hashManager.capacity;\n },\n hashCost:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _count: unknown = 1): number => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const count = helpers.number(ctx, \"count\", _count);\n if (!hasHacknetServers(player)) {\n return Infinity;\n }\n\n return player.hashManager.getUpgradeCost(upgName, count);\n },\n spendHashes:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _upgTarget: unknown = \"\", _count: unknown = 1): boolean => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const upgTarget = helpers.string(ctx, \"upgTarget\", _upgTarget);\n const count = helpers.number(ctx, \"count\", _count);\n if (!hasHacknetServers(player)) {\n return false;\n }\n return purchaseHashUpgrade(player, upgName, upgTarget, count);\n },\n getHashUpgrades: () => (): string[] => {\n if (!hasHacknetServers(player)) {\n return [];\n }\n return Object.values(HashUpgrades).map((upgrade: HashUpgrade) => upgrade.name);\n },\n getHashUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgName: unknown): number => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const level = player.hashManager.upgrades[upgName];\n if (level === undefined) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid Hash Upgrade: ${upgName}`);\n }\n return level;\n },\n getStudyMult: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 1;\n }\n return player.hashManager.getStudyMult();\n },\n getTrainingMult: () => (): number => {\n if (!hasHacknetServers(player)) {\n return 1;\n }\n return player.hashManager.getTrainingMult();\n },\n };\n}\n","import { Player as player } from \"../Player\";\n\nimport { staneksGift } from \"../CotMG/Helper\";\nimport { Fragments, FragmentById } from \"../CotMG/Fragment\";\nimport { FragmentType } from \"../CotMG/FragmentType\";\n\nimport {\n Fragment as IFragment,\n ActiveFragment as IActiveFragment,\n Stanek as IStanek,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { AugmentationNames } from \"../Augmentation/data/AugmentationNames\";\nimport { NetscriptContext, InternalAPI } from \"../Netscript/APIWrapper\";\nimport { applyAugmentation } from \"../Augmentation/AugmentationHelpers\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { joinFaction } from \"../Faction/FactionHelpers\";\nimport { Factions } from \"../Faction/Factions\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptStanek(): InternalAPI {\n function checkStanekAPIAccess(ctx: NetscriptContext): void {\n if (!player.hasAugmentation(AugmentationNames.StaneksGift1, true)) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"Stanek's Gift is not installed\");\n }\n }\n\n return {\n giftWidth: (ctx: NetscriptContext) =>\n function (): number {\n checkStanekAPIAccess(ctx);\n return staneksGift.width();\n },\n giftHeight: (ctx: NetscriptContext) =>\n function (): number {\n checkStanekAPIAccess(ctx);\n return staneksGift.height();\n },\n chargeFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): Promise {\n //Get the fragment object using the given coordinates\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n const fragment = staneksGift.findFragment(rootX, rootY);\n //Check whether the selected fragment can ge charged\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `No fragment with root (${rootX}, ${rootY}).`);\n if (fragment.fragment().type == FragmentType.Booster) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `The fragment with root (${rootX}, ${rootY}) is a Booster Fragment and thus cannot be charged.`,\n );\n }\n //Charge the fragment\n const time = staneksGift.inBonus() ? 200 : 1000;\n return helpers.netscriptDelay(ctx, time).then(function () {\n staneksGift.charge(player, fragment, ctx.workerScript.scriptRef.threads);\n helpers.log(ctx, () => `Charged fragment with ${ctx.workerScript.scriptRef.threads} threads.`);\n return Promise.resolve();\n });\n },\n fragmentDefinitions: (ctx: NetscriptContext) =>\n function (): IFragment[] {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Returned ${Fragments.length} fragments`);\n return Fragments.map((f) => f.copy());\n },\n activeFragments: (ctx: NetscriptContext) =>\n function (): IActiveFragment[] {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Returned ${staneksGift.fragments.length} fragments`);\n return staneksGift.fragments.map((af) => {\n return { ...af.copy(), ...af.fragment().copy() };\n });\n },\n clearGift: (ctx: NetscriptContext) =>\n function (): void {\n checkStanekAPIAccess(ctx);\n helpers.log(ctx, () => `Cleared Stanek's Gift.`);\n staneksGift.clear();\n },\n canPlaceFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown, _rotation: unknown, _fragmentId: unknown): boolean {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n const rotation = helpers.number(ctx, \"rotation\", _rotation);\n const fragmentId = helpers.number(ctx, \"fragmentId\", _fragmentId);\n checkStanekAPIAccess(ctx);\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);\n const can = staneksGift.canPlace(rootX, rootY, rotation, fragment);\n return can;\n },\n placeFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown, _rotation: unknown, _fragmentId: unknown): boolean {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n const rotation = helpers.number(ctx, \"rotation\", _rotation);\n const fragmentId = helpers.number(ctx, \"fragmentId\", _fragmentId);\n checkStanekAPIAccess(ctx);\n const fragment = FragmentById(fragmentId);\n if (!fragment) throw helpers.makeRuntimeErrorMsg(ctx, `Invalid fragment id: ${fragmentId}`);\n return staneksGift.place(rootX, rootY, rotation, fragment);\n },\n getFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): IActiveFragment | undefined {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n const fragment = staneksGift.findFragment(rootX, rootY);\n if (fragment !== undefined) return fragment.copy();\n return undefined;\n },\n removeFragment: (ctx: NetscriptContext) =>\n function (_rootX: unknown, _rootY: unknown): boolean {\n const rootX = helpers.number(ctx, \"rootX\", _rootX);\n const rootY = helpers.number(ctx, \"rootY\", _rootY);\n checkStanekAPIAccess(ctx);\n return staneksGift.delete(rootX, rootY);\n },\n acceptGift: (ctx: NetscriptContext) =>\n function (): boolean {\n //Check if the player is eligible to join the church\n if (\n player.canAccessCotMG() &&\n player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0 &&\n player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length == 0\n ) {\n //Attempt to join CotMG\n joinFaction(Factions[FactionNames.ChurchOfTheMachineGod]);\n //Attempt to install the first Stanek aug\n if (\n !player.hasAugmentation(AugmentationNames.StaneksGift1) &&\n !player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n helpers.log(\n ctx,\n () => `'${FactionNames.ChurchOfTheMachineGod}' joined and '${AugmentationNames.StaneksGift1}' installed.`,\n );\n }\n }\n //Return true iff the player is in CotMG and has the first Stanek aug installed\n return (\n Factions[FactionNames.ChurchOfTheMachineGod].isMember &&\n player.hasAugmentation(AugmentationNames.StaneksGift1)\n );\n },\n };\n}\n","import { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\nexport function CalculateEffect(highestCharge: number, numCharge: number, power: number, boost: number): number {\n return (\n 1 +\n (Math.log(highestCharge + 1) / 60) *\n Math.pow((numCharge + 1) / 5, 0.07) *\n power *\n boost *\n BitNodeMultipliers.StaneksGiftPowerMultiplier\n );\n}\n","import { Player as player } from \"../Player\";\n\nimport {\n Infiltration as IInfiltration,\n InfiltrationLocation,\n PossibleInfiltrationLocation,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Location } from \"../Locations/Location\";\nimport { Locations } from \"../Locations/Locations\";\nimport { calculateDifficulty, calculateReward } from \"../Infiltration/formulas/game\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../Infiltration/formulas/victory\";\nimport { FactionNames } from \"../Faction/data/FactionNames\";\nimport { Factions } from \"../Faction/Factions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { checkEnum } from \"../utils/helpers/checkEnum\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptInfiltration(): InternalAPI {\n const getLocationsWithInfiltrations = Object.values(Locations).filter(\n (location: Location) => location.infiltrationData,\n );\n\n const calculateInfiltrationData = (ctx: NetscriptContext, locationName: string): InfiltrationLocation => {\n if (!checkEnum(LocationName, locationName)) throw new Error(`Location '${locationName}' does not exists.`);\n const location = Locations[locationName];\n if (location === undefined) throw helpers.makeRuntimeErrorMsg(ctx, `Location '${location}' does not exists.`);\n if (location.infiltrationData === undefined)\n throw helpers.makeRuntimeErrorMsg(ctx, `Location '${location}' does not provide infiltrations.`);\n const startingSecurityLevel = location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(player, startingSecurityLevel);\n const reward = calculateReward(player, startingSecurityLevel);\n const maxLevel = location.infiltrationData.maxClearanceLevel;\n return {\n location: JSON.parse(JSON.stringify(location)),\n reward: {\n tradeRep: calculateTradeInformationRepReward(player, reward, maxLevel, startingSecurityLevel),\n sellCash: calculateSellInformationCashReward(player, reward, maxLevel, startingSecurityLevel),\n SoARep: calculateInfiltratorsRepReward(player, Factions[FactionNames.ShadowsOfAnarchy], startingSecurityLevel),\n },\n difficulty: difficulty,\n };\n };\n return {\n getPossibleLocations: () => (): PossibleInfiltrationLocation[] => {\n return getLocationsWithInfiltrations.map((l) => ({\n city: l.city ?? \"\",\n name: String(l.name),\n }));\n },\n getInfiltration:\n (ctx: NetscriptContext) =>\n (_location: unknown): InfiltrationLocation => {\n const location = helpers.string(ctx, \"location\", _location);\n return calculateInfiltrationData(ctx, location);\n },\n };\n}\n","import {\n GameInfo,\n IStyleSettings,\n UserInterface as IUserInterface,\n UserInterfaceTheme,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Settings } from \"../Settings/Settings\";\nimport { ThemeEvents } from \"../Themes/ui/Theme\";\nimport { defaultTheme } from \"../Themes/Themes\";\nimport { defaultStyles } from \"../Themes/Styles\";\nimport { CONSTANTS } from \"../Constants\";\nimport { hash } from \"../hash/hash\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { Terminal } from \"../../src/Terminal\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptUserInterface(): InternalAPI {\n return {\n windowSize: () => (): [number, number] => {\n return [window.innerWidth, window.innerHeight];\n },\n getTheme: () => (): UserInterfaceTheme => {\n return { ...Settings.theme };\n },\n\n getStyles: () => (): IStyleSettings => {\n return { ...Settings.styles };\n },\n\n setTheme:\n (ctx: NetscriptContext) =>\n (newTheme: UserInterfaceTheme): void => {\n const hex = /^(#)((?:[A-Fa-f0-9]{2}){3,4}|(?:[A-Fa-f0-9]{3}))$/;\n const currentTheme = { ...Settings.theme };\n const errors: string[] = [];\n for (const key of Object.keys(newTheme)) {\n if (!currentTheme[key]) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else if (!hex.test(newTheme[key] ?? \"\")) {\n errors.push(`Invalid color \"${key}\": ${newTheme[key]}`);\n } else {\n currentTheme[key] = newTheme[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.theme, currentTheme);\n ThemeEvents.emit();\n helpers.log(ctx, () => `Successfully set theme`);\n } else {\n helpers.log(ctx, () => `Failed to set theme. Errors: ${errors.join(\", \")}`);\n }\n },\n\n setStyles:\n (ctx: NetscriptContext) =>\n (newStyles: IStyleSettings): void => {\n const currentStyles = { ...Settings.styles };\n const errors: string[] = [];\n for (const key of Object.keys(newStyles)) {\n if (!(currentStyles as any)[key]) {\n // Invalid key\n errors.push(`Invalid key \"${key}\"`);\n } else {\n (currentStyles as any)[key] = (newStyles as any)[key];\n }\n }\n\n if (errors.length === 0) {\n Object.assign(Settings.styles, currentStyles);\n ThemeEvents.emit();\n helpers.log(ctx, () => `Successfully set styles`);\n } else {\n helpers.log(ctx, () => `Failed to set styles. Errors: ${errors.join(\", \")}`);\n }\n },\n\n resetTheme: (ctx: NetscriptContext) => (): void => {\n Settings.theme = { ...defaultTheme };\n ThemeEvents.emit();\n helpers.log(ctx, () => `Reinitialized theme to default`);\n },\n\n resetStyles: (ctx: NetscriptContext) => (): void => {\n Settings.styles = { ...defaultStyles };\n ThemeEvents.emit();\n helpers.log(ctx, () => `Reinitialized styles to default`);\n },\n\n getGameInfo: () => (): GameInfo => {\n const version = CONSTANTS.VersionString;\n const commit = hash();\n const platform = navigator.userAgent.toLowerCase().indexOf(\" electron/\") > -1 ? \"Steam\" : \"Browser\";\n\n const gameInfo = {\n version,\n commit,\n platform,\n };\n\n return gameInfo;\n },\n\n clearTerminal: (ctx: NetscriptContext) => (): void => {\n helpers.log(ctx, () => `Clearing terminal`);\n Terminal.clear();\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { Bladeburner } from \"../Bladeburner/Bladeburner\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { Bladeburner as INetscriptBladeburner, BladeburnerCurAction } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { IAction } from \"src/Bladeburner/IAction\";\nimport { InternalAPI, NetscriptContext } from \"src/Netscript/APIWrapper\";\nimport { BlackOperation } from \"../Bladeburner/BlackOperation\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptBladeburner(): InternalAPI {\n const checkBladeburnerAccess = function (ctx: NetscriptContext, skipjoined = false): void {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const apiAccess =\n player.bitNodeN === 7 ||\n player.sourceFiles.some((a) => {\n return a.n === 7;\n });\n if (!apiAccess) {\n const apiDenied = `You do not currently have access to the Bladeburner API. You must either be in BitNode-7 or have Source-File 7.`;\n throw helpers.makeRuntimeErrorMsg(ctx, apiDenied);\n }\n if (!skipjoined) {\n const bladeburnerAccess = bladeburner instanceof Bladeburner;\n if (!bladeburnerAccess) {\n const bladeburnerDenied = `You must be a member of the Bladeburner division to use this API.`;\n throw helpers.makeRuntimeErrorMsg(ctx, bladeburnerDenied);\n }\n }\n };\n\n const checkBladeburnerCity = function (ctx: NetscriptContext, city: string): void {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n if (!bladeburner.cities.hasOwnProperty(city)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid city: ${city}`);\n }\n };\n\n const getBladeburnerActionObject = function (ctx: NetscriptContext, type: string, name: string): IAction {\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Must have joined bladeburner\");\n const actionId = bladeburner.getActionIdFromTypeAndName(type, name);\n if (!actionId) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid action type='${type}', name='${name}'`);\n }\n const actionObj = bladeburner.getActionObject(actionId);\n if (!actionObj) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid action type='${type}', name='${name}'`);\n }\n\n return actionObj;\n };\n\n return {\n getContractNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getContractNamesNetscriptFn();\n },\n getOperationNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getOperationNamesNetscriptFn();\n },\n getBlackOpNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getBlackOpNamesNetscriptFn();\n },\n getBlackOpRank:\n (ctx: NetscriptContext) =>\n (_blackOpName: unknown): number => {\n const blackOpName = helpers.string(ctx, \"blackOpName\", _blackOpName);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, \"blackops\", blackOpName);\n if (!(action instanceof BlackOperation)) throw new Error(\"action was not a black operation\");\n return action.reqdRank;\n },\n getGeneralActionNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getGeneralActionNamesNetscriptFn();\n },\n getSkillNames: (ctx: NetscriptContext) => (): string[] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getSkillNamesNetscriptFn();\n },\n startAction:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): boolean => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.startActionNetscriptFn(player, type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n stopBladeburnerAction: (ctx: NetscriptContext) => (): void => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.resetAction();\n },\n getCurrentAction: (ctx: NetscriptContext) => (): BladeburnerCurAction => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.getTypeAndNameFromActionId(bladeburner.action);\n },\n getActionTime:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const time = bladeburner.getActionTimeNetscriptFn(player, type, name);\n if (typeof time === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n helpers.log(ctx, () => errorLogText);\n return -1;\n } else {\n return time;\n }\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionCurrentTime: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const timecomputed =\n Math.min(bladeburner.actionTimeCurrent + bladeburner.actionTimeOverflow, bladeburner.actionTimeToComplete) *\n 1000;\n return timecomputed;\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionEstimatedSuccessChance:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): [number, number] => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n const chance = bladeburner.getActionEstimatedSuccessChanceNetscriptFn(player, type, name);\n if (typeof chance === \"string\") {\n const errorLogText = `Invalid action: type='${type}' name='${name}'`;\n helpers.log(ctx, () => errorLogText);\n return [-1, -1];\n } else {\n return chance;\n }\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionRepGain:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const level = helpers.number(ctx, \"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n let rewardMultiplier;\n if (level == null || isNaN(level)) {\n rewardMultiplier = Math.pow(action.rewardFac, action.level - 1);\n } else {\n rewardMultiplier = Math.pow(action.rewardFac, level - 1);\n }\n\n return action.rankGain * rewardMultiplier * BitNodeMultipliers.BladeburnerRank;\n },\n getActionCountRemaining:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getActionCountRemainingNetscriptFn(type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getActionMaxLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.maxLevel;\n },\n getActionCurrentLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.level;\n },\n getActionAutolevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): boolean => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n return action.autoLevel;\n },\n setActionAutolevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _autoLevel: unknown = true): void => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const autoLevel = !!_autoLevel;\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n action.autoLevel = autoLevel;\n },\n setActionLevel:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _level: unknown = 1): void => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const level = helpers.number(ctx, \"level\", _level);\n checkBladeburnerAccess(ctx);\n const action = getBladeburnerActionObject(ctx, type, name);\n if (level < 1 || level > action.maxLevel) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Level must be between 1 and ${action.maxLevel}, is ${level}`);\n }\n action.level = level;\n },\n getRank: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.rank;\n },\n getSkillPoints: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.skillPoints;\n },\n getSkillLevel:\n (ctx: NetscriptContext) =>\n (_skillName: unknown): number => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillLevelNetscriptFn(skillName, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getSkillUpgradeCost:\n (ctx: NetscriptContext) =>\n (_skillName: unknown, _count: unknown = 1): number => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n const count = helpers.number(ctx, \"count\", _count);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getSkillUpgradeCostNetscriptFn(skillName, count, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n upgradeSkill:\n (ctx: NetscriptContext) =>\n (_skillName: unknown, _count: unknown = 1): boolean => {\n const skillName = helpers.string(ctx, \"skillName\", _skillName);\n const count = helpers.number(ctx, \"count\", _count);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.upgradeSkillNetscriptFn(skillName, count, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.getTeamSizeNetscriptFn(type, name, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n setTeamSize:\n (ctx: NetscriptContext) =>\n (_type: unknown, _name: unknown, _size: unknown): number => {\n const type = helpers.string(ctx, \"type\", _type);\n const name = helpers.string(ctx, \"name\", _name);\n const size = helpers.number(ctx, \"size\", _size);\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n try {\n return bladeburner.setTeamSizeNetscriptFn(type, name, size, ctx.workerScript);\n } catch (e: unknown) {\n throw helpers.makeRuntimeErrorMsg(ctx, String(e));\n }\n },\n getCityEstimatedPopulation:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].popEst;\n },\n getCityCommunities:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].comms;\n },\n getCityChaos:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): number => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.cities[cityName].chaos;\n },\n getCity: (ctx: NetscriptContext) => (): string => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.city;\n },\n switchCity:\n (ctx: NetscriptContext) =>\n (_cityName: unknown): boolean => {\n const cityName = helpers.string(ctx, \"cityName\", _cityName);\n checkBladeburnerAccess(ctx);\n checkBladeburnerCity(ctx, cityName);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n bladeburner.city = cityName;\n return true;\n },\n getStamina: (ctx: NetscriptContext) => (): [number, number] => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return [bladeburner.stamina, bladeburner.maxStamina];\n },\n joinBladeburnerFaction: (ctx: NetscriptContext) => (): boolean => {\n checkBladeburnerAccess(ctx, true);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return bladeburner.joinBladeburnerFactionNetscriptFn(ctx.workerScript);\n },\n joinBladeburnerDivision: (ctx: NetscriptContext) => (): boolean => {\n if (player.bitNodeN === 7 || player.sourceFileLvl(7) > 0) {\n if (player.bitNodeN === 8) {\n return false;\n }\n if (player.bladeburner instanceof Bladeburner) {\n return true; // Already member\n } else if (\n player.skills.strength >= 100 &&\n player.skills.defense >= 100 &&\n player.skills.dexterity >= 100 &&\n player.skills.agility >= 100\n ) {\n player.bladeburner = new Bladeburner(player);\n helpers.log(ctx, () => \"You have been accepted into the Bladeburner division\");\n\n return true;\n } else {\n helpers.log(ctx, () => \"You do not meet the requirements for joining the Bladeburner division\");\n return false;\n }\n }\n return false;\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkBladeburnerAccess(ctx);\n const bladeburner = player.bladeburner;\n if (bladeburner === null) throw new Error(\"Should not be called without Bladeburner\");\n return Math.round(bladeburner.storedCycles / 5) * 1000;\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { CodingContract } from \"../CodingContracts\";\nimport { CodingAttemptOptions, CodingContract as ICodingContract } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptCodingContract(): InternalAPI {\n const getCodingContract = function (\n ctx: NetscriptContext,\n func: string,\n hostname: string,\n filename: string,\n ): CodingContract {\n const server = helpers.getServer(ctx, hostname);\n const contract = server.getContract(filename);\n if (contract == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Cannot find contract '${filename}' on server '${hostname}'`);\n }\n\n return contract;\n };\n\n return {\n attempt:\n (ctx: NetscriptContext) =>\n (\n answer: unknown,\n _filename: unknown,\n _hostname: unknown = ctx.workerScript.hostname,\n { returnReward }: CodingAttemptOptions = { returnReward: false },\n ): boolean | string => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"attempt\", hostname, filename);\n\n if (typeof answer !== \"number\" && typeof answer !== \"string\" && !Array.isArray(answer))\n throw new Error(\"The answer provided was not a number, string, or array\");\n\n // Convert answer to string.\n const answerStr = typeof answer === \"string\" ? answer : JSON.stringify(answer);\n const creward = contract.reward;\n if (creward === null) throw new Error(\"Somehow solved a contract that didn't have a reward\");\n\n const serv = helpers.getServer(ctx, hostname);\n if (contract.isSolution(answerStr)) {\n const reward = player.gainCodingContractReward(creward, contract.getDifficulty());\n helpers.log(ctx, () => `Successfully completed Coding Contract '${filename}'. Reward: ${reward}`);\n serv.removeContract(filename);\n return returnReward ? reward : true;\n } else {\n ++contract.tries;\n if (contract.tries >= contract.getMaxNumTries()) {\n helpers.log(ctx, () => `Coding Contract attempt '${filename}' failed. Contract is now self-destructing`);\n serv.removeContract(filename);\n } else {\n helpers.log(\n ctx,\n () =>\n `Coding Contract attempt '${filename}' failed. ${\n contract.getMaxNumTries() - contract.tries\n } attempts remaining.`,\n );\n }\n\n return returnReward ? \"\" : false;\n }\n },\n getContractType:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): string => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getContractType\", hostname, filename);\n return contract.getType();\n },\n getData:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): unknown => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getData\", hostname, filename);\n const data = contract.getData();\n if (Array.isArray(data)) {\n // For two dimensional arrays, we have to copy the internal arrays using\n // slice() as well. As of right now, no contract has arrays that have\n // more than two dimensions\n const copy = data.slice();\n for (let i = 0; i < copy.length; ++i) {\n if (data[i].constructor === Array) {\n copy[i] = data[i].slice();\n }\n }\n\n return copy;\n } else {\n return data;\n }\n },\n getDescription:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): string => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getDescription\", hostname, filename);\n return contract.getDescription();\n },\n getNumTriesRemaining:\n (ctx: NetscriptContext) =>\n (_filename: unknown, _hostname: unknown = ctx.workerScript.hostname): number => {\n const filename = helpers.string(ctx, \"filename\", _filename);\n const hostname = helpers.string(ctx, \"hostname\", _hostname);\n const contract = getCodingContract(ctx, \"getNumTriesRemaining\", hostname, filename);\n return contract.getMaxNumTries() - contract.tries;\n },\n };\n}\n","import { Player as player } from \"../Player\";\n\nimport { OfficeSpace } from \"../Corporation/OfficeSpace\";\nimport { Employee } from \"../Corporation/Employee\";\nimport { Product } from \"../Corporation/Product\";\nimport { Material } from \"../Corporation/Material\";\nimport { Warehouse } from \"../Corporation/Warehouse\";\nimport { IIndustry } from \"../Corporation/IIndustry\";\nimport { ICorporation } from \"../Corporation/ICorporation\";\n\nimport {\n Corporation as NSCorporation,\n CorporationInfo,\n Employee as NSEmployee,\n Product as NSProduct,\n Material as NSMaterial,\n Warehouse as NSWarehouse,\n Division as NSDivision,\n WarehouseAPI,\n OfficeAPI,\n InvestmentOffer,\n Office as NSOffice,\n} from \"../ScriptEditor/NetscriptDefinitions\";\n\nimport {\n NewIndustry,\n NewCity,\n UnlockUpgrade,\n LevelUpgrade,\n IssueDividends,\n SellMaterial,\n SellProduct,\n SetSmartSupply,\n BuyMaterial,\n AssignJob,\n AutoAssignJob,\n UpgradeOfficeSize,\n PurchaseWarehouse,\n UpgradeWarehouse,\n BuyCoffee,\n ThrowParty,\n HireAdVert,\n MakeProduct,\n Research,\n ExportMaterial,\n CancelExportMaterial,\n SetMaterialMarketTA1,\n SetMaterialMarketTA2,\n SetProductMarketTA1,\n SetProductMarketTA2,\n BulkPurchase,\n SellShares,\n BuyBackShares,\n SetSmartSupplyUseLeftovers,\n LimitMaterialProduction,\n LimitProductProduction,\n UpgradeWarehouseCost,\n} from \"../Corporation/Actions\";\nimport { CorporationUnlockUpgrades } from \"../Corporation/data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrades } from \"../Corporation/data/CorporationUpgrades\";\nimport { EmployeePositions } from \"../Corporation/EmployeePositions\";\nimport { Industry } from \"../Corporation/Industry\";\nimport { IndustryResearchTrees, IndustryStartingCosts } from \"../Corporation/IndustryData\";\nimport { CorporationConstants } from \"../Corporation/data/Constants\";\nimport { ResearchMap } from \"../Corporation/ResearchMap\";\nimport { Factions } from \"../Faction/Factions\";\nimport { BitNodeMultipliers } from \"../BitNode/BitNodeMultipliers\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptCorporation(): InternalAPI {\n function createCorporation(corporationName: string, selfFund = true): boolean {\n if (!player.canAccessCorporation() || player.hasCorporation()) return false;\n if (!corporationName) return false;\n if (player.bitNodeN !== 3 && !selfFund) throw new Error(\"cannot use seed funds outside of BitNode 3\");\n if (BitNodeMultipliers.CorporationSoftcap < 0.15)\n throw new Error(`You cannot create a corporation in Bitnode ${player.bitNodeN}`);\n\n if (selfFund) {\n if (!player.canAfford(150e9)) return false;\n\n player.startCorporation(corporationName);\n player.loseMoney(150e9, \"corporation\");\n } else {\n player.startCorporation(corporationName, 500e6);\n }\n return true;\n }\n\n function hasUnlockUpgrade(upgradeName: string): boolean {\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.unlockUpgrades[upgN] === 1;\n }\n\n function getUnlockUpgradeCost(upgradeName: string): number {\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n return upgrade.price;\n }\n\n function getUpgradeLevel(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n return corporation.upgrades[upgN];\n }\n\n function getUpgradeLevelCost(ctx: NetscriptContext, _upgradeName: string): number {\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n const upgN = upgrade.index;\n const baseCost = upgrade.basePrice;\n const priceMult = upgrade.priceMult;\n const level = corporation.upgrades[upgN];\n return baseCost * Math.pow(priceMult, level);\n }\n\n function getExpandIndustryCost(industryName: string): number {\n const cost = IndustryStartingCosts[industryName];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industryName}'`);\n }\n return cost;\n }\n\n function getExpandCityCost(): number {\n return CorporationConstants.OfficeInitialCost;\n }\n\n function getInvestmentOffer(): InvestmentOffer {\n const corporation = getCorporation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\n return {\n funds: 0,\n shares: 0,\n round: corporation.fundingRound + 1, // Make more readable\n }; // Don't throw an error here, no reason to have a second function to check if you can get investment.\n const val = corporation.determineValuation();\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n return {\n funds: funding,\n shares: investShares,\n round: corporation.fundingRound + 1, // Make more readable\n };\n }\n\n function acceptInvestmentOffer(): boolean {\n const corporation = getCorporation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length ||\n corporation.public\n )\n return false;\n const val = corporation.determineValuation();\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n return true;\n }\n\n function goPublic(numShares: number): boolean {\n const corporation = getCorporation();\n const initialSharePrice = corporation.determineValuation() / corporation.totalShares;\n if (isNaN(numShares)) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares < 0) throw new Error(\"Invalid value for number of issued shares\");\n if (numShares > corporation.numShares) throw new Error(\"You don't have that many shares to issue!\");\n corporation.public = true;\n corporation.sharePrice = initialSharePrice;\n corporation.issuedShares = numShares;\n corporation.numShares -= numShares;\n corporation.addFunds(numShares * initialSharePrice);\n return true;\n }\n\n function getResearchCost(division: IIndustry, researchName: string): number {\n const researchTree = IndustryResearchTrees[division.type];\n if (researchTree === undefined) throw new Error(`No research tree for industry '${division.type}'`);\n const allResearch = researchTree.getAllNodes();\n if (!allResearch.includes(researchName)) throw new Error(`No research named '${researchName}'`);\n const research = ResearchMap[researchName];\n return research.cost;\n }\n\n function hasResearched(division: IIndustry, researchName: string): boolean {\n return division.researched[researchName] === undefined ? false : (division.researched[researchName] as boolean);\n }\n\n function bribe(factionName: string, amountCash: number): boolean {\n if (!player.factions.includes(factionName)) throw new Error(\"Invalid faction name\");\n if (isNaN(amountCash) || amountCash < 0)\n throw new Error(\"Invalid value for amount field! Must be numeric, grater than 0.\");\n\n const corporation = getCorporation();\n if (corporation.funds < amountCash) return false;\n const faction = Factions[factionName];\n const info = faction.getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(factionName)) return false;\n\n const repGain = amountCash / CorporationConstants.BribeToRepRatio;\n faction.playerReputation += repGain;\n corporation.funds = corporation.funds - amountCash;\n\n return true;\n }\n\n function getCorporation(): ICorporation {\n const corporation = player.corporation;\n if (corporation === null) throw new Error(\"cannot be called without a corporation\");\n return corporation;\n }\n\n function getDivision(divisionName: string): IIndustry {\n const corporation = getCorporation();\n const division = corporation.divisions.find((div) => div.name === divisionName);\n if (division === undefined) throw new Error(`No division named '${divisionName}'`);\n return division;\n }\n\n function getOffice(divisionName: string, cityName: string): OfficeSpace {\n const division = getDivision(divisionName);\n if (!(cityName in division.offices)) throw new Error(`Invalid city name '${cityName}'`);\n const office = division.offices[cityName];\n if (office === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return office;\n }\n\n function getWarehouse(divisionName: string, cityName: string): Warehouse {\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n if (warehouse === 0) throw new Error(`${division.name} has not expanded to '${cityName}'`);\n return warehouse;\n }\n\n function getMaterial(divisionName: string, cityName: string, materialName: string): Material {\n const warehouse = getWarehouse(divisionName, cityName);\n const matName = materialName.replace(/ /g, \"\");\n const material = warehouse.materials[matName];\n if (material === undefined) throw new Error(`Invalid material name: '${materialName}'`);\n return material;\n }\n\n function getProduct(divisionName: string, productName: string): Product {\n const division = getDivision(divisionName);\n const product = division.products[productName];\n if (product === undefined) throw new Error(`Invalid product name: '${productName}'`);\n return product;\n }\n\n function getEmployee(divisionName: string, cityName: string, employeeName: string): Employee {\n const office = getOffice(divisionName, cityName);\n const employee = office.employees.find((e) => e.name === employeeName);\n if (employee === undefined) throw new Error(`Invalid employee name: '${employeeName}'`);\n return employee;\n }\n\n function checkAccess(ctx: NetscriptContext, api?: number): void {\n if (player.corporation === null) throw helpers.makeRuntimeErrorMsg(ctx, \"Must own a corporation.\");\n if (!api) return;\n\n if (!player.corporation.unlockUpgrades[api])\n throw helpers.makeRuntimeErrorMsg(ctx, \"You do not have access to this API.\");\n }\n\n function getSafeDivision(division: Industry): NSDivision {\n const cities: string[] = [];\n for (const office of Object.values(division.offices)) {\n if (office === 0) continue;\n cities.push(office.loc);\n }\n\n return {\n name: division.name,\n type: division.type,\n awareness: division.awareness,\n popularity: division.popularity,\n prodMult: division.prodMult,\n research: division.sciResearch.qty,\n lastCycleRevenue: division.lastCycleRevenue,\n lastCycleExpenses: division.lastCycleExpenses,\n thisCycleRevenue: division.thisCycleRevenue,\n thisCycleExpenses: division.thisCycleExpenses,\n upgrades: [0, division.numAdVerts],\n cities: cities,\n products: division.products === undefined ? [] : Object.keys(division.products),\n makesProducts: division.makesProducts,\n };\n }\n\n const warehouseAPI: InternalAPI = {\n getPurchaseWarehouseCost: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx, 7);\n return CorporationConstants.WarehouseInitialCost;\n },\n getUpgradeWarehouseCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _amt: unknown = 1): number => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amt = helpers.number(ctx, \"amount\", _amt);\n if (amt < 1) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must provide a positive number\");\n }\n const warehouse = getWarehouse(divisionName, cityName);\n return UpgradeWarehouseCost(warehouse, amt);\n },\n hasWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): boolean => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const division = getDivision(divisionName);\n if (!(cityName in division.warehouses)) throw new Error(`Invalid city name '${cityName}'`);\n const warehouse = division.warehouses[cityName];\n return warehouse !== 0;\n },\n getWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): NSWarehouse => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const warehouse = getWarehouse(divisionName, cityName);\n return {\n level: warehouse.level,\n loc: warehouse.loc,\n size: warehouse.size,\n sizeUsed: warehouse.sizeUsed,\n smartSupplyEnabled: warehouse.smartSupplyEnabled,\n };\n },\n getMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown): NSMaterial => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const material = getMaterial(divisionName, cityName, materialName);\n const corporation = getCorporation();\n return {\n cost: material.bCost,\n sCost: material.sCost,\n name: material.name,\n qty: material.qty,\n qlt: material.qlt,\n dmd: corporation.unlockUpgrades[2] ? material.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? material.cmp : undefined,\n prod: material.prd,\n sell: material.sll,\n };\n },\n getProduct:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown): NSProduct => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const product = getProduct(divisionName, productName);\n const corporation = getCorporation();\n return {\n name: product.name,\n dmd: corporation.unlockUpgrades[2] ? product.dmd : undefined,\n cmp: corporation.unlockUpgrades[3] ? product.cmp : undefined,\n rat: product.rat,\n properties: {\n qlt: product.qlt,\n per: product.per,\n dur: product.dur,\n rel: product.rel,\n aes: product.aes,\n fea: product.fea,\n },\n pCost: product.pCost,\n sCost: product.sCost,\n cityData: product.data,\n developmentProgress: product.prog,\n };\n },\n purchaseWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const corporation = getCorporation();\n PurchaseWarehouse(corporation, getDivision(divisionName), cityName);\n },\n upgradeWarehouse:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _amt: unknown = 1): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amt = helpers.number(ctx, \"amount\", _amt);\n const corporation = getCorporation();\n if (amt < 1) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must provide a positive number\");\n }\n UpgradeWarehouse(corporation, getDivision(divisionName), getWarehouse(divisionName, cityName), amt);\n },\n sellMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown, _price: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n const price = helpers.string(ctx, \"price\", _price);\n const material = getMaterial(divisionName, cityName, materialName);\n SellMaterial(material, amt, price);\n },\n sellProduct:\n (ctx: NetscriptContext) =>\n (\n _divisionName: unknown,\n _cityName: unknown,\n _productName: unknown,\n _amt: unknown,\n _price: unknown,\n _all: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n const price = helpers.string(ctx, \"price\", _price);\n const all = !!_all;\n const product = getProduct(divisionName, productName);\n SellProduct(product, cityName, amt, price, all);\n },\n discontinueProduct:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n getDivision(divisionName).discontinueProduct(getProduct(divisionName, productName));\n },\n setSmartSupply:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _enabled: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const enabled = !!_enabled;\n const warehouse = getWarehouse(divisionName, cityName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not purchased the Smart Supply upgrade!`);\n SetSmartSupply(warehouse, enabled);\n },\n setSmartSupplyUseLeftovers:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _enabled: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const enabled = !!_enabled;\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n if (!hasUnlockUpgrade(\"Smart Supply\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not purchased the Smart Supply upgrade!`);\n SetSmartSupplyUseLeftovers(warehouse, material, enabled);\n },\n buyMaterial:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.number(ctx, \"amt\", _amt);\n if (amt < 0) throw new Error(\"Invalid value for amount field! Must be numeric and greater than 0\");\n const material = getMaterial(divisionName, cityName, materialName);\n BuyMaterial(material, amt);\n },\n bulkPurchase:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _amt: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n if (!hasResearched(getDivision(divisionName), \"Bulk Purchasing\"))\n throw new Error(`You have not researched Bulk Purchasing in ${divisionName}`);\n const corporation = getCorporation();\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.number(ctx, \"amt\", _amt);\n const warehouse = getWarehouse(divisionName, cityName);\n const material = getMaterial(divisionName, cityName, materialName);\n BulkPurchase(corporation, warehouse, material, amt);\n },\n makeProduct:\n (ctx: NetscriptContext) =>\n (\n _divisionName: unknown,\n _cityName: unknown,\n _productName: unknown,\n _designInvest: unknown,\n _marketingInvest: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const designInvest = helpers.number(ctx, \"designInvest\", _designInvest);\n const marketingInvest = helpers.number(ctx, \"marketingInvest\", _marketingInvest);\n const corporation = getCorporation();\n MakeProduct(corporation, getDivision(divisionName), cityName, productName, designInvest, marketingInvest);\n },\n limitProductProduction:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _cityName: unknown, _qty: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const qty = helpers.number(ctx, \"qty\", _qty);\n LimitProductProduction(getProduct(divisionName, productName), cityName, qty);\n },\n exportMaterial:\n (ctx: NetscriptContext) =>\n (\n _sourceDivision: unknown,\n _sourceCity: unknown,\n _targetDivision: unknown,\n _targetCity: unknown,\n _materialName: unknown,\n _amt: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const sourceDivision = helpers.string(ctx, \"sourceDivision\", _sourceDivision);\n const sourceCity = helpers.string(ctx, \"sourceCity\", _sourceCity);\n const targetDivision = helpers.string(ctx, \"targetDivision\", _targetDivision);\n const targetCity = helpers.string(ctx, \"targetCity\", _targetCity);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n ExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n getDivision(targetDivision),\n );\n },\n cancelExportMaterial:\n (ctx: NetscriptContext) =>\n (\n _sourceDivision: unknown,\n _sourceCity: unknown,\n _targetDivision: unknown,\n _targetCity: unknown,\n _materialName: unknown,\n _amt: unknown,\n ): void => {\n checkAccess(ctx, 7);\n const sourceDivision = helpers.string(ctx, \"sourceDivision\", _sourceDivision);\n const sourceCity = helpers.string(ctx, \"sourceCity\", _sourceCity);\n const targetDivision = helpers.string(ctx, \"targetDivision\", _targetDivision);\n const targetCity = helpers.string(ctx, \"targetCity\", _targetCity);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const amt = helpers.string(ctx, \"amt\", _amt);\n CancelExportMaterial(\n targetDivision,\n targetCity,\n getMaterial(sourceDivision, sourceCity, materialName),\n amt + \"\",\n );\n },\n limitMaterialProduction:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _qty: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const qty = helpers.number(ctx, \"qty\", _qty);\n LimitMaterialProduction(getMaterial(divisionName, cityName, materialName), qty);\n },\n setMaterialMarketTA1:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.I for division: ${divisionName}`);\n SetMaterialMarketTA1(getMaterial(divisionName, cityName, materialName), on);\n },\n setMaterialMarketTA2:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _materialName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const materialName = helpers.string(ctx, \"materialName\", _materialName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.II for division: ${divisionName}`);\n SetMaterialMarketTA2(getMaterial(divisionName, cityName, materialName), on);\n },\n setProductMarketTA1:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.I\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.I for division: ${divisionName}`);\n SetProductMarketTA1(getProduct(divisionName, productName), on);\n },\n setProductMarketTA2:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _productName: unknown, _on: unknown): void => {\n checkAccess(ctx, 7);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const productName = helpers.string(ctx, \"productName\", _productName);\n const on = !!_on;\n if (!getDivision(divisionName).hasResearch(\"Market-TA.II\"))\n throw helpers.makeRuntimeErrorMsg(ctx, `You have not researched MarketTA.II for division: ${divisionName}`);\n SetProductMarketTA2(getProduct(divisionName, productName), on);\n },\n };\n\n const officeAPI: InternalAPI = {\n getHireAdVertCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.getAdVertCost();\n },\n getHireAdVertCount:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return division.numAdVerts;\n },\n getResearchCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n return getResearchCost(getDivision(divisionName), researchName);\n },\n hasResearched:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): boolean => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n return hasResearched(getDivision(divisionName), researchName);\n },\n getOfficeSizeUpgradeCost:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const size = helpers.number(ctx, \"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const initialPriceMult = Math.round(office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n let mult = 0;\n for (let i = 0; i < size / CorporationConstants.OfficeInitialSize; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n return CorporationConstants.OfficeInitialCost * mult;\n },\n assignJob:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _employeeName: unknown, _job: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const employeeName = helpers.string(ctx, \"employeeName\", _employeeName);\n const job = helpers.string(ctx, \"job\", _job);\n\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n const office = getOffice(divisionName, cityName);\n\n AssignJob(office, employeeName, job);\n },\n setAutoJobAssignment:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _job: unknown, _amount: unknown): boolean => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const amount = helpers.number(ctx, \"amount\", _amount);\n const job = helpers.string(ctx, \"job\", _job);\n\n if (!Object.values(EmployeePositions).includes(job)) throw new Error(`'${job}' is not a valid job.`);\n const office = getOffice(divisionName, cityName);\n\n return AutoAssignJob(office, job, amount);\n },\n hireEmployee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): NSEmployee | undefined => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const office = getOffice(divisionName, cityName);\n const employee = office.hireRandomEmployee();\n if (employee === undefined) return undefined;\n return {\n name: employee.name,\n mor: employee.mor,\n hap: employee.hap,\n ene: employee.ene,\n int: employee.int,\n cha: employee.cha,\n exp: employee.exp,\n cre: employee.cre,\n eff: employee.eff,\n sal: employee.sal,\n loc: employee.loc,\n pos: employee.pos,\n };\n },\n upgradeOfficeSize:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _size: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const size = helpers.number(ctx, \"size\", _size);\n if (size < 0) throw new Error(\"Invalid value for size field! Must be numeric and greater than 0\");\n const office = getOffice(divisionName, cityName);\n const corporation = getCorporation();\n UpgradeOfficeSize(corporation, office, size);\n },\n throwParty:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _costPerEmployee: unknown): number => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const costPerEmployee = helpers.number(ctx, \"costPerEmployee\", _costPerEmployee);\n\n if (costPerEmployee < 0) {\n throw new Error(\"Invalid value for Cost Per Employee field! Must be numeric and greater than 0\");\n }\n\n const corporation = getCorporation();\n const office = getOffice(divisionName, cityName);\n\n return ThrowParty(corporation, office, costPerEmployee);\n },\n buyCoffee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): boolean => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n\n const corporation = getCorporation();\n const office = getOffice(divisionName, cityName);\n\n return BuyCoffee(corporation, office);\n },\n hireAdVert:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const corporation = getCorporation();\n HireAdVert(corporation, getDivision(divisionName));\n },\n research:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _researchName: unknown): void => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const researchName = helpers.string(ctx, \"researchName\", _researchName);\n Research(getDivision(divisionName), researchName);\n },\n getOffice:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): NSOffice => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const office = getOffice(divisionName, cityName);\n return {\n loc: office.loc,\n size: office.size,\n minEne: office.minEne,\n maxEne: office.maxEne,\n minHap: office.minHap,\n maxHap: office.maxHap,\n minMor: office.minMor,\n maxMor: office.maxMor,\n employees: office.employees.map((e) => e.name),\n employeeProd: {\n Operations: office.employeeProd[EmployeePositions.Operations],\n Engineer: office.employeeProd[EmployeePositions.Engineer],\n Business: office.employeeProd[EmployeePositions.Business],\n Management: office.employeeProd[EmployeePositions.Management],\n \"Research & Development\": office.employeeProd[EmployeePositions.RandD],\n Training: office.employeeProd[EmployeePositions.Training],\n Unassigned: 0,\n },\n employeeJobs: {\n Operations: office.employeeJobs[EmployeePositions.Operations],\n Engineer: office.employeeJobs[EmployeePositions.Engineer],\n Business: office.employeeJobs[EmployeePositions.Business],\n Management: office.employeeJobs[EmployeePositions.Management],\n \"Research & Development\": office.employeeJobs[EmployeePositions.RandD],\n Training: office.employeeJobs[EmployeePositions.Training],\n Unassigned: office.employeeJobs[EmployeePositions.Unassigned],\n },\n };\n },\n getEmployee:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown, _employeeName: unknown): NSEmployee => {\n checkAccess(ctx, 8);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n const employeeName = helpers.string(ctx, \"employeeName\", _employeeName);\n const employee = getEmployee(divisionName, cityName, employeeName);\n return {\n name: employee.name,\n mor: employee.mor,\n hap: employee.hap,\n ene: employee.ene,\n int: employee.int,\n cha: employee.cha,\n exp: employee.exp,\n cre: employee.cre,\n eff: employee.eff,\n sal: employee.sal,\n loc: employee.loc,\n pos: employee.pos,\n };\n },\n };\n\n return {\n ...warehouseAPI,\n ...officeAPI,\n getMaterialNames: () => (): string[] => {\n return CorporationConstants.AllMaterials;\n },\n getIndustryTypes: () => (): string[] => {\n return CorporationConstants.AllIndustryTypes;\n },\n getUnlockables: () => (): string[] => {\n return CorporationConstants.AllUnlocks;\n },\n getUpgradeNames: () => (): string[] => {\n return CorporationConstants.AllUpgrades;\n },\n getResearchNames: () => (): string[] => {\n return CorporationConstants.AllResearch;\n },\n expandIndustry:\n (ctx: NetscriptContext) =>\n (_industryName: unknown, _divisionName: unknown): void => {\n checkAccess(ctx);\n const industryName = helpers.string(ctx, \"industryName\", _industryName);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const corporation = getCorporation();\n NewIndustry(corporation, industryName, divisionName);\n },\n expandCity:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown, _cityName: unknown): void => {\n checkAccess(ctx);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const cityName = helpers.city(ctx, \"cityName\", _cityName);\n if (!CorporationConstants.Cities.includes(cityName)) throw new Error(\"Invalid city name\");\n const corporation = getCorporation();\n const division = getDivision(divisionName);\n NewCity(corporation, division, cityName);\n },\n unlockUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): void => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUnlockUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n UnlockUpgrade(corporation, upgrade);\n },\n levelUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): void => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n const corporation = getCorporation();\n const upgrade = Object.values(CorporationUpgrades).find((upgrade) => upgrade.name === upgradeName);\n if (upgrade === undefined) throw new Error(`No upgrade named '${upgradeName}'`);\n LevelUpgrade(corporation, upgrade);\n },\n issueDividends:\n (ctx: NetscriptContext) =>\n (_rate: unknown): void => {\n checkAccess(ctx);\n const rate = helpers.number(ctx, \"rate\", _rate);\n const max = CorporationConstants.DividendMaxRate;\n if (rate < 0 || rate > max)\n throw new Error(`Invalid value for rate field! Must be numeric, greater than 0, and less than ${max}`);\n const corporation = getCorporation();\n if (!corporation.public) throw helpers.makeRuntimeErrorMsg(ctx, `Your company has not gone public!`);\n IssueDividends(corporation, rate);\n },\n\n // If you modify these objects you will affect them for real, it's not\n // copies.\n getDivision:\n (ctx: NetscriptContext) =>\n (_divisionName: unknown): NSDivision => {\n checkAccess(ctx);\n const divisionName = helpers.string(ctx, \"divisionName\", _divisionName);\n const division = getDivision(divisionName);\n return getSafeDivision(division);\n },\n getCorporation: (ctx: NetscriptContext) => (): CorporationInfo => {\n checkAccess(ctx);\n const corporation = getCorporation();\n return {\n name: corporation.name,\n funds: corporation.funds,\n revenue: corporation.revenue,\n expenses: corporation.expenses,\n public: corporation.public,\n totalShares: corporation.totalShares,\n numShares: corporation.numShares,\n shareSaleCooldown: corporation.shareSaleCooldown,\n issuedShares: corporation.issuedShares,\n sharePrice: corporation.sharePrice,\n dividendRate: corporation.dividendRate,\n dividendTax: corporation.dividendTax,\n dividendEarnings: corporation.getCycleDividends() / CorporationConstants.SecsPerMarketCycle,\n state: corporation.state.getState(),\n divisions: corporation.divisions.map((division): NSDivision => getSafeDivision(division)),\n };\n },\n createCorporation:\n (ctx: NetscriptContext) =>\n (_corporationName: unknown, _selfFund: unknown = true): boolean => {\n const corporationName = helpers.string(ctx, \"corporationName\", _corporationName);\n const selfFund = !!_selfFund;\n return createCorporation(corporationName, selfFund);\n },\n hasUnlockUpgrade:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): boolean => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return hasUnlockUpgrade(upgradeName);\n },\n getUnlockUpgradeCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUnlockUpgradeCost(upgradeName);\n },\n getUpgradeLevel:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUpgradeLevel(ctx, upgradeName);\n },\n getUpgradeLevelCost:\n (ctx: NetscriptContext) =>\n (_upgradeName: unknown): number => {\n checkAccess(ctx);\n const upgradeName = helpers.string(ctx, \"upgradeName\", _upgradeName);\n return getUpgradeLevelCost(ctx, upgradeName);\n },\n getExpandIndustryCost:\n (ctx: NetscriptContext) =>\n (_industryName: unknown): number => {\n checkAccess(ctx);\n const industryName = helpers.string(ctx, \"industryName\", _industryName);\n return getExpandIndustryCost(industryName);\n },\n getExpandCityCost: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx);\n return getExpandCityCost();\n },\n getInvestmentOffer: (ctx: NetscriptContext) => (): InvestmentOffer => {\n checkAccess(ctx);\n return getInvestmentOffer();\n },\n acceptInvestmentOffer: (ctx: NetscriptContext) => (): boolean => {\n checkAccess(ctx);\n return acceptInvestmentOffer();\n },\n goPublic:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return goPublic(numShares);\n },\n sellShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): number => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return SellShares(getCorporation(), player, numShares);\n },\n buyBackShares:\n (ctx: NetscriptContext) =>\n (_numShares: unknown): boolean => {\n checkAccess(ctx);\n const numShares = helpers.number(ctx, \"numShares\", _numShares);\n return BuyBackShares(getCorporation(), player, numShares);\n },\n bribe:\n (ctx: NetscriptContext) =>\n (_factionName: unknown, _amountCash: unknown): boolean => {\n checkAccess(ctx);\n const factionName = helpers.string(ctx, \"factionName\", _factionName);\n const amountCash = helpers.number(ctx, \"amountCash\", _amountCash);\n return bribe(factionName, amountCash);\n },\n getBonusTime: (ctx: NetscriptContext) => (): number => {\n checkAccess(ctx);\n return Math.round(getCorporation().storedCycles / 5) * 1000;\n },\n };\n}\n","import { Reviver, Generic_toJSON, Generic_fromJSON, IReviverValue } from \"../utils/JSONReviver\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { Industries, IndustryStartingCosts, IndustryResearchTrees } from \"./IndustryData\";\nimport { CorporationConstants } from \"./data/Constants\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { Material } from \"./Material\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { calculateEffectWithFactors } from \"../utils/calculateEffectWithFactors\";\nimport { OfficeSpace } from \"./OfficeSpace\";\nimport { Product } from \"./Product\";\nimport { dialogBoxCreate } from \"../ui/React/DialogBox\";\nimport { isString } from \"../utils/helpers/isString\";\nimport { MaterialSizes } from \"./MaterialSizes\";\nimport { Warehouse } from \"./Warehouse\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\n\ninterface IParams {\n name?: string;\n corp?: ICorporation;\n type?: string;\n}\n\nexport class Industry implements IIndustry {\n name = \"\";\n type = Industries.Agriculture;\n sciResearch = new Material({ name: \"Scientific Research\" });\n researched: { [key: string]: boolean | undefined } = {};\n reqMats: { [key: string]: number | undefined } = {};\n\n //An array of the name of materials being produced\n prodMats: string[] = [];\n\n products: { [key: string]: Product | undefined } = {};\n makesProducts = false;\n\n awareness = 0;\n popularity = 0; //Should always be less than awareness\n startingCost = 0;\n\n /* The following are factors for how much production/other things are increased by\n different factors. The production increase always has diminishing returns,\n and they are all reprsented by exponentials of < 1 (e.g x ^ 0.5, x ^ 0.8)\n The number for these represent the exponential. A lower number means more\n diminishing returns */\n reFac = 0; //Real estate Factor\n sciFac = 0; //Scientific Research Factor, affects quality\n hwFac = 0; //Hardware factor\n robFac = 0; //Robotics Factor\n aiFac = 0; //AI Cores factor;\n advFac = 0; //Advertising factor, affects sales\n\n prodMult = 0; //Production multiplier\n\n //Financials\n lastCycleRevenue: number;\n lastCycleExpenses: number;\n thisCycleRevenue: number;\n thisCycleExpenses: number;\n\n state = \"START\";\n newInd = true;\n\n //Maps locations to warehouses. 0 if no warehouse at that location\n warehouses: { [key: string]: Warehouse | 0 };\n\n //Maps locations to offices. 0 if no office at that location\n offices: { [key: string]: OfficeSpace | 0 } = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new OfficeSpace({\n loc: CityName.Sector12,\n size: CorporationConstants.OfficeInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n numAdVerts = 0;\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"\";\n this.type = params.type ? params.type : Industries.Agriculture;\n\n //Financials\n this.lastCycleRevenue = 0;\n this.lastCycleExpenses = 0;\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n this.warehouses = {\n [CityName.Aevum]: 0,\n [CityName.Chongqing]: 0,\n [CityName.Sector12]: new Warehouse({\n corp: params.corp,\n industry: this,\n loc: CityName.Sector12,\n size: CorporationConstants.WarehouseInitialSize,\n }),\n [CityName.NewTokyo]: 0,\n [CityName.Ishima]: 0,\n [CityName.Volhaven]: 0,\n };\n\n this.init();\n }\n\n init(): void {\n //Set the unique properties of an industry (how much its affected by real estate/scientific research, etc.)\n const startingCost = IndustryStartingCosts[this.type];\n if (startingCost === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.startingCost = startingCost;\n switch (this.type) {\n case Industries.Energy:\n this.reFac = 0.65;\n this.sciFac = 0.7;\n this.robFac = 0.05;\n this.aiFac = 0.3;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.2,\n };\n this.prodMats = [\"Energy\"];\n break;\n case Industries.Utilities:\n case \"Utilities\":\n this.reFac = 0.5;\n this.sciFac = 0.6;\n this.robFac = 0.4;\n this.aiFac = 0.4;\n this.advFac = 0.08;\n this.reqMats = {\n Hardware: 0.1,\n Metal: 0.1,\n };\n this.prodMats = [\"Water\"];\n break;\n case Industries.Agriculture:\n this.reFac = 0.72;\n this.sciFac = 0.5;\n this.hwFac = 0.2;\n this.robFac = 0.3;\n this.aiFac = 0.3;\n this.advFac = 0.04;\n this.reqMats = {\n Water: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"Plants\", \"Food\"];\n break;\n case Industries.Fishing:\n this.reFac = 0.15;\n this.sciFac = 0.35;\n this.hwFac = 0.35;\n this.robFac = 0.5;\n this.aiFac = 0.2;\n this.advFac = 0.08;\n this.reqMats = {\n Energy: 0.5,\n };\n this.prodMats = [\"Food\"];\n break;\n case Industries.Mining:\n this.reFac = 0.3;\n this.sciFac = 0.26;\n this.hwFac = 0.4;\n this.robFac = 0.45;\n this.aiFac = 0.45;\n this.advFac = 0.06;\n this.reqMats = {\n Energy: 0.8,\n };\n this.prodMats = [\"Metal\"];\n break;\n case Industries.Food:\n //reFac is unique for this bc it diminishes greatly per city. Handle this separately in code?\n this.sciFac = 0.12;\n this.hwFac = 0.15;\n this.robFac = 0.3;\n this.aiFac = 0.25;\n this.advFac = 0.25;\n this.reFac = 0.05;\n this.reqMats = {\n Food: 0.5,\n Water: 0.5,\n Energy: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Tobacco:\n this.reFac = 0.15;\n this.sciFac = 0.75;\n this.hwFac = 0.15;\n this.robFac = 0.2;\n this.aiFac = 0.15;\n this.advFac = 0.2;\n this.reqMats = {\n Plants: 1,\n Water: 0.2,\n };\n this.makesProducts = true;\n break;\n case Industries.Chemical:\n this.reFac = 0.25;\n this.sciFac = 0.75;\n this.hwFac = 0.2;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.07;\n this.reqMats = {\n Plants: 1,\n Energy: 0.5,\n Water: 0.5,\n };\n this.prodMats = [\"Chemicals\"];\n break;\n case Industries.Pharmaceutical:\n this.reFac = 0.05;\n this.sciFac = 0.8;\n this.hwFac = 0.15;\n this.robFac = 0.25;\n this.aiFac = 0.2;\n this.advFac = 0.16;\n this.reqMats = {\n Chemicals: 2,\n Energy: 1,\n Water: 0.5,\n };\n this.prodMats = [\"Drugs\"];\n this.makesProducts = true;\n break;\n case Industries.Computer:\n case \"Computer\":\n this.reFac = 0.2;\n this.sciFac = 0.62;\n this.robFac = 0.36;\n this.aiFac = 0.19;\n this.advFac = 0.17;\n this.reqMats = {\n Metal: 2,\n Energy: 1,\n };\n this.prodMats = [\"Hardware\"];\n this.makesProducts = true;\n break;\n case Industries.Robotics:\n this.reFac = 0.32;\n this.sciFac = 0.65;\n this.aiFac = 0.36;\n this.advFac = 0.18;\n this.hwFac = 0.19;\n this.reqMats = {\n Hardware: 5,\n Energy: 3,\n };\n this.prodMats = [\"Robots\"];\n this.makesProducts = true;\n break;\n case Industries.Software:\n this.sciFac = 0.62;\n this.advFac = 0.16;\n this.hwFac = 0.25;\n this.reFac = 0.15;\n this.aiFac = 0.18;\n this.robFac = 0.05;\n this.reqMats = {\n Hardware: 0.5,\n Energy: 0.5,\n };\n this.prodMats = [\"AICores\"];\n this.makesProducts = true;\n break;\n case Industries.Healthcare:\n this.reFac = 0.1;\n this.sciFac = 0.75;\n this.advFac = 0.11;\n this.hwFac = 0.1;\n this.robFac = 0.1;\n this.aiFac = 0.1;\n this.reqMats = {\n Robots: 10,\n AICores: 5,\n Energy: 5,\n Water: 5,\n };\n this.makesProducts = true;\n break;\n case Industries.RealEstate:\n this.robFac = 0.6;\n this.aiFac = 0.6;\n this.advFac = 0.25;\n this.sciFac = 0.05;\n this.hwFac = 0.05;\n this.reqMats = {\n Metal: 5,\n Energy: 5,\n Water: 2,\n Hardware: 4,\n };\n this.prodMats = [\"RealEstate\"];\n this.makesProducts = true;\n break;\n default:\n console.error(`Invalid Industry Type passed into Industry.init(): ${this.type}`);\n return;\n }\n }\n\n getProductDescriptionText(): string {\n if (!this.makesProducts) return \"\";\n switch (this.type) {\n case Industries.Food:\n return \"create and manage restaurants\";\n case Industries.Tobacco:\n return \"create tobacco and tobacco-related products\";\n case Industries.Pharmaceutical:\n return \"develop new pharmaceutical drugs\";\n case Industries.Computer:\n case \"Computer\":\n return \"create new computer hardware and networking infrastructures\";\n case Industries.Robotics:\n return \"build specialized robots and robot-related products\";\n case Industries.Software:\n return \"develop computer software\";\n case Industries.Healthcare:\n return \"build and manage hospitals\";\n case Industries.RealEstate:\n return \"develop and manage real estate properties\";\n default:\n console.error(\"Invalid industry type in Industry.getProductDescriptionText\");\n return \"\";\n }\n }\n\n getMaximumNumberProducts(): number {\n if (!this.makesProducts) return 0;\n\n // Calculate additional number of allowed Products from Research/Upgrades\n let additional = 0;\n if (this.hasResearch(\"uPgrade: Capacity.I\")) ++additional;\n if (this.hasResearch(\"uPgrade: Capacity.II\")) ++additional;\n\n return CorporationConstants.BaseMaxProducts + additional;\n }\n\n hasMaximumNumberProducts(): boolean {\n return Object.keys(this.products).length >= this.getMaximumNumberProducts();\n }\n\n //Calculates the values that factor into the production and properties of\n //materials/products (such as quality, etc.)\n calculateProductionFactors(): void {\n let multSum = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const warehouse = this.warehouses[city];\n if (!(warehouse instanceof Warehouse)) {\n continue;\n }\n\n const materials = warehouse.materials;\n\n const cityMult =\n Math.pow(0.002 * materials.RealEstate.qty + 1, this.reFac) *\n Math.pow(0.002 * materials.Hardware.qty + 1, this.hwFac) *\n Math.pow(0.002 * materials.Robots.qty + 1, this.robFac) *\n Math.pow(0.002 * materials.AICores.qty + 1, this.aiFac);\n multSum += Math.pow(cityMult, 0.73);\n }\n\n multSum < 1 ? (this.prodMult = 1) : (this.prodMult = multSum);\n }\n\n updateWarehouseSizeUsed(warehouse: Warehouse): void {\n warehouse.updateMaterialSizeUsed();\n\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n warehouse.sizeUsed += prod.data[warehouse.loc][0] * prod.siz;\n }\n }\n }\n\n process(marketCycles = 1, state: string, corporation: ICorporation): void {\n this.state = state;\n\n //At the start of a cycle, store and reset revenue/expenses\n //Then calculate salaries and processs the markets\n if (state === \"START\") {\n if (isNaN(this.thisCycleRevenue) || isNaN(this.thisCycleExpenses)) {\n console.error(\"NaN in Corporation's computed revenue/expenses\");\n dialogBoxCreate(\n \"Something went wrong when compting Corporation's revenue/expenses. This is a bug. Please report to game developer\",\n );\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n }\n this.lastCycleRevenue = this.thisCycleRevenue / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.lastCycleExpenses = this.thisCycleExpenses / (marketCycles * CorporationConstants.SecsPerMarketCycle);\n this.thisCycleRevenue = 0;\n this.thisCycleExpenses = 0;\n\n // Once you start making revenue, the player should no longer be\n // considered new, and therefore no longer needs the 'tutorial' UI elements\n if (this.lastCycleRevenue > 0) {\n this.newInd = false;\n }\n\n // Process offices (and the employees in them)\n let employeeSalary = 0;\n for (const officeLoc of Object.keys(this.offices)) {\n const office = this.offices[officeLoc];\n if (office === 0) continue;\n if (office instanceof OfficeSpace) {\n employeeSalary += office.process(marketCycles, corporation, this);\n }\n }\n this.thisCycleExpenses = this.thisCycleExpenses + employeeSalary;\n\n // Process change in demand/competition of materials/products\n this.processMaterialMarket();\n this.processProductMarket(marketCycles);\n\n // Process loss of popularity\n this.popularity -= marketCycles * 0.0001;\n this.popularity = Math.max(0, this.popularity);\n\n // Process Dreamsense gains\n const popularityGain = corporation.getDreamSenseGain(),\n awarenessGain = popularityGain * 4;\n if (popularityGain > 0) {\n const awareness = this.awareness + awarenessGain * marketCycles;\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = this.popularity + popularityGain * marketCycles;\n this.popularity = Math.min(popularity, Number.MAX_VALUE);\n }\n\n return;\n }\n\n // Process production, purchase, and import/export of materials\n let res = this.processMaterials(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n\n // Process creation, production & sale of products\n res = this.processProducts(marketCycles, corporation);\n if (Array.isArray(res)) {\n this.thisCycleRevenue = this.thisCycleRevenue + res[0];\n this.thisCycleExpenses = this.thisCycleExpenses + res[1];\n }\n }\n\n // Process change in demand and competition for this industry's materials\n processMaterialMarket(): void {\n //References to prodMats and reqMats\n const reqMats = this.reqMats,\n prodMats = this.prodMats;\n\n //Only 'process the market' for materials that this industry deals with\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n //If this industry has a warehouse in this city, process the market\n //for every material this industry requires or produces\n if (this.warehouses[CorporationConstants.Cities[i]] instanceof Warehouse) {\n const wh = this.warehouses[CorporationConstants.Cities[i]];\n if (wh === 0) continue;\n for (const name of Object.keys(reqMats)) {\n if (reqMats.hasOwnProperty(name)) {\n wh.materials[name].processMarket();\n }\n }\n\n //Produced materials are stored in an array\n for (let foo = 0; foo < prodMats.length; ++foo) {\n wh.materials[prodMats[foo]].processMarket();\n }\n\n //Process these twice because these boost production\n wh.materials[\"Hardware\"].processMarket();\n wh.materials[\"Robots\"].processMarket();\n wh.materials[\"AICores\"].processMarket();\n wh.materials[\"RealEstate\"].processMarket();\n }\n }\n }\n\n // Process change in demand and competition for this industry's products\n processProductMarket(marketCycles = 1): void {\n // Demand gradually decreases, and competition gradually increases\n for (const name of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(name)) {\n const product = this.products[name];\n if (product === undefined) continue;\n let change = getRandomInt(0, 3) * 0.0004;\n if (change === 0) continue;\n\n if (\n this.type === Industries.Pharmaceutical ||\n this.type === Industries.Software ||\n this.type === Industries.Robotics\n ) {\n change *= 3;\n }\n change *= marketCycles;\n product.dmd -= change;\n product.cmp += change;\n product.cmp = Math.min(product.cmp, 99.99);\n product.dmd = Math.max(product.dmd, 0.001);\n }\n }\n }\n\n //Process production, purchase, and import/export of materials\n processMaterials(marketCycles = 1, corporation: ICorporation): [number, number] {\n let revenue = 0,\n expenses = 0;\n this.calculateProductionFactors();\n\n //At the start of the export state, set the imports of everything to 0\n if (this.state === \"EXPORT\") {\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n if (!(this.warehouses[city] instanceof Warehouse)) {\n continue;\n }\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.imp = 0;\n }\n }\n }\n }\n\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n\n if (this.warehouses[city] instanceof Warehouse) {\n const warehouse = this.warehouses[city];\n if (warehouse === 0) continue;\n\n switch (this.state) {\n case \"PURCHASE\": {\n /* Process purchase of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n const mat = warehouse.materials[matName];\n let buyAmt = 0;\n let maxAmt = 0;\n if (warehouse.smartSupplyEnabled && Object.keys(this.reqMats).includes(matName)) {\n continue;\n }\n buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) {\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n this.updateWarehouseSizeUsed(warehouse);\n } //End process purchase of materials\n\n // smart supply\n const smartBuy: { [key: string]: number | undefined } = {};\n for (const matName of Object.keys(warehouse.materials)) {\n if (!warehouse.materials.hasOwnProperty(matName)) continue;\n if (!warehouse.smartSupplyEnabled || !Object.keys(this.reqMats).includes(matName)) continue;\n const mat = warehouse.materials[matName];\n\n //Smart supply tracker is stored as per second rate\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n mat.buy = reqMat * warehouse.smartSupplyStore;\n let buyAmt = mat.buy * CorporationConstants.SecsPerMarketCycle * marketCycles;\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / MaterialSizes[matName]);\n buyAmt = Math.min(buyAmt, maxAmt);\n if (buyAmt > 0) smartBuy[matName] = buyAmt;\n }\n\n // Find which material were trying to create the least amount of product with.\n let worseAmt = 1e99;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n const amt = buyAmt / reqMat;\n if (amt < worseAmt) worseAmt = amt;\n }\n\n // Align all the materials to the smallest amount.\n for (const matName of Object.keys(smartBuy)) {\n const reqMat = this.reqMats[matName];\n if (reqMat === undefined) throw new Error(`reqMat \"${matName}\" is undefined`);\n smartBuy[matName] = worseAmt * reqMat;\n }\n\n // Calculate the total size of all things were trying to buy\n let totalSize = 0;\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n totalSize += buyAmt * MaterialSizes[matName];\n }\n\n // Shrink to the size of available space.\n const freeSpace = warehouse.size - warehouse.sizeUsed;\n if (totalSize > freeSpace) {\n for (const matName of Object.keys(smartBuy)) {\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.floor((buyAmt * freeSpace) / totalSize);\n }\n }\n\n // Use the materials already in the warehouse if the option is on.\n for (const matName of Object.keys(smartBuy)) {\n if (!warehouse.smartSupplyUseLeftovers[matName]) continue;\n const mat = warehouse.materials[matName];\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n smartBuy[matName] = Math.max(0, buyAmt - mat.qty);\n }\n\n // buy them\n for (const matName of Object.keys(smartBuy)) {\n const mat = warehouse.materials[matName];\n const buyAmt = smartBuy[matName];\n if (buyAmt === undefined) throw new Error(`Somehow smartbuy matname is undefined`);\n mat.qty += buyAmt;\n expenses += buyAmt * mat.bCost;\n }\n break;\n }\n case \"PRODUCTION\":\n warehouse.smartSupplyStore = 0; //Reset smart supply amount\n\n /* Process production of materials */\n if (this.prodMats.length > 0) {\n const mat = warehouse.materials[this.prodMats[0]];\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office) *\n this.prodMult * // Multiplier from materials\n corporation.getProductionMultiplier() *\n this.getProductionMultiplier(); // Multiplier from Research\n let prod;\n\n if (mat.prdman[0]) {\n //Production is manually limited\n prod = Math.min(maxProd, mat.prdman[1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles; //Convert production from per second to per market cycle\n\n // Calculate net change in warehouse storage making the produced materials will cost\n let totalMatSize = 0;\n for (let tmp = 0; tmp < this.prodMats.length; ++tmp) {\n totalMatSize += MaterialSizes[this.prodMats[tmp]];\n }\n for (const reqMatName of Object.keys(this.reqMats)) {\n const normQty = this.reqMats[reqMatName];\n if (normQty === undefined) continue;\n totalMatSize -= MaterialSizes[reqMatName] * normQty;\n }\n // If not enough space in warehouse, limit the amount of produced materials\n if (totalMatSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / totalMatSize);\n prod = Math.min(maxAmt, prod);\n }\n\n if (prod < 0) {\n prod = 0;\n }\n\n // Keep track of production for smart supply (/s)\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n // Make sure we have enough resource to make our materials\n let producableFrac = 1;\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const req = reqMat * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n if (producableFrac <= 0) {\n producableFrac = 0;\n prod = 0;\n }\n\n // Make our materials if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(this.reqMats)) {\n const reqMat = this.reqMats[reqMatName];\n if (reqMat === undefined) continue;\n const reqMatQtyNeeded = reqMat * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd = 0;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n for (let j = 0; j < this.prodMats.length; ++j) {\n warehouse.materials[this.prodMats[j]].qty += prod * producableFrac;\n warehouse.materials[this.prodMats[j]].qlt =\n office.employeeProd[EmployeePositions.Engineer] / 90 +\n Math.pow(this.sciResearch.qty, this.sciFac) +\n Math.pow(warehouse.materials[\"AICores\"].qty, this.aiFac) / 10e3;\n }\n } else {\n for (const reqMatName of Object.keys(this.reqMats)) {\n if (this.reqMats.hasOwnProperty(reqMatName)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n }\n\n //Per second\n const fooProd = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n for (let fooI = 0; fooI < this.prodMats.length; ++fooI) {\n warehouse.materials[this.prodMats[fooI]].prd = fooProd;\n }\n } else {\n //If this doesn't produce any materials, then it only creates\n //Products. Creating products will consume materials. The\n //Production of all consumed materials must be set to 0\n for (const reqMatName of Object.keys(this.reqMats)) {\n warehouse.materials[reqMatName].prd = 0;\n }\n }\n break;\n\n case \"SALE\":\n /* Process sale of materials */\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n if (mat.sCost < 0 || mat.sllman[0] === false) {\n mat.sll = 0;\n continue;\n }\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(mat); //Competition + demand\n\n // Determine the cost that the material will be sold at\n const markupLimit = mat.getMarkupLimit();\n let sCost;\n if (mat.marketTa2) {\n const prod = mat.prd;\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n (mat.qlt + 0.001) *\n marketFactor *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = mat.bCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + mat.bCost;\n }\n\n // We'll store this \"Optimal Price\" in a property so that we don't have\n // to re-calculate it for the UI\n mat.marketTa2Price = optimalPrice;\n\n sCost = optimalPrice;\n } else if (mat.marketTa1) {\n sCost = mat.bCost + markupLimit;\n } else if (isString(mat.sCost)) {\n sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sCost = eval(sCost);\n } else {\n sCost = mat.sCost;\n }\n\n // Calculate how much of the material sells (per second)\n let markup = 1;\n if (sCost > mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - mat.bCost), 2);\n }\n } else if (sCost < mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = mat.bCost / sCost;\n }\n }\n\n mat.maxsll =\n (mat.qlt + 0.001) *\n marketFactor *\n markup *\n businessFactor *\n corporation.getSalesMultiplier() *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (isString(mat.sllman[1])) {\n //Dynamically evaluated\n let tmp = (mat.sllman[1] as string).replace(/MAX/g, (mat.maxsll + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, mat.prd + \"\");\n try {\n sellAmt = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell amount for material \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. The sell amount \" +\n \"is being set to zero\",\n );\n sellAmt = 0;\n }\n sellAmt = Math.min(mat.maxsll, sellAmt);\n } else if (mat.sllman[1] === -1) {\n //Backwards compatibility, -1 = MAX\n sellAmt = mat.maxsll;\n } else {\n //Player's input value is just a number\n sellAmt = Math.min(mat.maxsll, mat.sllman[1] as number);\n }\n\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(mat.qty, sellAmt);\n if (sellAmt < 0) {\n console.warn(`sellAmt calculated to be negative for ${matName} in ${city}`);\n mat.sll = 0;\n continue;\n }\n if (sellAmt && sCost >= 0) {\n mat.qty -= sellAmt;\n revenue += sellAmt * sCost;\n mat.sll = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n } else {\n mat.sll = 0;\n }\n }\n } //End processing of sale of materials\n break;\n\n case \"EXPORT\":\n for (const matName of Object.keys(warehouse.materials)) {\n if (warehouse.materials.hasOwnProperty(matName)) {\n const mat = warehouse.materials[matName];\n mat.totalExp = 0; //Reset export\n for (let expI = 0; expI < mat.exp.length; ++expI) {\n const exp = mat.exp[expI];\n const amtStr = exp.amt.replace(\n /MAX/g,\n (mat.qty / (CorporationConstants.SecsPerMarketCycle * marketCycles) + \"\").toUpperCase(),\n );\n let amt = 0;\n try {\n amt = eval(amtStr);\n } catch (e) {\n dialogBoxCreate(\n \"Calculating export for \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" division failed with \" +\n \"error: \" +\n e,\n );\n continue;\n }\n if (isNaN(amt)) {\n dialogBoxCreate(\n \"Error calculating export amount for \" +\n mat.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" division.\",\n );\n continue;\n }\n amt = amt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n if (mat.qty < amt) {\n amt = mat.qty;\n }\n if (amt === 0) {\n break; //None left\n }\n for (let foo = 0; foo < corporation.divisions.length; ++foo) {\n if (corporation.divisions[foo].name === exp.ind) {\n const expIndustry = corporation.divisions[foo];\n const expWarehouse = expIndustry.warehouses[exp.city];\n if (!(expWarehouse instanceof Warehouse)) {\n console.error(`Invalid export! ${expIndustry.name} ${exp.city}`);\n break;\n }\n\n // Make sure theres enough space in warehouse\n if (expWarehouse.sizeUsed >= expWarehouse.size) {\n // Warehouse at capacity. Exporting doesnt\n // affect revenue so just return 0's\n return [0, 0];\n } else {\n const maxAmt = Math.floor((expWarehouse.size - expWarehouse.sizeUsed) / MaterialSizes[matName]);\n amt = Math.min(maxAmt, amt);\n }\n expWarehouse.materials[matName].imp +=\n amt / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n expWarehouse.materials[matName].qty += amt;\n expWarehouse.materials[matName].qlt = mat.qlt;\n mat.qty -= amt;\n mat.totalExp += amt;\n expIndustry.updateWarehouseSizeUsed(expWarehouse);\n break;\n }\n }\n }\n //totalExp should be per second\n mat.totalExp /= CorporationConstants.SecsPerMarketCycle * marketCycles;\n }\n }\n\n break;\n\n case \"START\":\n break;\n default:\n console.error(`Invalid state: ${this.state}`);\n break;\n } //End switch(this.state)\n this.updateWarehouseSizeUsed(warehouse);\n } // End warehouse\n\n //Produce Scientific Research based on R&D employees\n //Scientific Research can be produced without a warehouse\n if (office instanceof OfficeSpace) {\n this.sciResearch.qty +=\n 0.004 *\n Math.pow(office.employeeProd[EmployeePositions.RandD], 0.5) *\n corporation.getScientificResearchMultiplier() *\n this.getScientificResearchMultiplier();\n }\n }\n return [revenue, expenses];\n }\n\n //Process production & sale of this industry's FINISHED products (including all of their stats)\n processProducts(marketCycles = 1, corporation: ICorporation): [number, number] {\n let revenue = 0;\n const expenses = 0;\n\n //Create products\n if (this.state === \"PRODUCTION\") {\n for (const prodName of Object.keys(this.products)) {\n const prod = this.products[prodName];\n if (prod === undefined) continue;\n if (!prod.fin) {\n const city = prod.createCity;\n const office = this.offices[city];\n if (office === 0) continue;\n\n prod.createProduct(marketCycles, office.employeeProd);\n if (prod.prog >= 100) {\n prod.finishProduct(this);\n }\n break;\n }\n }\n }\n\n //Produce Products\n for (const prodName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(prodName)) {\n const prod = this.products[prodName];\n if (prod instanceof Product && prod.fin) {\n revenue += this.processProduct(marketCycles, prod, corporation);\n }\n }\n }\n return [revenue, expenses];\n }\n\n //Processes FINISHED products\n processProduct(marketCycles = 1, product: Product, corporation: ICorporation): number {\n let totalProfit = 0;\n for (let i = 0; i < CorporationConstants.Cities.length; ++i) {\n const city = CorporationConstants.Cities[i];\n const office = this.offices[city];\n if (office === 0) continue;\n const warehouse = this.warehouses[city];\n if (warehouse instanceof Warehouse) {\n switch (this.state) {\n case \"PRODUCTION\": {\n //Calculate the maximum production of this material based\n //on the office's productivity\n const maxProd =\n this.getOfficeProductivity(office, { forProduct: true }) *\n corporation.getProductionMultiplier() *\n this.prodMult * // Multiplier from materials\n this.getProductionMultiplier() * // Multiplier from research\n this.getProductProductionMultiplier(); // Multiplier from research\n let prod;\n\n //Account for whether production is manually limited\n if (product.prdman[city][0]) {\n prod = Math.min(maxProd, product.prdman[city][1]);\n } else {\n prod = maxProd;\n }\n prod *= CorporationConstants.SecsPerMarketCycle * marketCycles;\n\n //Calculate net change in warehouse storage making the Products will cost\n let netStorageSize = product.siz;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const normQty = product.reqMats[reqMatName];\n netStorageSize -= MaterialSizes[reqMatName] * normQty;\n }\n }\n\n //If there's not enough space in warehouse, limit the amount of Product\n if (netStorageSize > 0) {\n const maxAmt = Math.floor((warehouse.size - warehouse.sizeUsed) / netStorageSize);\n prod = Math.min(maxAmt, prod);\n }\n\n warehouse.smartSupplyStore += prod / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n\n //Make sure we have enough resources to make our Products\n let producableFrac = 1;\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const req = product.reqMats[reqMatName] * prod;\n if (warehouse.materials[reqMatName].qty < req) {\n producableFrac = Math.min(producableFrac, warehouse.materials[reqMatName].qty / req);\n }\n }\n }\n\n //Make our Products if they are producable\n if (producableFrac > 0 && prod > 0) {\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n const reqMatQtyNeeded = product.reqMats[reqMatName] * prod * producableFrac;\n warehouse.materials[reqMatName].qty -= reqMatQtyNeeded;\n warehouse.materials[reqMatName].prd -=\n reqMatQtyNeeded / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n }\n }\n //Quantity\n product.data[city][0] += prod * producableFrac;\n }\n\n //Keep track of production Per second\n product.data[city][1] = (prod * producableFrac) / (CorporationConstants.SecsPerMarketCycle * marketCycles);\n break;\n }\n case \"SALE\": {\n //Process sale of Products\n product.pCost = 0; //Estimated production cost\n for (const reqMatName of Object.keys(product.reqMats)) {\n if (product.reqMats.hasOwnProperty(reqMatName)) {\n product.pCost += product.reqMats[reqMatName] * warehouse.materials[reqMatName].bCost;\n }\n }\n\n // Since its a product, its production cost is increased for labor\n product.pCost *= CorporationConstants.ProductProductionCostRatio;\n\n // Sale multipliers\n const businessFactor = this.getBusinessFactor(office); //Business employee productivity\n const advertisingFactor = this.getAdvertisingFactors()[0]; //Awareness + popularity\n const marketFactor = this.getMarketFactor(product); //Competition + demand\n\n // Calculate Sale Cost (sCost), which could be dynamically evaluated\n const markupLimit = product.rat / product.mku;\n let sCost;\n if (product.marketTa2) {\n const prod = product.data[city][1];\n\n // Reverse engineer the 'maxSell' formula\n // 1. Set 'maxSell' = prod\n // 2. Substitute formula for 'markup'\n // 3. Solve for 'sCost'roduct.pCost = sCost\n const numerator = markupLimit;\n const sqrtNumerator = prod;\n const sqrtDenominator =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n const denominator = Math.sqrt(sqrtNumerator / sqrtDenominator);\n let optimalPrice;\n if (sqrtDenominator === 0 || denominator === 0) {\n if (sqrtNumerator === 0) {\n optimalPrice = 0; // No production\n } else {\n optimalPrice = product.pCost + markupLimit;\n console.warn(`In Corporation, found illegal 0s when trying to calculate MarketTA2 sale cost`);\n }\n } else {\n optimalPrice = numerator / denominator + product.pCost;\n }\n\n // Store this \"optimal Price\" in a property so we don't have to re-calculate for UI\n product.marketTa2Price[city] = optimalPrice;\n sCost = optimalPrice;\n } else if (product.marketTa1) {\n sCost = product.pCost + markupLimit;\n } else if (isString(product.sCost)) {\n const sCostString = product.sCost as string;\n if (product.mku === 0) {\n console.error(`mku is zero, reverting to 1 to avoid Infinity`);\n product.mku = 1;\n }\n sCost = sCostString.replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sCost = eval(sCost);\n } else {\n sCost = product.sCost;\n }\n\n let markup = 1;\n if (sCost > product.pCost) {\n if (sCost - product.pCost > markupLimit) {\n markup = markupLimit / (sCost - product.pCost);\n }\n }\n\n product.maxsll =\n 0.5 *\n Math.pow(product.rat, 0.65) *\n marketFactor *\n corporation.getSalesMultiplier() *\n Math.pow(markup, 2) *\n businessFactor *\n advertisingFactor *\n this.getSalesMultiplier();\n let sellAmt;\n if (product.sllman[city][0] && isString(product.sllman[city][1])) {\n //Sell amount is dynamically evaluated\n let tmp = product.sllman[city][1].replace(/MAX/g, (product.maxsll + \"\").toUpperCase());\n tmp = tmp.replace(/PROD/g, product.data[city][1]);\n try {\n tmp = eval(tmp);\n } catch (e) {\n dialogBoxCreate(\n \"Error evaluating your sell price expression for \" +\n product.name +\n \" in \" +\n this.name +\n \"'s \" +\n city +\n \" office. Sell price is being set to MAX\",\n );\n tmp = product.maxsll;\n }\n sellAmt = Math.min(product.maxsll, tmp);\n } else if (product.sllman[city][0] && product.sllman[city][1] > 0) {\n //Sell amount is manually limited\n sellAmt = Math.min(product.maxsll, product.sllman[city][1]);\n } else if (product.sllman[city][0] === false) {\n sellAmt = 0;\n } else {\n sellAmt = product.maxsll;\n }\n if (sellAmt < 0) {\n sellAmt = 0;\n }\n sellAmt = sellAmt * CorporationConstants.SecsPerMarketCycle * marketCycles;\n sellAmt = Math.min(product.data[city][0], sellAmt); //data[0] is qty\n if (sellAmt && sCost) {\n product.data[city][0] -= sellAmt; //data[0] is qty\n totalProfit += sellAmt * sCost;\n product.data[city][2] = sellAmt / (CorporationConstants.SecsPerMarketCycle * marketCycles); //data[2] is sell property\n } else {\n product.data[city][2] = 0; //data[2] is sell property\n }\n break;\n }\n case \"START\":\n case \"PURCHASE\":\n case \"EXPORT\":\n break;\n default:\n console.error(`Invalid State: ${this.state}`);\n break;\n } //End switch(this.state)\n }\n }\n return totalProfit;\n }\n\n discontinueProduct(product: Product): void {\n for (const productName of Object.keys(this.products)) {\n if (this.products.hasOwnProperty(productName)) {\n if (product === this.products[productName]) {\n delete this.products[productName];\n }\n }\n }\n }\n\n getAdVertCost(): number {\n return 1e9 * Math.pow(1.06, this.numAdVerts);\n }\n\n applyAdVert(corporation: ICorporation): void {\n const advMult = corporation.getAdvertisingMultiplier() * this.getAdvertisingMultiplier();\n const awareness = (this.awareness + 3 * advMult) * (1.01 * advMult);\n this.awareness = Math.min(awareness, Number.MAX_VALUE);\n\n const popularity = (this.popularity + 1 * advMult) * ((1 + getRandomInt(1, 3) / 100) * advMult);\n this.popularity = Math.min(popularity, Number.MAX_VALUE);\n\n ++this.numAdVerts;\n }\n\n // Returns how much of a material can be produced based of office productivity (employee stats)\n getOfficeProductivity(office: OfficeSpace, params: { forProduct?: boolean } = {}): number {\n const opProd = office.employeeProd[EmployeePositions.Operations];\n const engrProd = office.employeeProd[EmployeePositions.Engineer];\n const mgmtProd = office.employeeProd[EmployeePositions.Management];\n const total = opProd + engrProd + mgmtProd;\n\n if (total <= 0) return 0;\n\n // Management is a multiplier for the production from Operations and Engineers\n const mgmtFactor = 1 + mgmtProd / (1.2 * total);\n\n // For production, Operations is slightly more important than engineering\n // Both Engineering and Operations have diminishing returns\n const prod = (Math.pow(opProd, 0.4) + Math.pow(engrProd, 0.3)) * mgmtFactor;\n\n // Generic multiplier for the production. Used for game-balancing purposes\n const balancingMult = 0.05;\n\n if (params && params.forProduct) {\n // Products are harder to create and therefore have less production\n return 0.5 * balancingMult * prod;\n } else {\n return balancingMult * prod;\n }\n }\n\n // Returns a multiplier based on the office' 'Business' employees that affects sales\n getBusinessFactor(office: OfficeSpace): number {\n const businessProd = 1 + office.employeeProd[EmployeePositions.Business];\n\n return calculateEffectWithFactors(businessProd, 0.26, 10e3);\n }\n\n //Returns a set of multipliers based on the Industry's awareness, popularity, and advFac. This\n //multiplier affects sales. The result is:\n // [Total sales mult, total awareness mult, total pop mult, awareness/pop ratio mult]\n getAdvertisingFactors(): [number, number, number, number] {\n const awarenessFac = Math.pow(this.awareness + 1, this.advFac);\n const popularityFac = Math.pow(this.popularity + 1, this.advFac);\n const ratioFac = this.awareness === 0 ? 0.01 : Math.max((this.popularity + 0.001) / this.awareness, 0.01);\n const totalFac = Math.pow(awarenessFac * popularityFac * ratioFac, 0.85);\n return [totalFac, awarenessFac, popularityFac, ratioFac];\n }\n\n //Returns a multiplier based on a materials demand and competition that affects sales\n getMarketFactor(mat: { dmd: number; cmp: number }): number {\n return Math.max(0.1, (mat.dmd * (100 - mat.cmp)) / 100);\n }\n\n // Returns a boolean indicating whether this Industry has the specified Research\n hasResearch(name: string): boolean {\n return this.researched[name] === true;\n }\n\n updateResearchTree(): void {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry \"${this.type}\"`);\n\n // Since ResearchTree data isnt saved, we'll update the Research Tree data\n // based on the stored 'researched' property in the Industry object\n if (Object.keys(researchTree.researched).length !== Object.keys(this.researched).length) {\n for (const research of Object.keys(this.researched)) {\n researchTree.research(research);\n }\n }\n }\n\n // Get multipliers from Research\n getAdvertisingMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getAdvertisingMultiplier();\n }\n\n getEmployeeChaMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeChaMultiplier();\n }\n\n getEmployeeCreMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeCreMultiplier();\n }\n\n getEmployeeEffMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeEffMultiplier();\n }\n\n getEmployeeIntMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getEmployeeIntMultiplier();\n }\n\n getProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductionMultiplier();\n }\n\n getProductProductionMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getProductProductionMultiplier();\n }\n\n getSalesMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getSalesMultiplier();\n }\n\n getScientificResearchMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getScientificResearchMultiplier();\n }\n\n getStorageMultiplier(): number {\n const researchTree = IndustryResearchTrees[this.type];\n if (researchTree === undefined) throw new Error(`Invalid industry: \"${this.type}\"`);\n this.updateResearchTree();\n return researchTree.getStorageMultiplier();\n }\n\n /**\n * Serialize the current object to a JSON save state.\n */\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Industry\", this);\n }\n\n /**\n * Initiatizes a Industry object from a JSON save state.\n */\n static fromJSON(value: IReviverValue): Industry {\n return Generic_fromJSON(Industry, value.data);\n }\n}\n\nReviver.constructors.Industry = Industry;\n","/**\n * This is a component that implements a mathematical formula used commonly throughout the\n * game. This formula is (typically) used to calculate the effect that various statistics\n * have on a game mechanic. It looks something like:\n *\n * (stat ^ exponential factor) + (stat / linear factor)\n *\n * where the exponential factor is a number between 0 and 1 and the linear factor\n * is typically a relatively larger number.\n *\n * This formula ensures that the effects of the statistic that is being processed\n * has diminishing returns, but never loses its effectiveness as you continue\n * to raise it.\n */\nexport function calculateEffectWithFactors(n: number, expFac: number, linearFac: number): number {\n if (expFac <= 0 || expFac >= 1) {\n console.warn(`Exponential factor is ${expFac}. This is not an intended value for it`);\n }\n if (linearFac < 1) {\n console.warn(`Linear factor is ${linearFac}. This is not an intended value for it`);\n }\n\n return Math.pow(n, expFac) + n / linearFac;\n}\n","import { CorporationConstants } from \"./data/Constants\";\nimport { getRandomInt } from \"../utils/helpers/getRandomInt\";\nimport { Generic_fromJSON, Generic_toJSON, IReviverValue, Reviver } from \"../utils/JSONReviver\";\nimport { EmployeePositions } from \"./EmployeePositions\";\nimport { ICorporation } from \"./ICorporation\";\nimport { IIndustry } from \"./IIndustry\";\n\ninterface IParams {\n name?: string;\n morale?: number;\n happiness?: number;\n energy?: number;\n intelligence?: number;\n charisma?: number;\n experience?: number;\n creativity?: number;\n efficiency?: number;\n salary?: number;\n loc?: string;\n}\n\nexport class Employee {\n name: string;\n mor: number;\n hap: number;\n ene: number;\n int: number;\n cha: number;\n exp: number;\n cre: number;\n eff: number;\n sal: number;\n cyclesUntilRaise = CorporationConstants.CyclesPerEmployeeRaise;\n loc: string;\n pos: string;\n nextPos: string;\n\n constructor(params: IParams = {}) {\n this.name = params.name ? params.name : \"Bobby\";\n\n //Morale, happiness, and energy are 0-100\n this.mor = params.morale ? params.morale : getRandomInt(50, 100);\n this.hap = params.happiness ? params.happiness : getRandomInt(50, 100);\n this.ene = params.energy ? params.energy : getRandomInt(50, 100);\n\n this.int = params.intelligence ? params.intelligence : getRandomInt(10, 50);\n this.cha = params.charisma ? params.charisma : getRandomInt(10, 50);\n this.exp = params.experience ? params.experience : getRandomInt(10, 50);\n this.cre = params.creativity ? params.creativity : getRandomInt(10, 50);\n this.eff = params.efficiency ? params.efficiency : getRandomInt(10, 50);\n this.sal = params.salary ? params.salary : getRandomInt(0.1, 5);\n\n this.loc = params.loc ? params.loc : \"\";\n this.pos = EmployeePositions.Unassigned;\n this.nextPos = this.pos;\n }\n\n //Returns the amount the employee needs to be paid\n process(marketCycles = 1): number {\n const gain = 0.003 * marketCycles;\n const det = gain * Math.random();\n this.exp += gain;\n\n //Training\n const trainingEff = gain * Math.random();\n if (this.pos === EmployeePositions.Training) {\n //To increase creativity and intelligence special upgrades are needed\n this.cha += trainingEff;\n this.exp += trainingEff;\n this.eff += trainingEff;\n }\n\n this.ene -= det;\n this.hap -= det;\n\n const salary = this.sal * marketCycles * CorporationConstants.SecsPerMarketCycle;\n return salary;\n }\n\n calculateProductivity(corporation: ICorporation, industry: IIndustry): number {\n const effCre = this.cre * corporation.getEmployeeCreMultiplier() * industry.getEmployeeCreMultiplier(),\n effCha = this.cha * corporation.getEmployeeChaMultiplier() * industry.getEmployeeChaMultiplier(),\n effInt = this.int * corporation.getEmployeeIntMultiplier() * industry.getEmployeeIntMultiplier(),\n effEff = this.eff * corporation.getEmployeeEffMultiplier() * industry.getEmployeeEffMultiplier();\n const prodBase = this.mor * this.hap * this.ene * 1e-6;\n let prodMult = 0;\n switch (this.pos) {\n //Calculate productivity based on position. This is multipled by prodBase\n //to get final value\n case EmployeePositions.Operations:\n prodMult = 0.6 * effInt + 0.1 * effCha + this.exp + 0.5 * effCre + effEff;\n break;\n case EmployeePositions.Engineer:\n prodMult = effInt + 0.1 * effCha + 1.5 * this.exp + effEff;\n break;\n case EmployeePositions.Business:\n prodMult = 0.4 * effInt + effCha + 0.5 * this.exp;\n break;\n case EmployeePositions.Management:\n prodMult = 2 * effCha + this.exp + 0.2 * effCre + 0.7 * effEff;\n break;\n case EmployeePositions.RandD:\n prodMult = 1.5 * effInt + 0.8 * this.exp + effCre + 0.5 * effEff;\n break;\n case EmployeePositions.Unassigned:\n case EmployeePositions.Training:\n prodMult = 0;\n break;\n default:\n console.error(`Invalid employee position: ${this.pos}`);\n break;\n }\n return prodBase * prodMult;\n }\n\n toJSON(): IReviverValue {\n return Generic_toJSON(\"Employee\", this);\n }\n\n static fromJSON(value: IReviverValue): Employee {\n return Generic_fromJSON(Employee, value.data);\n }\n}\n\nReviver.constructors.Employee = Employee;\n","import { Industries } from \"./IndustryData\";\nimport { IMap } from \"../types\";\n\nexport interface IProductRatingWeight {\n Aesthetics?: number;\n Durability?: number;\n Features?: number;\n Quality?: number;\n Performance?: number;\n Reliability?: number;\n}\n\nexport const ProductRatingWeights: IMap = {\n [Industries.Food]: {\n Quality: 0.7,\n Durability: 0.1,\n Aesthetics: 0.2,\n },\n [Industries.Tobacco]: {\n Quality: 0.4,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.2,\n },\n [Industries.Pharmaceutical]: {\n Quality: 0.2,\n Performance: 0.2,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.2,\n },\n [Industries.Computer]: {\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n Computer: {\n //Repeat\n Quality: 0.15,\n Performance: 0.25,\n Durability: 0.25,\n Reliability: 0.2,\n Aesthetics: 0.05,\n Features: 0.1,\n },\n [Industries.Robotics]: {\n Quality: 0.1,\n Performance: 0.2,\n Durability: 0.2,\n Reliability: 0.2,\n Aesthetics: 0.1,\n Features: 0.2,\n },\n [Industries.Software]: {\n Quality: 0.2,\n Performance: 0.2,\n Reliability: 0.2,\n Durability: 0.2,\n Features: 0.2,\n },\n [Industries.Healthcare]: {\n Quality: 0.4,\n Performance: 0.1,\n Durability: 0.1,\n Reliability: 0.3,\n Features: 0.1,\n },\n [Industries.RealEstate]: {\n Quality: 0.2,\n Durability: 0.25,\n Reliability: 0.1,\n Aesthetics: 0.35,\n Features: 0.1,\n },\n};\n","import { Player as player } from \"../Player\";\nimport { calculateServerGrowth } from \"../Server/formulas/grow\";\nimport {\n calculateMoneyGainRate,\n calculateLevelUpgradeCost,\n calculateRamUpgradeCost,\n calculateCoreUpgradeCost,\n calculateNodeCost,\n} from \"../Hacknet/formulas/HacknetNodes\";\nimport {\n calculateHashGainRate as HScalculateHashGainRate,\n calculateLevelUpgradeCost as HScalculateLevelUpgradeCost,\n calculateRamUpgradeCost as HScalculateRamUpgradeCost,\n calculateCoreUpgradeCost as HScalculateCoreUpgradeCost,\n calculateCacheUpgradeCost as HScalculateCacheUpgradeCost,\n calculateServerCost as HScalculateServerCost,\n} from \"../Hacknet/formulas/HacknetServers\";\nimport { HacknetNodeConstants, HacknetServerConstants } from \"../Hacknet/data/Constants\";\nimport { calculateSkill, calculateExp } from \"../PersonObjects/formulas/skill\";\nimport {\n calculateHackingChance,\n calculateHackingExpGain,\n calculatePercentMoneyHacked,\n calculateHackingTime,\n calculateGrowTime,\n calculateWeakenTime,\n} from \"../Hacking\";\nimport { Programs } from \"../Programs/Programs\";\nimport {\n Formulas as IFormulas,\n HacknetNodeConstants as DefHacknetNodeConstants,\n HacknetServerConstants as DefHacknetServerConstants,\n} from \"../ScriptEditor/NetscriptDefinitions\";\nimport {\n calculateRespectGain,\n calculateWantedLevelGain,\n calculateMoneyGain,\n calculateWantedPenalty,\n calculateAscensionMult,\n calculateAscensionPointsGain,\n} from \"../Gang/formulas/formulas\";\nimport { favorToRep as calculateFavorToRep, repToFavor as calculateRepToFavor } from \"../Faction/formulas/favor\";\nimport { repFromDonation } from \"../Faction/formulas/donation\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\nimport { WorkStats } from \"../Work/WorkStats\";\nimport { calculateCrimeWorkStats } from \"../Work/formulas/Crime\";\nimport { Crimes } from \"../Crime/Crimes\";\nimport { calculateClassEarnings } from \"../Work/formulas/Class\";\nimport { ClassType } from \"../Work/ClassWork\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { calculateFactionExp, calculateFactionRep } from \"../Work/formulas/Faction\";\nimport { FactionWorkType } from \"../Work/data/FactionWorkType\";\n\nimport { Player as INetscriptPlayer, Server as IServerDef } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { defaultMultipliers } from \"../PersonObjects/Multipliers\";\n\nexport function NetscriptFormulas(): InternalAPI {\n const checkFormulasAccess = function (ctx: NetscriptContext): void {\n if (!player.hasProgram(Programs.Formulas.name)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Requires Formulas.exe to run.`);\n }\n };\n return {\n mockServer: () => (): IServerDef => ({\n cpuCores: 0,\n ftpPortOpen: false,\n hasAdminRights: false,\n hostname: \"\",\n httpPortOpen: false,\n ip: \"\",\n isConnectedTo: false,\n maxRam: 0,\n organizationName: \"\",\n ramUsed: 0,\n smtpPortOpen: false,\n sqlPortOpen: false,\n sshPortOpen: false,\n purchasedByPlayer: false,\n backdoorInstalled: false,\n baseDifficulty: 0,\n hackDifficulty: 0,\n minDifficulty: 0,\n moneyAvailable: 0,\n moneyMax: 0,\n numOpenPortsRequired: 0,\n openPortCount: 0,\n requiredHackingSkill: 0,\n serverGrowth: 0,\n }),\n mockPlayer: () => (): INetscriptPlayer => ({\n hp: { current: 0, max: 0 },\n skills: {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n },\n exp: {\n hacking: 0,\n strength: 0,\n defense: 0,\n dexterity: 0,\n agility: 0,\n charisma: 0,\n intelligence: 0,\n },\n mults: defaultMultipliers(),\n numPeopleKilled: 0,\n money: 0,\n city: \"\",\n location: \"\",\n bitNodeN: 0,\n totalPlaytime: 0,\n playtimeSinceLastAug: 0,\n playtimeSinceLastBitnode: 0,\n jobs: {},\n factions: [],\n tor: false,\n hasCorporation: false,\n inBladeburner: false,\n entropy: 0,\n }),\n reputation: {\n calculateFavorToRep:\n (ctx: NetscriptContext) =>\n (_favor: unknown): number => {\n const favor = helpers.number(ctx, \"favor\", _favor);\n checkFormulasAccess(ctx);\n return calculateFavorToRep(favor);\n },\n calculateRepToFavor:\n (ctx: NetscriptContext) =>\n (_rep: unknown): number => {\n const rep = helpers.number(ctx, \"rep\", _rep);\n checkFormulasAccess(ctx);\n return calculateRepToFavor(rep);\n },\n repFromDonation:\n (ctx: NetscriptContext) =>\n (_amount: unknown, _player: unknown): number => {\n const amount = helpers.number(ctx, \"amount\", _amount);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return repFromDonation(amount, player);\n },\n },\n skills: {\n calculateSkill:\n (ctx: NetscriptContext) =>\n (_exp: unknown, _mult: unknown = 1): number => {\n const exp = helpers.number(ctx, \"exp\", _exp);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateSkill(exp, mult);\n },\n calculateExp:\n (ctx: NetscriptContext) =>\n (_skill: unknown, _mult: unknown = 1): number => {\n const skill = helpers.number(ctx, \"skill\", _skill);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateExp(skill, mult);\n },\n },\n hacking: {\n hackChance:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingChance(server, player);\n },\n hackExp:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingExpGain(server, player);\n },\n hackPercent:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculatePercentMoneyHacked(server, player);\n },\n growPercent:\n (ctx: NetscriptContext) =>\n (_server: unknown, _threads: unknown, _player: unknown, _cores: unknown = 1): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n const threads = helpers.number(ctx, \"threads\", _threads);\n const cores = helpers.number(ctx, \"cores\", _cores);\n checkFormulasAccess(ctx);\n return calculateServerGrowth(server, threads, player, cores);\n },\n hackTime:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateHackingTime(server, player) * 1000;\n },\n growTime:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateGrowTime(server, player) * 1000;\n },\n weakenTime:\n (ctx: NetscriptContext) =>\n (_server: unknown, _player: unknown): number => {\n const server = helpers.server(ctx, _server);\n const player = helpers.player(ctx, _player);\n checkFormulasAccess(ctx);\n return calculateWeakenTime(server, player) * 1000;\n },\n },\n hacknetNodes: {\n moneyGainRate:\n (ctx: NetscriptContext) =>\n (_level: unknown, _ram: unknown, _cores: unknown, _mult: unknown = 1): number => {\n const level = helpers.number(ctx, \"level\", _level);\n const ram = helpers.number(ctx, \"ram\", _ram);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateMoneyGainRate(level, ram, cores, mult);\n },\n levelUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingLevel: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingLevel = helpers.number(ctx, \"startingLevel\", _startingLevel);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingRam: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingRam = helpers.number(ctx, \"startingRam\", _startingRam);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingCore: unknown, _extraCores: unknown = 1, _costMult: unknown = 1): number => {\n const startingCore = helpers.number(ctx, \"startingCore\", _startingCore);\n const extraCores = helpers.number(ctx, \"extraCores\", _extraCores);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return calculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n hacknetNodeCost:\n (ctx: NetscriptContext) =>\n (_n: unknown, _mult: unknown): number => {\n const n = helpers.number(ctx, \"n\", _n);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return calculateNodeCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): DefHacknetNodeConstants => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetNodeConstants);\n },\n },\n hacknetServers: {\n hashGainRate:\n (ctx: NetscriptContext) =>\n (_level: unknown, _ramUsed: unknown, _maxRam: unknown, _cores: unknown, _mult: unknown = 1): number => {\n const level = helpers.number(ctx, \"level\", _level);\n const ramUsed = helpers.number(ctx, \"ramUsed\", _ramUsed);\n const maxRam = helpers.number(ctx, \"maxRam\", _maxRam);\n const cores = helpers.number(ctx, \"cores\", _cores);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateHashGainRate(level, ramUsed, maxRam, cores, mult);\n },\n levelUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingLevel: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingLevel = helpers.number(ctx, \"startingLevel\", _startingLevel);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateLevelUpgradeCost(startingLevel, extraLevels, costMult);\n },\n ramUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingRam: unknown, _extraLevels: unknown = 1, _costMult: unknown = 1): number => {\n const startingRam = helpers.number(ctx, \"startingRam\", _startingRam);\n const extraLevels = helpers.number(ctx, \"extraLevels\", _extraLevels);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateRamUpgradeCost(startingRam, extraLevels, costMult);\n },\n coreUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingCore: unknown, _extraCores: unknown = 1, _costMult: unknown = 1): number => {\n const startingCore = helpers.number(ctx, \"startingCore\", _startingCore);\n const extraCores = helpers.number(ctx, \"extraCores\", _extraCores);\n const costMult = helpers.number(ctx, \"costMult\", _costMult);\n checkFormulasAccess(ctx);\n return HScalculateCoreUpgradeCost(startingCore, extraCores, costMult);\n },\n cacheUpgradeCost:\n (ctx: NetscriptContext) =>\n (_startingCache: unknown, _extraCache: unknown = 1): number => {\n const startingCache = helpers.number(ctx, \"startingCache\", _startingCache);\n const extraCache = helpers.number(ctx, \"extraCache\", _extraCache);\n checkFormulasAccess(ctx);\n return HScalculateCacheUpgradeCost(startingCache, extraCache);\n },\n hashUpgradeCost:\n (ctx: NetscriptContext) =>\n (_upgName: unknown, _level: unknown): number => {\n const upgName = helpers.string(ctx, \"upgName\", _upgName);\n const level = helpers.number(ctx, \"level\", _level);\n checkFormulasAccess(ctx);\n const upg = player.hashManager.getUpgrade(upgName);\n if (!upg) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid Hash Upgrade: ${upgName}`);\n }\n return upg.getCost(level);\n },\n hacknetServerCost:\n (ctx: NetscriptContext) =>\n (_n: unknown, _mult: unknown = 1): number => {\n const n = helpers.number(ctx, \"n\", _n);\n const mult = helpers.number(ctx, \"mult\", _mult);\n checkFormulasAccess(ctx);\n return HScalculateServerCost(n, mult);\n },\n constants: (ctx: NetscriptContext) => (): DefHacknetServerConstants => {\n checkFormulasAccess(ctx);\n return Object.assign({}, HacknetServerConstants);\n },\n },\n gang: {\n wantedPenalty:\n (ctx: NetscriptContext) =>\n (_gang: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n checkFormulasAccess(ctx);\n return calculateWantedPenalty(gang);\n },\n respectGain:\n (ctx: NetscriptContext) =>\n (_gang: unknown, _member: unknown, _task: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateRespectGain(gang, member, task);\n },\n wantedLevelGain:\n (ctx: NetscriptContext) =>\n (_gang: unknown, _member: unknown, _task: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateWantedLevelGain(gang, member, task);\n },\n moneyGain:\n (ctx: NetscriptContext) =>\n (_gang: unknown, _member: unknown, _task: unknown): number => {\n const gang = helpers.gang(ctx, _gang);\n const member = helpers.gangMember(ctx, _member);\n const task = helpers.gangTask(ctx, _task);\n checkFormulasAccess(ctx);\n return calculateMoneyGain(gang, member, task);\n },\n ascensionPointsGain:\n (ctx: NetscriptContext) =>\n (_exp: unknown): number => {\n const exp = helpers.number(ctx, \"exp\", _exp);\n checkFormulasAccess(ctx);\n return calculateAscensionPointsGain(exp);\n },\n ascensionMultiplier:\n (ctx: NetscriptContext) =>\n (_points: unknown): number => {\n const points = helpers.number(ctx, \"points\", _points);\n checkFormulasAccess(ctx);\n return calculateAscensionMult(points);\n },\n },\n work: {\n crimeGains:\n (ctx: NetscriptContext) =>\n (_crimeType: unknown): WorkStats => {\n const crimeType = helpers.string(ctx, \"crimeType\", _crimeType);\n const crime = Object.values(Crimes).find((c) => String(c.type) === crimeType);\n if (!crime) throw new Error(`Invalid crime type: ${crimeType}`);\n return calculateCrimeWorkStats(crime);\n },\n classGains:\n (ctx: NetscriptContext) =>\n (_player: unknown, _classType: unknown, _locationName: unknown): WorkStats => {\n const target = helpers.player(ctx, _player);\n const classType = helpers.string(ctx, \"classType\", _classType);\n const locationName = helpers.string(ctx, \"locationName\", _locationName);\n return calculateClassEarnings(player, target, classType as ClassType, locationName as LocationName);\n },\n factionGains:\n (ctx: NetscriptContext) =>\n (_player: unknown, _workType: unknown, _favor: unknown): WorkStats => {\n const player = helpers.player(ctx, _player);\n const workType = helpers.string(ctx, \"_workType\", _workType) as FactionWorkType;\n const favor = helpers.number(ctx, \"favor\", _favor);\n const exp = calculateFactionExp(player, workType);\n const rep = calculateFactionRep(player, workType, favor);\n exp.reputation = rep;\n return exp;\n },\n // companyGains: (ctx: NetscriptContext) =>_player: unknown (): WorkStats {\n // const player = helpers.player(ctx, _player);\n\n // },\n },\n };\n}\n","import { Player as player } from \"../Player\";\nimport { buyStock, sellStock, shortStock, sellShort } from \"../StockMarket/BuyingAndSelling\";\nimport { StockMarket, SymbolToStockMap, placeOrder, cancelOrder, initStockMarketFn } from \"../StockMarket/StockMarket\";\nimport { getBuyTransactionCost, getSellTransactionGain } from \"../StockMarket/StockMarketHelpers\";\nimport { OrderTypes } from \"../StockMarket/data/OrderTypes\";\nimport { PositionTypes } from \"../StockMarket/data/PositionTypes\";\nimport { StockSymbols } from \"../StockMarket/data/StockSymbols\";\nimport {\n getStockMarket4SDataCost,\n getStockMarket4STixApiCost,\n getStockMarketWseCost,\n getStockMarketTixApiCost,\n} from \"../StockMarket/StockMarketCosts\";\nimport { Stock } from \"../StockMarket/Stock\";\nimport { StockOrder, TIX } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptStockMarket(): InternalAPI {\n /**\n * Checks if the player has TIX API access. Throws an error if the player does not\n */\n const checkTixApiAccess = function (ctx: NetscriptContext): void {\n if (!player.hasWseAccount) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You don't have WSE Access! Cannot use ${ctx.function}()`);\n }\n if (!player.hasTixApiAccess) {\n throw helpers.makeRuntimeErrorMsg(ctx, `You don't have TIX API Access! Cannot use ${ctx.function}()`);\n }\n };\n\n const getStockFromSymbol = function (ctx: NetscriptContext, symbol: string): Stock {\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid stock symbol: '${symbol}'`);\n }\n\n return stock;\n };\n\n return {\n hasWSEAccount: () => (): boolean => {\n return player.hasWseAccount;\n },\n hasTIXAPIAccess: () => (): boolean => {\n return player.hasTixApiAccess;\n },\n has4SData: () => (): boolean => {\n return player.has4SData;\n },\n has4SDataTIXAPI: () => (): boolean => {\n return player.has4SDataTixApi;\n },\n getSymbols: (ctx: NetscriptContext) => (): string[] => {\n checkTixApiAccess(ctx);\n return Object.values(StockSymbols);\n },\n getPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.price;\n },\n getAskPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getAskPrice();\n },\n getBidPrice:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.getBidPrice();\n },\n getPosition:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): [number, number, number, number] => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = SymbolToStockMap[symbol];\n if (stock == null) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid stock symbol: ${symbol}`);\n }\n return [stock.playerShares, stock.playerAvgPx, stock.playerShortShares, stock.playerAvgShortPx];\n },\n getMaxShares:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.maxShares;\n },\n getPurchaseCost:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _posType: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n let shares = helpers.number(ctx, \"shares\", _shares);\n const posType = helpers.string(ctx, \"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return Infinity;\n }\n\n const res = getBuyTransactionCost(stock, shares, pos);\n if (res == null) {\n return Infinity;\n }\n\n return res;\n },\n getSaleGain:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _posType: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n let shares = helpers.number(ctx, \"shares\", _shares);\n const posType = helpers.string(ctx, \"posType\", _posType);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n shares = Math.round(shares);\n\n let pos;\n const sanitizedPosType = posType.toLowerCase();\n if (sanitizedPosType.includes(\"l\")) {\n pos = PositionTypes.Long;\n } else if (sanitizedPosType.includes(\"s\")) {\n pos = PositionTypes.Short;\n } else {\n return 0;\n }\n\n const res = getSellTransactionGain(stock, shares, pos);\n if (res == null) {\n return 0;\n }\n\n return res;\n },\n buyStock:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = buyStock(stock, shares, ctx, {});\n return res ? stock.getAskPrice() : 0;\n },\n sellStock:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellStock(stock, shares, ctx, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n buyShort:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = shortStock(stock, shares, ctx, {});\n\n return res ? stock.getBidPrice() : 0;\n },\n sellShort:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 1) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 2.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n const res = sellShort(stock, shares, ctx, {});\n\n return res ? stock.getAskPrice() : 0;\n },\n placeOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n const price = helpers.number(ctx, \"price\", _price);\n const type = helpers.string(ctx, \"type\", _type);\n const pos = helpers.string(ctx, \"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid position type: ${pos}`);\n }\n\n return placeOrder(stock, shares, price, orderType, orderPos, ctx);\n },\n cancelOrder:\n (ctx: NetscriptContext) =>\n (_symbol: unknown, _shares: unknown, _price: unknown, _type: unknown, _pos: unknown): boolean => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n const shares = helpers.number(ctx, \"shares\", _shares);\n const price = helpers.number(ctx, \"price\", _price);\n const type = helpers.string(ctx, \"type\", _type);\n const pos = helpers.string(ctx, \"pos\", _pos);\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You must either be in BitNode-8 or you must have Source-File 8 Level 3.\",\n );\n }\n }\n const stock = getStockFromSymbol(ctx, symbol);\n if (isNaN(shares) || isNaN(price)) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n `Invalid shares or price. Must be numeric. shares=${shares}, price=${price}`,\n );\n }\n let orderType;\n let orderPos;\n const ltype = type.toLowerCase();\n if (ltype.includes(\"limit\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.LimitBuy;\n } else if (ltype.includes(\"limit\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.LimitSell;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"buy\")) {\n orderType = OrderTypes.StopBuy;\n } else if (ltype.includes(\"stop\") && ltype.includes(\"sell\")) {\n orderType = OrderTypes.StopSell;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid order type: ${type}`);\n }\n\n const lpos = pos.toLowerCase();\n if (lpos.includes(\"l\")) {\n orderPos = PositionTypes.Long;\n } else if (lpos.includes(\"s\")) {\n orderPos = PositionTypes.Short;\n } else {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid position type: ${pos}`);\n }\n const params = {\n stock: stock,\n shares: shares,\n price: price,\n type: orderType,\n pos: orderPos,\n };\n return cancelOrder(params, ctx);\n },\n getOrders: (ctx: NetscriptContext) => (): StockOrder => {\n checkTixApiAccess(ctx);\n if (player.bitNodeN !== 8) {\n if (player.sourceFileLvl(8) <= 2) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must either be in BitNode-8 or have Source-File 8 Level 3.\");\n }\n }\n\n const orders: StockOrder = {};\n\n const stockMarketOrders = StockMarket[\"Orders\"];\n for (const symbol of Object.keys(stockMarketOrders)) {\n const orderBook = stockMarketOrders[symbol];\n if (orderBook.constructor === Array && orderBook.length > 0) {\n orders[symbol] = [];\n for (let i = 0; i < orderBook.length; ++i) {\n orders[symbol].push({\n shares: orderBook[i].shares,\n price: orderBook[i].price,\n type: orderBook[i].type,\n position: orderBook[i].pos,\n });\n }\n }\n }\n\n return orders;\n },\n getVolatility:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n return stock.mv / 100; // Convert from percentage to decimal\n },\n getForecast:\n (ctx: NetscriptContext) =>\n (_symbol: unknown): number => {\n const symbol = helpers.string(ctx, \"symbol\", _symbol);\n if (!player.has4SDataTixApi) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You don't have 4S Market Data TIX API Access!\");\n }\n const stock = getStockFromSymbol(ctx, symbol);\n\n let forecast = 50;\n stock.b ? (forecast += stock.otlkMag) : (forecast -= stock.otlkMag);\n return forecast / 100; // Convert from percentage to decimal\n },\n purchase4SMarketData: (ctx: NetscriptContext) => (): boolean => {\n if (player.has4SData) {\n helpers.log(ctx, () => \"Already purchased 4S Market Data.\");\n return true;\n }\n\n if (player.money < getStockMarket4SDataCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase 4S Market Data.\");\n return false;\n }\n\n player.has4SData = true;\n player.loseMoney(getStockMarket4SDataCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased 4S Market Data\");\n return true;\n },\n purchase4SMarketDataTixApi: (ctx: NetscriptContext) => (): boolean => {\n checkTixApiAccess(ctx);\n\n if (player.has4SDataTixApi) {\n helpers.log(ctx, () => \"Already purchased 4S Market Data TIX API\");\n return true;\n }\n\n if (player.money < getStockMarket4STixApiCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase 4S Market Data TIX API\");\n return false;\n }\n\n player.has4SDataTixApi = true;\n player.loseMoney(getStockMarket4STixApiCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased 4S Market Data TIX API\");\n return true;\n },\n purchaseWseAccount: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasWseAccount) {\n helpers.log(ctx, () => \"Already purchased WSE Account\");\n return true;\n }\n\n if (player.money < getStockMarketWseCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase WSE Account Access\");\n return false;\n }\n\n player.hasWseAccount = true;\n initStockMarketFn();\n player.loseMoney(getStockMarketWseCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased WSE Account Access\");\n return true;\n },\n purchaseTixApi: (ctx: NetscriptContext) => (): boolean => {\n if (player.hasTixApiAccess) {\n helpers.log(ctx, () => \"Already purchased TIX API\");\n return true;\n }\n\n if (player.money < getStockMarketTixApiCost()) {\n helpers.log(ctx, () => \"Not enough money to purchase TIX API Access\");\n return false;\n }\n\n player.hasTixApiAccess = true;\n player.loseMoney(getStockMarketTixApiCost(), \"stock\");\n helpers.log(ctx, () => \"Purchased TIX API\");\n return true;\n },\n };\n}\n","import { InternalAPI, NetscriptContext } from \"../Netscript/APIWrapper\";\nimport { StaticAugmentations } from \"../Augmentation/StaticAugmentations\";\nimport { hasAugmentationPrereqs } from \"../Faction/FactionHelpers\";\nimport { CityName } from \"../Locations/data/CityNames\";\nimport { GraftableAugmentation } from \"../PersonObjects/Grafting/GraftableAugmentation\";\nimport { getGraftingAvailableAugs, calculateGraftingTimeWithBonus } from \"../PersonObjects/Grafting/GraftingHelpers\";\nimport { Player as player } from \"../Player\";\nimport { Grafting as IGrafting } from \"../ScriptEditor/NetscriptDefinitions\";\nimport { Router } from \"../ui/GameRoot\";\nimport { GraftingWork } from \"../Work/GraftingWork\";\nimport { helpers } from \"../Netscript/NetscriptHelpers\";\n\nexport function NetscriptGrafting(): InternalAPI {\n const checkGraftingAPIAccess = (ctx: NetscriptContext): void => {\n if (!player.canAccessGrafting()) {\n throw helpers.makeRuntimeErrorMsg(\n ctx,\n \"You do not currently have access to the Grafting API. This is either because you are not in BitNode 10 or because you do not have Source-File 10\",\n );\n }\n };\n\n return {\n getAugmentationGraftPrice:\n (ctx: NetscriptContext) =>\n (_augName: unknown): number => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return graftableAug.cost;\n },\n\n getAugmentationGraftTime:\n (ctx: NetscriptContext) =>\n (_augName: string): number => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n checkGraftingAPIAccess(ctx);\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n throw helpers.makeRuntimeErrorMsg(ctx, `Invalid aug: ${augName}`);\n }\n const graftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n return calculateGraftingTimeWithBonus(player, graftableAug);\n },\n\n getGraftableAugmentations: (ctx: NetscriptContext) => (): string[] => {\n checkGraftingAPIAccess(ctx);\n const graftableAugs = getGraftingAvailableAugs(player);\n return graftableAugs;\n },\n\n graftAugmentation:\n (ctx: NetscriptContext) =>\n (_augName: string, _focus: unknown = true): boolean => {\n const augName = helpers.string(ctx, \"augName\", _augName);\n const focus = !!_focus;\n checkGraftingAPIAccess(ctx);\n if (player.city !== CityName.NewTokyo) {\n throw helpers.makeRuntimeErrorMsg(ctx, \"You must be in New Tokyo to begin grafting an Augmentation.\");\n }\n if (!getGraftingAvailableAugs(player).includes(augName) || !StaticAugmentations.hasOwnProperty(augName)) {\n helpers.log(ctx, () => `Invalid aug: ${augName}`);\n return false;\n }\n\n const wasFocusing = player.focus;\n\n const craftableAug = new GraftableAugmentation(StaticAugmentations[augName]);\n if (player.money < craftableAug.cost) {\n helpers.log(ctx, () => `You don't have enough money to craft ${augName}`);\n return false;\n }\n\n if (!hasAugmentationPrereqs(craftableAug.augmentation)) {\n helpers.log(ctx, () => `You don't have the pre-requisites for ${augName}`);\n return false;\n }\n\n player.startWork(\n new GraftingWork({\n singularity: true,\n augmentation: augName,\n player: player,\n }),\n );\n\n if (focus) {\n player.startFocusing();\n Router.toWork();\n } else if (wasFocusing) {\n player.stopFocusing();\n Router.toTerminal();\n }\n\n helpers.log(ctx, () => `Began grafting Augmentation ${augName}.`);\n return true;\n },\n };\n}\n","import { saveObject } from \"../SaveObject\";\nimport { Script } from \"../Script/Script\";\nimport { GetAllServers, GetServer } from \"../Server/AllServers\";\nimport { IFileLine } from \"./v1APIBreak\";\nimport { openV2Modal } from \"./V2Modal\";\n\nconst singularity = [\n \"applyToCompany\",\n \"b1tflum3\",\n \"checkFactionInvitations\",\n \"commitCrime\",\n \"connect\",\n \"createProgram\",\n \"destroyW0r1dD43m0n\",\n \"donateToFaction\",\n \"getAugmentationBasePrice\",\n \"getAugmentationCost\",\n \"getAugmentationPrereq\",\n \"getAugmentationPrice\",\n \"getAugmentationRepReq\",\n \"getAugmentationsFromFaction\",\n \"getAugmentationStats\",\n \"getCompanyFavor\",\n \"getCompanyFavorGain\",\n \"getCompanyRep\",\n \"getCrimeChance\",\n \"getCrimeStats\",\n \"getCurrentServer\",\n \"getDarkwebProgramCost\",\n \"getDarkwebPrograms\",\n \"getFactionFavor\",\n \"getFactionFavorGain\",\n \"getFactionRep\",\n \"getOwnedAugmentations\",\n \"getOwnedSourceFiles\",\n \"getUpgradeHomeCoresCost\",\n \"getUpgradeHomeRamCost\",\n \"goToLocation\",\n \"gymWorkout\",\n \"hospitalize\",\n \"installAugmentations\",\n \"installBackdoor\",\n \"isBusy\",\n \"isFocused\",\n \"joinFaction\",\n \"manualHack\",\n \"purchaseAugmentation\",\n \"purchaseProgram\",\n \"purchaseTor\",\n \"quitJob\",\n \"setFocus\",\n \"softReset\",\n \"stopAction\",\n \"travelToCity\",\n \"universityCourse\",\n \"upgradeHomeCores\",\n \"upgradeHomeRam\",\n \"workForCompany\",\n \"workForFaction\",\n];\n\nconst getPlayerFields = [\n \"workChaExpGained\",\n \"currentWorkFactionName\",\n \"workDexExpGained\",\n \"workHackExpGained\",\n \"createProgramReqLvl\",\n \"workStrExpGained\",\n \"companyName\",\n \"crimeType\",\n \"workRepGained\",\n \"workChaExpGainRate\",\n \"workType\",\n \"workStrExpGainRate\",\n \"isWorking\",\n \"workRepGainRate\",\n \"workDefExpGained\",\n \"currentWorkFactionDescription\",\n \"workHackExpGainRate\",\n \"workAgiExpGainRate\",\n \"workDexExpGainRate\",\n \"workMoneyGained\",\n \"workMoneyLossRate\",\n \"workMoneyGainRate\",\n \"createProgramName\",\n \"workDefExpGainRate\",\n \"workAgiExpGained\",\n \"className\",\n \"hacking\",\n \"strength\",\n \"defense\",\n \"dexterity\",\n \"agility\",\n \"charisma\",\n \"intelligence\",\n \"hacking_exp\",\n \"strength_exp\",\n \"defense_exp\",\n \"dexterity_exp\",\n \"agility_exp\",\n \"charisma_exp\",\n \"intelligence_exp\",\n \"hp\",\n \"max_hp\",\n \"hasWseAccount\",\n \"hasTixApiAccess\",\n \"has4SData\",\n \"has4SDataTixApi\",\n];\n\nconst mults = [\n \"hacking_chance_mult\",\n \"hacking_speed_mult\",\n \"hacking_money_mult\",\n \"hacking_grow_mult\",\n \"hacking_mult\",\n \"hacking_exp_mult\",\n \"strength_mult\",\n \"strength_exp_mult\",\n \"defense_mult\",\n \"defense_exp_mult\",\n \"dexterity_mult\",\n \"dexterity_exp_mult\",\n \"agility_mult\",\n \"agility_exp_mult\",\n \"charisma_mult\",\n \"charisma_exp_mult\",\n \"hacknet_node_money_mult\",\n \"hacknet_node_purchase_cost_mult\",\n \"hacknet_node_ram_cost_mult\",\n \"hacknet_node_core_cost_mult\",\n \"hacknet_node_level_cost_mult\",\n \"company_rep_mult\",\n \"faction_rep_mult\",\n \"work_money_mult\",\n \"crime_success_mult\",\n \"crime_money_mult\",\n \"bladeburner_max_stamina_mult\",\n \"bladeburner_stamina_gain_mult\",\n \"bladeburner_analysis_mult\",\n \"bladeburner_success_chance_mult\",\n];\n\ninterface IRule {\n matchJS: RegExp;\n matchScript?: RegExp;\n reason: string;\n offenders: IFileLine[];\n}\n\nexport const v2APIBreak = () => {\n const home = GetServer(\"home\");\n if (!home) throw new Error(\"'home' server was not found.\");\n const rules: IRule[] = [\n {\n matchJS: /ns\\.workForCompany/g,\n matchScript: /workForCompany/g,\n reason: \"workForCompany argument companyName is now not-optional.\",\n offenders: [],\n },\n {\n matchJS: /ns\\.getScriptExpGain/g,\n matchScript: /getScriptExpGain/g,\n reason: \"getScriptExpGain with 0 argument no longer returns the sum of all scripts. Use getTotalScriptExpGain\",\n offenders: [],\n },\n {\n matchJS: /ns\\.getScriptExpGain/g,\n matchScript: /getScriptExpGain/g,\n reason: \"getScriptIncome with 0 argument no longer returns the sum of all scripts. Use getTotalScriptIncome\",\n offenders: [],\n },\n {\n matchJS: /ns\\.scp/g,\n matchScript: /scp/g,\n reason:\n \"scp arguments were switch, it is now scp(files, destination, optionally_source). If you were using 2 argument (not 3) this doesn't affect you.\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.buy/g,\n matchScript: /stock\\.buy/g,\n reason: \"buy is a very common word so in order to avoid ram costs it was renamed ns.stock.buyStock\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.sell/g,\n matchScript: /stock\\.sell/g,\n reason: \"sell is a very common word so in order to avoid ram costs it was renamed ns.stock.sellStock\",\n offenders: [],\n },\n {\n matchJS: /ns\\.stock\\.short/g,\n matchScript: /stock\\.short/g,\n reason: \"short is a very common word so in order to avoid ram costs it was renamed ns.stock.buyShort\",\n offenders: [],\n },\n {\n matchJS: /ns\\.corporation\\.bribe/g,\n matchScript: /corporation\\.bribe/g,\n reason: \"bribe no longer allows you to give shares of the corporation, only money\",\n offenders: [],\n },\n ];\n\n for (const fn of singularity) {\n rules.push({\n matchJS: new RegExp(`ns.${fn}`, \"g\"),\n reason: `ns.${fn} was moved to ns.singularity.${fn}`,\n offenders: [],\n });\n }\n\n for (const mult of mults) {\n rules.push({\n matchJS: new RegExp(mult, \"g\"),\n reason: `ns.getPlayer().${mult} was moved to ns.getPlayer().mults.${mult.slice(0, mult.length - 5)}`,\n offenders: [],\n });\n }\n\n for (const f of getPlayerFields) {\n rules.push({\n matchJS: new RegExp(f, \"g\"),\n reason: `The work system is completely reworked and ns.getPlayer().${f} no longer exists. This data is likely available inside ns.getPlayer().currentWork, skills, exp, or hp`,\n offenders: [],\n });\n }\n\n for (const script of home.scripts) {\n processScript(rules, script);\n }\n\n home.writeToTextFile(\"V2_0_0_API_BREAK.txt\", formatRules(rules));\n openV2Modal();\n\n for (const server of GetAllServers()) {\n server.runningScripts = [];\n }\n saveObject.exportGame();\n};\n\nconst formatOffenders = (offenders: IFileLine[]): string => {\n const files: Record = {};\n for (const off of offenders) {\n const current = files[off.file] ?? [];\n current.push(off);\n files[off.file] = current;\n }\n\n let txt = \"\";\n for (const file in files) {\n txt += \"\\t\" + file + \"\\n\";\n for (const fileline of files[file]) {\n txt += `\\t\\tLine ${fileline.line} ${fileline.content.trim()}\\n`;\n }\n }\n return txt;\n};\n\nconst formatRules = (rules: IRule[]): string => {\n let txt =\n \"This file contains the list of potential API break. A pattern was used to look through all your files and note the spots where you might have a problem. Not everything here is broken.\";\n for (const rule of rules) {\n if (rule.offenders.length === 0) continue;\n txt += String(rule.matchJS) + \"\\n\";\n txt += rule.reason + \"\\n\\n\";\n txt += formatOffenders(rule.offenders);\n txt += \"\\n\\n\";\n }\n return txt;\n};\n\nconst processScript = (rules: IRule[], script: Script) => {\n const lines = script.code.split(\"\\n\");\n for (let i = 0; i < lines.length; i++) {\n for (const rule of rules) {\n const line = lines[i];\n const match = script.filename.endsWith(\".script\") ? rule.matchScript ?? rule.matchJS : rule.matchJS;\n if (line.match(match)) {\n rule.offenders.push({\n file: script.filename,\n line: i + 1,\n content: line,\n });\n }\n }\n }\n};\n","import React, { useState, useEffect } from \"react\";\n\nimport Paper from \"@mui/material/Paper\";\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Button from \"@mui/material/Button\";\nimport ArrowForwardIos from \"@mui/icons-material/ArrowForwardIos\";\nimport ArrowBackIos from \"@mui/icons-material/ArrowBackIos\";\nimport { ITutorialEvents } from \"./ITutorialEvents\";\nimport { CopyableText } from \"../React/CopyableText\";\n\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\";\nimport StorageIcon from \"@mui/icons-material/Storage\";\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\nimport {\n iTutorialPrevStep,\n iTutorialNextStep,\n ITutorial,\n iTutorialSteps,\n iTutorialEnd,\n} from \"../../InteractiveTutorial\";\nimport { NSSelection } from \"./NSSelection\";\n\ninterface IContent {\n content: React.ReactElement;\n canNext: boolean;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n borderBottom: \"1px solid \" + theme.palette.primary.main,\n },\n code: {\n whiteSpace: \"pre\",\n backgroundColor: theme.palette.background.paper,\n },\n }),\n);\n\nenum Language {\n None,\n NS1,\n NS2,\n}\n\nexport function InteractiveTutorialRoot(): React.ReactElement {\n const [nsSelectionOpen, setNSSelectionOpen] = useState(false);\n const [language, setLanguage] = useState(Language.None);\n const classes = useStyles();\n\n const tutorialScriptExtension = {\n [Language.None]: \".script\",\n [Language.NS1]: \".script\",\n [Language.NS2]: \".js\",\n }[language];\n const tutorialScriptName = `n00dles${tutorialScriptExtension}`;\n\n const contents: { [number: string]: IContent | undefined } = {\n [iTutorialSteps.Start as number]: {\n content: (\n <>\n \n Welcome to Bitburner, a cyberpunk-themed incremental RPG! The game takes place in a dark, dystopian\n future... The year is 2077...\n
    \n
    \n This tutorial will show you the basics of the game. You may skip the tutorial at any time.\n
    \n
    \n You can also collapse this panel to temporarily hide this tutorial.\n
    \n \n ),\n canNext: true,\n },\n [iTutorialSteps.NSSelection as number]: {\n content: (\n <>\n The tutorial will adjust to your programming ability.\n Bitburner has 2 types of scripts:\n \n \n NS1: Javascript from 2009, very simple. Recommended for beginners to programming.\n \n \n \n NS2: Native, modern Javascript. Recommended if you know any programming language or are serious about\n learning programming.\n \n \n \n \n Both are available at all time and interchangeably. This choice is only for the tutorial.\n \n {\n setLanguage(Language.NS1);\n iTutorialNextStep();\n }}\n >\n Use NS1\n \n {\n setLanguage(Language.NS2);\n iTutorialNextStep();\n }}\n >\n Use NS2\n \n \n
    \n \n ),\n canNext: false,\n },\n [iTutorialSteps.GoToCharacterPage as number]: {\n content: (\n <>\n Let's start by heading to the Stats page. Click\n \n \n Stats\n \n\n on the main navigation menu (left-hand side of the screen)\n \n ),\n canNext: false,\n },\n [iTutorialSteps.CharacterPage as number]: {\n content: (\n <>\n \n \n Stats\n \n \n shows a lot of important information about your progress, such as your skills, money, and bonuses.\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.CharacterGoToTerminalPage as number]: {\n content: (\n <>\n Let's head to your computer's terminal by clicking\n \n \n Terminal\n \n on the main navigation menu.\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalIntro as number]: {\n content: (\n <>\n \n \n Terminal\n \n \n is used to interface with your home computer as well as all of the other machines around the world.\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHelp as number]: {\n content: (\n <>\n Let's try it out. Start by entering\n {\"[home ~/]> help\"}\n (Don't forget to press Enter after typing the command)\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalLs as number]: {\n content: (\n <>\n {\"[home ~/]> help\"}\n \n displays a list of all available Terminal commands, how to use them, and a description of what they do.{\" \"}\n
    \n
    \n Let's try another command. Enter\n
    \n\n {\"[home ~/]> ls\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScan as number]: {\n content: (\n <>\n {\"[home ~/]> ls\"}\n \n {\" \"}\n is a basic command that shows files on the computer. Right now, it shows that you have a program called{\" \"}\n NUKE.exe on your computer. We'll get to what this does later.
    \n
    \n Using your home computer's terminal, you can connect to other machines throughout the world. Let's do that\n now by first entering\n
    \n {\"[home ~/]> scan\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze1 as number]: {\n content: (\n <>\n {\"[home ~/]> scan\"}\n \n shows all available network connections. In other words, it displays a list of all servers that can be\n connected to from your current machine. A server is identified by its hostname.
    \n
    \n That's great and all, but there's so many servers. Which one should you go to?{\" \"}\n
    \n\n {\"[home ~/]> scan-analyze\"}\n gives some more detailed information about servers on the network. Try it now!\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalScanAnalyze2 as number]: {\n content: (\n <>\n {\"[home ~/]> scan-analyze\"}\n \n shows more detailed information about each server that you can connect to (servers that are a distance of\n one node away).
    \n
    It is also possible to run scan-analyze with a higher depth. Let's try a depth of two with the\n following command:{\" \"}\n
    \n\n {\"[home ~/]> scan-analyze 2\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalConnect as number]: {\n content: (\n <>\n \n Now you can see information about all servers that are up to two nodes away, as well as figure out how to\n navigate to those servers through the network. You can only connect to a server that is one node away. To\n connect to a machine, use\n \n {\"[home ~/]> connect hostname\"}\n\n From the results of \n {\"[home ~/]> scan-analyze 2\"}\n\n \n {\" \"}\n we can see that the n00dles server is only one node away. Let's connect to it now using:\n \n\n {\"[home ~/]> connect n00dles\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalAnalyze as number]: {\n content: (\n <>\n \n You are now connected to another machine! What can you do now? You can hack it!\n
    \n
    In the year 2077, currency has become digital and decentralized. People and corporations store their\n money on servers and computers. Using your hacking abilities, you can hack servers to steal money and gain\n experience.
    \n
    \n Before you try to hack a server, you should run diagnostics using{\" \"}\n
    \n {\"[n00dles ~/]> analyze\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalNuke as number]: {\n content: (\n <>\n When \n {\"[n00dles ~/]> analyze\"}\n\n \n finishes running it will show useful information about hacking the server.
    \n
    For this server, the required hacking skill is only 1, which means you can hack it right now.\n However, in order to hack a server you must first gain root access. The NUKE.exe program that we saw earlier\n on your home computer is a virus that will grant you root access to a machine if there are enough open\n ports.\n
    \n {\"[n00dles ~/]> analyze\"}\n\n \n {\" \"}\n shows that there do not need to be any open ports on this machine for the NUKE virus to work, so go ahead\n and run the virus using{\" \"}\n \n {\"[n00dles ~/]> run NUKE.exe\"}\n\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalManualHack as number]: {\n content: (\n <>\n You now have root access! You can hack the server using \n {\"[n00dles ~/]> hack\"}\n\n Try doing that now.\n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalHackingMechanics as number]: {\n content: (\n \n You are now attempting to hack the server. Performing a hack takes time and only has a certain percentage\n chance of success. This time and success chance is determined by a variety of factors, including your hacking\n skill and the server's security level.\n
    \n
    \n If your attempt to hack the server is successful, you will steal a certain percentage of the server's total\n money. This percentage is affected by your hacking skill and the server's security level.\n
    \n
    \n The amount of money on a server is not limitless. So, if you constantly hack a server and deplete its money,\n then you will encounter diminishing returns in your hacking. You will need to use{\" \"}\n {\"[n00dles ~/]> grow\"}\n which tricks the company into adding money to their server and{\" \"}\n {\"[n00dles ~/]> weaken\"}\n which increases the speed of hack and grow.\n
    \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalGoHome as number]: {\n content: (\n <>\n From any server you can get back home using\n {\"[n00dles ~/]> home\"}\n\n Let's head home before creating our first script!\n \n ),\n canNext: true,\n },\n [iTutorialSteps.TerminalCreateScript as number]: {\n content: (\n <>\n \n Hacking is the core mechanic of the game and is necessary for progressing. However, you don't want to be\n hacking manually the entire time. You can automate your hacking by writing scripts!\n
    \n
    \n To create a new script or edit an existing one, you can use{\" \"}\n
    \n {\"[home ~/]> nano\"}\n\n \n Scripts must end with the {tutorialScriptExtension} extension. Let's make a script now by entering{\" \"}\n \n {`[n00dles ~/]> nano ${tutorialScriptName}`}\n\n \n after the hack command finishes running (Sidenote: Pressing ctrl + c will end a command like hack early)\n \n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTypeScript as number]: {\n content: (\n <>\n \n This is the script editor. You can use it to program your scripts.{\" \"}\n {language !== Language.NS2 && <>Scripts are written in a simplified version of javascript.} Copy and\n paste the following code into the script editor:
    \n
    \n\n \n {language !== Language.NS2 && (\n \n )}\n {language === Language.NS2 && (\n \n )}\n \n \n For anyone with basic programming experience, this code should be straightforward. This script will\n continuously hack the n00dles server.\n
    \n
    \n To save and close the script editor, press the button in the bottom left, or press ctrl + s then ctrl + b.\n
    \n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalFree as number]: {\n content: (\n <>\n \n Now we'll run the script. Scripts require a certain amount of RAM to run, and can be run on any machine\n which you have root access to. Different servers have different amounts of RAM. You can also purchase more\n RAM for your home server.\n
    \n
    \n To check how much RAM is available on this machine, enter\n
    \n {\"[n00dles ~/]> free\"}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalRunScript as number]: {\n content: (\n <>\n \n We have 4GB of free RAM on this machine, which is enough to run our script. Let's run our script using\n \n {`[n00dles ~/]> run ${tutorialScriptName}`}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalGoToActiveScriptsPage as number]: {\n content: (\n <>\n \n Your script is now running! It will continuously run in the background and will automatically stop if the\n code ever completes (the {tutorialScriptName} will never complete because it runs an infinite loop).
    \n
    \n These scripts can passively earn you income and hacking experience. Your scripts will also earn money and\n experience while you are offline, although at a slightly slower rate.
    \n
    \n Let's check out some statistics for our running scripts by clicking{\" \"}\n
    \n \n \n Active Scripts\n \n \n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsPage as number]: {\n content: (\n <>\n \n This page displays information about all of your scripts that are running across every server. You can use\n this to gauge how well your scripts are doing. Let's go back to\n \n \n \n Terminal\n \n \n ),\n canNext: false,\n },\n [iTutorialSteps.ActiveScriptsToTerminal as number]: {\n content: (\n <>\n \n One last thing about scripts, each active script contains logs that detail what it's doing. We can check\n these logs using the tail command. Do that now for the script we just ran by typing{\" \"}\n \n {`[n00dles ~/]> tail ${tutorialScriptName}`}\n \n ),\n canNext: false,\n },\n [iTutorialSteps.TerminalTailScript as number]: {\n content: (\n <>\n \n The log for this script won't show much right now (it might show nothing at all) because it just started\n running...but check back again in a few minutes!
    \n
    \n This covers the basics of hacking. To learn more about writing scripts, select\n
    \n \n \n Tutorial\n \n \n in the main navigation menu to look at the documentation.\n
    \n
    \n For now, let's move on to something else!\n
    \n \n ),\n canNext: true,\n },\n [iTutorialSteps.GoToHacknetNodesPage as number]: {\n content: (\n <>\n \n Hacking is not the only way to earn money. One other way to passively earn money is by purchasing and\n upgrading Hacknet Nodes. Let's go to\n \n \n \n Hacknet\n \n through the main navigation menu now.\n \n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesIntroduction as number]: {\n content: (\n \n Here you can purchase new Hacknet Nodes and upgrade your existing ones. Let's purchase a new one now.\n \n ),\n canNext: true,\n },\n [iTutorialSteps.HacknetNodesGoToWorldPage as number]: {\n content: (\n <>\n \n You just purchased a Hacknet Node! This Hacknet Node will passively earn you money over time, both online\n and offline. When you get enough money, you can upgrade your newly-purchased Hacknet Node below.\n
    \n
    \n Let's go to\n
    \n \n \n City\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.WorldDescription as number]: {\n content: (\n <>\n \n This page lists all of the different locations you can currently travel to. Each location has something that\n you can do. There's a lot of content out in the world, make sure you explore and discover!\n
    \n
    \n Lastly, click on\n
    \n \n \n Tutorial\n \n \n ),\n canNext: true,\n },\n [iTutorialSteps.TutorialPageInfo as number]: {\n content: (\n \n This page contains a lot of different documentation about the game's content and mechanics. I know it's a lot,\n but I highly suggest you read (or at least skim) through this before you start playing . That's the end of the\n tutorial. Hope you enjoy the game!\n \n ),\n canNext: true,\n },\n [iTutorialSteps.End as number]: {\n content: ,\n canNext: true,\n },\n };\n\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n return ITutorialEvents.subscribe(rerender);\n }, []);\n const step = ITutorial.currStep;\n const content = contents[step];\n if (content === undefined) throw new Error(\"error in the tutorial\");\n return (\n <>\n setNSSelectionOpen(false)} />\n \n {content.content}\n {step !== iTutorialSteps.TutorialPageInfo && (\n <>\n {step !== iTutorialSteps.Start && (\n \n \n \n )}\n {content.canNext && (\n \n \n \n )}\n \n )}\n
    \n
    \n \n
    \n \n );\n}\n","import Editor from \"@monaco-editor/react\";\nimport { Tab, Tabs, Typography } from \"@mui/material\";\nimport React from \"react\";\n\nimport { Modal } from \"../React/Modal\";\n\nimport * as monaco from \"monaco-editor\";\n\ntype IStandaloneCodeEditor = monaco.editor.IStandaloneCodeEditor;\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nconst ns1Example = `while(true) {\n hack('n00dles');\n}`;\nconst ns2Example = `/** @param {NS} ns */\nexport async function main(ns) {\n\twhile(true) {\n\t\tawait ns.hack('n00dles');\n\t}\n}`;\n\nexport function NSSelection(props: IProps): React.ReactElement {\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n function onMount(editor: IStandaloneCodeEditor): void {\n editor.updateOptions({ readOnly: true });\n }\n\n return (\n \n \n \n \n \n\n {value === 0 && (\n <>\n \n These scripts end with '.script'. Using a very old interpreted version of javascript. It is perfect for\n beginner to programming.\n \n Example script using NS1:\n }\n defaultLanguage=\"javascript\"\n defaultValue={ns1Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n onMount={onMount}\n options={{ fontSize: 30 }}\n />\n \n )}\n {value === 1 && (\n <>\n \n These scripts end with '.js'. Scripts using ns2 are running natively along the game. If you know any\n programming language you should be using this. However if you're unfamiliar with javascript Promises you\n might want to read up on them a little bit before diving in.\n \n Example script using NS2:\n }\n defaultLanguage=\"javascript\"\n defaultValue={ns2Example}\n height={`${300}px`}\n theme={\"vs-dark\"}\n options={{ fontSize: 30 }}\n />\n \n )}\n \n );\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport Draggable, { DraggableEventHandler } from \"react-draggable\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Paper from \"@mui/material/Paper\";\nimport KeyboardArrowDownIcon from \"@mui/icons-material/KeyboardArrowDown\";\nimport KeyboardArrowUpIcon from \"@mui/icons-material/KeyboardArrowUp\";\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\";\nimport SchoolIcon from \"@mui/icons-material/School\";\nimport { use } from \"../Context\";\nimport { Page } from \"../Router\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { Box, Button, Typography } from \"@mui/material\";\nimport { debounce } from \"lodash\";\n\nconst useStyles = makeStyles({\n overviewContainer: {\n position: \"fixed\",\n top: 0,\n right: 0,\n zIndex: 1500,\n display: \"flex\",\n justifyContent: \"flex-end\",\n flexDirection: \"column\",\n },\n\n header: {\n cursor: \"grab\",\n textAlign: \"center\",\n display: \"flex\",\n flexDirection: \"row\",\n alignItems: \"center\",\n },\n\n visibilityToggle: {\n padding: \"2px\",\n minWidth: \"inherit\",\n backgroundColor: \"transparent\",\n border: \"none\",\n \"&:hover\": {\n backgroundColor: \"rgba(255, 255, 255, 0.1)\",\n },\n },\n\n collapse: {\n borderTop: `1px solid ${Settings.theme.welllight}`,\n margin: \"0 auto\",\n },\n\n icon: {\n fontSize: \"24px\",\n },\n});\n\ninterface IProps {\n children: JSX.Element[] | JSX.Element | React.ReactElement[] | React.ReactElement;\n mode: \"tutorial\" | \"overview\";\n}\n\nexport interface OverviewSettings {\n opened: boolean;\n x: number;\n y: number;\n}\n\nexport function Overview({ children, mode }: IProps): React.ReactElement {\n const draggableRef = useRef(null);\n const [open, setOpen] = useState(Settings.overview.opened);\n const [x, setX] = useState(Settings.overview.x);\n const [y, setY] = useState(Settings.overview.y);\n const classes = useStyles();\n const router = use.Router();\n\n const CurrentIcon = open ? KeyboardArrowUpIcon : KeyboardArrowDownIcon;\n const LeftIcon = mode === \"tutorial\" ? SchoolIcon : EqualizerIcon;\n const header = mode === \"tutorial\" ? \"Tutorial\" : \"Overview\";\n const handleStop: DraggableEventHandler = (e, data) => {\n setX(data.x);\n setY(data.y);\n };\n\n useEffect(() => {\n Settings.overview = { x, y, opened: open };\n }, [open, x, y]);\n\n // Trigger fakeDrag once to make sure loaded data is not outside bounds\n useEffect(() => fakeDrag(), []);\n\n // And trigger fakeDrag when the window is resized\n useEffect(() => {\n window.addEventListener(\"resize\", fakeDrag);\n return () => {\n window.removeEventListener(\"resize\", fakeDrag);\n };\n }, []);\n\n const fakeDrag = debounce((): void => {\n const node = draggableRef?.current;\n if (!node) return;\n\n // No official way to trigger an onChange to recompute the bounds\n // See: https://github.com/react-grid-layout/react-draggable/issues/363#issuecomment-947751127\n triggerMouseEvent(node, \"mouseover\");\n triggerMouseEvent(node, \"mousedown\");\n triggerMouseEvent(document, \"mousemove\");\n triggerMouseEvent(node, \"mouseup\");\n triggerMouseEvent(node, \"click\");\n }, 100);\n\n const triggerMouseEvent = (node: HTMLDivElement | Document, eventType: string): void => {\n const clickEvent = document.createEvent(\"MouseEvents\");\n clickEvent.initEvent(eventType, true, true);\n node.dispatchEvent(clickEvent);\n };\n\n if (router.page() === Page.BitVerse || router.page() === Page.Loading || router.page() === Page.Recovery)\n return <>;\n return (\n \n \n setOpen((old) => !old)} ref={draggableRef}>\n \n \n \n {header}\n \n \n {\n setOpen((old) => !old)}\n onTouchEnd={() => setOpen((old) => !old)}\n />\n }\n \n \n \n \n {children}\n \n \n \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { KEYCODE } from \"../../utils/helpers/keyCodes\";\nimport clsx from \"clsx\";\nimport { styled, Theme, CSSObject } from \"@mui/material/styles\";\nimport createStyles from \"@mui/styles/createStyles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport MuiDrawer from \"@mui/material/Drawer\";\nimport List from \"@mui/material/List\";\nimport Divider from \"@mui/material/Divider\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport ChevronLeftIcon from \"@mui/icons-material/ChevronLeft\";\nimport ChevronRightIcon from \"@mui/icons-material/ChevronRight\";\nimport ListItem from \"@mui/material/ListItem\";\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Typography from \"@mui/material/Typography\";\nimport Collapse from \"@mui/material/Collapse\";\nimport Badge from \"@mui/material/Badge\";\n\nimport ComputerIcon from \"@mui/icons-material/Computer\";\nimport LastPageIcon from \"@mui/icons-material/LastPage\"; // Terminal\nimport CreateIcon from \"@mui/icons-material/Create\"; // Create Script\nimport StorageIcon from \"@mui/icons-material/Storage\"; // Active Scripts\nimport BugReportIcon from \"@mui/icons-material/BugReport\"; // Create Program\nimport EqualizerIcon from \"@mui/icons-material/Equalizer\"; // Stats\nimport ContactsIcon from \"@mui/icons-material/Contacts\"; // Factions\nimport DoubleArrowIcon from \"@mui/icons-material/DoubleArrow\"; // Augmentations\nimport AccountTreeIcon from \"@mui/icons-material/AccountTree\"; // Hacknet\nimport PeopleAltIcon from \"@mui/icons-material/PeopleAlt\"; // Sleeves\nimport LocationCityIcon from \"@mui/icons-material/LocationCity\"; // City\nimport AirplanemodeActiveIcon from \"@mui/icons-material/AirplanemodeActive\"; // Travel\nimport WorkIcon from \"@mui/icons-material/Work\"; // Job\nimport TrendingUpIcon from \"@mui/icons-material/TrendingUp\"; // Stock Market\nimport FormatBoldIcon from \"@mui/icons-material/FormatBold\"; // Bladeburner\nimport BusinessIcon from \"@mui/icons-material/Business\"; // Corp\nimport SportsMmaIcon from \"@mui/icons-material/SportsMma\"; // Gang\nimport CheckIcon from \"@mui/icons-material/Check\"; // Milestones\nimport HelpIcon from \"@mui/icons-material/Help\"; // Tutorial\nimport SettingsIcon from \"@mui/icons-material/Settings\"; // options\nimport DeveloperBoardIcon from \"@mui/icons-material/DeveloperBoard\"; // Dev\nimport EmojiEventsIcon from \"@mui/icons-material/EmojiEvents\"; // Achievements\nimport AccountBoxIcon from \"@mui/icons-material/AccountBox\";\nimport PublicIcon from \"@mui/icons-material/Public\";\nimport LiveHelpIcon from \"@mui/icons-material/LiveHelp\";\nimport ExpandLessIcon from \"@mui/icons-material/ExpandLess\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { IRouter, Page } from \"../../ui/Router\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { iTutorialSteps, iTutorialNextStep, ITutorial } from \"../../InteractiveTutorial\";\nimport { getAvailableCreatePrograms } from \"../../Programs/ProgramHelpers\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\n\nimport { ProgramsSeen } from \"../../Programs/ui/ProgramsRoot\";\nimport { InvitationsSeen } from \"../../Faction/ui/FactionsRoot\";\nimport { hash } from \"../../hash/hash\";\nimport { Locations } from \"../../Locations/Locations\";\n\nconst openedMixin = (theme: Theme): CSSObject => ({\n width: theme.spacing(31),\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.enteringScreen,\n }),\n overflowX: \"hidden\",\n});\n\nconst closedMixin = (theme: Theme): CSSObject => ({\n transition: theme.transitions.create(\"width\", {\n easing: theme.transitions.easing.sharp,\n duration: theme.transitions.duration.leavingScreen,\n }),\n overflowX: \"hidden\",\n width: `calc(${theme.spacing(2)} + 1px)`,\n [theme.breakpoints.up(\"sm\")]: {\n width: `calc(${theme.spacing(7)} + 1px)`,\n },\n});\n\nconst Drawer = styled(MuiDrawer, { shouldForwardProp: (prop) => prop !== \"open\" })(({ theme, open }) => ({\n width: theme.spacing(31),\n whiteSpace: \"nowrap\",\n boxSizing: \"border-box\",\n ...(open && {\n ...openedMixin(theme),\n \"& .MuiDrawer-paper\": openedMixin(theme),\n }),\n ...(!open && {\n ...closedMixin(theme),\n \"& .MuiDrawer-paper\": closedMixin(theme),\n }),\n}));\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n active: {\n borderLeft: \"3px solid \" + theme.palette.primary.main,\n },\n listitem: {},\n }),\n);\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n page: Page;\n opened: boolean;\n onToggled: (newValue: boolean) => void;\n}\n\nexport function SidebarRoot(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const [hackingOpen, setHackingOpen] = useState(true);\n const [characterOpen, setCharacterOpen] = useState(true);\n const [worldOpen, setWorldOpen] = useState(true);\n const [helpOpen, setHelpOpen] = useState(true);\n\n const flashTerminal =\n ITutorial.currStep === iTutorialSteps.CharacterGoToTerminalPage ||\n ITutorial.currStep === iTutorialSteps.ActiveScriptsPage;\n\n const flashStats = ITutorial.currStep === iTutorialSteps.GoToCharacterPage;\n\n const flashActiveScripts = ITutorial.currStep === iTutorialSteps.TerminalGoToActiveScriptsPage;\n\n const flashHacknet = ITutorial.currStep === iTutorialSteps.GoToHacknetNodesPage;\n\n const flashCity = ITutorial.currStep === iTutorialSteps.HacknetNodesGoToWorldPage;\n\n const flashTutorial = ITutorial.currStep === iTutorialSteps.WorldDescription;\n\n const augmentationCount = props.player.queuedAugmentations.length;\n const invitationsCount = props.player.factionInvitations.filter((f) => !InvitationsSeen.includes(f)).length;\n const programCount = getAvailableCreatePrograms(props.player).length - ProgramsSeen.length;\n\n const canOpenFactions =\n props.player.factionInvitations.length > 0 ||\n props.player.factions.length > 0 ||\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenAugmentations =\n props.player.augmentations.length > 0 ||\n props.player.queuedAugmentations.length > 0 ||\n props.player.sourceFiles.length > 0;\n\n const canOpenSleeves = props.player.sleeves.length > 0;\n\n const canCorporation = !!props.player.corporation;\n const canGang = !!props.player.gang;\n const canJob = Object.values(props.player.jobs).length > 0;\n const canStockMarket = props.player.hasWseAccount;\n const canBladeburner = !!props.player.bladeburner;\n const canStaneksGift = props.player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1);\n\n function clickTerminal(): void {\n props.router.toTerminal();\n if (flashTerminal) iTutorialNextStep();\n }\n\n function clickScriptEditor(): void {\n props.router.toScriptEditor();\n }\n\n function clickStats(): void {\n props.router.toStats();\n if (flashStats) iTutorialNextStep();\n }\n\n function clickActiveScripts(): void {\n props.router.toActiveScripts();\n if (flashActiveScripts) iTutorialNextStep();\n }\n\n function clickCreateProgram(): void {\n props.router.toCreateProgram();\n }\n\n function clickStaneksGift(): void {\n props.router.toStaneksGift();\n }\n\n function clickFactions(): void {\n props.router.toFactions();\n }\n\n function clickAugmentations(): void {\n props.router.toAugmentations();\n }\n\n function clickSleeves(): void {\n props.router.toSleeves();\n }\n\n function clickHacknet(): void {\n props.router.toHacknetNodes();\n if (flashHacknet) iTutorialNextStep();\n }\n\n function clickCity(): void {\n props.router.toCity();\n if (flashCity) iTutorialNextStep();\n }\n\n function clickTravel(): void {\n props.router.toTravel();\n }\n\n function clickJob(): void {\n props.router.toJob(Locations[Object.keys(props.player.jobs)[0]]);\n }\n\n function clickStockMarket(): void {\n props.router.toStockMarket();\n }\n\n function clickBladeburner(): void {\n props.router.toBladeburner();\n }\n\n function clickCorp(): void {\n props.router.toCorporation();\n }\n\n function clickGang(): void {\n props.router.toGang();\n }\n\n function clickTutorial(): void {\n props.router.toTutorial();\n if (flashTutorial) iTutorialNextStep();\n }\n\n function clickMilestones(): void {\n props.router.toMilestones();\n }\n function clickOptions(): void {\n props.router.toGameOptions();\n }\n\n function clickDev(): void {\n props.router.toDevMenu();\n }\n\n function clickAchievements(): void {\n props.router.toAchievements();\n }\n\n useEffect(() => {\n // Shortcuts to navigate through the game\n // Alt-t - Terminal\n // Alt-c - Character\n // Alt-e - Script editor\n // Alt-s - Active scripts\n // Alt-h - Hacknet Nodes\n // Alt-w - City\n // Alt-j - Job\n // Alt-r - Travel Agency of current city\n // Alt-p - Create program\n // Alt-f - Factions\n // Alt-a - Augmentations\n // Alt-u - Tutorial\n // Alt-o - Options\n // Alt-b - Bladeburner\n // Alt-g - Gang\n function handleShortcuts(this: Document, event: KeyboardEvent): void {\n if (Settings.DisableHotkeys) return;\n if ((props.player.currentWork && props.player.focus) || props.router.page() === Page.BitVerse) return;\n if (event.code === KEYCODE.T && event.altKey) {\n event.preventDefault();\n clickTerminal();\n } else if (event.code === KEYCODE.C && event.altKey) {\n event.preventDefault();\n clickStats();\n } else if (event.code === KEYCODE.E && event.altKey) {\n event.preventDefault();\n clickScriptEditor();\n } else if (event.code === KEYCODE.S && event.altKey) {\n event.preventDefault();\n clickActiveScripts();\n } else if (event.code === KEYCODE.H && event.altKey) {\n event.preventDefault();\n clickHacknet();\n } else if (event.code === KEYCODE.W && event.altKey) {\n event.preventDefault();\n clickCity();\n } else if (event.code === KEYCODE.J && event.altKey && !event.ctrlKey && !event.metaKey && canJob) {\n // ctrl/cmd + alt + j is shortcut to open Chrome dev tools\n event.preventDefault();\n clickJob();\n } else if (event.code === KEYCODE.R && event.altKey) {\n event.preventDefault();\n clickTravel();\n } else if (event.code === KEYCODE.P && event.altKey) {\n event.preventDefault();\n clickCreateProgram();\n } else if (event.code === KEYCODE.F && event.altKey) {\n if (props.page == Page.Terminal && Settings.EnableBashHotkeys) {\n return;\n }\n event.preventDefault();\n clickFactions();\n } else if (event.code === KEYCODE.A && event.altKey) {\n event.preventDefault();\n clickAugmentations();\n } else if (event.code === KEYCODE.U && event.altKey) {\n event.preventDefault();\n clickTutorial();\n } else if (event.code === KEYCODE.O && event.altKey) {\n event.preventDefault();\n clickOptions();\n } else if (event.code === KEYCODE.B && event.altKey && props.player.bladeburner) {\n event.preventDefault();\n clickBladeburner();\n } else if (event.code === KEYCODE.G && event.altKey && props.player.gang) {\n event.preventDefault();\n clickGang();\n }\n }\n\n document.addEventListener(\"keydown\", handleShortcuts);\n return () => document.removeEventListener(\"keydown\", handleShortcuts);\n }, []);\n\n const classes = useStyles();\n const [open, setOpen] = useState(props.opened);\n const toggleDrawer = (): void => setOpen((old) => !old);\n\n useEffect(() => {\n props.onToggled(open);\n }, [open]);\n\n return (\n \n \n \n {!open ? : }\n \n \n Bitburner v{CONSTANTS.VersionString}\n \n }\n />\n \n \n \n setHackingOpen((old) => !old)}>\n \n \n \n \n \n Hacking} />\n {hackingOpen ? : }\n \n \n \n \n \n \n \n \n \n \n \n Terminal\n \n \n \n \n \n \n \n \n \n \n \n Script Editor\n \n \n \n \n \n \n \n \n \n \n \n Active Scripts\n \n \n \n \n \n 0 ? programCount : undefined} color=\"error\">\n \n \n \n \n \n \n \n Create Program\n \n \n \n {canStaneksGift && (\n \n \n \n \n \n \n \n \n Stanek's Gift\n \n \n \n )}\n \n \n\n \n setCharacterOpen((old) => !old)}>\n \n \n \n \n \n Character} />\n {characterOpen ? : }\n \n \n \n \n \n \n \n \n \n \n Stats\n \n \n \n {canOpenFactions && (\n \n \n \n \n \n \n \n \n \n \n Factions\n \n \n \n )}\n {canOpenAugmentations && (\n \n \n \n \n \n \n \n \n \n \n Augmentations\n \n \n \n )}\n \n \n \n \n \n \n \n \n Hacknet\n \n \n \n {canOpenSleeves && (\n \n \n \n \n \n \n \n Sleeves\n \n \n )}\n \n\n \n setWorldOpen((old) => !old)}>\n \n \n \n \n \n World} />\n {worldOpen ? : }\n \n \n \n \n \n \n \n \n \n \n City\n \n \n \n \n \n \n \n \n \n \n Travel\n \n \n {canJob && (\n \n \n \n \n \n \n \n Job\n \n \n )}\n {canStockMarket && (\n \n \n \n \n \n \n \n Stock Market\n \n \n )}\n {canBladeburner && (\n \n \n \n \n \n \n \n Bladeburner\n \n \n )}\n {canCorporation && (\n \n \n \n \n \n \n \n Corp\n \n \n )}\n {canGang && (\n \n \n \n \n \n \n \n Gang\n \n \n )}\n \n\n \n setHelpOpen((old) => !old)}>\n \n \n \n \n \n Help} />\n {helpOpen ? : }\n \n \n \n \n \n \n \n \n \n Milestones\n \n \n \n \n \n \n \n \n \n \n Tutorial\n \n \n \n \n \n \n \n \n \n \n Achievements\n \n \n \n \n \n \n \n \n \n Options\n \n \n {process.env.NODE_ENV === \"development\" && (\n \n \n \n \n \n \n \n Dev\n \n \n )}\n \n \n \n );\n}\n","import { Programs } from \"./Programs\";\nimport { Program } from \"./Program\";\n\nimport { IPlayer } from \"../PersonObjects/IPlayer\";\n\n//Returns the programs this player can create.\nexport function getAvailableCreatePrograms(player: IPlayer): Program[] {\n const programs: Program[] = [];\n for (const key of Object.keys(Programs)) {\n // Non-creatable program\n const create = Programs[key].create;\n if (create == null) continue;\n\n // Already has program\n if (player.hasProgram(Programs[key].name)) continue;\n\n // Does not meet requirements\n if (!create.req(player)) continue;\n\n programs.push(Programs[key]);\n }\n\n return programs;\n}\n","/**\n * Root React component for the Augmentations UI page that display all of your\n * owned and purchased Augmentations and Source-Files.\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { InstalledAugmentations } from \"./InstalledAugmentations\";\nimport { PlayerMultipliers } from \"./PlayerMultipliers\";\nimport { PurchasedAugmentations } from \"./PurchasedAugmentations\";\nimport { SourceFilesElement } from \"./SourceFiles\";\n\nimport { canGetBonus } from \"../../ExportBonus\";\nimport { use } from \"../../ui/Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Container from \"@mui/material/Container\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { Info } from \"@mui/icons-material\";\n\ninterface NFGDisplayProps {\n player: IPlayer;\n}\n\nconst NeuroFluxDisplay = ({ player }: NFGDisplayProps): React.ReactElement => {\n const level = player.augmentations.find((e) => e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0;\n\n return level > 0 ? (\n \n \n NeuroFlux Governor - Level {level}\n \n \n {StaticAugmentations[AugmentationNames.NeuroFluxGovernor].stats}\n \n \n ) : (\n <>\n );\n};\n\ninterface EntropyDisplayProps {\n player: IPlayer;\n}\n\nconst EntropyDisplay = ({ player }: EntropyDisplayProps): React.ReactElement => {\n return player.entropy > 0 ? (\n \n \n Entropy Virus - Level {player.entropy}\n \n \n All multipliers decreased by: {formatNumber((1 - CONSTANTS.EntropyEffect ** player.entropy) * 100, 3)}%\n (multiplicative)\n \n \n ) : (\n <>\n );\n};\n\ninterface IProps {\n exportGameFn: () => void;\n installAugmentationsFn: () => void;\n}\n\nexport function AugmentationsRoot(props: IProps): React.ReactElement {\n const [installOpen, setInstallOpen] = useState(false);\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((o) => !o);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n function doExport(): void {\n props.exportGameFn();\n rerender();\n }\n\n function exportBonusStr(): string {\n if (canGetBonus()) return \"(+1 favor to all factions)\";\n return \"\";\n }\n\n function doInstall(): void {\n if (!Settings.SuppressBuyAugmentationConfirmation) {\n setInstallOpen(true);\n } else {\n props.installAugmentationsFn();\n }\n }\n\n return (\n \n Augmentations\n \n \n \n Purchased Augmentations\n \n \n Below is a list of all Augmentations you have purchased but not yet installed. Click the button\n below to install them.\n \n \n WARNING: Installing your Augmentations resets most of your progress, including:\n \n
    \n - Stats/Skill levels and Experience\n - Money\n - Scripts on every computer but your home computer\n - Purchased servers\n - Hacknet Nodes\n - Faction/Company reputation\n - Stocks\n
    \n \n Installing Augmentations lets you start over with the perks and benefits granted by all of the\n Augmentations you have ever installed. Also, you will keep any scripts and RAM/Core upgrades on your\n home computer (but you will lose all programs besides NUKE.exe)\n \n \n }\n >\n \n \n
    \n setInstallOpen(false)}\n onConfirm={props.installAugmentationsFn}\n confirmationText={\n <>\n Installing will reset\n
    \n
    - money\n
    - skill / experience\n
    - every server except home\n
    - factions and reputation\n
    \n
    \n You will keep:\n
    \n
    - All scripts on home\n
    - home ram and cores\n
    \n
    \n It is recommended to install several Augmentations at once. Preferably everything from any faction of\n your choosing.\n \n }\n />\n \n 'I never asked for this'}>\n \n \n \n \n It's always a good idea to backup/export your save!}>\n \n \n \n
    \n {player.queuedAugmentations.length > 0 ? (\n \n \n \n \n ) : (\n \n No Augmentations have been purchased yet\n \n )}\n
    \n\n e.name === AugmentationNames.NeuroFluxGovernor)?.level ?? 0) > 0) +\n +!!(player.entropy > 0)\n }, 1fr)`,\n gap: 1,\n }}\n >\n \n \n \n\n \n \n \n \n
    \n );\n}\n","/**\n * React Component for displaying all of the player's installed Augmentations and\n * Source-Files.\n *\n * It also contains 'configuration' buttons that allow you to change how the\n * Augs/SF's are displayed\n */\nimport { Box, ListItemButton, Paper, Typography } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport List from \"@mui/material/List\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport React, { useState } from \"react\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { use } from \"../../ui/Context\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\n\nexport function InstalledAugmentations(): React.ReactElement {\n const setRerender = useState(true)[1];\n const player = use.Player();\n const sourceAugs = player.augmentations.slice().filter((aug) => aug.name !== AugmentationNames.NeuroFluxGovernor);\n\n const [selectedAug, setSelectedAug] = useState(sourceAugs[0]);\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceAugs.sort((aug1, aug2) => {\n return aug1.name.localeCompare(aug2.name);\n });\n }\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function sortByAcquirementTime(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.AcquirementTime;\n rerender();\n }\n\n function sortInOrder(): void {\n Settings.OwnedAugmentationsOrder = OwnedAugmentationsOrderSetting.Alphabetically;\n rerender();\n }\n\n return (\n \n \n Installed Augmentations\n \n \n \n \n \n \n \n \n \n {sourceAugs.length > 0 ? (\n \n \n \n {sourceAugs.map((k, i) => (\n setSelectedAug(k)} selected={selectedAug === k}>\n {k.name}\n \n ))}\n \n \n \n \n {selectedAug.name}\n \n \n {(() => {\n const aug = StaticAugmentations[selectedAug.name];\n\n const info = typeof aug.info === \"string\" ? {aug.info} : aug.info;\n const tooltip = (\n <>\n {info}\n
    \n
    \n {aug.stats}\n \n );\n return tooltip;\n })()}\n
    \n
    \n
    \n ) : (\n \n No Augmentations have been installed yet\n \n )}\n
    \n );\n}\n","/**\n * React component for displaying the player's multipliers on the Augmentation UI page\n */\nimport { DoubleArrow } from \"@mui/icons-material\";\nimport { List, ListItem, ListItemText, Paper, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { Multipliers, defaultMultipliers, mergeMultipliers } from \"../../PersonObjects/Multipliers\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\n\nfunction calculateAugmentedStats(): Multipliers {\n let augP: Multipliers = defaultMultipliers();\n for (const aug of Player.queuedAugmentations) {\n const augObj = StaticAugmentations[aug.name];\n augP = mergeMultipliers(augP, augObj.mults);\n }\n return augP;\n}\n\ninterface IBitNodeModifiedStatsProps {\n base: number;\n mult: number;\n color: string;\n}\n\nfunction BitNodeModifiedStats(props: IBitNodeModifiedStatsProps): React.ReactElement {\n // If player doesn't have SF5 or if the property isn't affected by BitNode mults\n if (props.mult === 1 || Player.sourceFileLvl(5) === 0)\n return {numeralWrapper.formatPercentage(props.base)};\n\n return (\n \n {numeralWrapper.formatPercentage(props.base)}{\" \"}\n {numeralWrapper.formatPercentage(props.base * props.mult)}\n \n );\n}\n\ninterface MultiplierListItemData {\n mult: string;\n current: number;\n augmented: number;\n bnMult?: number;\n color?: string;\n}\n\ninterface IMultiplierListProps {\n rows: MultiplierListItemData[];\n}\n\nfunction MultiplierList(props: IMultiplierListProps): React.ReactElement {\n const listItems = props.rows\n .map((data) => {\n const { mult, current, augmented, bnMult = 1, color = Settings.theme.primary } = data;\n\n if (!isNaN(augmented)) {\n return (\n \n \n {mult}\n \n }\n secondary={\n \n \n \n \n \n }\n disableTypography\n />\n \n );\n }\n return;\n })\n .filter((i) => i !== undefined);\n\n return listItems.length > 0 ? {listItems} : <>;\n}\n\nexport function PlayerMultipliers(): React.ReactElement {\n const mults = calculateAugmentedStats();\n\n const leftColData: MultiplierListItemData[] = [\n ...[\n {\n mult: \"Hacking Chance\",\n current: Player.mults.hacking_chance,\n augmented: Player.mults.hacking_chance * mults.hacking_chance,\n },\n {\n mult: \"Hacking Speed\",\n current: Player.mults.hacking_speed,\n augmented: Player.mults.hacking_speed * mults.hacking_speed,\n },\n {\n mult: \"Hacking Money\",\n current: Player.mults.hacking_money,\n augmented: Player.mults.hacking_money * mults.hacking_money,\n bnMult: BitNodeMultipliers.ScriptHackMoney,\n },\n {\n mult: \"Hacking Growth\",\n current: Player.mults.hacking_grow,\n augmented: Player.mults.hacking_grow * mults.hacking_grow,\n },\n {\n mult: \"Hacking Level\",\n current: Player.mults.hacking,\n augmented: Player.mults.hacking * mults.hacking,\n bnMult: BitNodeMultipliers.HackingLevelMultiplier,\n },\n {\n mult: \"Hacking Experience\",\n current: Player.mults.hacking_exp,\n augmented: Player.mults.hacking_exp * mults.hacking_exp,\n bnMult: BitNodeMultipliers.HackExpGain,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.hack,\n }),\n ),\n ...[\n {\n mult: \"Strength Level\",\n current: Player.mults.strength,\n augmented: Player.mults.strength * mults.strength,\n bnMult: BitNodeMultipliers.StrengthLevelMultiplier,\n },\n {\n mult: \"Strength Experience\",\n current: Player.mults.strength_exp,\n augmented: Player.mults.strength_exp * mults.strength_exp,\n },\n {\n mult: \"Defense Level\",\n current: Player.mults.defense,\n augmented: Player.mults.defense * mults.defense,\n bnMult: BitNodeMultipliers.DefenseLevelMultiplier,\n },\n {\n mult: \"Defense Experience\",\n current: Player.mults.defense_exp,\n augmented: Player.mults.defense_exp * mults.defense_exp,\n },\n {\n mult: \"Dexterity Level\",\n current: Player.mults.dexterity,\n augmented: Player.mults.dexterity * mults.dexterity,\n bnMult: BitNodeMultipliers.DexterityLevelMultiplier,\n },\n {\n mult: \"Dexterity Experience\",\n current: Player.mults.dexterity_exp,\n augmented: Player.mults.dexterity_exp * mults.dexterity_exp,\n },\n {\n mult: \"Agility Level\",\n current: Player.mults.agility,\n augmented: Player.mults.agility * mults.agility,\n bnMult: BitNodeMultipliers.AgilityLevelMultiplier,\n },\n {\n mult: \"Agility Experience\",\n current: Player.mults.agility_exp,\n augmented: Player.mults.agility_exp * mults.agility_exp,\n },\n ].map((data: MultiplierListItemData) =>\n Object.defineProperty(data, \"color\", {\n value: Settings.theme.combat,\n }),\n ),\n {\n mult: \"Charisma Level\",\n current: Player.mults.charisma,\n augmented: Player.mults.charisma * mults.charisma,\n bnMult: BitNodeMultipliers.CharismaLevelMultiplier,\n color: Settings.theme.cha,\n },\n {\n mult: \"Charisma Experience\",\n current: Player.mults.charisma_exp,\n augmented: Player.mults.charisma_exp * mults.charisma_exp,\n color: Settings.theme.cha,\n },\n ];\n const rightColData: MultiplierListItemData[] = [\n {\n mult: \"Hacknet Node Production\",\n current: Player.mults.hacknet_node_money,\n augmented: Player.mults.hacknet_node_money * mults.hacknet_node_money,\n bnMult: BitNodeMultipliers.HacknetNodeMoney,\n },\n {\n mult: \"Hacknet Node Purchase Cost\",\n current: Player.mults.hacknet_node_purchase_cost,\n augmented: Player.mults.hacknet_node_purchase_cost * mults.hacknet_node_purchase_cost,\n },\n {\n mult: \"Hacknet Node RAM Upgrade Cost\",\n current: Player.mults.hacknet_node_ram_cost,\n augmented: Player.mults.hacknet_node_ram_cost * mults.hacknet_node_ram_cost,\n },\n {\n mult: \"Hacknet Node Core Purchase Cost\",\n current: Player.mults.hacknet_node_core_cost,\n augmented: Player.mults.hacknet_node_core_cost * mults.hacknet_node_core_cost,\n },\n {\n mult: \"Hacknet Node Level Upgrade Cost\",\n current: Player.mults.hacknet_node_level_cost,\n augmented: Player.mults.hacknet_node_level_cost * mults.hacknet_node_level_cost,\n },\n {\n mult: \"Company Reputation Gain\",\n current: Player.mults.company_rep,\n augmented: Player.mults.company_rep * mults.company_rep,\n },\n {\n mult: \"Faction Reputation Gain\",\n current: Player.mults.faction_rep,\n augmented: Player.mults.faction_rep * mults.faction_rep,\n bnMult: BitNodeMultipliers.FactionWorkRepGain,\n },\n {\n mult: \"Salary\",\n current: Player.mults.work_money,\n augmented: Player.mults.work_money * mults.work_money,\n bnMult: BitNodeMultipliers.CompanyWorkMoney,\n color: Settings.theme.money,\n },\n {\n mult: \"Crime Success Chance\",\n current: Player.mults.crime_success,\n augmented: Player.mults.crime_success * mults.crime_success,\n color: Settings.theme.combat,\n },\n {\n mult: \"Crime Money\",\n current: Player.mults.crime_money,\n augmented: Player.mults.crime_money * mults.crime_money,\n bnMult: BitNodeMultipliers.CrimeMoney,\n color: Settings.theme.money,\n },\n ];\n\n if (Player.canAccessBladeburner()) {\n rightColData.push(\n {\n mult: \"Bladeburner Success Chance\",\n current: Player.mults.bladeburner_success_chance,\n augmented: Player.mults.bladeburner_success_chance * mults.bladeburner_success_chance,\n },\n {\n mult: \"Bladeburner Max Stamina\",\n current: Player.mults.bladeburner_max_stamina,\n augmented: Player.mults.bladeburner_max_stamina * mults.bladeburner_max_stamina,\n },\n {\n mult: \"Bladeburner Stamina Gain\",\n current: Player.mults.bladeburner_stamina_gain,\n augmented: Player.mults.bladeburner_stamina_gain * mults.bladeburner_stamina_gain,\n },\n {\n mult: \"Bladeburner Field Analysis\",\n current: Player.mults.bladeburner_analysis,\n augmented: Player.mults.bladeburner_analysis * mults.bladeburner_analysis,\n },\n );\n }\n\n return (\n \n \n \n \n );\n}\n","/**\n * React component for displaying all of the player's purchased (but not installed)\n * Augmentations on the Augmentations UI.\n */\nimport { List, ListItemText, Paper, Tooltip, Typography } from \"@mui/material\";\nimport * as React from \"react\";\nimport { Player } from \"../../Player\";\nimport { StaticAugmentations } from \"../StaticAugmentations\";\nimport { AugmentationNames } from \"../data/AugmentationNames\";\n\nexport function PurchasedAugmentations(): React.ReactElement {\n const augs: React.ReactElement[] = [];\n // Only render the last NeuroFlux (there are no findLastIndex btw)\n let nfgIndex = -1;\n for (let i = Player.queuedAugmentations.length - 1; i >= 0; i--) {\n if (Player.queuedAugmentations[i].name === AugmentationNames.NeuroFluxGovernor) {\n nfgIndex = i;\n break;\n }\n }\n for (let i = 0; i < Player.queuedAugmentations.length; i++) {\n const ownedAug = Player.queuedAugmentations[i];\n let displayName = ownedAug.name;\n\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor && i !== nfgIndex) continue;\n const aug = StaticAugmentations[ownedAug.name];\n\n let level = null;\n if (ownedAug.name === AugmentationNames.NeuroFluxGovernor) {\n level = ownedAug.level;\n displayName += ` - Level ${level}`;\n }\n\n augs.push(\n \n {(() => {\n const info = typeof aug.info === \"string\" ? {aug.info} : aug.info;\n const tooltip = (\n <>\n {info}\n
    \n
    \n {aug.stats}\n \n );\n return tooltip;\n })()}\n \n }\n enterNextDelay={500}\n key={displayName}\n >\n \n ,\n );\n }\n\n return (\n \n \n {augs}\n \n \n );\n}\n","import { ListItemButton, ListItemText, Paper } from \"@mui/material\";\nimport Box from \"@mui/material/Box\";\nimport List from \"@mui/material/List\";\nimport Typography from \"@mui/material/Typography\";\nimport React, { useState } from \"react\";\nimport { Exploit, ExploitName } from \"../../Exploits/Exploit\";\nimport { Player } from \"../../Player\";\nimport { OwnedAugmentationsOrderSetting } from \"../../Settings/SettingEnums\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { SourceFile } from \"../../SourceFile/SourceFile\";\nimport { SourceFiles } from \"../../SourceFile/SourceFiles\";\n\ninterface SfMinus1 {\n info: React.ReactElement;\n n: number;\n name: string;\n lvl: number;\n}\n\nconst safeGetSf = (sfNum: number): SourceFile | SfMinus1 | null => {\n if (sfNum === -1) {\n const sfMinus1: SfMinus1 = {\n info: (\n <>\n This Source-File can only be acquired with obscure knowledge of the game, javascript, and the web ecosystem.\n
    \n
    \n It increases all of the player's multipliers by 0.1%\n
    \n
    \n You have found the following exploits:\n
    \n
    \n {Player.exploits.map((c: Exploit) => (\n \n * {ExploitName(c)}\n
    \n
    \n ))}\n \n ),\n lvl: Player.exploits.length,\n n: -1,\n name: \"Source-File -1: Exploits in the BitNodes\",\n };\n return sfMinus1;\n }\n\n const srcFileKey = \"SourceFile\" + sfNum;\n const sfObj = SourceFiles[srcFileKey];\n if (sfObj == null) {\n console.error(`Invalid source file number: ${sfNum}`);\n return null;\n }\n return sfObj;\n};\n\nconst getMaxLevel = (sfObj: SourceFile | SfMinus1): string | number => {\n let maxLevel;\n switch (sfObj.n) {\n case 12:\n maxLevel = \"∞\";\n break;\n case -1:\n maxLevel = Object.keys(Exploit).length;\n break;\n default:\n maxLevel = \"3\";\n }\n return maxLevel;\n};\n\nexport function SourceFilesElement(): React.ReactElement {\n const sourceSfs = Player.sourceFiles.slice();\n const exploits = Player.exploits;\n // Create a fake SF for -1, if \"owned\"\n if (exploits.length > 0) {\n sourceSfs.unshift({\n n: -1,\n lvl: exploits.length,\n });\n }\n\n if (Settings.OwnedAugmentationsOrder === OwnedAugmentationsOrderSetting.Alphabetically) {\n sourceSfs.sort((sf1, sf2) => {\n return sf1.n - sf2.n;\n });\n }\n\n if (sourceSfs.length === 0) {\n return <>;\n }\n\n const [selectedSf, setSelectedSf] = useState(sourceSfs[0]);\n\n return (\n \n \n Source Files\n \n \n \n \n {sourceSfs.map((e, i) => {\n const sfObj = safeGetSf(e.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n setSelectedSf(e)}\n selected={selectedSf.n === e.n}\n sx={{ py: 0 }}\n >\n {sfObj.name}}\n secondary={\n \n Level {e.lvl} / {maxLevel}\n \n }\n />\n \n );\n })}\n \n \n \n \n {safeGetSf(selectedSf.n)?.name}\n \n \n {(() => {\n const sfObj = safeGetSf(selectedSf.n);\n if (!sfObj) return;\n\n const maxLevel = getMaxLevel(sfObj);\n\n return (\n <>\n Level {selectedSf.lvl} / {maxLevel}\n
    \n
    \n {sfObj.info}\n \n );\n })()}\n
    \n
    \n
    \n
    \n );\n}\n","import { IPlayer } from \"./PersonObjects/IPlayer\";\nimport { Bladeburner } from \"./Bladeburner/Bladeburner\";\nimport { IEngine } from \"./IEngine\";\nimport { IRouter } from \"./ui/Router\";\nimport { AugmentationNames } from \"./Augmentation/data/AugmentationNames\";\n\nimport React, { useEffect } from \"react\";\n\nimport { General } from \"./DevMenu/ui/General\";\nimport { Stats } from \"./DevMenu/ui/Stats\";\nimport { Factions } from \"./DevMenu/ui/Factions\";\nimport { Augmentations } from \"./DevMenu/ui/Augmentations\";\nimport { SourceFiles } from \"./DevMenu/ui/SourceFiles\";\nimport { Programs } from \"./DevMenu/ui/Programs\";\nimport { Servers } from \"./DevMenu/ui/Servers\";\nimport { Companies } from \"./DevMenu/ui/Companies\";\nimport { Bladeburner as BladeburnerElem } from \"./DevMenu/ui/Bladeburner\";\nimport { Gang } from \"./DevMenu/ui/Gang\";\nimport { Corporation } from \"./DevMenu/ui/Corporation\";\nimport { CodingContracts } from \"./DevMenu/ui/CodingContracts\";\nimport { StockMarket } from \"./DevMenu/ui/StockMarket\";\nimport { Sleeves } from \"./DevMenu/ui/Sleeves\";\nimport { Stanek } from \"./DevMenu/ui/Stanek\";\nimport { TimeSkip } from \"./DevMenu/ui/TimeSkip\";\nimport { SaveFile } from \"./DevMenu/ui/SaveFile\";\nimport { Achievements } from \"./DevMenu/ui/Achievements\";\nimport { Entropy } from \"./DevMenu/ui/Entropy\";\nimport Typography from \"@mui/material/Typography\";\nimport { Exploit } from \"./Exploits/Exploit\";\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n router: IRouter;\n}\n\nexport function DevMenuRoot(props: IProps): React.ReactElement {\n useEffect(() => {\n props.player.giveExploit(Exploit.YoureNotMeantToAccessThis);\n }, []);\n return (\n <>\n Development Menu - Only meant to be used for testing/debugging\n \n \n \n \n \n \n \n \n\n {props.player.bladeburner instanceof Bladeburner && }\n\n {props.player.inGang() && }\n\n {props.player.hasCorporation() && }\n\n \n\n {props.player.hasWseAccount && }\n\n {props.player.sleeves.length > 0 && }\n {props.player.augmentations.some((aug) => aug.name === AugmentationNames.StaneksGift1) && }\n\n \n \n \n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../ui/React/Money\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { MenuItem, SelectChangeEvent, TextField, Select } from \"@mui/material\";\nimport { Bladeburner } from \"../../Bladeburner/Bladeburner\";\nimport { GangConstants } from \"../../Gang/data/Constants\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { checkForMessagesToSend } from \"../../Message/MessageHelpers\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n}\n\nexport function General(props: IProps): React.ReactElement {\n const [error, setError] = useState(false);\n const [corporationName, setCorporationName] = useState(\"\");\n const [gangFaction, setGangFaction] = useState(\"\");\n\n function addMoney(n: number) {\n return function () {\n props.player.gainMoney(n, \"other\");\n };\n }\n\n function upgradeRam(): void {\n props.player.getHomeComputer().maxRam *= 2;\n }\n\n function quickB1tFlum3(): void {\n props.router.toBitVerse(true, true);\n }\n\n function b1tflum3(): void {\n props.router.toBitVerse(true, false);\n }\n\n function quickHackW0r1dD43m0n(): void {\n props.router.toBitVerse(false, true);\n }\n\n function hackW0r1dD43m0n(): void {\n props.router.toBitVerse(false, false);\n }\n\n function createCorporation(): void {\n props.player.startCorporation(corporationName);\n }\n\n function joinBladeburner(): void {\n props.player.bladeburner = new Bladeburner(props.player);\n }\n\n function startGang(): void {\n const isHacking = gangFaction === FactionNames.NiteSec || gangFaction === FactionNames.TheBlackHand;\n props.player.startGang(gangFaction, isHacking);\n }\n\n function setGangFactionDropdown(event: SelectChangeEvent): void {\n setGangFaction(event.target.value);\n }\n\n function checkMessages(): void {\n checkForMessagesToSend();\n }\n\n useEffect(() => {\n if (error) throw new ReferenceError(\"Manually thrown error\");\n }, [error]);\n\n return (\n \n }>\n General\n \n \n \n \n \n \n \n \n
    \n Corporation Name:\n setCorporationName(x.target.value)} />\n \n
    \n Gang Faction:\n \n \n
    \n \n
    \n\n \n \n \n \n \n \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n function modifyExp(stat: string, modifier: number) {\n return function (exp: number) {\n switch (stat) {\n case \"hacking\":\n if (exp) {\n props.player.gainHackingExp(exp * modifier);\n }\n break;\n case \"strength\":\n if (exp) {\n props.player.gainStrengthExp(exp * modifier);\n }\n break;\n case \"defense\":\n if (exp) {\n props.player.gainDefenseExp(exp * modifier);\n }\n break;\n case \"dexterity\":\n if (exp) {\n props.player.gainDexterityExp(exp * modifier);\n }\n break;\n case \"agility\":\n if (exp) {\n props.player.gainAgilityExp(exp * modifier);\n }\n break;\n case \"charisma\":\n if (exp) {\n props.player.gainCharismaExp(exp * modifier);\n }\n break;\n case \"intelligence\":\n if (exp) {\n props.player.gainIntelligenceExp(exp * modifier);\n }\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function modifyKarma(modifier: number) {\n return function (amt: number) {\n props.player.karma += amt * modifier;\n };\n }\n\n function tonsOfExp(): void {\n props.player.gainHackingExp(bigNumber);\n props.player.gainStrengthExp(bigNumber);\n props.player.gainDefenseExp(bigNumber);\n props.player.gainDexterityExp(bigNumber);\n props.player.gainAgilityExp(bigNumber);\n props.player.gainCharismaExp(bigNumber);\n props.player.gainIntelligenceExp(bigNumber);\n props.player.updateSkillLevels();\n }\n\n function resetAllExp(): void {\n props.player.exp.hacking = 0;\n props.player.exp.strength = 0;\n props.player.exp.defense = 0;\n props.player.exp.dexterity = 0;\n props.player.exp.agility = 0;\n props.player.exp.charisma = 0;\n props.player.exp.intelligence = 0;\n props.player.updateSkillLevels();\n }\n\n function resetExperience(stat: string): () => void {\n return function () {\n switch (stat) {\n case \"hacking\":\n props.player.exp.hacking = 0;\n break;\n case \"strength\":\n props.player.exp.strength = 0;\n break;\n case \"defense\":\n props.player.exp.defense = 0;\n break;\n case \"dexterity\":\n props.player.exp.dexterity = 0;\n break;\n case \"agility\":\n props.player.exp.agility = 0;\n break;\n case \"charisma\":\n props.player.exp.charisma = 0;\n break;\n case \"intelligence\":\n props.player.exp.intelligence = 0;\n break;\n }\n props.player.updateSkillLevels();\n };\n }\n\n function resetKarma(): () => void {\n return function () {\n props.player.karma = 0;\n };\n }\n\n function enableIntelligence(): void {\n if (props.player.skills.intelligence === 0) {\n props.player.skills.intelligence = 1;\n props.player.updateSkillLevels();\n }\n }\n\n function disableIntelligence(): void {\n props.player.exp.intelligence = 0;\n props.player.skills.intelligence = 0;\n props.player.updateSkillLevels();\n }\n\n return (\n \n }>\n Experience / Stats\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n All:\n \n \n \n
    \n Hacking:\n \n modifyExp(\"hacking\", 1)(bigNumber)}\n add={modifyExp(\"hacking\", 1)}\n subtract={modifyExp(\"hacking\", -1)}\n reset={resetExperience(\"hacking\")}\n />\n
    \n Strength:\n \n modifyExp(\"strength\", 1)(bigNumber)}\n add={modifyExp(\"strength\", 1)}\n subtract={modifyExp(\"strength\", -1)}\n reset={resetExperience(\"strength\")}\n />\n
    \n Defense:\n \n modifyExp(\"defense\", 1)(bigNumber)}\n add={modifyExp(\"defense\", 1)}\n subtract={modifyExp(\"defense\", -1)}\n reset={resetExperience(\"defense\")}\n />\n
    \n Dexterity:\n \n modifyExp(\"dexterity\", 1)(bigNumber)}\n add={modifyExp(\"dexterity\", 1)}\n subtract={modifyExp(\"dexterity\", -1)}\n reset={resetExperience(\"dexterity\")}\n />\n
    \n Agility:\n \n modifyExp(\"agility\", 1)(bigNumber)}\n add={modifyExp(\"agility\", 1)}\n subtract={modifyExp(\"agility\", -1)}\n reset={resetExperience(\"agility\")}\n />\n
    \n Charisma:\n \n modifyExp(\"charisma\", 1)(bigNumber)}\n add={modifyExp(\"charisma\", 1)}\n subtract={modifyExp(\"charisma\", -1)}\n reset={resetExperience(\"charisma\")}\n />\n
    \n Intelligence:\n \n modifyExp(\"intelligence\", 1)(bigNumber)}\n add={modifyExp(\"intelligence\", 1)}\n subtract={modifyExp(\"intelligence\", -1)}\n reset={resetExperience(\"intelligence\")}\n />\n \n \n \n \n
    \n Karma:\n \n modifyExp(\"intelligence\", 1)(100000)}\n add={modifyKarma(1)}\n subtract={modifyKarma(-1)}\n reset={resetKarma()}\n />\n
    \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Factions as AllFaction } from \"../../Faction/Factions\";\nimport FormControl from \"@mui/material/FormControl\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyAllIcon from \"@mui/icons-material/ReplyAll\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport InputLabel from \"@mui/material/InputLabel\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Factions(props: IProps): React.ReactElement {\n const [faction, setFaction] = useState(FactionNames.Illuminati as string);\n\n function setFactionDropdown(event: SelectChangeEvent): void {\n setFaction(event.target.value);\n }\n\n function receiveInvite(): void {\n props.player.receiveInvite(faction);\n }\n\n function receiveAllInvites(): void {\n Object.values(FactionNames).forEach((faction) => props.player.receiveInvite(faction));\n }\n\n function modifyFactionRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(reputation)) {\n fac.playerReputation += reputation * modifier;\n }\n };\n }\n\n function resetFactionRep(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.playerReputation = 0;\n }\n }\n\n function modifyFactionFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const fac = AllFaction[faction];\n if (fac != null && !isNaN(favor)) {\n fac.favor += favor * modifier;\n }\n };\n }\n\n function resetFactionFavor(): void {\n const fac = AllFaction[faction];\n if (fac != null) {\n fac.favor = 0;\n }\n }\n\n function tonsOfRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = bigNumber;\n }\n }\n\n function resetAllRep(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].playerReputation = 0;\n }\n }\n\n function tonsOfFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = bigNumber;\n }\n }\n\n function resetAllFactionFavor(): void {\n for (const i of Object.keys(AllFaction)) {\n AllFaction[i].favor = 0;\n }\n }\n\n return (\n \n }>\n Factions\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Faction:\n \n \n Faction\n \n \n \n \n \n \n \n \n }\n >\n {Object.values(AllFaction).map((faction) => (\n \n {faction.name}\n \n ))}\n \n \n
    \n Reputation:\n \n modifyFactionRep(1)(bigNumber)}\n add={modifyFactionRep(1)}\n subtract={modifyFactionRep(-1)}\n reset={resetFactionRep}\n />\n
    \n Favor:\n \n modifyFactionFavor(1)(2000)}\n add={modifyFactionFavor(1)}\n subtract={modifyFactionFavor(-1)}\n reset={resetFactionFavor}\n />\n
    \n All Reputation:\n \n \n \n
    \n All Favor:\n \n \n \n
    \n
    \n
    \n );\n}\n","import { Clear, ExpandMore, Reply, ReplyAll } from \"@mui/icons-material\";\nimport {\n Accordion,\n AccordionDetails,\n AccordionSummary,\n Button,\n IconButton,\n MenuItem,\n Select,\n SelectChangeEvent,\n Typography,\n} from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Augmentations(props: IProps): React.ReactElement {\n const [augmentation, setAugmentation] = useState(\"Augmented Targeting I\");\n\n function setAugmentationDropdown(event: SelectChangeEvent): void {\n setAugmentation(event.target.value);\n }\n function queueAug(): void {\n props.player.queueAugmentation(augmentation);\n }\n\n function queueAllAugs(): void {\n for (const augName of Object.values(AugmentationNames)) {\n props.player.queueAugmentation(augName);\n }\n }\n\n function clearAugs(): void {\n props.player.augmentations = [];\n }\n\n function clearQueuedAugs(): void {\n props.player.queuedAugmentations = [];\n }\n\n return (\n \n }>\n Augmentations\n \n \n \n \n \n \n \n \n \n \n }\n endAdornment={\n <>\n \n \n \n \n }\n >\n {Object.values(AugmentationNames).map((aug) => (\n \n {aug}\n \n ))}\n \n \n \n \n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { PlayerOwnedSourceFile } from \"../../SourceFile/PlayerOwnedSourceFile\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\n\n// Update as additional BitNodes get implemented\nconst validSFN = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function SourceFiles(props: IProps): React.ReactElement {\n function setSF(sfN: number, sfLvl: number) {\n return function () {\n if (sfN === 9) {\n props.player.hacknetNodes = [];\n }\n if (sfLvl === 0) {\n props.player.sourceFiles = props.player.sourceFiles.filter((sf) => sf.n !== sfN);\n return;\n }\n\n if (!props.player.sourceFiles.some((sf) => sf.n === sfN)) {\n props.player.sourceFiles.push(new PlayerOwnedSourceFile(sfN, sfLvl));\n return;\n }\n\n for (let i = 0; i < props.player.sourceFiles.length; i++) {\n if (props.player.sourceFiles[i].n === sfN) {\n props.player.sourceFiles[i].lvl = sfLvl;\n }\n }\n };\n }\n\n function setAllSF(sfLvl: number) {\n return () => {\n for (let i = 0; i < validSFN.length; i++) {\n setSF(validSFN[i], sfLvl)();\n }\n };\n }\n\n function clearExploits(): void {\n props.player.exploits = [];\n }\n\n return (\n \n }>\n Source-Files\n \n \n \n \n \n \n \n \n \n \n \n \n {validSFN.map((i) => (\n \n \n \n \n ))}\n \n
    \n Exploits:\n \n \n
    \n All:\n \n \n \n \n \n \n \n
    \n SF-{i}:\n \n \n \n \n \n \n \n
    \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Programs as AllPrograms } from \"../../Programs/Programs\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Programs(props: IProps): React.ReactElement {\n const [program, setProgram] = useState(\"NUKE.exe\");\n function setProgramDropdown(event: SelectChangeEvent): void {\n setProgram(event.target.value);\n }\n function addProgram(): void {\n if (!props.player.hasProgram(program)) {\n props.player.getHomeComputer().programs.push(program);\n }\n }\n\n function addAllPrograms(): void {\n for (const i of Object.keys(AllPrograms)) {\n if (!props.player.hasProgram(AllPrograms[i].name)) {\n props.player.getHomeComputer().programs.push(AllPrograms[i].name);\n }\n }\n }\n\n return (\n \n }>\n Programs\n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Program:\n \n \n
    \n Add:\n \n \n \n
    \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { GetServer, GetAllServers } from \"../../Server/AllServers\";\nimport { Server } from \"../../Server/Server\";\nimport MenuItem from \"@mui/material/MenuItem\";\n\nexport function Servers(): React.ReactElement {\n const [server, setServer] = useState(\"home\");\n function setServerDropdown(event: SelectChangeEvent): void {\n setServer(event.target.value);\n }\n function rootServer(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n\n function rootAllServers(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hasAdminRights = true;\n s.sshPortOpen = true;\n s.ftpPortOpen = true;\n s.smtpPortOpen = true;\n s.httpPortOpen = true;\n s.sqlPortOpen = true;\n s.openPortCount = 5;\n }\n }\n\n function minSecurity(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n\n function minAllSecurity(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.hackDifficulty = s.minDifficulty;\n }\n }\n\n function maxMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n\n function maxAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = s.moneyMax;\n }\n }\n\n function minMoney(): void {\n const s = GetServer(server);\n if (s === null) return;\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n\n function minAllMoney(): void {\n for (const s of GetAllServers()) {\n if (!(s instanceof Server)) return;\n s.moneyAvailable = 0;\n }\n }\n\n return (\n \n }>\n Servers\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Server:\n \n \n
    \n Root:\n \n \n \n \n
    \n Security:\n \n \n \n \n
    \n Money:\n \n \n \n \n \n \n \n \n
    \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { Companies as AllCompanies } from \"../../Company/Companies\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { Adjuster } from \"./Adjuster\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\nconst bigNumber = 1e12;\n\nexport function Companies(): React.ReactElement {\n const [company, setCompany] = useState(FactionNames.ECorp as string);\n function setCompanyDropdown(event: SelectChangeEvent): void {\n setCompany(event.target.value);\n }\n function resetCompanyRep(): void {\n AllCompanies[company].playerReputation = 0;\n }\n\n function modifyCompanyRep(modifier: number): (x: number) => void {\n return function (reputation: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(reputation)) {\n c.playerReputation += reputation * modifier;\n }\n };\n }\n\n function modifyCompanyFavor(modifier: number): (x: number) => void {\n return function (favor: number): void {\n const c = AllCompanies[company];\n if (c != null && !isNaN(favor)) {\n c.favor += favor * modifier;\n }\n };\n }\n\n function resetCompanyFavor(): void {\n AllCompanies[company].favor = 0;\n }\n\n function tonsOfRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = bigNumber;\n }\n }\n\n function resetAllRepCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].playerReputation = 0;\n }\n }\n\n function tonsOfFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = bigNumber;\n }\n }\n\n function resetAllFavorCompanies(): void {\n for (const c of Object.keys(AllCompanies)) {\n AllCompanies[c].favor = 0;\n }\n }\n\n return (\n \n }>\n Companies\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Company:\n \n \n
    \n Reputation:\n \n modifyCompanyRep(1)(bigNumber)}\n add={modifyCompanyRep(1)}\n subtract={modifyCompanyRep(-1)}\n reset={resetCompanyRep}\n />\n
    \n Favor:\n \n modifyCompanyFavor(1)(2000)}\n add={modifyCompanyFavor(1)}\n subtract={modifyCompanyFavor(-1)}\n reset={resetCompanyFavor}\n />\n
    \n All Reputation:\n \n \n \n
    \n All Favor:\n \n \n \n
    \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Bladeburner(props: IProps): React.ReactElement {\n const bladeburner = props.player.bladeburner;\n if (bladeburner === null) return <>;\n function modifyBladeburnerRank(modify: number): (x: number) => void {\n return function (rank: number): void {\n if (!bladeburner) return;\n bladeburner.changeRank(props.player, rank * modify);\n };\n }\n\n function resetBladeburnerRank(): void {\n if (!bladeburner) return;\n bladeburner.rank = 0;\n bladeburner.maxRank = 0;\n }\n\n function addTonsBladeburnerRank(): void {\n if (!bladeburner) return;\n\n bladeburner.changeRank(props.player, bigNumber);\n }\n\n function modifyBladeburnerCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += cycles * modify;\n };\n }\n\n function resetBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles = 0;\n }\n\n function addTonsBladeburnerCycles(): void {\n if (!bladeburner) return;\n bladeburner.storedCycles += bigNumber;\n }\n\n return (\n \n }>\n Bladeburner\n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Rank:\n \n \n
    \n Cycles:\n \n \n
    \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Gang(props: IProps): React.ReactElement {\n function addTonsGangCycles(): void {\n if (props.player.gang) {\n props.player.gang.storedCycles = bigNumber;\n }\n }\n\n function modifyGangCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (props.player.gang) {\n props.player.gang.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetGangCycles(): void {\n if (props.player.gang) {\n props.player.gang.storedCycles = 0;\n }\n }\n\n return (\n \n }>\n Gang\n \n \n \n \n \n \n \n \n \n
    \n Cycles:\n \n \n
    \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nconst bigNumber = 1e27;\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Corporation(props: IProps): React.ReactElement {\n function addTonsCorporationFunds(): void {\n if (props.player.corporation) {\n props.player.corporation.funds = props.player.corporation.funds + bigNumber;\n }\n }\n\n function modifyCorporationFunds(modify: number): (x: number) => void {\n return function (funds: number): void {\n if (props.player.corporation) {\n props.player.corporation.funds += funds * modify;\n }\n };\n }\n\n function resetCorporationFunds(): void {\n if (props.player.corporation) {\n props.player.corporation.funds = props.player.corporation.funds - props.player.corporation.funds;\n }\n }\n\n function addTonsCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = bigNumber;\n }\n }\n\n function modifyCorporationCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles += cycles * modify;\n }\n };\n }\n\n function resetCorporationCycles(): void {\n if (props.player.corporation) {\n props.player.corporation.storedCycles = 0;\n }\n }\n\n function finishCorporationProducts(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n Object.keys(div.products).forEach((prod) => {\n const product = div.products[prod];\n if (product === undefined) throw new Error(\"Impossible product undefined\");\n product.prog = 99.9;\n });\n });\n }\n\n function addCorporationResearch(): void {\n if (!props.player.corporation) return;\n props.player.corporation.divisions.forEach((div) => {\n div.sciResearch.qty += 1e10;\n });\n }\n\n return (\n \n }>\n Corporation\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Funds:\n \n \n
    \n Cycles:\n \n \n
    \n \n
    \n \n
    \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { generateContract, generateRandomContract, generateRandomContractOnHome } from \"../../CodingContractGenerator\";\nimport { CodingContractTypes } from \"../../CodingContracts\";\n\nexport function CodingContracts(): React.ReactElement {\n const [codingcontract, setCodingcontract] = useState(\"Find Largest Prime Factor\");\n function setCodingcontractDropdown(event: SelectChangeEvent): void {\n setCodingcontract(event.target.value);\n }\n\n function specificContract(): void {\n generateContract({\n problemType: codingcontract,\n server: \"home\",\n });\n }\n\n return (\n \n }>\n Coding Contracts\n \n \n \n \n \n \n \n \n \n \n \n
    \n \n \n
    \n \n \n
    \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { Money } from \"../../ui/React/Money\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { StockMarket as SM } from \"../../StockMarket/StockMarket\";\nimport { Stock } from \"../../StockMarket/Stock\";\n\nexport function StockMarket(): React.ReactElement {\n const [stockPrice, setStockPrice] = useState(0);\n const [stockSymbol, setStockSymbol] = useState(\"\");\n\n function setStockPriceField(event: React.ChangeEvent): void {\n setStockPrice(parseFloat(event.target.value));\n }\n\n function setStockSymbolField(event: React.ChangeEvent): void {\n setStockSymbol(event.target.value);\n }\n\n function processStocks(sub: (arg0: Stock) => void): void {\n const inputSymbols = stockSymbol.replace(/\\s/g, \"\");\n\n let match: (symbol: string) => boolean = (): boolean => {\n return true;\n };\n\n if (inputSymbols !== \"\" && inputSymbols !== \"all\") {\n match = function (symbol: string): boolean {\n return inputSymbols.split(\",\").includes(symbol);\n };\n }\n\n for (const name of Object.keys(SM)) {\n if (SM.hasOwnProperty(name)) {\n const stock = SM[name];\n if (stock instanceof Stock && match(stock.symbol)) {\n sub(stock);\n }\n }\n }\n }\n\n function doSetStockPrice(): void {\n if (!isNaN(stockPrice)) {\n processStocks((stock: Stock) => {\n stock.price = stockPrice;\n });\n }\n }\n\n function viewStockCaps(): void {\n const stocks: JSX.Element[] = [];\n processStocks((stock: Stock) => {\n stocks.push(\n \n {stock.symbol}\n \n \n \n ,\n );\n });\n dialogBoxCreate(\n \n \n \n \n \n \n {stocks}\n \n
    StockPrice cap
    ,\n );\n }\n return (\n \n }>\n Stock Market\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Symbol:\n \n \n
    \n Price:\n \n \n \n
    \n Caps:\n \n \n
    \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Adjuster } from \"./Adjuster\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function Sleeves(props: IProps): React.ReactElement {\n function sleeveMaxAllShock(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].shock = 0;\n }\n }\n\n function sleeveClearAllShock(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].shock = 100;\n }\n }\n\n function sleeveSyncMaxAll(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].sync = 100;\n }\n }\n\n function sleeveSyncClearAll(): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].sync = 0;\n }\n }\n\n function sleeveSetStoredCycles(cycles: number): void {\n for (let i = 0; i < props.player.sleeves.length; ++i) {\n props.player.sleeves[i].storedCycles = cycles;\n }\n }\n\n return (\n \n }>\n Sleeves\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n Shock:\n \n \n \n \n
    \n Sync:\n \n \n \n \n
    \n sleeveSetStoredCycles(10000000)}\n add={sleeveSetStoredCycles}\n subtract={sleeveSetStoredCycles}\n reset={() => sleeveSetStoredCycles(0)}\n />\n
    \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport { staneksGift } from \"../../CotMG/Helper\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { Adjuster } from \"./Adjuster\";\n\nexport function Stanek(): React.ReactElement {\n function addCycles(): void {\n staneksGift.storedCycles = 1e6;\n }\n\n function modCycles(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.storedCycles += cycles * modify;\n };\n }\n\n function resetCycles(): void {\n staneksGift.storedCycles = 0;\n }\n\n function addCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.highestCharge = 1e21;\n f.numCharge = 1e21;\n });\n }\n\n function modCharge(modify: number): (x: number) => void {\n return function (cycles: number): void {\n staneksGift.fragments.forEach((f) => (f.highestCharge += cycles * modify));\n };\n }\n\n function resetCharge(): void {\n staneksGift.fragments.forEach((f) => {\n f.highestCharge = 0;\n f.numCharge = 0;\n });\n }\n\n return (\n \n }>\n Stanek's Gift\n \n \n \n \n \n \n \n \n \n \n \n
    \n \n
    \n \n
    \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { saveObject } from \"../../SaveObject\";\nimport { IEngine } from \"../../IEngine\";\n\n// Update as additional BitNodes get implemented\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function TimeSkip(props: IProps): React.ReactElement {\n function timeskip(time: number) {\n return () => {\n props.player.lastUpdate -= time;\n props.engine._lastUpdate -= time;\n saveObject.saveGame();\n setTimeout(() => location.reload(), 1000);\n };\n }\n\n return (\n \n }>\n Time skip\n \n \n \n \n \n \n \n );\n}\n","import React, { useState, useRef } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { saveObject } from \"../../SaveObject\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { Upload } from \"@mui/icons-material\";\nimport { Button } from \"@mui/material\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport function SaveFile(): React.ReactElement {\n const importInput = useRef(null);\n const [saveFile, setSaveFile] = useState(\"\");\n const [restoreScripts, setRestoreScripts] = useState(true);\n const [restoreAugs, setRestoreAugs] = useState(true);\n const [restoreSFs, setRestoreSFs] = useState(true);\n\n async function onImport(event: React.ChangeEvent): Promise {\n try {\n const base64Save = await saveObject.getImportStringFromFile(event.target.files);\n const save = atob(base64Save);\n setSaveFile(save);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n }\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n function doRestore(): void {\n const save = JSON.parse(saveFile);\n // TODO: Continue here.\n console.error(save);\n }\n\n return (\n \n }>\n Save file\n \n \n \n
    \n {saveFile !== \"\" && (\n <>\n setRestoreScripts(v)}\n text=\"Restore scripts\"\n tooltip={<>Restore the save file home computer scripts.}\n />\n
    \n setRestoreAugs(v)}\n text=\"Restore Augmentations\"\n tooltip={<>Restore the save file installed augmentations.}\n />\n
    \n setRestoreSFs(v)}\n text=\"Restore Source Files\"\n tooltip={<>Restore the save file acquired source files.}\n />\n
    \n \n \n )}\n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport { Tooltip } from \"@mui/material\";\nimport LockIcon from \"@mui/icons-material/Lock\";\nimport LockOpenIcon from \"@mui/icons-material/LockOpen\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { achievements } from \"../../Achievements/Achievements\";\nimport { IEngine } from \"../../IEngine\";\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function Achievements(props: IProps): React.ReactElement {\n const [playerAchievement, setPlayerAchievements] = useState(props.player.achievements.map((m) => m.ID));\n\n function grantAchievement(id: string): void {\n props.player.giveAchievement(id);\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function grantAllAchievements(): void {\n Object.values(achievements).forEach((a) => props.player.giveAchievement(a.ID));\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function removeAchievement(id: string): void {\n props.player.achievements = props.player.achievements.filter((a) => a.ID !== id);\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function clearAchievements(): void {\n props.player.achievements = [];\n setPlayerAchievements(props.player.achievements.map((m) => m.ID));\n }\n\n function disableEngine(): void {\n props.engine.Counters.achievementsCounter = Number.MAX_VALUE;\n }\n\n function enableEngine(): void {\n props.engine.Counters.achievementsCounter = 0;\n }\n\n return (\n \n }>\n Achievements\n \n \n \n \n \n \n \n \n \n {Object.values(achievements).map((i) => {\n const achieved = playerAchievement.includes(i.ID);\n return (\n \n \n \n \n \n );\n })}\n \n
    \n Achievements:\n \n \n \n \n \n \n \n
    \n {achieved ? (\n \n \n \n ) : (\n \n \n \n )}\n \n \n {i.ID}\n
    \n {i.Description}\n \n }\n >\n {i.Name}:\n \n
    \n \n \n \n \n
    \n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\nimport Typography from \"@mui/material/Typography\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Adjuster } from \"./Adjuster\";\nimport { IEngine } from \"../../IEngine\";\n\n// Update as additional BitNodes get implemented\n\ninterface IProps {\n player: IPlayer;\n engine: IEngine;\n}\n\nexport function Entropy(props: IProps): React.ReactElement {\n return (\n \n }>\n Entropy\n \n \n {\n props.player.entropy += num;\n props.player.applyEntropy(props.player.entropy);\n }}\n subtract={(num) => {\n props.player.entropy -= num;\n props.player.applyEntropy(props.player.entropy);\n }}\n tons={() => {\n props.player.entropy += 1e12;\n props.player.applyEntropy(props.player.entropy);\n }}\n reset={() => {\n props.player.entropy = 0;\n props.player.applyEntropy(props.player.entropy);\n }}\n />\n \n \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { Stats } from \"./Stats\";\nimport { Console } from \"./Console\";\nimport { AllPages } from \"./AllPages\";\n\nimport { use } from \"../../ui/Context\";\nimport Box from \"@mui/material/Box\";\n\nexport function BladeburnerRoot(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const bladeburner = player.bladeburner;\n if (bladeburner === null) return <>;\n return (\n \n \n \n \n \n\n \n \n );\n}\n","import React, { useState, useEffect } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport { TravelModal } from \"./TravelModal\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Button from \"@mui/material/Button\";\nimport Paper from \"@mui/material/Paper\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n router: IRouter;\n player: IPlayer;\n}\n\nexport function Stats(props: IProps): React.ReactElement {\n const [travelOpen, setTravelOpen] = useState(false);\n const setRerender = useState(false)[1];\n\n const inFaction = props.bladeburner.rank >= BladeburnerConstants.RankNeededForFaction;\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function openFaction(): void {\n if (!inFaction) return;\n const faction = Factions[FactionNames.Bladeburners];\n if (!faction.isMember) {\n joinFaction(faction);\n }\n\n props.router.toFaction(faction);\n }\n\n return (\n \n \n \n \n Rank 25 required. : \"\"}>\n \n \n \n \n setTravelOpen(false)} bladeburner={props.bladeburner} />\n \n \n Your rank within the Bladeburner division.}>\n Rank: {formatNumber(props.bladeburner.rank, 2)}\n \n \n
    \n \n \n Performing actions will use up your stamina.\n
    \n
    \n Your max stamina is determined primarily by your agility stat.\n
    \n
    \n Your stamina gain rate is determined by both your agility and your max stamina. Higher max stamina leads\n to a higher gain rate.\n
    \n
    \n Once your stamina falls below 50% of its max value, it begins to negatively affect the success rate of\n your contracts/operations. This penalty is shown in the overview panel. If the penalty is 15%, then this\n means your success rate would be multipled by 85% (100 - 15).\n
    \n
    \n Your max stamina and stamina gain rate can also be increased by training, or through skills and\n Augmentation upgrades.\n \n }\n >\n \n Stamina: {formatNumber(props.bladeburner.stamina, 3)} / {formatNumber(props.bladeburner.maxStamina, 3)}\n \n \n
    \n
    \n \n Stamina Penalty: {formatNumber((1 - props.bladeburner.calculateStaminaPenalty()) * 100, 1)}%\n \n
    \n Team Size: {formatNumber(props.bladeburner.teamSize, 0)}\n Team Members Lost: {formatNumber(props.bladeburner.teamLost, 0)}\n
    \n Num Times Hospitalized: {props.bladeburner.numHosp}\n \n Money Lost From Hospitalizations: \n \n
    \n Current City: {props.bladeburner.city}\n \n \n This is your Bladeburner division's estimate of how many Synthoids exist in your current city. An\n accurate population count increases success rate estimates.\n \n }\n >\n \n Est. Synthoid Population: {numeralWrapper.formatPopulation(props.bladeburner.getCurrentCity().popEst)}\n \n \n \n
    \n \n \n This is your Bladeburner divison's estimate of how many Synthoid communities exist in your current city.\n \n }\n >\n Synthoid Communities: {formatNumber(props.bladeburner.getCurrentCity().comms, 0)}\n \n \n
    \n \n \n The city's chaos level due to tensions and conflicts between humans and Synthoids. Having too high of a\n chaos level can make contracts and operations harder.\n \n }\n >\n City Chaos: {formatNumber(props.bladeburner.getCurrentCity().chaos)}\n \n \n
    \n {(props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000 > 15000 && (\n <>\n \n \n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by\n browser). Bonus time makes the Bladeburner mechanic progress faster, up to 5x the normal speed.\n \n }\n >\n \n Bonus time:{\" \"}\n {convertTimeMsToTimeElapsedString(\n (props.bladeburner.storedCycles / BladeburnerConstants.CyclesPerSecond) * 1000,\n )}\n \n \n \n
    \n \n )}\n Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}\n
    \n \n Aug. Success Chance mult: {formatNumber(props.player.mults.bladeburner_success_chance * 100, 1)}%\n
    \n Aug. Max Stamina mult: {formatNumber(props.player.mults.bladeburner_max_stamina * 100, 1)}%\n
    \n Aug. Stamina Gain mult: {formatNumber(props.player.mults.bladeburner_stamina_gain * 100, 1)}%\n
    \n Aug. Field Analysis mult: {formatNumber(props.player.mults.bladeburner_analysis * 100, 1)}%\n
    \n
    \n
    \n );\n}\n","import React from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { WorldMap } from \"../../ui/React/WorldMap\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { Settings } from \"../../Settings/Settings\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n function travel(city: string): void {\n props.bladeburner.city = city;\n props.onClose();\n }\n\n return (\n \n <>\n \n Travel to a different city for your Bladeburner activities. This does not cost any money. The city you are in\n for your Bladeburner duties does not affect your location in the game otherwise.\n \n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n \n ))\n ) : (\n travel(city)} />\n )}\n \n \n );\n}\n","import React, { useState, useRef, useEffect } from \"react\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Paper from \"@mui/material/Paper\";\nimport List from \"@mui/material/List\";\nimport ListItem from \"@mui/material/ListItem\";\nimport Box from \"@mui/material/Box\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport { Theme } from \"@mui/material/styles\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface ILineProps {\n content: React.ReactNode;\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textfield: {\n margin: theme.spacing(0),\n width: \"100%\",\n },\n input: {\n backgroundColor: theme.colors.backgroundsecondary,\n },\n nopadding: {\n padding: theme.spacing(0),\n },\n preformatted: {\n whiteSpace: \"pre-wrap\",\n margin: theme.spacing(0),\n },\n list: {\n padding: theme.spacing(0),\n height: \"100%\",\n },\n }),\n);\n\nfunction Line(props: ILineProps): React.ReactElement {\n return (\n \n {props.content}\n \n );\n}\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function Console(props: IProps): React.ReactElement {\n const classes = useStyles();\n const [command, setCommand] = useState(\"\");\n const setRerender = useState(false)[1];\n const consoleInput = useRef(null);\n\n function handleCommandChange(event: React.ChangeEvent): void {\n setCommand(event.target.value);\n }\n\n const [consoleHistoryIndex, setConsoleHistoryIndex] = useState(props.bladeburner.consoleHistory.length);\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 1000);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n function handleKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) {\n event.preventDefault();\n if (command.length > 0) {\n props.bladeburner.postToConsole(\"> \" + command);\n props.bladeburner.executeConsoleCommands(props.player, command);\n setConsoleHistoryIndex(props.bladeburner.consoleHistory.length);\n setCommand(\"\");\n }\n }\n\n const consoleHistory = props.bladeburner.consoleHistory;\n\n if (event.key === KEY.UP_ARROW) {\n // up\n let i = consoleHistoryIndex;\n const len = consoleHistory.length;\n if (len === 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n if (i !== 0) {\n i = i - 1;\n }\n setConsoleHistoryIndex(i);\n const prevCommand = consoleHistory[i];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n\n if (event.key === KEY.DOWN_ARROW) {\n const i = consoleHistoryIndex;\n const len = consoleHistory.length;\n\n if (len == 0) {\n return;\n }\n if (i < 0 || i > len) {\n setConsoleHistoryIndex(len);\n }\n\n // Latest command, put nothing\n if (i == len || i == len - 1) {\n setConsoleHistoryIndex(len);\n event.currentTarget.value = \"\";\n } else {\n setConsoleHistoryIndex(consoleHistoryIndex + 1);\n const prevCommand = consoleHistory[consoleHistoryIndex + 1];\n event.currentTarget.value = prevCommand;\n setCommand(prevCommand);\n }\n }\n }\n\n function handleClick(): void {\n if (!consoleInput.current) return;\n consoleInput.current.focus();\n }\n\n return (\n \n \n \n \n \n \n \n \n \n ),\n spellCheck: false,\n }}\n />\n \n );\n}\n\ninterface ILogProps {\n entries: string[];\n}\n\nfunction Logs({ entries }: ILogProps): React.ReactElement {\n const scrollHook = useRef(null);\n\n // TODO: Text gets shifted up as new entries appear, if the user scrolled up it should attempt to keep the text focused\n function scrollToBottom(): void {\n if (!scrollHook.current) return;\n scrollHook.current.scrollTop = scrollHook.current.scrollHeight;\n }\n\n useEffect(() => {\n scrollToBottom();\n }, [entries.length]);\n\n return (\n \n {entries && entries.map((log: string, i: number) => )}\n \n );\n}\n","import React from \"react\";\nimport { GeneralActionPage } from \"./GeneralActionPage\";\nimport { ContractPage } from \"./ContractPage\";\nimport { OperationPage } from \"./OperationPage\";\nimport { BlackOpPage } from \"./BlackOpPage\";\nimport { SkillPage } from \"./SkillPage\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function AllPages(props: IProps): React.ReactElement {\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n {value === 0 && }\n {value === 1 && }\n {value === 2 && }\n {value === 3 && }\n {value === 4 && }\n \n \n );\n}\n","import * as React from \"react\";\nimport { GeneralActionList } from \"./GeneralActionList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function GeneralActionPage(props: IProps): React.ReactElement {\n return (\n <>\n These are generic actions that will assist you in your Bladeburner duties.\n \n \n );\n}\n","import React from \"react\";\nimport { GeneralActionElem } from \"./GeneralActionElem\";\nimport { Action } from \"../Action\";\nimport { GeneralActions } from \"../GeneralActions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function GeneralActionList(props: IProps): React.ReactElement {\n const actions: Action[] = [];\n for (const name of Object.keys(GeneralActions)) {\n if (GeneralActions.hasOwnProperty(name)) {\n actions.push(GeneralActions[name]);\n }\n }\n return (\n <>\n {actions.map((action: Action) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IAction } from \"../IAction\";\nimport { GeneralActions } from \"../data/GeneralActions\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: IAction;\n}\n\nexport function GeneralActionElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive = props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = (function (): number {\n switch (props.action.name) {\n case \"Training\":\n case \"Field Analysis\":\n return 30;\n case \"Diplomacy\":\n case \"Hyperbolic Regeneration Chamber\":\n case \"Incite Violence\":\n return 60;\n case \"Recruitment\":\n return props.bladeburner.getRecruitmentTime(props.player);\n }\n return -1; // dead code\n })();\n const successChance =\n props.action.name === \"Recruitment\"\n ? Math.max(0, Math.min(props.bladeburner.getRecruitmentSuccessChance(props.player), 1))\n : -1;\n\n const actionData = GeneralActions[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n \n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n ) : (\n \n \n \n \n )}\n
    \n
    \n {actionData.desc}\n
    \n
    \n \n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n {successChance !== -1 && (\n <>\n
    \n Estimated success chance: {formatNumber(successChance * 100, 1)}%\n \n )}\n
    \n
    \n );\n}\n","import * as React from \"react\";\nimport { ContractList } from \"./ContractList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractPage(props: IProps): React.ReactElement {\n return (\n <>\n \n Complete contracts in order to increase your Bladeburner rank and earn money. Failing a contract will cause you\n to lose HP, which can lead to hospitalization.\n
    \n
    \n You can unlock higher-level contracts by successfully completing them. Higher-level contracts are more\n difficult, but grant more rank, experience, and money.\n
    \n \n \n );\n}\n","import React from \"react\";\nimport { ContractElem } from \"./ContractElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function ContractList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.contracts);\n const contracts = props.bladeburner.contracts;\n return (\n <>\n {names.map((name: string) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Contracts } from \"../data/Contracts\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IAction } from \"../IAction\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: IAction;\n}\n\nexport function ContractElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Contract\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner, props.player);\n\n const actionData = Contracts[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n ) : (\n <>\n \n \n \n )}\n
    \n
    \n \n
    \n
    \n \n {actionData.desc}\n
    \n
    \n \n
    \n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n
    \n Contracts remaining: {Math.floor(props.action.count)}\n
    \n Successes: {props.action.successes}\n
    \n Failures: {props.action.failures}\n
    \n
    \n \n
    \n );\n}\n","import React from \"react\";\n\ninterface IContract {\n desc: JSX.Element;\n}\n\nexport const Contracts: {\n [key: string]: IContract | undefined;\n} = {\n Tracking: {\n desc: (\n <>\n Identify and locate Synthoids. This contract involves reconnaissance and information-gathering ONLY. Do NOT\n engage. Stealth is of the utmost importance.\n
    \n
    \n Successfully completing Tracking contracts will slightly improve your Synthoid population estimate for whatever\n city you are currently in.\n \n ),\n },\n \"Bounty Hunter\": {\n desc: (\n <>\n Hunt down and capture fugitive Synthoids. These Synthoids are wanted alive.\n
    \n
    \n Successfully completing a Bounty Hunter contract will lower the population in your current city, and will also\n increase its chaos level.\n \n ),\n },\n Retirement: {\n desc: (\n <>\n Hunt down and retire (kill) rogue Synthoids.\n
    \n
    \n Successfully completing a Retirement contract will lower the population in your current city, and will also\n increase its chaos level.\n \n ),\n },\n};\n","import React from \"react\";\nimport { stealthIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function StealthIcon(): React.ReactElement {\n return This action involves stealth}>{stealthIcon};\n}\n","import React from \"react\";\nimport { killIcon } from \"../data/Icons\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nexport function KillIcon(): React.ReactElement {\n return This action involves retirement}>{killIcon};\n}\n","import * as React from \"react\";\nimport { OperationList } from \"./OperationList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationPage(props: IProps): React.ReactElement {\n return (\n <>\n \n Carry out operations for the Bladeburner division. Failing an operation will reduce your Bladeburner rank. It\n will also cause you to lose HP, which can lead to hospitalization. In general, operations are harder and more\n punishing than contracts, but are also more rewarding.\n
    \n
    \n Operations can affect the chaos level and Synthoid population of your current city. The exact effects vary\n between different Operations.\n
    \n
    \n For operations, you can use a team. You must first recruit team members. Having a larger team will improve your\n chances of success.\n
    \n
    \n You can unlock higher-level operations by successfully completing them. Higher-level operations are more\n difficult, but grant more rank and experience.\n
    \n \n \n );\n}\n","import React from \"react\";\nimport { OperationElem } from \"./OperationElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function OperationList(props: IProps): React.ReactElement {\n const names = Object.keys(props.bladeburner.operations);\n const operations = props.bladeburner.operations;\n return (\n <>\n {names.map((name: string) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { ActionLevel } from \"./ActionLevel\";\nimport { Autolevel } from \"./Autolevel\";\nimport { StartButton } from \"./StartButton\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { Operation } from \"../Operation\";\nimport { Operations } from \"../data/Operations\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: Operation;\n}\n\nexport function OperationElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"Operation\"] && props.action.name === props.bladeburner.action.name;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n const actionTime = props.action.getActionTime(props.bladeburner, props.player);\n\n const actionData = Operations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n ) : (\n <>\n \n \n \n \n )}\n
    \n
    \n\n \n
    \n
    \n \n {actionData.desc}\n
    \n
    \n \n
    \n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n
    \n Operations remaining: {Math.floor(props.action.count)}\n
    \n Successes: {props.action.successes}\n
    \n Failures: {props.action.failures}\n
    \n
    \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { Action } from \"../Action\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n action: Action;\n open: boolean;\n onClose: () => void;\n}\n\nexport function TeamSizeModal(props: IProps): React.ReactElement {\n const [teamSize, setTeamSize] = useState();\n\n function confirmTeamSize(): void {\n if (teamSize === undefined) return;\n const num = Math.round(teamSize);\n if (isNaN(num) || num < 0) {\n dialogBoxCreate(\"Invalid value entered for number of Team Members (must be numeric, positive)\");\n } else {\n props.action.teamCount = num;\n }\n props.onClose();\n }\n\n function onTeamSize(event: React.ChangeEvent): void {\n const x = parseFloat(event.target.value);\n if (x > props.bladeburner.teamSize) setTeamSize(props.bladeburner.teamSize);\n else setTeamSize(x);\n }\n\n return (\n \n \n Enter the amount of team members you would like to take on this Op. If you do not have the specified number of\n team members, then as many as possible will be used. Note that team members may be lost during operations.\n \n \n \n \n );\n}\n","import React from \"react\";\n\ninterface IOperation {\n desc: JSX.Element;\n}\n\nexport const Operations: {\n [key: string]: IOperation | undefined;\n} = {\n Investigation: {\n desc: (\n <>\n As a field agent, investigate and identify Synthoid populations, movements, and operations.\n
    \n
    \n Successful Investigation ops will increase the accuracy of your synthoid data.\n
    \n
    \n You will NOT lose HP from failed Investigation ops.\n \n ),\n },\n \"Undercover Operation\": {\n desc: (\n <>\n Conduct undercover operations to identify hidden and underground Synthoid communities and organizations.\n
    \n
    \n Successful Undercover ops will increase the accuracy of your synthoid data.\n \n ),\n },\n \"Sting Operation\": {\n desc: <>Conduct a sting operation to bait and capture particularly notorious Synthoid criminals.,\n },\n Raid: {\n desc: (\n <>\n Lead an assault on a known Synthoid community. Note that there must be an existing Synthoid community in your\n current city in order for this Operation to be successful.\n \n ),\n },\n \"Stealth Retirement Operation\": {\n desc: (\n <>\n Lead a covert operation to retire Synthoids. The objective is to complete the task without drawing any\n attention. Stealth and discretion are key.\n \n ),\n },\n Assassination: {\n desc: (\n <>\n Assassinate Synthoids that have been identified as important, high-profile social and political leaders in the\n Synthoid communities.\n \n ),\n },\n};\n","import * as React from \"react\";\nimport { BlackOpList } from \"./BlackOpList\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport Typography from \"@mui/material/Typography\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { use } from \"../../ui/Context\";\nimport { BlackOperationNames } from \"../data/BlackOperationNames\";\nimport { Button } from \"@mui/material\";\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpPage(props: IProps): React.ReactElement {\n const router = use.Router();\n return (\n <>\n \n Black Operations (Black Ops) are special, one-time covert operations. Each Black Op must be unlocked\n successively by completing the one before it.\n
    \n
    \n \n Your ultimate goal to climb through the ranks of {FactionNames.Bladeburners} is to complete all of the Black\n Ops.\n \n
    \n
    \n Like normal operations, you may use a team for Black Ops. Failing a black op will incur heavy HP and rank\n losses.\n
    \n {props.bladeburner.blackops[BlackOperationNames.OperationDaedalus] ? (\n \n ) : (\n \n )}\n \n );\n}\n","import React from \"react\";\nimport { BlackOperations } from \"../BlackOperations\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOpElem } from \"./BlackOpElem\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n}\n\nexport function BlackOpList(props: IProps): React.ReactElement {\n let blackops: BlackOperation[] = [];\n for (const blackopName of Object.keys(BlackOperations)) {\n if (BlackOperations.hasOwnProperty(blackopName)) {\n blackops.push(BlackOperations[blackopName]);\n }\n }\n blackops.sort(function (a, b) {\n return a.reqdRank - b.reqdRank;\n });\n\n blackops = blackops.filter(\n (blackop: BlackOperation, i: number) =>\n !(\n props.bladeburner.blackops[blackops[i].name] == null &&\n i !== 0 &&\n props.bladeburner.blackops[blackops[i - 1].name] == null\n ),\n );\n\n blackops = blackops.reverse();\n\n return (\n <>\n {blackops.map((blackop: BlackOperation) => (\n \n ))}\n \n );\n}\n","import React, { useState } from \"react\";\nimport { formatNumber, convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { ActionTypes } from \"../data/ActionTypes\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { TeamSizeButton } from \"./TeamSizeButton\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport { BlackOperation } from \"../BlackOperation\";\nimport { BlackOperations } from \"../data/BlackOperations\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { SuccessChance } from \"./SuccessChance\";\nimport { StartButton } from \"./StartButton\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n player: IPlayer;\n action: BlackOperation;\n}\n\nexport function BlackOpElem(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const isCompleted = props.bladeburner.blackops[props.action.name] != null;\n if (isCompleted) {\n return (\n \n {props.action.name} (COMPLETED)\n \n );\n }\n\n const isActive =\n props.bladeburner.action.type === ActionTypes[\"BlackOperation\"] &&\n props.action.name === props.bladeburner.action.name;\n const actionTime = props.action.getActionTime(props.bladeburner, props.player);\n const hasReqdRank = props.bladeburner.rank >= props.action.reqdRank;\n const computedActionTimeCurrent = Math.min(\n props.bladeburner.actionTimeCurrent + props.bladeburner.actionTimeOverflow,\n props.bladeburner.actionTimeToComplete,\n );\n\n const actionData = BlackOperations[props.action.name];\n if (actionData === undefined) {\n throw new Error(`Cannot find data for ${props.action.name}`);\n }\n\n return (\n \n {isActive ? (\n <>\n <>\n \n \n (IN PROGRESS - {formatNumber(computedActionTimeCurrent, 0)} /{\" \"}\n {formatNumber(props.bladeburner.actionTimeToComplete, 0)})\n \n \n {createProgressBarText({\n progress: computedActionTimeCurrent / props.bladeburner.actionTimeToComplete,\n })}\n \n \n \n ) : (\n <>\n \n\n \n \n \n )}\n\n
    \n
    \n {actionData.desc}\n
    \n
    \n \n Required Rank: {formatNumber(props.action.reqdRank, 0)}\n \n
    \n \n \n
    \n Time Required: {convertTimeMsToTimeElapsedString(actionTime * 1000)}\n
    \n
    \n );\n}\n","import React from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { CityName } from \"../../Locations/data/CityNames\";\nimport { BlackOperationNames } from \"./BlackOperationNames\";\n\ninterface IBlackOp {\n desc: JSX.Element;\n}\n\nexport const BlackOperations: {\n [key: string]: IBlackOp | undefined;\n} = {\n [BlackOperationNames.OperationTyphoon]: {\n desc: (\n <>\n Obadiah Zenyatta is the leader of a RedWater PMC. It has long been known among the intelligence community that\n Zenyatta, along with the rest of the PMC, is a Synthoid.\n
    \n
    \n The goal of {BlackOperationNames.OperationTyphoon} is to find and eliminate Zenyatta and RedWater by any means\n necessary. After the task is completed, the actions must be covered up from the general public.\n \n ),\n },\n\n [BlackOperationNames.OperationZero]: {\n desc: (\n <>\n AeroCorp is one of the world's largest defense contractors. Its leader, Steve Watataki, is thought to be a\n supporter of Synthoid rights. He must be removed.\n
    \n
    \n The goal of {BlackOperationNames.OperationZero} is to covertly infiltrate AeroCorp and uncover any incriminating\n evidence or information against Watataki that will cause him to be removed from his position at AeroCorp.\n Incriminating evidence can be fabricated as a last resort. Be warned that AeroCorp has some of the most advanced\n security measures in the world.\n \n ),\n },\n [BlackOperationNames.OperationX]: {\n desc: (\n <>\n We have recently discovered an underground publication group called Samizdat. Even though most of their\n publications are nonsensical conspiracy theories, the average human is gullible enough to believe them. Many of\n their works discuss Synthoids and pose a threat to society. The publications are spreading rapidly in China and\n other Eastern countries.\n
    \n
    \n Samizdat has done a good job of keeping hidden and anonymous. However, we've just received intelligence that\n their base of operations is in {CityName.Ishima}'s underground sewer systems. Your task is to investigate the\n sewer systems, and eliminate Samizdat. They must never publish anything again.\n \n ),\n },\n [BlackOperationNames.OperationTitan]: {\n desc: (\n <>\n Several months ago Titan Laboratories' Bioengineering department was infiltrated by Synthoids. As far as we\n know, Titan Laboratories' management has no knowledge about this. We don't know what the Synthoids are up to,\n but the research that they could be conducting using Titan Laboraties' vast resources is potentially very\n dangerous.\n
    \n
    \n Your goal is to enter and destroy the Bioengineering department's facility in {CityName.Aevum}. The task is not\n just to retire the Synthoids there, but also to destroy any information or research at the facility that is\n relevant to the Synthoids and their goals.\n \n ),\n },\n [BlackOperationNames.OperationAres]: {\n desc: (\n <>\n One of our undercover agents, Agent Carter, has informed us of a massive weapons deal going down in Dubai\n between rogue Russian militants and a radical Synthoid community. These weapons are next-gen plasma and energy\n weapons. It is critical for the safety of humanity that this deal does not happen.\n
    \n
    \n Your task is to intercept the deal. Leave no survivors.\n \n ),\n },\n [BlackOperationNames.OperationArchangel]: {\n desc: (\n <>\n Our analysts have discovered that the popular Red Rabbit brothel in Amsterdam is run and 'staffed' by MK-VI\n Synthoids. Intelligence suggests that the profit from this brothel is used to fund a large black market arms\n trafficking operation.\n
    \n
    \n The goal of this operation is to take out the leaders that are running the Red Rabbit brothel. Try to limit the\n number of other casualties, but do what you must to complete the mission.\n \n ),\n },\n [BlackOperationNames.OperationJuggernaut]: {\n desc: (\n <>\n The CIA has just encountered a new security threat. A new criminal group, lead by a shadowy operative who calls\n himself Juggernaut, has been smuggling drugs and weapons (including suspected bioweapons) into{\" \"}\n {CityName.Sector12}. We also have reason to believe they tried to break into one of Universal Energy's\n facilities in order to cause a city-wide blackout. The CIA suspects that Juggernaut is a heavily-augmented\n Synthoid, and have thus enlisted our help.\n
    \n
    \n Your mission is to eradicate Juggernaut and his followers.\n \n ),\n },\n [BlackOperationNames.OperationRedDragon]: {\n desc: (\n <>\n The {FactionNames.Tetrads} criminal organization is suspected of reverse-engineering the MK-VI Synthoid design.\n We believe they altered and possibly improved the design and began manufacturing their own Synthoid models in\n order to bolster their criminal activities.\n
    \n
    \n Your task is to infiltrate and destroy the {FactionNames.Tetrads}' base of operations in Los Angeles.\n Intelligence tells us that their base houses one of their Synthoid manufacturing units.\n \n ),\n },\n [BlackOperationNames.OperationK]: {\n desc: (\n <>\n CODE RED SITUATION. Our intelligence tells us that VitaLife has discovered a new android cloning technology.\n This technology is supposedly capable of cloning Synthoids, not only physically but also their advanced AI\n modules. We do not believe that VitaLife is trying to use this technology illegally or maliciously, but if any\n Synthoids were able to infiltrate the corporation and take advantage of this technology then the results would\n be catastrophic.\n
    \n
    \n We do not have the power or jurisdiction to shut this down through legal or political means, so we must resort\n to a covert operation. Your goal is to destroy this technology and eliminate anyone who was involved in its\n creation.\n \n ),\n },\n [BlackOperationNames.OperationDeckard]: {\n desc: (\n <>\n Despite your success in eliminating VitaLife's new android-replicating technology in{\" \"}\n {BlackOperationNames.OperationK}, we've discovered that a small group of MK-VI Synthoids were able to make off\n with the schematics and design of the technology before the Operation. It is almost a certainty that these\n Synthoids are some of the rogue MK-VI ones from the Synthoid Uprising.\n
    \n
    \n The goal of {BlackOperationNames.OperationDeckard} is to hunt down these Synthoids and retire them. I don't need\n to tell you how critical this mission is.\n \n ),\n },\n [BlackOperationNames.OperationTyrell]: {\n desc: (\n <>\n A week ago {FactionNames.BladeIndustries} reported a small break-in at one of their {CityName.Aevum}{\" \"}\n Augmentation storage facilities. We figured out that {FactionNames.TheDarkArmy} was behind the heist, and didn't\n think any more of it. However, we've just discovered that several known MK-VI Synthoids were part of that\n break-in group.\n
    \n
    \n We cannot have Synthoids upgrading their already-enhanced abilities with Augmentations. Your task is to hunt\n down associated {FactionNames.TheDarkArmy} members and eliminate them.\n \n ),\n },\n [BlackOperationNames.OperationWallace]: {\n desc: (\n <>\n Based on information gathered from {BlackOperationNames.OperationTyrell}, we've discovered that{\" \"}\n {FactionNames.TheDarkArmy} was well aware that there were Synthoids amongst their ranks. Even worse, we believe\n that {FactionNames.TheDarkArmy} is working together with other criminal organizations such as{\" \"}\n {FactionNames.TheSyndicate} and that they are planning some sort of large-scale takeover of multiple major\n cities, most notably {CityName.Aevum}. We suspect that Synthoids have infiltrated the ranks of these criminal\n factions and are trying to stage another Synthoid uprising.\n
    \n
    \n The best way to deal with this is to prevent it before it even happens. The goal of{\" \"}\n {BlackOperationNames.OperationWallace} is to destroy {FactionNames.TheDarkArmy} and Syndicate factions in{\" \"}\n {CityName.Aevum} immediately. Leave no survivors.\n \n ),\n },\n [BlackOperationNames.OperationShoulderOfOrion]: {\n desc: (\n <>\n China's Solaris Space Systems is secretly launching the first manned spacecraft in over a decade using\n Synthoids. We believe China is trying to establish the first off-world colonies.\n
    \n
    \n The mission is to prevent this launch without instigating an international conflict. When you accept this\n mission you will be officially disavowed by the NSA and the national government until after you successfully\n return. In the event of failure, all of the operation's team members must not let themselves be captured alive.\n \n ),\n },\n [BlackOperationNames.OperationHyron]: {\n desc: (\n <>\n Our intelligence tells us that {FactionNames.FulcrumSecretTechnologies} is developing a quantum supercomputer\n using human brains as core processors. This supercomputer is rumored to be able to store vast amounts of data\n and perform computations unmatched by any other supercomputer on the planet. But more importantly, the use of\n organic human brains means that the supercomputer may be able to reason abstractly and become self-aware.\n
    \n
    \n I do not need to remind you why sentient-level AIs pose a serious threat to all of mankind.\n
    \n
    \n The research for this project is being conducted at one of {FactionNames.FulcrumSecretTechnologies} secret\n facilities in {CityName.Aevum}, codenamed 'Alpha Ranch'. Infiltrate the compound, delete and destroy the work,\n and then find and kill the project lead.\n \n ),\n },\n [BlackOperationNames.OperationMorpheus]: {\n desc: (\n <>\n DreamSense Technologies is an advertising company that uses special technology to transmit their ads into the\n people's dreams and subconcious. They do this using broadcast transmitter towers. Based on information from our\n agents and informants in {CityName.Chongqing}, we have reason to believe that one of the broadcast towers there\n has been compromised by Synthoids and is being used to spread pro-Synthoid propaganda.\n
    \n
    \n The mission is to destroy this broadcast tower. Speed and stealth are of the utmost importance for this.\n \n ),\n },\n [BlackOperationNames.OperationIonStorm]: {\n desc: (\n <>\n Our analysts have uncovered a gathering of MK-VI Synthoids that have taken up residence in the{\" \"}\n {CityName.Sector12} Slums. We don't know if they are rogue Synthoids from the Uprising, but we do know that they\n have been stockpiling weapons, money, and other resources. This makes them dangerous.\n
    \n
    \n This is a full-scale assault operation to find and retire all of these Synthoids in the {CityName.Sector12}{\" \"}\n Slums.\n \n ),\n },\n [BlackOperationNames.OperationAnnihilus]: {\n desc: (\n <>\n Our superiors have ordered us to eradicate everything and everyone in an underground facility located in{\" \"}\n {CityName.Aevum}. They tell us that the facility houses many dangerous Synthoids and belongs to a terrorist\n organization called '{FactionNames.TheCovenant}'. We have no prior intelligence about this organization, so you\n are going in blind.\n \n ),\n },\n [BlackOperationNames.OperationUltron]: {\n desc: (\n <>\n {FactionNames.OmniTekIncorporated}, the original designer and manufacturer of Synthoids, has notified us of a\n malfunction in their AI design. This malfunction, when triggered, causes MK-VI Synthoids to become radicalized\n and seek out the destruction of humanity. They say that this bug affects all MK-VI Synthoids, not just the rogue\n ones from the Uprising.\n
    \n
    \n {FactionNames.OmniTekIncorporated} has also told us they believe someone has triggered this malfunction in a\n large group of MK-VI Synthoids, and that these newly-radicalized Synthoids are now amassing in{\" \"}\n {CityName.Volhaven} to form a terrorist group called Ultron.\n
    \n
    \n Intelligence suggests Ultron is heavily armed and that their members are augmented. We believe Ultron is making\n moves to take control of and weaponize DeltaOne's Tactical High-Energy Satellite Laser Array (THESLA).\n
    \n
    \n Your task is to find and destroy Ultron.\n \n ),\n },\n [BlackOperationNames.OperationCenturion]: {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n
    \n
    \n Throughout all of humanity's history, we have relied on technology to survive, conquer, and progress. Its\n advancement became our primary goal. And at the peak of human civilization technology turned into power. Global,\n absolute power.\n
    \n
    \n It seems that the universe is not without a sense of irony.\n
    \n
    \n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n \n ),\n },\n [BlackOperationNames.OperationVindictus]: {\n desc: (\n <>\n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n
    \n
    \n The bits are all around us. The daemons that hold the Node together can manifest themselves in many different\n ways.\n
    \n
    \n {\"D)@#)($M)C0293c40($*)@#D0JUMP3Rm0C<*@#)*$)#02c94830c(#$*D)\"}\n \n ),\n },\n [BlackOperationNames.OperationDaedalus]: {\n desc: <> Yesterday we obeyed kings and bent our neck to emperors. Today we kneel only to truth.,\n },\n};\n","import React, { useState } from \"react\";\nimport { SkillList } from \"./SkillList\";\nimport { BladeburnerConstants } from \"../data/Constants\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\nimport Typography from \"@mui/material/Typography\";\ninterface IProps {\n bladeburner: IBladeburner;\n}\n\nexport function SkillPage(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const mults = props.bladeburner.skillMultipliers;\n\n function valid(mult: number | undefined): boolean {\n return mult !== undefined && mult !== 1;\n }\n\n return (\n <>\n \n Skill Points: {formatNumber(props.bladeburner.skillPoints, 0)}\n \n \n You will gain one skill point every {BladeburnerConstants.RanksPerSkillPoint} ranks.\n
    \n Note that when upgrading a skill, the benefit for that skill is additive. However, the effects of different\n skills with each other is multiplicative.\n
    \n {valid(mults[\"successChanceAll\"]) && (\n Total Success Chance: x{formatNumber(mults[\"successChanceAll\"], 3)}\n )}\n {valid(mults[\"successChanceStealth\"]) && (\n Stealth Success Chance: x{formatNumber(mults[\"successChanceStealth\"], 3)}\n )}\n {valid(mults[\"successChanceKill\"]) && (\n Retirement Success Chance: x{formatNumber(mults[\"successChanceKill\"], 3)}\n )}\n {valid(mults[\"successChanceContract\"]) && (\n Contract Success Chance: x{formatNumber(mults[\"successChanceContract\"], 3)}\n )}\n {valid(mults[\"successChanceOperation\"]) && (\n Operation Success Chance: x{formatNumber(mults[\"successChanceOperation\"], 3)}\n )}\n {valid(mults[\"successChanceEstimate\"]) && (\n Synthoid Data Estimate: x{formatNumber(mults[\"successChanceEstimate\"], 3)}\n )}\n {valid(mults[\"actionTime\"]) && Action Time: x{formatNumber(mults[\"actionTime\"], 3)}}\n {valid(mults[\"effHack\"]) && Hacking Skill: x{formatNumber(mults[\"effHack\"], 3)}}\n {valid(mults[\"effStr\"]) && Strength: x{formatNumber(mults[\"effStr\"], 3)}}\n {valid(mults[\"effDef\"]) && Defense: x{formatNumber(mults[\"effDef\"], 3)}}\n {valid(mults[\"effDex\"]) && Dexterity: x{formatNumber(mults[\"effDex\"], 3)}}\n {valid(mults[\"effAgi\"]) && Agility: x{formatNumber(mults[\"effAgi\"], 3)}}\n {valid(mults[\"effCha\"]) && Charisma: x{formatNumber(mults[\"effCha\"], 3)}}\n {valid(mults[\"effInt\"]) && Intelligence: x{formatNumber(mults[\"effInt\"], 3)}}\n {valid(mults[\"stamina\"]) && Stamina: x{formatNumber(mults[\"stamina\"], 3)}}\n {valid(mults[\"money\"]) && Contract Money: x{formatNumber(mults[\"money\"], 3)}}\n {valid(mults[\"expGain\"]) && Exp Gain: x{formatNumber(mults[\"expGain\"], 3)}}\n setRerender((old) => !old)} />\n \n );\n}\n\n/*\n\n\n\n\nvar multKeys = Object.keys(this.skillMultipliers);\nfor (var i = 0; i < multKeys.length; ++i) {\n var mult = this.skillMultipliers[multKeys[i]];\n if (mult && mult !== 1) {\n mult = formatNumber(mult, 3);\n switch(multKeys[i]) {\n\n }\n }\n}\n*/\n","import * as React from \"react\";\nimport { SkillElem } from \"./SkillElem\";\nimport { Skills } from \"../Skills\";\nimport { IBladeburner } from \"../IBladeburner\";\n\ninterface IProps {\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillList(props: IProps): React.ReactElement {\n return (\n <>\n {Object.keys(Skills).map((skill: string) => (\n \n ))}\n \n );\n}\n","import React from \"react\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { IBladeburner } from \"../IBladeburner\";\n\nimport Typography from \"@mui/material/Typography\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport AddIcon from \"@mui/icons-material/Add\";\nimport CloseIcon from \"@mui/icons-material/Close\";\nimport { Skill } from \"../Skill\";\n\ninterface IProps {\n skill: Skill;\n bladeburner: IBladeburner;\n onUpgrade: () => void;\n}\n\nexport function SkillElem(props: IProps): React.ReactElement {\n const skillName = props.skill.name;\n let currentLevel = 0;\n if (props.bladeburner.skills[skillName] && !isNaN(props.bladeburner.skills[skillName])) {\n currentLevel = props.bladeburner.skills[skillName];\n }\n const pointCost = props.skill.calculateCost(currentLevel);\n\n const canLevel = props.bladeburner.skillPoints >= pointCost;\n const maxLvl = props.skill.maxLvl ? currentLevel >= props.skill.maxLvl : false;\n\n function onClick(): void {\n if (props.bladeburner.skillPoints < pointCost) return;\n props.bladeburner.skillPoints -= pointCost;\n props.bladeburner.upgradeSkill(props.skill);\n props.onUpgrade();\n }\n\n return (\n \n \n \n {!canLevel || maxLvl ? (\n \n \n \n ) : (\n \n \n \n )}\n \n Level: {currentLevel}\n {maxLvl ? (\n MAX LEVEL\n ) : (\n Skill Points required: {formatNumber(pointCost, 0)}\n )}\n {props.skill.desc}\n \n );\n}\n","/**\n * React Component for all the gang stuff.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { ManagementSubpage } from \"./ManagementSubpage\";\nimport { TerritorySubpage } from \"./TerritorySubpage\";\nimport { EquipmentsSubpage } from \"./EquipmentsSubpage\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function GangRoot(): React.ReactElement {\n const player = use.Player();\n const gang = (function () {\n if (player.gang === null) throw new Error(\"Gang should not be null\");\n return player.gang;\n })();\n const [value, setValue] = React.useState(0);\n\n function handleChange(event: React.SyntheticEvent, tab: number): void {\n setValue(tab);\n }\n\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n \n \n \n \n \n \n {value === 0 && }\n {value === 1 && }\n {value === 2 && }\n \n );\n}\n","/**\n * React Component for the subpage that manages gang members, the main page.\n */\nimport React from \"react\";\nimport { GangStats } from \"./GangStats\";\nimport { GangMemberList } from \"./GangMemberList\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\n\nexport function ManagementSubpage(): React.ReactElement {\n const gang = useGang();\n return (\n <>\n \n This page is used to manage your gang members and get an overview of your gang's stats.\n
    \n
    \n If a gang member is not earning much money or respect, the task that you have assigned to that member might be\n too difficult. Consider training that member's stats or choosing an easier task. The tasks closer to the top of\n the dropdown list are generally easier. Alternatively, the gang member's low production might be due to the fact\n that your wanted level is too high. Consider assigning a few members to the '\n {gang.isHackingGang ? \"Ethical Hacking\" : \"Vigilante Justice\"}' task to lower your wanted level.\n
    \n
    \n Installing Augmentations does NOT reset your progress with your Gang. Furthermore, after installing\n Augmentations, you will automatically be a member of whatever Faction you created your gang with.\n
    \n
    \n You can also manage your gang programmatically through Netscript using the Gang API\n
    \n
    \n \n
    \n \n \n );\n}\n","/**\n * React Component for the stats related to the gang, like total respect and\n * money per second.\n */\nimport React from \"react\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { AllGangs } from \"../AllGangs\";\nimport { BonusTime } from \"./BonusTime\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nexport function GangStats(): React.ReactElement {\n const gang = useGang();\n const territoryMult = AllGangs[gang.facName].territory * 100;\n let territoryStr;\n if (territoryMult <= 0) {\n territoryStr = formatNumber(0, 2);\n } else if (territoryMult >= 100) {\n territoryStr = formatNumber(100, 2);\n } else {\n territoryStr = formatNumber(territoryMult, 2);\n }\n\n return (\n <>\n \n \n Represents the amount of respect your gang has from other gangs and criminal organizations. Your respect\n affects the amount of money your gang members will earn, and also determines how much reputation you are\n earning with your gang's corresponding Faction.\n \n }\n >\n \n Respect: {numeralWrapper.formatRespect(gang.respect)} (\n {numeralWrapper.formatRespect(5 * gang.respectGainRate)} / sec)\n \n \n \n\n \n \n Represents how much the gang is wanted by law enforcement. The higher your gang's wanted level, the harder\n it will be for your gang members to make money and earn respect. Note that the minimum wanted level is 1.\n \n }\n >\n \n Wanted Level: {numeralWrapper.formatWanted(gang.wanted)} (\n {numeralWrapper.formatWanted(5 * gang.wantedGainRate)} / sec)\n \n \n \n\n \n Penalty for respect and money gain rates due to Wanted Level}>\n Wanted Level Penalty: -{formatNumber((1 - gang.getWantedPenalty()) * 100, 2)}%\n \n \n\n \n Money gain rate: \n \n\n \n The percentage of total territory your Gang controls}>\n Territory: {territoryStr}%\n \n \n \n Faction reputation: \n \n\n \n \n );\n}\n","/**\n * React Component for displaying the bonus time remaining.\n */\nimport * as React from \"react\";\nimport { Gang } from \"../Gang\";\nimport { CONSTANTS } from \"../../Constants\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n gang: Gang;\n}\n\nexport function BonusTime(props: IProps): React.ReactElement {\n const CyclerPerSecond = 1000 / CONSTANTS._idleSpeed;\n if ((props.gang.storedCycles / CyclerPerSecond) * 1000 <= 5000) return <>;\n const bonusMillis = (props.gang.storedCycles / CyclerPerSecond) * 1000;\n return (\n \n \n You gain bonus time while offline or when the game is inactive (e.g. when the tab is throttled by the\n browser). Bonus time makes the Gang mechanic progress faster, up to 5x the normal speed.\n \n }\n >\n Bonus time: {convertTimeMsToTimeElapsedString(bonusMillis)}\n \n \n );\n}\n","/**\n * React Component for the list of gang members on the management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberCard } from \"./GangMemberCard\";\nimport { RecruitButton } from \"./RecruitButton\";\nimport { useGang } from \"./Context\";\n\nimport { Box, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { GangMember } from \"../GangMember\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport function GangMemberList(): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n const [filter, setFilter] = useState(\"\");\n const [ascendOnly, setAscendOnly] = useState(false);\n\n const handleFilterChange = (event: React.ChangeEvent): void => {\n setFilter(event.target.value.toLowerCase());\n };\n\n const members = gang.members\n .filter((member) => member && member.name.toLowerCase().includes(filter))\n .filter((member) => {\n if (ascendOnly) return member.canAscend();\n return true;\n });\n\n return (\n <>\n setRerender((old) => !old)} />\n ,\n spellCheck: false,\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: \"15%\" }}\n />\n setAscendOnly(newValue)}\n text=\"Show only ascendable\"\n tooltip={<>Filter the members list by whether or not the member can be ascended.}\n />\n \n {members.map((member: GangMember) => (\n \n ))}\n \n \n );\n}\n","/**\n * React Component for a gang member on the management subpage.\n */\nimport React from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { GangMemberCardContent } from \"./GangMemberCardContent\";\n\nimport Box from \"@mui/material/Box\";\n\nimport ListItemText from \"@mui/material/ListItemText\";\nimport Paper from \"@mui/material/Paper\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberCard(props: IProps): React.ReactElement {\n return (\n \n \n {props.member.name}} />\n \n \n \n );\n}\n","/**\n * React Component for the content of the accordion of gang members on the\n * management subpage.\n */\nimport React, { useState } from \"react\";\nimport { GangMemberStats } from \"./GangMemberStats\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { AscensionModal } from \"./AscensionModal\";\n\nimport { Box } from \"@mui/system\";\nimport { Button, Typography } from \"@mui/material\";\nimport HelpIcon from \"@mui/icons-material/Help\";\n\nimport { GangMember } from \"../GangMember\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberCardContent(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n const [helpOpen, setHelpOpen] = useState(false);\n const [ascendOpen, setAscendOpen] = useState(false);\n\n return (\n <>\n {props.member.canAscend() && (\n \n \n setAscendOpen(false)}\n member={props.member}\n onAscend={() => setRerender((old) => !old)}\n />\n \n setHelpOpen(false)}>\n \n Ascending a Gang Member resets the member's progress and stats in exchange for a permanent boost to their\n stat multipliers.\n
    \n
    \n The additional stat multiplier that the Gang Member gains upon ascension is based on the amount of exp\n they have.\n
    \n
    \n Upon ascension, the member will lose all of its non-Augmentation Equipment and your gang will lose respect\n equal to the total respect earned by the member.\n
    \n
    \n
    \n )}\n \n \n setRerender((old) => !old)} member={props.member} />\n \n \n );\n}\n","/**\n * React Component for the first part of a gang member details.\n * Contains skills and exp.\n */\nimport React from \"react\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { Table, TableBody, TableCell, TableRow } from \"@mui/material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMember } from \"../GangMember\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\nimport { characterOverviewStyles as useStyles } from \"../../ui/React/CharacterOverview\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function GangMemberStats(props: IProps): React.ReactElement {\n const classes = useStyles();\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n\n const gang = useGang();\n const data = [\n [`Money:`, ],\n [`Respect:`, `${numeralWrapper.formatRespect(5 * props.member.calculateRespectGain(gang))} / sec`],\n [`Wanted Level:`, `${numeralWrapper.formatWanted(5 * props.member.calculateWantedLevelGain(gang))} / sec`],\n [`Total Respect:`, `${numeralWrapper.formatRespect(props.member.earnedRespect)}`],\n ];\n\n return (\n <>\n \n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.hack)}{\" \"}\n Asc)\n
    \n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.str)}{\" \"}\n Asc)\n
    \n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.def)}{\" \"}\n Asc)\n
    \n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.dex)}{\" \"}\n Asc)\n
    \n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.agi)}{\" \"}\n Asc)\n
    \n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x{numeralWrapper.formatMultiplier(asc.cha)}{\" \"}\n Asc)\n \n }\n >\n \n \n \n \n \n \n \n \n \n \n
    \n
    \n
    \n {data.map(([a, b]) => (\n \n \n {a}\n \n \n {b}\n \n \n ))}\n
    \n
    \n \n \n );\n}\n","import React from \"react\";\nimport { Modal } from \"./Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n killScripts: () => void;\n}\n\nexport function KillScriptsModal(props: IProps): React.ReactElement {\n function onClick(): void {\n props.killScripts();\n props.onClose();\n }\n\n return (\n \n Forcefully kill all running scripts? This will also save your game and reload the game.\n \n \n );\n}\n","/**\n * React Component for the middle part of the gang member accordion. Contains\n * the task selector as well as some stats.\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\nimport { TaskDescription } from \"./TaskDescription\";\n\nimport { Box } from \"@mui/material\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\nimport { GangMember } from \"../GangMember\";\n\ninterface IProps {\n member: GangMember;\n onTaskChange: () => void;\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const gang = useGang();\n const [currentTask, setCurrentTask] = useState(props.member.task);\n\n const contextMember = gang.members.find((member) => member.name == props.member.name);\n if (contextMember && contextMember.task != currentTask) {\n setCurrentTask(contextMember.task);\n }\n\n function onChange(event: SelectChangeEvent): void {\n const task = event.target.value;\n props.member.assignToTask(task);\n setCurrentTask(task);\n props.onTaskChange();\n }\n\n const tasks = gang.getAllTaskNames();\n\n return (\n \n \n \n \n );\n}\n","/**\n * React Component for left side of the gang member accordion, contains the\n * description of the task that member is currently doing.\n */\nimport React from \"react\";\nimport { GangMemberTasks } from \"../GangMemberTasks\";\nimport { GangMember } from \"../GangMember\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n member: GangMember;\n}\n\nexport function TaskDescription(props: IProps): React.ReactElement {\n const task = GangMemberTasks[props.member.task];\n const desc = task ? task.desc : GangMemberTasks[\"Unassigned\"].desc;\n\n return ;\n}\n","/**\n * React Component for the content of the popup before the player confirms the\n * ascension of a gang member.\n */\nimport React, { useState, useEffect } from \"react\";\nimport { GangMember } from \"../GangMember\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n member: GangMember;\n onAscend: () => void;\n}\n\nexport function AscensionModal(props: IProps): React.ReactElement {\n const gang = useGang();\n const setRerender = useState(false)[1];\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 1000);\n return () => clearInterval(id);\n }, []);\n\n function confirm(): void {\n props.onAscend();\n const res = gang.ascendMember(props.member);\n dialogBoxCreate(\n <>\n You ascended {props.member.name}!
    \n
    \n Your gang lost {numeralWrapper.formatRespect(res.respect)} respect.\n
    \n
    \n {props.member.name} gained the following stat multipliers for ascending:\n
    \n Hacking: x{numeralWrapper.format(res.hack, \"0.000\")}\n
    \n Strength: x{numeralWrapper.format(res.str, \"0.000\")}\n
    \n Defense: x{numeralWrapper.format(res.def, \"0.000\")}\n
    \n Dexterity: x{numeralWrapper.format(res.dex, \"0.000\")}\n
    \n Agility: x{numeralWrapper.format(res.agi, \"0.000\")}\n
    \n Charisma: x{numeralWrapper.format(res.cha, \"0.000\")}\n
    \n ,\n );\n props.onClose();\n }\n\n // const ascendBenefits = props.member.getAscensionResults();\n const preAscend = props.member.getCurrentAscensionMults();\n const postAscend = props.member.getAscensionMultsAfterAscend();\n\n return (\n \n \n Are you sure you want to ascend this member? They will lose all of\n
    \n their non-Augmentation upgrades and their stats will reset back to 1.\n
    \n
    \n Furthermore, your gang will lose {numeralWrapper.formatRespect(props.member.earnedRespect)} respect\n
    \n
    \n In return, they will gain the following permanent boost to stat multipliers:\n
    \n Hacking: x{numeralWrapper.format(preAscend.hack, \"0.000\")} => x\n {numeralWrapper.format(postAscend.hack, \"0.000\")}\n
    \n Strength: x{numeralWrapper.format(preAscend.str, \"0.000\")} => x\n {numeralWrapper.format(postAscend.str, \"0.000\")}\n
    \n Defense: x{numeralWrapper.format(preAscend.def, \"0.000\")} => x\n {numeralWrapper.format(postAscend.def, \"0.000\")}\n
    \n Dexterity: x{numeralWrapper.format(preAscend.dex, \"0.000\")} => x\n {numeralWrapper.format(postAscend.dex, \"0.000\")}\n
    \n Agility: x{numeralWrapper.format(preAscend.agi, \"0.000\")} => x\n {numeralWrapper.format(postAscend.agi, \"0.000\")}\n
    \n Charisma: x{numeralWrapper.format(preAscend.cha, \"0.000\")} => x\n {numeralWrapper.format(postAscend.cha, \"0.000\")}\n
    \n
    \n \n
    \n );\n}\n","/**\n * React Component for the recruitment button and text on the gang main page.\n */\nimport React, { useState } from \"react\";\nimport { RecruitModal } from \"./RecruitModal\";\nimport { GangConstants } from \"../data/Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n onRecruit: () => void;\n}\n\nexport function RecruitButton(props: IProps): React.ReactElement {\n const gang = useGang();\n const [open, setOpen] = useState(false);\n if (gang.members.length >= GangConstants.MaximumGangMembers) {\n return <>;\n }\n\n if (!gang.canRecruitMember()) {\n const respect = gang.getRespectNeededToRecruitMember();\n return (\n \n \n \n {numeralWrapper.formatRespect(respect)} respect needed to recruit next member\n \n \n );\n }\n\n return (\n <>\n \n \n \n setOpen(false)} onRecruit={props.onRecruit} />\n \n );\n}\n","/**\n * React Component for the popup used to recruit new gang members.\n */\nimport React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { useGang } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\ninterface IRecruitPopupProps {\n open: boolean;\n onClose: () => void;\n onRecruit: () => void;\n}\n\nexport function RecruitModal(props: IRecruitPopupProps): React.ReactElement {\n const gang = useGang();\n const [name, setName] = useState(\"\");\n\n const disabled = name === \"\" || !gang.canRecruitMember();\n function recruit(): void {\n if (disabled) return;\n // At this point, the only way this can fail is if you already\n // have a gang member with the same name\n if (!gang.recruitMember(name)) {\n dialogBoxCreate(\"You already have a gang member with this name!\");\n return;\n }\n\n props.onRecruit();\n props.onClose();\n }\n\n function onKeyUp(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) recruit();\n }\n\n function onChange(event: React.ChangeEvent): void {\n setName(event.target.value);\n }\n\n return (\n \n Enter a name for your new Gang member:\n
    \n \n Recruit\n \n ),\n }}\n />\n
    \n );\n}\n","/**\n * React Component for the territory subpage.\n */\nimport React, { useState } from \"react\";\n\nimport { Container, Button, Paper, Box, Tooltip, Switch, FormControlLabel, Typography } from \"@mui/material\";\nimport { Help } from \"@mui/icons-material\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\n\nimport { AllGangs } from \"../AllGangs\";\n\nimport { useGang } from \"./Context\";\nimport { TerritoryInfoModal } from \"./TerritoryInfoModal\";\n\nexport function TerritorySubpage(): React.ReactElement {\n const gang = useGang();\n const gangNames = Object.keys(AllGangs).filter((g) => g != gang.facName);\n const [infoOpen, setInfoOpen] = useState(false);\n\n return (\n \n \n This page shows how much territory your Gang controls. This statistic is listed as a percentage, which\n represents how much of the total territory you control.\n \n\n \n\n \n \n {gang.facName} (Your gang)\n \n\n (gang.territoryWarfareEngaged = event.target.checked)}\n />\n }\n label={\n \n Engaging in Territory Warfare sets your clash chance to 100%. Disengaging will cause your clash chance\n to gradually decrease until it reaches 0%.\n
    \n }\n >\n Engage in Territory Warfare\n \n }\n />\n
    \n (gang.notifyMemberDeath = event.target.checked)}\n />\n }\n label={\n \n If this is enabled, then you will receive a pop-up notifying you whenever one of your Gang Members\n dies in a territory clash.\n \n }\n >\n Notify about Gang Member Deaths\n \n }\n />\n\n \n Territory Clash Chance: {numeralWrapper.formatPercentage(gang.territoryClashChance, 3)}
    \n Power: {formatNumber(AllGangs[gang.facName].power, 3)}
    \n Territory: {formatTerritory(AllGangs[gang.facName].territory)}%
    \n
    \n \n \n {gangNames\n .sort((a, b) => {\n if (AllGangs[a].territory <= 0 && AllGangs[b].territory > 0) return 1;\n if (AllGangs[a].territory > 0 && AllGangs[b].territory <= 0) return -1;\n return 0;\n })\n .map((name) => (\n \n ))}\n \n setInfoOpen(false)} />\n \n );\n}\nfunction formatTerritory(n: number): string {\n const v = n * 100;\n const precision = 3;\n if (v <= 0) {\n return formatNumber(0, precision);\n } else if (v >= 100) {\n return formatNumber(100, precision);\n } else {\n return formatNumber(v, precision);\n }\n}\n\ninterface ITerritoryProps {\n name: string;\n}\n\nfunction OtherGangTerritory(props: ITerritoryProps): React.ReactElement {\n const gang = useGang();\n const playerPower = AllGangs[gang.facName].power;\n const power = AllGangs[props.name].power;\n const clashVictoryChance = playerPower / (power + playerPower);\n const territory = AllGangs[props.name].territory;\n const opacity = territory ? 1 : 0.75;\n return (\n \n \n {props.name}\n \n \n Power: {formatNumber(power, 3)}
    \n Territory: {formatTerritory(territory)}%
    \n Clash Win Chance: {numeralWrapper.formatPercentage(clashVictoryChance, 3)}\n
    \n
    \n );\n}\n","import React from \"react\";\n\nimport Typography from \"@mui/material/Typography\";\n\nimport { Modal } from \"../../ui/React/Modal\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport const TerritoryInfoModal = ({ open, onClose }: IProps): React.ReactElement => {\n return (\n \n <>\n Clashing\n \n Every ~20 seconds, your gang has a chance to 'clash' with other gangs. Your chance to win a clash depends on\n your gang's power, which is listed in the display below. Your gang's power slowly accumulates over time. The\n accumulation rate is determined by the stats of all Gang members you have assigned to the 'Territory Warfare'\n task. Gang members that are not assigned to this task do not contribute to your gang's power. Your gang also\n loses a small amount of power whenever you lose a clash.\n
    \n
    \n NOTE: Gang members assigned to 'Territory Warfare' can be killed during clashes. This can happen regardless of\n whether you win or lose the clash. A gang member being killed results in both respect and power loss for your\n gang.\n
    \n
    \n Territory\n \n The amount of territory you have affects all aspects of your Gang members' production, including money,\n respect, and wanted level. It is very beneficial to have high territory control.\n
    \n
    \n To increase your chances of winning territory, assign gang members to \"Territory Warfare\". This will build\n your gang power. Then, enable \"Engage in Territory Warfare\" to start fighting over territory.\n
    \n
    \n Territory Clash Chance\n \n This percentage represents the chance you have of 'clashing' with another gang. If you do not wish to\n gain/lose territory, then keep this percentage at 0% by not engaging in territory warfare.\n \n \n
    \n );\n};\n","/**\n * React Component for the popup that manages gang members upgrades\n */\nimport React, { useState } from \"react\";\nimport { useGang } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { MenuItem, Table, TableBody, TextField } from \"@mui/material\";\nimport SearchIcon from \"@mui/icons-material/Search\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { GangMemberUpgrades } from \"../GangMemberUpgrades\";\nimport { GangMemberUpgrade } from \"../GangMemberUpgrade\";\nimport { Money } from \"../../ui/React/Money\";\nimport { GangMember } from \"../GangMember\";\nimport { UpgradeType } from \"../data/upgrades\";\nimport { use } from \"../../ui/Context\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { StatsRow } from \"../../ui/React/StatsRow\";\n\ninterface INextRevealProps {\n upgrades: string[];\n type: UpgradeType;\n}\n\nfunction NextReveal(props: INextRevealProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n const upgrades = Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (player.money > gang.getUpgradeCost(upg)) return false;\n if (upg.type !== props.type) return false;\n if (props.upgrades.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n\n if (upgrades.length === 0) return <>;\n return (\n \n Next at \n \n );\n}\n\nfunction PurchasedUpgrade({ upgName }: { upgName: string }): React.ReactElement {\n const upg = GangMemberUpgrades[upgName];\n return (\n \n }>\n {upg.name}\n \n \n );\n}\n\ninterface IUpgradeButtonProps {\n upg: GangMemberUpgrade;\n rerender: () => void;\n member: GangMember;\n}\n\nfunction UpgradeButton(props: IUpgradeButtonProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n function onClick(): void {\n props.member.buyUpgrade(props.upg, player, gang);\n props.rerender();\n }\n return (\n }>\n \n \n \n \n );\n}\n\ninterface IPanelProps {\n member: GangMember;\n}\n\nfunction GangMemberUpgradePanel(props: IPanelProps): React.ReactElement {\n const gang = useGang();\n const player = use.Player();\n const setRerender = useState(false)[1];\n const [currentCategory, setCurrentCategory] = useState(\"Weapons\");\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function filterUpgrades(list: string[], type: UpgradeType): GangMemberUpgrade[] {\n return Object.keys(GangMemberUpgrades)\n .filter((upgName: string) => {\n const upg = GangMemberUpgrades[upgName];\n if (player.money < gang.getUpgradeCost(upg)) return false;\n if (upg.type !== type) return false;\n if (list.includes(upgName)) return false;\n return true;\n })\n .map((upgName: string) => GangMemberUpgrades[upgName]);\n }\n\n const onChange = (event: SelectChangeEvent): void => {\n setCurrentCategory(event.target.value);\n rerender();\n };\n\n const weaponUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Weapon);\n const armorUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Armor);\n const vehicleUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Vehicle);\n const rootkitUpgrades = filterUpgrades(props.member.upgrades, UpgradeType.Rootkit);\n const augUpgrades = filterUpgrades(props.member.augmentations, UpgradeType.Augmentation);\n\n const categories: { [key: string]: (GangMemberUpgrade[] | UpgradeType)[] } = {\n Weapons: [weaponUpgrades, UpgradeType.Weapon],\n Armor: [armorUpgrades, UpgradeType.Armor],\n Vehicles: [vehicleUpgrades, UpgradeType.Vehicle],\n Rootkits: [rootkitUpgrades, UpgradeType.Rootkit],\n Augmentations: [augUpgrades, UpgradeType.Augmentation],\n };\n\n const asc = {\n hack: props.member.calculateAscensionMult(props.member.hack_asc_points),\n str: props.member.calculateAscensionMult(props.member.str_asc_points),\n def: props.member.calculateAscensionMult(props.member.def_asc_points),\n dex: props.member.calculateAscensionMult(props.member.dex_asc_points),\n agi: props.member.calculateAscensionMult(props.member.agi_asc_points),\n cha: props.member.calculateAscensionMult(props.member.cha_asc_points),\n };\n return (\n \n \n \n \n {props.member.name} ({props.member.task})\n \n \n Hk: x{numeralWrapper.formatMultiplier(props.member.hack_mult * asc.hack)}(x\n {numeralWrapper.formatMultiplier(props.member.hack_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.hack)} Asc)\n
    \n St: x{numeralWrapper.formatMultiplier(props.member.str_mult * asc.str)}\n (x{numeralWrapper.formatMultiplier(props.member.str_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.str)} Asc)\n
    \n Df: x{numeralWrapper.formatMultiplier(props.member.def_mult * asc.def)}\n (x{numeralWrapper.formatMultiplier(props.member.def_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.def)} Asc)\n
    \n Dx: x{numeralWrapper.formatMultiplier(props.member.dex_mult * asc.dex)}\n (x{numeralWrapper.formatMultiplier(props.member.dex_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.dex)} Asc)\n
    \n Ag: x{numeralWrapper.formatMultiplier(props.member.agi_mult * asc.agi)}\n (x{numeralWrapper.formatMultiplier(props.member.agi_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.agi)} Asc)\n
    \n Ch: x{numeralWrapper.formatMultiplier(props.member.cha_mult * asc.cha)}\n (x{numeralWrapper.formatMultiplier(props.member.cha_mult)} Eq, x\n {numeralWrapper.formatMultiplier(asc.cha)} Asc)\n \n }\n >\n \n \n \n \n \n \n \n \n \n
    \n \n
    \n\n \n \n\n \n {(categories[currentCategory][0] as GangMemberUpgrade[]).length === 0 && (\n All upgrades owned!\n )}\n \n {(categories[currentCategory][0] as GangMemberUpgrade[]).map((upg) => (\n \n ))}\n \n \n \n \n
    \n\n Purchased Upgrades: \n \n {props.member.upgrades.map((upg: string) => (\n \n ))}\n {props.member.augmentations.map((upg: string) => (\n \n ))}\n \n
    \n );\n}\n\nexport function EquipmentsSubpage(): React.ReactElement {\n const gang = useGang();\n const [filter, setFilter] = useState(\"\");\n\n const handleFilterChange = (event: React.ChangeEvent): void => {\n setFilter(event.target.value.toLowerCase());\n };\n\n const members = gang.members.filter((member) => member && member.name.toLowerCase().includes(filter));\n\n return (\n <>\n \n You get a discount on equipment and upgrades based on your gang's respect and power. More respect and power\n leads to more discounts.\n \n }\n >\n Discount: -{numeralWrapper.formatPercentage(1 - 1 / gang.getDiscount())}\n \n\n ,\n spellCheck: false,\n }}\n placeholder=\"Filter by member name\"\n sx={{ m: 1, width: \"15%\" }}\n />\n\n \n {members.map((member: GangMember) => (\n \n ))}\n \n \n );\n}\n","// React Components for the Corporation UI's navigation tabs\n// These are the tabs at the top of the UI that let you switch to different\n// divisions, see an overview of your corporation, or create a new industry\nimport React, { useState, useEffect } from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MainPanel } from \"./MainPanel\";\nimport { Industries } from \"../IndustryData\";\nimport { ExpandIndustryTab } from \"./ExpandIndustryTab\";\nimport { use } from \"../../ui/Context\";\nimport { Context } from \"./Context\";\nimport { Overview } from \"./Overview\";\n\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\nexport function CorporationRoot(): React.ReactElement {\n const player = use.Player();\n const corporation = player.corporation;\n if (corporation === null) return <>;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [divisionName, setDivisionName] = useState(\"Overview\");\n function handleChange(event: React.SyntheticEvent, tab: string | number): void {\n setDivisionName(tab);\n }\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n const canExpand =\n Object.keys(Industries).filter(\n (industryType: string) =>\n corporation.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n ).length > 0;\n\n return (\n \n \n \n {corporation.divisions.map((div) => (\n \n ))}\n {canExpand && }\n \n {divisionName === \"Overview\" && }\n {divisionName === -1 && }\n {typeof divisionName === \"string\" && divisionName !== \"Overview\" && (\n \n )}\n \n );\n}\n","// React Component for the element that contains the actual info/data\n// for the Corporation UI. This panel lies below the header tabs and will\n// be filled with whatever is needed based on the routing/navigation\nimport React from \"react\";\n\nimport { CityTabs } from \"./CityTabs\";\nimport { IIndustry } from \"../IIndustry\";\nimport { Context, useCorporation } from \"./Context\";\n\nimport { CityName } from \"../../Locations/data/CityNames\";\n\ninterface IProps {\n divisionName: string;\n rerender: () => void;\n}\n\nexport function MainPanel(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division =\n props.divisionName !== \"Overview\"\n ? corp.divisions.find((division: IIndustry) => division.name === props.divisionName)\n : undefined; // use undefined because find returns undefined\n\n if (division === undefined) throw new Error(\"Cannot find division\");\n return (\n \n \n \n );\n}\n","// React Components for the Corporation UI's City navigation tabs\n// These allow player to navigate between different cities for each industry\nimport React, { useState } from \"react\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Industry } from \"./Industry\";\nimport { ExpandNewCity } from \"./ExpandNewCity\";\nimport { useDivision } from \"./Context\";\nimport Tabs from \"@mui/material/Tabs\";\nimport Tab from \"@mui/material/Tab\";\n\ninterface IProps {\n city: string;\n rerender: () => void;\n}\n\nexport function CityTabs(props: IProps): React.ReactElement {\n const division = useDivision();\n const [city, setCity] = useState(props.city);\n\n const office = division.offices[city];\n if (office === 0) {\n setCity(\"Sector-12\");\n return <>;\n }\n\n const canExpand =\n Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0).length > 0;\n function handleChange(event: React.SyntheticEvent, tab: string): void {\n setCity(tab);\n }\n return (\n <>\n \n {Object.values(division.offices).map(\n (office: OfficeSpace | 0) => office !== 0 && ,\n )}\n {canExpand && }\n \n\n {city !== \"Expand\" ? (\n \n ) : (\n \n )}\n \n );\n}\n","// React Component for managing the Corporation's Industry UI\n// This Industry component does NOT include the city tabs at the top\nimport React from \"react\";\n\nimport { IndustryOffice } from \"./IndustryOffice\";\nimport { IndustryOverview } from \"./IndustryOverview\";\nimport { IndustryWarehouse } from \"./IndustryWarehouse\";\nimport { Warehouse } from \"../Warehouse\";\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProps {\n city: string;\n warehouse: Warehouse | 0;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function Industry(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const division = useDivision();\n return (\n \n \n \n \n \n \n \n \n \n );\n}\n","// React Component for displaying an Industry's OfficeSpace information\n// (bottom-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Employee } from \"../Employee\";\nimport { EmployeePositions } from \"../EmployeePositions\";\nimport { BuyCoffee } from \"../Actions\";\n\nimport { MoneyCost } from \"./MoneyCost\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { UpgradeOfficeSizeModal } from \"./modals/UpgradeOfficeSizeModal\";\nimport { ThrowPartyModal } from \"./modals/ThrowPartyModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport IconButton from \"@mui/material/IconButton\";\nimport Paper from \"@mui/material/Paper\";\nimport ArrowForwardIcon from \"@mui/icons-material/ArrowForward\";\nimport ArrowDropUpIcon from \"@mui/icons-material/ArrowDropUp\";\nimport ArrowDropDownIcon from \"@mui/icons-material/ArrowDropDown\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport { Box } from \"@mui/material\";\n\ninterface IProps {\n office: OfficeSpace;\n rerender: () => void;\n}\n\ninterface ISwitchProps {\n manualMode: boolean;\n switchMode: (f: (b: boolean) => boolean) => void;\n}\n\nfunction SwitchButton(props: ISwitchProps): React.ReactElement {\n if (props.manualMode) {\n return (\n \n Switch to Automatic Assignment Mode, which will automatically assign employees to your selected jobs. You\n simply have to select the number of assignments for each job\n \n }\n >\n \n \n );\n } else {\n return (\n \n Switch to Manual Assignment Mode, which allows you to specify which employees should get which jobs\n \n }\n >\n \n \n );\n }\n}\n\nfunction ManualManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [employee, setEmployee] = useState(\n props.office.employees.length > 0 ? props.office.employees[0] : null,\n );\n\n // Employee Selector\n const employees = [];\n for (let i = 0; i < props.office.employees.length; ++i) {\n employees.push(\n \n {props.office.employees[i].name}\n ,\n );\n }\n\n function employeeSelectorOnChange(e: SelectChangeEvent): void {\n const name = e.target.value;\n for (let i = 0; i < props.office.employees.length; ++i) {\n if (name === props.office.employees[i].name) {\n setEmployee(props.office.employees[i]);\n break;\n }\n }\n\n props.rerender();\n }\n\n // Employee Positions Selector\n const emp = employee;\n let employeePositionSelectorInitialValue = \"\";\n const employeePositions = [];\n const positionNames = Object.values(EmployeePositions);\n for (let i = 0; i < positionNames.length; ++i) {\n employeePositions.push(\n \n {positionNames[i]}\n ,\n );\n if (emp != null && emp.nextPos === positionNames[i]) {\n employeePositionSelectorInitialValue = emp.nextPos;\n }\n }\n\n function employeePositionSelectorOnChange(e: SelectChangeEvent): void {\n if (employee === null) return;\n props.office.assignSingleJob(employee, e.target.value);\n props.rerender();\n }\n\n // Numeraljs formatter\n const nf = \"0.000\";\n\n // Employee stats (after applying multipliers)\n const effCre = emp ? emp.cre * corp.getEmployeeCreMultiplier() * division.getEmployeeCreMultiplier() : 0;\n const effCha = emp ? emp.cha * corp.getEmployeeChaMultiplier() * division.getEmployeeChaMultiplier() : 0;\n const effInt = emp ? emp.int * corp.getEmployeeIntMultiplier() * division.getEmployeeIntMultiplier() : 0;\n const effEff = emp ? emp.eff * corp.getEmployeeEffMultiplier() * division.getEmployeeEffMultiplier() : 0;\n\n return (\n <>\n
    \n \n {employee != null && (\n \n Morale: {numeralWrapper.format(employee.mor, nf)}\n
    \n Happiness: {numeralWrapper.format(employee.hap, nf)}\n
    \n Energy: {numeralWrapper.format(employee.ene, nf)}\n
    \n Intelligence: {numeralWrapper.format(effInt, nf)}\n
    \n Charisma: {numeralWrapper.format(effCha, nf)}\n
    \n Experience: {numeralWrapper.format(employee.exp, nf)}\n
    \n Creativity: {numeralWrapper.format(effCre, nf)}\n
    \n Efficiency: {numeralWrapper.format(effEff, nf)}\n
    \n Salary: \n
    \n )}\n {employee != null && (\n \n )}\n \n );\n}\n\ninterface IAutoAssignProps {\n office: OfficeSpace;\n job: string;\n desc: string;\n rerender: () => void;\n}\n\nfunction EmployeeCount(props: { num: number; next: number }): React.ReactElement {\n return (\n \n {props.num === props.next ? null : props.num}\n {props.num === props.next ? null : }\n {props.next}\n \n );\n}\n\nfunction AutoAssignJob(props: IAutoAssignProps): React.ReactElement {\n const currJob = props.office.employeeJobs[props.job];\n const nextJob = props.office.employeeNextJobs[props.job];\n const nextUna = props.office.employeeNextJobs[EmployeePositions.Unassigned];\n\n function assignEmployee(): void {\n if (nextUna <= 0) {\n console.warn(\"Cannot assign employee. No unassigned employees available\");\n return;\n }\n\n props.office.autoAssignJob(props.job, nextJob + 1);\n props.rerender();\n }\n\n function unassignEmployee(): void {\n props.office.autoAssignJob(props.job, nextJob - 1);\n props.rerender();\n }\n\n return (\n \n \n \n {props.job}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n}\n\nfunction AutoManagement(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const vechain = corp.unlockUpgrades[4] === 1; // Has Vechain upgrade\n\n // Calculate average morale, happiness, energy, and salary.\n let totalMorale = 0,\n totalHappiness = 0,\n totalEnergy = 0,\n totalSalary = 0;\n for (let i = 0; i < props.office.employees.length; ++i) {\n totalMorale += props.office.employees[i].mor;\n totalHappiness += props.office.employees[i].hap;\n totalEnergy += props.office.employees[i].ene;\n totalSalary += props.office.employees[i].sal;\n }\n\n let avgMorale = 0,\n avgHappiness = 0,\n avgEnergy = 0;\n if (props.office.employees.length > 0) {\n avgMorale = totalMorale / props.office.employees.length;\n avgHappiness = totalHappiness / props.office.employees.length;\n avgEnergy = totalEnergy / props.office.employees.length;\n }\n\n const currUna = props.office.employeeJobs[EmployeePositions.Unassigned];\n const nextUna = props.office.employeeNextJobs[EmployeePositions.Unassigned];\n\n return (\n \n \n \n \n Unassigned Employees:\n \n \n \n \n \n \n \n Avg Employee Morale:\n \n \n {numeralWrapper.format(avgMorale, \"0.000\")}\n \n \n \n \n Avg Employee Happiness:\n \n \n {numeralWrapper.format(avgHappiness, \"0.000\")}\n \n \n \n \n Avg Employee Energy:\n \n \n {numeralWrapper.format(avgEnergy, \"0.000\")}\n \n \n \n \n Total Employee Salary:\n \n \n \n \n \n \n \n {vechain && (\n <>\n \n \n \n The base amount of material this office can produce. Does not include production multipliers from\n upgrades and materials. This value is based off the productivity of your Operations, Engineering,\n and Management employees\n \n }\n >\n Material Production:\n \n \n \n \n {numeralWrapper.format(division.getOfficeProductivity(props.office), \"0.000\")}\n \n \n \n \n \n \n The base amount of any given Product this office can produce. Does not include production\n multipliers from upgrades and materials. This value is based off the productivity of your\n Operations, Engineering, and Management employees\n \n }\n >\n Product Production:\n \n \n \n \n {numeralWrapper.format(\n division.getOfficeProductivity(props.office, {\n forProduct: true,\n }),\n \"0.000\",\n )}\n \n \n \n \n \n The effect this office's 'Business' employees has on boosting sales}\n >\n Business Multiplier:\n \n \n \n x{numeralWrapper.format(division.getBusinessFactor(props.office), \"0.000\")}\n \n \n \n )}\n \n\n \n\n \n\n \n\n \n\n \n \n
    \n );\n}\n\nexport function IndustryOffice(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [upgradeOfficeSizeOpen, setUpgradeOfficeSizeOpen] = useState(false);\n const [throwPartyOpen, setThrowPartyOpen] = useState(false);\n const [employeeManualAssignMode, setEmployeeManualAssignMode] = useState(false);\n\n function autohireEmployeeButtonOnClick(): void {\n if (props.office.atCapacity()) return;\n props.office.hireRandomEmployee();\n props.rerender();\n }\n\n return (\n \n Office Space\n \n Size: {props.office.employees.length} / {props.office.size} employees\n \n \n \n Automatically hires an employee and gives him/her a random name}>\n \n \n \n \n Upgrade the office's size so that it can hold more employees!}>\n \n \n \n \n setUpgradeOfficeSizeOpen(false)}\n />\n\n {!division.hasResearch(\"AutoBrew\") && (\n <>\n Provide your employees with coffee, increasing their energy by 5%}\n >\n \n 0}\n onClick={() => BuyCoffee(corp, props.office)}\n >\n {props.office.coffeeMult > 0 ? (\n \"Buying coffee...\"\n ) : (\n \n Buy Coffee - \n \n )}\n \n \n \n \n )}\n\n {!division.hasResearch(\"AutoPartyManager\") && (\n <>\n Throw an office party to increase your employee's morale and happiness}\n >\n \n 0}\n onClick={() => setThrowPartyOpen(true)}\n >\n {props.office.partyMult > 0 ? \"Throwing Party...\" : \"Throw Party\"}\n \n \n \n setThrowPartyOpen(false)}\n />\n \n )}\n \n \n \n {employeeManualAssignMode ? (\n \n ) : (\n \n )}\n \n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { OfficeSpace } from \"../../OfficeSpace\";\nimport { ICorporation } from \"../../ICorporation\";\nimport { UpgradeOfficeSize } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\ninterface IUpgradeButton {\n cost: number;\n size: number;\n corp: ICorporation;\n office: OfficeSpace;\n onClose: () => void;\n rerender: () => void;\n}\n\nfunction UpgradeSizeButton(props: IUpgradeButton): React.ReactElement {\n const corp = useCorporation();\n function upgradeSize(cost: number, size: number): void {\n if (corp.funds < cost) {\n return;\n }\n\n UpgradeOfficeSize(corp, props.office, size);\n props.rerender();\n props.onClose();\n }\n return (\n \n \n \n \n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function UpgradeOfficeSizeModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const initialPriceMult = Math.round(props.office.size / CorporationConstants.OfficeInitialSize);\n const costMultiplier = 1.09;\n const upgradeCost = CorporationConstants.OfficeInitialCost * Math.pow(costMultiplier, initialPriceMult);\n\n // Calculate cost to upgrade size by 15 employees\n let mult = 0;\n for (let i = 0; i < 5; ++i) {\n mult += Math.pow(costMultiplier, initialPriceMult + i);\n }\n const upgradeCost15 = CorporationConstants.OfficeInitialCost * mult;\n\n //Calculate max upgrade size and cost\n const maxMult = corp.funds / CorporationConstants.OfficeInitialCost;\n let maxNum = 1;\n mult = Math.pow(costMultiplier, initialPriceMult);\n while (maxNum < 50) {\n //Hard cap of 50x (extra 150 employees)\n if (mult >= maxMult) break;\n const multIncrease = Math.pow(costMultiplier, initialPriceMult + maxNum);\n if (mult + multIncrease > maxMult) {\n break;\n } else {\n mult += multIncrease;\n }\n ++maxNum;\n }\n const upgradeCostMax = CorporationConstants.OfficeInitialCost * mult;\n\n return (\n \n Increase the size of your office space to fit additional employees!\n \n Upgrade size: \n \n \n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { OfficeSpace } from \"../../OfficeSpace\";\nimport { ThrowParty } from \"../../Actions\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport Box from \"@mui/material/Box\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n office: OfficeSpace;\n rerender: () => void;\n}\n\nexport function ThrowPartyModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [cost, setCost] = useState(0);\n\n const totalCost = cost * props.office.employees.length;\n const canParty = corp.funds >= totalCost;\n function changeCost(event: React.ChangeEvent): void {\n let x = parseFloat(event.target.value);\n if (isNaN(x)) x = 0;\n setCost(x);\n }\n\n function throwParty(): void {\n if (cost === null || isNaN(cost) || cost < 0) {\n dialogBoxCreate(\"Invalid value entered\");\n } else if (!canParty) {\n dialogBoxCreate(\"You don't have enough company funds to throw a party!\");\n } else {\n const mult = ThrowParty(corp, props.office, cost);\n\n if (mult > 0) {\n dialogBoxCreate(\n \"You threw a party for the office! The morale and happiness \" +\n \"of each employee increased by \" +\n numeralWrapper.formatPercentage(mult - 1),\n );\n }\n\n props.rerender();\n props.onClose();\n }\n }\n\n function EffectText(): React.ReactElement {\n if (isNaN(cost) || cost < 0) return Invalid value entered!;\n return (\n \n Throwing this party will cost a total of \n \n );\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) throwParty();\n }\n\n return (\n \n Enter the amount of money you would like to spend PER EMPLOYEE on this office party\n \n \n \n \n \n \n );\n}\n","// React Component for displaying an Industry's overview information\n// (top-left panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { Industries } from \"../IndustryData\";\nimport { HireAdVert } from \"../Actions\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { createProgressBarText } from \"../../utils/helpers/createProgressBarText\";\nimport { MakeProductModal } from \"./modals/MakeProductModal\";\nimport { ResearchModal } from \"./modals/ResearchModal\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { StaticModal } from \"../../ui/React/StaticModal\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport IconButton from \"@mui/material/IconButton\";\nimport HelpIcon from \"@mui/icons-material/Help\";\nimport Box from \"@mui/material/Box\";\n\nfunction MakeProductButton(): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [makeOpen, setMakeOpen] = useState(false);\n\n const hasMaxProducts = division.hasMaximumNumberProducts();\n\n function shouldFlash(): boolean {\n return Object.keys(division.products).length === 0;\n }\n\n let createProductButtonText = \"\";\n switch (division.type) {\n case Industries.Food:\n createProductButtonText = \"Build Restaurant\";\n break;\n case Industries.Tobacco:\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Pharmaceutical:\n createProductButtonText = \"Create Drug\";\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductButtonText = \"Create Product\";\n break;\n case Industries.Robotics:\n createProductButtonText = \"Design Robot\";\n break;\n case Industries.Software:\n createProductButtonText = \"Develop Software\";\n break;\n case Industries.Healthcare:\n createProductButtonText = \"Build Hospital\";\n break;\n case Industries.RealEstate:\n createProductButtonText = \"Develop Property\";\n break;\n default:\n createProductButtonText = \"Create Product\";\n return <>;\n }\n\n return (\n <>\n \n You have reached the maximum number of products: {division.getMaximumNumberProducts()}\n \n ) : (\n \"\"\n )\n }\n >\n \n \n setMakeOpen(false)} />\n \n );\n}\n\ninterface IProps {\n rerender: () => void;\n}\n\nexport function IndustryOverview(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [helpOpen, setHelpOpen] = useState(false);\n const [researchOpen, setResearchOpen] = useState(false);\n const vechain = corp.unlockUpgrades[4] === 1;\n const profit = division.lastCycleRevenue - division.lastCycleExpenses;\n\n let advertisingInfo = false;\n const advertisingFactors = division.getAdvertisingFactors();\n const awarenessFac = advertisingFactors[1];\n const popularityFac = advertisingFactors[2];\n const ratioFac = advertisingFactors[3];\n const totalAdvertisingFac = advertisingFactors[0];\n if (vechain) {\n advertisingInfo = true;\n }\n\n function convertEffectFacToGraphic(fac: number): string {\n return createProgressBarText({\n progress: fac,\n totalTicks: 20,\n });\n }\n\n return (\n \n \n Industry: {division.type} (Corp Funds: )\n \n
    \n \n {advertisingInfo !== false && (\n \n Total multiplier for this industrys sales due to its awareness and popularity\n \n \n }\n >\n Advertising Multiplier: x{numeralWrapper.formatReallyBigNumber(totalAdvertisingFac)}\n \n )}\n
    \n ],\n [\"Expenses:\", ],\n [\"Profit:\", ],\n ]}\n />\n
    \n \n \n Production gain from owning production-boosting materials such as hardware, Robots, AI Cores, and Real\n Estate.\n \n }\n >\n Production Multiplier: {numeralWrapper.formatReallyBigNumber(division.prodMult)}\n \n setHelpOpen(true)}>\n \n \n setHelpOpen(false)}>\n \n Owning Hardware, Robots, AI Cores, and Real Estate can boost your Industry's production. The effect these\n materials have on your production varies between Industries. For example, Real Estate may be very effective\n for some Industries, but ineffective for others.\n
    \n
    \n This division's production multiplier is calculated by summing the individual production multiplier of each\n of its office locations. This production multiplier is applied to each office. Therefore, it is beneficial\n to expand into new cities as this can greatly increase the production multiplier of your entire Division.\n
    \n
    \n Below are approximations for how effective each material is at boosting this industry's production\n multiplier (Bigger bars = more effective):\n
    \n
    \n Hardware:    {convertEffectFacToGraphic(division.hwFac)}\n
    \n Robots:      {convertEffectFacToGraphic(division.robFac)}\n
    \n AI Cores:    {convertEffectFacToGraphic(division.aiFac)}\n
    \n Real Estate: {convertEffectFacToGraphic(division.reFac)}\n
    \n
    \n
    \n \n \n Scientific Research increases the quality of the materials and products that you produce.\n \n }\n >\n Scientific Research: {numeralWrapper.formatReallyBigNumber(division.sciResearch.qty)}\n \n \n setResearchOpen(false)} industry={division} />\n \n
    \n \n \n Hire AdVert.Inc to advertise your company. Each level of this upgrade grants your company a static\n increase of 3 and 1 to its awareness and popularity, respectively. It will then increase your company's\n awareness by 1%, and its popularity by a random percentage between 1% and 3%. These effects are increased\n by other upgrades that increase the power of your advertising.\n \n }\n >\n corp.funds}\n onClick={function () {\n HireAdVert(corp, division);\n props.rerender();\n }}\n >\n Hire AdVert -  \n \n \n {division.makesProducts && }\n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Industries } from \"../../IndustryData\";\nimport { MakeProduct } from \"../../Actions\";\nimport { useCorporation, useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nfunction productPlaceholder(tpe: string): string {\n if (tpe === Industries.Food) {\n return \"Restaurant Name\";\n } else if (tpe === Industries.Healthcare) {\n return \"Hospital Name\";\n } else if (tpe === Industries.RealEstate) {\n return \"Property Name\";\n }\n return \"Product Name\";\n}\n\n// Create a popup that lets the player create a product for their current industry\nexport function MakeProductModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const allCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] !== 0);\n const [city, setCity] = useState(allCities.length > 0 ? allCities[0] : \"\");\n const [name, setName] = useState(\"\");\n const [design, setDesign] = useState(NaN);\n const [marketing, setMarketing] = useState(NaN);\n if (division.hasMaximumNumberProducts()) return <>;\n\n let createProductPopupText = <>;\n switch (division.type) {\n case Industries.Food:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Build and manage a new restaurant!\n \n );\n break;\n case Industries.Tobacco:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Create a new tobacco product!\n \n );\n break;\n case Industries.Pharmaceutical:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Design and develop a new pharmaceutical drug!\n \n );\n break;\n case Industries.Computer:\n case \"Computer\":\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Design and manufacture a new computer hardware product!\n \n );\n break;\n case Industries.Robotics:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Design and create a new robot or robotic system!\n \n );\n break;\n case Industries.Software:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Develop a new piece of software!\n \n );\n break;\n case Industries.Healthcare:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Build and manage a new hospital!\n \n );\n break;\n case Industries.RealEstate:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Develop a new piece of real estate property!\n \n );\n break;\n default:\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n Create a new product!\n \n );\n return <>;\n }\n createProductPopupText = (\n <>\n {createProductPopupText}\n
    \n
    \n To begin developing a product, first choose the city in which it will be designed. The stats of your employees in\n the selected city affect the properties of the finished product, such as its quality, performance, and durability.\n
    \n
    \n You can also choose to invest money in the design and marketing of the product. Investing money in its design will\n result in a superior product. Investing money in marketing the product will help the product's sales.\n \n );\n\n function makeProduct(): void {\n if (isNaN(design) || isNaN(marketing)) return;\n try {\n MakeProduct(corp, division, city, name, design, marketing);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onCityChange(event: SelectChangeEvent): void {\n setCity(event.target.value);\n }\n\n function onProductNameChange(event: React.ChangeEvent): void {\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) makeProduct();\n }\n\n return (\n \n {createProductPopupText}\n \n \n
    \n \n \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { IndustryResearchTrees } from \"../../IndustryData\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { IIndustry } from \"../../IIndustry\";\nimport { Research } from \"../../Actions\";\nimport { Node } from \"../../ResearchTree\";\nimport { ResearchMap } from \"../../ResearchMap\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\nimport Collapse from \"@mui/material/Collapse\";\nimport ExpandMore from \"@mui/icons-material/ExpandMore\";\nimport ExpandLess from \"@mui/icons-material/ExpandLess\";\nimport CheckIcon from \"@mui/icons-material/Check\";\n\ninterface INodeProps {\n n: Node | null;\n division: IIndustry;\n}\nfunction Upgrade({ n, division }: INodeProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (n === null) return <>;\n const r = ResearchMap[n.text];\n let disabled = division.sciResearch.qty < r.cost || n.researched;\n const parent = n.parent;\n if (parent !== null) {\n disabled = disabled || !parent.researched;\n }\n\n function research(): void {\n if (n === null || disabled) return;\n try {\n Research(division, n.text);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(\n `Researched ${n.text}. It may take a market cycle ` +\n `(~${CorporationConstants.SecsPerMarketCycle} seconds) before the effects of ` +\n `the Research apply.`,\n );\n }\n\n let color: \"primary\" | \"info\" = \"primary\";\n if (n.researched) {\n color = \"info\";\n }\n\n const wrapInTooltip = (ele: React.ReactElement): React.ReactElement => {\n return (\n \n Research points: {r.cost}\n
    \n {r.desc}\n \n }\n >\n {ele}\n \n );\n };\n\n const but = (\n \n {wrapInTooltip(\n \n \n {n.researched && }\n {n.text}\n \n ,\n )}\n \n );\n\n if (n.children.length === 0) return but;\n\n return (\n \n \n {wrapInTooltip(\n \n \n {n.researched && }\n {n.text}\n \n ,\n )}\n setOpen((old) => !old)}\n sx={{ borderColor: Settings.theme.button, minWidth: \"fit-content\" }}\n >\n {open ? : }\n \n \n \n \n {n.children.map((m) => (\n \n ))}\n \n \n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n industry: IIndustry;\n}\n\n// Create the Research Tree UI for this Industry\nexport function ResearchModal(props: IProps): React.ReactElement {\n const researchTree = IndustryResearchTrees[props.industry.type];\n if (researchTree === undefined) return <>;\n\n return (\n \n \n \n Research points: {props.industry.sciResearch.qty.toFixed(3)}\n
    \n Multipliers from research:\n
    * Advertising Multiplier: x{researchTree.getAdvertisingMultiplier()}\n
    * Employee Charisma Multiplier: x{researchTree.getEmployeeChaMultiplier()}\n
    * Employee Creativity Multiplier: x{researchTree.getEmployeeCreMultiplier()}\n
    * Employee Efficiency Multiplier: x{researchTree.getEmployeeEffMultiplier()}\n
    * Employee Intelligence Multiplier: x{researchTree.getEmployeeIntMultiplier()}\n
    * Production Multiplier: x{researchTree.getProductionMultiplier()}\n
    * Sales Multiplier: x{researchTree.getSalesMultiplier()}\n
    * Scientific Research Multiplier: x{researchTree.getScientificResearchMultiplier()}\n
    * Storage Multiplier: x{researchTree.getStorageMultiplier()}\n
    \n
    \n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Material } from \"../Material\";\nimport { Product } from \"../Product\";\nimport { Warehouse } from \"../Warehouse\";\nimport { SmartSupplyModal } from \"./modals/SmartSupplyModal\";\nimport { ProductElem } from \"./ProductElem\";\nimport { MaterialElem } from \"./MaterialElem\";\nimport { MaterialSizes } from \"../MaterialSizes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { ICorporation } from \"../ICorporation\";\nimport { IIndustry } from \"../IIndustry\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { isRelevantMaterial } from \"./Helpers\";\nimport { IndustryProductEquation } from \"./IndustryProductEquation\";\nimport { PurchaseWarehouse } from \"../Actions\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport makeStyles from \"@mui/styles/makeStyles\";\nimport createStyles from \"@mui/styles/createStyles\";\n\ninterface IProps {\n corp: ICorporation;\n division: IIndustry;\n warehouse: Warehouse | 0;\n currentCity: string;\n player: IPlayer;\n rerender: () => void;\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n retainHeight: {\n minHeight: \"3em\",\n },\n }),\n);\n\nfunction WarehouseRoot(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [smartSupplyOpen, setSmartSupplyOpen] = useState(false);\n if (props.warehouse === 0) return <>;\n\n // Upgrade Warehouse size button\n const sizeUpgradeCost = CorporationConstants.WarehouseUpgradeBaseCost * Math.pow(1.07, props.warehouse.level + 1);\n const canAffordUpgrade = corp.funds > sizeUpgradeCost;\n function upgradeWarehouseOnClick(): void {\n if (division === null) return;\n if (props.warehouse === 0) return;\n if (!canAffordUpgrade) return;\n ++props.warehouse.level;\n props.warehouse.updateSize(corp, division);\n corp.funds = corp.funds - sizeUpgradeCost;\n props.rerender();\n }\n\n const classes = useStyles();\n\n // Current State:\n let stateText;\n switch (division.state) {\n case \"START\":\n stateText = \"Current state: Preparing...\";\n break;\n case \"PURCHASE\":\n stateText = \"Current state: Purchasing materials...\";\n break;\n case \"PRODUCTION\":\n stateText = \"Current state: Producing materials and/or products...\";\n break;\n case \"SALE\":\n stateText = \"Current state: Selling materials and/or products...\";\n break;\n case \"EXPORT\":\n stateText = \"Current state: Exporting materials and/or products...\";\n break;\n default:\n console.error(`Invalid state: ${division.state}`);\n break;\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n // Only create UI for materials that are relevant for the industry or in stock\n const isInStock = props.warehouse.materials[matName].qty > 0;\n const isRelevant = isRelevantMaterial(matName, division);\n if (!isInStock && !isRelevant) continue;\n mats.push(\n ,\n );\n }\n\n // Create React components for products\n const products = [];\n if (division.makesProducts && Object.keys(division.products).length > 0) {\n for (const productName of Object.keys(division.products)) {\n const product = division.products[productName];\n if (!(product instanceof Product)) continue;\n products.push(\n ,\n );\n }\n }\n\n const breakdownItems: JSX.Element[] = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n const mat = props.warehouse.materials[matName];\n if (!MaterialSizes.hasOwnProperty(matName)) continue;\n if (mat.qty === 0) continue;\n breakdownItems.push(\n <>\n {matName}: {numeralWrapper.format(mat.qty * MaterialSizes[matName], \"0,0.0\")}\n ,\n );\n }\n\n for (const prodName of Object.keys(division.products)) {\n const prod = division.products[prodName];\n if (prod === undefined) continue;\n breakdownItems.push(\n <>\n {prodName}: {numeralWrapper.format(prod.data[props.warehouse.loc][0] * prod.siz, \"0,0.0\")}\n ,\n );\n }\n\n let breakdown;\n if (breakdownItems && breakdownItems.length > 0) {\n breakdown = breakdownItems.reduce(\n (previous: JSX.Element, current: JSX.Element): JSX.Element =>\n (previous && (\n <>\n {previous}\n
    \n {current}\n \n )) || <>{current},\n );\n } else {\n breakdown = <>No items in storage.;\n }\n\n return (\n \n \n \n <>{breakdown}\n \n ) : (\n \"\"\n )\n }\n >\n = props.warehouse.size ? \"error\" : \"primary\"}>\n Storage: {numeralWrapper.formatBigNumber(props.warehouse.sizeUsed)} /{\" \"}\n {numeralWrapper.formatBigNumber(props.warehouse.size)}\n \n \n \n\n \n\n This industry uses the following equation for its production: \n
    \n \n \n \n
    \n \n To get started with production, purchase your required materials or import them from another of your company's\n divisions.\n \n
    \n\n {stateText}\n\n {corp.unlockUpgrades[1] && (\n <>\n \n setSmartSupplyOpen(false)}\n warehouse={props.warehouse}\n />\n \n )}\n\n {mats}\n\n {products}\n
    \n );\n}\n\nexport function IndustryWarehouse(props: IProps): React.ReactElement {\n if (props.warehouse instanceof Warehouse) {\n return ;\n } else {\n return ;\n }\n}\n\ninterface IEmptyProps {\n city: string;\n rerender: () => void;\n}\n\nfunction EmptyWarehouse(props: IEmptyProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const disabled = corp.funds < CorporationConstants.WarehouseInitialCost;\n function purchaseWarehouse(): void {\n if (disabled) return;\n PurchaseWarehouse(corp, division, props.city);\n props.rerender();\n }\n return (\n \n \n \n );\n}\n","import React, { useState } from \"react\";\n\nimport { Warehouse } from \"../../Warehouse\";\nimport { SetSmartSupply, SetSmartSupplyUseLeftovers } from \"../../Actions\";\nimport { Material } from \"../../Material\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\n\ninterface ILeftoverProps {\n matName: string;\n warehouse: Warehouse;\n}\n\nfunction Leftover(props: ILeftoverProps): React.ReactElement {\n const [checked, setChecked] = useState(!!props.warehouse.smartSupplyUseLeftovers[props.matName.replace(/ /g, \"\")]);\n\n function onChange(event: React.ChangeEvent): void {\n try {\n const matName = props.matName.replace(/ /g, \"\");\n const material = props.warehouse.materials[matName];\n SetSmartSupplyUseLeftovers(props.warehouse, material, event.target.checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n setChecked(event.target.checked);\n }\n\n return (\n <>\n }\n label={{props.warehouse.materials[props.matName.replace(/ /g, \"\")].name}}\n />\n
    \n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n warehouse: Warehouse;\n}\n\nexport function SmartSupplyModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n // Smart Supply Checkbox\n function smartSupplyOnChange(e: React.ChangeEvent): void {\n SetSmartSupply(props.warehouse, e.target.checked);\n rerender();\n }\n\n // Create React components for materials\n const mats = [];\n for (const matName of Object.keys(props.warehouse.materials)) {\n if (!(props.warehouse.materials[matName] instanceof Material)) continue;\n if (!Object.keys(division.reqMats).includes(matName)) continue;\n mats.push();\n }\n\n return (\n \n <>\n }\n label={Enable Smart Supply}\n />\n
    \n Use materials already in the warehouse instead of buying new ones, if available:\n {mats}\n \n
    \n );\n}\n","import React, { useState } from \"react\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { Product } from \"../Product\";\nimport { DiscontinueProductModal } from \"./modals/DiscontinueProductModal\";\nimport { LimitProductProductionModal } from \"./modals/LimitProductProductionModal\";\nimport { SellProductModal } from \"./modals/SellProductModal\";\nimport { ProductMarketTaModal } from \"./modals/ProductMarketTaModal\";\nimport { CancelProductModal } from \"./modals/CancelProductModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\n\ninterface IProductProps {\n city: string;\n product: Product;\n rerender: () => void;\n}\n\n// Creates the UI for a single Product type\nexport function ProductElem(props: IProductProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [sellOpen, setSellOpen] = useState(false);\n const [limitOpen, setLimitOpen] = useState(false);\n const [discontinueOpen, setDiscontinueOpen] = useState(false);\n const [cancelOpen, setCancelOpen] = useState(false);\n const [marketTaOpen, setMarketTaOpen] = useState(false);\n const city = props.city;\n const product = props.product;\n\n // Numeraljs formatters\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be big\n\n const hasUpgradeDashboard = division.hasResearch(\"uPgrade: Dashboard\");\n\n // Total product gain = production - sale\n const totalGain = product.data[city][1] - product.data[city][2];\n\n // Sell button\n let sellButtonText: JSX.Element;\n if (product.sllman[city][0]) {\n if (isString(product.sllman[city][1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/{product.sllman[city][1]})\n \n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(product.data[city][2], nfB)}/\n {numeralWrapper.format(product.sllman[city][1], nfB)})\n \n );\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000);\n }\n\n if (product.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (product.marketTa1) {\n const markupLimit = product.rat / product.mku;\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (product.sCost) {\n if (isString(product.sCost)) {\n const sCost = (product.sCost as string).replace(/MP/g, product.pCost + product.rat / product.mku + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n }\n }\n\n // Limit Production button\n let limitProductionButtonText = \"Limit Production\";\n if (product.prdman[city][0]) {\n limitProductionButtonText += \" (\" + numeralWrapper.format(product.prdman[city][1], nf) + \")\";\n }\n\n return (\n \n {!product.fin ? (\n <>\n \n Designing {product.name} (req. Operations/Engineers in {product.createCity})...\n \n
    \n {numeralWrapper.format(product.prog, \"0.00\")}% complete\n \n setCancelOpen(false)}\n />\n \n ) : (\n <>\n \n \n Prod: {numeralWrapper.format(product.data[city][1], nfB)}/s\n
    \n Sell: {numeralWrapper.format(product.data[city][2], nfB)} /s\n \n }\n >\n \n {product.name}: {numeralWrapper.format(product.data[city][0], nfB)} (\n {numeralWrapper.format(totalGain, nfB)}\n /s)\n \n \n
    \n \n \n Quality: {numeralWrapper.format(product.qlt, nf)}
    \n Performance: {numeralWrapper.format(product.per, nf)}
    \n Durability: {numeralWrapper.format(product.dur, nf)}
    \n Reliability: {numeralWrapper.format(product.rel, nf)}
    \n Aesthetics: {numeralWrapper.format(product.aes, nf)}
    \n Features: {numeralWrapper.format(product.fea, nf)}\n {corp.unlockUpgrades[2] === 1 &&
    }\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(product.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 &&
    }\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(product.cmp, nf)}\n \n }\n >\n Rating: {numeralWrapper.format(product.rat, nf)}\n \n
    \n \n An estimate of the material cost it takes to create this Product.}>\n \n Est. Production Cost:{\" \"}\n {numeralWrapper.formatMoney(product.pCost / CorporationConstants.ProductProductionCostRatio)}\n \n \n \n \n \n An estimate of how much consumers are willing to pay for this product. Setting the sale price above\n this may result in less sales. Setting the sale price below this may result in more sales.\n \n }\n >\n Est. Market Price: {numeralWrapper.formatMoney(product.pCost)}\n \n \n \n setDiscontinueOpen(false)}\n />\n \n )}\n\n {(hasUpgradeDashboard || product.fin) && (\n <>\n \n setSellOpen(false)} />\n
    \n \n setLimitOpen(false)}\n />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n \n setMarketTaOpen(false)} />\n \n )}\n \n )}\n
    \n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player discontinue a product\nexport function DiscontinueProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function discontinue(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n \n \n Are you sure you want to do this? Discontinuing a product removes it completely and permanently. You will no\n longer produce this product and all of its existing stock will be removed and left unsold\n \n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { Product } from \"../../Product\";\nimport { LimitProductProduction } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitProductProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState(null);\n\n // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\n\n function limitProductProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitProductProduction(props.product, props.city, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) limitProductProduction();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n \n \n Enter a limit to the amount of this product you would like to produce per second. Leave the box empty to set no\n limit.\n \n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Product } from \"../../Product\";\nimport { SellProduct } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\n\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\nfunction initialPrice(product: Product): string {\n let val = product.sCost ? product.sCost + \"\" : \"\";\n if (product.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (product.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n city: string;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellProductModal(props: IProps): React.ReactElement {\n const [checked, setChecked] = useState(true);\n const [iQty, setQty] = useState(\n props.product.sllman[props.city][1] ? props.product.sllman[props.city][1] : \"\",\n );\n const [px, setPx] = useState(initialPrice(props.product));\n\n function onCheckedChange(event: React.ChangeEvent): void {\n setChecked(event.target.checked);\n }\n\n function sellProduct(): void {\n try {\n SellProduct(props.product, props.city, iQty, px, checked);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent): void {\n setQty(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent): void {\n setPx(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) sellProduct();\n }\n\n return (\n \n \n Enter the maximum amount of {props.product.name} you would like to sell per second, as well as the price at\n which you would like to sell it at.\n
    \n
    \n If the sell amount is set to 0, then the product will not be sold. If the sell price is set to 0, then the\n product will be discarded.\n
    \n
    \n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n
    \n
    \n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-1' then you will always sell 1 less\n of the material than you produce.\n
    \n
    \n When setting the sell price, you can use the 'MP' variable to set a dynamically changing price that depends on\n the Product's estimated market price. For example, if you set it to 'MP*5' then it will always be sold at five\n times the estimated market price.\n
    \n
    \n \n \n \n }\n label={Use same 'Sell Amount' for all cities}\n />\n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface ITa2Props {\n product: Product;\n}\n\nfunction MarketTA2(props: ITa2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <>;\n const markupLimit = props.product.rat / props.product.mku;\n const [value, setValue] = useState(props.product.pCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent): void {\n setValue(parseFloat(event.target.value));\n }\n\n function onCheckedChange(event: React.ChangeEvent): void {\n props.product.marketTa2 = event.target.checked;\n rerender();\n }\n\n const sCost = value;\n let markup = 1;\n if (sCost > props.product.pCost) {\n if (sCost - props.product.pCost > markupLimit) {\n markup = markupLimit / (sCost - props.product.pCost);\n }\n }\n\n return (\n <>\n Market-TA.II\n
    \n \n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n \n \n
    \n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n \n }\n >\n Use Market-TA.II for Auto-Sale Price\n \n }\n />\n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n}\n\n// Create a popup that lets the player use the Market TA research for Products\nexport function ProductMarketTaModal(props: IProps): React.ReactElement {\n const markupLimit = props.product.rat / props.product.mku;\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onChange(event: React.ChangeEvent): void {\n props.product.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n \n <>\n Market-TA.I\n \n The maximum sale price you can mark this up to is{\" \"}\n {numeralWrapper.formatMoney(props.product.pCost + markupLimit)}. This means that if you set the sale price\n higher than this, you will begin to experience a loss in number of sales\n \n\n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n \n }\n >\n Use Market-TA.I for Auto-Sale Price\n \n }\n />\n \n\n \n \n );\n}\n","import React from \"react\";\n\nimport { Product } from \"../../Product\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n product: Product;\n rerender: () => void;\n}\n\n// Create a popup that lets the player cancel a product\nexport function CancelProductModal(props: IProps): React.ReactElement {\n const division = useDivision();\n function cancel(): void {\n division.discontinueProduct(props.product);\n props.onClose();\n props.rerender();\n }\n\n return (\n \n \n Are you sure you want to do this? Canceling a product removes it completely and permanently. You will receive no\n money back by doing so\n \n \n \n );\n}\n","// React Component for displaying an Industry's warehouse information\n// (right-side panel in the Industry UI)\nimport React, { useState } from \"react\";\n\nimport { OfficeSpace } from \"../OfficeSpace\";\nimport { Material } from \"../Material\";\nimport { Warehouse } from \"../Warehouse\";\nimport { ExportModal } from \"./modals/ExportModal\";\nimport { MaterialMarketTaModal } from \"./modals/MaterialMarketTaModal\";\nimport { SellMaterialModal } from \"./modals/SellMaterialModal\";\nimport { PurchaseMaterialModal } from \"./modals/PurchaseMaterialModal\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\nimport { isString } from \"../../utils/helpers/isString\";\nimport { Money } from \"../../ui/React/Money\";\nimport { useCorporation, useDivision } from \"./Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport { LimitMaterialProductionModal } from \"./modals/LimitMaterialProductionModal\";\n\ninterface IMaterialProps {\n warehouse: Warehouse;\n city: string;\n mat: Material;\n rerender: () => void;\n}\n\n// Creates the UI for a single Material type\nexport function MaterialElem(props: IMaterialProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const [purchaseMaterialOpen, setPurchaseMaterialOpen] = useState(false);\n const [exportOpen, setExportOpen] = useState(false);\n const [sellMaterialOpen, setSellMaterialOpen] = useState(false);\n const [materialMarketTaOpen, setMaterialMarketTaOpen] = useState(false);\n const [limitProductionOpen, setLimitProductionOpen] = useState(false);\n\n const warehouse = props.warehouse;\n const city = props.city;\n const mat = props.mat;\n const markupLimit = mat.getMarkupLimit();\n const office = division.offices[city];\n if (!(office instanceof OfficeSpace)) {\n throw new Error(`Could not get OfficeSpace object for this city (${city})`);\n }\n\n // Numeraljs formatter\n const nf = \"0.000\";\n const nfB = \"0.000a\"; // For numbers that might be biger\n\n // Total gain or loss of this material (per second)\n const totalGain = mat.buy + mat.prd + mat.imp - mat.sll - mat.totalExp;\n\n // Flag that determines whether this industry is \"new\" and the current material should be\n // marked with flashing-red lights\n const tutorial =\n division.newInd && Object.keys(division.reqMats).includes(mat.name) && mat.buy === 0 && mat.imp === 0;\n\n // Purchase material button\n const purchaseButtonText = `Buy (${numeralWrapper.format(mat.buy, nfB)})`;\n\n // Sell material button\n let sellButtonText: JSX.Element;\n if (mat.sllman[0]) {\n if (isString(mat.sllman[1])) {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{mat.sllman[1]})\n \n );\n } else {\n sellButtonText = (\n <>\n Sell ({numeralWrapper.format(mat.sll, nfB)}/{numeralWrapper.format(mat.sllman[1] as number, nfB)})\n \n );\n }\n\n if (mat.marketTa2) {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (mat.marketTa1) {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else if (mat.sCost) {\n if (isString(mat.sCost)) {\n const sCost = (mat.sCost as string).replace(/MP/g, mat.bCost + \"\");\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n } else {\n sellButtonText = (\n <>\n {sellButtonText} @ \n \n );\n }\n }\n } else {\n sellButtonText = <>Sell (0.000/0.000);\n }\n\n // Limit Production button\n let limitMaterialButtonText = \"Limit Material\";\n if (mat.prdman[0]) {\n limitMaterialButtonText += \" (\" + numeralWrapper.format(mat.prdman[1], nf) + \")\";\n }\n\n return (\n \n \n \n \n Buy: {numeralWrapper.format(mat.buy, nfB)}
    \n Prod: {numeralWrapper.format(mat.prd, nfB)}
    \n Sell: {numeralWrapper.format(mat.sll, nfB)}
    \n Export: {numeralWrapper.format(mat.totalExp, nfB)}
    \n Import: {numeralWrapper.format(mat.imp, nfB)}\n {corp.unlockUpgrades[2] === 1 &&
    }\n {corp.unlockUpgrades[2] === 1 && \"Demand: \" + numeralWrapper.format(mat.dmd, nf)}\n {corp.unlockUpgrades[3] === 1 &&
    }\n {corp.unlockUpgrades[3] === 1 && \"Competition: \" + numeralWrapper.format(mat.cmp, nf)}\n \n }\n >\n \n {mat.name}: {numeralWrapper.format(mat.qty, nfB)} ({numeralWrapper.format(totalGain, nfB)}/s)\n \n \n \n Market Price: The price you would pay if you were to buy this material on the market\n \n }\n >\n MP: {numeralWrapper.formatMoney(mat.bCost)}\n \n The quality of your material. Higher quality will lead to more sales}\n >\n Quality: {numeralWrapper.format(mat.qlt, \"0.00a\")}\n \n
    \n\n \n Purchase your required materials to get production started! : \"\"}\n >\n \n \n setPurchaseMaterialOpen(false)}\n />\n\n {corp.unlockUpgrades[0] === 1 && (\n <>\n \n\n setExportOpen(false)} />\n \n )}\n\n setSellMaterialOpen(true)}\n >\n {sellButtonText}\n \n setSellMaterialOpen(false)} />\n {division.hasResearch(\"Market-TA.I\") && (\n <>\n \n\n setMaterialMarketTaOpen(false)}\n />\n \n )}\n \n setLimitProductionOpen(false)}\n />\n \n
    \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Material } from \"../../Material\";\nimport { Export } from \"../../Export\";\nimport { IIndustry } from \"../../IIndustry\";\nimport { ExportMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\nimport { isRelevantMaterial } from \"../Helpers\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player manage exports\nexport function ExportModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const possibleDivisions = corp.divisions.filter((division: IIndustry) =>\n isRelevantMaterial(props.mat.name, division),\n );\n if (possibleDivisions.length === 0) throw new Error(\"Export popup created with no divisions.\");\n const defaultDivision = possibleDivisions[0];\n if (Object.keys(defaultDivision.warehouses).length === 0)\n throw new Error(\"Export popup created in a division with no warehouses.\");\n const [industry, setIndustry] = useState(defaultDivision.name);\n const [city, setCity] = useState(Object.keys(defaultDivision.warehouses)[0]);\n const [amt, setAmt] = useState(\"\");\n const setRerender = useState(false)[1];\n\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n function onCityChange(event: SelectChangeEvent): void {\n setCity(event.target.value);\n }\n\n function onIndustryChange(event: SelectChangeEvent): void {\n const div = event.target.value;\n setIndustry(div);\n setCity(Object.keys(corp.divisions[0].warehouses)[0]);\n }\n\n function onAmtChange(event: React.ChangeEvent): void {\n setAmt(event.target.value);\n }\n\n function exportMaterial(): void {\n try {\n ExportMaterial(industry, city, props.mat, amt, currentDivision);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function removeExport(exp: Export): void {\n for (let i = 0; i < props.mat.exp.length; ++i) {\n if (props.mat.exp[i].ind !== exp.ind || props.mat.exp[i].city !== exp.city || props.mat.exp[i].amt !== exp.amt)\n continue;\n props.mat.exp.splice(i, 1);\n break;\n }\n rerender();\n }\n\n const currentDivision = corp.divisions.find((division: IIndustry) => division.name === industry);\n if (currentDivision === undefined)\n throw new Error(`Export popup somehow ended up with undefined division '${currentDivision}'`);\n const possibleCities = Object.keys(currentDivision.warehouses).filter(\n (city) => currentDivision.warehouses[city] !== 0,\n );\n if (possibleCities.length > 0 && !possibleCities.includes(city)) {\n setCity(possibleCities[0]);\n }\n\n return (\n \n \n Select the industry and city to export this material to, as well as how much of this material to export per\n second. You can set the export amount to 'MAX' to export all of the materials in this warehouse.\n \n \n \n \n \n \n Below is a list of all current exports of this material from this warehouse. Clicking on one of the exports\n below will REMOVE that export.\n \n {props.mat.exp.map((exp: Export, index: number) => (\n \n \n \n Industry: {exp.ind}\n
    \n City: {exp.city}\n
    \n Amount/s: {exp.amt}\n
    \n
    \n ))}\n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { Material } from \"../../Material\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\nimport Switch from \"@mui/material/Switch\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IMarketTA2Props {\n mat: Material;\n}\n\nfunction MarketTA2(props: IMarketTA2Props): React.ReactElement {\n const division = useDivision();\n if (!division.hasResearch(\"Market-TA.II\")) return <>;\n const [newCost, setNewCost] = useState(props.mat.bCost);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setNewCost(0);\n else setNewCost(parseFloat(event.target.value));\n }\n\n const sCost = newCost;\n let markup = 1;\n if (sCost > props.mat.bCost) {\n //Penalty if difference between sCost and bCost is greater than markup limit\n if (sCost - props.mat.bCost > markupLimit) {\n markup = Math.pow(markupLimit / (sCost - props.mat.bCost), 2);\n }\n } else if (sCost < props.mat.bCost) {\n if (sCost <= 0) {\n markup = 1e12; //Sell everything, essentially discard\n } else {\n //Lower prices than market increases sales\n markup = props.mat.bCost / sCost;\n }\n }\n\n function onMarketTA2(event: React.ChangeEvent): void {\n props.mat.marketTa2 = event.target.checked;\n rerender();\n }\n\n return (\n <>\n Market-TA.II\n
    \n \n If you sell at {numeralWrapper.formatMoney(sCost)}, then you will sell{\" \"}\n {numeralWrapper.format(markup, \"0.00000\")}x as much compared to if you sold at market price.\n \n \n
    \n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the optimal price such that the\n amount sold matches the amount produced. (i.e. the highest possible price, while still ensuring that all\n produced materials will be sold)\n \n }\n >\n Use Market-TA.II for Auto-Sale Price\n \n }\n />\n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that lets the player use the Market TA research for Materials\nexport function MaterialMarketTaModal(props: IProps): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const markupLimit = props.mat.getMarkupLimit();\n\n function onMarketTA1(event: React.ChangeEvent): void {\n props.mat.marketTa1 = event.target.checked;\n rerender();\n }\n\n return (\n \n <>\n Market-TA.I\n \n The maximum sale price you can mark this up to is {numeralWrapper.formatMoney(props.mat.bCost + markupLimit)}.\n This means that if you set the sale price higher than this, you will begin to experience a loss in number of\n sales\n \n\n }\n label={\n \n If this is enabled, then this Material will automatically be sold at the price identified by\n Market-TA.I (i.e. the price shown above)\n \n }\n >\n Use Market-TA.I for Auto-Sale Price\n \n }\n />\n \n\n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Material } from \"../../Material\";\nimport { SellMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\nfunction initialPrice(mat: Material): string {\n let val = mat.sCost ? mat.sCost + \"\" : \"\";\n if (mat.marketTa2) {\n val += \" (Market-TA.II)\";\n } else if (mat.marketTa1) {\n val += \" (Market-TA.I)\";\n }\n return val;\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n}\n\n// Create a popup that let the player manage sales of a material\nexport function SellMaterialModal(props: IProps): React.ReactElement {\n const [amt, setAmt] = useState(props.mat.sllman[1] ? props.mat.sllman[1] + \"\" : \"\");\n const [price, setPrice] = useState(initialPrice(props.mat));\n\n function sellMaterial(): void {\n try {\n SellMaterial(props.mat, amt, price);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onAmtChange(event: React.ChangeEvent): void {\n setAmt(event.target.value);\n }\n\n function onPriceChange(event: React.ChangeEvent): void {\n setPrice(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) sellMaterial();\n }\n\n return (\n \n \n Enter the maximum amount of {props.mat.name} you would like to sell per second, as well as the price at which\n you would like to sell at.\n
    \n
    \n If the sell amount is set to 0, then the material will not be sold. If the sell price if set to 0, then the\n material will be discarded\n
    \n
    \n Setting the sell amount to 'MAX' will result in you always selling the maximum possible amount of the material.\n
    \n
    \n When setting the sell amount, you can use the 'PROD' variable to designate a dynamically changing amount that\n depends on your production. For example, if you set the sell amount to 'PROD-5' then you will always sell 5 less\n of the material than you produce.\n
    \n
    \n When setting the sell price, you can use the 'MP' variable to designate a dynamically changing price that\n depends on the market price. For example, if you set the sell price to 'MP+10' then it will always be sold at\n $10 above the market price.\n
    \n
    \n \n \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { MaterialSizes } from \"../../MaterialSizes\";\nimport { Warehouse } from \"../../Warehouse\";\nimport { Material } from \"../../Material\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { BulkPurchase, BuyMaterial } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation, useDivision } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IBulkPurchaseTextProps {\n warehouse: Warehouse;\n mat: Material;\n amount: string;\n}\n\ninterface IBPProps {\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n}\n\nfunction BulkPurchaseSection(props: IBPProps): React.ReactElement {\n const corp = useCorporation();\n const [buyAmt, setBuyAmt] = useState(\"\");\n const [disabled, setDisabled] = useState(false);\n\n function BulkPurchaseText(props: IBulkPurchaseTextProps): React.ReactElement {\n const parsedAmt = parseFloat(props.amount);\n const cost = parsedAmt * props.mat.bCost;\n\n const matSize = MaterialSizes[props.mat.name];\n const maxAmount = (props.warehouse.size - props.warehouse.sizeUsed) / matSize;\n\n if (parsedAmt > maxAmount) {\n setDisabled(true);\n return (\n <>\n Not enough warehouse space to purchase this amount\n \n );\n } else if (isNaN(cost) || parsedAmt < 0) {\n setDisabled(true);\n return (\n <>\n Invalid input for Bulk Purchase amount\n \n );\n } else {\n setDisabled(false);\n return (\n <>\n \n Purchasing {numeralWrapper.format(parsedAmt, \"0,0.00\")} of {props.mat.name} will cost{\" \"}\n {numeralWrapper.formatMoney(cost)}\n \n \n );\n }\n }\n\n function bulkPurchase(): void {\n try {\n BulkPurchase(corp, props.warehouse, props.mat, parseFloat(buyAmt));\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) bulkPurchase();\n }\n\n function onChange(event: React.ChangeEvent): void {\n setBuyAmt(event.target.value);\n }\n\n return (\n <>\n \n Enter the amount of {props.mat.name} you would like to bulk purchase. This purchases the specified amount\n instantly (all at once).\n \n \n \n \n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n mat: Material;\n warehouse: Warehouse;\n disablePurchaseLimit: boolean;\n}\n\n// Create a popup that lets the player purchase a Material\nexport function PurchaseMaterialModal(props: IProps): React.ReactElement {\n const division = useDivision();\n const [buyAmt, setBuyAmt] = useState(props.mat.buy ? props.mat.buy : 0);\n\n function purchaseMaterial(): void {\n if (buyAmt === null) return;\n try {\n BuyMaterial(props.mat, buyAmt);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function clearPurchase(): void {\n props.mat.buy = 0;\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) purchaseMaterial();\n }\n\n function onChange(event: React.ChangeEvent): void {\n setBuyAmt(parseFloat(event.target.value));\n }\n\n return (\n \n <>\n \n Enter the amount of {props.mat.name} you would like to purchase per second. This material's cost changes\n constantly.\n {props.disablePurchaseLimit ? \"Note: Purchase amount is disabled as smart supply is enabled\" : \"\"}\n \n \n \n \n {division.hasResearch(\"Bulk Purchasing\") && (\n \n )}\n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { LimitMaterialProduction } from \"../../Actions\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { Material } from \"../../Material\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n material: Material;\n}\n\n// Create a popup that lets the player limit the production of a product\nexport function LimitMaterialProductionModal(props: IProps): React.ReactElement {\n const [limit, setLimit] = useState(null);\n\n // reset modal internal state on modal close\n useEffect(() => {\n if (!props.open) {\n setLimit(null);\n }\n }, [props.open]);\n\n function limitMaterialProduction(): void {\n let qty = limit;\n if (qty === null) qty = -1;\n LimitMaterialProduction(props.material, qty);\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) limitMaterialProduction();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setLimit(null);\n else setLimit(parseFloat(event.target.value));\n }\n\n return (\n \n \n Enter a limit to the amount of this material you would like to produce per second. Leave the box empty to set no\n limit.\n \n \n \n \n );\n}\n","import React from \"react\";\nimport { IIndustry } from \"../IIndustry\";\nimport { MathJaxWrapper } from \"../../MathJaxWrapper\";\n\ninterface IProps {\n division: IIndustry;\n}\n\nexport function IndustryProductEquation(props: IProps): React.ReactElement {\n const reqs = [];\n for (const reqMat of Object.keys(props.division.reqMats)) {\n const reqAmt = props.division.reqMats[reqMat];\n if (reqAmt === undefined) continue;\n reqs.push(String.raw`${reqAmt}\\text{ }${reqMat}`);\n }\n const prod = props.division.prodMats.map((p) => `1\\\\text{ }${p}`);\n if (props.division.makesProducts) {\n prod.push(\"Products\");\n }\n\n return {\"\\\\(\" + reqs.join(\"+\") + `\\\\Rightarrow ` + prod.join(\"+\") + \"\\\\)\"};\n}\n","import React, { useState } from \"react\";\nimport { CorporationConstants } from \"../data/Constants\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { NewCity } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation, useDivision } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n cityStateSetter: (city: string) => void;\n}\n\nexport function ExpandNewCity(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const division = useDivision();\n const possibleCities = Object.keys(division.offices).filter((cityName: string) => division.offices[cityName] === 0);\n const [city, setCity] = useState(possibleCities[0]);\n\n const disabled = corp.funds < CorporationConstants.OfficeInitialCost;\n\n function onCityChange(event: SelectChangeEvent): void {\n setCity(event.target.value);\n }\n\n function expand(): void {\n try {\n NewCity(corp, division, city);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n dialogBoxCreate(`Opened a new office in ${city}!`);\n\n props.cityStateSetter(city);\n }\n return (\n <>\n \n Would you like to expand into a new city by opening an office? This would cost{\" \"}\n \n \n \n Confirm\n \n }\n value={city}\n onChange={onCityChange}\n >\n {possibleCities.map((cityName: string) => (\n \n {cityName}\n \n ))}\n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { IndustryStartingCosts, Industries, IndustryDescriptions } from \"../IndustryData\";\nimport { useCorporation } from \"./Context\";\nimport { IIndustry } from \"../IIndustry\";\nimport { NewIndustry } from \"../Actions\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\n\ninterface IProps {\n setDivisionName: (name: string) => void;\n}\n\nexport function ExpandIndustryTab(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const allIndustries = Object.keys(Industries).sort();\n const possibleIndustries = allIndustries\n .filter(\n (industryType: string) =>\n corp.divisions.find((division: IIndustry) => division.type === industryType) === undefined,\n )\n .sort();\n const [industry, setIndustry] = useState(possibleIndustries.length > 0 ? possibleIndustries[0] : \"\");\n const [name, setName] = useState(\"\");\n\n const cost = IndustryStartingCosts[industry];\n if (cost === undefined) {\n throw new Error(`Invalid industry: '${industry}'`);\n }\n const disabled = corp.funds < cost || name === \"\";\n\n function newIndustry(): void {\n if (disabled) return;\n try {\n NewIndustry(corp, industry, name);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n return;\n }\n\n // Set routing to the new division so that the UI automatically switches to it\n props.setDivisionName(name);\n }\n\n function onNameChange(event: React.ChangeEvent): void {\n // [a-zA-Z0-9-_]\n setName(event.target.value);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) newIndustry();\n }\n\n function onIndustryChange(event: SelectChangeEvent): void {\n setIndustry(event.target.value);\n }\n\n const desc = IndustryDescriptions[industry];\n if (desc === undefined) throw new Error(`Trying to create an industry that doesn't exists: '${industry}'`);\n\n return (\n <>\n Create a new division to expand into a new industry:\n \n {desc(corp)}\n
    \n
    \n\n Division name:\n\n \n \n Expand\n \n ),\n }}\n />\n \n \n );\n}\n","// React Component for displaying Corporation Overview info\nimport React, { useState } from \"react\";\nimport { LevelableUpgrade } from \"./LevelableUpgrade\";\nimport { UnlockUpgrade } from \"./UnlockUpgrade\";\nimport { BribeFactionModal } from \"./modals/BribeFactionModal\";\nimport { SellSharesModal } from \"./modals/SellSharesModal\";\nimport { BuybackSharesModal } from \"./modals/BuybackSharesModal\";\nimport { IssueDividendsModal } from \"./modals/IssueDividendsModal\";\nimport { IssueNewSharesModal } from \"./modals/IssueNewSharesModal\";\nimport { FindInvestorsModal } from \"./modals/FindInvestorsModal\";\nimport { GoPublicModal } from \"./modals/GoPublicModal\";\nimport { Factions } from \"../../Faction/Factions\";\n\nimport { CorporationConstants } from \"../data/Constants\";\nimport { CorporationUnlockUpgrade, CorporationUnlockUpgrades } from \"../data/CorporationUnlockUpgrades\";\nimport { CorporationUpgrade, CorporationUpgradeIndex, CorporationUpgrades } from \"../data/CorporationUpgrades\";\n\nimport { CONSTANTS } from \"../../Constants\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { StatsTable } from \"../../ui/React/StatsTable\";\nimport { use } from \"../../ui/Context\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Paper from \"@mui/material/Paper\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n rerender: () => void;\n}\nexport function Overview({ rerender }: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const profit: number = corp.revenue - corp.expenses;\n\n const multRows: string[][] = [];\n function appendMult(name: string, value: number): void {\n if (value === 1) return;\n multRows.push([name, numeralWrapper.format(value, \"0.000\")]);\n }\n appendMult(\"Production Multiplier: \", corp.getProductionMultiplier());\n appendMult(\"Storage Multiplier: \", corp.getStorageMultiplier());\n appendMult(\"Advertising Multiplier: \", corp.getAdvertisingMultiplier());\n appendMult(\"Empl. Creativity Multiplier: \", corp.getEmployeeCreMultiplier());\n appendMult(\"Empl. Charisma Multiplier: \", corp.getEmployeeChaMultiplier());\n appendMult(\"Empl. Intelligence Multiplier: \", corp.getEmployeeIntMultiplier());\n appendMult(\"Empl. Efficiency Multiplier: \", corp.getEmployeeEffMultiplier());\n appendMult(\"Sales Multiplier: \", corp.getSalesMultiplier());\n appendMult(\"Scientific Research Multiplier: \", corp.getScientificResearchMultiplier());\n\n return (\n <>\n ],\n [\"Total Revenue:\", ],\n [\"Total Expenses:\", ],\n [\"Total Profit:\", ],\n [\"Publicly Traded:\", corp.public ? \"Yes\" : \"No\"],\n [\"Owned Stock Shares:\", numeralWrapper.format(corp.numShares, \"0.000a\")],\n [\"Stock Price:\", corp.public ? : \"N/A\"],\n ]}\n />\n
    \n \n \n }\n >\n Total Stock Shares: {numeralWrapper.format(corp.totalShares, \"0.000a\")}\n \n \n
    \n \n
    \n \n
    \n \n \n \n Get a copy of and read 'The Complete Handbook for Creating a Successful Corporation.' This is a .lit file\n that guides you through the beginning of setting up a Corporation and provides some tips/pointers for\n helping you get started with managing it.\n \n }\n >\n \n \n {corp.public ? : }\n \n \n
    \n \n \n );\n}\n\ninterface IPrivateButtonsProps {\n rerender: () => void;\n}\n// Render the buttons for when your Corporation is still private\nfunction PrivateButtons({ rerender }: IPrivateButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [findInvestorsopen, setFindInvestorsopen] = useState(false);\n const [goPublicopen, setGoPublicopen] = useState(false);\n\n const fundingAvailable = corp.fundingRound < 4;\n const findInvestorsTooltip = fundingAvailable\n ? \"Search for private investors who will give you startup funding in exchange for equity (stock shares) in your company\"\n : \"\";\n\n return (\n <>\n {findInvestorsTooltip}}>\n \n \n \n Become a publicly traded and owned entity. Going public involves issuing shares for an IPO. Once you are a\n public company, your shares will be traded on the stock market.\n \n }\n >\n \n \n setFindInvestorsopen(false)} rerender={rerender} />\n setGoPublicopen(false)} rerender={rerender} />\n \n );\n}\n\ninterface IUpgradeProps {\n rerender: () => void;\n}\n// Render the UI for Corporation upgrades\nfunction Upgrades({ rerender }: IUpgradeProps): React.ReactElement {\n const corp = useCorporation();\n // Don't show upgrades\n if (corp.divisions.length <= 0) {\n return Upgrades are unlocked once you create an industry.;\n }\n\n return (\n <>\n \n Unlocks\n \n {Object.values(CorporationUnlockUpgrades)\n .filter((upgrade: CorporationUnlockUpgrade) => !corp.unlockUpgrades[upgrade.index])\n .map((upgrade: CorporationUnlockUpgrade) => (\n \n ))}\n \n \n \n Upgrades\n \n {corp.upgrades\n .map((level: number, i: number) => CorporationUpgrades[i as CorporationUpgradeIndex])\n .map((upgrade: CorporationUpgrade) => (\n \n ))}\n \n \n \n );\n}\n\ninterface IPublicButtonsProps {\n rerender: () => void;\n}\n\n// Render the buttons for when your Corporation has gone public\nfunction PublicButtons({ rerender }: IPublicButtonsProps): React.ReactElement {\n const corp = useCorporation();\n const [sellSharesOpen, setSellSharesOpen] = useState(false);\n const [buybackSharesOpen, setBuybackSharesOpen] = useState(false);\n const [issueNewSharesOpen, setIssueNewSharesOpen] = useState(false);\n const [issueDividendsOpen, setIssueDividendsOpen] = useState(false);\n\n const sellSharesOnCd = corp.shareSaleCooldown > 0;\n const sellSharesTooltip = sellSharesOnCd\n ? \"Cannot sell shares for \" + corp.convertCooldownToString(corp.shareSaleCooldown)\n : \"Sell your shares in the company. The money earned from selling your \" +\n \"shares goes into your personal account, not the Corporation's. \" +\n \"This is one of the only ways to profit from your business venture.\";\n\n const issueNewSharesOnCd = corp.issueNewSharesCooldown > 0;\n const issueNewSharesTooltip = issueNewSharesOnCd\n ? \"Cannot issue new shares for \" + corp.convertCooldownToString(corp.issueNewSharesCooldown)\n : \"Issue new equity shares to raise capital.\";\n\n return (\n <>\n {sellSharesTooltip}}>\n \n \n setSellSharesOpen(false)} rerender={rerender} />\n Buy back shares you that previously issued or sold at market price.}>\n \n \n setBuybackSharesOpen(false)} rerender={rerender} />\n {issueNewSharesTooltip}}>\n \n \n setIssueNewSharesOpen(false)} />\n Manage the dividends that are paid out to shareholders (including yourself)}\n >\n \n \n setIssueDividendsOpen(false)} />\n \n );\n}\n\nfunction BribeButton(): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [open, setOpen] = useState(false);\n const canBribe =\n corp.determineValuation() >= CorporationConstants.BribeThreshold &&\n player.factions.filter((f) => Factions[f].getInfo().offersWork()).length > 0;\n\n function openBribe(): void {\n if (!canBribe) return;\n setOpen(true);\n }\n\n return (\n <>\n \n \n \n setOpen(false)} />\n \n );\n}\n\ninterface IDividendsStatsProps {\n profit: number;\n}\nfunction DividendsStats({ profit }: IDividendsStatsProps): React.ReactElement {\n const corp = useCorporation();\n if (corp.dividendRate <= 0 || profit <= 0) return <>;\n const totalDividends = corp.dividendRate * profit;\n const retainedEarnings = profit - totalDividends;\n const dividendsPerShare = totalDividends / corp.totalShares;\n const playerEarnings = corp.getCycleDividends() / CorporationConstants.SecsPerMarketCycle;\n return (\n ],\n [\"Dividend Percentage:\", numeralWrapper.format(corp.dividendRate, \"0%\")],\n [\"Dividends per share:\", ],\n [\"Your earnings as a shareholder:\", ],\n ]}\n />\n );\n}\n\n// Returns a string with general information about Corporation\nfunction BonusTime(): React.ReactElement {\n const corp = useCorporation();\n const storedTime = corp.storedCycles * CONSTANTS.MilliPerCycle;\n if (storedTime <= 15000) return <>;\n return (\n \n Bonus time: {convertTimeMsToTimeElapsedString(storedTime)}\n
    \n
    \n
    \n );\n}\n","// React components for the levelable upgrade buttons on the overview panel\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUpgrade } from \"../data/CorporationUpgrades\";\nimport { LevelUpgrade } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport { useCorporation } from \"./Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgrade: CorporationUpgrade;\n rerender: () => void;\n}\n\nexport function LevelableUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgrade;\n const level = corp.upgrades[data.index];\n\n const baseCost = data.basePrice;\n const priceMult = data.priceMult;\n const cost = baseCost * Math.pow(priceMult, level);\n\n const tooltip = data.desc;\n function onClick(): void {\n if (corp.funds < cost) return;\n try {\n LevelUpgrade(corp, props.upgrade);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n \n \n \n \n \n {data.name} - lvl {level}\n \n \n \n \n );\n}\n","// React Components for the Unlock upgrade buttons on the overview page\nimport React from \"react\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CorporationUnlockUpgrade } from \"../data/CorporationUnlockUpgrades\";\nimport { useCorporation } from \"./Context\";\nimport { UnlockUpgrade as UU } from \"../Actions\";\nimport { MoneyCost } from \"./MoneyCost\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Button from \"@mui/material/Button\";\nimport Box from \"@mui/material/Box\";\nimport Grid from \"@mui/material/Grid\";\n\ninterface IProps {\n upgradeData: CorporationUnlockUpgrade;\n rerender: () => void;\n}\n\nexport function UnlockUpgrade(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const data = props.upgradeData;\n const tooltip = data.desc;\n function onClick(): void {\n if (corp.funds < data.price) return;\n try {\n UU(corp, props.upgradeData);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.rerender();\n }\n\n return (\n \n \n \n \n {data.name}\n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Box from \"@mui/material/Box\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function BribeFactionModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const factions = player.factions.filter((name: string) => {\n const info = Factions[name].getInfo();\n if (!info.offersWork()) return false;\n if (player.hasGangWith(name)) return false;\n return true;\n });\n const corp = useCorporation();\n const [money, setMoney] = useState(NaN);\n const [selectedFaction, setSelectedFaction] = useState(factions.length > 0 ? factions[0] : \"\");\n const disabled = money === 0 || isNaN(money) || money < 0 || corp.funds < money;\n\n function changeFaction(event: SelectChangeEvent): void {\n setSelectedFaction(event.target.value);\n }\n\n function repGain(money: number): number {\n return money / CorporationConstants.BribeToRepRatio;\n }\n\n function getRepText(money: number): string {\n if (money === 0) return \"\";\n if (isNaN(money) || money < 0) {\n return \"ERROR: Invalid value(s) entered\";\n } else if (corp.funds < money) {\n return \"ERROR: You do not have this much money to bribe with\";\n } else {\n return (\n \"You will gain \" +\n numeralWrapper.formatReputation(repGain(money)) +\n \" reputation with \" +\n selectedFaction +\n \" with this bribe\"\n );\n }\n }\n\n function bribe(money: number): void {\n const fac = Factions[selectedFaction];\n if (disabled) return;\n const rep = repGain(money);\n dialogBoxCreate(\n \"You gained \" + numeralWrapper.formatReputation(rep) + \" reputation with \" + fac.name + \" by bribing them.\",\n );\n fac.playerReputation += rep;\n corp.funds = corp.funds - money;\n props.onClose();\n }\n\n return (\n \n \n You can use Corporation funds or stock shares to bribe Faction Leaders in exchange for faction reputation.\n \n \n Faction:\n \n \n {getRepText(money ? money : 0)}\n \n \n \n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport { ICorporation } from \"../../ICorporation\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { SellShares } from \"../../Actions\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player sell Corporation shares\n// This is created when the player clicks the \"Sell Shares\" button in the overview panel\nexport function SellSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n\n const disabled = isNaN(shares) || shares <= 0 || shares > corp.numShares;\n\n function ProfitIndicator(props: { shares: number | null; corp: ICorporation }): React.ReactElement {\n if (props.shares === null) return <>;\n let text = \"\";\n if (isNaN(props.shares) || props.shares <= 0) {\n text = `ERROR: Invalid value entered for number of shares to sell`;\n } else if (props.shares > corp.numShares) {\n text = `You don't have this many shares to sell!`;\n } else {\n const stockSaleResults = corp.calculateShareSale(props.shares);\n const profit = stockSaleResults[0];\n text = `Sell ${props.shares} shares for a total of ${numeralWrapper.formatMoney(profit)}`;\n }\n\n return (\n \n {text}\n \n );\n }\n\n function sell(): void {\n if (disabled) return;\n try {\n const profit = SellShares(corp, player, shares);\n props.onClose();\n dialogBoxCreate(\n <>\n Sold {numeralWrapper.formatMoney(shares)} shares for\n . The corporation's stock price fell to  \n as a result of dilution.\n ,\n );\n\n props.rerender();\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) sell();\n }\n\n return (\n \n \n Enter the number of shares you would like to sell. The money from selling your shares will go directly to you\n (NOT your Corporation).\n
    \n
    \n Selling your shares will cause your corporation's stock price to fall due to dilution. Furthermore, selling a\n large number of shares all at once will have an immediate effect in reducing your stock price.\n
    \n
    \n The current price of your company's stock is {numeralWrapper.formatMoney(corp.sharePrice)}\n
    \n
    \n \n \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { use } from \"../../../ui/Context\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport { BuyBackShares } from \"../../Actions\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player buyback shares\n// This is created when the player clicks the \"Buyback Shares\" button in the overview panel\nexport function BuybackSharesModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n\n const currentStockPrice = corp.sharePrice;\n const buybackPrice = currentStockPrice * 1.1;\n const disabled =\n shares === null ||\n isNaN(shares) ||\n shares <= 0 ||\n shares > corp.issuedShares ||\n shares * buybackPrice > player.money;\n\n function buy(): void {\n if (disabled) return;\n try {\n BuyBackShares(corp, player, shares);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n props.onClose();\n props.rerender();\n }\n\n function CostIndicator(): React.ReactElement {\n if (shares === null) return <>;\n if (isNaN(shares) || shares <= 0) {\n return <>ERROR: Invalid value entered for number of shares to buyback;\n } else if (shares > corp.issuedShares) {\n return (\n <>\n There are not this many shares available to buy back. There are only{\" \"}\n {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding shares.\n \n );\n } else {\n return (\n <>\n Purchase {shares} shares for a total of {numeralWrapper.formatMoney(shares * buybackPrice)}\n \n );\n }\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) buy();\n }\n\n return (\n \n \n Enter the number of outstanding shares you would like to buy back. These shares must be bought at a 10% premium.\n However, repurchasing shares from the market tends to lead to an increase in stock price.\n
    \n
    \n To purchase these shares, you must use your own money (NOT your Corporation's funds).\n
    \n
    \n The current buyback price of your company's stock is {numeralWrapper.formatMoney(buybackPrice)}. Your company\n currently has {numeralWrapper.formatBigNumber(corp.issuedShares)} outstanding stock shares.\n
    \n \n
    \n \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { IssueDividends } from \"../../Actions\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport TextField from \"@mui/material/TextField\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue & manage dividends\n// This is created when the player clicks the \"Issue Dividends\" button in the overview panel\nexport function IssueDividendsModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [percent, setPercent] = useState(0);\n\n const canIssue = !isNaN(percent) && percent >= 0 && percent <= CorporationConstants.DividendMaxRate * 100;\n function issueDividends(): void {\n if (!canIssue) return;\n if (percent === null) return;\n try {\n IssueDividends(corp, percent / 100);\n } catch (err) {\n dialogBoxCreate(err + \"\");\n }\n\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) issueDividends();\n }\n\n function onChange(event: React.ChangeEvent): void {\n if (event.target.value === \"\") setPercent(0);\n else {\n let p = parseFloat(event.target.value);\n if (p > 100) p = 100;\n if (p < 0) p = 0;\n setPercent(p);\n }\n }\n\n return (\n \n \n Dividends are a distribution of a portion of the corporation's profits to the shareholders. This includes\n yourself, as well.\n
    \n
    \n In order to issue dividends, simply allocate some percentage of your corporation's profits to dividends. This\n percentage must be an integer between 0 and 100. (A percentage of 0 means no dividends will be issued)\n
    \n
    \n Two important things to note:\n
    \n * Issuing dividends will negatively affect your corporation's stock price\n
    \n
    \n Example: Assume your corporation makes $100m / sec in profit and you allocate 40% of that towards dividends.\n That means your corporation will gain $60m / sec in funds and the remaining $40m / sec will be paid as\n dividends. Since your corporation starts with 1 billion shares, every shareholder will be paid $0.04 per share\n per second before taxes.\n
    \n \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { getRandomInt } from \"../../../utils/helpers/getRandomInt\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Button from \"@mui/material/Button\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IEffectTextProps {\n shares: number | null;\n}\n\nfunction EffectText(props: IEffectTextProps): React.ReactElement {\n const corp = useCorporation();\n if (props.shares === null) return <>;\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n let newShares = props.shares;\n if (isNaN(newShares)) {\n return Invalid input;\n }\n\n // Round to nearest ten-millionth\n newShares /= 10e6;\n newShares = Math.round(newShares) * 10e6;\n\n if (newShares < 10e6) {\n return Must issue at least 10 million new shares;\n }\n\n if (newShares > maxNewShares) {\n return You cannot issue that many shares;\n }\n\n return (\n \n Issue {numeralWrapper.format(newShares, \"0.000a\")} new shares for{\" \"}\n {numeralWrapper.formatMoney(newShares * newSharePrice)}?\n \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\n// Create a popup that lets the player issue new shares\n// This is created when the player clicks the \"Issue New Shares\" buttons in the overview panel\nexport function IssueNewSharesModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n const maxNewSharesUnrounded = Math.round(corp.totalShares * 0.2);\n const maxNewShares = maxNewSharesUnrounded - (maxNewSharesUnrounded % 1e6);\n\n const newShares = Math.round((shares || 0) / 10e6) * 10e6;\n const disabled = isNaN(shares) || isNaN(newShares) || newShares < 10e6 || newShares > maxNewShares;\n\n function issueNewShares(): void {\n if (isNaN(shares)) return;\n if (disabled) return;\n\n const newSharePrice = Math.round(corp.sharePrice * 0.9);\n let newShares = shares;\n\n // Round to nearest ten-millionth\n newShares = Math.round(newShares / 10e6) * 10e6;\n\n const profit = newShares * newSharePrice;\n corp.issueNewSharesCooldown = CorporationConstants.IssueNewSharesCooldown;\n\n // Determine how many are bought by private investors\n // If private investors own n% of the company, private investors get up to 0.5n% at most\n // Round # of private shares to the nearest million\n const privateOwnedRatio = 1 - (corp.numShares + corp.issuedShares) / corp.totalShares;\n const maxPrivateShares = Math.round((newShares / 2) * privateOwnedRatio);\n const privateShares = Math.round(getRandomInt(0, maxPrivateShares) / 1e6) * 1e6;\n\n corp.issuedShares += newShares - privateShares;\n corp.totalShares += newShares;\n corp.funds = corp.funds + profit;\n corp.immediatelyUpdateSharePrice();\n props.onClose();\n\n let dialogContents =\n `Issued ${numeralWrapper.format(newShares, \"0.000a\")} new shares` +\n ` and raised ${numeralWrapper.formatMoney(profit)}.`;\n if (privateShares > 0) {\n dialogContents += `
    ${numeralWrapper.format(\n privateShares,\n \"0.000a\",\n )} of these shares were bought by private investors.`;\n }\n dialogContents += `

    Stock price decreased to ${numeralWrapper.formatMoney(corp.sharePrice)}`;\n dialogBoxCreate(dialogContents);\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) issueNewShares();\n }\n\n return (\n \n \n You can issue new equity shares (i.e. stocks) in order to raise capital for your corporation.\n
    \n
    \n  * You can issue at most {numeralWrapper.formatMoney(maxNewShares)} new shares\n
    \n  * New shares are sold at a 10% discount\n
    \n  * You can only issue new shares once every 12 hours\n
    \n  * Issuing new shares causes dilution, resulting in a decrease in stock price and lower dividends per share\n
    \n  * Number of new shares issued must be a multiple of 10 million\n
    \n
    \n When you choose to issue new equity, private shareholders have first priority for up to 0.5n% of the new shares,\n where n is the percentage of the company currently owned by private shareholders. If they choose to exercise\n this option, these newly issued shares become private, restricted shares, which means you cannot buy them back.\n
    \n \n \n \n
    \n );\n}\n","import React from \"react\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { CorporationConstants } from \"../../data/Constants\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { useCorporation } from \"../Context\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function FindInvestorsModal(props: IProps): React.ReactElement {\n const corporation = useCorporation();\n const val = corporation.determineValuation();\n if (\n corporation.fundingRound >= CorporationConstants.FundingRoundShares.length ||\n corporation.fundingRound >= CorporationConstants.FundingRoundMultiplier.length\n )\n return <>;\n const percShares = CorporationConstants.FundingRoundShares[corporation.fundingRound];\n const roundMultiplier = CorporationConstants.FundingRoundMultiplier[corporation.fundingRound];\n const funding = val * percShares * roundMultiplier;\n const investShares = Math.floor(CorporationConstants.INITIALSHARES * percShares);\n\n function findInvestors(): void {\n corporation.fundingRound++;\n corporation.addFunds(funding);\n corporation.numShares -= investShares;\n props.rerender();\n props.onClose();\n }\n return (\n \n \n An investment firm has offered you {numeralWrapper.formatMoney(funding)} in funding in exchange for a{\" \"}\n {numeralWrapper.format(percShares * 100, \"0.000a\")}% stake in the company (\n {numeralWrapper.format(investShares, \"0.000a\")} shares).\n
    \n
    \n Do you accept or reject this offer?\n
    \n
    \n Hint: Investment firms will offer more money if your corporation is turning a profit\n
    \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { useCorporation } from \"../Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport { NumberInput } from \"../../../ui/React/NumberInput\";\nimport Box from \"@mui/material/Box\";\nimport { KEY } from \"../../../utils/helpers/keyCodes\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n rerender: () => void;\n}\n\n// Create a popup that lets the player manage exports\nexport function GoPublicModal(props: IProps): React.ReactElement {\n const corp = useCorporation();\n const [shares, setShares] = useState(NaN);\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n\n function goPublic(): void {\n const initialSharePrice = corp.determineValuation() / corp.totalShares;\n if (isNaN(shares)) {\n dialogBoxCreate(\"Invalid value for number of issued shares\");\n return;\n }\n if (shares > corp.numShares) {\n dialogBoxCreate(\"Error: You don't have that many shares to issue!\");\n return;\n }\n corp.public = true;\n corp.sharePrice = initialSharePrice;\n corp.issuedShares = shares;\n corp.numShares -= shares;\n corp.addFunds(shares * initialSharePrice);\n props.rerender();\n dialogBoxCreate(\n `You took your ${corp.name} public and earned ` +\n `${numeralWrapper.formatMoney(shares * initialSharePrice)} in your IPO`,\n );\n props.onClose();\n }\n\n function onKeyDown(event: React.KeyboardEvent): void {\n if (event.key === KEY.ENTER) goPublic();\n }\n\n return (\n \n \n Enter the number of shares you would like to issue for your IPO. These shares will be publicly sold and you will\n no longer own them. Your Corporation will receive {numeralWrapper.formatMoney(initialSharePrice)} per share (the\n IPO money will be deposited directly into your Corporation's funds).\n
    \n
    \n You have a total of {numeralWrapper.format(corp.numShares, \"0.000a\")} of shares that you can issue.\n
    \n \n \n \n \n
    \n );\n}\n","import React, { useState } from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { use } from \"../../ui/Context\";\nimport { calculateDifficulty, calculateReward } from \"../formulas/game\";\nimport { Game } from \"./Game\";\nimport { Intro } from \"./Intro\";\ninterface IProps {\n location: Location;\n}\n\nexport function InfiltrationRoot(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [start, setStart] = useState(false);\n\n if (props.location.infiltrationData === undefined) throw new Error(\"Trying to do infiltration on invalid location.\");\n const startingSecurityLevel = props.location.infiltrationData.startingSecurityLevel;\n const difficulty = calculateDifficulty(player, startingSecurityLevel);\n const reward = calculateReward(player, startingSecurityLevel);\n\n function cancel(): void {\n router.toCity();\n }\n\n return (\n
    \n {start ? (\n \n ) : (\n setStart(true)}\n cancel={cancel}\n />\n )}\n
    \n );\n}\n","import { Button, Container, Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { use } from \"../../ui/Context\";\nimport { BackwardGame } from \"./BackwardGame\";\nimport { BracketGame } from \"./BracketGame\";\nimport { BribeGame } from \"./BribeGame\";\nimport { CheatCodeGame } from \"./CheatCodeGame\";\nimport { Countdown } from \"./Countdown\";\nimport { Cyberpunk2077Game } from \"./Cyberpunk2077Game\";\nimport { MinesweeperGame } from \"./MinesweeperGame\";\nimport { SlashGame } from \"./SlashGame\";\nimport { Victory } from \"./Victory\";\nimport { WireCuttingGame } from \"./WireCuttingGame\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nenum Stage {\n Countdown = 0,\n Minigame,\n Result,\n Sell,\n}\n\nconst minigames = [\n SlashGame,\n BracketGame,\n BackwardGame,\n BribeGame,\n CheatCodeGame,\n Cyberpunk2077Game,\n MinesweeperGame,\n WireCuttingGame,\n];\n\nexport function Game(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [level, setLevel] = useState(1);\n const [stage, setStage] = useState(Stage.Countdown);\n const [results, setResults] = useState(\"\");\n const [gameIds, setGameIds] = useState({\n lastGames: [-1, -1],\n id: Math.floor(Math.random() * minigames.length),\n });\n\n function nextGameId(): number {\n let id = gameIds.lastGames[0];\n const ids = [gameIds.lastGames[0], gameIds.lastGames[1], gameIds.id];\n while (ids.includes(id)) {\n id = Math.floor(Math.random() * minigames.length);\n }\n return id;\n }\n\n function setupNextGame(): void {\n setGameIds({\n lastGames: [gameIds.lastGames[1], gameIds.id],\n id: nextGameId(),\n });\n }\n\n function success(): void {\n pushResult(true);\n if (level === props.MaxLevel) {\n setStage(Stage.Sell);\n } else {\n setStage(Stage.Countdown);\n setLevel(level + 1);\n }\n setupNextGame();\n }\n\n function pushResult(win: boolean): void {\n setResults((old) => {\n let next = old;\n next += win ? \"✓\" : \"✗\";\n if (next.length > 15) next = next.slice(1);\n return next;\n });\n }\n\n function failure(options?: { automated: boolean }): void {\n setStage(Stage.Countdown);\n pushResult(false);\n // Kill the player immediately if they use automation, so\n // it's clear they're not meant to\n const damage = options?.automated\n ? player.hp.current\n : props.StartingDifficulty * 3 * (player.hasAugmentation(AugmentationNames.WKSharmonizer, true) ? 0.5 : 1);\n if (player.takeDamage(damage)) {\n router.toCity();\n return;\n }\n setupNextGame();\n }\n\n function cancel(): void {\n router.toCity();\n return;\n }\n\n let stageComponent: React.ReactNode;\n switch (stage) {\n case Stage.Countdown:\n stageComponent = setStage(Stage.Minigame)} />;\n break;\n case Stage.Minigame: {\n const MiniGame = minigames[gameIds.id];\n stageComponent = ;\n break;\n }\n case Stage.Sell:\n stageComponent = (\n \n );\n break;\n }\n\n function Progress(): React.ReactElement {\n return (\n \n {results.slice(0, results.length - 1)}\n {results[results.length - 1]}\n \n );\n }\n\n return (\n \n \n {stage !== Stage.Sell && (\n \n )}\n \n Level {level} / {props.MaxLevel}\n \n \n \n\n {stageComponent}\n \n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 16000, min: 3, max: 4 },\n Normal: { timer: 12500, min: 2, max: 3 },\n Hard: { timer: 15000, min: 3, max: 4 },\n Impossible: { timer: 8000, min: 4, max: 4 },\n};\n\nexport function BackwardGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [answer] = useState(makeAnswer(difficulty));\n const [guess, setGuess] = useState(\"\");\n const hasAugment = Player.hasAugmentation(AugmentationNames.ChaosOfDionysus, true);\n\n function ignorableKeyboardEvent(event: KeyboardEvent): boolean {\n return event.key === KEY.BACKSPACE || (event.shiftKey && event.key === \"Shift\") || event.ctrlKey || event.altKey;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (ignorableKeyboardEvent(event)) return;\n const nextGuess = guess + event.key.toUpperCase();\n if (!answer.startsWith(nextGuess)) props.onFailure();\n else if (answer === nextGuess) props.onSuccess();\n else setGuess(nextGuess);\n }\n\n return (\n <>\n \n \n Type it{!hasAugment ? \" backward\" : \"\"}\n \n {answer}\n \n {guess}\n \n \n \n \n );\n}\n\nfunction makeAnswer(difficulty: Difficulty): string {\n const length = random(difficulty.min, difficulty.max);\n let answer = \"\";\n for (let i = 0; i < length; i++) {\n if (i > 0) answer += \" \";\n answer += words[Math.floor(Math.random() * words.length)];\n }\n\n return answer;\n}\n\nconst words = [\n \"ALGORITHM\",\n \"ANALOG\",\n \"APP\",\n \"APPLICATION\",\n \"ARRAY\",\n \"BACKUP\",\n \"BANDWIDTH\",\n \"BINARY\",\n \"BIT\",\n \"BITE\",\n \"BITMAP\",\n \"BLOG\",\n \"BLOGGER\",\n \"BOOKMARK\",\n \"BOOT\",\n \"BROADBAND\",\n \"BROWSER\",\n \"BUFFER\",\n \"BUG\",\n \"BUS\",\n \"BYTE\",\n \"CACHE\",\n \"CAPS LOCK\",\n \"CAPTCHA\",\n \"CD\",\n \"CD-ROM\",\n \"CLIENT\",\n \"CLIPBOARD\",\n \"CLOUD\",\n \"COMPUTING\",\n \"COMMAND\",\n \"COMPILE\",\n \"COMPRESS\",\n \"COMPUTER\",\n \"CONFIGURE\",\n \"COOKIE\",\n \"COPY\",\n \"CPU\",\n \"CYBERCRIME\",\n \"CYBERSPACE\",\n \"DASHBOARD\",\n \"DATA\",\n \"MINING\",\n \"DATABASE\",\n \"DEBUG\",\n \"DECOMPRESS\",\n \"DELETE\",\n \"DESKTOP\",\n \"DEVELOPMENT\",\n \"DIGITAL\",\n \"DISK\",\n \"DNS\",\n \"DOCUMENT\",\n \"DOMAIN\",\n \"DOMAIN NAME\",\n \"DOT\",\n \"DOT MATRIX\",\n \"DOWNLOAD\",\n \"DRAG\",\n \"DVD\",\n \"DYNAMIC\",\n \"EMAIL\",\n \"EMOTICON\",\n \"ENCRYPT\",\n \"ENCRYPTION\",\n \"ENTER\",\n \"EXABYTE\",\n \"FAQ\",\n \"FILE\",\n \"FINDER\",\n \"FIREWALL\",\n \"FIRMWARE\",\n \"FLAMING\",\n \"FLASH\",\n \"FLASH DRIVE\",\n \"FLOPPY DISK\",\n \"FLOWCHART\",\n \"FOLDER\",\n \"FONT\",\n \"FORMAT\",\n \"FRAME\",\n \"FREEWARE\",\n \"GIGABYTE\",\n \"GRAPHICS\",\n \"HACK\",\n \"HACKER\",\n \"HARDWARE\",\n \"HOME PAGE\",\n \"HOST\",\n \"HTML\",\n \"HYPERLINK\",\n \"HYPERTEXT\",\n \"ICON\",\n \"INBOX\",\n \"INTEGER\",\n \"INTERFACE\",\n \"INTERNET\",\n \"IP ADDRESS\",\n \"ITERATION\",\n \"JAVA\",\n \"JOYSTICK\",\n \"JUNKMAIL\",\n \"KERNEL\",\n \"KEY\",\n \"KEYBOARD\",\n \"KEYWORD\",\n \"LAPTOP\",\n \"LASER PRINTER\",\n \"LINK\",\n \"LINUX\",\n \"LOG OUT\",\n \"LOGIC\",\n \"LOGIN\",\n \"LURKING\",\n \"MACINTOSH\",\n \"MACRO\",\n \"MAINFRAME\",\n \"MALWARE\",\n \"MEDIA\",\n \"MEMORY\",\n \"MIRROR\",\n \"MODEM\",\n \"MONITOR\",\n \"MOTHERBOARD\",\n \"MOUSE\",\n \"MULTIMEDIA\",\n \"NET\",\n \"NETWORK\",\n \"NODE\",\n \"NOTEBOOK\",\n \"COMPUTER\",\n \"OFFLINE\",\n \"ONLINE\",\n \"OPENSOURCE\",\n \"OPERATING\",\n \"SYSTEM\",\n \"OPTION\",\n \"OUTPUT\",\n \"PAGE\",\n \"PASSWORD\",\n \"PASTE\",\n \"PATH\",\n \"PHISHING\",\n \"PIRACY\",\n \"PIRATE\",\n \"PLATFORM\",\n \"PLUGIN\",\n \"PODCAST\",\n \"POPUP\",\n \"PORTAL\",\n \"PRINT\",\n \"PRINTER\",\n \"PRIVACY\",\n \"PROCESS\",\n \"PROGRAM\",\n \"PROGRAMMER\",\n \"PROTOCOL\",\n \"QUEUE\",\n \"QWERTY\",\n \"RAM\",\n \"REALTIME\",\n \"REBOOT\",\n \"RESOLUTION\",\n \"RESTORE\",\n \"ROM\",\n \"ROOT\",\n \"ROUTER\",\n \"RUNTIME\",\n \"SAVE\",\n \"SCAN\",\n \"SCANNER\",\n \"SCREEN\",\n \"SCREENSHOT\",\n \"SCRIPT\",\n \"SCROLL\",\n \"SCROLL\",\n \"SEARCH\",\n \"ENGINE\",\n \"SECURITY\",\n \"SERVER\",\n \"SHAREWARE\",\n \"SHELL\",\n \"SHIFT\",\n \"SHIFT KEY\",\n \"SNAPSHOT\",\n \"SOCIAL NETWORKING\",\n \"SOFTWARE\",\n \"SPAM\",\n \"SPAMMER\",\n \"SPREADSHEET\",\n \"SPYWARE\",\n \"STATUS\",\n \"STORAGE\",\n \"SUPERCOMPUTER\",\n \"SURF\",\n \"SYNTAX\",\n \"TABLE\",\n \"TAG\",\n \"TERMINAL\",\n \"TEMPLATE\",\n \"TERABYTE\",\n \"TEXT EDITOR\",\n \"THREAD\",\n \"TOOLBAR\",\n \"TRASH\",\n \"TROJAN HORSE\",\n \"TYPEFACE\",\n \"UNDO\",\n \"UNIX\",\n \"UPLOAD\",\n \"URL\",\n \"USER\",\n \"USER INTERFACE\",\n \"USERNAME\",\n \"UTILITY\",\n \"VERSION\",\n \"VIRTUAL\",\n \"VIRTUAL MEMORY\",\n \"VIRUS\",\n \"WEB\",\n \"WEBMASTER\",\n \"WEBSITE\",\n \"WIDGET\",\n \"WIKI\",\n \"WINDOW\",\n \"WINDOWS\",\n \"WIRELESS\",\n \"PROCESSOR\",\n \"WORKSTATION\",\n \"WEB\",\n \"WORM\",\n \"WWW\",\n \"XML\",\n \"ZIP\",\n];\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { BlinkingCursor } from \"./BlinkingCursor\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 8000, min: 2, max: 3 },\n Normal: { timer: 6000, min: 4, max: 5 },\n Hard: { timer: 4000, min: 4, max: 6 },\n Impossible: { timer: 2500, min: 7, max: 7 },\n};\n\nfunction generateLeftSide(difficulty: Difficulty): string {\n let str = \"\";\n const options = [KEY.OPEN_BRACKET, KEY.LESS_THAN, KEY.OPEN_PARENTHESIS, KEY.OPEN_BRACE];\n if (Player.hasAugmentation(AugmentationNames.WisdomOfAthena, true)) {\n options.splice(0, 1);\n }\n const length = random(difficulty.min, difficulty.max);\n for (let i = 0; i < length; i++) {\n str += options[Math.floor(Math.random() * options.length)];\n }\n\n return str;\n}\n\nfunction getChar(event: KeyboardEvent): string {\n if (event.key === KEY.CLOSE_PARENTHESIS) return KEY.CLOSE_PARENTHESIS;\n if (event.key === KEY.CLOSE_BRACKET) return KEY.CLOSE_BRACKET;\n if (event.key === KEY.CLOSE_BRACE) return KEY.CLOSE_BRACE;\n if (event.key === KEY.GREATER_THAN) return KEY.GREATER_THAN;\n return \"\";\n}\n\nfunction match(left: string, right: string): boolean {\n return (\n (left === KEY.OPEN_BRACKET && right === KEY.CLOSE_BRACKET) ||\n (left === KEY.LESS_THAN && right === KEY.GREATER_THAN) ||\n (left === KEY.OPEN_PARENTHESIS && right === KEY.CLOSE_PARENTHESIS) ||\n (left === KEY.OPEN_BRACE && right === KEY.CLOSE_BRACE)\n );\n}\n\nexport function BracketGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [right, setRight] = useState(\"\");\n const [left] = useState(generateLeftSide(difficulty));\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const char = getChar(event);\n if (!char) return;\n if (!match(left[left.length - right.length - 1], char)) {\n props.onFailure();\n return;\n }\n if (left.length === right.length + 1) {\n props.onSuccess();\n return;\n }\n setRight(right + char);\n }\n\n return (\n <>\n \n \n Close the brackets\n \n {`${left}${right}`}\n \n \n \n \n \n );\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n size: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12000, size: 6 },\n Normal: { timer: 9000, size: 8 },\n Hard: { timer: 5000, size: 9 },\n Impossible: { timer: 2500, size: 12 },\n};\n\nexport function BribeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, size: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [choices] = useState(makeChoices(difficulty));\n const [correctIndex, setCorrectIndex] = useState(0);\n const [index, setIndex] = useState(0);\n const currentChoice = choices[index];\n\n useEffect(() => {\n setCorrectIndex(choices.findIndex((choice) => positive.includes(choice)));\n }, [choices]);\n\n const defaultColor = Settings.theme.primary;\n const disabledColor = Settings.theme.disabled;\n let upColor = defaultColor;\n let downColor = defaultColor;\n let choiceColor = defaultColor;\n const hasAugment = Player.hasAugmentation(AugmentationNames.BeautyOfAphrodite, true);\n\n if (hasAugment) {\n const upIndex = index + 1 >= choices.length ? 0 : index + 1;\n let upDistance = correctIndex - upIndex;\n if (upIndex > correctIndex) {\n upDistance = choices.length - 1 - upIndex + correctIndex;\n }\n\n const downIndex = index - 1 < 0 ? choices.length - 1 : index - 1;\n let downDistance = downIndex - correctIndex;\n if (downIndex < correctIndex) {\n downDistance = downIndex + choices.length - 1 - correctIndex;\n }\n\n const onCorrectIndex = correctIndex == index;\n\n upColor = upDistance <= downDistance && !onCorrectIndex ? upColor : disabledColor;\n downColor = upDistance >= downDistance && !onCorrectIndex ? downColor : disabledColor;\n choiceColor = onCorrectIndex ? defaultColor : disabledColor;\n }\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n\n const k = event.key;\n if (k === KEY.SPACE) {\n if (positive.includes(currentChoice)) props.onSuccess();\n else props.onFailure();\n return;\n }\n\n let newIndex = index;\n if ([KEY.UP_ARROW, KEY.W, KEY.RIGHT_ARROW, KEY.D].map((k) => k as string).includes(k)) newIndex++;\n if ([KEY.DOWN_ARROW, KEY.S, KEY.LEFT_ARROW, KEY.A].map((k) => k as string).includes(k)) newIndex--;\n while (newIndex < 0) newIndex += choices.length;\n while (newIndex > choices.length - 1) newIndex -= choices.length;\n setIndex(newIndex);\n }\n\n return (\n <>\n \n \n Say something nice about the guard\n \n \n {upArrowSymbol}\n \n \n {currentChoice}\n \n \n {downArrowSymbol}\n \n \n \n );\n}\n\nfunction shuffleArray(array: string[]): void {\n for (let i = array.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n}\n\nfunction makeChoices(difficulty: Difficulty): string[] {\n const choices = [];\n choices.push(positive[Math.floor(Math.random() * positive.length)]);\n for (let i = 0; i < difficulty.size; i++) {\n const option = negative[Math.floor(Math.random() * negative.length)];\n if (choices.includes(option)) {\n i--;\n continue;\n }\n choices.push(option);\n }\n shuffleArray(choices);\n return choices;\n}\n\nconst positive = [\n \"affectionate\",\n \"agreeable\",\n \"bright\",\n \"charming\",\n \"creative\",\n \"determined\",\n \"energetic\",\n \"friendly\",\n \"funny\",\n \"generous\",\n \"polite\",\n \"likable\",\n \"diplomatic\",\n \"helpful\",\n \"giving\",\n \"kind\",\n \"hardworking\",\n \"patient\",\n \"dynamic\",\n \"loyal\",\n \"straightforward\",\n];\n\nconst negative = [\n \"aggressive\",\n \"aloof\",\n \"arrogant\",\n \"big-headed\",\n \"boastful\",\n \"boring\",\n \"bossy\",\n \"careless\",\n \"clingy\",\n \"couch potato\",\n \"cruel\",\n \"cynical\",\n \"grumpy\",\n \"hot air\",\n \"know it all\",\n \"obnoxious\",\n \"pain in the neck\",\n \"picky\",\n \"tactless\",\n \"thoughtless\",\n \"cringe\",\n];\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport {\n downArrowSymbol,\n getArrow,\n getInverseArrow,\n leftArrowSymbol,\n random,\n rightArrowSymbol,\n upArrowSymbol,\n} from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n min: number;\n max: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 13000, min: 6, max: 8 },\n Normal: { timer: 7000, min: 7, max: 8 },\n Hard: { timer: 5000, min: 8, max: 9 },\n Impossible: { timer: 3000, min: 9, max: 10 },\n};\n\nexport function CheatCodeGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, min: 0, max: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [code] = useState(generateCode(difficulty));\n const [index, setIndex] = useState(0);\n const hasAugment = Player.hasAugmentation(AugmentationNames.TrickeryOfHermes, true);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (code[index] !== getArrow(event) && (!hasAugment || code[index] !== getInverseArrow(event))) {\n props.onFailure();\n return;\n }\n setIndex(index + 1);\n if (index + 1 >= code.length) props.onSuccess();\n }\n\n return (\n <>\n \n \n Enter the Code!\n {code[index]}\n \n \n \n );\n}\n\nfunction generateCode(difficulty: Difficulty): string {\n const arrows = [leftArrowSymbol, rightArrowSymbol, upArrowSymbol, downArrowSymbol];\n let code = \"\";\n for (let i = 0; i < random(difficulty.min, difficulty.max); i++) {\n let arrow = arrows[Math.floor(4 * Math.random())];\n while (arrow === code[code.length - 1]) arrow = arrows[Math.floor(4 * Math.random())];\n code += arrow;\n }\n\n return code;\n}\n","import { Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\n\ninterface IProps {\n onFinish: () => void;\n}\n\nexport function Countdown(props: IProps): React.ReactElement {\n const [x, setX] = useState(3);\n useEffect(() => {\n if (x === 0) {\n props.onFinish();\n return;\n }\n setTimeout(() => setX(x - 1), 300);\n });\n\n return (\n \n Get Ready!\n {x}\n \n );\n}\n","import { Paper, Typography, Box } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n symbols: number;\n}\n\ninterface GridItem {\n content: string;\n color: string;\n selected?: boolean;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 12500, width: 3, height: 3, symbols: 6 },\n Normal: { timer: 15000, width: 4, height: 4, symbols: 7 },\n Hard: { timer: 12500, width: 5, height: 5, symbols: 8 },\n Impossible: { timer: 10000, width: 6, height: 6, symbols: 9 },\n};\n\nexport function Cyberpunk2077Game(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, symbols: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [grid] = useState(generatePuzzle(difficulty));\n const [answers] = useState(generateAnswers(grid, difficulty));\n const [currentAnswerIndex, setCurrentAnswerIndex] = useState(0);\n const [pos, setPos] = useState([0, 0]);\n\n const hasAugment = Player.hasAugmentation(AugmentationNames.FloodOfPoseidon, true);\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + grid[0].length) % grid[0].length;\n next[1] = (next[1] + grid.length) % grid.length;\n setPos(next);\n\n if (event.key === KEY.SPACE) {\n const selected = grid[pos[1]][pos[0]];\n const expected = answers[currentAnswerIndex];\n if (selected !== expected) {\n props.onFailure();\n return;\n }\n setCurrentAnswerIndex(currentAnswerIndex + 1);\n if (answers.length === currentAnswerIndex + 1) props.onSuccess();\n }\n }\n\n const flatGrid: GridItem[] = [];\n grid.map((line, y) =>\n line.map((cell, x) => {\n const isCorrectAnswer = cell === answers[currentAnswerIndex];\n const optionColor = hasAugment && !isCorrectAnswer ? Settings.theme.disabled : Settings.theme.primary;\n\n if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ color: optionColor, content: cell, selected: true });\n return;\n }\n\n flatGrid.push({ color: optionColor, content: cell });\n }),\n );\n\n const fontSize = \"2em\";\n return (\n <>\n \n \n Match the symbols!\n \n Targets:{\" \"}\n {answers.map((a, i) => {\n if (i == currentAnswerIndex)\n return (\n \n {a} \n \n );\n return (\n \n {a} \n \n );\n })}\n \n
    \n \n {flatGrid.map((item) => (\n \n {item.content}\n \n ))}\n \n \n
    \n \n );\n}\n\nfunction generateAnswers(grid: string[][], difficulty: Difficulty): string[] {\n const answers = [];\n for (let i = 0; i < Math.round(difficulty.symbols); i++) {\n answers.push(grid[Math.floor(Math.random() * grid.length)][Math.floor(Math.random() * grid[0].length)]);\n }\n return answers;\n}\n\nfunction randChar(): string {\n return \"ABCDEF0123456789\"[Math.floor(Math.random() * 16)];\n}\n\nfunction generatePuzzle(difficulty: Difficulty): string[][] {\n const puzzle = [];\n for (let i = 0; i < Math.round(difficulty.height); i++) {\n const line = [];\n for (let j = 0; j < Math.round(difficulty.width); j++) {\n line.push(randChar() + randChar());\n }\n puzzle.push(line);\n }\n return puzzle;\n}\n","import { Close, Flag, Report } from \"@mui/icons-material\";\nimport { Box, Paper, Typography } from \"@mui/material\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { downArrowSymbol, getArrow, leftArrowSymbol, rightArrowSymbol, upArrowSymbol } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n width: number;\n height: number;\n mines: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 15000, width: 3, height: 3, mines: 4 },\n Normal: { timer: 15000, width: 4, height: 4, mines: 7 },\n Hard: { timer: 15000, width: 5, height: 5, mines: 11 },\n Impossible: { timer: 15000, width: 6, height: 6, mines: 15 },\n};\n\nexport function MinesweeperGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { timer: 0, width: 0, height: 0, mines: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [minefield] = useState(generateMinefield(difficulty));\n const [answer, setAnswer] = useState(generateEmptyField(difficulty));\n const [pos, setPos] = useState([0, 0]);\n const [memoryPhase, setMemoryPhase] = useState(true);\n const hasAugment = Player.hasAugmentation(AugmentationNames.HuntOfArtemis, true);\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (memoryPhase) return;\n const move = [0, 0];\n const arrow = getArrow(event);\n switch (arrow) {\n case upArrowSymbol:\n move[1]--;\n break;\n case leftArrowSymbol:\n move[0]--;\n break;\n case downArrowSymbol:\n move[1]++;\n break;\n case rightArrowSymbol:\n move[0]++;\n break;\n }\n const next = [pos[0] + move[0], pos[1] + move[1]];\n next[0] = (next[0] + minefield[0].length) % minefield[0].length;\n next[1] = (next[1] + minefield.length) % minefield.length;\n setPos(next);\n\n if (event.key == KEY.SPACE) {\n if (!minefield[pos[1]][pos[0]]) {\n props.onFailure();\n return;\n }\n setAnswer((old) => {\n old[pos[1]][pos[0]] = true;\n if (fieldEquals(minefield, old)) props.onSuccess();\n return old;\n });\n }\n }\n\n useEffect(() => {\n const id = setTimeout(() => setMemoryPhase(false), 2000);\n return () => clearInterval(id);\n }, []);\n\n const flatGrid: { flagged?: boolean; current?: boolean; marked?: boolean }[] = [];\n\n minefield.map((line, y) =>\n line.map((cell, x) => {\n if (memoryPhase) {\n flatGrid.push({ flagged: Boolean(minefield[y][x]) });\n return;\n } else if (x === pos[0] && y === pos[1]) {\n flatGrid.push({ current: true });\n } else if (answer[y][x]) {\n flatGrid.push({ marked: true });\n } else if (hasAugment && minefield[y][x]) {\n flatGrid.push({ flagged: true });\n } else {\n flatGrid.push({});\n }\n }),\n );\n\n return (\n <>\n \n \n {memoryPhase ? \"Remember all the mines!\" : \"Mark all the mines!\"}\n \n {flatGrid.map((item) => {\n let color: string;\n let icon: React.ReactElement;\n\n if (item.marked) {\n color = Settings.theme.warning;\n icon = ;\n } else if (item.current) {\n color = Settings.theme.infolight;\n icon = ;\n } else if (item.flagged) {\n color = Settings.theme.error;\n icon = ;\n } else {\n color = Settings.theme.primary;\n icon = <>;\n }\n\n return (\n \n {icon}\n \n );\n })}\n \n \n \n \n );\n}\n\nfunction fieldEquals(a: boolean[][], b: boolean[][]): boolean {\n function count(field: boolean[][]): number {\n return field.flat().reduce((a, b) => a + (b ? 1 : 0), 0);\n }\n return count(a) === count(b);\n}\n\nfunction generateEmptyField(difficulty: Difficulty): boolean[][] {\n const field = [];\n for (let i = 0; i < difficulty.height; i++) {\n field.push(new Array(Math.round(difficulty.width)).fill(false));\n }\n return field;\n}\n\nfunction generateMinefield(difficulty: Difficulty): boolean[][] {\n const field = generateEmptyField(difficulty);\n for (let i = 0; i < difficulty.mines; i++) {\n const x = Math.floor(Math.random() * field.length);\n const y = Math.floor(Math.random() * field[0].length);\n if (field[x][y]) {\n i--;\n continue;\n }\n field[x][y] = true;\n }\n return field;\n}\n","import { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n window: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { window: 600 },\n Normal: { window: 325 },\n Hard: { window: 250 },\n Impossible: { window: 150 },\n};\n\nexport function SlashGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = { window: 0 };\n interpolate(difficulties, props.difficulty, difficulty);\n const [phase, setPhase] = useState(0);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n if (event.key !== KEY.SPACE) return;\n if (phase !== 2) {\n props.onFailure();\n } else {\n props.onSuccess();\n }\n }\n const hasAugment = Player.hasAugmentation(AugmentationNames.MightOfAres, true);\n const phaseZeroTime = Math.random() * 3250 + 1500 - (250 + difficulty.window);\n const phaseOneTime = 250;\n const timeUntilAttacking = phaseZeroTime + phaseOneTime;\n\n useEffect(() => {\n let id = window.setTimeout(() => {\n setPhase(1);\n id = window.setTimeout(() => {\n setPhase(2);\n id = window.setTimeout(() => setPhase(0), difficulty.window);\n }, phaseOneTime);\n }, phaseZeroTime);\n return () => {\n clearInterval(id);\n };\n }, []);\n\n return (\n <>\n \n \n Slash when his guard is down!\n\n {hasAugment ? (\n \n Guard will drop in...\n null} noPaper />\n \n ) : (\n <>\n )}\n\n {phase === 0 && Guarding ...}\n {phase === 1 && Preparing?}\n {phase === 2 && ATTACKING!}\n \n \n \n );\n}\n","import { Box, Button, MenuItem, Paper, Select, SelectChangeEvent, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { inviteToFaction } from \"../../Faction/FactionHelpers\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { use } from \"../../ui/Context\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { formatNumber } from \"../../utils/StringHelperFunctions\";\nimport {\n calculateInfiltratorsRepReward,\n calculateSellInformationCashReward,\n calculateTradeInformationRepReward,\n} from \"../formulas/victory\";\n\ninterface IProps {\n StartingDifficulty: number;\n Difficulty: number;\n Reward: number;\n MaxLevel: number;\n}\n\nexport function Victory(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const [faction, setFaction] = useState(\"none\");\n\n function quitInfiltration(): void {\n handleInfiltrators();\n router.toCity();\n }\n\n const soa = Factions[FactionNames.ShadowsOfAnarchy];\n const repGain = calculateTradeInformationRepReward(player, props.Reward, props.MaxLevel, props.StartingDifficulty);\n const moneyGain = calculateSellInformationCashReward(player, props.Reward, props.MaxLevel, props.StartingDifficulty);\n const infiltrationRepGain = calculateInfiltratorsRepReward(player, soa, props.StartingDifficulty);\n\n const isMemberOfInfiltrators = player.factions.includes(FactionNames.ShadowsOfAnarchy);\n\n function sell(): void {\n handleInfiltrators();\n player.gainMoney(moneyGain, \"infiltration\");\n quitInfiltration();\n }\n\n function trade(): void {\n if (faction === \"none\") return;\n handleInfiltrators();\n Factions[faction].playerReputation += repGain;\n quitInfiltration();\n }\n\n function changeDropdown(event: SelectChangeEvent): void {\n setFaction(event.target.value);\n }\n\n function handleInfiltrators(): void {\n inviteToFaction(Factions[FactionNames.ShadowsOfAnarchy]);\n if (isMemberOfInfiltrators) {\n soa.playerReputation += infiltrationRepGain;\n }\n }\n\n return (\n \n Infiltration successful!\n \n You{\" \"}\n {isMemberOfInfiltrators ? (\n <>\n have gained {formatNumber(infiltrationRepGain, 2)} rep for {FactionNames.ShadowsOfAnarchy} and{\" \"}\n \n ) : (\n <>\n )}\n can trade the confidential information you found for money or reputation.\n \n \n \n \n \n \n \n \n \n \n );\n}\n","import { Box, Paper, Typography } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Player } from \"../../Player\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { KEY } from \"../../utils/helpers/keyCodes\";\nimport { random } from \"../utils\";\nimport { interpolate } from \"./Difficulty\";\nimport { GameTimer } from \"./GameTimer\";\nimport { IMinigameProps } from \"./IMinigameProps\";\nimport { KeyHandler } from \"./KeyHandler\";\n\ninterface Difficulty {\n [key: string]: number;\n timer: number;\n wiresmin: number;\n wiresmax: number;\n rules: number;\n}\n\nconst difficulties: {\n Trivial: Difficulty;\n Normal: Difficulty;\n Hard: Difficulty;\n Impossible: Difficulty;\n} = {\n Trivial: { timer: 9000, wiresmin: 4, wiresmax: 4, rules: 2 },\n Normal: { timer: 7000, wiresmin: 6, wiresmax: 6, rules: 2 },\n Hard: { timer: 5000, wiresmin: 8, wiresmax: 8, rules: 3 },\n Impossible: { timer: 4000, wiresmin: 9, wiresmax: 9, rules: 4 },\n};\n\nconst types = [KEY.PIPE, KEY.DOT, KEY.FORWARD_SLASH, KEY.HYPHEN, \"█\", KEY.HASH];\n\nconst colors = [\"red\", \"#FFC107\", \"blue\", \"white\"];\n\nconst colorNames: Record = {\n red: \"red\",\n \"#FFC107\": \"yellow\",\n blue: \"blue\",\n white: \"white\",\n};\n\ninterface Wire {\n tpe: string;\n colors: string[];\n}\n\ninterface Question {\n toString: () => string;\n shouldCut: (wire: Wire, index: number) => boolean;\n}\n\nexport function WireCuttingGame(props: IMinigameProps): React.ReactElement {\n const difficulty: Difficulty = {\n timer: 0,\n wiresmin: 0,\n wiresmax: 0,\n rules: 0,\n };\n interpolate(difficulties, props.difficulty, difficulty);\n const timer = difficulty.timer;\n const [wires] = useState(generateWires(difficulty));\n const [cutWires, setCutWires] = useState(new Array(wires.length).fill(false));\n const [questions] = useState(generateQuestion(wires, difficulty));\n const hasAugment = Player.hasAugmentation(AugmentationNames.KnowledgeOfApollo, true);\n\n function checkWire(wireNum: number): boolean {\n return questions.some((q) => q.shouldCut(wires[wireNum - 1], wireNum - 1));\n }\n\n useEffect(() => {\n // check if we won\n const wiresToBeCut = [];\n for (let j = 0; j < wires.length; j++) {\n let shouldBeCut = false;\n for (let i = 0; i < questions.length; i++) {\n shouldBeCut = shouldBeCut || questions[i].shouldCut(wires[j], j);\n }\n wiresToBeCut.push(shouldBeCut);\n }\n if (wiresToBeCut.every((b, i) => b === cutWires[i])) {\n props.onSuccess();\n }\n }, [cutWires]);\n\n function press(this: Document, event: KeyboardEvent): void {\n event.preventDefault();\n const wireNum = parseInt(event.key);\n\n if (wireNum < 1 || wireNum > wires.length || isNaN(wireNum)) return;\n setCutWires((old) => {\n const next = [...old];\n next[wireNum - 1] = true;\n if (!checkWire(wireNum)) {\n props.onFailure();\n }\n\n return next;\n });\n }\n\n return (\n <>\n \n \n \n Cut the wires with the following properties! (keyboard 1 to 9)\n \n {questions.map((question, i) => (\n {question.toString()}\n ))}\n \n {new Array(wires.length).fill(0).map((_, i) => {\n const isCorrectWire = checkWire(i + 1);\n const color = hasAugment && !isCorrectWire ? Settings.theme.disabled : Settings.theme.primary;\n return (\n \n {i + 1}\n \n );\n })}\n {new Array(8).fill(0).map((_, i) => (\n \n {wires.map((wire, j) => {\n if ((i === 3 || i === 4) && cutWires[j]) {\n return ;\n }\n const isCorrectWire = checkWire(j + 1);\n const wireColor =\n hasAugment && !isCorrectWire ? Settings.theme.disabled : wire.colors[i % wire.colors.length];\n return (\n \n |{wire.tpe}|\n \n );\n })}\n \n ))}\n \n \n \n \n );\n}\n\nfunction randomPositionQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n return {\n toString: (): string => {\n return `Cut wires number ${index + 1}.`;\n },\n shouldCut: (wire: Wire, i: number): boolean => {\n return index === i;\n },\n };\n}\n\nfunction randomColorQuestion(wires: Wire[]): Question {\n const index = Math.floor(Math.random() * wires.length);\n const cutColor = wires[index].colors[0];\n return {\n toString: (): string => {\n return `Cut all wires colored ${colorNames[cutColor]}.`;\n },\n shouldCut: (wire: Wire): boolean => {\n return wire.colors.includes(cutColor);\n },\n };\n}\n\nfunction generateQuestion(wires: Wire[], difficulty: Difficulty): Question[] {\n const numQuestions = difficulty.rules;\n const questionGenerators = [randomPositionQuestion, randomColorQuestion];\n const questions = [];\n for (let i = 0; i < numQuestions; i++) {\n questions.push(questionGenerators[i % 2](wires));\n }\n return questions;\n}\n\nfunction generateWires(difficulty: Difficulty): Wire[] {\n const wires = [];\n const numWires = random(difficulty.wiresmin, difficulty.wiresmax);\n for (let i = 0; i < numWires; i++) {\n const wireColors = [colors[Math.floor(Math.random() * colors.length)]];\n if (Math.random() < 0.15) {\n wireColors.push(colors[Math.floor(Math.random() * colors.length)]);\n }\n wires.push({\n tpe: types[Math.floor(Math.random() * types.length)],\n colors: wireColors,\n });\n }\n return wires;\n}\n","import { Report } from \"@mui/icons-material\";\nimport { Box, Button, Container, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React from \"react\";\nimport { Location } from \"../../Locations/Location\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\n\ninterface IProps {\n Location: Location;\n Difficulty: number;\n MaxLevel: number;\n start: () => void;\n cancel: () => void;\n}\n\nfunction arrowPart(color: string, length: number): JSX.Element {\n let arrow = \"\";\n if (length <= 0) length = 0;\n else if (length > 13) length = 13;\n else {\n length--;\n arrow = \">\";\n }\n return (\n \n {\"=\".repeat(length)}\n {arrow}\n {\" \".repeat(13 - arrow.length - length)}\n \n );\n}\n\nfunction coloredArrow(difficulty: number): JSX.Element {\n if (difficulty === 0) {\n return (\n \n {\">\"}\n {\" \".repeat(38)}\n \n );\n } else {\n return (\n <>\n {arrowPart(Settings.theme.primary, difficulty * 13)}\n {arrowPart(Settings.theme.warning, (difficulty - 1) * 13)}\n {arrowPart(Settings.theme.error, (difficulty - 2) * 13)}\n \n );\n }\n}\n\nexport function Intro(props: IProps): React.ReactElement {\n return (\n \n \n \n Infiltrating {props.Location.name}\n \n \n Maximum Level: \n {props.MaxLevel}\n \n 2\n ? Settings.theme.error\n : props.Difficulty > 1\n ? Settings.theme.warning\n : Settings.theme.primary,\n display: \"flex\",\n alignItems: \"center\",\n }}\n >\n Difficulty: \n {numeralWrapper.format(props.Difficulty * 33.3333, \"0\")} / 100\n {props.Difficulty > 1.5 && (\n \n This location is too heavily guarded for your current stats. It is recommended that you try training,\n or finding an easier location.\n \n }\n >\n \n \n )}\n \n\n [{coloredArrow(props.Difficulty)}]\n {`▲ ▲ ▲ ▲`}\n {` Trivial Normal Hard Impossible`}\n \n\n \n \n Infiltration is a series of short minigames that get progressively harder. You take damage for failing\n them. Reaching the maximum level rewards you with intel that you can trade for money or reputation.\n
    \n
    \n Gameplay:\n
    \n
      \n \n
    • \n The minigames you play are randomly selected.\n
      \n It might take you a few tries to get used to them.\n
    • \n
    • No game requires use of the mouse.
    • \n
    • \n Spacebar is the default action/confirm button.\n
    • \n
    • \n The arrow keys and WASD can be used interchangeably.\n
    • \n
    • Sometimes the rest of the keyboard is used.
    • \n
      \n
    \n\n \n \n \n \n
    \n
    \n );\n}\n","import { Box, Container, Paper, Table, TableBody, Tooltip } from \"@mui/material\";\nimport Button from \"@mui/material/Button\";\nimport Typography from \"@mui/material/Typography\";\nimport { uniqueId } from \"lodash\";\nimport React, { useEffect, useState } from \"react\";\nimport { Companies } from \"../Company/Companies\";\nimport { Company } from \"../Company/Company\";\nimport { CONSTANTS } from \"../Constants\";\nimport { LocationName } from \"../Locations/data/LocationNames\";\nimport { Locations } from \"../Locations/Locations\";\nimport { Settings } from \"../Settings/Settings\";\nimport { convertTimeMsToTimeElapsedString } from \"../utils/StringHelperFunctions\";\nimport { use } from \"./Context\";\nimport { numeralWrapper } from \"./numeralFormat\";\nimport { Money } from \"./React/Money\";\nimport { MoneyRate } from \"./React/MoneyRate\";\nimport { ProgressBar } from \"./React/Progress\";\nimport { Reputation } from \"./React/Reputation\";\nimport { ReputationRate } from \"./React/ReputationRate\";\nimport { StatsRow } from \"./React/StatsRow\";\nimport { isCrimeWork } from \"../Work/CrimeWork\";\nimport { isClassWork } from \"../Work/ClassWork\";\nimport { WorkStats } from \"../Work/WorkStats\";\nimport { isCreateProgramWork } from \"../Work/CreateProgramWork\";\nimport { isGraftingWork } from \"../Work/GraftingWork\";\nimport { isFactionWork } from \"../Work/FactionWork\";\nimport { FactionWorkType } from \"../Work/data/FactionWorkType\";\nimport { isCompanyWork } from \"../Work/CompanyWork\";\n\nconst CYCLES_PER_SEC = 1000 / CONSTANTS.MilliPerCycle;\n\ninterface IWorkInfo {\n buttons: {\n cancel: () => void;\n unfocus?: () => void;\n };\n title: string | React.ReactElement;\n\n description?: string | React.ReactElement;\n gains?: (string | React.ReactElement)[];\n progress?: {\n elapsed?: number;\n remaining?: number;\n percentage?: number;\n };\n\n stopText: string;\n stopTooltip?: string | React.ReactElement;\n}\n\nfunction ExpRows(rate: WorkStats): React.ReactElement[] {\n return [\n rate.hackExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.strExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.defExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.dexExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.agiExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.chaExp > 0 ? (\n \n ) : (\n <>\n ),\n ];\n}\n\nfunction CrimeExpRows(rate: WorkStats): React.ReactElement[] {\n return [\n rate.hackExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.strExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.defExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.dexExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.agiExp > 0 ? (\n \n ) : (\n <>\n ),\n rate.chaExp > 0 ? (\n \n ) : (\n <>\n ),\n ];\n}\n\nexport function WorkInProgressRoot(): React.ReactElement {\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, CONSTANTS.MilliPerCycle);\n return () => clearInterval(id);\n }, []);\n\n const player = use.Player();\n const router = use.Router();\n\n let workInfo: IWorkInfo = {\n buttons: {\n cancel: () => undefined,\n },\n title: \"\",\n stopText: \"\",\n };\n\n if (player.currentWork === null) {\n setTimeout(() => router.toTerminal());\n return <>;\n }\n\n if (isCrimeWork(player.currentWork)) {\n const crime = player.currentWork.getCrime();\n const completion = (player.currentWork.unitCompleted / crime.time) * 100;\n const gains = player.currentWork.earnings();\n const successChance = crime.successRate(player);\n workInfo = {\n buttons: {\n cancel: () => {\n router.toLocation(Locations[LocationName.Slums]);\n player.finishWork(true);\n },\n unfocus: () => {\n router.toCity();\n player.stopFocusing();\n },\n },\n title: `You are attempting ${crime.workName}`,\n\n gains: [\n Success chance: {numeralWrapper.formatPercentage(successChance)},\n Gains (on success),\n \n \n \n \n ,\n ...CrimeExpRows(gains),\n ],\n progress: {\n remaining: crime.time - player.currentWork.unitCompleted,\n percentage: completion,\n },\n\n stopText: \"Stop commiting crime\",\n };\n }\n\n if (isClassWork(player.currentWork)) {\n const classWork = player.currentWork;\n function cancel(): void {\n player.finishWork(true);\n router.toCity();\n }\n\n function unfocus(): void {\n router.toCity();\n player.stopFocusing();\n }\n\n let stopText = \"\";\n if (classWork.isGym()) {\n stopText = \"Stop training at gym\";\n } else {\n stopText = \"Stop taking course\";\n }\n\n const rates = classWork.calculateRates(player);\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {classWork.getClass().youAreCurrently}\n \n ),\n\n gains: [\n \n \n ()\n \n ,\n ...ExpRows(rates),\n ],\n progress: {\n elapsed: classWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: stopText,\n };\n }\n\n if (isCreateProgramWork(player.currentWork)) {\n const create = player.currentWork;\n function cancel(): void {\n player.finishWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n const completion = (create.unitCompleted / create.unitNeeded()) * 100;\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on coding {create.programName}\n \n ),\n\n progress: {\n elapsed: create.cyclesWorked * CONSTANTS._idleSpeed,\n percentage: completion,\n },\n\n stopText: \"Stop creating program\",\n stopTooltip: \"Your work will be saved and you can return to complete the program later.\",\n };\n }\n\n if (isGraftingWork(player.currentWork)) {\n const graft = player.currentWork;\n function cancel(): void {\n player.finishWork(true);\n router.toTerminal();\n }\n function unfocus(): void {\n router.toTerminal();\n player.stopFocusing();\n }\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working on grafting {graft.augmentation}\n \n ),\n\n progress: {\n elapsed: graft.cyclesWorked * CONSTANTS._idleSpeed,\n percentage: (graft.unitCompleted / graft.unitNeeded()) * 100,\n },\n\n stopText: \"Stop grafting\",\n stopTooltip: (\n <>\n If you cancel, your work will not be saved, and the money you spent will not be returned\n \n ),\n };\n }\n\n if (isFactionWork(player.currentWork)) {\n const faction = player.currentWork.getFaction();\n if (!faction) {\n workInfo = {\n buttons: {\n cancel: () => router.toFactions(),\n },\n title:\n `You have not joined ${player.currentWork.factionName || \"(Faction not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Factions\",\n };\n }\n\n function cancel(): void {\n router.toFaction(faction);\n player.finishWork(true);\n }\n function unfocus(): void {\n router.toFaction(faction);\n player.stopFocusing();\n }\n\n const description = {\n [FactionWorkType.HACKING]: \"carrying out hacking contracts\",\n [FactionWorkType.FIELD]: \"carrying out field missions\",\n [FactionWorkType.SECURITY]: \"performing security detail\",\n };\n\n const exp = player.currentWork.getExpRates(player);\n\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently {description[player.currentWork.factionWorkType]} for {faction.name}\n \n ),\n\n description: (\n <>\n Current Faction Reputation: (\n )\n \n ),\n gains: ExpRows(exp),\n progress: {\n elapsed: player.currentWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: \"Stop Faction work\",\n };\n }\n\n if (isCompanyWork(player.currentWork)) {\n const comp = Companies[player.currentWork.companyName];\n if (comp == null || !(comp instanceof Company)) {\n workInfo = {\n buttons: {\n cancel: () => router.toTerminal(),\n },\n title:\n `You cannot work for ${player.currentWork.companyName || \"(Company not found)\"} at this time,` +\n \" please try again if you think this should have worked\",\n\n stopText: \"Back to Terminal\",\n };\n }\n\n const companyRep = comp.playerReputation;\n\n function cancel(): void {\n player.finishWork(true);\n router.toJob(Locations[comp.name]);\n }\n function unfocus(): void {\n player.stopFocusing();\n router.toJob(Locations[comp.name]);\n }\n\n const position = player.jobs[player.currentWork.companyName];\n const gains = player.currentWork.getGainRates(player);\n workInfo = {\n buttons: {\n cancel: cancel,\n unfocus: unfocus,\n },\n title: (\n <>\n You are currently working as a {position} at {player.currentWork.companyName}\n \n ),\n\n description: (\n <>\n Current Company Reputation: \n \n ),\n gains: [\n \n \n \n \n ,\n \n \n \n \n ,\n ...ExpRows(gains),\n ],\n progress: {\n elapsed: player.currentWork.cyclesWorked * CONSTANTS._idleSpeed,\n },\n\n stopText: \"Stop working\",\n };\n }\n\n if (workInfo.title === \"\") {\n return <>;\n }\n\n const tooltipInfo =\n typeof workInfo?.stopTooltip === \"string\" ? (\n {workInfo.stopTooltip}\n ) : (\n workInfo.stopTooltip || <>\n );\n\n return (\n \n \n {workInfo.title}\n {workInfo.description}\n {workInfo.gains && (\n \n \n {workInfo.gains.map((row) => (\n {row}\n ))}\n \n
    \n )}\n
    \n \n {workInfo.progress !== undefined && (\n \n \n {workInfo.progress.elapsed !== undefined && (\n {convertTimeMsToTimeElapsedString(workInfo.progress.elapsed)} elapsed\n )}\n {workInfo.progress.remaining !== undefined && (\n {convertTimeMsToTimeElapsedString(workInfo.progress.remaining)} remaining\n )}\n {workInfo.progress.percentage !== undefined && (\n {workInfo.progress.percentage.toFixed(2)}% done\n )}\n \n {workInfo.progress.percentage !== undefined && (\n \n )}\n \n )}\n\n \n {workInfo.stopTooltip ? (\n \n \n \n ) : (\n \n )}\n {workInfo.buttons.unfocus && (\n \n )}\n \n \n \n );\n}\n","import { Box, Container, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { IRouter } from \"../../ui/Router\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\nimport { GameOptionsSidebar } from \"./GameOptionsSidebar\";\nimport { GameplayPage } from \"./GameplayPage\";\nimport { InterfacePage } from \"./InterfacePage\";\nimport { MiscPage } from \"./MiscPage\";\nimport { RemoteAPIPage } from \"./RemoteAPIPage\";\nimport { SystemPage } from \"./SystemPage\";\n\ninterface IProps {\n player: IPlayer;\n router: IRouter;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\nexport function GameOptionsRoot(props: IProps): React.ReactElement {\n const [currentTab, setCurrentTab] = useState(GameOptionsTab.SYSTEM);\n\n return (\n \n Options\n \n \n {currentTab === GameOptionsTab.SYSTEM && }\n {currentTab === GameOptionsTab.INTERFACE && }\n {currentTab === GameOptionsTab.GAMEPLAY && }\n {currentTab === GameOptionsTab.MISC && }\n {currentTab === GameOptionsTab.REMOTE_API && }\n \n \n );\n}\n","import {\n BugReport,\n Chat,\n Download,\n LibraryBooks,\n Palette,\n Reddit,\n Save,\n SystemUpdateAlt,\n Upload,\n Bloodtype,\n} from \"@mui/icons-material\";\nimport { Box, Button, List, ListItemButton, Paper, Tooltip, Typography } from \"@mui/material\";\nimport { default as React, useRef, useState } from \"react\";\nimport { FileDiagnosticModal } from \"../../Diagnostic/FileDiagnosticModal\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { ImportData, saveObject } from \"../../SaveObject\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { StyleEditorButton } from \"../../Themes/ui/StyleEditorButton\";\nimport { ThemeEditorButton } from \"../../Themes/ui/ThemeEditorButton\";\nimport { ConfirmationModal } from \"../../ui/React/ConfirmationModal\";\nimport { DeleteGameButton } from \"../../ui/React/DeleteGameButton\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { SoftResetButton } from \"../../ui/React/SoftResetButton\";\nimport { IRouter } from \"../../ui/Router\";\nimport { convertTimeMsToTimeElapsedString } from \"../../utils/StringHelperFunctions\";\nimport { GameOptionsTab } from \"../GameOptionsTab\";\n\ninterface IProps {\n tab: GameOptionsTab;\n setTab: (tab: GameOptionsTab) => void;\n player: IPlayer;\n router: IRouter;\n save: () => void;\n export: () => void;\n forceKill: () => void;\n softReset: () => void;\n}\n\ninterface ITabProps {\n sideBarProps: IProps;\n tab: GameOptionsTab;\n tabName: string;\n}\n\nconst SideBarTab = (props: ITabProps): React.ReactElement => {\n return (\n props.sideBarProps.setTab(props.tab)}\n >\n {props.tabName}\n \n );\n};\n\nexport const GameOptionsSidebar = (props: IProps): React.ReactElement => {\n const importInput = useRef(null);\n\n const [diagnosticOpen, setDiagnosticOpen] = useState(false);\n const [importSaveOpen, setImportSaveOpen] = useState(false);\n const [importData, setImportData] = useState(null);\n\n function startImport(): void {\n if (!window.File || !window.FileReader || !window.FileList || !window.Blob) return;\n const ii = importInput.current;\n if (ii === null) throw new Error(\"import input should not be null\");\n ii.click();\n }\n\n async function onImport(event: React.ChangeEvent): Promise {\n try {\n const base64Save = await saveObject.getImportStringFromFile(event.target.files);\n const data = await saveObject.getImportDataFromString(base64Save);\n setImportData(data);\n setImportSaveOpen(true);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n }\n\n async function confirmedImportGame(): Promise {\n if (!importData) return;\n\n try {\n await saveObject.importGame(importData.base64);\n } catch (e: unknown) {\n SnackbarEvents.emit(String(e), ToastVariant.ERROR, 5000);\n }\n\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n function compareSaveGame(): void {\n if (!importData) return;\n props.router.toImportSave(importData.base64);\n setImportSaveOpen(false);\n setImportData(null);\n }\n\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Export your game to a text file.}>\n \n \n \n Import your game from a text file.\n
    \n This will overwrite your current game. Back it up first!\n \n }\n >\n \n \n setImportSaveOpen(false)}\n onConfirm={() => confirmedImportGame()}\n additionalButton={}\n confirmationText={\n <>\n Importing a new game will completely wipe the current data!\n
    \n
    \n Make sure to have a backup of your current save file before importing.\n
    \n The file you are attempting to import seems valid.\n {(importData?.playerData?.lastSave ?? 0) > 0 && (\n <>\n
    \n
    \n The export date of the save file is{\" \"}\n {new Date(importData?.playerData?.lastSave ?? 0).toLocaleString()}\n \n )}\n {(importData?.playerData?.totalPlaytime ?? 0) > 0 && (\n <>\n
    \n
    \n Total play time of imported game:{\" \"}\n {convertTimeMsToTimeElapsedString(importData?.playerData?.totalPlaytime ?? 0)}\n \n )}\n
    \n
    \n \n }\n />\n \n Forcefully kill all active running scripts, in case there is a bug or some unexpected issue with the game.\n After using this, save the game and then reload the page. This is different than normal kill in that\n normal kill will tell the script to shut down while force kill just removes the references to it (and it\n should crash on its own). This will not remove the files on your computer, just forcefully kill all\n running instances of all scripts.\n \n }\n >\n \n \n \n \n \n \n If your save file is extremely big you can use this button to view a map of all the files on every server.\n Be careful: there might be spoilers.\n \n }\n >\n \n \n \n \n \n \n \n \n \n \n \n\n \n }\n href=\"https://github.com/danielyxie/bitburner/issues/new\"\n target=\"_blank\"\n sx={{ gridArea: \"bug\" }}\n >\n Report Bug\n \n }\n href=\"https://bitburner.readthedocs.io/en/latest/changelog.html\"\n target=\"_blank\"\n sx={{ gridArea: \" changelog\" }}\n >\n Changelog\n \n }\n href=\"https://bitburner.readthedocs.io/en/latest/index.html\"\n target=\"_blank\"\n sx={{ gridArea: \"docs\" }}\n >\n Documentation\n \n \n }\n href=\"https://www.reddit.com/r/bitburner\"\n target=\"_blank\"\n sx={{ gridArea: \"reddit\" }}\n >\n Reddit\n \n
    \n\n {!location.href.startsWith(\"file://\") && (\n \n \n \n \n \n hydroflame (Current Maintainer)\n \n \n Donate blood!\n \n \n \n )}\n \n setDiagnosticOpen(false)} />\n \n );\n};\n","import React from \"react\";\nimport { GetServer, GetAllServers } from \"../Server/AllServers\";\nimport { Modal } from \"../ui/React/Modal\";\nimport { numeralWrapper } from \"../ui/numeralFormat\";\n\nimport Table from \"@mui/material/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport TableCell from \"@mui/material/TableCell\";\nimport TableContainer from \"@mui/material/TableContainer\";\nimport TableHead from \"@mui/material/TableHead\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Accordion from \"@mui/material/Accordion\";\nimport AccordionSummary from \"@mui/material/AccordionSummary\";\nimport AccordionDetails from \"@mui/material/AccordionDetails\";\nimport ExpandMoreIcon from \"@mui/icons-material/ExpandMore\";\n\ninterface IServerProps {\n hostname: string;\n}\n\nfunction ServerAccordion(props: IServerProps): React.ReactElement {\n const server = GetServer(props.hostname);\n if (server === null) throw new Error(`server '${props.hostname}' should not be null`);\n let totalSize = 0;\n for (const f of server.scripts) {\n totalSize += f.code.length;\n }\n\n for (const f of server.textFiles) {\n totalSize += f.text.length;\n }\n\n if (totalSize === 0) {\n return <>;\n }\n\n interface File {\n name: string;\n size: number;\n }\n\n const files: File[] = [];\n\n for (const f of server.scripts) {\n files.push({ name: f.filename, size: f.code.length });\n }\n\n for (const f of server.textFiles) {\n files.push({ name: f.fn, size: f.text.length });\n }\n\n files.sort((a: File, b: File): number => b.size - a.size);\n\n return (\n \n }>\n \n {server.hostname} ({numeralWrapper.formatBigNumber(totalSize)}b)\n \n \n \n \n \n \n \n \n Filename\n \n \n Size\n \n \n \n \n {files.map((file: File) => (\n \n \n {file.name}\n \n \n {numeralWrapper.formatBigNumber(file.size)}b\n \n \n ))}\n \n
    \n
    \n
      \n
      \n
      \n );\n}\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FileDiagnosticModal(props: IProps): React.ReactElement {\n const keys: string[] = [];\n for (const key of GetAllServers()) {\n keys.push(key.hostname);\n }\n\n return (\n \n <>\n \n Welcome to the file diagnostic! If your save file is really big it's likely because you have too many\n text/scripts. This tool can help you narrow down where they are.\n \n {keys.map((hostname: string) => (\n \n ))}\n \n \n );\n}\n","import React, { useEffect, useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\n\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport SaveIcon from \"@mui/icons-material/Save\";\n\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { defaultStyles } from \"../Styles\";\nimport { Tooltip } from \"@mui/material\";\nimport { IStyleSettings } from \"../../ScriptEditor/NetscriptDefinitions\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\ninterface FontFamilyProps {\n value: React.CSSProperties[\"fontFamily\"];\n onChange: (newValue: React.CSSProperties[\"fontFamily\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction FontFamilyField({ value, onChange, refreshId }: FontFamilyProps): React.ReactElement {\n const [errorText, setErrorText] = useState();\n const [fontFamily, setFontFamily] = useState(value);\n\n function update(newValue: React.CSSProperties[\"fontFamily\"]): void {\n setFontFamily(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(fontFamily, errorText), [fontFamily]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n \n );\n}\n\ninterface LineHeightProps {\n value: React.CSSProperties[\"lineHeight\"];\n onChange: (newValue: React.CSSProperties[\"lineHeight\"], error?: string) => void;\n refreshId: number;\n}\n\nfunction LineHeightField({ value, onChange, refreshId }: LineHeightProps): React.ReactElement {\n const [errorText, setErrorText] = useState();\n const [lineHeight, setLineHeight] = useState(value);\n\n function update(newValue: React.CSSProperties[\"lineHeight\"]): void {\n setLineHeight(newValue);\n if (!newValue) {\n setErrorText(\"Must have a value\");\n } else if (isNaN(Number(newValue))) {\n setErrorText(\"Must be a number\");\n } else {\n setErrorText(\"\");\n }\n }\n\n function onTextChange(event: React.ChangeEvent): void {\n update(event.target.value);\n }\n\n useEffect(() => onChange(lineHeight, errorText), [lineHeight]);\n useEffect(() => update(value), [refreshId]);\n\n return (\n \n );\n}\n\nexport function StyleEditorModal(props: IProps): React.ReactElement {\n const [refreshId, setRefreshId] = useState(0);\n const [error, setError] = useState();\n const [customStyle, setCustomStyle] = useState({\n ...Settings.styles,\n });\n\n function persistToSettings(styles: IStyleSettings): void {\n Object.assign(Settings.styles, styles);\n ThemeEvents.emit();\n }\n\n function saveStyles(): void {\n persistToSettings(customStyle);\n }\n\n function setDefaults(): void {\n const styles = { ...defaultStyles };\n setCustomStyle(styles);\n persistToSettings(styles);\n setRefreshId(refreshId + 1);\n }\n\n function update(styles: IStyleSettings, errorMessage?: string): void {\n setError(errorMessage);\n if (!errorMessage) {\n setCustomStyle(styles);\n }\n }\n\n return (\n \n Styles Editor\n \n WARNING: Changing styles may mess up the interface. Drastic changes are{\" \"}\n NOT recommended.\n \n \n update({ ...customStyle, fontFamily: value ?? \"\" }, error)}\n />\n
      \n update({ ...customStyle, lineHeight: Number(value) ?? 0 }, error)}\n />\n
      \n \n \n \n \n \n \n
      \n
      \n );\n}\n","import React, { useState } from \"react\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Button from \"@mui/material/Button\";\nimport ButtonGroup from \"@mui/material/ButtonGroup\";\nimport Typography from \"@mui/material/Typography\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Paper from \"@mui/material/Paper\";\nimport TextField from \"@mui/material/TextField\";\nimport IconButton from \"@mui/material/IconButton\";\nimport ReplyIcon from \"@mui/icons-material/Reply\";\nimport PaletteSharpIcon from \"@mui/icons-material/PaletteSharp\";\nimport HistoryIcon from \"@mui/icons-material/History\";\nimport { Color, ColorPicker } from \"material-ui-color\";\nimport { ThemeEvents } from \"./Theme\";\nimport { Settings, defaultSettings } from \"../../Settings/Settings\";\nimport { defaultTheme } from \"../Themes\";\nimport { UserInterfaceTheme } from \"../../ScriptEditor/NetscriptDefinitions\";\nimport { IRouter } from \"../../ui/Router\";\nimport { ThemeCollaborate } from \"./ThemeCollaborate\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n router: IRouter;\n}\n\ninterface IColorEditorProps {\n name: string;\n color: string | undefined;\n onColorChange: (name: string, value: string) => void;\n defaultColor: string;\n}\n\nfunction ColorEditor({ name, onColorChange, color, defaultColor }: IColorEditorProps): React.ReactElement {\n if (color === undefined) {\n console.error(`color ${name} was undefined, reverting to default`);\n color = defaultColor;\n }\n\n return (\n <>\n \n onColorChange(name, \"#\" + newColor.hex)}\n disableAlpha\n />\n \n ),\n endAdornment: (\n <>\n onColorChange(name, defaultColor)}>\n \n \n \n ),\n }}\n />\n \n );\n}\n\nexport function ThemeEditorModal(props: IProps): React.ReactElement {\n const [customTheme, setCustomTheme] = useState<{ [key: string]: string | undefined }>({\n ...Settings.theme,\n });\n\n function setTheme(theme: UserInterfaceTheme): void {\n setCustomTheme(theme);\n Object.assign(Settings.theme, theme);\n ThemeEvents.emit();\n }\n\n function onThemeChange(event: React.ChangeEvent): void {\n try {\n const importedTheme = JSON.parse(event.target.value);\n if (typeof importedTheme !== \"object\") return;\n setCustomTheme(importedTheme);\n for (const key of Object.keys(importedTheme)) {\n Settings.theme[key] = importedTheme[key];\n }\n ThemeEvents.emit();\n } catch (err) {\n // ignore\n }\n }\n\n function onColorChange(name: string, value: string): void {\n setCustomTheme((old: { [key: string]: string | undefined }) => {\n old[name] = value;\n return old;\n });\n\n Settings.theme[name] = value;\n ThemeEvents.emit();\n }\n\n function setTemplateTheme(theme: UserInterfaceTheme): void {\n setTheme(theme);\n }\n\n return (\n \n \n Example tooltip}>\n \n \n \n \n \n \n \n
      \n \n text with primary color\n \n  \n \n text with secondary color\n \n  \n \n text with error color\n \n
      \n \n
      \n\n \n \n \n \n\n
      \n \n \n \n\n
      \n \n \n \n\n
      \n \n \n \n\n
      \n \n \n \n\n
      \n \n \n \n\n
      \n \n \n \n \n \n \n \n\n
      \n \n \n \n \n \n \n \n \n
      \n\n \n \n <>\n Backup your theme or share it with others by copying the string above.\n \n \n \n \n \n \n \n \n \n \n \n
      \n );\n}\n","import React from \"react\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { use } from \"../../ui/Context\";\n\nexport const GameplayPage = (): React.ReactElement => {\n const player = use.Player();\n return (\n \n (Settings.SuppressMessages = newValue)}\n text=\"Suppress story messages\"\n tooltip={\n <>\n If this is set, then any messages you receive will not appear as popups on the screen. They will still get\n sent to your home computer as '.msg' files and can be viewed with the 'cat' Terminal command.\n \n }\n />\n (Settings.SuppressFactionInvites = newValue)}\n text=\"Suppress faction invites\"\n tooltip={\n <>\n If this is set, then any faction invites you receive will not appear as popups on the screen. Your\n outstanding faction invites can be viewed in the 'Factions' page.\n \n }\n />\n (Settings.SuppressTravelConfirmation = newValue)}\n text=\"Suppress travel confirmations\"\n tooltip={\n <>\n If this is set, the confirmation message before traveling will not show up. You will automatically be\n deducted the travel cost as soon as you click.\n \n }\n />\n (Settings.SuppressBuyAugmentationConfirmation = newValue)}\n text=\"Suppress augmentations confirmation\"\n tooltip={<>If this is set, the confirmation message before buying augmentation will not show up.}\n />\n (Settings.SuppressTIXPopup = newValue)}\n text=\"Suppress TIX messages\"\n tooltip={<>If this is set, the stock market will never create any popup.}\n />\n {player.bladeburner && (\n (Settings.SuppressBladeburnerPopup = newValue)}\n text=\"Suppress bladeburner popup\"\n tooltip={\n <>\n If this is set, then having your Bladeburner actions interrupted by being busy with something else will\n not display a popup message.\n \n }\n />\n )}\n \n );\n};\n","import React, { useState } from \"react\";\nimport { MenuItem, Select, SelectChangeEvent, TextField, Tooltip, Typography } from \"@mui/material\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { formatTime } from \"../../utils/helpers/formatTime\";\n\nexport const InterfacePage = (): React.ReactElement => {\n const [timestampFormat, setTimestampFormat] = useState(Settings.TimestampsFormat);\n const [locale, setLocale] = useState(Settings.Locale);\n\n function handleLocaleChange(event: SelectChangeEvent): void {\n setLocale(event.target.value);\n Settings.Locale = event.target.value;\n }\n function handleTimestampFormatChange(event: React.ChangeEvent): void {\n setTimestampFormat(event.target.value);\n Settings.TimestampsFormat = event.target.value;\n }\n return (\n \n (Settings.DisableASCIIArt = newValue)}\n text=\"Disable ascii art\"\n tooltip={<>If this is set all ASCII art will be disabled.}\n />\n (Settings.DisableTextEffects = newValue)}\n text=\"Disable text effects\"\n tooltip={\n <>\n If this is set, text effects will not be displayed. This can help if text is difficult to read in certain\n areas.\n \n }\n />\n (Settings.DisableOverviewProgressBars = newValue)}\n text=\"Disable Overview Progress Bars\"\n tooltip={<>If this is set, the progress bars in the character overview will be hidden.}\n />\n (Settings.UseIEC60027_2 = newValue)}\n text=\"Use GiB instead of GB\"\n tooltip={\n <>If this is set all references to memory will use GiB instead of GB, in accordance with IEC 60027-2.\n }\n />\n \n Terminal commands and log entries will be timestamped. See https://date-fns.org/docs/Getting-Started/\n \n }\n >\n \n Timestamp format: \n \n ),\n }}\n value={timestampFormat}\n onChange={handleTimestampFormatChange}\n placeholder=\"yyyy-MM-dd hh:mm:ss\"\n />\n \n \n Example timestamp: {timestampFormat !== \"\" ? formatTime(timestampFormat) : \"no timestamp\"}\n \n
      \n\n \n
      \n );\n};\n","import React from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\n\nexport const MiscPage = (): React.ReactElement => {\n return (\n \n (Settings.DisableHotkeys = newValue)}\n text=\"Disable hotkeys\"\n tooltip={\n <>\n If this is set, then most hotkeys (keyboard shortcuts) in the game are disabled. This includes Terminal\n commands, hotkeys to navigate between different parts of the game, and the \"Save and Close (Ctrl + b)\"\n hotkey in the Text Editor.\n \n }\n />\n (Settings.EnableBashHotkeys = newValue)}\n text=\"Enable bash hotkeys\"\n tooltip={\n <>\n Improved Bash emulation mode. Setting this to 1 enables several new Terminal shortcuts and features that\n more closely resemble a real Bash-style shell. Note that when this mode is enabled, the default browser\n shortcuts are overriden by the new Bash shortcuts.\n \n }\n />\n \n );\n};\n","import React, { useState } from \"react\";\nimport { Button, Link, TextField, Tooltip, Typography } from \"@mui/material\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { ConnectionBauble } from \"./ConnectionBauble\";\nimport { isRemoteFileApiConnectionLive, newRemoteFileApiConnection } from \"../../RemoteFileAPI/RemoteFileAPI\";\n\nexport const RemoteAPIPage = (): React.ReactElement => {\n const [remoteFileApiPort, setRemoteFileApiPort] = useState(Settings.RemoteFileApiPort);\n\n function handleRemoteFileApiPortChange(event: React.ChangeEvent): void {\n setRemoteFileApiPort(Number(event.target.value) as number);\n Settings.RemoteFileApiPort = Number(event.target.value);\n }\n\n return (\n \n \n These settings control the Remote API for bitburner. This is typically used to write scripts using an external\n text editor and then upload files to the home server.\n \n \n \n Documentation\n \n \n \n \n This port number is used to connect to a Remote API port, please ensure that it matches with your Remote API\n server port. Set to 0 to disable the feature.\n \n }\n >\n 0 && remoteFileApiPort <= 65535 ? \"success\" : \"error\"}>\n Port: \n \n ),\n endAdornment: ,\n }}\n value={remoteFileApiPort}\n onChange={handleRemoteFileApiPortChange}\n placeholder=\"12525\"\n />\n \n \n );\n};\n","import { Typography } from \"@mui/material\";\nimport React, { useState, useEffect } from \"react\";\nimport WifiIcon from \"@mui/icons-material/Wifi\";\nimport WifiOffIcon from \"@mui/icons-material/WifiOff\";\n\ninterface baubleProps {\n isConnected: () => boolean;\n}\n\nexport const ConnectionBauble = (props: baubleProps): React.ReactElement => {\n const [connection, setConnection] = useState(props.isConnected());\n\n useEffect(() => {\n const timer = setInterval(() => {\n setConnection(props.isConnected());\n }, 1000);\n return () => clearInterval(timer);\n });\n\n return (\n <>\n \n Status: \n \n {connection ? (\n <>\n Online \n \n \n ) : (\n <>\n Offline \n \n \n )}\n \n \n \n );\n};\n","import { RFAMessage } from \"./MessageDefinitions\";\nimport { RFARequestHandler } from \"./MessageHandlers\";\nimport { SnackbarEvents, ToastVariant } from \"../ui/React/Snackbar\";\n\nexport class Remote {\n connection?: WebSocket;\n static protocol = \"ws\";\n ipaddr: string;\n port: number;\n\n constructor(ip: string, port: number) {\n this.ipaddr = ip;\n this.port = port;\n }\n\n public stopConnection(): void {\n this.connection?.close();\n }\n\n public startConnection(): void {\n const address = Remote.protocol + \"://\" + this.ipaddr + \":\" + this.port;\n this.connection = new WebSocket(address);\n\n this.connection.addEventListener(\"error\", (e: Event) =>\n SnackbarEvents.emit(`Error with websocket ${address}, details: ${JSON.stringify(e)}`, ToastVariant.ERROR, 5000),\n );\n this.connection.addEventListener(\"message\", handleMessageEvent);\n this.connection.addEventListener(\"open\", () =>\n SnackbarEvents.emit(\n `Remote API connection established on ${this.ipaddr}:${this.port}`,\n ToastVariant.SUCCESS,\n 2000,\n ),\n );\n this.connection.addEventListener(\"close\", () =>\n SnackbarEvents.emit(\"Remote API connection closed\", ToastVariant.WARNING, 2000),\n );\n }\n}\n\nfunction handleMessageEvent(this: WebSocket, e: MessageEvent): void {\n const msg: RFAMessage = JSON.parse(e.data);\n\n if (!msg.method || !RFARequestHandler[msg.method]) {\n const response = new RFAMessage({ error: \"Unknown message received\", id: msg.id });\n this.send(JSON.stringify(response));\n return;\n }\n const response = RFARequestHandler[msg.method](msg);\n if (!response) return;\n this.send(JSON.stringify(response));\n}\n","import React, { useState } from \"react\";\nimport { Settings } from \"../../Settings/Settings\";\nimport { GameOptionsPage } from \"./GameOptionsPage\";\nimport { OptionsSlider } from \"./OptionsSlider\";\nimport { OptionSwitch } from \"../../ui/React/OptionSwitch\";\n\nexport const SystemPage = (): React.ReactElement => {\n const [execTime, setExecTime] = useState(Settings.CodeInstructionRunTime);\n const [recentScriptsSize, setRecentScriptsSize] = useState(Settings.MaxRecentScriptsCapacity);\n const [logSize, setLogSize] = useState(Settings.MaxLogCapacity);\n const [portSize, setPortSize] = useState(Settings.MaxPortCapacity);\n const [terminalSize, setTerminalSize] = useState(Settings.MaxTerminalCapacity);\n const [autosaveInterval, setAutosaveInterval] = useState(Settings.AutosaveInterval);\n\n function handlePortSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setPortSize(newValue as number);\n Settings.MaxPortCapacity = newValue as number;\n }\n\n function handleTerminalSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setTerminalSize(newValue as number);\n Settings.MaxTerminalCapacity = newValue as number;\n }\n\n function handleExecTimeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setExecTime(newValue as number);\n Settings.CodeInstructionRunTime = newValue as number;\n }\n\n function handleRecentScriptsSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setRecentScriptsSize(newValue as number);\n Settings.MaxRecentScriptsCapacity = newValue as number;\n }\n\n function handleLogSizeChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setLogSize(newValue as number);\n Settings.MaxLogCapacity = newValue as number;\n }\n\n function handleAutosaveIntervalChange(\n _event: Event | React.SyntheticEvent,\n newValue: number | number[],\n ): void {\n setAutosaveInterval(newValue as number);\n Settings.AutosaveInterval = newValue as number;\n }\n return (\n \n {/* Wrap in a React fragment to prevent the sliders from breaking as list items */}\n <>\n \n The minimum number of milliseconds it takes to execute an operation in Netscript. Setting this too low can\n result in poor performance if you have many scripts running.\n \n }\n />\n The maximum number of recently killed scripts the game will keep.}\n />\n \n The maximum number of lines a script's logs can hold. Setting this too high can cause the game to use a\n lot of memory if you have many scripts running.\n \n }\n />\n \n The maximum number of entries that can be written to a port using Netscript's write() function. Setting\n this too high can cause the game to use a lot of memory.\n \n }\n />\n \n The maximum number of entries that can be written to the terminal. Setting this too high can cause the\n game to use a lot of memory.\n \n }\n marks\n />\n The time (in seconds) between each autosave. Set to 0 to disable autosave.}\n marks\n />\n \n (Settings.SuppressSavedGameToast = newValue)}\n text=\"Suppress Auto-Save Game Toast\"\n tooltip={<>If this is set, there will be no \"Game Saved!\" toast appearing after an auto-save.}\n />\n (Settings.SuppressAutosaveDisabledWarnings = newValue)}\n text=\"Suppress Auto-Save Disabled Warning\"\n tooltip={<>If this is set, there will be no warning triggered when auto-save is disabled (at 0).}\n />\n (Settings.SaveGameOnFileSave = newValue)}\n text=\"Save game on file save\"\n tooltip={<>Save your game any time a file is saved in the script editor.}\n />\n (Settings.ExcludeRunningScriptsFromSave = newValue)}\n text=\"Exclude Running Scripts from Save\"\n tooltip={\n <>\n If this is set, the save file will exclude all running scripts. This is only useful if your save is lagging\n a lot. You'll have to restart your script every time you launch the game.\n \n }\n />\n \n );\n};\n","import React, { useState, useEffect } from \"react\";\n\nimport { Box, Typography, Button, Container } from \"@mui/material\";\n\nimport { use } from \"../../../ui/Context\";\n\nimport { SleeveElem } from \"./SleeveElem\";\nimport { FAQModal } from \"./FAQModal\";\n\nexport function SleeveRoot(): React.ReactElement {\n const player = use.Player();\n const [FAQOpen, setFAQOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n return (\n <>\n \n Sleeves\n \n Duplicate Sleeves are MK-V Synthoids (synthetic androids) into which your consciousness has been copied. In\n other words, these Synthoids contain a perfect duplicate of your mind.\n
      \n
      \n Sleeves can be used to perform different tasks synchronously.\n
      \n
      \n
      \n
      \n\n \n \n Wiki Documentation\n \n \n {player.sleeves.map((sleeve, i) => (\n \n ))}\n \n setFAQOpen(false)} />\n \n );\n}\n","import { Box, Button, Paper, Tooltip, Typography } from \"@mui/material\";\nimport React, { useState } from \"react\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { use } from \"../../../ui/Context\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { ProgressBar } from \"../../../ui/React/Progress\";\nimport { Sleeve } from \"../Sleeve\";\nimport { MoreStatsModal } from \"./MoreStatsModal\";\nimport { SleeveAugmentationsModal } from \"./SleeveAugmentationsModal\";\nimport { EarningsElement, StatsElement } from \"./StatsElement\";\nimport { TaskSelector } from \"./TaskSelector\";\nimport { TravelModal } from \"./TravelModal\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveSynchroWork } from \"../Work/SleeveSynchroWork\";\nimport { isSleeveRecoveryWork } from \"../Work/SleeveRecoveryWork\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveInfiltrateWork } from \"../Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../Work/SleeveSupportWork\";\nimport { isSleeveBladeburnerWork } from \"../Work/SleeveBladeburnerWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\n\ninterface IProps {\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function SleeveElem(props: IProps): React.ReactElement {\n const player = use.Player();\n const [statsOpen, setStatsOpen] = useState(false);\n const [travelOpen, setTravelOpen] = useState(false);\n const [augmentationsOpen, setAugmentationsOpen] = useState(false);\n\n const [abc, setABC] = useState([\"------\", \"------\", \"------\"]);\n\n function setTask(): void {\n switch (abc[0]) {\n case \"------\":\n break;\n case \"Work for Company\":\n props.sleeve.workForCompany(player, abc[1]);\n break;\n case \"Work for Faction\":\n props.sleeve.workForFaction(player, abc[1], abc[2]);\n break;\n case \"Commit Crime\":\n props.sleeve.commitCrime(player, abc[1]);\n break;\n case \"Take University Course\":\n props.sleeve.takeUniversityCourse(player, abc[2], abc[1]);\n break;\n case \"Workout at Gym\":\n props.sleeve.workoutAtGym(player, abc[2], abc[1]);\n break;\n case \"Perform Bladeburner Actions\":\n props.sleeve.bladeburner(player, abc[1], abc[2]);\n break;\n case \"Shock Recovery\":\n props.sleeve.shockRecovery(player);\n break;\n case \"Synchronize\":\n props.sleeve.synchronize(player);\n break;\n default:\n console.error(`Invalid/Unrecognized taskValue in setSleeveTask(): ${abc[0]}`);\n }\n props.rerender();\n }\n\n let desc = <>This sleeve is currently idle;\n\n if (isSleeveCrimeWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n const crime = w.getCrime();\n desc = (\n <>\n This sleeve is currently attempting to {crime.type} (Success Rate:{\" \"}\n {numeralWrapper.formatPercentage(crime.successRate(props.sleeve))}).\n \n );\n }\n\n if (isSleeveClassWork(props.sleeve.currentWork)) {\n if (props.sleeve.currentWork.isGym())\n desc = <>This sleeve is currently working out at {props.sleeve.currentWork.location}.;\n else desc = <>This sleeve is currently studying at {props.sleeve.currentWork.location}.;\n }\n if (isSleeveSynchroWork(props.sleeve.currentWork)) {\n desc = (\n <>\n This sleeve is currently set to synchronize with the original consciousness. This causes the Sleeve's\n synchronization to increase.\n \n );\n }\n if (isSleeveRecoveryWork(props.sleeve.currentWork)) {\n desc = (\n <>\n This sleeve is currently set to focus on shock recovery. This causes the Sleeve's shock to decrease at a faster\n rate.\n \n );\n }\n if (isSleeveFactionWork(props.sleeve.currentWork)) {\n let doing = \"nothing\";\n switch (props.sleeve.currentWork.factionWorkType) {\n case FactionWorkType.FIELD:\n doing = \"Field work\";\n break;\n case FactionWorkType.HACKING:\n doing = \"Hacking contracts\";\n break;\n case FactionWorkType.SECURITY:\n doing = \"Security work\";\n break;\n }\n desc = (\n <>\n This sleeve is currently doing {doing} for {props.sleeve.currentWork.factionName}.\n \n );\n }\n if (isSleeveCompanyWork(props.sleeve.currentWork)) {\n desc = <>This sleeve is currently working your job at {props.sleeve.currentWork.companyName}.;\n }\n\n if (isSleeveBladeburnerWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n desc = (\n <>\n This sleeve is currently attempting to perform {w.actionName}. (\n {((100 * w.cyclesWorked) / w.cyclesNeeded(player, props.sleeve)).toFixed(2)}%)\n \n );\n }\n\n if (isSleeveInfiltrateWork(props.sleeve.currentWork)) {\n const w = props.sleeve.currentWork;\n desc = (\n <>\n This sleeve is currently attempting to infiltrate synthoids communities. (\n {((100 * w.cyclesWorked) / w.cyclesNeeded()).toFixed(2)}%)\n \n );\n }\n\n if (isSleeveSupportWork(props.sleeve.currentWork)) {\n desc = <>This sleeve is currently supporting you in your bladeburner activities.;\n }\n\n return (\n <>\n \n \n \n \n \n Insufficient funds : \"\"}>\n \n setTravelOpen(true)}\n disabled={player.money < CONSTANTS.TravelCost}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\n Travel\n \n \n \n Unlocked when sleeve has fully recovered : \"\"}\n >\n \n setAugmentationsOpen(true)}\n disabled={props.sleeve.shock < 100}\n sx={{ width: \"100%\", height: \"100%\" }}\n >\n Manage Augmentations\n \n \n \n \n \n \n \n \n \n {desc}\n \n {isSleeveCrimeWork(props.sleeve.currentWork) && (\n \n )}\n {isSleeveBladeburnerWork(props.sleeve.currentWork) && (\n \n )}\n \n \n \n setStatsOpen(false)} sleeve={props.sleeve} />\n setTravelOpen(false)}\n sleeve={props.sleeve}\n rerender={props.rerender}\n />\n setAugmentationsOpen(false)}\n sleeve={props.sleeve}\n />\n \n );\n}\n","import { Sleeve } from \"../Sleeve\";\nimport { numeralWrapper } from \"../../../ui/numeralFormat\";\nimport { convertTimeMsToTimeElapsedString } from \"../../../utils/StringHelperFunctions\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Typography } from \"@mui/material\";\nimport { StatsTable } from \"../../../ui/React/StatsTable\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport React from \"react\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function MoreStatsModal(props: IProps): React.ReactElement {\n return (\n \n Hacking: ,\n props.sleeve.skills.hacking,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.hacking)} exp),\n ],\n [\n <>Strength: ,\n props.sleeve.skills.strength,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.strength)} exp),\n ],\n [\n <>Defense: ,\n props.sleeve.skills.defense,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.defense)} exp),\n ],\n [\n <>Dexterity: ,\n props.sleeve.skills.dexterity,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.dexterity)} exp),\n ],\n [\n <>Agility: ,\n props.sleeve.skills.agility,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.agility)} exp),\n ],\n [\n <>Charisma: ,\n props.sleeve.skills.charisma,\n <> ({numeralWrapper.formatExp(props.sleeve.exp.charisma)} exp),\n ],\n ]}\n title=\"Stats:\"\n />\n
      \n Hacking Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.hacking)],\n [<>Hacking Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.hacking_exp)],\n [<>Strength Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.strength)],\n [\n <>Strength Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.strength_exp),\n ],\n [<>Defense Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.defense)],\n [<>Defense Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.defense_exp)],\n [<>Dexterity Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.dexterity)],\n [\n <>Dexterity Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.dexterity_exp),\n ],\n [<>Agility Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.agility)],\n [<>Agility Experience multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.agility_exp)],\n [<>Charisma Level multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.charisma)],\n [\n <>Charisma Experience multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.charisma_exp),\n ],\n [\n <>Faction Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.faction_rep),\n ],\n [\n <>Company Reputation Gain multiplier: ,\n numeralWrapper.formatPercentage(props.sleeve.mults.company_rep),\n ],\n [<>Salary multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.work_money)],\n [<>Crime Money multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.crime_money)],\n [<>Crime Success multiplier: , numeralWrapper.formatPercentage(props.sleeve.mults.crime_success)],\n ]}\n title=\"Multipliers:\"\n />\n\n {/* Check for storedCycles to be a bit over 0 to prevent jittering */}\n {props.sleeve.storedCycles > 10 && (\n \n Bonus Time: {convertTimeMsToTimeElapsedString(props.sleeve.storedCycles * CONSTANTS.MilliPerCycle)}\n \n )}\n
      \n );\n}\n","import { Container, Typography, Paper } from \"@mui/material\";\nimport React, { useEffect, useState } from \"react\";\nimport { PurchasableAugmentations } from \"../../../Augmentation/ui/PurchasableAugmentations\";\nimport { use } from \"../../../ui/Context\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { Sleeve } from \"../Sleeve\";\nimport { findSleevePurchasableAugs } from \"../SleeveHelpers\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n}\n\nexport function SleeveAugmentationsModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 150);\n return () => clearInterval(id);\n }, []);\n\n // Array of all owned Augmentations. Names only\n const ownedAugNames = props.sleeve.augmentations.map((e) => e.name);\n\n // You can only purchase Augmentations that are actually available from\n // your factions. I.e. you must be in a faction that has the Augmentation\n // and you must also have enough rep in that faction in order to purchase it.\n const availableAugs = findSleevePurchasableAugs(props.sleeve, player);\n\n return (\n \n \n \n You can purchase Augmentations for your Duplicate Sleeves. These Augmentations have the same effect as they\n would for you. You can only purchase Augmentations that you have unlocked through Factions.\n
      \n
      \n When purchasing an Augmentation for a Duplicate Sleeve, they are immediately installed. This means that the\n Duplicate Sleeve will immediately lose all of its stat experience.\n
      \n
      \n Augmentations will appear below as they become available.\n
      \n
      \n aug.name)}\n ownedAugNames={ownedAugNames}\n player={player}\n canPurchase={(player, aug) => {\n return player.money > aug.baseCost;\n }}\n purchaseAugmentation={(player, aug) => {\n props.sleeve.tryBuyAugmentation(player, aug);\n rerender();\n }}\n sleeveAugs\n />\n
      \n );\n}\n","import React from \"react\";\n\nimport { Augmentation } from \"../Augmentation\";\nimport { Faction } from \"../../Faction/Faction\";\nimport { purchaseAugmentation } from \"../../Faction/FactionHelpers\";\nimport { isRepeatableAug } from \"../AugmentationHelpers\";\nimport { Money } from \"../../ui/React/Money\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n faction?: Faction;\n aug?: Augmentation;\n}\n\nexport function PurchaseAugmentationModal(props: IProps): React.ReactElement {\n if (typeof props.aug === \"undefined\" || typeof props.faction === \"undefined\") {\n return <>;\n }\n\n const player = use.Player();\n\n function buy(): void {\n if (!isRepeatableAug(props.aug as Augmentation) && player.hasAugmentation(props.aug as Augmentation)) {\n return;\n }\n\n purchaseAugmentation(props.aug as Augmentation, props.faction as Faction);\n props.onClose();\n }\n\n return (\n \n {props.aug.name}\n \n {props.aug.info}\n
      \n
      \n {props.aug.stats}\n
      \n
      \n Would you like to purchase the {props.aug.name} Augmentation for \n ?\n
      \n
      \n
      \n \n
      \n );\n}\n","import React, { useState } from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { IPlayer } from \"../../IPlayer\";\nimport { Crimes } from \"../../../Crime/Crimes\";\nimport { LocationName } from \"../../../Locations/data/LocationNames\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Factions } from \"../../../Faction/Factions\";\nimport Select, { SelectChangeEvent } from \"@mui/material/Select\";\nimport MenuItem from \"@mui/material/MenuItem\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\nimport { isSleeveFactionWork } from \"../Work/SleeveFactionWork\";\nimport { isSleeveCompanyWork } from \"../Work/SleeveCompanyWork\";\nimport { isSleeveBladeburnerWork } from \"../Work/SleeveBladeburnerWork\";\nimport { isSleeveRecoveryWork } from \"../Work/SleeveRecoveryWork\";\nimport { isSleeveSynchroWork } from \"../Work/SleeveSynchroWork\";\nimport { isSleeveClassWork } from \"../Work/SleeveClassWork\";\nimport { isSleeveInfiltrateWork } from \"../Work/SleeveInfiltrateWork\";\nimport { isSleeveSupportWork } from \"../Work/SleeveSupportWork\";\nimport { ClassType } from \"../../../Work/ClassWork\";\nimport { isSleeveCrimeWork } from \"../Work/SleeveCrimeWork\";\nimport { FactionWorkType } from \"../../../Work/data/FactionWorkType\";\n\nconst universitySelectorOptions: string[] = [\n \"Study Computer Science\",\n \"Data Structures\",\n \"Networks\",\n \"Algorithms\",\n \"Management\",\n \"Leadership\",\n];\n\nconst gymSelectorOptions: string[] = [\"Train Strength\", \"Train Defense\", \"Train Dexterity\", \"Train Agility\"];\n\nconst bladeburnerSelectorOptions: string[] = [\n \"Field analysis\",\n \"Recruitment\",\n \"Diplomacy\",\n \"Infiltrate synthoids\",\n \"Support main sleeve\",\n \"Take on contracts\",\n];\n\ninterface IProps {\n sleeve: Sleeve;\n player: IPlayer;\n setABC: (abc: string[]) => void;\n}\n\ninterface ITaskDetails {\n first: string[];\n second: (s1: string) => string[];\n}\n\nfunction possibleJobs(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all companies that other sleeves are working at\n const forbiddenCompanies: string[] = [];\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveCompanyWork(otherSleeve.currentWork)) {\n forbiddenCompanies.push(otherSleeve.currentWork.companyName);\n }\n }\n const allJobs: string[] = Object.keys(player.jobs);\n\n return allJobs.filter((company) => !forbiddenCompanies.includes(company));\n}\n\nfunction possibleFactions(player: IPlayer, sleeve: Sleeve): string[] {\n // Array of all factions that other sleeves are working for\n const forbiddenFactions = [FactionNames.Bladeburners as string, FactionNames.ShadowsOfAnarchy as string];\n if (player.gang) {\n forbiddenFactions.push(player.gang.facName);\n }\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveFactionWork(otherSleeve.currentWork)) {\n forbiddenFactions.push(otherSleeve.currentWork.factionName);\n }\n }\n\n const factions = [];\n for (const fac of player.factions) {\n if (!forbiddenFactions.includes(fac)) {\n factions.push(fac);\n }\n }\n\n return factions.filter((faction) => {\n const factionObj = Factions[faction];\n if (!factionObj) return false;\n const facInfo = factionObj.getInfo();\n return facInfo.offerHackingWork || facInfo.offerFieldWork || facInfo.offerSecurityWork;\n });\n}\n\nfunction possibleContracts(player: IPlayer, sleeve: Sleeve): string[] {\n const bb = player.bladeburner;\n if (bb === null) {\n return [\"------\"];\n }\n let contracts = bb.getContractNamesNetscriptFn();\n for (const otherSleeve of player.sleeves) {\n if (sleeve === otherSleeve) {\n continue;\n }\n if (isSleeveBladeburnerWork(otherSleeve.currentWork) && otherSleeve.currentWork.actionType === \"Contracts\") {\n const w = otherSleeve.currentWork;\n contracts = contracts.filter((x) => x != w.actionName);\n }\n }\n if (contracts.length === 0) {\n return [\"------\"];\n }\n return contracts;\n}\n\nconst tasks: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => ITaskDetails);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Perform Bladeburner Actions\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => ITaskDetails;\n} = {\n \"------\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let jobs = possibleJobs(player, sleeve);\n\n if (jobs.length === 0) jobs = [\"------\"];\n return { first: jobs, second: () => [\"------\"] };\n },\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let factions = possibleFactions(player, sleeve);\n if (factions.length === 0) factions = [\"------\"];\n\n return {\n first: factions,\n second: (s1: string) => {\n const faction = Factions[s1];\n if (!faction) return [\"------\"];\n\n const facInfo = faction.getInfo();\n const options: string[] = [];\n if (facInfo.offerHackingWork) {\n options.push(\"Hacking Contracts\");\n }\n if (facInfo.offerFieldWork) {\n options.push(\"Field Work\");\n }\n if (facInfo.offerSecurityWork) {\n options.push(\"Security Work\");\n }\n return options;\n },\n };\n },\n \"Commit Crime\": (): ITaskDetails => {\n return { first: Object.values(Crimes).map((crime) => crime.name), second: () => [\"------\"] };\n },\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let universities: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n universities = [LocationName.AevumSummitUniversity];\n break;\n case CityName.Sector12:\n universities = [LocationName.Sector12RothmanUniversity];\n break;\n case CityName.Volhaven:\n universities = [LocationName.VolhavenZBInstituteOfTechnology];\n break;\n default:\n universities = [\"No university available in city!\"];\n break;\n }\n\n return { first: universitySelectorOptions, second: () => universities };\n },\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n let gyms: string[] = [];\n switch (sleeve.city) {\n case CityName.Aevum:\n gyms = [LocationName.AevumCrushFitnessGym, LocationName.AevumSnapFitnessGym];\n break;\n case CityName.Sector12:\n gyms = [LocationName.Sector12IronGym, LocationName.Sector12PowerhouseGym];\n break;\n case CityName.Volhaven:\n gyms = [LocationName.VolhavenMilleniumFitnessGym];\n break;\n default:\n gyms = [\"No gym available in city!\"];\n break;\n }\n\n return { first: gymSelectorOptions, second: () => gyms };\n },\n \"Perform Bladeburner Actions\": (player: IPlayer, sleeve: Sleeve): ITaskDetails => {\n return {\n first: bladeburnerSelectorOptions,\n second: (s1: string) => {\n if (s1 === \"Take on contracts\") {\n return possibleContracts(player, sleeve);\n } else {\n return [\"------\"];\n }\n },\n };\n },\n \"Shock Recovery\": (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n Synchronize: (): ITaskDetails => {\n return { first: [\"------\"], second: () => [\"------\"] };\n },\n};\n\nconst canDo: {\n [key: string]: undefined | ((player: IPlayer, sleeve: Sleeve) => boolean);\n [\"------\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Company\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Work for Faction\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Commit Crime\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Take University Course\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Workout at Gym\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Perform Bladeburner Actions\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Shock Recovery\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n [\"Synchronize\"]: (player: IPlayer, sleeve: Sleeve) => boolean;\n} = {\n \"------\": () => true,\n \"Work for Company\": (player: IPlayer, sleeve: Sleeve) => possibleJobs(player, sleeve).length > 0,\n \"Work for Faction\": (player: IPlayer, sleeve: Sleeve) => possibleFactions(player, sleeve).length > 0,\n \"Commit Crime\": () => true,\n \"Take University Course\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Workout at Gym\": (player: IPlayer, sleeve: Sleeve) =>\n [CityName.Aevum, CityName.Sector12, CityName.Volhaven].includes(sleeve.city),\n \"Perform Bladeburner Actions\": (player: IPlayer) => player.inBladeburner(),\n \"Shock Recovery\": (player: IPlayer, sleeve: Sleeve) => sleeve.shock < 100,\n Synchronize: (player: IPlayer, sleeve: Sleeve) => sleeve.sync < 100,\n};\n\nfunction getABC(sleeve: Sleeve): [string, string, string] {\n const w = sleeve.currentWork;\n if (w === null) {\n return [\"------\", \"------\", \"------\"];\n }\n\n if (isSleeveCompanyWork(w)) {\n return [\"Work for Company\", w.companyName, \"------\"];\n }\n if (isSleeveFactionWork(w)) {\n let workType = \"\";\n switch (w.factionWorkType) {\n case FactionWorkType.HACKING:\n workType = \"Hacking Contracts\";\n break;\n case FactionWorkType.FIELD:\n workType = \"Field Work\";\n break;\n case FactionWorkType.SECURITY:\n workType = \"Security Work\";\n break;\n }\n return [\"Work for Faction\", w.factionName, workType];\n }\n if (isSleeveBladeburnerWork(w)) {\n if (w.actionType === \"Contracts\") {\n return [\"Perform Bladeburner Actions\", \"Take on contracts\", w.actionName];\n }\n switch (w.actionName) {\n case \"Field Analysis\":\n return [\"Perform Bladeburner Actions\", \"Field Analysis\", \"------\"];\n case \"Diplomacy\":\n return [\"Perform Bladeburner Actions\", \"Diplomacy\", \"------\"];\n case \"Recruitment\":\n return [\"Perform Bladeburner Actions\", \"Recruitment\", \"------\"];\n }\n }\n\n if (isSleeveClassWork(w)) {\n switch (w.classType) {\n case ClassType.StudyComputerScience:\n return [\"Take University Course\", \"Study Computer Science\", w.location];\n case ClassType.DataStructures:\n return [\"Take University Course\", \"Data Structures\", w.location];\n case ClassType.Networks:\n return [\"Take University Course\", \"Networks\", w.location];\n case ClassType.Algorithms:\n return [\"Take University Course\", \"Algorithms\", w.location];\n case ClassType.Management:\n return [\"Take University Course\", \"Management\", w.location];\n case ClassType.Leadership:\n return [\"Take University Course\", \"Leadership\", w.location];\n case ClassType.GymStrength:\n return [\"Workout at Gym\", \"Train Strength\", w.location];\n case ClassType.GymDefense:\n return [\"Workout at Gym\", \"Train Defense\", w.location];\n case ClassType.GymDexterity:\n return [\"Workout at Gym\", \"Train Dexterity\", w.location];\n case ClassType.GymAgility:\n return [\"Workout at Gym\", \"Train Agility\", w.location];\n }\n }\n if (isSleeveCrimeWork(w)) {\n return [\n \"Commit Crime\",\n Object.values(Crimes).find((crime) => crime.type === w.crimeType)?.name ?? \"Shoplift\",\n \"------\",\n ];\n }\n if (isSleeveSupportWork(w)) {\n return [\"Perform Bladeburner Actions\", \"Support main sleeve\", \"------\"];\n }\n if (isSleeveInfiltrateWork(w)) {\n return [\"Perform Bladeburner Actions\", \"Infiltrate synthoids\", \"------\"];\n }\n if (isSleeveRecoveryWork(w)) {\n return [\"Shock Recovery\", \"------\", \"------\"];\n }\n if (isSleeveSynchroWork(w)) {\n return [\"Synchronize\", \"------\", \"------\"];\n }\n\n return [\"------\", \"------\", \"------\"];\n}\n\nexport function TaskSelector(props: IProps): React.ReactElement {\n const abc = getABC(props.sleeve);\n const [s0, setS0] = useState(abc[0]);\n const [s1, setS1] = useState(abc[1]);\n const [s2, setS2] = useState(abc[2]);\n\n const validActions = Object.keys(canDo).filter((k) =>\n (canDo[k] as (player: IPlayer, sleeve: Sleeve) => boolean)(props.player, props.sleeve),\n );\n\n const detailsF = tasks[s0];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(s1);\n\n if (details.first.length > 0 && !details.first.includes(s1)) {\n setS1(details.first[0]);\n props.setABC([s0, details.first[0], s2]);\n }\n if (details2.length > 0 && !details2.includes(s2)) {\n setS2(details2[0]);\n props.setABC([s0, s1, details2[0]]);\n }\n\n function onS0Change(event: SelectChangeEvent): void {\n const n = event.target.value;\n const detailsF = tasks[n];\n if (detailsF === undefined) throw new Error(`No function for task '${s0}'`);\n const details = detailsF(props.player, props.sleeve);\n const details2 = details.second(details.first[0]) ?? [\"------\"];\n setS2(details2[0]);\n setS1(details.first[0]);\n setS0(n);\n props.setABC([n, details.first[0], details2[0]]);\n }\n\n function onS1Change(event: SelectChangeEvent): void {\n setS1(event.target.value);\n props.setABC([s0, event.target.value, s2]);\n }\n\n function onS2Change(event: SelectChangeEvent): void {\n setS2(event.target.value);\n props.setABC([s0, s1, event.target.value]);\n }\n\n return (\n <>\n \n {!(details.first.length === 1 && details.first[0] === \"------\") && (\n <>\n \n \n )}\n {!(details2.length === 1 && details2[0] === \"------\") && (\n <>\n \n \n )}\n \n );\n}\n","import React from \"react\";\nimport { Sleeve } from \"../Sleeve\";\nimport { CONSTANTS } from \"../../../Constants\";\nimport { Money } from \"../../../ui/React/Money\";\nimport { WorldMap } from \"../../../ui/React/WorldMap\";\nimport { CityName } from \"../../../Locations/data/CityNames\";\nimport { Settings } from \"../../../Settings/Settings\";\nimport { dialogBoxCreate } from \"../../../ui/React/DialogBox\";\nimport { use } from \"../../../ui/Context\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n sleeve: Sleeve;\n rerender: () => void;\n}\n\nexport function TravelModal(props: IProps): React.ReactElement {\n const player = use.Player();\n function travel(city: string): void {\n if (!player.canAfford(CONSTANTS.TravelCost)) {\n dialogBoxCreate(\"You cannot afford to have this sleeve travel to another city\");\n }\n props.sleeve.city = city as CityName;\n player.loseMoney(CONSTANTS.TravelCost, \"sleeve\");\n props.sleeve.stopWork(player);\n props.rerender();\n props.onClose();\n }\n\n return (\n \n <>\n \n Have this sleeve travel to a different city. This affects the gyms and universities at which this sleeve can\n study. Traveling to a different city costs . It will\n also set your current sleeve task to idle.\n \n {Settings.DisableASCIIArt ? (\n Object.values(CityName).map((city: CityName) => (\n \n ))\n ) : (\n travel(city)} />\n )}\n \n \n );\n}\n","import React from \"react\";\n\nimport { Modal } from \"../../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport { FactionNames } from \"../../../Faction/data/FactionNames\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function FAQModal({ open, onClose }: IProps): React.ReactElement {\n return (\n \n <>\n How do Duplicate Sleeves work?\n
      \n \n Duplicate Sleeves are essentially clones. You can use them to perform any work type action, such as working\n for a company/faction or committing a crime. Having sleeves perform these tasks earns you money, experience,\n and reputation.\n \n
      \n
      \n \n Sleeves are their own individuals, which means they each have their own experience and stats.\n \n
      \n
      \n \n When a sleeve earns experience, it earns experience for itself, the player's original 'consciousness', as well\n as all of the player's other sleeves.\n \n
      \n
      \n What is Synchronization (Sync)?\n
      \n \n Synchronization is a measure of how aligned your consciousness is with that of your Duplicate Sleeves. It is a\n numerical value between 1 and 100, and it affects how much experience is earned when the sleeve is performing\n a task.\n \n
      \n
      \n \n Let N be the sleeve's synchronization. When the sleeve earns experience by performing a task, both the sleeve\n and the player's original host consciousness earn N% of the amount of experience normally earned by the task.\n All of the player's other sleeves earn ((N/100)^2 * 100)% of the experience.\n \n
      \n
      \n Synchronization can be increased by assigning sleeves to the 'Synchronize' task.\n
      \n
      \n What is Shock?\n
      \n \n Sleeve shock is a measure of how much trauma the sleeve has due to being placed in a new body. It is a\n numerical value between 0 and 99, where 99 indicates full shock and 0 indicates no shock. Shock affects the\n amount of experience earned by the sleeve.\n \n
      \n
      \n \n Sleeve shock slowly decreases over time. You can further increase the rate at which it decreases by assigning\n sleeves to the 'Shock Recovery' task.\n \n
      \n
      \n Why can't I work for this company or faction?\n
      \n \n Only one of your sleeves can work for a given company/faction a time. To clarify further, if you have two\n sleeves they can work for two different companies, but they cannot both work for the same company.\n \n
      \n
      \n Why did my Sleeve stop working?\n
      \n \n Sleeves are subject to the same time restrictions as you. This means that they automatically stop working at a\n company after 8 hours, and stop working for a faction after 20 hours.\n \n
      \n
      \n How do I buy Augmentations for my Sleeves?\n
      \n Your Sleeve needs to have a Shock of 0 in order for you to buy Augmentations for it.\n
      \n
      \n Why can't I buy the X Augmentation for my sleeve?\n
      \n \n Certain Augmentations, like {FactionNames.Bladeburners}-specific ones and NeuroFlux Governor, are not\n available for sleeves.\n \n
      \n
      \n Do sleeves get reset when installing Augmentations or switching BitNodes?\n
      \n Sleeves are reset when switching BitNodes, but not when installing Augmentations.\n
      \n
      \n What is Memory?\n
      \n \n Sleeve memory dictates what a sleeve's synchronization will be when it's reset by switching BitNodes. For\n example, if a sleeve has a memory of 25, then when you switch BitNodes its synchronization will initially be\n set to 25, rather than 1.\n \n
      \n
      \n \n Memory can only be increased by purchasing upgrades from {FactionNames.TheCovenant}. It is a persistent stat,\n meaning it never gets resets back to 1. The maximum possible value for a sleeve's memory is 100.\n \n \n
      \n );\n}\n","/**\n * Root React Component for the Hacknet Node UI\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { GeneralInfo } from \"./GeneralInfo\";\nimport { HacknetNodeElem } from \"./HacknetNodeElem\";\nimport { HacknetServerElem } from \"./HacknetServerElem\";\nimport { HacknetNode } from \"../HacknetNode\";\nimport { HacknetServer } from \"../HacknetServer\";\nimport { HashUpgradeModal } from \"./HashUpgradeModal\";\nimport { MultiplierButtons } from \"./MultiplierButtons\";\nimport { PlayerInfo } from \"./PlayerInfo\";\nimport { PurchaseButton } from \"./PurchaseButton\";\nimport { PurchaseMultipliers } from \"../data/Constants\";\n\nimport {\n getCostOfNextHacknetNode,\n getCostOfNextHacknetServer,\n hasHacknetServers,\n purchaseHacknet,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Button from \"@mui/material/Button\";\nimport { Box } from \"@mui/material\";\n\ninterface IProps {\n player: IPlayer;\n}\n\nexport function HacknetRoot(props: IProps): React.ReactElement {\n const [open, setOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n const [purchaseMultiplier, setPurchaseMultiplier] = useState(PurchaseMultipliers.x1);\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n\n let totalProduction = 0;\n for (let i = 0; i < props.player.hacknetNodes.length; ++i) {\n const node = props.player.hacknetNodes[i];\n if (hasHacknetServers(props.player)) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n if (hserver) {\n totalProduction += hserver.hashRate;\n } else {\n console.warn(`Could not find Hacknet Server object in AllServers map (i=${i})`);\n }\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n totalProduction += node.moneyGainRatePerSecond;\n }\n }\n\n function handlePurchaseButtonClick(): void {\n purchaseHacknet(props.player);\n rerender();\n }\n\n // Cost to purchase a new Hacknet Node\n let purchaseCost;\n if (hasHacknetServers(props.player)) {\n purchaseCost = getCostOfNextHacknetServer(props.player);\n } else {\n purchaseCost = getCostOfNextHacknetNode(props.player);\n }\n\n // onClick event handlers for purchase multiplier buttons\n const purchaseMultiplierOnClicks = [\n () => setPurchaseMultiplier(PurchaseMultipliers.x1),\n () => setPurchaseMultiplier(PurchaseMultipliers.x5),\n () => setPurchaseMultiplier(PurchaseMultipliers.x10),\n () => setPurchaseMultiplier(PurchaseMultipliers.MAX),\n ];\n\n // HacknetNode components\n const nodes = props.player.hacknetNodes.map((node: string | HacknetNode) => {\n if (hasHacknetServers(props.player)) {\n if (node instanceof HacknetNode) throw new Error(\"node was hacknet node\"); // should never happen\n const hserver = GetServer(node);\n if (hserver == null) {\n throw new Error(`Could not find Hacknet Server object in AllServers map for IP: ${node}`);\n }\n if (!(hserver instanceof HacknetServer)) throw new Error(\"node was not hacknet server\"); // should never happen\n return (\n \n );\n } else {\n if (typeof node === \"string\") throw new Error(\"node was ip string\"); // should never happen\n return (\n \n );\n }\n });\n\n return (\n <>\n Hacknet {hasHacknetServers(props.player) ? \"Servers\" : \"Nodes\"}\n \n\n \n\n
      \n\n \n \n \n \n \n \n \n \n\n {hasHacknetServers(props.player) && }\n\n {nodes}\n setOpen(false)} />\n \n );\n}\n","/**\n * React Component for the Hacknet Node UI\n *\n * Displays general information about Hacknet Nodes\n */\nimport React from \"react\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n hasHacknetServers: boolean;\n}\n\nexport function GeneralInfo(props: IProps): React.ReactElement {\n return (\n <>\n \n The Hacknet is a global, decentralized network of machines. It is used by hackers all around the world to\n anonymously share computing power and perform distributed cyberattacks without the fear of being traced.\n \n {!props.hasHacknetServers ? (\n <>\n \n {`Here, you can purchase a Hacknet Node, a specialized machine that can connect ` +\n `and contribute its resources to the Hacknet network. This allows you to take ` +\n `a small percentage of profits from hacks performed on the network. Essentially, ` +\n `you are renting out your Node's computing power.`}\n \n \n {`Each Hacknet Node you purchase will passively earn you money. Each Hacknet Node ` +\n `can be upgraded in order to increase its computing power and thereby increase ` +\n `the profit you earn from it.`}\n \n \n ) : (\n <>\n \n {`Here, you can purchase a Hacknet Server, an upgraded version of the Hacknet Node. ` +\n `Hacknet Servers will perform computations and operations on the network, earning ` +\n `you hashes. Hashes can be spent on a variety of different upgrades.`}\n \n \n {`Hacknet Servers can also be used as servers to run scripts. However, running scripts ` +\n `on a server will reduce its hash rate (hashes generated per second). A Hacknet Server's hash ` +\n `rate will be reduced by the percentage of RAM that is being used by that Server to run ` +\n `scripts.`}\n \n \n )}\n \n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetNodeConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { HacknetNode } from \"../HacknetNode\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateMoneyGainRate } from \"../formulas/HacknetNodes\";\n\ninterface IProps {\n node: HacknetNode;\n purchaseMultiplier: number | \"MAX\";\n rerender: () => void;\n player: IPlayer;\n}\n\nexport function HacknetNodeElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetNodeConstants.MaxLevel) {\n upgradeLevelButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(props.player, node, HacknetNodeConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(node.level + multiplier, node.ram, node.cores, props.player.mults.hacknet_node_money) -\n node.moneyGainRatePerSecond;\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.mults.hacknet_node_level_cost);\n upgradeLevelButton = (\n \n +\n \n }\n >\n \n \n );\n }\n function upgradeLevelOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\"\n ? getMaxNumberLevelUpgrades(props.player, node, HacknetNodeConstants.MaxLevel)\n : purchaseMult;\n purchaseLevelUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n\n let upgradeRAMButton;\n if (node.ram >= HacknetNodeConstants.MaxRam) {\n upgradeRAMButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(props.player, node, HacknetNodeConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetNodeConstants.MaxRam / node.ram));\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(\n node.level,\n node.ram * Math.pow(2, multiplier),\n node.cores,\n props.player.mults.hacknet_node_money,\n ) - node.moneyGainRatePerSecond;\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.mults.hacknet_node_ram_cost);\n upgradeRAMButton = (\n \n +\n \n }\n >\n \n \n );\n }\n function upgradeRamOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\" ? getMaxNumberRamUpgrades(props.player, node, HacknetNodeConstants.MaxRam) : purchaseMult;\n purchaseRamUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n\n function upgradeCoresOnClick(): void {\n const numUpgrades =\n purchaseMult === \"MAX\"\n ? getMaxNumberCoreUpgrades(props.player, node, HacknetNodeConstants.MaxCores)\n : purchaseMult;\n purchaseCoreUpgrade(props.player, node, numUpgrades);\n rerender();\n }\n let upgradeCoresButton;\n if (node.cores >= HacknetNodeConstants.MaxCores) {\n upgradeCoresButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(props.player, node, HacknetNodeConstants.MaxCores);\n } else {\n const levelsToMax = HacknetNodeConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult);\n }\n\n const increase =\n calculateMoneyGainRate(node.level, node.ram, node.cores + multiplier, props.player.mults.hacknet_node_money) -\n node.moneyGainRatePerSecond;\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.mults.hacknet_node_core_cost);\n upgradeCoresButton = (\n \n +\n \n }\n >\n \n \n );\n }\n\n return (\n \n \n \n \n \n {node.name}\n \n \n \n \n Production:\n \n \n \n (\n )\n \n \n \n \n \n Level:\n \n \n {node.level}\n \n {upgradeLevelButton}\n \n \n \n RAM:\n \n \n {numeralWrapper.formatRAM(node.ram)}\n \n {upgradeRAMButton}\n \n \n \n Cores:\n \n \n {node.cores}\n \n {upgradeCoresButton}\n \n \n
      \n
      \n );\n}\n","/**\n * React Component for the Hacknet Node UI.\n * This Component displays the panel for a single Hacknet Node\n */\nimport React from \"react\";\n\nimport { HacknetServerConstants } from \"../data/Constants\";\nimport {\n getMaxNumberLevelUpgrades,\n getMaxNumberRamUpgrades,\n getMaxNumberCoreUpgrades,\n getMaxNumberCacheUpgrades,\n purchaseLevelUpgrade,\n purchaseRamUpgrade,\n purchaseCoreUpgrade,\n purchaseCacheUpgrade,\n updateHashManagerCapacity,\n} from \"../HacknetHelpers\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { HacknetServer } from \"../HacknetServer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport Typography from \"@mui/material/Typography\";\nimport Grid from \"@mui/material/Grid\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { TableCell } from \"../../ui/React/Table\";\nimport TableBody from \"@mui/material/TableBody\";\nimport Table from \"@mui/material/Table\";\nimport TableRow from \"@mui/material/TableRow\";\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { calculateHashGainRate } from \"../formulas/HacknetServers\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\ninterface IProps {\n node: HacknetServer;\n purchaseMultiplier: number | string;\n rerender: () => void;\n player: IPlayer;\n}\n\nexport function HacknetServerElem(props: IProps): React.ReactElement {\n const node = props.node;\n const purchaseMult = props.purchaseMultiplier;\n const rerender = props.rerender;\n\n // Upgrade Level Button\n let upgradeLevelButton;\n if (node.level >= HacknetServerConstants.MaxLevel) {\n upgradeLevelButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberLevelUpgrades(props.player, node, HacknetServerConstants.MaxLevel);\n } else {\n const levelsToMax = HacknetServerConstants.MaxLevel - node.level;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(\n node.level + multiplier,\n 0,\n node.maxRam,\n node.cores,\n props.player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeLevelCost = node.calculateLevelUpgradeCost(multiplier, props.player.mults.hacknet_node_level_cost);\n upgradeLevelButton = (\n \n + (effective increase, taking current RAM usage into account)\n
      \n \n +\n {\" \"}\n (base increase, attained when no script is running)\n \n }\n >\n \n \n );\n }\n function upgradeLevelOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberLevelUpgrades(props.player, node, HacknetServerConstants.MaxLevel);\n }\n purchaseLevelUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n\n function upgradeRamOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberRamUpgrades(props.player, node, HacknetServerConstants.MaxRam);\n }\n purchaseRamUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n // Upgrade RAM Button\n let upgradeRamButton;\n if (node.maxRam >= HacknetServerConstants.MaxRam) {\n upgradeRamButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberRamUpgrades(props.player, node, HacknetServerConstants.MaxRam);\n } else {\n const levelsToMax = Math.round(Math.log2(HacknetServerConstants.MaxRam / node.maxRam));\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(\n node.level,\n 0,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n props.player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n\n const modded_increase =\n calculateHashGainRate(\n node.level,\n node.ramUsed,\n node.maxRam * Math.pow(2, multiplier),\n node.cores,\n props.player.mults.hacknet_node_money,\n ) -\n calculateHashGainRate(node.level, node.ramUsed, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n\n const upgradeRamCost = node.calculateRamUpgradeCost(multiplier, props.player.mults.hacknet_node_ram_cost);\n upgradeRamButton = (\n \n + (effective increase, taking current RAM usage into account)\n
      \n \n +\n {\" \"}\n (base increase, attained when no script is running)\n \n }\n >\n \n \n );\n }\n\n function upgradeCoresOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCoreUpgrades(props.player, node, HacknetServerConstants.MaxCores);\n }\n purchaseCoreUpgrade(props.player, node, numUpgrades as number);\n rerender();\n }\n // Upgrade Cores Button\n let upgradeCoresButton;\n if (node.cores >= HacknetServerConstants.MaxCores) {\n upgradeCoresButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCoreUpgrades(props.player, node, HacknetServerConstants.MaxCores);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCores - node.cores;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const base_increase =\n calculateHashGainRate(\n node.level,\n 0,\n node.maxRam,\n node.cores + multiplier,\n props.player.mults.hacknet_node_money,\n ) - calculateHashGainRate(node.level, 0, node.maxRam, node.cores, props.player.mults.hacknet_node_money);\n const modded_increase = (base_increase * (node.maxRam - node.ramUsed)) / node.maxRam;\n\n const upgradeCoreCost = node.calculateCoreUpgradeCost(multiplier, props.player.mults.hacknet_node_core_cost);\n upgradeCoresButton = (\n \n + (effective increase, taking current RAM usage into account)\n
      \n \n +\n {\" \"}\n (base increase, attained when no script is running)\n \n }\n >\n \n \n );\n }\n\n // Upgrade Cache button\n let upgradeCacheButton;\n if (node.cache >= HacknetServerConstants.MaxCache) {\n upgradeCacheButton = ;\n } else {\n let multiplier = 0;\n if (purchaseMult === \"MAX\") {\n multiplier = getMaxNumberCacheUpgrades(props.player, node, HacknetServerConstants.MaxCache);\n } else {\n const levelsToMax = HacknetServerConstants.MaxCache - node.cache;\n multiplier = Math.min(levelsToMax, purchaseMult as number);\n }\n\n const increase = 32 * Math.pow(2, node.cache + multiplier) - node.hashCapacity;\n const upgradeCacheCost = node.calculateCacheUpgradeCost(multiplier);\n upgradeCacheButton = (\n \n + hashes\n \n }\n >\n \n \n );\n if (props.player.money < upgradeCacheCost) {\n } else {\n }\n }\n function upgradeCacheOnClick(): void {\n let numUpgrades = purchaseMult;\n if (purchaseMult === \"MAX\") {\n numUpgrades = getMaxNumberCacheUpgrades(props.player, node, HacknetServerConstants.MaxCache);\n }\n purchaseCacheUpgrade(props.player, node, numUpgrades as number);\n rerender();\n updateHashManagerCapacity(props.player);\n }\n\n return (\n \n \n \n \n \n {node.hostname}\n \n \n \n \n Production:\n \n \n \n hashes produced by this server since last augment\n installation.\n
      \n current production rate.\n
      \n \n \n {\" \"}\n max production rate. (achieved when 100% RAM is allocated to it)\n
      \n {numeralWrapper.formatRAM(node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * node.ramUsed) / node.maxRam)}%) RAM allocated to script.\n
      \n {numeralWrapper.formatRAM(node.maxRam - node.ramUsed)} / {numeralWrapper.formatRAM(node.maxRam)} (\n {Math.round((100 * (node.maxRam - node.ramUsed)) / node.maxRam)}%) RAM allocated to hash production.\n \n }\n >\n \n ()\n \n \n
      \n
      \n \n \n Hash Capacity:\n \n \n \n \n \n \n \n \n \n Level:\n \n \n {node.level}\n \n {upgradeLevelButton}\n \n \n \n RAM:\n \n \n {numeralWrapper.formatRAM(node.maxRam)}\n \n {upgradeRamButton}\n \n \n \n Cores:\n \n \n {node.cores}\n \n {upgradeCoresButton}\n \n \n \n Cache Level:\n \n \n {node.cache}\n \n {upgradeCacheButton}\n \n
      \n
      \n
      \n );\n}\n","/**\n * Create the pop-up for purchasing upgrades with hashes\n */\nimport React, { useState, useEffect } from \"react\";\n\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrades } from \"../HashUpgrades\";\n\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport { HacknetUpgradeElem } from \"./HacknetUpgradeElem\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport { use } from \"../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function HashUpgradeModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(() => setRerender((old) => !old), 200);\n return () => clearInterval(id);\n }, []);\n\n const hashManager = player.hashManager;\n if (!(hashManager instanceof HashManager)) {\n throw new Error(`Player does not have a HashManager)`);\n }\n\n return (\n \n <>\n Spend your hashes on a variety of different upgrades\n \n Hashes: \n \n {Object.keys(HashUpgrades).map((upgName) => {\n const upg = HashUpgrades[upgName];\n return (\n \n );\n })}\n \n \n );\n}\n","import React, { useState } from \"react\";\n\nimport { purchaseHashUpgrade } from \"../HacknetHelpers\";\nimport { HashManager } from \"../HashManager\";\nimport { HashUpgrade } from \"../HashUpgrade\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { ServerDropdown, ServerType } from \"../../ui/React/ServerDropdown\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { CopyableText } from \"../../ui/React/CopyableText\";\nimport { Hashes } from \"../../ui/React/Hashes\";\n\nimport Typography from \"@mui/material/Typography\";\nimport Paper from \"@mui/material/Paper\";\nimport Button from \"@mui/material/Button\";\nimport { SelectChangeEvent } from \"@mui/material/Select\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\n\ninterface IProps {\n player: IPlayer;\n hashManager: HashManager;\n upg: HashUpgrade;\n rerender: () => void;\n}\n\nconst serversMap: { [key: string]: string } = {};\n\nexport function HacknetUpgradeElem(props: IProps): React.ReactElement {\n const [selectedServer, setSelectedServer] = useState(\n serversMap[props.upg.name] ? serversMap[props.upg.name] : FactionNames.ECorp.toLowerCase(),\n );\n function changeTargetServer(event: SelectChangeEvent): void {\n setSelectedServer(event.target.value);\n serversMap[props.upg.name] = event.target.value;\n }\n\n function purchase(): void {\n const canPurchase = props.hashManager.hashes >= props.hashManager.getUpgradeCost(props.upg.name);\n if (canPurchase) {\n const res = purchaseHashUpgrade(props.player, props.upg.name, selectedServer);\n if (!res) {\n dialogBoxCreate(\n \"Failed to purchase upgrade. This may be because you do not have enough hashes, \" +\n \"or because you do not have access to the feature upgrade affects.\",\n );\n }\n props.rerender();\n }\n }\n\n const hashManager = props.hashManager;\n const upg = props.upg;\n const cost = hashManager.getUpgradeCost(upg.name);\n const level = hashManager.upgrades[upg.name];\n const effect = upg.effectText(level);\n\n // Purchase button\n const canPurchase = hashManager.hashes >= cost;\n\n // We'll reuse a Bladeburner css class\n return (\n \n \n \n \n \n Cost: , Bought: {level} times\n \n\n {upg.desc}\n {!upg.hasTargetServer && (\n \n )}\n {upg.hasTargetServer && (\n \n )}\n {level > 0 && effect && {effect}}\n \n );\n}\n","/**\n * React Component for the Multiplier buttons on the Hacknet page.\n * These buttons let the player control how many Nodes/Upgrades they're\n * purchasing when using the UI (x1, x5, x10, MAX)\n */\nimport React from \"react\";\n\nimport { PurchaseMultipliers } from \"../data/Constants\";\nimport Button from \"@mui/material/Button\";\n\ninterface IMultiplierProps {\n disabled: boolean;\n onClick: () => void;\n text: string;\n}\n\nfunction MultiplierButton(props: IMultiplierProps): React.ReactElement {\n return (\n \n );\n}\n\ninterface IProps {\n purchaseMultiplier: number | string;\n onClicks: (() => void)[];\n}\n\nexport function MultiplierButtons(props: IProps): React.ReactElement {\n if (props.purchaseMultiplier == null) {\n throw new Error(`MultiplierButtons constructed without required props`);\n }\n\n const mults = [\"x1\", \"x5\", \"x10\", \"MAX\"];\n const onClicks = props.onClicks;\n const buttons = [];\n for (let i = 0; i < mults.length; ++i) {\n const mult = mults[i];\n const btnProps = {\n disabled: props.purchaseMultiplier === PurchaseMultipliers[mult],\n onClick: onClicks[i],\n text: mult,\n };\n\n buttons.push();\n }\n\n return <>{buttons};\n}\n","/**\n * React Component for displaying Player info and stats on the Hacknet Node UI.\n * This includes:\n * - Player's money\n * - Player's production from Hacknet Nodes\n */\nimport React from \"react\";\n\nimport { hasHacknetServers } from \"../HacknetHelpers\";\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { Money } from \"../../ui/React/Money\";\nimport { MoneyRate } from \"../../ui/React/MoneyRate\";\nimport { HashRate } from \"../../ui/React/HashRate\";\nimport { Hashes } from \"../../ui/React/Hashes\";\nimport Typography from \"@mui/material/Typography\";\n\ninterface IProps {\n totalProduction: number;\n player: IPlayer;\n}\n\nexport function PlayerInfo(props: IProps): React.ReactElement {\n const hasServers = hasHacknetServers(props.player);\n\n let prod;\n if (hasServers) {\n prod = ;\n } else {\n prod = ;\n }\n\n return (\n <>\n \n Money:\n \n \n\n {hasServers && (\n <>\n \n Hashes: /{\" \"}\n \n \n \n )}\n\n \n Total Hacknet {hasServers ? \"Server\" : \"Node\"} Production: {prod}\n \n \n );\n}\n","/**\n * React Component for the button that is used to purchase new Hacknet Nodes\n */\nimport React from \"react\";\n\nimport { hasHacknetServers, hasMaxNumberHacknetServers } from \"../HacknetHelpers\";\nimport { Player } from \"../../Player\";\nimport { Money } from \"../../ui/React/Money\";\n\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n multiplier: number | string;\n onClick: () => void;\n cost: number;\n}\n\nexport function PurchaseButton(props: IProps): React.ReactElement {\n const cost = props.cost;\n let text;\n if (hasHacknetServers(Player)) {\n if (hasMaxNumberHacknetServers(Player)) {\n text = <>Hacknet Server limit reached;\n } else {\n text = (\n <>\n Purchase Hacknet Server - \n \n \n );\n }\n } else {\n text = (\n <>\n Purchase Hacknet Node - \n \n \n );\n }\n\n return (\n \n );\n}\n","/**\n * React Component for displaying a location's UI\n *\n * This is a \"router\" component of sorts, meaning it deduces the type of\n * location that is being rendered and then creates the proper component(s) for that.\n */\nimport * as React from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { CompanyLocation } from \"./CompanyLocation\";\nimport { GymLocation } from \"./GymLocation\";\nimport { HospitalLocation } from \"./HospitalLocation\";\nimport { SlumsLocation } from \"./SlumsLocation\";\nimport { SpecialLocation } from \"./SpecialLocation\";\nimport { TechVendorLocation } from \"./TechVendorLocation\";\nimport { TravelAgencyRoot } from \"./TravelAgencyRoot\";\nimport { UniversityLocation } from \"./UniversityLocation\";\nimport { CasinoLocation } from \"./CasinoLocation\";\n\nimport { Location } from \"../Location\";\nimport { LocationType } from \"../LocationTypeEnum\";\n\nimport { Settings } from \"../../Settings/Settings\";\n\nimport { isBackdoorInstalled } from \"../../Server/ServerHelpers\";\nimport { GetServer } from \"../../Server/AllServers\";\n\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { use } from \"../../ui/Context\";\nimport { serverMetadata } from \"../../Server/data/servers\";\nimport { Tooltip } from \"@mui/material\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function GenericLocation({ loc }: IProps): React.ReactElement {\n const router = use.Router();\n const player = use.Player();\n /**\n * Determine what needs to be rendered for this location based on the locations\n * type. Returns an array of React components that should be rendered\n */\n function getLocationSpecificContent(): React.ReactNode[] {\n const content: React.ReactNode[] = [];\n\n if (loc.types.includes(LocationType.Company)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Gym)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Hospital)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Slums)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Special)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.TechVendor)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.TravelAgency)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.University)) {\n content.push();\n }\n\n if (loc.types.includes(LocationType.Casino)) {\n content.push();\n }\n\n return content;\n }\n\n const locContent: React.ReactNode[] = getLocationSpecificContent();\n const serverMeta = serverMetadata.find((s) => s.specialName === loc.name);\n const server = GetServer(serverMeta ? serverMeta.hostname : \"\");\n\n const backdoorInstalled = server !== null && isBackdoorInstalled(server);\n\n return (\n <>\n \n \n {backdoorInstalled && !Settings.DisableTextEffects ? (\n \n \n \n \n \n ) : (\n loc.name\n )}\n \n {locContent}\n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a company\n *\n * This subcomponent renders all of the buttons for applying to jobs at a company\n */\nimport React, { useState, useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\nimport Box from \"@mui/material/Box\";\n\nimport { ApplyToJobButton } from \"./ApplyToJobButton\";\n\nimport { Locations } from \"../Locations\";\nimport { LocationName } from \"../data/LocationNames\";\n\nimport { Companies } from \"../../Company/Companies\";\nimport { CompanyPosition } from \"../../Company/CompanyPosition\";\nimport { CompanyPositions } from \"../../Company/CompanyPositions\";\nimport * as posNames from \"../../Company/data/companypositionnames\";\n\nimport { Reputation } from \"../../ui/React/Reputation\";\nimport { Favor } from \"../../ui/React/Favor\";\nimport { use } from \"../../ui/Context\";\nimport { QuitJobModal } from \"../../Company/ui/QuitJobModal\";\nimport { CompanyWork } from \"../../Work/CompanyWork\";\n\ntype IProps = {\n locName: LocationName;\n};\n\nexport function CompanyLocation(props: IProps): React.ReactElement {\n const p = use.Player();\n const router = use.Router();\n const [quitOpen, setQuitOpen] = useState(false);\n const setRerender = useState(false)[1];\n function rerender(): void {\n setRerender((old) => !old);\n }\n\n useEffect(() => {\n const id = setInterval(rerender, 200);\n return () => clearInterval(id);\n }, []);\n /**\n * We'll keep a reference to the Company that this component is being rendered for,\n * so we don't have to look it up every time\n */\n const company = Companies[props.locName];\n if (company == null) throw new Error(`CompanyLocation component constructed with invalid company: ${props.locName}`);\n\n /**\n * Reference to the Location that this component is being rendered for\n */\n const location = Locations[props.locName];\n if (location == null) {\n throw new Error(`CompanyLocation component constructed with invalid location: ${props.locName}`);\n }\n\n /**\n * Name of company position that player holds, if applicable\n */\n const jobTitle = p.jobs[props.locName] ? p.jobs[props.locName] : null;\n\n /**\n * CompanyPosition object for the job that the player holds at this company\n * (if he has one)\n */\n const companyPosition = jobTitle ? CompanyPositions[jobTitle] : null;\n\n p.location = props.locName;\n\n function applyForAgentJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForAgentJob();\n rerender();\n }\n\n function applyForBusinessConsultantJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForBusinessConsultantJob();\n rerender();\n }\n\n function applyForBusinessJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForBusinessJob();\n rerender();\n }\n\n function applyForEmployeeJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForEmployeeJob();\n rerender();\n }\n\n function applyForItJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForItJob();\n rerender();\n }\n\n function applyForPartTimeEmployeeJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForPartTimeEmployeeJob();\n rerender();\n }\n\n function applyForPartTimeWaiterJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForPartTimeWaiterJob();\n rerender();\n }\n\n function applyForSecurityJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSecurityJob();\n rerender();\n }\n\n function applyForSoftwareConsultantJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSoftwareConsultantJob();\n rerender();\n }\n\n function applyForSoftwareJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForSoftwareJob();\n rerender();\n }\n\n function applyForWaiterJob(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n p.applyForWaiterJob();\n rerender();\n }\n\n function startInfiltration(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n const loc = location;\n if (!loc.infiltrationData)\n throw new Error(`trying to start infiltration at ${props.locName} but the infiltrationData is null`);\n\n router.toInfiltration(loc);\n }\n\n function work(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n\n const pos = companyPosition;\n if (pos instanceof CompanyPosition) {\n p.startWork(\n new CompanyWork({\n singularity: false,\n companyName: props.locName,\n }),\n );\n p.startFocusing();\n router.toWork();\n }\n }\n\n const isEmployedHere = jobTitle != null;\n const favorGain = company.getFavorGain();\n\n return (\n <>\n {isEmployedHere && (\n <>\n Job Title: {jobTitle}\n -------------------------\n \n \n You will have company favor upon resetting after\n installing Augmentations\n \n }\n >\n \n Company reputation: \n \n \n \n -------------------------\n \n \n Company favor increases the rate at which you earn reputation for this company by 1% per favor.\n Company favor is gained whenever you reset after installing Augmentations. The amount of favor you\n gain depends on how much reputation you have with the company.\n \n }\n >\n \n Company Favor: \n \n \n \n -------------------------\n
      \n \n )}\n \n {isEmployedHere && (\n \n \n \n setQuitOpen(false)}\n />\n \n )}\n {company.hasAgentPositions() && (\n \n )}\n {company.hasBusinessConsultantPositions() && (\n \n )}\n {company.hasBusinessPositions() && (\n \n )}\n {company.hasEmployeePositions() && (\n \n )}\n {company.hasEmployeePositions() && (\n \n )}\n {company.hasITPositions() && (\n \n )}\n {company.hasSecurityPositions() && (\n \n )}\n {company.hasSoftwareConsultantPositions() && (\n \n )}\n {company.hasSoftwarePositions() && (\n \n )}\n {company.hasWaiterPositions() && (\n \n )}\n {company.hasWaiterPositions() && (\n \n )}\n {location.infiltrationData != null && }\n \n \n );\n}\n","import React from \"react\";\nimport { Company } from \"../Company\";\nimport { use } from \"../../ui/Context\";\nimport { Modal } from \"../../ui/React/Modal\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n locName: string;\n company: Company;\n onQuit: () => void;\n}\n\nexport function QuitJobModal(props: IProps): React.ReactElement {\n const player = use.Player();\n function quit(): void {\n player.quitJob(props.locName);\n props.onQuit();\n props.onClose();\n }\n\n return (\n \n Would you like to quit your job at {props.company.name}?\n
      \n
      \n \n
      \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a gym\n *\n * This subcomponent renders all of the buttons for training at the gym\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\n\nimport { Money } from \"../../ui/React/Money\";\nimport { IRouter } from \"../../ui/Router\";\nimport { Box } from \"@mui/material\";\nimport { ClassWork, ClassType, Classes } from \"../../Work/ClassWork\";\nimport { calculateCost } from \"../../Work/formulas/Class\";\n\ntype IProps = {\n loc: Location;\n p: IPlayer;\n router: IRouter;\n};\n\nexport function GymLocation(props: IProps): React.ReactElement {\n function train(stat: ClassType): void {\n props.p.startWork(\n new ClassWork({\n classType: stat,\n location: props.loc.name,\n singularity: false,\n }),\n );\n props.p.startFocusing();\n props.router.toWork();\n }\n\n const cost = calculateCost(Classes[ClassType.GymStrength], props.loc);\n\n return (\n \n \n \n \n \n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a hospital\n *\n * This subcomponent renders all of the buttons for hospital options\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\n\nimport { IPlayer } from \"../../PersonObjects/IPlayer\";\nimport { getHospitalizationCost } from \"../../Hospital/Hospital\";\n\nimport { Money } from \"../../ui/React/Money\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\n\ntype IProps = {\n p: IPlayer;\n};\n\ntype IState = {\n currHp: number;\n};\n\nexport class HospitalLocation extends React.Component {\n /**\n * Stores button styling that sets them all to block display\n */\n btnStyle = { display: \"block\" };\n\n constructor(props: IProps) {\n super(props);\n\n this.getCost = this.getCost.bind(this);\n this.getHealed = this.getHealed.bind(this);\n\n this.state = {\n currHp: this.props.p.hp.current,\n };\n }\n\n getCost(): number {\n return getHospitalizationCost(this.props.p);\n }\n\n getHealed(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n\n if (this.props.p.hp.current < 0) {\n this.props.p.hp.current = 0;\n }\n if (this.props.p.hp.current >= this.props.p.hp.max) {\n return;\n }\n\n const cost = this.getCost();\n this.props.p.loseMoney(cost, \"hospitalization\");\n this.props.p.hp.current = this.props.p.hp.max;\n\n // This just forces a re-render to update the cost\n this.setState({\n currHp: this.props.p.hp.current,\n });\n\n dialogBoxCreate(\n <>\n You were healed to full health! The hospital billed you for \n ,\n );\n }\n\n render(): React.ReactNode {\n const cost = this.getCost();\n\n return (\n \n );\n }\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location is a slum\n *\n * This subcomponent renders all of the buttons for committing crimes\n */\nimport * as React from \"react\";\nimport Button from \"@mui/material/Button\";\nimport Tooltip from \"@mui/material/Tooltip\";\n\nimport { Crimes } from \"../../Crime/Crimes\";\n\nimport { numeralWrapper } from \"../../ui/numeralFormat\";\nimport { use } from \"../../ui/Context\";\nimport { Box } from \"@mui/material\";\n\nexport function SlumsLocation(): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n function shoplift(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Shoplift.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function robStore(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.RobStore.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function mug(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Mug.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function larceny(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Larceny.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function dealDrugs(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.DealDrugs.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function bondForgery(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.BondForgery.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function traffickArms(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.TraffickArms.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function homicide(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Homicide.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function grandTheftAuto(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.GrandTheftAuto.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function kidnap(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Kidnap.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function assassinate(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Assassination.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n function heist(e: React.MouseEvent): void {\n if (!e.isTrusted) {\n return;\n }\n Crimes.Heist.commit(player);\n router.toWork();\n player.focus = true;\n }\n\n const shopliftChance = Crimes.Shoplift.successRate(player);\n const robStoreChance = Crimes.RobStore.successRate(player);\n const mugChance = Crimes.Mug.successRate(player);\n const larcenyChance = Crimes.Larceny.successRate(player);\n const drugsChance = Crimes.DealDrugs.successRate(player);\n const bondChance = Crimes.BondForgery.successRate(player);\n const armsChance = Crimes.TraffickArms.successRate(player);\n const homicideChance = Crimes.Homicide.successRate(player);\n const gtaChance = Crimes.GrandTheftAuto.successRate(player);\n const kidnapChance = Crimes.Kidnap.successRate(player);\n const assassinateChance = Crimes.Assassination.successRate(player);\n const heistChance = Crimes.Heist.successRate(player);\n\n return (\n \n Attempt to shoplift from a low-end retailer}>\n \n \n Attempt to commit armed robbery on a high-end store}>\n \n \n Attempt to mug a random person on the street}>\n \n \n Attempt to rob property from someone's house}>\n \n \n Attempt to deal drugs}>\n \n \n Attempt to forge corporate bonds}>\n \n \n Attempt to smuggle illegal arms into the city}>\n \n \n Attempt to murder a random person on the street}>\n \n \n Attempt to commit grand theft auto}>\n \n \n Attempt to kidnap and ransom a high-profile-target}>\n \n \n Attempt to assassinate a high-profile target}>\n \n \n Attempt to pull off the ultimate heist}>\n \n \n \n );\n}\n","/**\n * React Subcomponent for displaying a location's UI, when that location has special\n * actions/options/properties\n *\n * Examples:\n * - Bladeburner @ NSA\n * - Re-sleeving @ VitaLife\n * - Create Corporation @ City Hall\n *\n * This subcomponent creates all of the buttons for interacting with those special\n * properties\n */\nimport React, { useState } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\n\nimport { Location } from \"../Location\";\nimport { CreateCorporationModal } from \"../../Corporation/ui/modals/CreateCorporationModal\";\nimport { LocationName } from \"../data/LocationNames\";\nimport { AugmentationNames } from \"../../Augmentation/data/AugmentationNames\";\nimport { Factions } from \"../../Faction/Factions\";\nimport { joinFaction } from \"../../Faction/FactionHelpers\";\n\nimport { use } from \"../../ui/Context\";\n\nimport { dialogBoxCreate } from \"../../ui/React/DialogBox\";\nimport { SnackbarEvents, ToastVariant } from \"../../ui/React/Snackbar\";\nimport { N00dles } from \"../../utils/helpers/N00dles\";\nimport { Exploit } from \"../../Exploits/Exploit\";\nimport { applyAugmentation } from \"../../Augmentation/AugmentationHelpers\";\nimport { CorruptableText } from \"../../ui/React/CorruptableText\";\nimport { HacknetNode } from \"../../Hacknet/HacknetNode\";\nimport { HacknetServer } from \"../../Hacknet/HacknetServer\";\nimport { GetServer } from \"../../Server/AllServers\";\nimport { ArcadeRoot } from \"../../Arcade/ui/ArcadeRoot\";\nimport { FactionNames } from \"../../Faction/data/FactionNames\";\nimport { BitNodeMultipliers } from \"../../BitNode/BitNodeMultipliers\";\n\ntype IProps = {\n loc: Location;\n};\n\nexport function SpecialLocation(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const setRerender = useState(false)[1];\n const inBladeburner = player.inBladeburner();\n\n /**\n * Click handler for Bladeburner button at Sector-12 NSA\n */\n function handleBladeburner(): void {\n const p = player;\n if (p.inBladeburner()) {\n // Enter Bladeburner division\n router.toBladeburner();\n } else if (\n p.skills.strength >= 100 &&\n p.skills.defense >= 100 &&\n p.skills.dexterity >= 100 &&\n p.skills.agility >= 100\n ) {\n // Apply for Bladeburner division\n p.startBladeburner();\n dialogBoxCreate(\"You have been accepted into the Bladeburner division!\");\n setRerender((old) => !old);\n\n const worldHeader = document.getElementById(\"world-menu-header\");\n if (worldHeader instanceof HTMLElement) {\n worldHeader.click();\n worldHeader.click();\n }\n } else {\n dialogBoxCreate(\"Rejected! Please apply again when you have 100 of each combat stat (str, def, dex, agi)\");\n }\n }\n\n /**\n * Click handler for Resleeving button at New Tokyo VitaLife\n */\n function handleGrafting(): void {\n router.toGrafting();\n }\n\n function renderBladeburner(): React.ReactElement {\n if (!player.canAccessBladeburner()) {\n return <>;\n }\n const text = inBladeburner ? \"Enter Bladeburner Headquarters\" : \"Apply to Bladeburner Division\";\n return (\n <>\n
      \n \n \n );\n }\n\n function renderNoodleBar(): React.ReactElement {\n function EatNoodles(): void {\n SnackbarEvents.emit(\"You ate some delicious noodles and feel refreshed\", ToastVariant.SUCCESS, 2000);\n N00dles(); // This is the true power of the noodles.\n if (player.sourceFiles.length > 0) player.giveExploit(Exploit.N00dles);\n if (player.sourceFileLvl(5) > 0 || player.bitNodeN === 5) {\n player.exp.intelligence *= 1.0000000000000002;\n }\n player.exp.hacking *= 1.0000000000000002;\n player.exp.strength *= 1.0000000000000002;\n player.exp.defense *= 1.0000000000000002;\n player.exp.agility *= 1.0000000000000002;\n player.exp.dexterity *= 1.0000000000000002;\n player.exp.charisma *= 1.0000000000000002;\n for (const node of player.hacknetNodes) {\n if (node instanceof HacknetNode) {\n player.gainMoney(node.moneyGainRatePerSecond * 0.001, \"other\");\n } else {\n const server = GetServer(node);\n if (!(server instanceof HacknetServer)) throw new Error(`Server ${node} is not a hacknet server.`);\n player.hashManager.storeHashes(server.hashRate * 0.001);\n }\n }\n\n if (player.bladeburner) {\n player.bladeburner.rank += 0.00001;\n }\n\n if (player.corporation) {\n player.corporation.funds += player.corporation.revenue * 0.01;\n }\n }\n\n return (\n <>\n
      \n \n \n );\n }\n\n function CreateCorporation(): React.ReactElement {\n const [open, setOpen] = useState(false);\n if (!player.canAccessCorporation()) {\n return (\n <>\n \n A businessman is yelling at a clerk. You should come back later.\n \n \n );\n }\n return (\n <>\n \n setOpen(false)} />\n \n );\n }\n\n function renderGrafting(): React.ReactElement {\n if (!player.canAccessGrafting()) {\n return <>;\n }\n return (\n \n );\n }\n\n function handleCotMG(): void {\n const faction = Factions[FactionNames.ChurchOfTheMachineGod];\n if (!player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n joinFaction(faction);\n }\n if (\n !player.augmentations.some((a) => a.name === AugmentationNames.StaneksGift1) &&\n !player.queuedAugmentations.some((a) => a.name === AugmentationNames.StaneksGift1)\n ) {\n applyAugmentation({ name: AugmentationNames.StaneksGift1, level: 1 });\n }\n\n router.toStaneksGift();\n }\n\n function renderCotMG(): React.ReactElement {\n const toStanek = ;\n // prettier-ignore\n const symbol = \n {\" `` \"}
      \n {\" -odmmNmds: \"}
      \n {\" `hNmo:..-omNh. \"}
      \n {\" yMd` `hNh \"}
      \n {\" mMd oNm \"}
      \n {\" oMNo .mM/ \"}
      \n {\" `dMN+ -mM+ \"}
      \n {\" -mMNo -mN+ \"}
      \n {\" .+- :mMNo/mN/ \"}
      \n {\":yNMd. :NMNNN/ \"}
      \n {\"-mMMMh. /NMMh` \"}
      \n {\" .dMMMd. /NMMMy` \"}
      \n {\" `yMMMd. /NNyNMMh` \"}
      \n {\" `sMMMd. +Nm: +NMMh. \"}
      \n {\" oMMMm- oNm: /NMMd. \"}
      \n {\" +NMMmsMm- :mMMd. \"}
      \n {\" /NMMMm- -mMMd. \"}
      \n {\" /MMMm- -mMMd. \"}
      \n {\" `sMNMMm- .mMmo \"}
      \n {\" `sMd:hMMm. ./. \"}
      \n {\" `yMy` `yNMd` \"}
      \n {\" `hMs` oMMy \"}
      \n {\" `hMh sMN- \"}
      \n {\" /MM- .NMo \"}
      \n {\" +MM: :MM+ \"}
      \n {\" sNNo-.`.-omNy` \"}
      \n {\" -smNNNNmdo- \"}
      \n {\" `..` \"}
      \n if (player.hasAugmentation(AugmentationNames.StaneksGift3, true)) {\n return (\n <>\n \n \n Allison \"Mother\" Stanek: ..can ...you hear them too ...? Come now, don't be shy and let me get a closer\n look at you. Yes wonderful, I see my creation has taken root without consquence or much ill effect it\n seems. Curious, Just how much of a machine's soul do you house in that body?\n \n \n
      \n {toStanek}\n
      \n {symbol}\n \n );\n }\n if (player.hasAugmentation(AugmentationNames.StaneksGift2, true)) {\n return (\n <>\n \n \n Allison \"Mother\" Stanek: I see you've taken to my creation. So much that it could hardly be recognized as\n one of my own after your tinkering with it. I see you follow the ways of the Machine God as I do, and your\n mastery of the gift clearly demonstrates that. My hopes are climbing by the day for you.\n \n \n
      \n {toStanek}\n
      \n {symbol}\n \n );\n }\n if (player.factions.includes(FactionNames.ChurchOfTheMachineGod)) {\n return (\n <>\n \n Allison \"Mother\" Stanek: Welcome back my child!\n \n
      \n {toStanek}\n
      \n {symbol}\n \n );\n }\n\n if (!player.canAccessCotMG()) {\n return (\n <>\n \n A decrepit altar stands in the middle of a dilapidated church.\n
      \n
      A symbol is carved in the altar.\n
      \n
      \n {symbol}\n \n );\n }\n\n if (\n player.augmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0 ||\n player.queuedAugmentations.filter((a) => a.name !== AugmentationNames.NeuroFluxGovernor).length > 0\n ) {\n return (\n <>\n \n \n Allison \"Mother\" Stanek: Begone you filth! My gift must be the first modification that your body should\n have!\n \n \n \n );\n }\n\n return (\n <>\n \n \n Allison \"Mother\" Stanek: Welcome child, I see your body is pure. Are you ready to ascend beyond our human\n form? If you are, accept my gift.\n \n \n \n {symbol}\n \n );\n }\n\n function renderGlitch(): React.ReactElement {\n return (\n <>\n \n \n \n \n );\n }\n\n switch (props.loc.name) {\n case LocationName.NewTokyoVitaLife: {\n return renderGrafting();\n }\n case LocationName.Sector12CityHall: {\n return (BitNodeMultipliers.CorporationSoftcap < 0.15 && <>) || ;\n }\n case LocationName.Sector12NSA: {\n return renderBladeburner();\n }\n case LocationName.NewTokyoNoodleBar: {\n return renderNoodleBar();\n }\n case LocationName.ChongqingChurchOfTheMachineGod: {\n return renderCotMG();\n }\n case LocationName.IshimaGlitch: {\n return renderGlitch();\n }\n case LocationName.NewTokyoArcade: {\n return ;\n }\n default:\n console.error(`Location ${props.loc.name} doesn't have any special properties`);\n return <>;\n }\n}\n","import React, { useState } from \"react\";\n\nimport { Money } from \"../../../ui/React/Money\";\nimport { Modal } from \"../../../ui/React/Modal\";\nimport { use } from \"../../../ui/Context\";\nimport Typography from \"@mui/material/Typography\";\nimport Button from \"@mui/material/Button\";\nimport TextField from \"@mui/material/TextField\";\n\ninterface IProps {\n open: boolean;\n onClose: () => void;\n}\n\nexport function CreateCorporationModal(props: IProps): React.ReactElement {\n const player = use.Player();\n const router = use.Router();\n const canSelfFund = player.canAfford(150e9);\n if (!player.canAccessCorporation() || player.hasCorporation()) {\n props.onClose();\n return <>;\n }\n\n const [name, setName] = useState(\"\");\n function onChange(event: React.ChangeEvent): void {\n setName(event.target.value);\n }\n\n function selfFund(): void {\n if (!canSelfFund) {\n return;\n }\n\n if (name == \"\") {\n return;\n }\n\n player.startCorporation(name);\n player.loseMoney(150e9, \"corporation\");\n\n props.onClose();\n router.toCorporation();\n }\n\n function seed(): void {\n if (name == \"\") {\n return;\n }\n\n player.startCorporation(name, 500e6);\n\n props.onClose();\n router.toCorporation();\n }\n\n return (\n \n \n Would you like to start a corporation? This will require $150b for registration and initial funding.{\" \"}\n {player.bitNodeN === 3 &&\n `This $150b\n can either be self-funded, or you can obtain the seed money from the government in exchange for 500 million\n shares`}\n
      \n
      \n If you would like to start one, please enter a name for your corporation below:\n
      \n \n {player.bitNodeN === 3 && (\n \n )}\n \n
      \n );\n}\n","const n00dlePower =\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(\" +\n \"!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]\" +\n \"+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+\" +\n \"[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[\" +\n \"])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!\" +\n \"+[]]+([][[]]+[])[+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()[+!+\" +\n \"[]+[!+[]+!+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[\" +\n \"])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+\" +\n \"(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+\" +\n \"[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+\" +\n \"!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]\" +\n \"]]+![]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]\" +\n \"]()[+!+[]+[+[]]])()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[\" +\n \"+[]]]+(!![]+[])[+!+[]]]((![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(\" +\n \"![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[]\" +\n \")[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])+[])[+!+[]]+[+!+[]]+[+!+[]]+[!+[]+!+[]+!+[]+!+\" +\n \"[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!\" +\n \"![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(\" +\n \"![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[\" +\n \"])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+\" +\n \"[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[\" +\n \"])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[]\" +\n \")[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[\" +\n \"]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[\" +\n \"]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[]\" +\n \")[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(+(!+[]+!+[]+[+!+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!\" +\n \"+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]\" +\n \"]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]\" +\n \"]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+(\" +\n \"[][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[\" +\n \"+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+\" +\n \"[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[\" +\n \"]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+\" +\n \"(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[]\" +\n \")[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]]\" +\n \"(!+[]+!+[]+!+[]+[+!+[]])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]])()([][(![]+[])[+[]]+(!\" +\n \"[]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[(![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]]\" +\n \"((+((+(+!+[]+[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+[!+[]+!+[]]+[+[]])+[])[+!+[]]+[+[\" +\n \"]+[+[]]+[+[]]+[+[]]+[+[]]+[+[]]+[+!+[]]])+[])[!+[]+!+[]]+[+!+[]])+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]])()())[!+[]+!+[]+!+[]+[+[]]]+(+[]+[][(\" +\n \"[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+\" +\n \"[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!!\" +\n \"[]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]\" +\n \"]])[+!+[]+[+[]]]+(+[]+[][(!![]+[])[!+[]+!+[]+!+[]]+([][[]]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]\" +\n \"+[])[!+[]+!+[]+!+[]]]()[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!\" +\n \"![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]\" +\n \"+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]\" +\n \"+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+\" +\n \"[]+[+[]]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]\" +\n \"+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+!+[]]+([\" +\n \"![]]+[][[]])[+!+[]+[+[]]]+([][[]]+[])[!+[]+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[\" +\n \"])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(+[![]]+[+(+!+[]+(\" +\n \"!+[]+[])[!+[]+!+[]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(!![]+[][(![]\" +\n \"+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][\" +\n \"[]]+[])[+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[!+[]+!+[]]+(+[![]]+[+(+!+[]+(!+[]+[])[!+[]+!+[\" +\n \"]+!+[]]+[+!+[]]+[+[]]+[+[]]+[+[]])])[+!+[]+[+[]]]+(+[![]]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+([][[]]+[])[!+[]+\" +\n \"!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(![]+[])[+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]\" +\n \"+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(+(!+[]\" +\n \"+!+[]+[+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])\" +\n \"[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+\" +\n \"[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(\" +\n \"![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+\" +\n \"[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([\" +\n \"][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[\" +\n \"]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!\" +\n \"+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]\" +\n \"]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]\" +\n \"+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]\" +\n \"]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(!\" +\n \"[]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!\" +\n \"![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]]\" +\n \")+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[\" +\n \"+!+[]+[+!+[]]]+(!![]+[])[+[]]+(+(+!+[]+[+[]]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![\" +\n \"]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![\" +\n \"]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[]\" +\n \")[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[\" +\n \"])[+!+[]]][([][[]]+[])[+!+[]]+(![]+[])[+!+[]]+((+[])[([][(![]+[])[+[]]+(![]+[])[\" +\n \"!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+\" +\n \"[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[\" +\n \"+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!\" +\n \"+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[]\" +\n \")[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]+[])[+!+[]+[+!+[]]]+(!![\" +\n \"]+[])[!+[]+!+[]+!+[]]]](!+[]+!+[]+[+!+[]])[+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(!\" +\n \"[]+[])[!+[]+!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!!\" +\n \"[]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]\" +\n \"]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]\" +\n \"]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![\" +\n \"]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[\" +\n \"]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]\" +\n \"+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+\" +\n \"[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])\" +\n \"[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]\" +\n \"+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+\" +\n \"[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!\" +\n \"+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])\" +\n \"[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[\" +\n \"])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]\" +\n \"+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+\" +\n \"[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]()\" +\n \"+[])[!+[]+!+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[\" +\n \"+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[\" +\n \"!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]\" +\n \"+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+\" +\n \"[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]\" +\n \"+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[]\" +\n \")[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[\" +\n \"+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(![]+[+[]])[([![]]+[][[]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])[+!+[]+[+[]]]+\" +\n \"([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!\" +\n \"+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]]+![]+(![]+[+[]])[([![]]+[][[]]\" +\n \")[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+([![]]+[][[]])\" +\n \"[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[\" +\n \"]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]])()[([][(![]+[])\" +\n \"[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!\" +\n \"![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+\" +\n \"[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[\" +\n \"]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+\" +\n \"[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[\" +\n \"]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((![]+[+[\" +\n \"]])[([![]]+[][[]])[+!+[]+[+[]]]+(!![]+[])[+[]]+(![]+[])[+!+[]]+(![]+[])[!+[]+!+[\" +\n \"]]+([![]]+[][[]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!\" +\n \"+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(![]+[])[!+[]+!+[]+!+[]]]()[+!+[]+[+[]]\" +\n \"])+[])[+!+[]]+[!+[]+!+[]+!+[]+!+[]]+[!+[]+!+[]]+([]+[])[(![]+[])[+[]]+(!![]+[][(\" +\n \"![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(\" +\n \"[][[]]+[])[+!+[]]+(!![]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[\" +\n \"+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+\" +\n \"!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[]\" +\n \"[(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]\" +\n \"+(!![]+[])[+!+[]]]()[+!+[]+[!+[]+!+[]]])()\";\n\nexport function N00dles(): void {\n // TODO: Too powerful, needs a nerf.\n eval(n00dlePower);\n}\n","import React, { useState } from \"react\";\nimport { BBCabinetRoot } from \"./BBCabinet\";\n\nimport Button from \"@mui/material/Button\";\nimport { use } from \"../../ui/Context\";\nimport { AlertEvents } from \"../../ui/React/AlertManager\";\n\nenum Page {\n None,\n Megabyteburner2000,\n}\n\nexport function ArcadeRoot(): React.ReactElement {\n const player = use.Player();\n const [page, setPage] = useState(Page.None);\n\n function mbBurner2000(): void {\n if (player.sourceFileLvl(1) === 0) {\n AlertEvents.emit(\"This machine is broken.\");\n } else {\n setPage(Page.Megabyteburner2000);\n }\n }\n\n if (page === Page.None) {\n return (\n <>\n \n \n );\n }\n let currentGame = <>;\n switch (page) {\n case Page.Megabyteburner2000:\n currentGame = ;\n }\n return (\n <>\n \n {currentGame}\n \n );\n}\n","import React, { useEffect } from \"react\";\nimport Typography from \"@mui/material/Typography\";\nimport { use } from \"../../ui/Context\";\nimport { Exploit } from \"../../Exploits/Exploit\";\n\nconst metaBB = \"https://bitburner-official.github.io/bitburner-legacy/\";\n\nconst style = {\n width: \"1060px\",\n height: \"800px\",\n border: \"0px\",\n};\n\nexport function BBCabinetRoot(): React.ReactElement {\n const player = use.Player();\n useEffect(() => {\n window.addEventListener(\"message\", function (this: Window, ev: MessageEvent) {\n if (ev.isTrusted && ev.origin == \"https://bitburner-official.github.io\" && ev.data) {\n player.giveExploit(Exploit.TrueRecursion);\n }\n });\n });\n // prettier-ignore\n const joystick =\n <>\n \n ,'\" \"', .-. \n / \\ ( ) \n | | .-. '-' .-. \n \\ / ( ) ( )\n '.___.' '-' .-. '-'\n ||| ( ) \n ||| '-' \n ;\n return (\n <>\n \n